QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#116226#6661. 야유회csy2005#0 27ms23824kbC++143.1kb2023-06-28 12:25:152024-05-31 18:21:41

Judging History

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

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

answer

#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#include<ctime>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<bitset>
#include<cassert>
#include<random>
#define sqr(x) ((x)*(x))
#define fz1(i,n) for ((i)=1;(i)<=(n);(i)++)
#define fd1(i,n) for ((i)=(n);(i)>=1;(i)--)
#define fz0g(i,n) for ((i)=0;(i)<=(n);(i)++)
#define fd0g(i,n) for ((i)=(n);(i)>=0;(i)--)
#define fz0k(i,n) for ((i)=0;(i)<(n);(i)++)
#define fd0k(i,n) for ((i)=(((long long)(n))-1);(i)>=0;(i)--)
#define fz(i,x,y) for ((i)=(x);(i)<=(y);(i)++)
#define fd(i,y,x) for ((i)=(y);(i)>=(x);(i)--)
#define fzin fz1(i,n)
#define fzim fz1(i,m)
#define fzjn fz1(j,n)
#define fzjm fz1(j,m)
#define ff(c,itr) for (__typeof((c).begin()) itr=(c).begin();itr!=(c).end();++itr)
#define pb push_back
#define mk make_pair
#define rdst(st,len){static char ss[len];scanf(" %s",ss);(st)=ss;}
#define spln(i,n) (i==n?'\n':' ')
#define fac_init(n){fac[0]=fac[1]=inv[1]=fi[0]=fi[1]=1;fz(i,2,n){fac[i]=1ll*fac[i-1]*i%mod;inv[i]=1ll*(mod-mod/i)*inv[mod%i]%mod;fi[i]=1ll*fi[i-1]*inv[i]%mod;}}
using namespace std;
typedef long long i64;
typedef long double f80;
typedef unsigned int u32;
typedef unsigned long long u64;
//typedef __int128 i128;
//typedef unsigned __int128 u128;
inline void read(int &x)
{
	char c;int f=1;
	while(!isdigit(c=getchar()))if(c=='-')f=-1;
	x=(c&15);while(isdigit(c=getchar()))x=(x<<1)+(x<<3)+(c&15);
	x*=f;
}
#include "workshop.h"
int len1,len2;
vector<int> p1[45],p2[45],q1[45],q2[45];
mt19937 rnd(1064);
int solve(vector<int> *p,vector<int> *q,int n)
{
	int cnt=0,i,j;vector<vector<int> > cur;
	vector<int> _;fz0k(i,n)_.push_back(i);p[cnt++]=_;reverse(_.begin(),_.end());p[cnt++]=_;
	fz0k(i,n)cur.push_back({i});vector<int> ta;
	while(cur.size()>1){
		vector<vector<int> > nxt;i=(cur.size()-1)/2;j=i+1;
		vector<int> cta=cur[i];
		ff(cta,it) p[cnt].push_back(*it);
		i--;
		while(i>=0||j<cur.size()){
			if(i>=0) ff(cur[i],it) p[cnt].push_back(*it);
			if(j<cur.size()) ff(cur[j],it) p[cnt].push_back(*it);
			vector<int> nv;
			if(j<cur.size()) ff(cur[j],it) nv.push_back(*it);
			if(i>=0) ff(cur[i],it) nv.push_back(*it);
			nxt.push_back(nv);
			i--;j++;
		}
		ff(ta,it) p[cnt].push_back(*it);
		ff(cta,it) ta.push_back(*it);
		cur=nxt;cnt++;
	}
	p[cnt]=cur[0];ff(ta,it) p[cnt].push_back(*it);cnt++;
	fz0k(i,cnt){
		q[i].resize(n);
//		fz0k(j,n) cerr<<p[i][j]<<' ';cerr<<endl;
		fz0k(j,n) q[i][p[i][j]]=j;
	}
	return cnt;
}
void init()
{
	len1=solve(p1,q1,100000);len1-=2;
	len2=solve(p2,q2,len1);cerr<<len2<<endl;
}
int morning(int my_num, int right_num)
{
	return my_num;
}
int afternoon(int left_num, int my_num, int right_num)
{
//	cerr<<left_num<<' '<<my_num<<' '<<right_num<<endl;
	int s=0;while(s+1<len1&&q1[s][left_num]<q1[s][my_num]||q1[s][right_num]<q1[s][my_num])s++;
	return s;
}
int evening(int left_num, int my_num, int right_num) 
{
	int s=0;while(q2[s][left_num]<q2[s][my_num]||q2[s][right_num]<q2[s][my_num])s++;
	return s;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 19ms = 18ms + 1ms
memory: 23824kb,3912kb

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:

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: 0
Wrong Answer
time: 27ms = 26ms + 1ms
memory: 23400kb,3876kb

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:

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]