結果
| 問題 |
No.3300 Frog Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-10-05 16:18:31 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 1,314 bytes |
| コンパイル時間 | 5,056 ms |
| コンパイル使用メモリ | 335,084 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-10-05 16:18:55 |
| 合計ジャッジ時間 | 6,234 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
typedef long long ll;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
const ll MOD = 998244353;
const double INFD = 1.0E10;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, -1, 0, 1};
//const int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
//const int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
using Pair = pair<ll, ll>;
using Graph = vector<vector<int>>;
using mint = atcoder::modint998244353;
void test(){
ll n = 100;
int a = 3, b = 10;
//cerr << (n - 2) % (a + b) << endl;
vector<bool> v(n + 1, false); v[n] = true;
for (int i = n - 1; i >= 1; i--){
//どっちかがfalseならtrue//勝てる
int x = i + a;
if (i + a < n && v[i + a] == false) v[i] = true;
if (i + b < n && v[i + b] == false) v[i] = true;
}
for (int i = 1; i <= n; i++){
cerr << i << " : " << (v[i] ? "win" : "false") << endl;
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
ll n, a, b; cin >> n >> a >> b;
ll idx = (n - 2) % (a + b); //下からこれ
bool win = true;
if (idx >= b) win = true;
else{
ll p = idx / a;
win = p % 2;
}
cout << (win ? "sepa" : "ryota") << endl;
return 0;
}