QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#53650 | #2014. 动物园 | james1BadCreeper | 100 ✓ | 264ms | 3852kb | C++ | 637b | 2022-10-05 16:43:46 | 2022-10-05 16:43:46 |
Judging History
answer
#include <iostream>
#include <cstdio>
#define ULL unsigned long long
using namespace std;
int n, m, c, k;
ULL base, lim;
int main(void) {
scanf("%d%d%d%d", &n, &m, &c, &k);
for (int i = 1; i <= n; ++i) {
ULL a;
scanf("%llu", &a);
base |= a;
}
while (m--) {
ULL a, b;
scanf("%llu%llu", &a, &b);
lim |= (ULL)1 << a;
}
ULL res = 0;
for (int i = 0; i < k; ++i) res += ((base >> i) & 1) || (!((lim >> i) & 1));
if (res == 64 && n == 0) puts("18446744073709551616");
else printf("%llu\n", (((ULL)1 << res) - n));
return 0;
}
詳細信息
Test #1:
score: 5
Accepted
time: 3ms
memory: 3764kb
input:
5 5 5 5 15 0 7 13 18 1 5 4 3 0 1 2 2 3 4
output:
27
result:
ok single line: '27'
Test #2:
score: 5
Accepted
time: 2ms
memory: 3728kb
input:
5 4 8 4 1 11 7 12 2 1 6 2 5 0 1 3 8
output:
11
result:
ok single line: '11'
Test #3:
score: 5
Accepted
time: 2ms
memory: 3752kb
input:
5 4 5 4 10 11 2 8 12 3 5 2 1 0 4 1 2
output:
11
result:
ok single line: '11'
Test #4:
score: 5
Accepted
time: 2ms
memory: 3748kb
input:
5 3 9 3 7 5 2 3 6 0 9 2 5 1 1
output:
3
result:
ok single line: '3'
Test #5:
score: 5
Accepted
time: 0ms
memory: 3744kb
input:
9 6 16 6 8 12 34 10 38 19 24 40 52 2 2 3 5 0 11 1 4 4 8 0 13
output:
55
result:
ok single line: '55'
Test #6:
score: 5
Accepted
time: 0ms
memory: 3748kb
input:
11 17 18 11 1604 264 119 1360 1052 182 1516 377 1507 1981 1566 5 9 7 14 9 16 2 10 6 17 10 2 6 4 4 15 7 8 0 7 3 3 2 18 1 12 7 5 3 13 2 1 10 6
output:
2037
result:
ok single line: '2037'
Test #7:
score: 5
Accepted
time: 2ms
memory: 3804kb
input:
12 9 19 12 3295 2689 2117 3531 1312 629 2684 2396 3029 770 2271 1699 0 12 11 3 8 9 1 16 6 14 2 13 9 15 3 8 11 6
output:
4084
result:
ok single line: '4084'
Test #8:
score: 5
Accepted
time: 2ms
memory: 3728kb
input:
13 11 11 6 45 42 18 7 26 14 13 59 19 56 5 54 4 5 10 2 8 0 7 3 1 2 2 5 5 0 11 3 6 3 4 4 9 1 3
output:
51
result:
ok single line: '51'
Test #9:
score: 5
Accepted
time: 1ms
memory: 3732kb
input:
26 324 12349371 27 61418656 110110905 39652520 20516480 32579724 53546656 54003252 134021304 17108497 12134541 83174533 58722853 83886721 25701428 79956516 8923809 120924189 53283333 67707561 57945116 10749588 45091877 130556077 94382637 120922793 30682277 6 2390806 8 5689478 25 1232617 25 4116481 9...
output:
1048550
result:
ok single line: '1048550'
Test #10:
score: 5
Accepted
time: 2ms
memory: 3632kb
input:
30 831 51977530 28 201105464 134692880 94068751 240462742 200085826 117221733 76394696 131724039 205230579 216006884 12130393 95726049 12290416 85465962 138523456 194494691 181526913 122255410 81523609 140648975 263864676 253040804 201204453 142533135 256407575 209896122 159533363 183980388 15150696...
output:
134217698
result:
ok single line: '134217698'
Test #11:
score: 5
Accepted
time: 2ms
memory: 3772kb
input:
28 576 60803690 26 52234368 20038252 52448955 19843231 54447807 50334221 19008761 4063933 18025152 52563482 53773401 3558013 19447919 35933860 19369088 36782793 16959655 34325084 36900454 34505963 19907787 50482753 50546299 51399326 36536384 52020939 37374188 1198150 3 45330325 23 30146741 18 365796...
output:
2097124
result:
ok single line: '2097124'
Test #12:
score: 5
Accepted
time: 2ms
memory: 3764kb
input:
20 435 36165499 25 11560228 9494832 3173569 9481345 8389937 2100644 1049632 2109348 10496389 60245 8415268 3163201 1697 8429825 8425076 2149920 3156465 11576980 10527973 3180448 4 27557941 12 27270868 10 35876327 14 15155630 22 14359257 9 22050266 2 34966691 7 28532460 18 31119112 6 11593346 15 2686...
output:
262124
result:
ok single line: '262124'
Test #13:
score: 5
Accepted
time: 17ms
memory: 3772kb
input:
97867 56 51849195 57 128496181648209559 138280887558405832 65376263474287560 126885848020177093 129128636876988438 81219813867051367 20976901715953382 19074143725298125 72284113364890946 47442552489696225 81911447495783583 111187570095850719 100069151738977850 29288838778373759 63202170511844307 927...
output:
562949953323445
result:
ok single line: '562949953323445'
Test #14:
score: 5
Accepted
time: 4ms
memory: 3692kb
input:
40409 90 8715510 53 5033650311765005 7302956246637073 757030953166639 2216616558138888 211123435780899 1777439118834743 5086968962979645 1918176438819333 4186966214065171 5210037111295541 1357355849876751 8074831660655901 230966344034597 4538861466270489 3785087035126846 3465746577894689 42925107157...
output:
549755773479
result:
ok single line: '549755773479'
Test #15:
score: 5
Accepted
time: 37ms
memory: 3768kb
input:
304509 965 82913519 58 255606264823493553 156145509733302886 87888401650235141 198624745312885477 170589286497349649 277551404801746452 173392065492712151 209565884827829990 13158032550201046 30001848635628062 222669301228990336 189161681765993926 157832868971620801 72094995898840991 127435196897586...
output:
18014398509177475
result:
ok single line: '18014398509177475'
Test #16:
score: 5
Accepted
time: 102ms
memory: 3768kb
input:
470294 593 50528650 58 103534364170433249 95372790981104430 227309032303927460 4107212659131271 5161935969419429 172778883203629284 225203243940745325 32670915612750244 158442574190412643 16116565824897765 15345849939731107 167905520520630507 7583014785028264 90952727932896008 33498365601133132 8347...
output:
2251799813214954
result:
ok single line: '2251799813214954'
Test #17:
score: 5
Accepted
time: 264ms
memory: 3852kb
input:
988554 452505 39667983 50 76171449585232 675202352201742 83924885717012 568785957307982 567642280332318 87233097761300 635923747359260 685339356663314 606228191823872 75993025217600 115506851333120 682825809397780 668912377807430 119977913550942 45383863632396 680710508283916 15718673499224 37684268...
output:
137437964918
result:
ok single line: '137437964918'
Test #18:
score: 5
Accepted
time: 247ms
memory: 3776kb
input:
919631 329459 25719849 63 6486310123062051648 4905018819489154630 7783414228211220744 4616213953088882752 8075020723756862244 1874087545309038882 6058485682467471878 3026436613518444580 6341664282134105610 2455029218804829798 5049107001679873028 7384391499319850 7353831254609004066 20182268531217209...
output:
8796092102577
result:
ok single line: '8796092102577'
Test #19:
score: 5
Accepted
time: 248ms
memory: 3840kb
input:
949995 520979 19662275 52 1273562462833241 37817220606022 146321022541848 1161137371677250 179376233662543 319116271427597 1549402406732369 4627164709382 463122132484101 1590306234484752 1448251230396940 41214774766087 463396949639257 1272637574668807 322591179948035 1551428299752031 144309626194331...
output:
68718526741
result:
ok single line: '68718526741'
Test #20:
score: 5
Accepted
time: 0ms
memory: 3668kb
input:
0 0 81795575 64
output:
18446744073709551616
result:
ok single line: '18446744073709551616'
Extra Test:
score: 0
Extra Test Passed