結果
問題 |
No.2285 Make A Unit Square
|
ユーザー |
|
提出日時 | 2023-04-28 21:44:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 39 ms / 2,000 ms |
コード長 | 766 bytes |
コンパイル時間 | 2,336 ms |
コンパイル使用メモリ | 197,980 KB |
最終ジャッジ日時 | 2025-02-12 15:04:14 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 |
ソースコード
#include <bits/stdc++.h> using i64 = long long; int sg[200]; void solve() { int a, b; std::cin >> a >> b; if (a > 100) { a -= (a - 100) / 34 * 34; } if (b > 100) { b -= (b - 100) / 34 * 34; } if (sg[a] ^ sg[b]) { std::cout << "First\n"; } else { std::cout << "Second\n"; } } int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); for (int i = 2; i < 200; i++) { std::set<int> s; for (int j = 2; j + 2 <= i; j++) { s.insert(sg[j] ^ sg[i - j]); } while (s.count(sg[i])) { sg[i]++; } } int t; std::cin >> t; while (t--) { solve(); } return 0; }