結果
問題 | No.747 循環小数N桁目 Hard |
ユーザー | 37zigen |
提出日時 | 2020-03-22 06:38:07 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 671 ms / 2,000 ms |
コード長 | 730 bytes |
コンパイル時間 | 2,230 ms |
コンパイル使用メモリ | 75,232 KB |
実行使用メモリ | 44,568 KB |
最終ジャッジ日時 | 2024-06-06 22:11:07 |
合計ジャッジ時間 | 42,933 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 129 ms
41,352 KB |
testcase_01 | AC | 126 ms
41,260 KB |
testcase_02 | AC | 129 ms
41,532 KB |
testcase_03 | AC | 129 ms
41,040 KB |
testcase_04 | AC | 126 ms
41,620 KB |
testcase_05 | AC | 128 ms
41,508 KB |
testcase_06 | AC | 131 ms
41,272 KB |
testcase_07 | AC | 125 ms
41,144 KB |
testcase_08 | AC | 127 ms
41,284 KB |
testcase_09 | AC | 127 ms
41,020 KB |
testcase_10 | AC | 128 ms
41,076 KB |
testcase_11 | AC | 128 ms
41,528 KB |
testcase_12 | AC | 127 ms
41,360 KB |
testcase_13 | AC | 128 ms
41,184 KB |
testcase_14 | AC | 130 ms
41,204 KB |
testcase_15 | AC | 129 ms
41,352 KB |
testcase_16 | AC | 128 ms
41,444 KB |
testcase_17 | AC | 129 ms
41,392 KB |
testcase_18 | AC | 127 ms
41,208 KB |
testcase_19 | AC | 130 ms
41,392 KB |
testcase_20 | AC | 129 ms
41,260 KB |
testcase_21 | AC | 128 ms
41,356 KB |
testcase_22 | AC | 137 ms
41,276 KB |
testcase_23 | AC | 130 ms
41,188 KB |
testcase_24 | AC | 130 ms
41,404 KB |
testcase_25 | AC | 128 ms
41,400 KB |
testcase_26 | AC | 129 ms
41,364 KB |
testcase_27 | AC | 130 ms
41,180 KB |
testcase_28 | AC | 125 ms
41,124 KB |
testcase_29 | AC | 128 ms
41,620 KB |
testcase_30 | AC | 114 ms
40,252 KB |
testcase_31 | AC | 116 ms
41,376 KB |
testcase_32 | AC | 129 ms
40,832 KB |
testcase_33 | AC | 284 ms
42,884 KB |
testcase_34 | AC | 287 ms
42,152 KB |
testcase_35 | AC | 201 ms
42,152 KB |
testcase_36 | AC | 255 ms
42,464 KB |
testcase_37 | AC | 212 ms
41,776 KB |
testcase_38 | AC | 316 ms
42,920 KB |
testcase_39 | AC | 284 ms
42,364 KB |
testcase_40 | AC | 426 ms
43,436 KB |
testcase_41 | AC | 444 ms
43,448 KB |
testcase_42 | AC | 281 ms
43,280 KB |
testcase_43 | AC | 215 ms
42,068 KB |
testcase_44 | AC | 259 ms
42,636 KB |
testcase_45 | AC | 407 ms
43,324 KB |
testcase_46 | AC | 353 ms
43,460 KB |
testcase_47 | AC | 296 ms
43,164 KB |
testcase_48 | AC | 350 ms
42,936 KB |
testcase_49 | AC | 257 ms
42,512 KB |
testcase_50 | AC | 206 ms
42,244 KB |
testcase_51 | AC | 220 ms
41,744 KB |
testcase_52 | AC | 200 ms
42,020 KB |
testcase_53 | AC | 520 ms
44,232 KB |
testcase_54 | AC | 512 ms
43,652 KB |
testcase_55 | AC | 576 ms
43,972 KB |
testcase_56 | AC | 518 ms
43,512 KB |
testcase_57 | AC | 289 ms
42,584 KB |
testcase_58 | AC | 557 ms
44,368 KB |
testcase_59 | AC | 256 ms
42,720 KB |
testcase_60 | AC | 425 ms
43,492 KB |
testcase_61 | AC | 428 ms
43,668 KB |
testcase_62 | AC | 341 ms
43,340 KB |
testcase_63 | AC | 293 ms
42,900 KB |
testcase_64 | AC | 282 ms
42,536 KB |
testcase_65 | AC | 178 ms
41,700 KB |
testcase_66 | AC | 271 ms
43,164 KB |
testcase_67 | AC | 306 ms
42,996 KB |
testcase_68 | AC | 393 ms
43,160 KB |
testcase_69 | AC | 281 ms
43,048 KB |
testcase_70 | AC | 283 ms
42,776 KB |
testcase_71 | AC | 205 ms
41,684 KB |
testcase_72 | AC | 359 ms
42,912 KB |
testcase_73 | AC | 389 ms
43,028 KB |
testcase_74 | AC | 271 ms
42,980 KB |
testcase_75 | AC | 195 ms
42,148 KB |
testcase_76 | AC | 335 ms
42,360 KB |
testcase_77 | AC | 221 ms
41,948 KB |
testcase_78 | AC | 264 ms
42,488 KB |
testcase_79 | AC | 272 ms
42,828 KB |
testcase_80 | AC | 289 ms
42,740 KB |
testcase_81 | AC | 198 ms
41,680 KB |
testcase_82 | AC | 239 ms
42,176 KB |
testcase_83 | AC | 214 ms
41,844 KB |
testcase_84 | AC | 293 ms
42,900 KB |
testcase_85 | AC | 291 ms
42,892 KB |
testcase_86 | AC | 244 ms
42,396 KB |
testcase_87 | AC | 437 ms
43,376 KB |
testcase_88 | AC | 327 ms
42,308 KB |
testcase_89 | AC | 235 ms
42,120 KB |
testcase_90 | AC | 375 ms
43,296 KB |
testcase_91 | AC | 409 ms
43,584 KB |
testcase_92 | AC | 259 ms
42,952 KB |
testcase_93 | AC | 397 ms
43,564 KB |
testcase_94 | AC | 514 ms
43,944 KB |
testcase_95 | AC | 542 ms
43,768 KB |
testcase_96 | AC | 503 ms
43,792 KB |
testcase_97 | AC | 575 ms
43,596 KB |
testcase_98 | AC | 671 ms
44,500 KB |
testcase_99 | AC | 460 ms
44,504 KB |
testcase_100 | AC | 423 ms
44,532 KB |
testcase_101 | AC | 301 ms
42,668 KB |
testcase_102 | AC | 390 ms
43,748 KB |
testcase_103 | AC | 333 ms
42,852 KB |
testcase_104 | AC | 506 ms
43,784 KB |
testcase_105 | AC | 506 ms
43,524 KB |
testcase_106 | AC | 360 ms
43,268 KB |
testcase_107 | AC | 365 ms
43,040 KB |
testcase_108 | AC | 509 ms
44,276 KB |
testcase_109 | AC | 364 ms
43,016 KB |
testcase_110 | AC | 502 ms
43,708 KB |
testcase_111 | AC | 528 ms
44,568 KB |
testcase_112 | AC | 367 ms
43,132 KB |
testcase_113 | AC | 501 ms
44,404 KB |
testcase_114 | AC | 359 ms
43,028 KB |
testcase_115 | AC | 349 ms
43,148 KB |
testcase_116 | AC | 484 ms
43,560 KB |
testcase_117 | AC | 363 ms
43,292 KB |
testcase_118 | AC | 474 ms
43,488 KB |
testcase_119 | AC | 363 ms
43,244 KB |
testcase_120 | AC | 364 ms
43,324 KB |
testcase_121 | AC | 499 ms
43,916 KB |
testcase_122 | AC | 445 ms
43,004 KB |
testcase_123 | AC | 492 ms
43,952 KB |
ソースコード
import java.io.FileNotFoundException; import java.math.BigInteger; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws FileNotFoundException { long t = System.currentTimeMillis(); new Main().run(); System.err.println(System.currentTimeMillis() - t); } void run() { Scanner sc = new Scanner(System.in); BigInteger N=new BigInteger(sc.next()).mod(BigInteger.valueOf(6)); BigInteger K=new BigInteger(sc.next()); N=N.modPow(K, BigInteger.valueOf(6)); int[] ans=new int[] {2,8,5,7,1,4}; System.out.println(N.intValue()==0?4:ans[N.intValue()-1]); } static void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }