QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#120558 | #3273. Datalab | zhouhuanyi | 25 | 9ms | 3980kb | C++11 | 1.1kb | 2023-07-06 21:30:37 | 2023-07-06 21:30:48 |
Judging History
answer
#include"datalab.h"
#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<cassert>
#define N 8191
using namespace std;
bitset<N+1>A;
bitset<N+1>B;
int sz,block[N+1],ps[N+1],cl[N+1];
vector<int>solve(int k,int LIMIT)
{
int rt,d;
bool op;
vector<int>p(k);
p[k-2]=-1,p[k-1]=1,sz=sqrt(k-2);
for (int i=0;i<=k-3;++i) block[i]=i/sz;
for (int i=0;i<=block[k-3];++i) ps[i]=i*sz;
while (1)
{
A.reset(),op=0;
for (int i=0;i<=block[k-3];++i)
if (ps[i]<=min((i+1)*sz-1,k-3))
A[ps[i]]=op=1;
if (!op) break;
B=Add(A,A);
for (int i=0;i<=block[k-3];++i)
if (ps[i]<=min((i+1)*sz-1,k-3))
{
rt=ps[i]+1;
for (int j=ps[i]+1;j<=min((i+1)*sz-1,k-3)+1;++j)
{
if (B[j]) rt=j;
else break;
}
for (int j=ps[i]+1;j<=rt-1;++j) cl[j]=(!cl[ps[i]]);
if (rt<=min((i+1)*sz-1,k-3)) cl[rt]=cl[ps[i]];
ps[i]=rt;
}
}
for (int i=block[k-3];i>=0;--i)
{
d=min((i+1)*sz-1,k-3),A.reset(),A[d]=1,B=Add(A,A);
for (int j=i*sz;j<=d;++j)
{
if (cl[d]^cl[j]^(!B[d+2])) p[j]=p[d+1];
else p[j]=-p[d+1];
}
}
return p;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 9ms
memory: 3744kb
output:
AC 148
result:
ok Correct, 148 queries used
Test #2:
score: 10
Accepted
time: 8ms
memory: 3856kb
output:
AC 145
result:
ok Correct, 145 queries used
Test #3:
score: 10
Accepted
time: 8ms
memory: 3948kb
output:
AC 147
result:
ok Correct, 147 queries used
Test #4:
score: 10
Accepted
time: 8ms
memory: 3856kb
output:
AC 150
result:
ok Correct, 150 queries used
Test #5:
score: 10
Accepted
time: 8ms
memory: 3844kb
output:
AC 150
result:
ok Correct, 150 queries used
Test #6:
score: 10
Accepted
time: 8ms
memory: 3904kb
output:
AC 146
result:
ok Correct, 146 queries used
Test #7:
score: 10
Accepted
time: 8ms
memory: 3852kb
output:
AC 148
result:
ok Correct, 148 queries used
Test #8:
score: 10
Accepted
time: 8ms
memory: 3864kb
output:
AC 147
result:
ok Correct, 147 queries used
Test #9:
score: 10
Accepted
time: 8ms
memory: 3940kb
output:
AC 149
result:
ok Correct, 149 queries used
Test #10:
score: 10
Accepted
time: 8ms
memory: 3752kb
output:
AC 148
result:
ok Correct, 148 queries used
Test #11:
score: 10
Accepted
time: 9ms
memory: 3968kb
output:
AC 150
result:
ok Correct, 150 queries used
Test #12:
score: 10
Accepted
time: 8ms
memory: 3828kb
output:
AC 145
result:
ok Correct, 145 queries used
Test #13:
score: 10
Accepted
time: 9ms
memory: 3860kb
output:
AC 150
result:
ok Correct, 150 queries used
Subtask #2:
score: 15
Accepted
Test #14:
score: 15
Accepted
time: 9ms
memory: 3856kb
output:
AC 150
result:
ok Correct, 150 queries used
Test #15:
score: 15
Accepted
time: 9ms
memory: 3908kb
output:
AC 148
result:
ok Correct, 148 queries used
Test #16:
score: 15
Accepted
time: 5ms
memory: 3828kb
output:
AC 149
result:
ok Correct, 149 queries used
Test #17:
score: 15
Accepted
time: 8ms
memory: 3940kb
output:
AC 147
result:
ok Correct, 147 queries used
Test #18:
score: 15
Accepted
time: 8ms
memory: 3852kb
output:
AC 145
result:
ok Correct, 145 queries used
Test #19:
score: 15
Accepted
time: 4ms
memory: 3944kb
output:
AC 147
result:
ok Correct, 147 queries used
Test #20:
score: 15
Accepted
time: 6ms
memory: 3972kb
output:
AC 149
result:
ok Correct, 149 queries used
Test #21:
score: 15
Accepted
time: 4ms
memory: 3744kb
output:
AC 147
result:
ok Correct, 147 queries used
Test #22:
score: 15
Accepted
time: 8ms
memory: 3880kb
output:
AC 148
result:
ok Correct, 148 queries used
Test #23:
score: 15
Accepted
time: 5ms
memory: 3856kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #24:
score: 15
Accepted
time: 2ms
memory: 3948kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #25:
score: 15
Accepted
time: 2ms
memory: 3860kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #26:
score: 15
Accepted
time: 5ms
memory: 3856kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #27:
score: 15
Accepted
time: 5ms
memory: 3952kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #28:
score: 15
Accepted
time: 2ms
memory: 3820kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #29:
score: 15
Accepted
time: 5ms
memory: 3952kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #30:
score: 15
Accepted
time: 5ms
memory: 3748kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #31:
score: 15
Accepted
time: 5ms
memory: 3840kb
output:
AC 141
result:
ok Correct, 141 queries used
Test #32:
score: 15
Accepted
time: 5ms
memory: 3952kb
output:
AC 140
result:
ok Correct, 140 queries used
Test #33:
score: 15
Accepted
time: 6ms
memory: 3860kb
output:
AC 144
result:
ok Correct, 144 queries used
Test #34:
score: 15
Accepted
time: 6ms
memory: 3972kb
output:
AC 170
result:
ok Correct, 170 queries used
Test #35:
score: 15
Accepted
time: 6ms
memory: 3908kb
output:
AC 163
result:
ok Correct, 163 queries used
Test #36:
score: 15
Accepted
time: 6ms
memory: 3936kb
output:
AC 146
result:
ok Correct, 146 queries used
Test #37:
score: 15
Accepted
time: 3ms
memory: 3860kb
output:
AC 169
result:
ok Correct, 169 queries used
Test #38:
score: 15
Accepted
time: 3ms
memory: 3836kb
output:
AC 161
result:
ok Correct, 161 queries used
Test #39:
score: 15
Accepted
time: 6ms
memory: 3820kb
output:
AC 147
result:
ok Correct, 147 queries used
Test #40:
score: 15
Accepted
time: 6ms
memory: 3968kb
output:
AC 172
result:
ok Correct, 172 queries used
Test #41:
score: 15
Accepted
time: 5ms
memory: 3688kb
output:
AC 143
result:
ok Correct, 143 queries used
Test #42:
score: 15
Accepted
time: 5ms
memory: 3980kb
output:
AC 142
result:
ok Correct, 142 queries used
Test #43:
score: 15
Accepted
time: 6ms
memory: 3860kb
output:
AC 158
result:
ok Correct, 158 queries used
Test #44:
score: 15
Accepted
time: 6ms
memory: 3832kb
output:
AC 146
result:
ok Correct, 146 queries used
Test #45:
score: 15
Accepted
time: 6ms
memory: 3860kb
output:
AC 145
result:
ok Correct, 145 queries used
Subtask #3:
score: 0
Wrong Answer
Test #46:
score: 75
Accepted
time: 9ms
memory: 3956kb
output:
AC 153
result:
ok Correct, 153 queries used
Test #47:
score: 75
Accepted
time: 9ms
memory: 3828kb
output:
AC 149
result:
ok Correct, 149 queries used
Test #48:
score: 75
Accepted
time: 8ms
memory: 3832kb
output:
AC 148
result:
ok Correct, 148 queries used
Test #49:
score: 75
Accepted
time: 4ms
memory: 3908kb
output:
AC 147
result:
ok Correct, 147 queries used
Test #50:
score: 75
Accepted
time: 8ms
memory: 3976kb
output:
AC 150
result:
ok Correct, 150 queries used
Test #51:
score: 75
Accepted
time: 5ms
memory: 3888kb
output:
AC 146
result:
ok Correct, 146 queries used
Test #52:
score: 75
Accepted
time: 8ms
memory: 3948kb
output:
AC 148
result:
ok Correct, 148 queries used
Test #53:
score: 75
Accepted
time: 6ms
memory: 3940kb
output:
AC 152
result:
ok Correct, 152 queries used
Test #54:
score: 75
Accepted
time: 8ms
memory: 3848kb
output:
AC 147
result:
ok Correct, 147 queries used
Test #55:
score: 75
Accepted
time: 5ms
memory: 3856kb
output:
AC 138
result:
ok Correct, 138 queries used
Test #56:
score: 75
Accepted
time: 5ms
memory: 3948kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #57:
score: 75
Accepted
time: 5ms
memory: 3828kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #58:
score: 75
Accepted
time: 5ms
memory: 3948kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #59:
score: 75
Accepted
time: 5ms
memory: 3944kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #60:
score: 75
Accepted
time: 6ms
memory: 3836kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #61:
score: 75
Accepted
time: 5ms
memory: 3860kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #62:
score: 75
Accepted
time: 6ms
memory: 3896kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #63:
score: 75
Accepted
time: 6ms
memory: 3944kb
output:
AC 137
result:
ok Correct, 137 queries used
Test #64:
score: 75
Accepted
time: 2ms
memory: 3832kb
output:
AC 142
result:
ok Correct, 142 queries used
Test #65:
score: 75
Accepted
time: 2ms
memory: 3848kb
output:
AC 141
result:
ok Correct, 141 queries used
Test #66:
score: 75
Accepted
time: 2ms
memory: 3820kb
output:
AC 142
result:
ok Correct, 142 queries used
Test #67:
score: 75
Accepted
time: 3ms
memory: 3952kb
output:
AC 172
result:
ok Correct, 172 queries used
Test #68:
score: 75
Accepted
time: 5ms
memory: 3976kb
output:
AC 140
result:
ok Correct, 140 queries used
Test #69:
score: 75
Accepted
time: 3ms
memory: 3944kb
output:
AC 173
result:
ok Correct, 173 queries used
Test #70:
score: 75
Accepted
time: 5ms
memory: 3828kb
output:
AC 142
result:
ok Correct, 142 queries used
Test #71:
score: 75
Accepted
time: 3ms
memory: 3972kb
output:
AC 175
result:
ok Correct, 175 queries used
Test #72:
score: 75
Accepted
time: 6ms
memory: 3948kb
output:
AC 146
result:
ok Correct, 146 queries used
Test #73:
score: 75
Accepted
time: 5ms
memory: 3860kb
output:
AC 144
result:
ok Correct, 144 queries used
Test #74:
score: 75
Accepted
time: 6ms
memory: 3944kb
output:
AC 168
result:
ok Correct, 168 queries used
Test #75:
score: 75
Accepted
time: 6ms
memory: 3976kb
output:
AC 163
result:
ok Correct, 163 queries used
Test #76:
score: 75
Accepted
time: 5ms
memory: 3856kb
output:
AC 143
result:
ok Correct, 143 queries used
Test #77:
score: 75
Accepted
time: 5ms
memory: 3852kb
output:
AC 141
result:
ok Correct, 141 queries used
Test #78:
score: 75
Accepted
time: 6ms
memory: 3824kb
output:
AC 169
result:
ok Correct, 169 queries used
Test #79:
score: 75
Accepted
time: 3ms
memory: 3940kb
output:
AC 143
result:
ok Correct, 143 queries used
Test #80:
score: 75
Accepted
time: 5ms
memory: 3904kb
output:
AC 152
result:
ok Correct, 152 queries used
Test #81:
score: 75
Accepted
time: 2ms
memory: 3832kb
output:
AC 152
result:
ok Correct, 152 queries used
Test #82:
score: 75
Accepted
time: 6ms
memory: 3944kb
output:
AC 154
result:
ok Correct, 154 queries used
Test #83:
score: 75
Accepted
time: 6ms
memory: 3976kb
output:
AC 155
result:
ok Correct, 155 queries used
Test #84:
score: 75
Accepted
time: 6ms
memory: 3840kb
output:
AC 155
result:
ok Correct, 155 queries used
Test #85:
score: 75
Accepted
time: 6ms
memory: 3752kb
output:
AC 156
result:
ok Correct, 156 queries used
Test #86:
score: 75
Accepted
time: 6ms
memory: 3972kb
output:
AC 157
result:
ok Correct, 157 queries used
Test #87:
score: 75
Accepted
time: 6ms
memory: 3980kb
output:
AC 160
result:
ok Correct, 160 queries used
Test #88:
score: 75
Accepted
time: 6ms
memory: 3860kb
output:
AC 162
result:
ok Correct, 162 queries used
Test #89:
score: 75
Accepted
time: 4ms
memory: 3856kb
output:
AC 161
result:
ok Correct, 161 queries used
Test #90:
score: 75
Accepted
time: 6ms
memory: 3880kb
output:
AC 162
result:
ok Correct, 162 queries used
Test #91:
score: 75
Accepted
time: 6ms
memory: 3856kb
output:
AC 163
result:
ok Correct, 163 queries used
Test #92:
score: 75
Accepted
time: 6ms
memory: 3976kb
output:
AC 164
result:
ok Correct, 164 queries used
Test #93:
score: 75
Accepted
time: 6ms
memory: 3944kb
output:
AC 168
result:
ok Correct, 168 queries used
Test #94:
score: 75
Accepted
time: 6ms
memory: 3972kb
output:
AC 163
result:
ok Correct, 163 queries used
Test #95:
score: 75
Accepted
time: 3ms
memory: 3860kb
output:
AC 167
result:
ok Correct, 167 queries used
Test #96:
score: 75
Accepted
time: 3ms
memory: 3940kb
output:
AC 167
result:
ok Correct, 167 queries used
Test #97:
score: 75
Accepted
time: 6ms
memory: 3880kb
output:
AC 168
result:
ok Correct, 168 queries used
Test #98:
score: 75
Accepted
time: 6ms
memory: 3904kb
output:
AC 169
result:
ok Correct, 169 queries used
Test #99:
score: 75
Accepted
time: 3ms
memory: 3856kb
output:
AC 169
result:
ok Correct, 169 queries used
Test #100:
score: 75
Accepted
time: 3ms
memory: 3952kb
output:
AC 172
result:
ok Correct, 172 queries used
Test #101:
score: 75
Accepted
time: 6ms
memory: 3976kb
output:
AC 173
result:
ok Correct, 173 queries used
Test #102:
score: 75
Accepted
time: 6ms
memory: 3820kb
output:
AC 174
result:
ok Correct, 174 queries used
Test #103:
score: 75
Accepted
time: 6ms
memory: 3864kb
output:
AC 174
result:
ok Correct, 174 queries used
Test #104:
score: 75
Accepted
time: 6ms
memory: 3856kb
output:
AC 175
result:
ok Correct, 175 queries used
Test #105:
score: 75
Accepted
time: 6ms
memory: 3852kb
output:
AC 177
result:
ok Correct, 177 queries used
Test #106:
score: 75
Accepted
time: 6ms
memory: 3744kb
output:
AC 178
result:
ok Correct, 178 queries used
Test #107:
score: 75
Accepted
time: 6ms
memory: 3980kb
output:
AC 179
result:
ok Correct, 179 queries used
Test #108:
score: 0
Wrong Answer
time: 6ms
memory: 3840kb
output:
WA WA on 0th number,-1 found,1 expected
result:
wrong answer