結果
| 問題 | No.1312 Snake Eyes |
| コンテスト | |
| ユーザー |
tko919
|
| 提出日時 | 2020-12-09 00:02:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 661 bytes |
| 記録 | |
| コンパイル時間 | 1,298 ms |
| コンパイル使用メモリ | 165,504 KB |
| 実行使用メモリ | 13,756 KB |
| 最終ジャッジ日時 | 2024-09-18 21:51:34 |
| 合計ジャッジ時間 | 9,019 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 TLE * 1 -- * 40 |
ソースコード
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
//template
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
//end
int main(){
ll n; cin>>n;
for(ll p=2;;p++){
ll m=n; int v=m%p;
for(;m;m/=p){
if(m%p!=v)goto fail;
}
cout<<p<<endl;
return 0;
fail:;
}
return 0;
}
tko919