Task: | Integer Points |
Sender: | aalto2024m_004 |
Submission time: | 2024-11-25 16:36:57 +0200 |
Language: | C++ (C++17) |
Status: | READY |
Result: | ACCEPTED |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.01 s | details |
#5 | ACCEPTED | 0.12 s | details |
#6 | ACCEPTED | 0.12 s | details |
#7 | ACCEPTED | 0.12 s | details |
#8 | ACCEPTED | 0.12 s | details |
#9 | ACCEPTED | 0.12 s | details |
#10 | ACCEPTED | 0.09 s | details |
#11 | ACCEPTED | 0.08 s | details |
#12 | ACCEPTED | 0.08 s | details |
#13 | ACCEPTED | 0.08 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:14:19: warning: comparison of integer expressions of different signedness: 'int' and 'ull' {aka 'long long unsigned int'} [-Wsign-compare] 14 | for(int i=0; i<n; i++){ | ~^~ input/code.cpp:25:19: warning: comparison of integer expressions of different signedness: 'int' and 'ull' {aka 'long long unsigned int'} [-Wsign-compare] 25 | for(int i=0; i<m; i++){ | ~^~
Code
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main(){ ios::sync_with_stdio(0); cin.tie(0); ull n; cin >> n; set<ll> cs; for(int i=0; i<n; i++){ ll c; cin >> c; cs.insert(c); } ll cso = count_if(cs.begin(), cs.end(), [](ll c){ return c%2; }); ull m; cin >> m; set<ll> cs2; for(int i=0; i<m; i++){ ll c; cin >> c; cs2.insert(c); } ll cs2o = count_if(cs2.begin(), cs2.end(), [](ll c){ return c%2; }); // cout << "this: " << cso << " " << cs2o << "\n"; // cout << (cs.size() * cs2.size()) << "\n"; cout << (cs2o * cso + (n - cso) * (m - cs2o)) << "\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 |