結果
| 問題 |
No.351 市松スライドパズル
|
| コンテスト | |
| ユーザー |
Kmcode1
|
| 提出日時 | 2016-03-11 22:33:54 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,092 bytes |
| コンパイル時間 | 774 ms |
| コンパイル使用メモリ | 94,752 KB |
| 実行使用メモリ | 13,320 KB |
| 最終ジャッジ日時 | 2024-09-25 00:58:55 |
| 合計ジャッジ時間 | 3,589 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 10 WA * 7 |
コンパイルメッセージ
main.cpp: In constructor ‘st::st()’:
main.cpp:47:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
47 | scanf("%s%d", buf, &k);
| ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
using namespace std;
int h;
int w;
char buf[3];
struct st{
char s;
int k;
st(){
scanf("%s%d", buf, &k);
s = buf[0];
}
};
vector<st> v;
int main(){
cin >> h >> w;
int n;
cin >> n;
for (int i = 0; i < n; i++){
v.push_back(st());
}
reverse(v.begin(), v.end());
int x = 0;
int y = 0;
for (int i = 0; i < v.size(); i++){
if (v[i].s == 'R'){
y += w - 1;
y %= w;
}
else{
x += h - 1;
x %= h;
}
}
int k = (x + y);
k %= 2;
if (k == 0){
puts("white");
}
else{
puts("black");
}
return 0;
}
Kmcode1