結果

問題 No.254 文字列の構成
ユーザー climpet
提出日時 2015-07-25 01:37:23
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 272 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 56,332 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-16 04:20:22
合計ジャッジ時間 2,100 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 28 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;

int main(){
	int n;
	cin >> n;
	string s = "a";
	
	int t = n - 1;
	for(int i = 2; i * i <= n; ++i){
		s += "ba";
		t = n - i * i;
	}
	for(int i = 0; i < t; ++i){
		s += "sugim"[i % 5];
	}
	
	cout << s << '\n';
}
0