Submission #918666

# Submission time Handle Problem Language Result Execution time Memory
918666 2024-01-30T08:34:54 Z rahidilbayramli Coins (IOI17_coins) C++17
0 / 100
7 ms 1364 KB
#include<bits/stdc++.h>
#include"coins.h"
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#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(1);
    int xr = 0;
    for(int i = 0; i < c; i++) {
        if(b[i] == 1)
            xr = (xr ^ (i + 1));
    }
    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 + 1));
    }
    return xr;
}

Compilation message

coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:31:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     for(int i = 0; i < b.size(); i++)
      |                    ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1048 KB WA in grader: invalid flips length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1048 KB WA in grader: invalid flips length
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 1352 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 1364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1048 KB WA in grader: invalid flips length
2 Halted 0 ms 0 KB -