結果

問題 No.701 ひとりしりとり
ユーザー 37zigen
提出日時 2018-06-16 00:04:03
言語 Java
(openjdk 23)
結果
AC  
実行時間 419 ms / 2,000 ms
コード長 743 bytes
コンパイル時間 2,077 ms
コンパイル使用メモリ 78,580 KB
実行使用メモリ 59,588 KB
最終ジャッジ日時 2024-06-30 15:41:34
合計ジャッジ時間 4,994 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

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