結果
問題 | No.351 市松スライドパズル |
ユーザー | 37kt_ |
提出日時 | 2016-03-11 23:11:40 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,754 bytes |
コンパイル時間 | 1,604 ms |
コンパイル使用メモリ | 169,432 KB |
実行使用メモリ | 38,712 KB |
最終ジャッジ日時 | 2024-09-25 01:18:01 |
合計ジャッジ時間 | 4,612 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 117 ms
38,452 KB |
testcase_01 | AC | 13 ms
35,016 KB |
testcase_02 | AC | 14 ms
35,648 KB |
testcase_03 | AC | 14 ms
35,520 KB |
testcase_04 | AC | 13 ms
35,008 KB |
testcase_05 | AC | 13 ms
35,012 KB |
testcase_06 | AC | 14 ms
35,272 KB |
testcase_07 | AC | 13 ms
34,628 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 13 ms
35,904 KB |
testcase_11 | AC | 14 ms
34,628 KB |
testcase_12 | WA | - |
testcase_13 | AC | 141 ms
38,584 KB |
testcase_14 | WA | - |
testcase_15 | AC | 147 ms
38,576 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 141 ms
38,576 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
ソースコード
/* template.cpp {{{ */ #include <bits/stdc++.h> using namespace std; namespace solver { #define GET_MACRO(a, b, c, d, NAME, ...) NAME #define REP1(n) REP2(i_, n) #define REP2(i, n) REP3(i, 0, n) #define REP3(i, a, b) REP4(i, a, b, 1) #define REP4(i, a, b, s) for (ll i = (a); i < (ll)(b); i += (ll)(s)) #define RREP1(n) RREP2(i_, n) #define RREP2(i, n) RREP3(i, 0, n) #define RREP3(i, a, b) RREP4(i, a, b, 1) #define RREP4(i, a, b, s) for (ll i = (b) - 1; i >= (ll)(a); i -= (ll)(s)) #define rep(...) GET_MACRO(__VA_ARGS__, REP4, REP3, REP2, REP1)(__VA_ARGS__) #define rrep(...) GET_MACRO(__VA_ARGS__, RREP4, RREP3, RREP2, RREP1)(__VA_ARGS__) #define each(x, c) for (auto &&x : c) #define all(c) std::begin(c), std::end(c) using ll = long long; using ull = unsigned long long; using uint = unsigned int; using ld = long double; template<typename T> using MinPQ = priority_queue<T, vector<T>, greater<T>>; template<typename T> using MaxPQ = priority_queue<T, vector<T>, less<T>>; template<bool cond, typename T = void> using enable_if_t = typename enable_if<cond, T>::type; const int INF = 1e9 + 10; const ll INF_LL = 1e18 + 10; const double INF_D = 1e12; const ld INF_LD = 1e24; const ld EPS = 1e-8; const ld PI = acos(-1.0l); const int dx[] = {-1, 0, 1, 0, -1, 1, 1, -1}; const int dy[] = {0, -1, 0, 1, -1, -1, 1, 1}; template<typename T> inline T sq(const T &x){ return x * x; } template<typename T, typename U> inline T &chmin(T &x, const U &y){ if (x > y) x = y; return x; } template<typename T, typename U> inline T &chmax(T &x, const U &y){ if (x < y) x = y; return x; } ll gcd(ll a, ll b){ return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b){ return a / gcd(a, b) * b; } tuple<ll, ll, ll> extgcd(ll a, ll b){ if (b == 0) return make_tuple(a, 1, 0); ll g, x, y; tie(g, x, y) = extgcd(b, a % b); return make_tuple(g, y, x - a / b * y); } ll invmod(ll a, ll m = 1000000007){ ll g, x; tie(g, x, ignore) = extgcd(a, m); return g == 1 ? (x + m) % m : 0; } void solve(); } signed main(){ auto begin = std::chrono::high_resolution_clock::now(); std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout << std::fixed << std::setprecision(12); solver::solve(); auto end = std::chrono::high_resolution_clock::now(); auto time = std::chrono::duration_cast<std::chrono::milliseconds>(end - begin); #ifdef DEBUG std::cerr << "time: " << time.count() << " [ms]" << std::endl; #endif } namespace solver { /* }}} */ int h, w, n; string s[1000000]; int k[1000000]; void solve(){ cin >> h >> w >> n; rep(i, n) cin >> s[i] >> k[i]; int x = 0, y = 0; rrep(i, n){ if (s[i] == "C") x = (x + 1) % h; else y = (y + 1) % w; } cout << ((x ^ y) & 1 ? "black\n" : "white\n"); } } /* namespace solver */