結果
問題 |
No.769 UNOシミュレータ
|
ユーザー |
![]() |
提出日時 | 2018-12-26 21:16:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,342 bytes |
コンパイル時間 | 1,796 ms |
コンパイル使用メモリ | 168,620 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-22 08:58:39 |
合計ジャッジ時間 | 3,457 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 1 |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main(){ | ^~~~
ソースコード
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=int(a);i<int(b);++i) using namespace std; typedef long long ll; int INF = (1LL << 30) - 1; int MOD = 1e9+7; main(){ int N,M; cin >> N >> M; vector<int> V(N); int turn = 0, dir = 1, draw = 0; bool d2 = 0, d4 = 0; rep(i,0,M){ //cout << turn << " " << V[turn] << endl; string s; cin >> s; V[turn]++; onemore: if(draw){ if(d2 && s == "drawtwo" || d4 && s == "drawfour"){ draw += (s == "drawtwo" ? 2 : 4); }else{ d2 = d4 = 0; V[turn] -= draw; V[turn]--; draw = 0; turn = (turn + N + dir) % N; V[turn]++; goto onemore; } }else if(s == "drawtwo" || s == "drawfour"){ draw += (s == "drawtwo" ? 2 : 4); (s == "drawtwo" ? d2 : d4) = 1; }else if(s == "skip"){ turn += dir; }else if(s == "reverse"){ dir *= -1; } if(i == M-1){ cout << turn + 1 << " " << V[turn] << endl; break; } turn = (turn + N + dir) % N; /* cout << endl; rep(j,0,N){ cout << j << " " << V[j] << endl; } */ } }