直接用 cin
的话,数据量 $n = 5 \times 10^5$ 貌似就不行了,具体一般是多少就不行?
另外,1s 一般执行多少次 scanf
?
附上 cin 加速
ios_base::sync_with_stdio(false);
cin.tie(NULL);
提问于16天前
2209
嘛, 我校oj在$ n=3e6 $左右会超过1s
应该和评测机关系很大,可能cf的评测机表现会好很多吧(大雾
使用以下程序测试, 数据范围$ [0,2^8) $
```
#include <iostream>
#include <random>
#include <algorithm>
using ull = unsigned long long;
using namespace std;
int main()
{
int T;
cin >> T;
ull ans = 0;
while(T--)
{
ull n;
cin >> n;
ans ^= n;
}
cout << ans << '\n';
}
``` –
Palytoxin
4天前