QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#119974#6669. MapaLYC_music0 3ms9540kbC++141.5kb2023-07-06 09:23:102023-07-06 09:23:10

Judging History

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

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

answer

#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 1000000007
#define int ll
#define N 10000005 
using namespace std;
const int B=998244353;
int t,x[N],y[N],a[N];
int f[N][3];
int n,q,L;
void BellaKira()
{
	cin>>t;
	if (t==1)
	{
		cin>>n;
		int nw=B;
		for (int i=1;i<=n;i++)
		{
			cin>>x[i]>>y[i];
			x[i]=(x[i]+nw)%mod;
			y[i]=(y[i]+nw)%mod;
			nw=nw*1023%mod;
			a[i*3-2]=x[i]%97;
			a[i*3-1]=x[i]%93;
			a[i*3]=y[i];
			// a[i*4-1]=y[i]%97;
			// a[i*4]=y[i]%93;
		}
		cout<<(30+14)*n<<'\n';
		for (int i=1;i<=3*n;i++) 
			if (i%3!=0) cout<<bitset<7>(a[i]);
			else cout<<bitset<30>(a[i]);
		return;
	}
	cin>>n>>q>>L;
	int smx=0,smy=0;
	for (int i=1;i<=3*n;i++)
	{
		int nw=0;
		for (int j=1;j<=((i%3)?7:30);j++)
		{
			char ch;
			cin>>ch;
			nw=nw*2+ch-'0';
		}
		if (i%3==0) y[i/3]=nw;
		else f[i/3+1][i%3]=nw;
	}	
	// for (int i=1;i<=n;i++) cout<<f[i][1]<<" "<<f[i][2]<<" "<<y[i]<<'\n';
	while (q--)
	{
		int o;
		cin>>o;
		int nw=B;
		for (int i=1;i<=n;i++)
		{
			// cout<<"?"<<i<<" "<<(o+nw)%97<<endl;
			if ((o+nw)%97==f[i][1]&&(o+nw)%93==f[i][2])
			{
				cout<<(y[i]-nw+mod)%mod<<'\n';
				break;
			}
			nw=nw*1023%mod;
		}
	}
}
signed main()
{
	IOS;
	cin.tie(0);
	int T=1;
	while (T--)
	{
		BellaKira();
	}
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 3ms = 2ms + 1ms
memory: 9540kb,5544kb

input:

1
100
495528311 963488152
269613430 443544124
700489871 792354118
151890319 506569919
180452297 13229948
684464994 543841485
978085128 903812192
238355172 441140842
28061035 783291471
530823766 718942732
936853023 439421263
201361623 226633955
304644844 778868118
864860135 461524170
88300500 6959354...

output:

4400
1001010010011011100101010010110111111001001010101010111011100110100110000011100001010000011110101010110110101100101101110111011110111100000000010011000001000100010111100010001110011000111001001100001011000001000110011110000000100100001101101110100011001111010101100110110011111111100111000110001...

input:

2
100 79 4400
1001010010011011100101010010110111111001001010101010111011100110100110000011100001010000011110101010110110101100101101110111011110111100000000010011000001000100010111100010001110011000111001001100001011000001000110011110000000100100001101101110100011001111010101100110110011111111100111...

output:

821194635
805026231
996046536
90686849
440972097
249563964
348624865
848301562
506569919
206848250
382805509
278712030
964702808
39665197
785665865
229376884
551191811
443544124
13229948
210104846
644153444
474113537
850543935
521820992
541265284
710858952
128214705
467224534
313523350
204582782
659...

result:

wrong answer wrong answer on query #1: read 821194635 but expected 310305144