本地为 windows 系统,在开了 -std=c++14 的情况下一些代码不会 CE,但提交后会 CE。
#include<bits/stdc++.h>
#define int long long
#define inf 0x3f3f3f3f3f3f3f3f
using namespace std;
signed main(){
int x;
cin>>x;
cout<<min(x,inf);
}
#include <bits/stdc++.h>
using namespace std;
inline read(){
int res=0;
char c;
do{
c=getchar();
}while(!isdigit(c)&&c!='-');
while(isdigit(c)){
res=res*10+c-'0';
c=getchar();
}
return res;
}
signed main(){
int n,res=0;
n=read();
for(int i=1;i<=n;i++){
int x=read();
res+=x;
}
cout<<res;
}
本地用的 dev C++。