QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#648084#8102. Mallrotcar07Compile Error//Python3470b2024-10-17 16:57:122024-10-17 16:57:14

Judging History

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

  • [2024-10-17 16:57:14]
  • 评测
  • [2024-10-17 16:57:12]
  • 提交

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

  File "answer.code", line 2
    using namespace std;
          ^^^^^^^^^
SyntaxError: invalid syntax