結果

問題 No.701 ひとりしりとり
ユーザー 37zigen37zigen
提出日時 2018-06-16 00:02:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,941 ms / 2,000 ms
コード長 714 bytes
コンパイル時間 2,083 ms
コンパイル使用メモリ 72,472 KB
実行使用メモリ 64,864 KB
最終ジャッジ日時 2023-09-13 05:31:04
合計ジャッジ時間 7,240 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,988 KB
testcase_01 AC 123 ms
56,544 KB
testcase_02 AC 124 ms
56,128 KB
testcase_03 AC 127 ms
56,268 KB
testcase_04 AC 128 ms
56,216 KB
testcase_05 AC 129 ms
56,208 KB
testcase_06 AC 128 ms
56,292 KB
testcase_07 AC 128 ms
56,616 KB
testcase_08 AC 160 ms
56,604 KB
testcase_09 AC 226 ms
57,232 KB
testcase_10 AC 537 ms
61,940 KB
testcase_11 AC 1,941 ms
64,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		new Main().run();
	}

	String s = "abcdefghijklmnopqrstuvwxyz";

	void run() throws FileNotFoundException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		while (n > 0) {
			System.out.print("a");
			for (int i = 0; i < 6; ++i) {
				System.out.print(s.charAt((int) (n / Math.pow(10, i) % 10)));
			}
			if (n > 1)
				System.out.println("a");
			else
				System.out.println("n");
			--n;
		}
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
0