結果
| 問題 | No.701 ひとりしりとり | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-05-03 23:18:22 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 878 bytes | 
| コンパイル時間 | 1,341 ms | 
| コンパイル使用メモリ | 160,384 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-06-23 04:24:15 | 
| 合計ジャッジ時間 | 4,145 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 2 WA * 3 RE * 7 | 
ソースコード
#include <bits/stdc++.h>
#include <string>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) (a)=max(a, b)
#define chmin(a, b) (a)=min(a, b)
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;
/*
 for(i=0; i<N; i++)
   cin >> a[i];
*/
ll N;
ll cnt=1;
void dfs(vector<char> c, ll k) {
  cnt++;
  if(cnt>N) return;
  
  
  for(ll i=0; i<20; i++) cout << c[i];
  pt("");
  
  if(cnt==N) {
    for(ll i=0; i<19; i++) cout << c[i];
    cout << 'n';
    pt("");
    return;
  }
  
  for(char p='b'; p<='z'; p++) {
    c[k]=p;
    dfs(c, k+1);
  }
  
}
int main(void) {
  ll i, j, k;
  cin >> N;
  
  vector<char> c(20);
  c[0]='z'; c[19]='z';
  for(i=1; i<19; i++) c[i]='a';
  dfs(c, 1);
  
}
 
 
            
            
            
        