QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#266525 | #6646. 物理实验 | PiggiesAndPony# | WA | 6ms | 6928kb | C++14 | 1.0kb | 2023-11-26 15:10:05 | 2023-11-26 15:10:06 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1205;
int in[N],vis[N];
int ans[N];
int n,m,ti[N],p[N][N];
bool chk(){
for(int i = 1;i <= n;i ++) vis[i] = 0;
int l = 0;
for(int i = 1;i <= m;i ++){
for(int j = 1;j <= n;j ++){
if(in[p[i][j]] && !vis[p[i][j]]){
vis[p[i][j]] = 1;
ans[++ l] = p[i][j];
if(l > ti[i]) return 0;
}
if(!in[p[i][j]]) break;
}
}
for(int i = 1;i <= n;i ++) if(in[i] && !vis[i]) ans[++ l] = i;
return 1;
}
void solve(){
cin >> n >> m;
for(int i = 1;i <= m;i ++) cin >> ti[i];
for(int i = 1;i <= m;i ++){
for(int j = 1;j <= n;j ++){
cin >> p[i][j];
}
}
for(int i = 1;i <= n;i ++){
in[i] = 1;
if(!chk()) in[i] = 0;
}
chk();
for(int i = 1;i <= n - m;i ++) cout << ans[i] << " \n"[i == n - m];
}
int main(){
ios::sync_with_stdio(false);
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 6ms
memory: 6928kb
input:
600 299 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
9 17 65 44 111 207 116 101 42 280 229 41 117 139 171 244 272 199 27 36 191 94 136 99 83 235 178 226 270 82 43 104 308 95 188 202 291 131 187 112 151 281 344 208 166 200 3 258 246 301 70 102 373 147 163 372 194 198 206 114 303 245 29 282 227 306 15 267 127 119 120 263 84 160 148 46 184 4 92 144 209 2...
result:
FAIL Method Invalid.