Submission #00082
ソースコード
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 | #include<bits/stdc++.h> using namespace std; #define read cin >> #define echo cout << #define fin << '\n' #define int long long const int MOD = 998244353; struct Authoritarianism { int id; int d[16] = {}; bool operator < ( const Authoritarianism &tar ) const { for ( int i = 9; i >= 0; i-- ) { if ( this ->d[i] == tar.d[i] ) continue ; return this ->d[i] < tar.d[i]; } return this ->id > tar.id; } bool operator > ( const Authoritarianism &tar ) const { for ( int i = 9; i >= 0; i-- ) { if ( this ->d[i] == tar.d[i] ) continue ; return this ->d[i] > tar.d[i]; } return this ->id <tar.id; } }; int itop[16]; priority_queue<Authoritarianism> q; signed main(){ int n, l; read n >> l; vector< int > a; vector< int > aUni; for ( int i = 0; i < l; i++ ) { int A; read A; a.push_back(A); aUni.push_back(A); } sort(aUni.begin(), aUni.end()); aUni.erase(unique(aUni.begin(), aUni.end()), aUni.end()); for ( int i = 0; i < l; i++ ) { for ( int j = 0; j < ( int )aUni.size(); j++ ) { if ( a[i] == aUni[j] ) { itop[i] = j; } } } for ( int i = 0; i < n; i++ ) { string s; read s; Authoritarianism tmp; tmp.id = i; for ( int j = 0; j < l; j++ ) { if ( s[j] == 'o' ) { tmp.d[itop[j]]++; } } q.emplace(tmp); } while ( !q.empty() ) { echo (1+q.top().id) fin; q.pop(); } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0007 - 998244353点 |
ユーザー名 | r1825 |
投稿日時 | 2020-04-25 22:01:31 |
言語 | C++14 |
状態 | Accepted |
得点 | 400 |
ソースコード長 | 1720 Byte |
最大実行時間 | 109 ms |
最大メモリ使用量 | 32084 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 400 / 400 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in01.txt | AC | 31 ms | 476 KB |
1
|
in02.txt | AC | 25 ms | 544 KB |
1
|
in03.txt | AC | 23 ms | 496 KB |
1
|
in04.txt | AC | 16 ms | 584 KB |
1
|
in05.txt | AC | 15 ms | 552 KB |
1
|
in06.txt | AC | 98 ms | 19296 KB |
1
|
in07.txt | AC | 58 ms | 19096 KB |
1
|
in08.txt | AC | 39 ms | 10812 KB |
1
|
in09.txt | AC | 66 ms | 11436 KB |
1
|
in10.txt | AC | 26 ms | 4568 KB |
1
|
in11.txt | AC | 100 ms | 20456 KB |
1
|
in12.txt | AC | 109 ms | 21796 KB |
1
|
in13.txt | AC | 106 ms | 22136 KB |
1
|
in14.txt | AC | 106 ms | 22944 KB |
1
|
in15.txt | AC | 109 ms | 23612 KB |
1
|
in16.txt | AC | 86 ms | 23344 KB |
1
|
in17.txt | AC | 81 ms | 24656 KB |
1
|
in18.txt | AC | 85 ms | 24232 KB |
1
|
in19.txt | AC | 76 ms | 25100 KB |
1
|
in20.txt | AC | 67 ms | 26316 KB |
1
|
in21.txt | AC | 67 ms | 26884 KB |
1
|
in22.txt | AC | 63 ms | 26572 KB |
1
|
in23.txt | AC | 109 ms | 28088 KB |
1
|
in24.txt | AC | 99 ms | 28856 KB |
1
|
in25.txt | AC | 98 ms | 29152 KB |
1
|
in26.txt | AC | 102 ms | 28808 KB |
1
|
in27.txt | AC | 18 ms | 11484 KB |
1
|
in28.txt | AC | 22 ms | 11448 KB |
1
|
in29.txt | AC | 17 ms | 11420 KB |
1
|
in30.txt | AC | 21 ms | 11392 KB |
1
|
in31.txt | AC | 93 ms | 30276 KB |
1
|
in32.txt | AC | 95 ms | 30888 KB |
1
|
in33.txt | AC | 84 ms | 32084 KB |
1
|
sample01.txt | AC | 24 ms | 13184 KB |
1
|
sample02.txt | AC | 20 ms | 13276 KB |
1
|
sample03.txt | AC | 25 ms | 13236 KB |
1
|