結果
問題 | No.1198 お菓子配り-1 |
ユーザー |
![]() |
提出日時 | 2020-08-28 21:34:45 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 128 ms / 2,000 ms |
コード長 | 773 bytes |
コンパイル時間 | 2,082 ms |
コンパイル使用メモリ | 74,664 KB |
実行使用メモリ | 41,548 KB |
最終ジャッジ日時 | 2024-11-16 09:17:04 |
合計ジャッジ時間 | 4,980 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 |
ソースコード
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); BigInteger n = sc.nextBigInteger(); sc.close(); BigInteger b0 = BigInteger.ZERO; BigInteger b1 = BigInteger.ONE; BigInteger b2 = BigInteger.valueOf(2); BigInteger b3 = BigInteger.valueOf(3); BigInteger b4 = BigInteger.valueOf(4); BigInteger b8 = BigInteger.valueOf(8); if (n.remainder(b2).compareTo(b1) == 0) { if (n.compareTo(b3) >= 0) { System.out.println(1); } else { System.out.println(-1); } } else { if (n.remainder(b4).compareTo(b0) == 0 && n.compareTo(b8) >= 0) { System.out.println(1); } else { System.out.println(-1); } } } }