結果
問題 |
No.769 UNOシミュレータ
|
ユーザー |
![]() |
提出日時 | 2019-09-05 15:49:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,273 bytes |
コンパイル時間 | 1,691 ms |
コンパイル使用メモリ | 169,552 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 09:25:53 |
合計ジャッジ時間 | 3,282 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 WA * 3 |
ソースコード
#include "bits/stdc++.h" using namespace std; typedef long long ll; void Say(bool say, string a = "Yes", string b = "No"){cout << (say ? a : b) << endl;}; int main(){ ll N, M; cin >> N >> M; vector<ll>ans(N, 0); ll ad = 1, p = 0; string lst = "number"; ll tmp = 0; for(ll i = 0; i < M; i++){ string s; cin >> s; if(tmp){ if(s == lst){ ans[p]++; if(s == "drawtwo")tmp += 2; else tmp += 4; p = (p + N + ad) % N; continue; } else{ ans[p] -= tmp; tmp = 0; p = (p + N + ad) % N; } } ans[p]++; if(i + 1 == M)break; if(tmp == 0){ if(s == "number"){ } if(s == "drawtwo"){ tmp = 2; } if(s == "drawfour"){ tmp = 4; } if(s == "skip"){ p = (p + N + ad) % N; } if(s == "reverse"){ ad = -ad; } lst = s; p = (p + N + ad) % N; } } cout << p + 1 << " " << ans[p] << endl; return 0; }