結果

問題 No.744 循環小数N桁目 Easy
ユーザー GrenacheGrenache
提出日時 2019-04-26 16:27:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 600 bytes
コンパイル時間 3,634 ms
コンパイル使用メモリ 71,676 KB
実行使用メモリ 56,296 KB
最終ジャッジ日時 2023-08-16 04:41:01
合計ジャッジ時間 5,823 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
55,948 KB
testcase_01 AC 110 ms
55,784 KB
testcase_02 AC 117 ms
55,928 KB
testcase_03 AC 110 ms
56,144 KB
testcase_04 AC 116 ms
55,776 KB
testcase_05 AC 111 ms
56,296 KB
testcase_06 AC 109 ms
55,532 KB
testcase_07 AC 107 ms
56,040 KB
testcase_08 AC 111 ms
55,784 KB
testcase_09 AC 110 ms
55,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.Scanner;


public class Main_yukicoder750 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		String n27 = "285714";

		int n = sc.nextInt();
		int MOD = n27.length();

		pr.println(n27.charAt((n - 1) % MOD));
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
0