QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#648085#8102. Mallrotcar07WA 0ms3652kbC++23470b2024-10-17 16:57:232024-10-17 16:57:24

Judging History

你现在查看的是最新测评结果

  • [2024-10-17 16:57:24]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3652kb
  • [2024-10-17 16:57:23]
  • 提交

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';
    }
}

Details

Tip: Click on the bar to expand more detailed information

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