結果
| 問題 |
No.769 UNOシミュレータ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-01 12:18:05 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,324 bytes |
| コンパイル時間 | 2,317 ms |
| コンパイル使用メモリ | 194,460 KB |
| 最終ジャッジ日時 | 2025-01-07 10:26:05 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n,m;
cin>>n>>m;
int cnt[n] {};
int drawn[n] {};
int turn = 0;
int dir = 1;
bool drawtwo = false;
bool drawfour = false;
for (int i = 0; i < m; i++) {
string s;
cin >> s;
if (drawtwo) {
if (s == "drawtwo") {
cnt[turn]++;
turn = (turn + dir + n) % n;
continue;
} else {
drawn[turn] += 2;
turn = (turn + dir + n) % n;
drawtwo = false;
}
} else if (drawfour) {
if (s == "drawfour") {
cnt[turn]++;
turn = (turn + dir + n) % n;
continue;
} else {
drawn[turn] += 4;
turn = (turn + dir + n) % n;
drawfour = false;
}
}
cnt[turn]++;
if (s == "drawtwo") drawtwo = true;
else if (s == "drawfour") drawfour = true;
else if (s == "reverse") dir = -dir;
else if (s == "skip") turn = (turn + dir + n) % n;
turn = (turn + dir + n) % n;
}
int winner = (turn - dir + n) % n;
cout << winner + 1 << ' ' << cnt[winner] - drawn[winner] << endl;
return 0;
}