QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#119980#6669. MapaLYC_music0 2ms9544kbC++141.5kb2023-07-06 09:34:072023-07-06 09:34:09

Judging History

This is the latest submission verdict.

  • [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:34:09]
  • Judged
  • Verdict: 0
  • Time: 2ms
  • Memory: 9544kb
  • [2023-07-06 09:34:07]
  • Submitted

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;
const int coef1=97;
const int coef2=103;
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;
			a[i*2-1]=x[i]%coef1;
			a[i*2]=y[i];
			nw=nw*1023%mod;
			// a[i*4-1]=y[i]%97;
			// a[i*4]=y[i]%93;
		}
		cout<<(30+14)*n<<'\n';
		// cout<<"??"<<a[1]<<'\n';
		for (int i=1;i<=2*n;i++) 
			if (i%2) cout<<bitset<14>(a[i]);
			else cout<<bitset<30>(a[i]);
		return;
	}
	cin>>n>>q>>L;
	int smx=0,smy=0;
	for (int i=1;i<=2*n;i++)
	{
		int nw=0;
		for (int j=1;j<=((i%2)?14:30);j++)
		{
			char ch;
			cin>>ch;
			nw=nw*2+ch-'0';
		}
		// cout<<"??"<<i<<" "<<nw<<'\n';
		if (i%2==0) y[i/2]=nw;
		else f[i/2+1][i%2]=nw;
	}	
	// for (int i=1;i<=n;i++) cout<<f[i][1]<<" "<<y[i]<<'\n';
	while (q--)
	{
		int o;
		cin>>o;
		int nw=B;
		for (int i=1;i<=n;i++)
		{
			// cout<<(o+nw)%mod%coef1<<" "<<f[i][1]<<'\n';
			if ((o+nw)%mod%coef1==f[i][1])
			{
				cout<<(y[i]-nw+mod)%mod<<'\n';
				break;
			}
			nw=nw*1023%mod;
		}
	}
}
signed main()
{
	IOS;
	cin.tie(0);
	int T=1;
	while (T--)
	{
		BellaKira();
	}
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 2ms = 2ms + 0ms
memory: 9544kb,5448kb

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
0000000100101011100101010010110111111001001000000001010101100110100110000011100001010000000000001111010110101100101101110111011110110000000110000011000001000100010111100010001100000001001100001100001011000001000110011110000000000000011101101110100011001111010101100000000011011011100111000110001...

input:

2
100 79 4400
0000000100101011100101010010110111111001001000000001010101100110100110000011100001010000000000001111010110101100101101110111011110110000000110000011000001000100010111100010001100000001001100001100001011000001000110011110000000000000011101101110100011001111010101100000000011011011100111...

output:

310305144
821194635
506569919
903812192
805026231
996046536
439421263
963488152
90686849
963488152
440972097
543841485
176553522
441140842
461524170
348624865
128214705
506569919
963939500
206848250
382805509
718942732
964702808
868944393
493895143
644153444
574757075
441140842
785665865
13229948
20...

result:

wrong answer wrong answer on query #3: read 506569919 but expected 174780370