제출 #650814

#제출 시각아이디문제언어결과실행 시간메모리
650814kunzaZa183Coins (IOI17_coins)C++17
0 / 100
9 ms1544 KiB
#include <bits/stdc++.h> using namespace std; vector<int> coin_flips(vector<int> b, int c) { int cur = 0; for (int i = 0; i < b.size(); i++) if (b[i] == 1) cur = cur ^ i; for (int i = 0; i < 64; i++) if (cur ^ i == c) { b[i] = !b[i]; break; } return b; } int find_coin(vector<int> b) { int cur = 0; for (int i = 0; i < b.size(); i++) if (b[i] == 1) cur = cur ^ i; return cur; }

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

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:6:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |     for (int i = 0; i < b.size(); i++)
      |                     ~~^~~~~~~~~~
coins.cpp:10:21: warning: suggest parentheses around comparison in operand of '^' [-Wparentheses]
   10 |         if (cur ^ i == c)
      |                   ~~^~~~
coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:20:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for (int i = 0; i < b.size(); i++)
      |                     ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...