답안 #918677

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
918677 2024-01-30T08:39:27 Z rahidilbayramli Coins (IOI17_coins) C++17
0 / 100
2 ms 1048 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;
    int xr = c;
    for(int i = 0; i < b.size(); 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 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:21:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for(int i = 0; i < b.size(); i++) {
      |                    ~~^~~~~~~~~~
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:31:21: 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++)
      |                    ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1048 KB WA in grader: invalid coin index in flips
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1048 KB WA in grader: invalid coin index in flips
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1044 KB WA in grader: invalid coin index in flips
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1036 KB WA in grader: invalid coin index in flips
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1048 KB WA in grader: invalid coin index in flips
2 Halted 0 ms 0 KB -