イメージ説明どうしてWAになるかわからないので、お助けいただけると嬉しいです。
問題のページ
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (n); ++i) typedef long long ll; int main(){ ll n, m; cin >> n >> m; vector <pair<ll, string>> judge(m+1); rep(i,m) cin >> judge[i].first >> judge[i].second; ll ac = 0, wa = 0; ll check = 0; rep(i,m){ if(judge[i].second=="AC" && check != judge[i].first){ ac++; check = judge[i].first; for(ll k = i-1; k >= 0;k--){ if(judge[k].second=="WA"&& judge[k].first == judge[i].first) wa++; else break; } }else continue; } cout << ac << " " << wa << endl; return 0; }
回答2件
あなたの回答
tips
プレビュー