結果

問題 No.701 ひとりしりとり
ユーザー gotutiyangotutiyan
提出日時 2018-06-17 00:39:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 1,011 bytes
コンパイル時間 617 ms
コンパイル使用メモリ 81,652 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 06:17:05
合計ジャッジ時間 1,675 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

int main(){
    int n;
    string s="abcdefghijklmnopqr";
    cin>>n;
    int t=0;
    do{
        t++;
        cout<<"a";
        cout<<s;
        if(t<n)cout<<"a"<<endl;
        else {
            cout<<"n"<<endl;
            return 0;
        }
        
    }while(next_permutation(all(s)));
    
    return 0;
}
0