結果

問題 No.747 循環小数N桁目 Hard
コンテスト
ユーザー nuhehe130
提出日時 2018-10-30 22:57:07
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
WA  
実行時間 -
コード長 640 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,168 ms
コンパイル使用メモリ 82,000 KB
実行使用メモリ 51,880 KB
最終ジャッジ日時 2026-05-13 18:28:45
合計ジャッジ時間 17,486 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2 RE * 2
other WA * 24 RE * 96
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package test;

import java.util.Scanner;

public class test {
	public static void main(String[] args) {
		
        Scanner scn = new Scanner(System.in);
        String str1 = scn.nextLine();
        String str2 = scn.nextLine();
        int ints[] = {2,8,5,7,1,4};
        
        int N = Integer.parseInt(str1);
        int K = Integer.parseInt(str2);
        
        int keta = 1;
        //NのK乗桁目
        for (int i = 0;i < K ;i++) {
            keta *= N;
        }
        
//        System.out.println(keta);
        
        keta %= 6;
        
        System.out.println(ints[keta]);
        scn.close();
        
		
	}
}
0