Submission #918685

# Submission time Handle Problem Language Result Execution time Memory
918685 2024-01-30T08:49:44 Z vjudge1 Coins (IOI17_coins) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include"coins.h"
#define ll long long
#define ld long double
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(v) v.begin(), v.end()
#define pb push_back
#define f first
#define s second
using namespace std;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
vi coin_flips(vi b, int c){
    vi flips;
    int xr = c;
    for(int i = 0; i < b.size(); i++) {
        if(b[i] == 1)
            xr = (xr ^ i);
    }
    flips.pb(xr);
    return flips;
}
int find_coin(vi b)
{
    int xr = 0;
    for(int i = 0; i<b.size(); i++)
    {
        if(b[i] == 1)
            xr = (xr ^ i);
    }
    return xr;
}

Compilation message

coins.cpp:14:17: error: '__gnu_pbds' is not a namespace-name
   14 | using namespace __gnu_pbds;
      |                 ^~~~~~~~~~
coins.cpp:15:9: error: 'tree' does not name a type; did you mean 'free'?
   15 | typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
      |         ^~~~
      |         free
coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:19:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |     for(int i = 0; i < b.size(); i++) {
      |                    ~~^~~~~~~~~~
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:29:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     for(int i = 0; i<b.size(); i++)
      |                    ~^~~~~~~~~