QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#104245#5163. 喵了个喵jijidawang100 ✓515ms60412kbC++203.0kb2023-05-09 19:29:492023-05-09 19:29:50

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-09 19:29:50]
  • 评测
  • 测评结果:100
  • 用时:515ms
  • 内存:60412kb
  • [2023-05-09 19:29:49]
  • 提交

answer

#include <bits/stdc++.h>
namespace // to fold that junk code
{
#define filein(x) freopen(x".in", "r", stdin);
#define file(x) freopen(x".in", "r", stdin), freopen(x".out", "w", stdout);
#define files(x) freopen(x".in", "r", stdin), freopen(x".ans", "w", stdout);
using namespace std;
#define cT const T&
template<typename T>
inline T chkmin(T& x, cT y){if (x > y) x = y; return x;}
template<typename T>
inline T chkmax(T& x, cT y){if (x < y) x = y; return x;}
template <typename T>
inline bool inrange(cT x, cT l, cT r){return (l <= x) && (x <= r);}
template <typename T>
inline bool inrange(cT l, cT r, cT L, cT R){return (L <= l) && (r <= R);}
#undef cT
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef unsigned u32;
template <typename T>
using pr = pair<T, T>;
typedef pr<int> pii;
typedef pr<ll> pll;
typedef pr<db> pdd;
typedef complex<double> cp;
typedef vector<int> vi;
inline void YN(bool x){puts(x ? "YES" : "NO");}
}
const int N = 305, M = 2e6 + 233;
int n, m, k, a[M], id[N << 1], S;
deque<int> st[N];
struct Op{int opt, s1, s2;};
vector<Op> op;
inline void op1(int s){op.emplace_back(Op({1, s}));}
inline void op2(int s1, int s2){op.emplace_back(Op({2, s1, s2}));}
queue<int> q;
inline bool meow(int x)
{
	int bel = id[x];
	if (!bel)
	{
		if (q.empty()) return false;
		bel = id[x] = q.front(); q.pop(); op1(bel); st[bel].emplace_back(x);
	}
	else
	{
		id[x] = 0; q.push(bel);
		if (x == st[bel].back()){op1(bel); st[bel].pop_back();}
		else{op1(S); op2(S, bel); st[bel].pop_front();}
	}
	return true;
}
int main()
{
#ifndef ONLINE_JUDGE
	file("i");
#endif
	int T; scanf("%d", &T);
	while (T--)
	{
		scanf("%d%d%d", &n, &m, &k);
		for (int i=1; i<=m; i++) scanf("%d", a+i);
		if (n == 1){printf("%d\n", m); while (m--) puts("1 1"); continue;}
		memset(id, 0, sizeof id); op.clear(); S = n;
		while (!q.empty()) q.pop();
		for (int i=1; i<n; i++) q.push(i), q.push(i);
		for (int i=1; i<=m; i++)
		{
			if (meow(a[i])) continue;
			int pos = i + 1;
			while ((pos <= m) && (a[pos] != a[i]) && (st[id[a[pos]]].back() == a[pos])) ++pos;
			if (a[pos] == a[i]){op1(S); for (int j=i+1; j<pos; j++) meow(a[j]); op1(S); i = pos; continue;}
			int bel = id[a[pos]], bot = st[bel].back(), cc = 0;
			for (int j=i+1; j<pos; j++) cc += (a[j] == bot);
			if (cc & 1)
			{
				op1(S); st[S].emplace_back(a[i]);
				for (int j=i+1; j<pos; j++) (a[j] == bot) ? op1(bel) : (void)meow(a[j]);
				op1(bel); st[bel].clear(); id[a[pos]] = id[bot] = 0; id[a[i]] = S; q.push(S); S = bel;
			}
			else
			{
				op1(bel); st[bel].emplace_back(a[i]);
				for (int j=i+1; j<pos; j++) (a[j] == bot) ? op1(S) : (void)meow(a[j]);
				op1(S); op2(S, bel); st[bel].pop_front(); id[a[pos]] = 0; id[a[i]] = bel;
			}
			i = pos;
		}
		printf("%lu\n", op.size());
		for (Op e : op)
		{
			printf("%d %d", e.opt, e.s1);
			if (e.opt == 2) printf(" %d", e.s2);
			puts("");
		}
	}
	return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 5
Accepted
time: 419ms
memory: 3888kb

input:

1001
300 1814 598
483 60 555 101 51 354 9 252 396 527 380 573 243 98 143 305 16 355 479 117 594 369 522 368 133 534 598 353 475 161 68 250 4 119 137 12 370 532 72 152 40 314 249 182 397 71 164 513 198 539 283 121 440 548 56 439 434 64 336 132 514 339 52 350 21 421 304 156 268 87 338 419 540 583 139 ...

output:

2119
1 1
1 1
1 2
1 2
1 3
1 3
1 4
1 4
1 5
1 5
1 6
1 6
1 7
1 7
1 8
1 8
1 9
1 9
1 10
1 10
1 11
1 11
1 12
1 12
1 13
1 13
1 14
1 14
1 15
1 15
1 16
1 16
1 17
1 17
1 18
1 18
1 19
1 19
1 20
1 20
1 21
1 21
1 22
1 22
1 23
1 23
1 24
1 24
1 25
1 25
1 26
1 26
1 27
1 27
1 28
1 28
1 29
1 29
1 30
1 30
1 31
1 31
1 3...

result:

ok Right Output!!! (1001 test cases)

Test #2:

score: 5
Accepted
time: 425ms
memory: 5248kb

input:

1001
300 99724 598
345 381 76 48 555 574 99 55 233 363 511 21 268 552 390 442 284 356 291 572 132 251 185 123 247 436 410 254 74 507 567 418 421 44 597 510 151 229 98 516 591 10 70 392 562 592 236 379 349 60 485 480 71 136 222 40 546 476 113 586 444 64 540 195 583 304 423 214 221 548 224 422 341 319...

output:

121026
1 1
1 1
1 2
1 2
1 3
1 3
1 4
1 4
1 5
1 5
1 6
1 6
1 7
1 7
1 8
1 8
1 9
1 9
1 10
1 10
1 11
1 11
1 12
1 12
1 13
1 13
1 14
1 14
1 15
1 15
1 16
1 16
1 17
1 17
1 18
1 18
1 19
1 19
1 20
1 20
1 21
1 21
1 22
1 22
1 23
1 23
1 24
1 24
1 25
1 25
1 26
1 26
1 27
1 27
1 28
1 28
1 29
1 29
1 30
1 30
1 31
1 31
1...

result:

ok Right Output!!! (1001 test cases)

Test #3:

score: 5
Accepted
time: 409ms
memory: 3880kb

input:

1001
300 1870 598
232 396 237 207 403 576 164 510 388 568 180 574 321 589 140 209 129 420 555 124 575 552 415 486 143 85 275 421 267 408 55 64 46 393 598 155 556 542 60 91 52 455 543 42 153 303 548 241 426 59 194 243 78 469 459 352 291 128 161 477 323 339 272 493 361 366 569 456 22 409 532 195 537 8...

output:

2162
1 1
1 1
1 2
1 2
1 3
1 3
1 4
1 4
1 5
1 5
1 6
1 6
1 7
1 7
1 8
1 8
1 9
1 9
1 10
1 10
1 11
1 11
1 12
1 12
1 13
1 13
1 14
1 14
1 15
1 15
1 16
1 16
1 17
1 17
1 18
1 18
1 19
1 19
1 20
1 20
1 21
1 21
1 22
1 22
1 23
1 23
1 24
1 24
1 25
1 25
1 26
1 26
1 27
1 27
1 28
1 28
1 29
1 29
1 30
1 30
1 31
1 31
1 3...

result:

ok Right Output!!! (1001 test cases)

Test #4:

score: 5
Accepted
time: 458ms
memory: 5396kb

input:

1002
2 100000 3
2 3 1 2 1 1 2 2 1 2 1 3 2 3 1 2 1 1 2 1 2 1 3 3 1 2 1 2 2 3 2 1 3 3 2 1 2 1 3 2 1 3 2 3 1 1 3 1 2 1 3 1 2 2 2 2 1 1 2 1 2 1 1 1 2 3 1 2 2 1 3 2 3 3 2 3 3 2 2 1 3 2 1 2 3 2 3 1 3 2 1 2 3 3 2 1 2 3 2 3 1 2 2 3 1 2 1 2 3 1 2 3 3 1 2 1 2 2 1 1 2 1 3 3 2 2 2 2 1 3 3 1 2 1 1 1 1 2 2 3 3 1 ...

output:

115278
1 1
1 1
1 1
1 2
2 2 1
1 1
1 1
1 2
1 2
1 1
1 1
1 1
1 2
2 2 1
1 2
2 2 1
1 1
1 2
2 2 1
1 1
1 2
1 2
1 1
1 1
1 2
1 1
1 1
1 2
1 2
1 1
2 1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 1
1 1
1 1
2 1 2
1 2
1 2
1 2
1 2
1 1
2 1 2
1 1
2 1 2
1 2
1 2
1 2
1 1
1 1
1 2
1 2
1 1
2 1 2
1 2
1 2
1 2
1 1
1 1
1 1
1 1
1 2
1 2
1 1
1 2...

result:

ok Right Output!!! (1002 test cases)

Test #5:

score: 5
Accepted
time: 401ms
memory: 3892kb

input:

1002
2 1994 3
3 1 2 1 1 3 2 1 3 2 1 1 3 1 2 3 3 2 1 3 3 2 3 2 1 3 1 1 3 1 3 1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2 1
1 1
1 2
1 1
1 1
1 2
1 1
1 2
1 2
1 2
2 2 1
1 1
1 2
2 2 1
1 2
1 1
1 1
1 2
1 2
2 2 1
1 1
1 2
1 2
1 1
1 2
2 2 1
1 1
1 2
2 2 1
1 1
1 2
2 2 1
1 2
2 2 1
1 1
1 1...

result:

ok Right Output!!! (1002 test cases)

Test #7:

score: 5
Accepted
time: 2ms
memory: 3796kb

input:

3
3 14 5
1 2 3 4 5 1 5 5 4 3 5 4 2 4
3 14 5
1 2 3 4 5 2 5 3 5 1 1 4 5 1
3 14 5
1 2 3 4 5 1 4 1 4 1 5 4 2 3

output:

15
1 1
1 1
1 2
1 2
1 1
1 3
2 3 1
1 1
1 1
1 2
1 2
1 1
1 2
1 1
1 2
17
1 1
1 1
1 2
1 2
1 3
1 1
1 3
1 3
2 3 2
1 1
1 3
2 3 1
1 2
1 3
2 3 2
1 1
1 2
15
1 1
1 1
1 2
1 2
1 1
1 3
2 3 1
1 2
1 2
1 3
1 2
1 1
1 3
1 1
1 2

result:

ok Right Output!!! (3 test cases)

Test #8:

score: 5
Accepted
time: 2ms
memory: 3776kb

input:

3
3 14 5
1 2 3 4 5 4 1 1 3 2 4 1 4 5
3 14 5
1 2 3 4 5 4 3 5 3 5 1 2 3 5
3 14 5
1 2 3 4 5 5 3 2 5 5 1 2 2 4

output:

18
1 1
1 1
1 2
1 2
1 1
1 2
1 3
2 3 1
1 2
1 3
2 3 2
1 3
2 3 1
1 2
1 3
2 3 2
1 2
1 1
16
1 1
1 1
1 2
1 2
1 3
1 2
1 2
1 3
1 3
1 3
1 2
2 2 1
1 1
1 2
2 2 3
1 3
15
1 1
1 1
1 2
1 2
1 3
1 3
1 3
2 3 2
1 1
1 2
1 2
1 1
1 1
1 1
1 2

result:

ok Right Output!!! (3 test cases)

Test #9:

score: 5
Accepted
time: 2ms
memory: 3796kb

input:

3
3 14 5
1 2 3 4 5 3 4 1 2 4 1 1 4 5
3 14 5
1 2 3 4 5 3 2 2 3 5 4 2 3 1
3 14 5
1 2 3 4 5 4 3 2 5 1 1 1 5 5

output:

17
1 1
1 1
1 2
1 2
1 2
1 3
2 3 2
1 3
2 3 2
1 3
2 3 1
1 1
1 2
1 1
1 1
1 2
1 2
15
1 1
1 1
1 2
1 2
1 2
1 3
2 3 2
1 1
1 1
1 3
1 2
1 2
1 1
1 3
1 1
14
1 1
1 1
1 2
1 2
1 3
1 2
1 2
1 1
1 3
1 1
1 3
1 3
1 1
1 1

result:

ok Right Output!!! (3 test cases)

Test #10:

score: 5
Accepted
time: 2ms
memory: 3824kb

input:

3
3 14 5
1 2 3 4 5 5 2 3 1 5 3 3 5 4
3 14 5
1 2 3 4 5 4 5 2 5 5 5 5 1 3
3 14 5
1 2 3 4 5 5 5 4 5 4 4 2 3 1

output:

15
1 1
1 1
1 2
1 2
1 3
1 3
1 1
1 3
2 3 2
1 1
1 1
1 2
1 2
1 1
1 2
14
1 1
1 1
1 2
1 2
1 3
1 2
1 3
1 1
1 2
1 2
1 1
1 1
1 1
1 2
14
1 1
1 1
1 2
1 2
1 3
1 3
1 3
1 2
1 3
1 2
1 2
1 1
1 2
1 1

result:

ok Right Output!!! (3 test cases)

Test #11:

score: 5
Accepted
time: 436ms
memory: 3884kb

input:

1004
3 1992 5
4 5 2 3 1 5 5 1 4 3 5 1 4 5 3 5 3 1 4 4 5 3 1 2 2 1 3 2 5 2 5 3 1 4 5 5 3 5 4 2 1 3 2 5 1 1 4 5 5 4 1 4 2 2 4 4 2 3 3 2 4 2 1 5 1 3 4 3 2 4 5 2 3 3 5 1 3 5 2 3 1 4 1 4 4 5 2 2 4 1 5 2 2 4 1 3 1 3 4 4 4 2 5 3 5 4 1 2 1 4 3 3 3 3 3 3 3 2 4 2 4 1 1 5 2 1 2 2 1 5 4 3 1 4 1 3 2 3 1 4 1 2 1 ...

output:

2348
1 1
1 1
1 2
1 2
1 3
1 1
1 1
1 3
1 3
2 3 1
1 2
1 1
1 1
1 2
1 1
1 3
1 1
1 3
1 1
1 2
1 1
1 1
1 2
1 2
1 3
2 3 2
1 3
1 2
1 2
1 3
1 1
1 3
1 3
1 1
1 1
1 2
2 2 1
1 3
1 3
1 2
2 2 1
1 3
1 1
1 3
1 2
2 2 1
1 3
1 3
1 1
1 2
1 2
1 2
2 2 1
1 1
1 1
1 1
1 2
1 1
1 3
1 3
1 1
1 1
1 3
1 3
1 1
1 2
1 3
1 2
1 2
1 2
2 2...

result:

ok Right Output!!! (1004 test cases)

Test #12:

score: 5
Accepted
time: 433ms
memory: 5352kb

input:

1004
3 100000 5
3 5 2 4 1 5 3 2 1 5 3 2 1 5 3 2 4 5 3 2 4 5 3 1 2 5 3 1 2 5 3 1 2 5 3 1 2 5 3 4 2 5 3 4 2 5 1 3 4 5 1 3 4 2 1 3 4 2 1 5 3 4 1 5 2 3 1 5 2 3 1 5 2 3 1 4 5 3 2 4 5 1 2 4 5 1 2 4 5 3 1 4 5 3 2 1 4 5 2 1 4 3 2 1 4 3 2 1 5 3 4 1 5 3 4 2 5 1 3 2 5 1 3 4 2 5 1 4 2 5 1 4 3 2 5 4 3 2 5 4 1 3 ...

output:

130520
1 1
1 1
1 2
1 2
1 3
1 1
1 1
1 1
2 1 2
1 3
1 3
1 2
1 3
1 3
1 1
2 1 3
1 2
1 1
2 1 3
1 2
1 2
1 3
1 2
1 2
1 1
2 1 2
1 3
1 3
1 1
2 1 2
1 3
1 3
1 2
1 3
1 1
2 1 3
1 1
2 1 3
1 2
1 3
1 3
1 2
1 3
1 3
1 1
2 1 3
1 2
1 2
1 3
1 2
1 2
1 3
1 2
1 1
2 1 2
1 1
2 1 3
1 1
2 1 2
1 3
1 3
1 2
1 3
1 2
1 1
2 1 2
1 1
2...

result:

ok Right Output!!! (1004 test cases)

Test #13:

score: 5
Accepted
time: 437ms
memory: 3892kb

input:

1004
3 1990 5
1 2 4 5 3 3 1 5 4 4 5 3 1 5 2 5 4 4 2 1 2 1 1 3 4 4 2 3 1 3 1 4 5 3 5 4 1 2 2 2 5 3 5 5 4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2
1 3
2 3 2
1 3
2 3 1
1 1
1 2
1 1
1 1
1 2
1 1
1 3
2 3 1
1 3
2 3 1
1 2
1 2
1 1
1 2
1 2
1 3
2 3 1
1 1
1 3
2 3 2
1 2
1 2
1 1
1 1
1 2
1...

result:

ok Right Output!!! (1004 test cases)

Test #15:

score: 5
Accepted
time: 443ms
memory: 3888kb

input:

1005
300 1908 599
161 199 80 536 40 121 528 569 337 568 8 547 86 424 333 220 439 500 210 515 593 5 75 466 537 352 372 513 451 87 554 209 261 482 415 597 450 422 182 535 484 580 506 563 200 582 101 409 135 95 51 198 587 561 514 359 112 429 435 383 418 96 266 233 331 116 293 150 289 414 130 432 377 56...

output:

2193
1 1
1 1
1 2
1 2
1 3
1 3
1 4
1 4
1 5
1 5
1 6
1 6
1 7
1 7
1 8
1 8
1 9
1 9
1 10
1 10
1 11
1 11
1 12
1 12
1 13
1 13
1 14
1 14
1 15
1 15
1 16
1 16
1 17
1 17
1 18
1 18
1 19
1 19
1 20
1 20
1 21
1 21
1 22
1 22
1 23
1 23
1 24
1 24
1 25
1 25
1 26
1 26
1 27
1 27
1 28
1 28
1 29
1 29
1 30
1 30
1 31
1 31
1 3...

result:

ok Right Output!!! (1005 test cases)

Test #16:

score: 5
Accepted
time: 434ms
memory: 5400kb

input:

1005
300 99936 599
512 185 499 176 447 476 341 332 298 68 191 231 198 536 252 220 259 113 265 438 579 284 418 212 179 467 498 105 361 170 205 273 354 104 87 201 217 427 171 152 494 382 329 535 34 186 194 146 88 32 362 372 449 573 550 553 109 292 315 278 496 225 270 237 311 470 453 375 242 269 40 24 ...

output:

121123
1 1
1 1
1 2
1 2
1 3
1 3
1 4
1 4
1 5
1 5
1 6
1 6
1 7
1 7
1 8
1 8
1 9
1 9
1 10
1 10
1 11
1 11
1 12
1 12
1 13
1 13
1 14
1 14
1 15
1 15
1 16
1 16
1 17
1 17
1 18
1 18
1 19
1 19
1 20
1 20
1 21
1 21
1 22
1 22
1 23
1 23
1 24
1 24
1 25
1 25
1 26
1 26
1 27
1 27
1 28
1 28
1 29
1 29
1 30
1 30
1 31
1 31
1...

result:

ok Right Output!!! (1005 test cases)

Test #17:

score: 5
Accepted
time: 466ms
memory: 3892kb

input:

1005
300 1886 599
451 344 162 305 593 146 549 590 299 495 258 419 77 45 171 220 48 246 124 560 317 321 131 588 500 395 207 460 34 240 123 583 194 427 215 339 377 205 275 509 101 95 585 145 502 442 193 148 566 390 464 524 520 90 62 315 296 521 535 553 108 157 147 371 213 398 458 313 492 81 394 523 28...

output:

2170
1 1
1 1
1 2
1 2
1 3
1 3
1 4
1 4
1 5
1 5
1 6
1 6
1 7
1 7
1 8
1 8
1 9
1 9
1 10
1 10
1 11
1 11
1 12
1 12
1 13
1 13
1 14
1 14
1 15
1 15
1 16
1 16
1 17
1 17
1 18
1 18
1 19
1 19
1 20
1 20
1 21
1 21
1 22
1 22
1 23
1 23
1 24
1 24
1 25
1 25
1 26
1 26
1 27
1 27
1 28
1 28
1 29
1 29
1 30
1 30
1 31
1 31
1 3...

result:

ok Right Output!!! (1005 test cases)

Test #18:

score: 5
Accepted
time: 462ms
memory: 7308kb

input:

1005
300 99736 599
497 195 73 245 116 464 389 581 366 205 272 386 586 471 22 590 112 345 138 236 219 243 524 392 302 306 62 157 465 399 380 1 593 452 346 317 35 327 83 476 237 106 462 127 91 456 110 228 329 328 470 491 121 409 434 419 565 300 455 86 435 182 431 453 396 109 330 270 214 429 15 578 519...

output:

120747
1 1
1 1
1 2
1 2
1 3
1 3
1 4
1 4
1 5
1 5
1 6
1 6
1 7
1 7
1 8
1 8
1 9
1 9
1 10
1 10
1 11
1 11
1 12
1 12
1 13
1 13
1 14
1 14
1 15
1 15
1 16
1 16
1 17
1 17
1 18
1 18
1 19
1 19
1 20
1 20
1 21
1 21
1 22
1 22
1 23
1 23
1 24
1 24
1 25
1 25
1 26
1 26
1 27
1 27
1 28
1 28
1 29
1 29
1 30
1 30
1 31
1 31
1...

result:

ok Right Output!!! (1005 test cases)

Test #19:

score: 5
Accepted
time: 458ms
memory: 3888kb

input:

1005
300 1966 599
291 319 439 495 23 192 348 560 588 454 219 46 564 99 322 503 272 246 350 41 284 337 335 168 573 491 50 94 59 96 413 497 590 435 327 576 33 552 68 252 597 587 557 488 128 229 135 477 506 56 451 241 224 62 370 273 466 463 332 562 513 190 585 430 403 19 382 471 507 18 141 494 574 29 2...

output:

2280
1 1
1 1
1 2
1 2
1 3
1 3
1 4
1 4
1 5
1 5
1 6
1 6
1 7
1 7
1 8
1 8
1 9
1 9
1 10
1 10
1 11
1 11
1 12
1 12
1 13
1 13
1 14
1 14
1 15
1 15
1 16
1 16
1 17
1 17
1 18
1 18
1 19
1 19
1 20
1 20
1 21
1 21
1 22
1 22
1 23
1 23
1 24
1 24
1 25
1 25
1 26
1 26
1 27
1 27
1 28
1 28
1 29
1 29
1 30
1 30
1 31
1 31
1 3...

result:

ok Right Output!!! (1005 test cases)

Test #20:

score: 5
Accepted
time: 515ms
memory: 60412kb

input:

1005
300 1997946 599
492 539 331 519 105 510 521 334 251 416 147 16 528 224 469 253 309 53 57 567 60 502 151 533 522 283 599 355 197 484 531 527 41 274 76 561 166 47 449 219 194 465 417 571 38 126 25 94 84 596 119 18 156 402 254 148 394 88 270 326 252 310 237 327 509 374 358 259 205 460 405 22 432 4...

output:

2422834
1 1
1 1
1 2
1 2
1 3
1 3
1 4
1 4
1 5
1 5
1 6
1 6
1 7
1 7
1 8
1 8
1 9
1 9
1 10
1 10
1 11
1 11
1 12
1 12
1 13
1 13
1 14
1 14
1 15
1 15
1 16
1 16
1 17
1 17
1 18
1 18
1 19
1 19
1 20
1 20
1 21
1 21
1 22
1 22
1 23
1 23
1 24
1 24
1 25
1 25
1 26
1 26
1 27
1 27
1 28
1 28
1 29
1 29
1 30
1 30
1 31
1 31
...

result:

ok Right Output!!! (1005 test cases)

Extra Test:

score: 0
Extra Test Passed