Submission #57376


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <ios>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <forward_list>
#include <random>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <unordered_map>
#include <unordered_set>
#endif
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm( a, b ) (a)/__gcd((a),(b))*(b)
#define endl '\n'
using namespace std;
typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;
static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 200005;
const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};
vector< int > Div( int n ) {
vector< int > ret;
for( int i = 1; i * i <= n; ++i ) {
if( n % i == 0 ) {
ret.pb( i );
if( i * i != n ) ret.pb( n / i );
}
}
sort( all( ret ) );
return ret;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector< pair<int, string> > v;
for( int i = 0; i < n; ++i ) {
string s;
cin >> s;
v.pb( MP(s.size(), s) );
}
sort( all(v) );
for( int i = 0; i < n; ++i ) {
cout << v[i].S << endl;
}
return 0;
}

ステータス

項目 データ
問題 1225 - std::sort
ユーザー名 crom
投稿日時 2019-12-15 15:02:34
言語 C++11
状態 Accepted
得点 10
ソースコード長 2199 Byte
最大実行時間 93 ms
最大メモリ使用量 59664 KB

セット

セット 得点 Cases
1 ALL 10 / 10 in*

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01-01.txt AC 37 ms 732 KB
1
in01-02.txt AC 20 ms 596 KB
1
in01-03.txt AC 16 ms 420 KB
1
in02-01.txt AC 20 ms 508 KB
1
in02-02.txt AC 17 ms 568 KB
1
in02-03.txt AC 25 ms 1484 KB
1
in02-04.txt AC 63 ms 11716 KB
1
in02-05.txt AC 61 ms 13720 KB
1
in02-06.txt AC 61 ms 16040 KB
1
in02-07.txt AC 62 ms 18284 KB
1
in02-08.txt AC 63 ms 21884 KB
1
in03-01.txt AC 25 ms 13732 KB
1
in03-02.txt AC 21 ms 13944 KB
1
in03-03.txt AC 82 ms 30052 KB
1
in03-04.txt AC 93 ms 33856 KB
1
in03-05.txt AC 84 ms 39140 KB
1
in03-06.txt AC 79 ms 44108 KB
1
in03-07.txt AC 77 ms 49312 KB
1
in03-08.txt AC 22 ms 38652 KB
1
in03-09.txt AC 42 ms 45632 KB
1
in03-10.txt AC 48 ms 45312 KB
1
in03-11.txt AC 55 ms 54544 KB
1
in03-12.txt AC 23 ms 44332 KB
1
in03-13.txt AC 59 ms 59664 KB
1
sample01.txt AC 17 ms 49440 KB
sample02.txt AC 20 ms 49524 KB