結果
| 問題 |
No.136 Yet Another GCD Problem
|
| コンテスト | |
| ユーザー |
kenji_shioya
|
| 提出日時 | 2016-07-05 00:19:43 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 131 ms / 5,000 ms |
| コード長 | 358 bytes |
| コンパイル時間 | 3,782 ms |
| コンパイル使用メモリ | 74,836 KB |
| 実行使用メモリ | 41,452 KB |
| 最終ジャッジ日時 | 2024-10-12 20:15:12 |
| 合計ジャッジ時間 | 9,684 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 39 |
ソースコード
import java.util.*;
public class Exercise144{
public static void main (String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int max = 0;
for(int i = 2; i <= n / 2; i++){
if(n % i == 0){
max = Math.max(max, i);
}
}
System.out.println((max == 0) ? 1 :max);
}
}
kenji_shioya