結果

問題 No.701 ひとりしりとり
ユーザー 37zigen37zigen
提出日時 2018-06-16 00:03:00
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 751 bytes
コンパイル時間 1,894 ms
コンパイル使用メモリ 72,864 KB
実行使用メモリ 66,800 KB
最終ジャッジ日時 2023-09-13 05:31:51
合計ジャッジ時間 6,301 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
56,048 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

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) {
			System.out.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