結果

問題 No.206 数の積集合を求めるクエリ
ユーザー hogeover30hogeover30
提出日時 2015-05-12 15:50:25
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 671 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 26,696 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-20 03:55:28
合計ジャッジ時間 9,962 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 9 ms
4,380 KB
testcase_13 AC 5 ms
4,380 KB
testcase_14 AC 8 ms
4,376 KB
testcase_15 AC 9 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 12 ms
4,388 KB
testcase_18 AC 7 ms
4,380 KB
testcase_19 AC 11 ms
4,380 KB
testcase_20 AC 7 ms
4,380 KB
testcase_21 AC 8 ms
4,380 KB
testcase_22 AC 8 ms
4,380 KB
testcase_23 AC 10 ms
4,380 KB
testcase_24 TLE -
testcase_25 AC 6,973 ms
4,380 KB
testcase_26 AC 3,986 ms
4,380 KB
testcase_27 AC 1,727 ms
4,376 KB
testcase_28 AC 5,823 ms
4,380 KB
testcase_29 AC 3,931 ms
4,380 KB
testcase_30 AC 3,437 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;

int a[200010], b[100010], res[100010];
const int bufsize=8*100010;
char buf[bufsize];

int main()
{
    int L, M, N, Q;
    fgets(buf, bufsize, stdin);
    sscanf(buf, "%d%d%d", &L, &M, &N);

    fgets(buf, bufsize, stdin);
    a[atoi(strtok(buf, " "))]=1;
    for(int i=1;i<L;++i) a[atoi(strtok(NULL, " "))]=1;

    fgets(buf, bufsize, stdin);
    b[0]=atoi(strtok(buf, " "));
    for(int i=1;i<M;++i) b[i]=atoi(strtok(NULL, " "));

    Q=atoi(fgets(buf, bufsize, stdin));
    while (Q--) {
        int res=0;
        for(int i=0;i<M;++i) res+=a[b[i]++];
        printf("%d\n", res);
    }
}
0