Submission #1084784

#TimeUsernameProblemLanguageResultExecution timeMemory
1084784Math4Life2020마술쇼 (APIO24_show)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "Alice.h" using ll = long long; using pii = pair<ll,ll>; const ll SEED = 82014384209183; const ll N = 5000; ll l2(ll x) { return (31-__builtin_clz(x)); } vector<pair<int,int>> Alice() { ll X = setN((int)N); //X<=10^18<2^60 mt19937 gen(SEED); vector<pii> ans; for (ll x=1;x<N;x++) { ll y=0; ll lx = l2(x); for (ll i=0;i<lx;i++) { ll bv = gen()%60; y += (1LL<<i)*((X>>bv)&1); } ans.push_back({y+1,x+1}); } return ans; }
#include <bits/stdc++.h> #include "Bob.h" using namespace std; using ll = long long; using pii = pair<ll,ll>; const ll SEED = 82014384209183; const ll N = 5000; ll l2(ll x) { return (31-__builtin_clz(x)); } ll Bob(vector<pair<int,int>> V) { mt19937 gen(SEED); ll ans = 0; ll read[N]; for (ll i=0;i<N;i++) { read[i]=-1; } for (pii p0: V) { ll y = p0.first; ll x = p0.second; x--; y--; read[x]=y; } for (ll x=1;x<N;x++) { ll RD=read[x]; ll lx = l2(x); for (ll i=0;i<lx;i++) { ll bv = gen()%60; if (RD!=-1) { ans |= (1LL<<bv)*(RD>>i); } } } return ans; }

Compilation message (stderr)

Alice.cpp: In function 'std::vector<std::pair<int, int> > Alice()':
Alice.cpp:25:9: error: could not convert 'ans' from 'vector<pair<long long int,long long int>>' to 'vector<pair<int,int>>'
   25 |  return ans;
      |         ^~~
      |         |
      |         vector<pair<long long int,long long int>>