結果

問題 No.746 7の倍数
ユーザー Mcpu3Mcpu3
提出日時 2018-10-19 23:30:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 286 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 2,139 ms
コンパイル使用メモリ 74,276 KB
実行使用メモリ 47,764 KB
最終ジャッジ日時 2024-04-29 17:07:32
合計ジャッジ時間 7,969 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
41,400 KB
testcase_01 AC 127 ms
41,088 KB
testcase_02 AC 116 ms
39,972 KB
testcase_03 AC 286 ms
47,764 KB
testcase_04 AC 143 ms
40,312 KB
testcase_05 AC 167 ms
40,340 KB
testcase_06 AC 238 ms
43,588 KB
testcase_07 AC 195 ms
41,848 KB
testcase_08 AC 233 ms
44,288 KB
testcase_09 AC 181 ms
40,916 KB
testcase_10 AC 171 ms
41,476 KB
testcase_11 AC 257 ms
46,200 KB
testcase_12 AC 269 ms
47,672 KB
testcase_13 AC 261 ms
45,612 KB
testcase_14 AC 251 ms
46,208 KB
testcase_15 AC 245 ms
45,344 KB
testcase_16 AC 253 ms
46,056 KB
testcase_17 AC 253 ms
45,852 KB
testcase_18 AC 255 ms
45,812 KB
testcase_19 AC 248 ms
45,716 KB
testcase_20 AC 195 ms
41,808 KB
testcase_21 AC 177 ms
40,632 KB
testcase_22 AC 260 ms
45,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		String tmp = "142857";
		if (N == 0) System.out.print(0);
		else {
			System.out.print("0.");
			for (int i = 0; i < N / 6; ++i) System.out.print(tmp);
			for (int i = 0; i < N % 6; ++i) System.out.print(tmp.charAt(i));
		}
	}
}
0