제출 #1029900

#제출 시각아이디문제언어결과실행 시간메모리
1029900lucri마술쇼 (APIO24_show)C++17
컴파일 에러
0 ms0 KiB
#include <vector> #include <utility> long long setN(int n); std::vector<std::pair<int,int>> Alice() { std::vector<std::pair<int,int>>v; long long x=setN(5000); for(int i=2;i<=5000;++i) v.push_back({x%(i-1)+1,i}); return v; }
#include <vector> #include <utility> __int128 cmmdc(__int128 a,__int128 b,__int128 &x1,__int128 &x2) { if(b==0) { x1=1; x2=0; return a; } __int128 val=cmmdc(b,a%b,x1,x2),cop; cop=x1; x1=x2; x2=cop-a/b*x2; return val; } long long Bob(std::vector<std::pair<int,int>> V) { __int128 a=0,b=1,aa,bb; __int128 n=V.size(); for(__int128 i=0;i<n;++i) { aa=V[i].first-1; bb=V[i].second-1; __int128 x1,x2; __int128 d=cmmdc(b,bb,x1,x2); a=a+x1*(aa-a)/d*b; b=b*bb/d; a%=b; if(a<=0) a+=b; if(b>=1000000000000000000) return a; } exit(1); }

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

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:35:5: error: 'exit' was not declared in this scope
   35 |     exit(1);
      |     ^~~~
Bob.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^