結果
| 問題 | No.136 Yet Another GCD Problem |
| コンテスト | |
| ユーザー |
latte0119
|
| 提出日時 | 2015-05-04 00:56:21 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 246 bytes |
| 記録 | |
| コンパイル時間 | 871 ms |
| コンパイル使用メモリ | 177,304 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-27 03:58:57 |
| 合計ジャッジ時間 | 1,989 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 WA * 2 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int N,K;
int gcd(int a,int b){
return b?gcd(b,a%b):a;
}
int main(){
cin>>N>>K;
int ma=0;
for(int i=1;i<N-1;i++){
ma=max(ma,gcd(i,N));
}
cout<<ma<<endl;
return 0;
}
latte0119