QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#105330#6386. Dollsxcc_szy0 116ms8420kbC++14496b2023-05-13 22:16:312023-05-13 22:16:52

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-13 22:16:52]
  • 评测
  • 测评结果:0
  • 用时:116ms
  • 内存:8420kb
  • [2023-05-13 22:16:31]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int kmaxm=5e5+10;
int n,ans,a[kmaxm],siz[kmaxm];
signed main(){

	cin>>n;
	while(n--){
		int x;
		cin>>x;
		if(a[x]){
			cout<<ans<<" ";
			continue;
		}
		a[x]=1;
		if(!a[x-1]&&!a[x+1]){
			ans++;
			siz[x]=1;
		}else{
			if(a[x-1]&&siz[x-1]%2==0){
				siz[x]=1;
				ans++;
			}else{
				if(a[x+1]&&siz[x+1]%2==0)siz[x]=1,ans++;
				else siz[x]=0;
			}
		}
		cout<<ans<<" "; 
	}
	return 0;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3356kb

input:

190
57 94 24 27 110 44 72 82 55 7 9 43 22 86 95 84 125 16 75 28 46 10 14 131 112 132 33 53 103 139 118 126 137 13 140 77 25 23 47 116 68 150 81 97 165 58 88 63 42 89 123 11 113 83 124 130 80 35 143 155 153 48 8 136 104 101 90 37 21 99 142 34 64 115 109 26 92 144 61 51 114 49 148 96 60 30 54 134 141 ...

output:

1 2 3 4 5 6 7 8 9 10 11 11 12 13 13 14 15 16 17 17 18 18 19 20 21 21 22 23 24 25 26 26 27 27 27 28 28 28 28 29 30 31 31 32 33 33 34 35 36 36 37 38 38 38 38 38 39 40 41 42 43 44 44 44 44 45 46 47 47 48 48 48 48 48 48 49 50 50 51 52 53 53 54 55 55 56 56 57 58 58 59 60 60 61 61 61 62 62 62 63 63 64 65 ...

result:

wrong answer 1st lines differ - expected: '1 2 3 4 5 6 7 8 9 10 11 11 12 ...7 77 77 77 77 77 77 77 77 77 77', found: '1 2 3 4 5 6 7 8 9 10 11 11 12 ... 85 85 85 85 85 85 85 85 85 85 '

Subtask #2:

score: 0
Time Limit Exceeded

Test #22:

score: 14
Accepted
time: 3ms
memory: 3388kb

input:

3922
1195 63679 1195 96797 63679 60311 456263 228361 96797 270167 60311 169529 60311 60311 456263 270167 169529 375829 169529 169529 270167 375829 60311 228361 1195 375829 96797 375829 375829 96797 375829 169529 456263 375829 1195 375829 456263 96797 169529 228361 63679 270167 212365 456263 270167 9...

output:

1 2 2 3 3 4 5 6 6 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ...

result:

ok single line: '1 2 2 3 3 4 5 6 6 7 7 8 8 8 8 ... 10 10 10 10 10 10 10 10 10 10 '

Test #23:

score: 0
Accepted
time: 59ms
memory: 4032kb

input:

37546
255823 496819 131877 21777 481397 180879 90117 66725 83377 206249 93703 442885 435091 246437 179919 223849 27443 74433 142363 142363 16575 201329 389035 88823 155627 408387 435091 309967 88823 22319 432337 270795 18657 27443 281699 498715 246849 304111 308965 369639 390257 220525 419229 369639...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 19 20 21 22 23 24 25 25 26 26 27 28 29 30 30 31 32 33 34 35 36 37 38 39 39 39 39 40 41 42 43 43 43 44 44 45 45 46 47 48 48 49 50 51 52 52 52 52 53 53 54 55 55 55 55 56 57 57 57 57 57 58 58 59 59 59 60 61 61 62 62 63 63 63 63 64 64 64 64 64 65 65 66 67 ...

result:

ok single line: '1 2 3 4 5 6 7 8 9 10 11 12 13 ...00 100 100 100 100 100 100 100 '

Test #24:

score: 0
Accepted
time: 116ms
memory: 8420kb

input:

41860
276641 406759 283073 345379 165557 31359 390947 187927 340289 129395 49647 335337 276755 50995 268817 195463 51921 278123 222361 266371 113513 143919 260233 160821 303295 411785 13473 259459 224893 146469 413425 247107 131953 97541 379057 430675 317003 429927 38801 344173 145729 137651 491731 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 75 76 77 77 78 79 80 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

result:

ok single line: '1 2 3 4 5 6 7 8 9 10 11 12 13 ...99 999 999 999 999 999 999 999 '

Test #25:

score: -14
Time Limit Exceeded

input:

98645
228089 101335 314019 349183 189145 106465 335897 227559 270541 83385 203093 453645 99857 42445 253521 211599 483607 160005 7323 359547 403049 301349 308095 164043 283581 243259 447263 429937 53907 67983 160567 446337 236571 74009 346389 421001 437029 369567 269085 484797 452647 295649 192387 1...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 1...

result:


Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #1:

0%