結果

問題 No.701 ひとりしりとり
ユーザー aaaaaa
提出日時 2018-07-17 19:15:56
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,041 bytes
コンパイル時間 788 ms
コンパイル使用メモリ 92,596 KB
実行使用メモリ 7,824 KB
最終ジャッジ日時 2023-08-17 10:59:22
合計ジャッジ時間 5,353 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>

using namespace std;


int main() {
	int i, j, k;
	int n;
	//vector<string>s(100000, "aaaaaaaaaaaaaaaaaaaa");
	int ke[20] = { 0 };

	cin >> n;

	int iti = 1, cnt = 0, cnt2 = 0, amari, keta = 0;



	for (i = 1; i <= n; i++) {
		keta = 0;
		for (j = 1; j <= i; j++) {
			ke[keta]++;
			
			bool flag = false;

			while (ke[keta]==25)
			{
				ke[keta + 1]++;
				ke[keta] = 0;
				keta++;
				flag = true;
			}
			
			if (flag == true) {
				keta = 0;
			}
		}

		cout << "a";
		for (int j = 0; j < 18; j++) {
			//cout << setw(3) << ke[i] << "  ";
			cout << (char)( 97 + ke[j]) ;
		}
		if (i == n) {
			cout << "n";
		}
		else {
			cout << "a";
		}
		cout << endl;
		for (int i = 0; i < 18; i++) {
			ke[i] = 0;
		}
	}








	getchar();
	getchar();
	return 0;
}
0