結果

問題 No.2551 2, 3, 5, 7 Game
ユーザー Naru820
提出日時 2025-05-07 19:27:36
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 3,126 ms
コンパイル使用メモリ 281,700 KB
実行使用メモリ 16,076 KB
最終ジャッジ日時 2025-05-07 19:27:47
合計ジャッジ時間 9,815 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 5 TLE * 1 -- * 4
権限があれば一括ダウンロードができます

ソースコード

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;
    memo.clear();
  }
}
0