結果
問題 |
No.647 明太子
|
ユーザー |
![]() |
提出日時 | 2018-02-11 23:11:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 973 bytes |
コンパイル時間 | 756 ms |
コンパイル使用メモリ | 72,832 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 08:07:27 |
合計ジャッジ時間 | 4,027 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 11 RE * 9 |
ソースコード
#include <iostream> #include <array> #include <vector> #include <algorithm> using namespace std; int main() { int N; cin >> N; array<long, 1000> as{}; array<long, 1000> bs{}; for (int i = 0; i < N; ++i) { long a, b; cin >> a >> b; as[i] = a; bs[i] = b; } int M; cin >> M; array<long, 100> xs{}; array<long, 100> ys{}; for (int j = 0; j < M; ++j) { long x, y; cin >> x >> y; xs[j] = x; ys[j] = y; } vector<int> counters(M, 0); for (int k = 0; k < M; ++k) { for (int i = 0; i < N; ++i) { if (xs[k] <= as[i] && ys[k] >= bs[i]) { counters[k] += 1; } } } int maxElem = *std::max_element(counters.begin(), counters.end()); for (int l = 0; l < M; ++l) { if(counters[l] == maxElem) { cout << (l+1) << endl; } } cout << "\n"; return 0; }