結果
| 問題 |
No.136 Yet Another GCD Problem
|
| コンテスト | |
| ユーザー |
latte0119
|
| 提出日時 | 2015-05-04 00:50:33 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 265 bytes |
| コンパイル時間 | 1,247 ms |
| コンパイル使用メモリ | 157,296 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 18:37:49 |
| 合計ジャッジ時間 | 2,506 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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++){
int j=N-i;
ma=max(ma,gcd(i,j));
}
cout<<ma<<endl;
return 0;
}
latte0119