結果

問題 No.769 UNOシミュレータ
ユーザー sggkshio
提出日時 2018-12-27 23:07:12
言語 C++11
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,229 bytes
コンパイル時間 727 ms
コンパイル使用メモリ 84,860 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-22 09:01:35
合計ジャッジ時間 2,204 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#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]++;
if (i == b - 1)break;
x = (x + f + a) % a;
continue;
}
if (r&&p == "drawfour") {
r++;
t[x]++;
if (i == b - 1)break;
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;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0