結果
問題 |
No.136 Yet Another GCD Problem
|
ユーザー |
![]() |
提出日時 | 2016-07-05 00:18:32 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 360 bytes |
コンパイル時間 | 3,240 ms |
コンパイル使用メモリ | 77,976 KB |
実行使用メモリ | 54,184 KB |
最終ジャッジ日時 | 2024-10-12 20:14:56 |
合計ジャッジ時間 | 9,723 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 WA * 4 |
ソースコード
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 = 3; i <= n / 2; i++){ if(n % i == 0){ max = Math.max(max, i); } } System.out.println((max == 0) ? 1 :max); } }