제출 #524023

#제출 시각아이디문제언어결과실행 시간메모리
524023DeepessonCoins (IOI17_coins)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "coins.h" std::vector<int> coin_flips(std::vector<int> b, int c) { std::vector<int> flips(1); long long xoro=0; for(int i=0;i!=b.size();++i)if(b[i])xoro^=x; long long quer = c^xoro; flips[0]=quer; return flips; } int find_coin(std::vector<int> b) { int ans=0; for(auto&x:b)ans^=x; return ans; }

컴파일 시 표준 에러 (stderr) 메시지

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:7:18: 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)if(b[i])xoro^=x;
      |                 ~^~~~~~~~~~
coins.cpp:7:47: error: 'x' was not declared in this scope
    7 |     for(int i=0;i!=b.size();++i)if(b[i])xoro^=x;
      |                                               ^