标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#21119 | #1048. 1-06A. nocriz送温暖 | Runtime Error | 0 | 69 ms | 2504 K | C++ 17 / 730 B | 自动化82-郭筠陶 | 2020-01-16 13:14:21 |
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
const ull mod = 998244353;
int main() {
ios::sync_with_stdio(false);
ifstream fin;
fin.open("input");
int n, q;
cin >> n >> q;
ull curNum = 1;
vector<ull> multiples;
multiples.push_back(1);
for (int i = 0; i < n; i++) {
ull tmp;
cin >> tmp;
curNum = curNum * tmp % mod;
// cout<<curNum<<"\n";
multiples.push_back(curNum);
}
vector<int> invs(mod + 1, 1);
for (int i = 2; i < mod; i++) {
invs.at(i) = (mod - mod / i) * invs.at(mod % i) % mod;
// cout<<invs.at(i)<<"\n";
}
for (int i = 0; i < q; i++) {
int l, r;
fin >> l >> r;
cout << (invs.at(multiples.at(l)) * multiples.at(r) % mod) << "\n";
}
}
标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault
15 15
165696370 476753897 229689806 996820895 598127751 379659198 554377549 804958724 215644896 7353
<134 bytes omitted>
812259183
486989696
945802145
565758286
410163715
916090137
777479440
197064759
963609266
143548199
<50 bytes omitted>
标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault
500 500
875859693 19297717 533567733 401117518 542067855 942549894 687071639 495756481 706319042 297
<8726 bytes omitted>
416681069
783464821
389635729
915396833
852827187
322964361
795736013
367058069
191319311
945823172
<4858 bytes omitted>
标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault
1000 1000
453485157 936247494 264621845 889134887 643611901 819233122 269455918 554517854 916438630
<17668 bytes omitted>
481893436
114188653
256055655
866518481
115927372
445439110
945938495
370915673
736335894
299245621
<9789 bytes omitted>
标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault
5000 5000
946768349 138710211 991772515 390895330 281870111 571810193 822919202 883598607 169120285
<98138 bytes omitted>
864985856
92100437
226580341
499360378
93125908
116831484
933548640
305899388
23514308
451996431
557
<49336 bytes omitted>
标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault
20000 20000
59910458 346043205 55132948 767676760 594687540 296026148 804076263 216042891 898704108
<423491 bytes omitted>
264861098
450881491
754854261
58003959
48752770
535545407
55061389
468348719
166198501
264776237
254
<197674 bytes omitted>
标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault
50000 50000
10914571 746386359 717378579 224085215 984739017 267333765 956855499 541678257 451519700
<1082564 bytes omitted>
933637921
857402294
582354625
140335565
420947534
73718381
236706476
834562894
485573569
657491365
2
<494348 bytes omitted>
标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault
50000 50000
122286549 265859588 427312049 174066036 78796680 922114383 64120931 991363404 224805463
<1082176 bytes omitted>
997140837
283606682
214721539
548031555
475134263
152394271
294848899
196771768
567435648
334436465
<494194 bytes omitted>
标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault
100000 100000
157108985 615229511 21768932 970738460 197695722 367294695 642916460 248027698 6977036
<2177053 bytes omitted>
303168480
503863169
553764057
764316760
393488868
947406744
243417456
722363372
219982366
909099658
<988912 bytes omitted>
标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault
200000 200000
757148 167851001 301413357 336971125 659598369 160567226 391749388 4890852 35766291 2
<4781955 bytes omitted>
933983893
340699169
629640029
502347892
666587249
205473890
609674864
539513027
128544884
2
<2178111 bytes omitted>
标准错误流
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
系统信息
Killed: Segmentation fault