結果

問題 No.2338 Range AtCoder Query
ユーザー SSRSSSRS
提出日時 2022-08-22 22:52:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 698 bytes
コンパイル時間 1,956 ms
コンパイル使用メモリ 169,216 KB
実行使用メモリ 11,012 KB
最終ジャッジ日時 2024-04-15 01:50:10
合計ジャッジ時間 4,404 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 6 ms
6,944 KB
testcase_07 AC 6 ms
6,944 KB
testcase_08 AC 6 ms
6,940 KB
testcase_09 AC 6 ms
6,944 KB
testcase_10 AC 6 ms
6,944 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 93 ms
11,012 KB
testcase_27 AC 93 ms
11,008 KB
testcase_28 AC 93 ms
11,008 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
  }
}
0