結果

問題 No.701 ひとりしりとり
ユーザー eQeeQe
提出日時 2020-05-03 20:54:58
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 764 bytes
コンパイル時間 2,320 ms
コンパイル使用メモリ 145,436 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-05 03:19:09
合計ジャッジ時間 5,566 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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) {
  if(cnt>N) return;
  cnt++;
  
  for(auto cc:c) cout << cc;
  pt("");
  
  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]='n'; c[19]='n';
  for(i=1; i<19; i++) c[i]='a';
  dfs(c, 1);
  
}
 
 
0