Submission #00029
ソースコード
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 | #include <bits/stdc++.h> using namespace std; struct Rabbit { int idx, a, b, c; bool operator<( const Rabbit &r) const { if (c == r.c) { return idx < r.idx; } else { return c > r.c; } } }; int main() { int n; Rabbit r[1000]; cin >> n; for ( int i = 0; i < n; ++i) { r[i].idx = i + 1; cin >> r[i].a; } for ( int i = 0; i < n; ++i) { cin >> r[i].b; r[i].c = r[i].a * r[i].b; } sort(r, r + n); cout << r[0].c << endl << r[0].idx << endl; for ( int i = 1; i < n; ++i) { if (r[i].c != r[i - 1].c) break ; cout << r[i].idx << endl; } } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 避難訓練 |
ユーザー名 | ei1503 |
投稿日時 | 2017-01-10 16:15:53 |
言語 | C++11 |
状態 | Accepted |
得点 | 90 |
ソースコード長 | 723 Byte |
最大実行時間 | 24 ms |
最大メモリ使用量 | 728 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 90 / 90 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
01_sample1.txt | AC | 16 ms | 480 KB |
1
|
01_sample2.txt | AC | 14 ms | 456 KB |
1
|
02_handmake1.txt | AC | 22 ms | 560 KB |
1
|
02_handmake2.txt | AC | 23 ms | 664 KB |
1
|
02_handmake3.txt | AC | 18 ms | 516 KB |
1
|
03_random1.txt | AC | 20 ms | 492 KB |
1
|
03_random2.txt | AC | 16 ms | 336 KB |
1
|
03_random3.txt | AC | 22 ms | 440 KB |
1
|
03_random4.txt | AC | 23 ms | 536 KB |
1
|
03_random5.txt | AC | 24 ms | 632 KB |
1
|
04_maximum1.txt | AC | 23 ms | 728 KB |
1
|