結果

問題 No.701 ひとりしりとり
ユーザー ohreitetsuohreitetsu
提出日時 2018-06-16 11:33:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 503 bytes
コンパイル時間 495 ms
コンパイル使用メモリ 65,648 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-13 06:00:45
合計ジャッジ時間 2,560 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
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 #

#include <iostream>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
	int n;
	cin>>n;
	int m=20;
	char ch='a';
	int i,j;
	char ch1=ch;
	string S;
	for (i=0;i<n;i++){
		for (j=0;j<19;j++){
			if (j==0){
				S.push_back(ch1);
				continue;
			}
			int index=(i+j)%26;
			if (ch+index>'z'){
				ch='a';
			}
			if (ch+index=='n'){
				index++;
			}
			S.push_back(char(ch+index));
			ch1=ch+index;
		}
		cout<<S<<endl;
		S.clear();
		if (ch1=='n'){
			return 0;
		}
	}
	return 0;
}
0