結果

問題 No.3029 素因数
ユーザー どららどらら
提出日時 2017-04-01 01:08:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,334 bytes
コンパイル時間 2,099 ms
コンパイル使用メモリ 168,404 KB
実行使用メモリ 4,708 KB
最終ジャッジ日時 2023-09-21 21:39:54
合計ジャッジ時間 4,468 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
4,436 KB
testcase_01 AC 11 ms
4,552 KB
testcase_02 AC 11 ms
4,588 KB
testcase_03 AC 12 ms
4,468 KB
testcase_04 AC 11 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 11 ms
4,664 KB
testcase_07 AC 11 ms
4,580 KB
testcase_08 AC 11 ms
4,460 KB
testcase_09 AC 11 ms
4,504 KB
testcase_10 AC 11 ms
4,436 KB
testcase_11 AC 11 ms
4,516 KB
testcase_12 AC 11 ms
4,596 KB
testcase_13 AC 11 ms
4,448 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 11 ms
4,472 KB
testcase_17 WA -
testcase_18 AC 11 ms
4,708 KB
testcase_19 WA -
testcase_20 AC 11 ms
4,580 KB
testcase_21 AC 11 ms
4,500 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 12 ms
4,668 KB
testcase_25 AC 11 ms
4,508 KB
testcase_26 WA -
testcase_27 AC 12 ms
4,608 KB
testcase_28 AC 11 ms
4,692 KB
testcase_29 AC 11 ms
4,628 KB
testcase_30 AC 11 ms
4,668 KB
testcase_31 AC 11 ms
4,532 KB
testcase_32 WA -
testcase_33 AC 11 ms
4,508 KB
testcase_34 AC 11 ms
4,556 KB
testcase_35 AC 11 ms
4,584 KB
testcase_36 AC 11 ms
4,440 KB
testcase_37 WA -
testcase_38 AC 12 ms
4,512 KB
testcase_39 AC 11 ms
4,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

#define MAX_PRIME 1000000 
bool isprime[MAX_PRIME+1]; 
vector<int> primes; 
void init_prime(){
  fill(isprime, isprime+MAX_PRIME+1, true); 
  isprime[0] = isprime[1] = false; 
  for(int i = 2; i <= MAX_PRIME; i++) { 
    if (isprime[i]) { 
      primes.push_back(i); 
      for(int j = i*2; j <= MAX_PRIME; j += i) 
      isprime[j] = false; 
    } 
  } 
}
ll strmod(const string& n, const ll& m){
  ll ret = 0;
  int j = 0;
  while(true){
    if(ret >= m) ret%=m;
    if(j >= n.size()) break;
    ret = ret*10 + (n[j]-'0');
    j++;
  }
  return ret;
}

int main(){
  init_prime();
  vector<int> cand;
  rep(i,MAX_PRIME){
    if(i%8 == 3 && i%21 == 4 && isprime[i]){
      cand.push_back(i);
    }
  }
  reverse(ALLOF(cand));
  string s = "26180411287263107299803976957264203054160842086839438580";
  int orig = 1;
  rep(i,cand.size()){
    if(strmod(s,cand[i]) == 0){
      orig = cand[i];
      break;
    }
  }
    
  int M;
  cin >> M;

  if((orig%M)%2==0) cout << "even" << endl;
  else cout << "odd" << endl;
  
  return 0;
}
0