結果
| 問題 | No.701 ひとりしりとり | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-06-18 05:29:44 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 132 ms / 2,000 ms | 
| コード長 | 329 bytes | 
| コンパイル時間 | 554 ms | 
| コンパイル使用メモリ | 66,416 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-30 16:47:41 | 
| 合計ジャッジ時間 | 1,618 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 12 | 
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~
            
            ソースコード
#include<iostream>
using namespace std;
string s[99];
int n;
main()
{
	cin>>n;
	for(int i=0;i<10;i++)s[i]=char(i+'a')+string(5,'a');
	int now=0;
	for(int i=0;i<n;i++)
	{
		cout<<s[now]<<(i==n-1?"n":"")<<endl;
		int next=s[now][5]-'a';
		s[now][5]++;
		int j=5;
		while(s[now][j]>'j')s[now][j]='a',s[now][--j]++;
		now=next;
	}
}
            
            
            
        