QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#487593#6661. 야유회Rafi22#0 846ms4120kbC++201.8kb2024-07-23 00:24:032024-07-23 00:24:03

Judging History

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

  • [2024-07-23 00:24:03]
  • 评测
  • 测评结果:0
  • 用时:846ms
  • 内存:4120kb
  • [2024-07-23 00:24:03]
  • 提交

answer

#include "workshop.h"
#include <bits/stdc++.h>

using namespace std;

#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif

#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define FOR(i,l,r) for(int i=(l);i<=(r);i++)
#define ROF(i,r,l) for(int i=(r);i>=(l);i--)
int inf=1000000007;
ll infl=1000000000000000007;
ll mod=1000000007;
ll mod1=998244353;

const int K=4,N=99999999;

int w[N];

void init()
{
	mt19937 mt;
	mt.seed(112137);
	FOR(i,0,N-1) w[i]=mt()%1000000000;
}

int morning(int x,int r)
{
	x=w[x]%N;
	if(w[x]%2==1) return w[x]%N;
	else 
	{
		int ban=-1;
		if(w[r]%2==1) ban=w[w[w[r]%N]%N]%K;
		while(w[w[x]%N]%K==ban) x=w[x]%N;
		return w[x]%N;
	}
}

int get_val(int x)
{
	int ban=w[x]%K;
	while(w[x]%K==ban) x=w[x]%N;
	return x;
}

int afternoon(int l,int x,int r) 
{
	if(w[l]%K==w[x]%K&&w[r]%K==w[x]%K) 
	{
		if(w[x]%2==1) return get_val(x);
		else
		{
			int ban=w[x]%K,ban1=-1,ban2=-1;
			if(w[l]%2==1) ban1=w[get_val(l)]%K;
			if(w[r]%2==1) ban2=w[get_val(r)]%K;
			while(w[x]%K==ban||w[x]%K==ban1||w[x]%K==ban2) x=w[x]%N;
			return x;
		}
	}
	else return x;
}

int evening(int l,int x,int r)
{
	int T=x;
	x=w[x]%K;
	l=w[l]%K;
	r=w[r]%K;
	if(l==x&&r==x) return (x+1+T%(K-3))%K;
	else if(r==x) 
	{
		if(l==(x-1+K)%K) return (x-2+K)%K;
		else return (x-1+K)%K;
	}
	else return x;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 5
Accepted
time: 695ms = 694ms + 1ms
memory: 1284kb,3984kb

input:

2dc2b1d4-8de2-INPUT-bcd3-aa55b691fdb3
1
2
40 40
0 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 40
0 3 1 5 7 9 6 4 2 10 8 23 21 25 27 29 26 24 22 30 28 13 11 15 17 19 16 14 12 20 18 33 31 35 37 39 36 34 32 38

output:

dd180566-1d37-PIPE-b85d-c176ae85727d
4 2
28 28 28 28
89 88 8b 8a 8d 8c 8f 8e 81 80 83 82 85 84 87 86 99 98 9b 9a 9d 9c 9f 9e 91 90 93 92 95 94 97 96 a9 a8 ab aa ad ac af ae 
01aebb03 04fd6976 0393e08e 05d6b33c 03bda05d 02fbe31a 003ff3c0 05da1a7b 04788260 01d95b97 0352c1af 03758923 029c4acd 013727eb ...

input:

dd180566-1d37-PIPE-b85d-c176ae85727d
4 2
28 28 28 28
89 88 8b 8a 8d 8c 8f 8e 81 80 83 82 85 84 87 86 99 98 9b 9a 9d 9c 9f 9e 91 90 93 92 95 94 97 96 a9 a8 ab aa ad ac af ae 
01aebb03 04fd6976 0393e08e 05d6b33c 03bda05d 02fbe31a 003ff3c0 05da1a7b 04788260 01d95b97 0352c1af 03758923 029c4acd 013727eb ...

output:

4468cc07-dabe-OUTPUT-ba95-7ddd49645c94
4

result:

ok Correct, m = 4

Test #2:

score: 5
Accepted
time: 687ms = 686ms + 1ms
memory: 1432kb,3900kb

input:

2dc2b1d4-8de2-INPUT-bcd3-aa55b691fdb3
1
2
40 7
6 9 4 2 1 5 7
40 10
6 9 4 2 0 1 5 7 3 8

output:

dd180566-1d37-PIPE-b85d-c176ae85727d
4 2
7 6 4 2
8f 80 8d 8b 88 8c 8e 
003ff3c0 01d95b97 03bda05d 0393e08e 000157f1 02fbe31a 
01d95b97 03bda05d 0393e08e 000157f1 
89 8a 
a 9 7 5
8f 80 8d 8b 89 88 8c 8e 8a 81 
003ff3c0 01d95b97 03bda05d 0393e08e 01aebb03 000157f1 02fbe31a 05da1a7b 0127589a 
01d95b97 ...

input:

dd180566-1d37-PIPE-b85d-c176ae85727d
4 2
7 6 4 2
8f 80 8d 8b 88 8c 8e 
003ff3c0 01d95b97 03bda05d 0393e08e 000157f1 02fbe31a 
01d95b97 03bda05d 0393e08e 000157f1 
89 8a 
a 9 7 5
8f 80 8d 8b 89 88 8c 8e 8a 81 
003ff3c0 01d95b97 03bda05d 0393e08e 01aebb03 000157f1 02fbe31a 05da1a7b 0127589a 
01d95b97 ...

output:

4468cc07-dabe-OUTPUT-ba95-7ddd49645c94
4

result:

ok Correct, m = 4

Test #3:

score: 0
Wrong Answer
time: 804ms = 803ms + 1ms

input:

2dc2b1d4-8de2-INPUT-bcd3-aa55b691fdb3
1
25000
40 40
12 4 16 7 26 21 10 20 0 32 15 3 33 37 23 8 34 38 13 1 29 18 17 25 39 35 31 24 36 28 30 9 14 5 19 22 2 27 11 6
40 40
3 34 21 38 36 7 33 39 26 15 2 13 22 20 5 25 10 12 30 35 0 31 24 17 11 37 32 18 9 28 6 16 23 27 1 4 8 14 19 29
40 40
18 34 29 31 22 3...

output:

64be09ab-d709-ERROR-82bc-c23f6124dd26
Wrong Answer [4]

input:

64be09ab-d709-ERROR-82bc-c23f6124dd26
Wrong Answer [4]

output:

64be09ab-d709-ERROR-82bc-c23f6124dd26
Wrong Answer [4]

result:

wrong answer Wrong Answer [4]

Subtask #2:

score: 0
Wrong Answer

Test #8:

score: 76
Acceptable Answer
time: 690ms = 689ms + 1ms
memory: 1284kb,4120kb

input:

2dc2b1d4-8de2-INPUT-bcd3-aa55b691fdb3
2
2
40 40
0 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 40
0 3 1 5 7 9 6 4 2 10 8 23 21 25 27 29 26 24 22 30 28 13 11 15 17 19 16 14 12 20 18 33 31 35 37 39 36 34 32 38

output:

dd180566-1d37-PIPE-b85d-c176ae85727d
4 2
28 28 28 28
89 88 8b 8a 8d 8c 8f 8e 81 80 83 82 85 84 87 86 99 98 9b 9a 9d 9c 9f 9e 91 90 93 92 95 94 97 96 a9 a8 ab aa ad ac af ae 
01aebb03 04fd6976 0393e08e 05d6b33c 03bda05d 02fbe31a 003ff3c0 05da1a7b 04788260 01d95b97 0352c1af 03758923 029c4acd 013727eb ...

input:

dd180566-1d37-PIPE-b85d-c176ae85727d
4 2
28 28 28 28
89 88 8b 8a 8d 8c 8f 8e 81 80 83 82 85 84 87 86 99 98 9b 9a 9d 9c 9f 9e 91 90 93 92 95 94 97 96 a9 a8 ab aa ad ac af ae 
01aebb03 04fd6976 0393e08e 05d6b33c 03bda05d 02fbe31a 003ff3c0 05da1a7b 04788260 01d95b97 0352c1af 03758923 029c4acd 013727eb ...

output:

4468cc07-dabe-OUTPUT-ba95-7ddd49645c94
4

result:

points 0.80 Incorrect, m = 4

Test #9:

score: 76
Acceptable Answer
time: 690ms = 689ms + 1ms
memory: 1196kb,4096kb

input:

2dc2b1d4-8de2-INPUT-bcd3-aa55b691fdb3
2
2
40 7
6 9 4 2 1 5 7
40 10
6 9 4 2 0 1 5 7 3 8

output:

dd180566-1d37-PIPE-b85d-c176ae85727d
4 2
7 6 4 2
8f 80 8d 8b 88 8c 8e 
003ff3c0 01d95b97 03bda05d 0393e08e 000157f1 02fbe31a 
01d95b97 03bda05d 0393e08e 000157f1 
89 8a 
a 9 7 5
8f 80 8d 8b 89 88 8c 8e 8a 81 
003ff3c0 01d95b97 03bda05d 0393e08e 01aebb03 000157f1 02fbe31a 05da1a7b 0127589a 
01d95b97 ...

input:

dd180566-1d37-PIPE-b85d-c176ae85727d
4 2
7 6 4 2
8f 80 8d 8b 88 8c 8e 
003ff3c0 01d95b97 03bda05d 0393e08e 000157f1 02fbe31a 
01d95b97 03bda05d 0393e08e 000157f1 
89 8a 
a 9 7 5
8f 80 8d 8b 89 88 8c 8e 8a 81 
003ff3c0 01d95b97 03bda05d 0393e08e 01aebb03 000157f1 02fbe31a 05da1a7b 0127589a 
01d95b97 ...

output:

4468cc07-dabe-OUTPUT-ba95-7ddd49645c94
4

result:

points 0.80 Incorrect, m = 4

Test #10:

score: 0
Wrong Answer
time: 846ms = 845ms + 1ms

input:

2dc2b1d4-8de2-INPUT-bcd3-aa55b691fdb3
2
25000
40 40
8 20 9 10 28 26 23 38 21 15 0 12 24 5 17 33 19 27 16 35 36 1 13 39 6 25 2 7 22 3 32 29 14 31 34 30 18 4 37 11
40 40
22 39 8 4 38 5 24 12 20 33 15 37 28 0 19 36 13 26 25 34 27 35 14 16 18 10 3 7 23 29 9 31 1 30 17 2 21 32 11 6
40 40
23 7 33 4 16 15 ...

output:

64be09ab-d709-ERROR-82bc-c23f6124dd26
Wrong Answer [4]

input:

64be09ab-d709-ERROR-82bc-c23f6124dd26
Wrong Answer [4]

output:

64be09ab-d709-ERROR-82bc-c23f6124dd26
Wrong Answer [4]

result:

wrong answer Wrong Answer [4]