제출 #1200577

#제출 시각아이디문제언어결과실행 시간메모리
1200577boclobanchatMagic Show (APIO24_show)C++20
컴파일 에러
0 ms0 KiB
#include<vector> #include"Alice.h" using namespace std; long long fr[22],per[22]; bool ck[22]; vector< pair<int,int> > Alice() { long long x=setN(4830)-1; vector< pair<int,int> > edges; fr[0]=1; for(int i=1;i<=20;i++) fr[i]=fr[i-1]*i,ck[i]=false; for(int i=1;i<=20;i++) while(true) { per[i]++; if(x>=fr[20-i]) x-=fr[20-i]; else break; } for(int j=0;j<230;j++) for(int i=1;i<=20;i++) edges.push_back({j*21+per[i],j*21+i+1}); for(int j=0;j<229;j++) edges.push_back({j*21+1,(j+1)*21+1}); return edges; }
#include<vector> #include"Bob.h" using namespace std; long long fr[22],per[22]; long long Bob(vector< pair<int,int> > V) { for(auto v:V) { int l=(v.first-1)/21,r=(v.second-1)/21; if(l==r) per[(v.second-1)%21]=v.first%21; } fr[0]=1; for(int i=1;i<=20;i++) fr[i]=fr[i-1]*i; long long x=1; for(int i=1;i<=20;i++) if(per[i]==0) assert(false); for(int i=1;i<=20;i++) x+=(per[i]-1)*fr[20-i]; return x; }

컴파일 시 표준 에러 (stderr) 메시지

# 2번째 컴파일 단계

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:15:46: error: 'assert' was not declared in this scope
   15 |         for(int i=1;i<=20;i++) if(per[i]==0) assert(false);
      |                                              ^~~~~~
Bob.cpp:3:1: note: 'assert' is defined in header '<cassert>'; did you forget to '#include <cassert>'?
    2 | #include"Bob.h"
  +++ |+#include <cassert>
    3 | using namespace std;