Submission #18056


Source Code Expand

Copy
// compile with "g++ XXX.cc -mno-cygwin -O2" in Cygwin

#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<numeric>
#include<functional>
#include<complex>
#include<bitset>
#include<cassert>

using namespace std;
#define BET(a,b,c) ((a)<=(b)&&(b)<(c))
#define FOR(i,n) for(int i=0,i##_end=(int(n));i<i##_end;i++)
#define FOR3(i,a,b) for(int i=a,i##_end=b;i<i##_end;i++)
#define FOR_EACH(it,v) for(__typeof(v.begin()) it=v.begin(),it_end=v.end() ; it != it_end ; it++)
#define SZ(x) (int)(x.size())
#define ALL(x) (x).begin(),(x).end()
#define MP make_pair
#define CLS(x,val) memset((x) , val , sizeof(x)) 
typedef long long ll_t;
typedef long double ld_t;
typedef vector<int> VI; 
typedef vector<VI> VVI;
typedef complex<int> xy_t;

template<typename T> void debug(T v , string delimiter = "\n")
{ for(__typeof(v.begin()) it=v.begin(),it_end=v.end() ; it != it_end ; it++) cout << *it << delimiter; cout << flush ;}

int dx[]  = {0,1,0,-1};
int dy[]  = {1,0,-1,0};
string ds = "SENW";

const double PI = 4.0*atan(1.0);

int main() {
  int n;
  vector<pair<string,string> > dat;
  cin>>n;
  FOR(i,n){
    string s;
    cin>>s;
    string ns(s);
    reverse(ALL(ns));
    dat.push_back(MP(ns,s));
  }
  sort(ALL(dat));
  FOR(i,SZ(dat)) cout<<dat[i].second<<endl;
  return 0 ;
}

Submission Info

Submission Time
Task B - さかさま辞書
User EmK
Language C++ (G++ 4.6.4)
Score 100
Code Size 1494 Byte
Status AC
Exec Time 36 ms
Memory 820 KB

Judge Result

Set Name all
Score / Max Score 100 / 100
Status
AC × 28
Set Name Test Cases
all 00_sample_01.txt, 00_sample_02.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 02_long_01.txt, 02_long_02.txt, 02_long_03.txt, 03_short_01.txt, 03_short_02.txt, 03_short_03.txt, 04_max_01.txt, 04_max_02.txt, 04_max_03.txt, 04_max_04.txt, 04_max_05.txt, 05_samestring_01.txt, 05_samestring_02.txt, 05_samestring_03.txt, 05_samestring_04.txt, 05_samestring_05.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 22 ms 820 KB
00_sample_02.txt AC 22 ms 764 KB
01_rand_01.txt AC 24 ms 796 KB
01_rand_02.txt AC 22 ms 792 KB
01_rand_03.txt AC 23 ms 792 KB
01_rand_04.txt AC 23 ms 788 KB
01_rand_05.txt AC 22 ms 736 KB
01_rand_06.txt AC 23 ms 788 KB
01_rand_07.txt AC 22 ms 796 KB
01_rand_08.txt AC 22 ms 692 KB
01_rand_09.txt AC 36 ms 760 KB
01_rand_10.txt AC 22 ms 800 KB
02_long_01.txt AC 23 ms 776 KB
02_long_02.txt AC 22 ms 788 KB
02_long_03.txt AC 23 ms 796 KB
03_short_01.txt AC 22 ms 732 KB
03_short_02.txt AC 23 ms 796 KB
03_short_03.txt AC 22 ms 816 KB
04_max_01.txt AC 23 ms 816 KB
04_max_02.txt AC 28 ms 784 KB
04_max_03.txt AC 23 ms 792 KB
04_max_04.txt AC 23 ms 788 KB
04_max_05.txt AC 23 ms 784 KB
05_samestring_01.txt AC 23 ms 788 KB
05_samestring_02.txt AC 28 ms 792 KB
05_samestring_03.txt AC 22 ms 784 KB
05_samestring_04.txt AC 23 ms 788 KB
05_samestring_05.txt AC 23 ms 820 KB