QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#700693#9541. Expanding Arrayucup-team5657#AC ✓219ms32804kbC++141.2kb2024-11-02 13:18:092024-11-02 13:18:45

Judging History

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

  • [2024-11-02 13:18:45]
  • 评测
  • 测评结果:AC
  • 用时:219ms
  • 内存:32804kb
  • [2024-11-02 13:18:09]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> Pr;
#define fi first
#define se second
#define mkp make_pair
#define pb emplace_back
// #define mid ((l+r)>>1)
#define popcnt __builtin_popcountll
const ll mod = 998244353;
inline ll read(){
	ll x=0, f=1; char ch=getchar();
	while(ch<'0' || ch>'9') { if(ch=='-') f=-1; ch=getchar(); }
	while(ch>='0' && ch<='9') x=x*10+ch-'0', ch=getchar();
	return x*f;
}
inline ll lg2(ll x){ return 63^__builtin_clzll(x); }
inline ll qpow(ll a,ll b){
	ll ans=1, base=a;
	while(b){
		if(b&1) ans=ans*base%mod;
		base=base*base%mod; b>>=1;
	}
	return ans;
}
void init(){ }

ll n,a[100005];

set<ll>S;
void procedure(){
	n=read();
	for(ll i=1;i<=n;i++) a[i]=read(), S.insert(a[i]);
	for(ll i=1;i<n;i++){
		S.insert(a[i]&a[i+1]);
		S.insert(a[i]|a[i+1]);
		S.insert(a[i]^a[i+1]);
		S.insert((a[i]|a[i+1])^a[i]);
		S.insert((a[i]|a[i+1])^a[i+1]);
	}
	S.insert(0);
	printf("%lld\n", (ll)S.size());
}
int main(){
	#ifdef LOCAL
		assert(freopen("input.txt","r",stdin));
		assert(freopen("output.txt","w",stdout));
	#endif
	ll T=1;
	init();
	while(T--) procedure();
	return 0;
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

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

input:

2
2 3

output:

4

result:

ok single line: '4'

Test #2:

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

input:

2
3 4

output:

4

result:

ok single line: '4'

Test #3:

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

input:

2
3 5

output:

8

result:

ok single line: '8'

Test #4:

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

input:

10
37760128 12721860 37519778 33518004 2760086 4473592 65451644 83416788 44877547 36766460

output:

56

result:

ok single line: '56'

Test #5:

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

input:

10
816913051 502168112 623785107 464692422 886370488 155984202 681252443 57479616 856353914 365166224

output:

56

result:

ok single line: '56'

Test #6:

score: 0
Accepted
time: 195ms
memory: 30252kb

input:

91141
991550420 630736630 613860632 683288307 801076961 655640638 825594849 292357587 386886324 280046446 969805344 558863217 285710238 677412106 663841817 331062932 665933557 860995134 10312018 472942826 92468113 114082647 184016662 952783745 869957199 427809351 730297077 324218702 340532370 865197...

output:

546842

result:

ok single line: '546842'

Test #7:

score: 0
Accepted
time: 219ms
memory: 32804kb

input:

99990
436733915 194729865 822464090 159380426 605947779 183500385 914253010 997171386 178142524 922229524 628470895 249318241 529701470 622239344 652486908 19042637 861164615 977371879 683176583 935482867 570862807 829803280 731891684 893345580 932602100 619651621 736491818 784943027 460885255 59290...

output:

599936

result:

ok single line: '599936'

Test #8:

score: 0
Accepted
time: 210ms
memory: 31656kb

input:

100000
487226969 457282779 405894670 507533594 752274125 691586010 899032024 977434663 549675232 670910087 246449945 121814497 42291126 10848596 700944136 358865545 712590631 568312324 399031386 687281452 313519716 238165298 674312548 467926333 766512188 954885325 666026653 533479054 583530932 45267...

output:

579323

result:

ok single line: '579323'

Test #9:

score: 0
Accepted
time: 203ms
memory: 30088kb

input:

100000
1953092 10171476 13315487 66517671 94511797 77389287 57536474 23157886 92265729 55280409 67818901 61111064 26318917 82821578 51704467 15632702 61857687 60938727 73003318 15951832 17688482 92575793 39449633 80417451 54686836 71910803 31085401 38647491 34419509 16762034 38589605 21528521 647290...

output:

541854

result:

ok single line: '541854'

Test #10:

score: 0
Accepted
time: 77ms
memory: 9884kb

input:

100000
56065 58469 40066 20348 26569 80174 42150 21521 23738 3838 28271 90443 69256 58488 88984 1352 19160 23379 17939 67514 36741 38812 96325 69799 19230 94641 80261 60359 16902 5734 50016 22922 83763 91140 67640 73360 44337 40837 64960 72814 52444 15770 74850 11151 92393 65509 38105 30161 39421 82...

output:

111922

result:

ok single line: '111922'

Test #11:

score: 0
Accepted
time: 21ms
memory: 4660kb

input:

100000
999999909 999999949 999999940 999999919 999999924 999999921 999999973 999999935 999999911 999999979 999999930 999999934 999999939 999999982 999999941 999999999 999999922 999999910 999999963 999999964 999999932 999999941 999999962 999999994 999999905 999999973 999999949 999999911 999999915 999...

output:

559

result:

ok single line: '559'

Test #12:

score: 0
Accepted
time: 6ms
memory: 4568kb

input:

100000
0 1000000000 0 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0 0 1000000000 0 0 1000000000 1000000000 1000000000 1000000000 1000000000 0 1000000000 0 1000000000 1000000000 1000000000 1000000000 1000000000 0 0 0 0 0 0 1000000000 1000000000 1000000000 0 1000000000 0 1000000000 1000000000 ...

output:

2

result:

ok single line: '2'

Test #13:

score: 0
Accepted
time: 79ms
memory: 10212kb

input:

99999
49649 32299 60025 47960 53077 16398 69446 62316 56559 79822 92758 88224 93118 2565 83000 81902 74193 58934 30888 37019 49885 84669 79862 2616 57609 97127 56251 94532 8780 76314 15489 82820 55682 95759 92640 34676 85170 58356 75229 16825 7732 5637 59290 38245 54977 71199 3038 53698 75899 80676 ...

output:

119399

result:

ok single line: '119399'

Test #14:

score: 0
Accepted
time: 196ms
memory: 31792kb

input:

99999
910117004 226112810 689456274 981491037 882117040 962190328 363339027 851861175 830129398 651834716 402308847 248682372 299945654 987753988 250203473 140204621 241970643 918779449 201281328 697331840 740820988 650480802 776181163 250928864 13132880 526953338 532607507 209164886 921764557 14888...

output:

579185

result:

ok single line: '579185'

Extra Test:

score: 0
Extra Test Passed