結果
問題 | No.647 明太子 |
ユーザー |
|
提出日時 | 2020-04-02 03:58:08 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 41 ms / 4,500 ms |
コード長 | 584 bytes |
コンパイル時間 | 651 ms |
コンパイル使用メモリ | 59,356 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 15:48:26 |
合計ジャッジ時間 | 1,826 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <iostream>#include <vector>using namespace std;int main(){int N,M,max=0;cin >> N;vector<int> A(N),B(N);for(int id=0;id<N;id++){cin >> A[id] >> B[id];}cin >> M;vector<int> cnt(M,0);for(int k=0,X,Y;k<M;k++){cin >> X >> Y;for(int id=0;id<N;id++){if(X<=A[id] && Y>=B[id]){cnt[k]++;if(max<cnt[k])max=cnt[k];}}}if(max>0) for(int k=0;k<M;k++){if(max==cnt[k])cout << k+1 << endl;}else cout << 0 << endl;return 0;}