Submission #00069
ソースコード
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 | #include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio( false ); int n; int a[1005],b[1005]; int m; cin >> n >> m; for ( int i=0;i<n;i++){ cin >> a[i]; } for ( int i=0;i<m;i++){ cin >> b[i]; } int ans[1005]={}; int temp; for ( int i=0;i<m;i++){ for ( int j=0;j<n;j++){ if (a[j]<=b[i]){ temp=j; break ; } } ans[temp]++; } int maxp=0; for ( int i=0;i<n;i++){ if (ans[maxp]<ans[i]) maxp=i; } cout << maxp+1 << endl; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0007 - 投票(vote) |
ユーザー名 | P_ei1623 |
投稿日時 | 2017-11-02 17:54:07 |
言語 | C++11 |
状態 | Accepted |
得点 | 100 |
ソースコード長 | 556 Byte |
最大実行時間 | 22 ms |
最大メモリ使用量 | 584 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | 入力1 | 20 / 20 | *1.txt |
2 | 入力2 | 20 / 20 | *[12].txt |
3 | 入力3 | 20 / 20 | *[1-3].txt |
4 | 入力4 | 20 / 20 | *[1-4].txt |
5 | 入力5 | 20 / 20 | *[1-5].txt |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # | ||||
---|---|---|---|---|---|---|---|---|
2014-yo-t2-in1.txt | AC | 18 ms | 480 KB |
1
|
2
|
3
|
4
|
5
|
2014-yo-t2-in2.txt | AC | 19 ms | 436 KB |
2
|
3
|
4
|
5
|
|
2014-yo-t2-in3.txt | AC | 19 ms | 508 KB |
3
|
4
|
5
|
||
2014-yo-t2-in4.txt | AC | 22 ms | 584 KB |
4
|
5
|
|||
2014-yo-t2-in5.txt | AC | 18 ms | 528 KB |
5
|