結果

問題 No.701 ひとりしりとり
ユーザー 37zigen37zigen
提出日時 2018-06-16 00:04:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 388 ms / 2,000 ms
コード長 743 bytes
コンパイル時間 1,886 ms
コンパイル使用メモリ 72,692 KB
実行使用メモリ 58,808 KB
最終ジャッジ日時 2023-09-13 05:32:00
合計ジャッジ時間 4,771 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,832 KB
testcase_01 AC 120 ms
56,116 KB
testcase_02 AC 120 ms
55,704 KB
testcase_03 AC 121 ms
56,168 KB
testcase_04 AC 120 ms
56,208 KB
testcase_05 AC 121 ms
56,036 KB
testcase_06 AC 129 ms
56,232 KB
testcase_07 AC 122 ms
56,520 KB
testcase_08 AC 127 ms
55,984 KB
testcase_09 AC 156 ms
55,708 KB
testcase_10 AC 200 ms
56,020 KB
testcase_11 AC 388 ms
58,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
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();
		PrintWriter pw = new PrintWriter(System.out);
		while (n > 0) {
			pw.print("a");
			for (int i = 0; i < 6; ++i) {
				pw.print(s.charAt((int) (n / Math.pow(10, i) % 10)));
			}
			if (n > 1)
				pw.println("a");
			else
				pw.println("n");
			--n;
		}
		pw.close();
	}

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