結果
| 問題 |
No.769 UNOシミュレータ
|
| コンテスト | |
| ユーザー |
kagasan
|
| 提出日時 | 2019-09-05 15:47:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,247 bytes |
| コンパイル時間 | 1,557 ms |
| コンパイル使用メモリ | 171,424 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-22 09:25:49 |
| 合計ジャッジ時間 | 3,304 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 9 |
ソースコード
#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;
}
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;
}
kagasan