AtCoder Beginner Contest 025

Submission #432356

Source codeソースコード

#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
#define mem(a) memset(a,0,sizeof(a))
#define pb(a) push_back(a)
#define in(a) insert(a)
#define R cin>>
#define F first
#define S second
#define C class
#define ll long long
#define ln cout<<'\n'
#define _(_1,_2,_3,N,...)N
#define pr(...) _(__VA_ARGS__,pr3,pr2,pr1)(__VA_ARGS__)
template<C T>void pr1(T a){cout<<a;ln;}
template<C T,C T2>void pr2(T a,T2 b){cout<<a<<' '<<b;ln;}
template<C T,C T2,C T3>void pr3(T a,T2 b,T3 c){cout<<a<<' '<<b<<' '<<c;ln;}
template<C T>void PR(T a,int n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
bool check(int n,int m,int x,int y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<60,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;


void Main() {
  string s;
  R s;
  vector<string> a;
  rep(i,s.size()) {
    rep(j,s.size()) {
      string t="";
      t+=s[i];t+=s[j];
      a.pb(t);
    }
  }
  sort(all(a));
  int n;
  R n;
  pr(a[n-1]);
}

int main() {
  ios::sync_with_stdio(0);cin.tie(0);Main();
  return 0;
}

Submission

Task問題 A - 25個の文字列
User nameユーザ名 kzyKT
Created time投稿日時
Language言語 C++ (GCC 4.9.2)
Status状態 AC
Score得点 100
Source lengthソースコード長 1339 Byte
File nameファイル名
Exec time実行時間 33 ms
Memory usageメモリ使用量 1044 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - sample-01.txt,sample-02.txt,sample-03.txt
All 100 / 100 test-01.txt,test-02.txt,test-03.txt,test-04.txt,test-05.txt,test-06.txt,test-07.txt,test-08.txt,test-09.txt,test-10.txt,test-11.txt,test-12.txt,test-13.txt,test-14.txt,test-15.txt,test-16.txt,test-17.txt,test-18.txt,test-19.txt,test-20.txt,test-21.txt,test-22.txt,test-23.txt,test-24.txt,test-25.txt,test-26.txt,test-27.txt,test-28.txt,test-29.txt,test-30.txt,sample-01.txt,sample-02.txt,sample-03.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
sample-01.txt AC 33 ms 872 KB
sample-02.txt AC 31 ms 1036 KB
sample-03.txt AC 29 ms 1040 KB
test-01.txt AC 31 ms 960 KB
test-02.txt AC 29 ms 1040 KB
test-03.txt AC 26 ms 1044 KB
test-04.txt AC 28 ms 872 KB
test-05.txt AC 29 ms 1044 KB
test-06.txt AC 29 ms 1044 KB
test-07.txt AC 28 ms 872 KB
test-08.txt AC 28 ms 868 KB
test-09.txt AC 27 ms 936 KB
test-10.txt AC 27 ms 940 KB
test-11.txt AC 32 ms 932 KB
test-12.txt AC 27 ms 960 KB
test-13.txt AC 27 ms 940 KB
test-14.txt AC 27 ms 940 KB
test-15.txt AC 27 ms 944 KB
test-16.txt AC 27 ms 940 KB
test-17.txt AC 26 ms 1044 KB
test-18.txt AC 26 ms 980 KB
test-19.txt AC 25 ms 1044 KB
test-20.txt AC 27 ms 940 KB
test-21.txt AC 26 ms 940 KB
test-22.txt AC 27 ms 1040 KB
test-23.txt AC 26 ms 936 KB
test-24.txt AC 26 ms 1044 KB
test-25.txt AC 26 ms 940 KB
test-26.txt AC 29 ms 1036 KB
test-27.txt AC 26 ms 940 KB
test-28.txt AC 27 ms 940 KB
test-29.txt AC 30 ms 944 KB
test-30.txt AC 26 ms 940 KB