Submission #955408

# Submission time Handle Problem Language Result Execution time Memory
955408 2024-03-30T11:48:08 Z guymmk Coins (IOI17_coins) C++14
0 / 100
6 ms 1696 KB
#include "bits/stdc++.h"
using  namespace std;
vector<int> coin_flips(vector<int> b, int c){
    int o=0;
    for(int i=0;i<b.size();i++){
        if(b[i])o^=i;
    }for(int i=0;i<b.size();i++){
        if(o^b[i]==c){
            vector<int>v={i};
            return v;
        }
    }
}int find_coin(vector<int> b){
    int o=0;
    for(int i=0;i<b.size();i++){
        if(b[i])o^=i;
    }return o;
}

Compilation message

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:5:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 |     for(int i=0;i<b.size();i++){
      |                 ~^~~~~~~~~
coins.cpp:7:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |     }for(int i=0;i<b.size();i++){
      |                  ~^~~~~~~~~
coins.cpp:8:18: warning: suggest parentheses around comparison in operand of '^' [-Wparentheses]
    8 |         if(o^b[i]==c){
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:15:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     for(int i=0;i<b.size();i++){
      |                 ~^~~~~~~~~
coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:13:1: warning: control reaches end of non-void function [-Wreturn-type]
   13 | }int find_coin(vector<int> b){
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 1696 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 1696 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1112 KB WA in grader: invalid coin index in flips
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1124 KB WA in grader: invalid coin index in flips
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 1696 KB Output isn't correct
2 Halted 0 ms 0 KB -