Submission #1292392
Source Code Expand
#include<bits/stdc++.h> #define N 100005 #define M 1000000007 #define vi vector<int> #define pii pair<int,int> #define pb push_back #define mp make_pair #define X first #define Y second #define rep(i,s,e) for(int i=s;i<e;i++) #define drep(i,s,e) for(int i=e-1;i>=s;i--) #define all(x) (x).begin(),(x).end() using namespace std; typedef long long ll; int main(){ ios_base::sync_with_stdio(0); ll a,b,c; cin>>a>>b>>c; if(a%2 || b%2 || c%2){ cout<<0<<endl; return 0; } if(a==b&&b==c){ cout<<-1<<endl; return 0; } ll ca=a,cb=b,cc=c,ans=0; while(ca%2==0 && cb%2==0 && cc%2==0){ a= cb/2 + cc/2; b= ca/2 + cc/2; c= ca/2 + cb/2; ans++; ca=a,cb=b,cc=c; } cout<<ans<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Cookie Exchanges |
User | sumant04 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 838 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 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 | AC | 1 ms | 256 KB |
in11.txt | AC | 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 | AC | 1 ms | 256 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |