結果
| 問題 |
No.469 区間加算と一致検索の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-14 01:54:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 609 bytes |
| コンパイル時間 | 871 ms |
| コンパイル使用メモリ | 83,104 KB |
| 実行使用メモリ | 814,936 KB |
| 最終ジャッジ日時 | 2024-12-14 07:40:50 |
| 合計ジャッジ時間 | 63,470 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 MLE * 27 |
ソースコード
// TLE
#include <iostream>
#include <vector>
#include <map>
#define repeat(i,n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_from(i,m,n) for (int i = (m); (i) < int(n); ++(i))
using namespace std;
int main() {
int n, q; cin >> n >> q;
vector<int> x(n);
map<vector<int>, int> f;
f[x] = 0;
repeat (t,q) {
char c; cin >> c;
if (c == '!') {
int l, r, k; cin >> l >> r >> k;
repeat_from (i,l,r) x[i] += k;
if (not f.count(x)) f[x] = t+1;
} else if (c == '?') {
cout << f[x] << endl;
}
}
return 0;
}