結果

問題 No.647 明太子
ユーザー dazydazy
提出日時 2018-05-12 20:00:50
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,097 bytes
コンパイル時間 1,201 ms
コンパイル使用メモリ 146,036 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 18:30:50
合計ジャッジ時間 2,417 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 6 ms
4,376 KB
testcase_20 AC 6 ms
4,376 KB
testcase_21 AC 3 ms
4,376 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:38:13: warning: ‘max’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             if(m[i][2] == max) {
             ^~

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define fastcin {\
    cin.tie(0);\
    ios::sync_with_stdio(false);\
}
#define REP(i, a, b) for(int i = a; i < b; i++)
#define RREP(i, a, b) for(int i = a; i > b; i--)
#define print(x) cout << x << "\n"
#define SORT(a, n) sort(a, a+n);
#define REVERSE(a,n) reverse(a,a+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VREVERSE(v) reverse(v.begin(), v.end());
#define MOD 1000000007
typedef long long ll;

int main() {
    fastcin;
    int N;
    cin >> N;
    int q[10000][2];
    REP(i, 0, N) cin >> q[i][0] >> q[i][1];

    int M;
    cin >> M;
    int m[1000][3] = {}, max, count;
    REP(i, 0, M) {
        cin >> m[i][0] >> m[i][1];
        REP(j, 0, N) {
            if(m[i][0]<=q[j][0] && m[i][1]>=q[j][1]) m[i][2]++;
        }
        if(max < m[i][2]) max = m[i][2];
    }

    vector<int> k;
    if(max) {
        REP(i, 0, M) {
            if(m[i][2] == max) {
                k.push_back(i+1);
            }
        }
    }

    int s = k.size();
    if(s!=0) {
        REP(i, 0, s) print(k[i]);
    } else print(0);
    return 0;
}
0