結果
問題 |
No.701 ひとりしりとり
|
ユーザー |
|
提出日時 | 2018-06-16 14:13:45 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 135 ms / 2,000 ms |
コード長 | 558 bytes |
コンパイル時間 | 1,391 ms |
コンパイル使用メモリ | 160,848 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 16:14:28 |
合計ジャッジ時間 | 2,285 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++) #define rep(i, n) FOR(i, 0, n) int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; string s = "abcdefghijklmnopq"; int count = 0; do{ count++; cout << "a" << s; if (count < n) cout << "a" << endl; else { cout << "n" << endl; break; } } while(next_permutation(s.begin(), s.end())); return 0; }