Submission #00049
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int s[n], t[n], p[n]; long long a[200002] = {}; for ( int i = 0; i < n; i++) { cin >> s[i] >> t[i] >> p[i]; a[s[i]] += p[i]; a[t[i] + 1] -= p[i]; } long long Max = 0; for ( int i = 1; i < 200002; i++) { a[i] = a[i - 1] + a[i]; Max = max(Max, a[i]); } cout << Max << "\n" ; return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0013 - subscription(サブスク) |
ユーザー名 | woody_1227 |
投稿日時 | 2023-11-13 09:27:55 |
言語 | C++17 |
状態 | Accepted |
得点 | 50 |
ソースコード長 | 463 Byte |
最大実行時間 | 127 ms |
最大メモリ使用量 | 4444 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 50 / 50 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in-1.txt | AC | 120 ms | 4444 KB |
1
|
in-2.txt | AC | 113 ms | 4228 KB |
1
|
in-3.txt | AC | 127 ms | 4268 KB |
1
|
in-4.txt | AC | 106 ms | 4304 KB |
1
|
in-5.txt | AC | 20 ms | 2044 KB |
1
|
in-6.txt | AC | 127 ms | 4424 KB |
1
|
in-sample1.txt | AC | 20 ms | 2032 KB |
1
|
in-sample2.txt | AC | 22 ms | 2116 KB |
1
|
in-sample3.txt | AC | 22 ms | 1936 KB |
1
|