제출 #1203522

#제출 시각아이디문제언어결과실행 시간메모리
1203522emad234Magic Show (APIO24_show)C++20
컴파일 에러
0 ms0 KiB
#include "Alice.h" #include "bits/stdc++.h" #define F first #define S second #define ll long long #define pii pair<int,int> const int mxN = 2e5 + 5; const int mod = 1e9 + 7; 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(). vector<pair<int,int>> Alice(){ ll x = setN(5000); vector<ll>idx; for(int i = 1;i <= 5000;i++){ idx.push_back(i / 83); } shuffle(idx.begin(),idx.end(),mt19937(234)); vector<pii>v = {{1,2},{1,3}}; for(int i = 4;i <= 5000;i++){ if((x & (1LL << (idx[i - 1])))) { v.push_back({2,i}); // cout<<2<<' '<<i<<' '<<idx[i - 1]<<'\n'; } else v.push_back({3,i}); } return v; }
#include "Bob.h" #include "bits/stdc++.h" #define F first #define S second #define ll long long #define pii pair<ll,ll> const int mxN = 2e5 + 5; const int mod = 1e9 + 7; 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(). ll Bob(vector<pair<int,int>> V){ bool vis[70] = {} vector<ll>idx; vector<ll>v[4]; for(int i = 1;i <= 5000;i++){ idx.push_back(i / 83); } shuffle(idx.begin(),idx.end(),mt19937(234)); for(auto x : V){ if(x.F == 3 || x.F == 2) v[x.F].push_back(x.S); } ll st = 2; if(v[2].size() < v[3].size()) st = 3; ll ans = 0; if(st == 3) ans = (1LL << 61) - 1; for(auto x : v[st]){ if(!vis[idx[x - 1]]) ans += (1LL << idx[x - 1]) * (st == 2 ? 1 : -1); vis[idx[x - 1]] = 1; } return ans; }

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

# 2번째 컴파일 단계

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:15:9: error: expected ',' or ';' before 'vector'
   15 |         vector<ll>idx;
      |         ^~~~~~
Bob.cpp:18:17: error: 'idx' was not declared in this scope
   18 |                 idx.push_back(i / 83);
      |                 ^~~
Bob.cpp:20:17: error: 'idx' was not declared in this scope
   20 |         shuffle(idx.begin(),idx.end(),mt19937(234));
      |                 ^~~