結果

問題 No.2551 2, 3, 5, 7 Game
ユーザー Naru820
提出日時 2025-05-07 19:12:48
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 3,418 ms
コンパイル使用メモリ 280,504 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-07 19:12:55
合計ジャッジ時間 6,581 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll mod = 998244353;

ll t,n;
vector<int> a = {2,3,5,7};
map<ll,bool> memo;
bool solve(ll now){
  if(now > n) return false;
  if(memo.count(now)) return memo[now];
  for(int i = 0; i < 4; i++){
    if(!solve(now * a[i])) return memo[now] = 1;
  }
  return memo[now] = 0;
}
int main(){
  cin >> t;
  while(t--){
    cin >> n;
    cout << (solve(1) ?  "ryota" : "sepa") << endl;
  }
}
0