結果
| 問題 |
No.2338 Range AtCoder Query
|
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2022-08-22 22:52:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 698 bytes |
| コンパイル時間 | 1,544 ms |
| コンパイル使用メモリ | 173,304 KB |
| 実行使用メモリ | 11,212 KB |
| 最終ジャッジ日時 | 2024-10-04 09:33:41 |
| 合計ジャッジ時間 | 3,982 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 WA * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int N, M, Q;
cin >> N >> M >> Q;
if (N >= 100000 && Q >= 100000) return 0;
vector<int> P(N);
vector<string> S(N);
for (int i = 0; i < N; i++){
cin >> P[i] >> S[i];
P[i]--;
}
for (int i = 0; i < Q; i++){
int L, R;
cin >> L >> R;
L--;
vector<bool> ac(M, false);
vector<int> wa(M, 0);
int ans1 = 0;
int ans2 = 0;
for (int j = L; j < R; j++){
if (S[j] == "AC"){
if (!ac[P[j]]){
ans1++;
ans2 += wa[P[j]];
ac[P[j]] = true;
}
}
if (S[j] == "WA"){
wa[P[j]]++;
}
}
cout << ans1 << ' ' << ans2 << endl;
}
}
SSRS