Submission #00111
ソースコード
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 | #include <bits/stdc++.h> #define endl "\n" #define INF INT_MAX using namespace std; int main(){ #define int long long cin.tie(nullptr);ios::sync_with_stdio( false ); int n; cin >>n; vector<pair<string,string>>a(n); for ( int i = 0;i < n;i++){ string s,t; cin >>s>>t; string l = "" ; for ( int j = 0;j < 40-t.size();j++)l+= "0" ; l += t; a[i] = {l,s}; } bool f = 0; sort(a.rbegin(),a.rend()); for ( int i = n-1;i > n/2;i--){ if (a[i].second == "gousuper" )f = 1; } if (f == 1)sort(a.begin(),a.end()); for ( int i = 0;i < n;i++){ cout <<i+1<< " " <<a[i].second<<endl; } } |
ステータス
項目 | データ |
---|---|
問題 | 0018 - GouSorter2 |
ユーザー名 | ei2332 |
投稿日時 | 2023-11-14 08:11:06 |
言語 | C++17 |
状態 | Accepted |
得点 | 50 |
ソースコード長 | 610 Byte |
最大実行時間 | 29 ms |
最大メモリ使用量 | 600 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 50 / 50 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in-01.txt | AC | 26 ms | 476 KB |
1
|
in-02.txt | AC | 29 ms | 436 KB |
1
|
in-03.txt | AC | 20 ms | 504 KB |
1
|
in-04.txt | AC | 15 ms | 428 KB |
1
|
in-05.txt | AC | 22 ms | 508 KB |
1
|
in-06.txt | AC | 21 ms | 600 KB |
1
|
in-07.txt | AC | 15 ms | 428 KB |
1
|
in-08.txt | AC | 15 ms | 508 KB |
1
|
in-09.txt | AC | 22 ms | 592 KB |
1
|
in-10.txt | AC | 21 ms | 540 KB |
1
|