結果
| 問題 |
No.136 Yet Another GCD Problem
|
| コンテスト | |
| ユーザー |
takeya_okino
|
| 提出日時 | 2019-08-22 19:13:34 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 311 bytes |
| コンパイル時間 | 2,075 ms |
| コンパイル使用メモリ | 73,760 KB |
| 実行使用メモリ | 41,704 KB |
| 最終ジャッジ日時 | 2024-10-12 19:14:44 |
| 合計ジャッジ時間 | 8,087 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 2 WA * 37 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int ans = 0;
for(int i = n - 1; i >= 1; i++) {
if((n % i) == 0) {
ans = i;
break;
}
}
System.out.println(ans);
}
}
takeya_okino