제출 #1162526

#제출 시각아이디문제언어결과실행 시간메모리
1162526alexander707070Magic Show (APIO24_show)C++17
0 / 100
1 ms584 KiB
#include <bits/stdc++.h> #include "Alice.h" #define MAXN 5007 using namespace std; // you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables. // you had better not use the same global variables in function Alice() and in function Bob(). mt19937 rnd(42069); int n,perm[MAXN]; vector< pair<int,int> > Alice(){ n=5000; long long x = setN(n); for(int i=1;i<=n;i++)perm[i]=i; //shuffle(perm+1,perm+n+1,rnd); vector< pair<int,int> > edges; for(int i=2;i<=10;i++){ edges.push_back({i-1,i}); } for(int i=11;i<=n;i++){ int bit=perm[i]%60; int curr=((x & (1LL<<bit)) > 0); int par=rnd()%i+1; while(perm[par]%2!=curr){ par=rnd()%i+1; } edges.push_back({par,i}); } cout<<1/0; return edges; }
#include <bits/stdc++.h> #include "Bob.h" #define MAXN 5007 using namespace std; // you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables. // you had better not use the same global variables in function Alice() and in function Bob(). mt19937 rndd(42069); int nn,permm[MAXN]; long long Bob(vector< pair<int,int> > V){ cout<<1/0; nn=5000; for(int i=1;i<=nn;i++)permm[i]=i; //shuffle(permm+1,permm+nn+1,rndd); long long ans=0; for(auto curr:V){ if(curr.second<=10)continue; int bit=permm[curr.second]%60; if(permm[curr.first]%2==1)ans|=(1LL<<bit); } return ans; // change this into your code }

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

# 1번째 컴파일 단계

Alice.cpp: In function 'std::vector<std::pair<int, int> > Alice()':
Alice.cpp:40:12: warning: division by zero [-Wdiv-by-zero]
   40 |     cout<<1/0;
      |           ~^~

# 2번째 컴파일 단계

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:17:12: warning: division by zero [-Wdiv-by-zero]
   17 |     cout<<1/0;
      |           ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...