結果

問題 No.744 循環小数N桁目 Easy
ユーザー NewbiekunNewbiekun
提出日時 2019-02-20 16:36:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 3,606 ms
コンパイル使用メモリ 74,280 KB
実行使用メモリ 41,452 KB
最終ジャッジ日時 2024-04-24 15:23:27
合計ジャッジ時間 5,698 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
41,120 KB
testcase_01 AC 112 ms
40,048 KB
testcase_02 AC 125 ms
40,844 KB
testcase_03 AC 122 ms
41,452 KB
testcase_04 AC 121 ms
40,080 KB
testcase_05 AC 119 ms
41,352 KB
testcase_06 AC 114 ms
40,312 KB
testcase_07 AC 126 ms
41,088 KB
testcase_08 AC 120 ms
40,912 KB
testcase_09 AC 124 ms
40,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No744
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String sample = "285714";

// n=4なら4%6 = 0..4なので4桁目の"7"
		String ans = sample.substring( (n-1)%6, n%6 );

		System.out.println( ans );
	}
}
0