結果
問題 | No.136 Yet Another GCD Problem |
ユーザー |
![]() |
提出日時 | 2015-05-04 00:56:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 246 bytes |
コンパイル時間 | 1,468 ms |
コンパイル使用メモリ | 157,404 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 18:38:21 |
合計ジャッジ時間 | 2,691 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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;}