Submission #417633

#TimeUsernameProblemLanguageResultExecution timeMemory
417633TricksterCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
//Suleyman Atayew #include "cave.h" #include <algorithm> #include <iostream> #include <string.h> #include <stdio.h> #include <vector> #include <bitset> #include <queue> #include <cmath> #include <map> #include <set> #define maxN 200010 #define ff first #define ss second #define pb push_back #define ll long long #define mod 1000000007 #define pii pair <int, int> #define sz(a) (int)(a.size()) ll bigmod(ll a, ll b) { if(b==0)return 1; ll ret = bigmod(a, b/2); return ret * ret % mod * (b%2 ? a : 1) % mod; } using namespace std; int n; pii arr[maxN]; void exploreCave(int N) { n = N; for(int i = 0; i < n; i++) arr[i].ff = -1; for(int i = 0; i < n; i++) { vector <int> cur; for(int h = 0; h < n; h++) { if(arr[h].ff == -1) cur.pb(0); else cur.pb(arr[h].ss); } int x = tryCombination(cur); int tp = 0; if(x == i) tp = 1; int l = 0, r = n-1, md, ans = 0; while(l <= r) { md = (l+r)/2; vector <int> cur; for(int h = 0; h < n; h++) { if(arr[h].ff == -1) cur.pb(tp); else cur.pb(arr[h].ss); } int x = tryCombination(cur); if(x > i) { l = md+1; ans = md; } else { r = md-1; } } arr[ans] = {tp, i}; } vector <int> S, D; for(int i = 0; i < n; i++) S.pb(arr[i].ff), D.pb(arr[i].ss); answer(S, D); }

Compilation message (stderr)

cave.cpp:71:17: warning: `\U0000037e' is not in NFC [-Wnormalized=]
   71 |     answer(S, D);
      |                 ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:42:32: error: cannot convert 'std::vector<int>' to 'int*'
   42 |         int x = tryCombination(cur);
      |                                ^~~
      |                                |
      |                                std::vector<int>
In file included from cave.cpp:3:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:56:36: error: cannot convert 'std::vector<int>' to 'int*'
   56 |             int x = tryCombination(cur);
      |                                    ^~~
      |                                    |
      |                                    std::vector<int>
In file included from cave.cpp:3:
cave.h:8:24: note:   initializing argument 1 of 'int tryCombination(int*)'
    8 | int tryCombination(int S[]);
      |                    ~~~~^~~
cave.cpp:71:12: error: cannot convert 'std::vector<int>' to 'int*'
   71 |     answer(S, D);
      |            ^
      |            |
      |            std::vector<int>
In file included from cave.cpp:3:
cave.h:9:17: note:   initializing argument 1 of 'void answer(int*, int*)'
    9 | void answer(int S[], int D[]);
      |             ~~~~^~~