結果
| 問題 |
No.769 UNOシミュレータ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-27 22:57:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,179 bytes |
| コンパイル時間 | 816 ms |
| コンパイル使用メモリ | 85,796 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-22 09:01:32 |
| 合計ジャッジ時間 | 2,468 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 WA * 4 |
ソースコード
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
#include <ctype.h>
#include <fstream>
#include <cassert>
//#include <bits/stdc++.h>
using namespace std;
//#include<bits/stdc++.h>
int t[100005];
int main() {
int a, b;
cin >> a >> b;
int x = 0;
int f = 1;
bool c = 0, d = 0;
int w = 0, r = 0;
for (int i = 0; i < b; i++) {
string p;
cin >> p;
if (w&&p == "drawtwo") {
w++;
t[x]++;
x = (x + f + a) % a;
continue;
}
if (r&&p == "drawfour") {
r++;
t[x]++;
x = (x + f + a) % a;
continue;
}
if (w) {
t[x] -= w * 2;
w = 0;
x = (x + f + a) % a;
}
if (r) {
t[x] -= r*4;
r = 0;
x = (x + f + a) % a;
}
t[x]++;
if (p == "drawtwo")w++;
else if (p == "drawfour")r++;
else if(p=="skip")x = (x + f + a) % a;
else if (p == "reverse")f *= -1;
if (i == b - 1)break;
x = (x + f + a) % a;
}
cout << x + 1 <<" "<<t[x]<< endl;
return 0;
}