結果
問題 | No.701 ひとりしりとり |
ユーザー | ミドリムシ |
提出日時 | 2018-06-15 22:25:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 185 ms / 2,000 ms |
コード長 | 503 bytes |
コンパイル時間 | 598 ms |
コンパイル使用メモリ | 69,828 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 15:00:23 |
合計ジャッジ時間 | 1,575 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> using namespace std; char get(){ while(true){ int ans = rand() % 26; if(ans != 'n' - 'a'){ return ans + 'a'; } } } int main(){ int n; cin >> n; char back = 'a'; for(int i = 0; i < n - 1; i++){ cout << back; for(int j = 0; j < 18; j++){ cout << get(); } back = get(); cout << back << endl; } cout << back << "n" << endl; }