結果
| 問題 |
No.769 UNOシミュレータ
|
| コンテスト | |
| ユーザー |
tac
|
| 提出日時 | 2019-07-14 00:34:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,740 bytes |
| コンパイル時間 | 1,549 ms |
| コンパイル使用メモリ | 168,508 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-22 09:22:12 |
| 合計ジャッジ時間 | 3,173 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 WA * 8 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep3(i, l, n) for (int i = l; i < n; ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define out(a) cout << a << endl
#define SZ(v) (int)v.size()
#define inf (int)(1e9+7)
//skip -> 2回カウンタ回す
//two, four -> 連続の後の人skip(sample3で修正するけど)
int c = 1;
int rev, t, f;
int n, m;
int acc = 1;
void counter() {
if (rev) {
c--;
if (c == 0) c = n;
} else {
c++;
if (c == n + 1) c = 1;
}
}
int main() {
cin >> n >> m;
vector<int> v(n + 1);
rep(i, m) {
string s; cin >> s;
if ((t && s != "drawtwo") || (f && s != "drawfour")) {
t = 0; f = 0;
v[c] -= acc;
//out(s << " " << c << " " << v[c]);
acc = 1;
counter();
}
v[c] += 1;// out(s << " " << c << " " << v[c]);
if (s == "drawfour") {
t = 0;
f = 1;
acc += 4;
}
else if (s == "drawtwo") {
f = 0;
t = 1;
acc += 2;
} else {
if (s == "reverse") {
rev ^= 1;
}
if (s == "skip" || t || f) {
counter();
}
}
if (i == m - 1) {
cout << c << " " << v[c] << endl;
break;
}
counter();
}
}
tac