Submission #3604266
Source Code Expand
#include <cstdio> #include <algorithm> #include <iostream> #include <vector> #include <map> #include <unordered_map> #include <cmath> #include <queue> #include <set> using namespace std; typedef long long ll; typedef pair<int, int> P; #define INF int(1e9) #define REP(i, n) for(int i = 0; i < (int)(n); i++) #define REPR(i, n) for(int i = n - 1; i >= 0; i--) #define REPONE(i, n) for(int i = 1; i <= (int)(n); i++) #define EACH(i, mp) for(auto i:mp) #define FOR(i, m, n) for(int i = m;i < n;i++) int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; ll A, B, C; void solve() { int powab = 0; ll ab = A + B; while (ab % 2 == 0) { ab /= 2; powab++; } ll bc = B + C; int powbc = 0; while (bc % 2 == 0) { bc /= 2; powbc++; } ll ca = C + A; int powca = 0; while (ca % 2 == 0) { ca /= 2; powca++; } if (A == B == C) cout << -1 << endl; else cout << min(powca, min(powab, powbc)) << endl; } int main() { cin >> A >> B >> C; solve(); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Cookie Exchanges |
User | hiramekun |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1105 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | sample1.txt, sample2.txt, sample3.txt, in1.txt, in10.txt, in11.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample1.txt, sample2.txt, sample3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | AC | 1 ms | 256 KB |
in10.txt | WA | 1 ms | 256 KB |
in11.txt | WA | 1 ms | 256 KB |
in2.txt | AC | 1 ms | 256 KB |
in3.txt | AC | 1 ms | 256 KB |
in4.txt | AC | 1 ms | 256 KB |
in5.txt | AC | 1 ms | 256 KB |
in6.txt | AC | 1 ms | 256 KB |
in7.txt | AC | 1 ms | 256 KB |
in8.txt | AC | 1 ms | 256 KB |
in9.txt | WA | 1 ms | 256 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | WA | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |