QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#119976 | #6669. Mapa | LYC_music | 0 | 2ms | 9652kb | C++14 | 1.5kb | 2023-07-06 09:27:53 | 2023-07-06 09:27:56 |
Judging History
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;
a[i*3-2]=x[i]%97;
a[i*3-1]=x[i]%103;
a[i*3]=y[i];
// cout<<x[i]%97<<" "<<nw<<" "<<(x[i]-nw'\n';
nw=nw*1023%mod;
// 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<<" "<<nw<<" "<<f[i][1]<<" "<<(o+nw)%97<<endl;
if ((o+nw)%mod%97==f[i][1]&&(o+nw)%mod%103==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();
}
}
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 = 1ms + 1ms
memory: 9652kb,5400kb
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 1001010001111011100101010010110111111001001010101010011100100110100110000011100001010000011110110000110110101100101101110111011110111100000100000011000001000100010111100010001110011001010011001100001011000001000110011110000000100101111101101110100011001111010101100110110100111011100111000110001...
input:
2 100 79 4400 1001010001111011100101010010110111111001001010101010011100100110100110000011100001010000011110110000110110101100101101110111011110111100000100000011000001000100010111100010001110011001010011001100001011000001000110011110000000100101111101101110100011001111010101100110110100111011100111...
output:
310305144 821194635 174780370 903812192 805026231 996046536 439421263 645287342 90686849 20101025 440972097 543841485 176553522 249563964 461524170 348624865 848301562 506569919 963939500 206848250 382805509 278712030 964702808 868944393 493895143 39665197 574757075 441140842 785665865 229376884 551...
result:
wrong answer wrong answer on query #19: read 963939500 but expected 306718453