CSES - Aalto Competitive Programming 2024 - wk12 - Mon - Results
Submission details
Task:Integer Points
Sender:aalto2024m_001
Submission time:2024-11-25 16:31:47 +0200
Language:C++ (C++17)
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.00 sdetails
#2ACCEPTED0.00 sdetails
#3ACCEPTED0.00 sdetails
#4ACCEPTED0.00 sdetails
#5ACCEPTED0.10 sdetails
#6ACCEPTED0.09 sdetails
#7ACCEPTED0.09 sdetails
#8ACCEPTED0.09 sdetails
#9ACCEPTED0.09 sdetails
#10ACCEPTED0.09 sdetails
#11ACCEPTED0.08 sdetails
#12ACCEPTED0.08 sdetails
#13ACCEPTED0.07 sdetails

Code

#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i=a;i<(b);++i)
#define all(x) begin(x),end(x)
#define sz(x) int((x).size())
using ll = long long;
using pii = pair<int,int>;
using vi = vector<int>;

ll A[2], B[2];

int main() {
  int n;
  cin >> n;
  rep(i,0,n) {
    ll c;
    cin >> c;
    ++A[c&1];
  }
  cin >> n;
  rep(i,0,n) {
    ll c;
    cin >> c;
    ++B[c % 2];
  }
  cout << A[0] * B[0] + A[1] * B[1] << '\n';
}

Test details

Test 1

Verdict: ACCEPTED

input
3
1 3 2
2
0 3

correct output
3

user output
3

Test 2

Verdict: ACCEPTED

input
2
1000000000 0
2
1000000000 0

correct output
4

user output
4

Test 3

Verdict: ACCEPTED

input
1
664947340
1
254841583

correct output
0

user output
0

Test 4

Verdict: ACCEPTED

input
200
346438723 462087704 569209152 ...

correct output
20000

user output
20000

Test 5

Verdict: ACCEPTED

input
100000
219972426 682881172 652258550 ...

correct output
10000000000

user output
10000000000

Test 6

Verdict: ACCEPTED

input
100000
941269471 182588867 631884359 ...

correct output
0

user output
0

Test 7

Verdict: ACCEPTED

input
100000
802070817 437903274 526938648 ...

correct output
5000000000

user output
5000000000

Test 8

Verdict: ACCEPTED

input
100000
630252165 102099677 259588247 ...

correct output
7160000000

user output
7160000000

Test 9

Verdict: ACCEPTED

input
100000
219808835 223532219 117310337 ...

correct output
399994

user output
399994

Test 10

Verdict: ACCEPTED

input
100000
1000000000 999999999 999999998...

correct output
5000000000

user output
5000000000

Test 11

Verdict: ACCEPTED

input
100000
0 1 2 3 4 5 6 7 8 9 10 11 12 1...

correct output
5000000000

user output
5000000000

Test 12

Verdict: ACCEPTED

input
100000
1000000000 999999999 999999998...

correct output
5000000000

user output
5000000000

Test 13

Verdict: ACCEPTED

input
100000
0 1 2 3 4 5 6 7 8 9 10 11 12 1...

correct output
5000000000

user output
5000000000