Submission #00080
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #include<bits/stdc++.h> #define mset multiset #define unset unordered_set #define endl "\n"; #define prg_queue priority_queue <int,vector<int>,greater<int> #define pr_queue priority_queue <int> #define upper upper_bound #define lower lower_bound using namespace std; int main(){ long long a,b,c,d,e; cin >>a>>b; long long q[b],w[a+1][2]={}; vector < long long > p(a+1,0); vector < long long > r(a+1,0); for ( int o=0; o<b; o++){ scanf ( "%lld" ,&q[o]); } for ( int o=0; o<b; o++){ scanf ( "%lld%lld" ,&c,&d); p[c-1]+=q[o]; r[c-1]++; p[d]-=q[o]; r[d]--; } w[0][0]=p[0]; w[0][1]=r[0]; for ( int o=1; o<a; o++){ w[o][0]=w[o-1][0]+p[o]; w[o][1]=w[o-1][1]+r[o]; } for ( int o=0; o<a; o++){ if (w[o][1]!=0){ e=w[o][0]/w[o][1]; } else { e=-1; } printf ( "%lld\n" ,e); } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0011 - Contest |
ユーザー名 | SnakyZoo8277089 |
投稿日時 | 2024-07-18 14:49:09 |
言語 | C++17 |
状態 | Accepted |
得点 | 33 |
ソースコード長 | 978 Byte |
最大実行時間 | 157 ms |
最大メモリ使用量 | 85756 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 33 / 33 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in01.txt | AC | 19 ms | 604 KB |
1
|
in02.txt | AC | 23 ms | 448 KB |
1
|
in03.txt | AC | 24 ms | 424 KB |
1
|
in04.txt | AC | 28 ms | 524 KB |
1
|
in05.txt | AC | 23 ms | 604 KB |
1
|
in06.txt | AC | 20 ms | 540 KB |
1
|
in07.txt | AC | 20 ms | 592 KB |
1
|
in08.txt | AC | 20 ms | 508 KB |
1
|
in09.txt | AC | 30 ms | 708 KB |
1
|
in10.txt | AC | 21 ms | 588 KB |
1
|
in11.txt | AC | 73 ms | 12152 KB |
1
|
in12.txt | AC | 37 ms | 5180 KB |
1
|
in13.txt | AC | 46 ms | 5300 KB |
1
|
in14.txt | AC | 78 ms | 12680 KB |
1
|
in15.txt | AC | 76 ms | 14600 KB |
1
|
in16.txt | AC | 34 ms | 9880 KB |
1
|
in17.txt | AC | 111 ms | 22304 KB |
1
|
in18.txt | AC | 119 ms | 25280 KB |
1
|
in19.txt | AC | 125 ms | 28128 KB |
1
|
in20.txt | AC | 106 ms | 31100 KB |
1
|
in21.txt | AC | 121 ms | 34076 KB |
1
|
in22.txt | AC | 157 ms | 36920 KB |
1
|
in23.txt | AC | 121 ms | 39892 KB |
1
|
in24.txt | AC | 127 ms | 42744 KB |
1
|
in25.txt | AC | 119 ms | 45728 KB |
1
|
in26.txt | AC | 127 ms | 48964 KB |
1
|
in27.txt | AC | 134 ms | 52200 KB |
1
|
in28.txt | AC | 100 ms | 55432 KB |
1
|
in29.txt | AC | 94 ms | 58540 KB |
1
|
in30.txt | AC | 108 ms | 61912 KB |
1
|
in31.txt | AC | 112 ms | 65144 KB |
1
|
in32.txt | AC | 102 ms | 67992 KB |
1
|
in33.txt | AC | 98 ms | 70976 KB |
1
|
in34.txt | AC | 102 ms | 73952 KB |
1
|
in35.txt | AC | 102 ms | 76416 KB |
1
|
in36.txt | AC | 99 ms | 78880 KB |
1
|
in37.txt | AC | 99 ms | 81344 KB |
1
|
in38.txt | AC | 107 ms | 83552 KB |
1
|
in39.txt | AC | 110 ms | 85756 KB |
1
|
in40.txt | AC | 71 ms | 76444 KB |
1
|
sample.txt | AC | 20 ms | 73956 KB |
1
|