为什么我的程序在编译后第一次运行时会很慢?
  • 板块灌水区
  • 楼主Augury
  • 当前回复15
  • 已保存回复15
  • 发布时间2023/10/6 15:39
  • 上次更新2023/11/2 15:14:48
查看原帖
为什么我的程序在编译后第一次运行时会很慢?
401461
Augury楼主2023/10/6 15:39

rt,萌新的编辑器为 VSCode,编译指令如下:

g++ -O2 -Wall -Wextra '-Wl,-stack=134217728' -std=c++20 \"$fileName\" -o \"$fileNameWithoutExt.exe\" -fexec-charset=GBK

代码如下:

#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int ans=0;bool op=0;char ch=getchar();
	while(ch<'0'||'9'<ch){if(ch=='-')op=1;ch=getchar();}
	while('0'<=ch&&ch<='9'){ans=(ans<<1)+(ans<<3)+(ch^48);ch=getchar();}
	if(op)return -ans;
	return ans;
}
signed main(){
	cout<<read()+read();
	return 0;
}

求大佬解答/kk

2023/10/6 15:39
加载中...