結果

問題 No.744 循環小数N桁目 Easy
ユーザー GrenacheGrenache
提出日時 2019-04-26 16:27:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 600 bytes
コンパイル時間 3,717 ms
コンパイル使用メモリ 75,204 KB
実行使用メモリ 41,556 KB
最終ジャッジ日時 2024-05-03 14:00:43
合計ジャッジ時間 5,110 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
41,216 KB
testcase_01 AC 125 ms
41,432 KB
testcase_02 AC 126 ms
41,552 KB
testcase_03 AC 127 ms
41,420 KB
testcase_04 AC 124 ms
41,280 KB
testcase_05 AC 129 ms
41,348 KB
testcase_06 AC 127 ms
41,448 KB
testcase_07 AC 128 ms
41,532 KB
testcase_08 AC 127 ms
41,464 KB
testcase_09 AC 128 ms
41,556 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