Submission #1267983
Source Code Expand
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int in(void){
int i;scanf("%d",&i);
return i;
}
long long llin(void){
long long i;scanf("%lld",&i);
return i;
}
void chin(char s[]){
scanf("%s",s);
}
void print(int a){
printf("%d\n",a);
}
void llprint(long long a){
printf("%lld\n",a);
}
void print2(int a,int b){
printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
return a>b?a:b;
}
long long min(long long a,long long b){
return a<b?a:b;
}
int main(void){
int a=in(),b=in(),c=in(),ans=0,ta,tb,tc;
if(a==b&&b==c&&a%2==0){
puts("-1");
return 0;
}
while(1){
ta=b/2+c/2;
tb=c/2+a/2;
tc=a/2+b/2;
if(2*ta!=b+c){
break;
}
if(2*tb!=c+a){
break;
}
if(2*tc!=a+b){
break;
}
ans++;
a=ta;
b=tb;
c=tc;
}
print(ans);
return 0;
}
Submission Info
Submission Time
2017-05-07 00:00:25+0900
Task
A - Cookie Exchanges
User
f_t_ikt
Language
C (GCC 5.4.1)
Score
300
Code Size
871 Byte
Status
AC
Exec Time
1 ms
Memory
128 KB
Compile Error
./Main.c: In function ‘in’:
./Main.c:7:8: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
int i;scanf("%d",&i);
^
./Main.c: In function ‘llin’:
./Main.c:11:14: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
long long i;scanf("%lld",&i);
^
./Main.c: In function ‘chin’:
./Main.c:15:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s",s);
^
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
128 KB
in10.txt
AC
0 ms
128 KB
in11.txt
AC
1 ms
128 KB
in2.txt
AC
1 ms
128 KB
in3.txt
AC
1 ms
128 KB
in4.txt
AC
1 ms
128 KB
in5.txt
AC
0 ms
128 KB
in6.txt
AC
1 ms
128 KB
in7.txt
AC
1 ms
128 KB
in8.txt
AC
0 ms
128 KB
in9.txt
AC
1 ms
128 KB
sample1.txt
AC
1 ms
128 KB
sample2.txt
AC
0 ms
128 KB
sample3.txt
AC
1 ms
128 KB