QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#189899#1091. Binary Supersonic UtahraptorsKKT89AC ✓18ms3732kbC++171.2kb2023-09-28 01:22:582023-09-28 01:22:59

Judging History

你现在查看的是最新测评结果

  • [2023-09-28 01:22:59]
  • 评测
  • 测评结果:AC
  • 用时:18ms
  • 内存:3732kb
  • [2023-09-28 01:22:58]
  • 提交

answer

#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
#include <deque>
#include <stack>
#include <sstream>
#include <utility>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <array>
#include <bitset>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}
inline double time() {
    return static_cast<double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    int m; cin >> m;
    int q; cin >> q;
    int res = 0;
    for(int i=0;i<n;i++){
        int x; cin >> x;
        if(x == 0)res++;
    }
    for(int i=0;i<m;i++){
        int x; cin >> x;
        if(x == 1)res--;
    }
    cout << abs(res) << endl;
}



詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3732kb

input:

2 3 1
0 0
1 1 1
2

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

1 1 1
1
1
1

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3720kb

input:

1 1 1
1
0
1

output:

0

result:

ok 1 number(s): "0"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

1 1 1
0
1
1

output:

0

result:

ok 1 number(s): "0"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

1 1 1
0
0
1

output:

1

result:

ok 1 number(s): "1"

Test #6:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

2 2 2
1 1
1 1
1 2

output:

2

result:

ok 1 number(s): "2"

Test #7:

score: 0
Accepted
time: 0ms
memory: 3720kb

input:

2 2 5
1 1
0 1
1 1 2 1 2

output:

1

result:

ok 1 number(s): "1"

Test #8:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

2 2 10
1 1
0 0
1 2 2 2 1 1 1 1 1 1

output:

0

result:

ok 1 number(s): "0"

Test #9:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

2 2 20
1 0
1 1
2 2 2 2 2 2 2 1 1 1 1 2 2 2 1 2 2 1 1 2

output:

1

result:

ok 1 number(s): "1"

Test #10:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

2 2 40
0 1
0 1
1 2 1 1 1 2 1 1 2 1 1 2 1 2 1 2 2 1 1 1 1 1 2 1 1 2 1 1 2 2 2 1 2 1 2 1 2 1 2 2

output:

0

result:

ok 1 number(s): "0"

Test #11:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

2 2 100
0 1
0 0
1 2 1 2 2 2 1 2 1 1 2 1 2 1 1 2 1 2 2 2 1 1 2 1 2 1 1 2 1 1 2 1 2 2 1 2 1 2 2 2 2 2 1 2 1 2 1 2 2 1 2 2 1 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 2 2 1 1 1 2 2 1 2 1 2 2 1 2 2 1 1 2 1 1 1 1 2 2 1 1

output:

1

result:

ok 1 number(s): "1"

Test #12:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

2 2 300
0 0
1 1
1 2 1 2 1 1 1 1 2 1 1 1 2 2 1 1 2 2 2 1 1 2 2 1 1 2 1 2 2 1 2 1 2 2 1 1 2 1 1 1 2 2 1 1 1 1 1 2 2 1 2 2 2 2 1 2 2 1 1 1 1 2 1 2 1 2 1 2 2 2 1 2 2 1 2 2 1 2 1 2 1 1 1 2 1 1 1 1 2 1 1 2 1 1 1 1 2 2 1 1 2 1 1 1 2 1 2 1 2 1 2 1 1 1 2 1 2 1 2 1 2 2 2 2 1 1 1 2 1 2 1 2 1 1 1 1 2 2 2 2 2 2 ...

output:

0

result:

ok 1 number(s): "0"

Test #13:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

2 2 600
0 0
1 0
1 2 1 2 1 1 2 1 1 1 2 1 1 2 1 2 1 2 2 2 2 1 2 1 2 2 1 1 2 2 1 1 1 2 2 2 1 1 1 1 2 1 2 2 2 1 1 1 2 2 1 2 2 2 2 2 2 2 1 2 2 1 1 2 1 2 1 1 1 1 2 2 2 1 1 2 1 1 1 2 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 2 2 2 2 1 1 2 2 1 1 1 2 1 1 2 1 2 2 2 1 1 2 2 2 1 1 1 1 2 2 1 1 2 1 2 2 2 1 1 1 2 1 2 2 1 1 ...

output:

1

result:

ok 1 number(s): "1"

Test #14:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

2 2 2000
0 0
0 0
1 2 2 2 1 2 2 1 1 1 1 1 1 2 2 2 2 1 2 1 2 1 2 1 1 1 1 2 2 1 1 2 2 2 2 1 2 1 2 1 2 1 2 2 2 1 2 2 1 2 1 1 2 2 2 1 1 1 1 2 2 1 1 1 1 1 1 1 2 1 2 2 2 1 1 2 2 2 2 2 1 1 1 1 2 1 1 2 1 2 2 1 1 1 2 2 2 1 2 2 1 2 1 1 1 2 1 1 2 2 1 2 1 1 2 2 2 2 1 2 1 1 2 2 1 1 1 2 2 1 1 1 2 1 2 1 1 1 1 1 1 2...

output:

2

result:

ok 1 number(s): "2"

Test #15:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

25 6 3000
1 1 1 1 1 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0
1 0 1 0 0 0
1 2 3 3 4 2 3 6 4 6 3 5 3 2 3 1 4 5 5 6 1 3 6 4 1 3 5 1 5 4 4 4 5 3 4 6 6 6 5 6 1 3 3 4 3 5 2 2 3 6 3 6 4 3 2 3 6 6 5 1 6 1 6 1 2 5 1 6 3 2 1 2 4 6 1 2 3 6 2 6 5 3 2 2 3 4 4 3 5 4 5 5 6 3 6 3 5 6 2 3 4 5 5 2 5 2 4 1 1 5 4 2 2 2 ...

output:

14

result:

ok 1 number(s): "14"

Test #16:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

83 153 30000
1 1 1 0 1 0 0 0 0 0 0 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 0 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 1 0 1 0 0 1
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0...

output:

7

result:

ok 1 number(s): "7"

Test #17:

score: 0
Accepted
time: 0ms
memory: 3716kb

input:

587 587 50000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

0

result:

ok 1 number(s): "0"

Test #18:

score: 0
Accepted
time: 1ms
memory: 3656kb

input:

6507 6507 10023
1 1 0 0 1 0 0 1 1 1 0 1 1 0 0 0 0 1 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 0 1 0 1 0 1 1 0 0 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 1 1 0 1 1 1 1 1 1 0 0 1 0 0 1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 0 0 0 0 1 1 0 1 1 0 1 0 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 ...

output:

3323

result:

ok 1 number(s): "3323"

Test #19:

score: 0
Accepted
time: 2ms
memory: 3592kb

input:

34523 12232 2003
1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

4451

result:

ok 1 number(s): "4451"

Test #20:

score: 0
Accepted
time: 10ms
memory: 3716kb

input:

150523 152232 150233
0 0 0 1 1 1 1 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 1 0 0 0 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 1 0 0 0 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 0 1 1...

output:

33423

result:

ok 1 number(s): "33423"

Test #21:

score: 0
Accepted
time: 8ms
memory: 3640kb

input:

120523 162232 150233
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

16577

result:

ok 1 number(s): "16577"

Test #22:

score: 0
Accepted
time: 8ms
memory: 3636kb

input:

130523 152232 250233
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

6677

result:

ok 1 number(s): "6677"

Test #23:

score: 0
Accepted
time: 16ms
memory: 3724kb

input:

290523 299232 300000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

290523

result:

ok 1 number(s): "290523"

Test #24:

score: 0
Accepted
time: 16ms
memory: 3584kb

input:

297523 299292 300000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

8769

result:

ok 1 number(s): "8769"

Test #25:

score: 0
Accepted
time: 16ms
memory: 3720kb

input:

299999 300000 300000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

300000

result:

ok 1 number(s): "300000"

Test #26:

score: 0
Accepted
time: 16ms
memory: 3572kb

input:

299999 300000 300000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

0

result:

ok 1 number(s): "0"

Test #27:

score: 0
Accepted
time: 16ms
memory: 3584kb

input:

300000 299999 300000
1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0...

output:

3102

result:

ok 1 number(s): "3102"

Test #28:

score: 0
Accepted
time: 18ms
memory: 3704kb

input:

300000 299999 300000
1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0 0 1 1 1 0 0 0 1 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 1 1 0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0...

output:

21440

result:

ok 1 number(s): "21440"

Test #29:

score: 0
Accepted
time: 17ms
memory: 3716kb

input:

300000 299999 300000
0 1 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 1 0 1 0 0 0 1...

output:

198045

result:

ok 1 number(s): "198045"

Test #30:

score: 0
Accepted
time: 18ms
memory: 3648kb

input:

300000 299999 300000
0 0 1 1 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 1 1 0 0 1 1 0 0 0 1 1 1 0 0 1 0 0 1 1 1 1 0 1 1 1 1 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 0 0 0 0 0 1 1 1 0 0 1 0 1 1 1 0 0 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 0 1 0 0 0 1 0 0 0 0 1...

output:

127854

result:

ok 1 number(s): "127854"

Test #31:

score: 0
Accepted
time: 14ms
memory: 3728kb

input:

300000 299999 300000
0 0 1 0 1 0 1 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 0 1 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 1 0 1...

output:

50283

result:

ok 1 number(s): "50283"

Test #32:

score: 0
Accepted
time: 18ms
memory: 3648kb

input:

300000 299999 300000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0...

output:

191359

result:

ok 1 number(s): "191359"