Submission #1263494
Source Code Expand
/*
なせば大抵なんとかなる!
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <limits.h>
#include <float.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <iterator>
#include <vector>
#include <map>
#include <utility>
#define LLU unsigned long long int
#define LL long long int
using namespace std;
#define Lfmax DBL_MAX
#define LLUmax ULLONG_MAX
#define LLmax LLONG_MAX
#define dmax INT_MAX
#define vd vector<int>
#define vLL vector<long long int>
#define vLLU vector<unsigned long long int>
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define debug printf("asd\n")
#define debugd(a) printf("--%d\n",a)
#define debugdd(a,b) printf("--%d %d\n",a,b)
#define debugarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i]);printf("\n")
#define newline printf("\n")
#define forin(a,b,c) for(int a=b ; a<c ; a++)
#define forineq(a,b,c) for(int a=b ; a<=c ; a++)
#define forde(a,b,c) for(int a=b ; a>=c ; a--)
#define UPC(oo) (oo>='A' && oo<='Z')
#define LWC(oo) (oo>='a' && oo<='z')
#define DGT(oo) (oo>='0' && oo<='9')
#define UPCVOC(oo) (oo=='A' || oo=='E' || oo=='I' || oo=='U' || oo=='O')
#define LWCVOC(oo) (oo=='a' || oo=='e' || oo=='i' || oo=='u' || oo=='o')
inline void scd(int &a){scanf("%d",&a);}
inline void scdd(int &a,int &b){scanf("%d %d",&a,&b);}
inline void sctd(int &a,int &b,int &c){scanf("%d %d %d",&a,&b,&c);}
inline void sctlld(LL &a,LL &b,LL &c){scanf("%lld %lld %lld",&a,&b,&c);}
inline void scdlld(LL &a,LL &b){scanf("%lld %lld",&a,&b);}
inline void prd(int a){printf("%d",a);};
inline void prdd(int a,int b){printf("%d %d",a,b);};
inline void prtd(int a, int b, int c){printf("%d %d %d",a,b,c);};
inline void prtlld(LL a, LL b, LL c){printf("%lld %lld %lld",a,b,c);};
inline void prdlld(LL a, LL b){printf("%lld %lld",a,b);};
inline void prlld(LL a){printf("%lld",a);};
#define scarrd(a,b) for(int index=0 ; index<b ; index++)scanf("%d",&a[index])
#define prarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i])
#define iniarr(a,b) for(int i=0 ; i<b ;i++)a[i]=0
#define arr(a,b) int *a=(int *)malloc(b*sizeof(int))
#define llarr(a,b) long long int *a=(long long int *)malloc(b*sizeof(long long int))
#define st(a,b) char *a=(char *)malloc(b*sizeof(char))
#define grav 9.8
#define pi 3.14159265
int main()
{
LL a,b,c;
sctlld(a,b,c);
if((a==b && b==c) || (a%2==1 || b%2==1 || c%2==1))
{
printf("-1");
return 0;
}
LL d=0,e=0;
do
{
d=0;
d+=a/2;
a/=2;
d+=b/2;
b/=2;
d+=c/2;
c/=2;
//debugd(d);
//printf("-%d %d %d\n",a,b,c);
a+=d/3;
b+=d/3;
c+=d/3;
//printf("-%d %d %d\n",a,b,c);
e++;
if(e>=dmax)
{
printf("-1");
return 0;
}
}while(a%2==0 && b%2==0 && c%2==0);
prlld(e);
return 0;
}
Submission Info
Submission Time
2017-05-06 21:22:38+0900
Task
A - Cookie Exchanges
User
Amnestia
Language
C++14 (GCC 5.4.1)
Score
0
Code Size
2910 Byte
Status
WA
Exec Time
1 ms
Memory
256 KB
Compile Error
./Main.cpp: In function ‘void sctlld(long long int&, long long int&, long long int&)’:
./Main.cpp:51:71: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
inline void sctlld(LL &a,LL &b,LL &c){scanf("%lld %lld %lld",&a,&b,&c);}
^
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
AC
1 ms
256 KB
in2.txt
WA
1 ms
256 KB
in3.txt
WA
1 ms
256 KB
in4.txt
AC
1 ms
256 KB
in5.txt
WA
1 ms
256 KB
in6.txt
WA
1 ms
256 KB
in7.txt
WA
1 ms
256 KB
in8.txt
WA
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