結果
問題 |
No.701 ひとりしりとり
|
ユーザー |
![]() |
提出日時 | 2023-08-26 23:47:03 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 858 bytes |
コンパイル時間 | 4,464 ms |
コンパイル使用メモリ | 259,012 KB |
最終ジャッジ日時 | 2025-02-16 14:53:47 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 1 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using namespace std; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll mod=998244353; ll inf=1009999999999999990; int main(){ ll n; cin >> n; map<string,ll>memo; memo["a"]++; cout << "a" << endl; for (ll i = 0; i < n-1; i++) { while (1) { string s="a"; for (ll j = 0; j < 18; j++) { char c='a'; c+=rand()%26; s.push_back(c); } if (i==n-2) { s.push_back('n'); }else{ s.push_back('a'); } if (memo[s]==0) { memo[s]++; cout << s << endl; break; } } } }