結果

問題 No.744 循環小数N桁目 Easy
ユーザー Grenache
提出日時 2019-04-26 16:27:11
言語 Java
(openjdk 23)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 600 bytes
コンパイル時間 3,651 ms
コンパイル使用メモリ 74,976 KB
実行使用メモリ 41,808 KB
最終ジャッジ日時 2024-11-24 14:27:54
合計ジャッジ時間 5,718 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

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