AcWing
  • 首页
  • 题库
  • 题解
  • 分享
  • 问答
  • 活动
  • 应用
  • 吐槽
  • 登录/注册

比赛中 c++ 1s 一般执行多少次 cin?



1


直接用 cin 的话,数据量 $n = 5 \times 10^5$ 貌似就不行了,具体一般是多少就不行?

另外,1s 一般执行多少次 scanf?


附上 cin 加速

ios_base::sync_with_stdio(false);
cin.tie(NULL);


提问于16天前
YimingLi
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天前

@Palytoxin:  好滴! –  YimingLi   3天前



0 个问答


我来回答
你确定删除吗?

© 2018-2020 AcWing 版权所有  |  京ICP备17053197号-1
联系我们  |  常见问题
AcWing
请输入登录信息
更多登录方式: 微信图标 qq图标
请输入绑定的邮箱地址
请输入注册信息