QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#116315#6661. 야유회youngsystem0 0ms0kbC++201.2kb2023-06-28 15:05:162023-06-28 15:05:19

Judging History

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

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

answer

#include<bits/stdc++.h>
#include "workshop.h"
int sz1[100005],cnt1;
int sz2[100005],cnt2;
int sz3[100005],cnt3;
void init()
{
	for(int i=0;i<(1<<20);i++)
	{
		if(__builtin_popcount(i)==10)sz1[++cnt1]=i;
	}
	for(int i=0;i<(1<<6);i++)
	{
		if(__builtin_popcount(i)==3)sz2[++cnt2]=i;
	}
	for(int i=0;i<(1<<4);i++)
	{
		if(__builtin_popcount(i)==2)sz3[++cnt3]=i;
	}
}
int f1(int x,int y)
{
	x=sz1[x+1];
	y=sz1[y+1];
	for(int i=19;i>=0;i--)
	{
		if(x&(1<<i))continue;
		if((y&(1<<i))==0)continue;
		return i;
	}
	return -1;
}
int f2(int x,int y)
{
	x=sz2[x+1];
	y=sz2[y+1];
	for(int i=19;i>=0;i--)
	{
		if(x&(1<<i))continue;
		if((y&(1<<i))==0)continue;
		return i;
	}
	return -1;
}
int f3(int x,int y)
{
	x=sz3[x+1];
	y=sz3[y+1];
	for(int i=19;i>=0;i--)
	{
		if(x&(1<<i))continue;
		if((y&(1<<i))==0)continue;
		return i;
	}
	return -1;
}
int morning(int my_num, int right_num) { return f1(my_num,right_num); }

int afternoon(int left_num, int my_num, int right_num) { return f3(f2(left_num,my_num),f2(my_num,right_num)); }

int evening(int left_num, int my_num, int right_num) {if(my_num<=2)return my_num;return 3^left_num^right_num; }

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 0
Runtime Error

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:


result:


Subtask #2:

score: 0
Runtime Error

Test #8:

score: 0
Runtime Error

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:


result: