結果

問題 No.701 ひとりしりとり
ユーザー ama_nukoama_nuko
提出日時 2018-07-10 19:33:29
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 724 bytes
コンパイル時間 1,802 ms
コンパイル使用メモリ 93,860 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 16:41:12
合計ジャッジ時間 2,048 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

signed main(){
    int n;
    cin >> n;

    int i = 0;
    while(i+1 < n){
        int x = i;
        cout << 'a';
        while(x > 0){
            cout << (char)(x % 26 + 'a');
            x /= 26;
        }
        cout << 'a' << endl;
        i++;
    }
    cout << "an" << endl;

    return 0;
}
0