QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#259766 | #5263. Pociąg towarowy | mikefeng | 15 | 94ms | 36632kb | C++14 | 1.7kb | 2023-11-21 13:21:29 | 2023-11-21 13:21:30 |
Judging History
answer
bool M1;
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<iomanip>
#include<cassert>
#include<random>
#include<cstdio>
#include<vector>
#include<bitset>
#include<stack>
#include<queue>
#include<deque>
#include<cmath>
#include<ctime>
#include<map>
#include<set>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/hash_policy.hpp>
//#include<ext/pb_ds/priority_queue.hpp>
#define fi first
#define se second
#define LD double
#define ll long long
#define Vector Point
#define I128 __int128
#define ull unsigned ll
#define pii pair<int,int>
#define pb(x) push_back(x)
#define syt cerr<<"sytakioi\n"
#define F(i,a,b) for(int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(int i=a,i##end=b;i>=i##end;--i)
#define look_memory cerr<<abs(&M2-&M1)/1024.0/1024<<'\n'
#define rd_i(l,r) uniform_int_distribution<int>(l,r)(rd)
#define rd_r(l,r) uniform_real_distribution<double>(l,r)(rd)
#define look_time cerr<<(clock()-Time)*1.0/CLOCKS_PER_SEC<<'\n'
using namespace std;
//using namespace __gnu_cxx;
mt19937 rd(time(0));
const int N=3e5+5;
int n,m,k;
int a[N],b[N];
int f[N],g[N];
set<int> s[N];
/*
g[i+1]-1 f[i-1]+1之间有a[i]
*/
bool M2;
int main(){
int Time=clock();
look_memory;
cin.tie(nullptr)->sync_with_stdio(false);
cin>>n>>m>>k;
F(i,1,n) cin>>a[i];
F(i,1,m) cin>>b[i],s[b[i]].emplace(i);
int l=1;
F(i,1,n){
if(a[i]==b[l]) ++l;
f[i]=l-1;
}
l=m;
UF(i,n,1){
if(a[i]==b[l]) --l;
g[i]=l+1;
}
F(i,1,n){
int l=g[i+1]-1,r=f[i-1]+1;
// cout<<l<<' '<<r<<'\n';
auto it=s[a[i]].lower_bound(l);
if(it!=s[a[i]].end()&&*it<=r) cout<<"1 ";
else cout<<"0 ";
}
cout<<'\n';
look_time;
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 15
Accepted
time: 0ms
memory: 17744kb
input:
1 1 100000 100000 100000
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 0ms
memory: 17788kb
input:
2 1 100000 100000 99999 99999
output:
0 1
result:
ok 2 number(s): "0 1"
Test #3:
score: 0
Accepted
time: 7ms
memory: 17772kb
input:
5 1 5 1 2 3 4 5 3
output:
0 0 1 0 0
result:
ok 5 number(s): "0 0 1 0 0"
Test #4:
score: 0
Accepted
time: 3ms
memory: 17816kb
input:
3 2 1 1 1 1 1 1
output:
1 1 1
result:
ok 3 number(s): "1 1 1"
Test #5:
score: 0
Accepted
time: 0ms
memory: 17704kb
input:
5 5 5 1 2 3 4 5 1 2 3 4 5
output:
1 1 1 1 1
result:
ok 5 number(s): "1 1 1 1 1"
Test #6:
score: -15
Wrong Answer
time: 0ms
memory: 17900kb
input:
10 2 5 5 4 3 2 1 5 4 3 2 1 1 2
output:
0 0 0 0 1 0 0 0 1 1
result:
wrong answer 10th numbers differ - expected: '0', found: '1'
Subtask #2:
score: 0
Wrong Answer
Test #29:
score: 0
Wrong Answer
time: 3ms
memory: 17832kb
input:
2000 200 10 3 6 7 3 7 1 10 4 10 5 10 5 10 7 10 1 10 2 9 10 3 3 5 2 10 9 7 1 2 8 4 2 7 10 9 1 4 3 5 2 4 10 8 9 1 6 9 3 2 3 1 5 7 2 5 8 8 3 10 5 3 5 7 8 9 5 2 1 6 9 1 4 9 2 1 8 4 2 6 2 9 7 8 6 2 2 1 6 6 3 8 6 1 10 6 10 9 7 8 7 3 8 4 1 2 10 9 6 8 5 2 8 5 3 1 9 8 4 10 4 6 5 5 6 7 8 4 7 1 5 8 1 6 7 3 2 9...
output:
0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0 1 0 1 0 1 0 0 1 0 0 1 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 0 0 1 0 0 1 1 1 1 0 1 1 1 1 1 1 0 0 0 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 1 ...
result:
wrong answer 2000th numbers differ - expected: '0', found: '1'
Subtask #3:
score: 15
Accepted
Test #40:
score: 15
Accepted
time: 94ms
memory: 36496kb
input:
300000 300000 300000 199487 250811 5333 152816 62649 13727 57135 266756 117667 122454 213963 202793 222398 107858 36438 166385 67442 80498 221043 259141 237970 80607 150543 87806 145868 220683 74660 296905 281807 56936 241184 52507 138022 62923 123117 298640 24027 212431 85651 177999 114506 291950 2...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 300000 numbers
Test #41:
score: 0
Accepted
time: 89ms
memory: 36492kb
input:
300000 299999 300000 96418 239269 189936 160849 226811 260787 76546 171227 271876 21533 221165 179387 32203 181489 292329 205228 80524 107068 105187 76551 27912 169843 46055 25961 217318 2182 288105 11873 15766 185350 149189 93741 220735 265723 51269 71822 226574 204147 238028 292059 139518 254188 2...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 300000 numbers
Test #42:
score: 0
Accepted
time: 87ms
memory: 33488kb
input:
300000 240000 300000 89988 210081 219346 14042 209085 112224 169856 140125 126987 257169 192432 295877 229988 65105 35852 118423 147729 155892 131937 230936 77227 280888 102158 180096 22546 38936 265632 180699 229295 229787 66221 7807 153913 181807 134958 46138 198102 38815 225149 41448 179780 21097...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 0 1 1 1 1 0 ...
result:
ok 300000 numbers
Test #43:
score: 0
Accepted
time: 57ms
memory: 28816kb
input:
300000 148000 300000 97749 185718 48551 98115 81706 71393 218060 174104 38384 5928 289908 76244 167851 265876 171760 71089 129135 79831 120909 264067 127271 92462 116101 173585 117650 203864 279302 261516 78767 132594 23292 202567 201101 71119 99323 110150 100932 292248 208179 248107 201793 58791 65...
output:
1 1 0 1 1 0 1 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 1 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 1 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 1 0 0 1 1 0 0 1 0 0 1 1 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 1 1 1 0 1 ...
result:
ok 300000 numbers
Test #44:
score: 0
Accepted
time: 40ms
memory: 21384kb
input:
300000 2000 300000 152331 258885 226797 206194 176049 137460 129068 129890 56411 114247 211984 145939 234220 145689 87450 296589 28994 241402 85416 73173 115223 187403 18453 217145 11883 60940 120085 282432 142579 258078 162154 220562 132025 275233 214876 70348 98272 160762 147421 83026 161137 18459...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 300000 numbers
Test #45:
score: 0
Accepted
time: 36ms
memory: 21312kb
input:
300000 100 300000 28323 244430 221814 44842 148759 209485 75486 266201 15578 228828 139285 187072 89352 117424 11783 150246 68834 130180 6013 53260 299765 259118 93645 62851 272178 295891 144383 173828 53529 208446 84554 312 51607 46671 290764 147228 90284 151191 111149 1945 113843 152861 35119 1883...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 300000 numbers
Test #46:
score: 0
Accepted
time: 87ms
memory: 36632kb
input:
300000 299999 300000 29018 299451 91137 31146 43349 223764 137701 70037 11554 42651 173118 256911 251089 297964 28859 238992 15379 13952 98054 51545 186142 293437 237878 297440 37385 285607 91622 135580 247529 166735 13400 10260 68042 154746 113376 107626 113565 125175 72283 222707 290314 224787 948...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 300000 numbers
Test #47:
score: 0
Accepted
time: 90ms
memory: 36448kb
input:
300000 299999 300000 29018 299451 91137 31146 43349 223764 137701 70037 11554 42651 173118 256911 251089 297964 28859 238992 15379 13952 98054 51545 186142 293437 237878 297440 37385 285607 91622 135580 247529 166735 13400 10260 68042 154746 113376 107626 113565 125175 72283 222707 290314 224787 948...
output:
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 300000 numbers
Subtask #4:
score: 0
Wrong Answer
Test #48:
score: 50
Accepted
time: 48ms
memory: 28792kb
input:
300000 149900 2 2 1 2 2 1 2 2 2 2 2 1 2 1 1 2 2 1 1 1 2 2 2 2 2 2 1 1 2 2 2 1 1 2 1 2 2 1 1 1 1 2 2 1 1 1 1 2 1 1 2 1 2 2 1 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 1 1 2 2 2 1 1 1 1 1 2 1 2 1 2 2 2 2 2 2 1 1 2 2 1 2 2 1 2 2 1 1 1 2 2 1 2 2 1 1 2 2 2 2 1 1 1 1 1 1 2 2 2 1 2 1 2 2 2 1 2 1 1 ...
output:
1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 300000 numbers
Test #49:
score: 0
Accepted
time: 30ms
memory: 22788kb
input:
300000 30000 10 5 7 10 4 2 4 10 9 3 3 2 3 8 5 3 5 2 9 4 1 4 6 5 5 1 7 7 5 3 7 7 3 6 8 8 1 2 8 3 6 3 1 6 1 7 7 8 5 9 1 2 8 3 1 5 8 9 10 2 10 9 9 1 9 8 5 1 6 7 5 5 4 4 9 2 4 8 5 6 1 9 4 1 4 3 8 4 9 5 5 7 7 4 3 7 1 8 8 6 7 4 5 8 1 10 4 1 5 3 1 5 1 4 9 4 3 7 7 3 7 9 4 5 9 1 10 5 5 7 10 4 8 8 8 1 3 3 10 ...
output:
0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 1 1 0 0 1 0 1 1 0 1 1 0 1 1 0 0 0 0 1 1 0 0 0 0 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 300000 numbers
Test #50:
score: -50
Wrong Answer
time: 27ms
memory: 21284kb
input:
300000 1200 200 8 95 40 90 196 68 169 171 163 45 197 137 52 34 23 174 199 42 123 141 38 39 105 166 104 35 183 188 187 118 152 91 6 183 89 75 64 16 157 54 28 122 179 50 166 87 33 16 63 78 89 32 188 96 85 157 77 19 12 64 135 83 173 35 69 144 44 59 45 38 123 124 67 165 160 140 18 29 130 82 174 16 98 16...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
wrong answer 300000th numbers differ - expected: '0', found: '1'