結果

問題 No.254 文字列の構成
ユーザー sugim48sugim48
提出日時 2015-07-14 23:02:27
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 309 bytes
コンパイル時間 1,322 ms
コンパイル使用メモリ 158,556 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-08 07:20:00
合計ジャッジ時間 2,694 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N; cin >> N;
    char a = 'a', b = 'b';
    while (N > 0) {
        int n = sqrt(N);
        N -= n * n;
        for (int i = 0; i < n - 1; i++)
            cout << a << b;
        cout << a;
        a += 2; b += 2;
    }
    cout << endl;
}
0