QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#648085 | #8102. Mall | rotcar07 | WA | 0ms | 3652kb | C++23 | 470b | 2024-10-17 16:57:23 | 2024-10-17 16:57:24 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
constexpr int maxn=1e3+5;
int col[maxn];
int main(){
int n,m;cin>>n>>m;
for(int i=1;i<=n;i++){
int k;cin>>k;
for(int j=1,x;j<=k;j++) cin>>x,col[x]=i;
}
bool f=1;for(int i=1;i<=m;i++) f&=!!col[i];
if(!f) cout<<"NO\n";
else{
cout<<"YES\n";
for(int i=1;i<=m;i++) cout<<i<<' ';cout<<'\n';
for(int i=1;i<=m;i++) cout<<col[i]<<' ';cout<<'\n';
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3592kb
input:
4 4 1 2 2 2 4 2 1 3 1 1
output:
YES 1 2 3 4 4 2 3 2
result:
ok OK!
Test #2:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
1 1 1 1
output:
YES 1 1
result:
ok OK!
Test #3:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
1 4 1 3
output:
NO
result:
ok OK, both said NO
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3652kb
input:
4 1 1 1 1 1 1 1 1 1
output:
YES 1 4
result:
wrong output format Unexpected end of file - int32 expected