关于 CSP-S 的编译
  • 板块灌水区
  • 楼主cincout001_wii
  • 当前回复2
  • 已保存回复2
  • 发布时间2024/10/31 19:56
  • 上次更新2024/10/31 22:06:39
查看原帖
关于 CSP-S 的编译
1302197
cincout001_wii楼主2024/10/31 19:56

下面的代码能否通过 CCF 的编译:

#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,a[1000001];
void work(){
	cin>>n;
	for(int i=1;i<=n;++i){
		cin>>a[i];
	}
	sort(a+1,a+1+n);
	int curr=1,ans=n;
	for(int i=2;i<=n;++i){
		if(a[i]>a[curr]){
			curr++;
			ans--;
		}
	}
	cout<<ans<<"\n";
}
signed main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int T=1;
//	cin>>T;
	while(T--){
		work();
	}
	return 0;
}

有人说 #define int long long 和 signed main 包过不了编译的

2024/10/31 19:56
加载中...