結果
| 問題 | No.136 Yet Another GCD Problem |
| コンテスト | |
| ユーザー |
latte0119
|
| 提出日時 | 2015-05-04 00:57:34 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 5,000 ms |
| コード長 | 244 bytes |
| 記録 | |
| コンパイル時間 | 911 ms |
| コンパイル使用メモリ | 174,208 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-27 03:59:01 |
| 合計ジャッジ時間 | 1,933 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 39 |
ソースコード
#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;i++){
ma=max(ma,gcd(i,N));
}
cout<<ma<<endl;
return 0;
}
latte0119