Submission #1266019
Source Code Expand
#include<bits/stdc++.h> using namespace std; void rd(int &x){ int k, m=0; x=0; for(;;){ k = getchar_unlocked(); if(k=='-'){ m=1; break; } if('0'<=k&&k<='9'){ x=k-'0'; break; } } for(;;){ k = getchar_unlocked(); if(k<'0'||k>'9'){ break; } x=x*10+k-'0'; } if(m){ x=-x; } } void wt_L(int x){ char f[10]; int m=0, s=0; if(x<0){ m=1; x=-x; } while(x){ f[s++]=x%10; x/=10; } if(!s){ f[s++]=0; } if(m){ putchar_unlocked('-'); } while(s--){ putchar_unlocked(f[s]+'0'); } } int main(){ int A[3], B[3], res; { int Lj4PdHRW; for(Lj4PdHRW=0;Lj4PdHRW<3;Lj4PdHRW++){ rd(A[Lj4PdHRW]); } } for(res=0;res<1000;res++){ if(A[0]%2 || A[1]%2 || A[2]%2){ break; } { int KL2GvlyY; for(KL2GvlyY=0;KL2GvlyY<(2) + 1;KL2GvlyY++){ B[KL2GvlyY] = A[(KL2GvlyY - (0) + (1))%3]/2 + A[(KL2GvlyY - (0) + (2))%3]/2; } } { int Q5VJL1cS; for(Q5VJL1cS=0;Q5VJL1cS<(2) + 1;Q5VJL1cS++){ A[Q5VJL1cS] = B[Q5VJL1cS]; } } } if(res==1000){ res = -1; } wt_L(res); putchar_unlocked('\n'); return 0; } // cLay varsion 20170506-1 [beta] // --- original code --- // { // int A[3], B[3], res; // rd(A(3)); // rep(res,1000){ // if(A[0]%2 || A[1]%2 || A[2]%2) break; // B[0..2] = A[(1..)%3]/2 + A[(2..)%3]/2; // A[0..2] = B[0..]; // } // if(res==1000) res = -1; // wt(res); // }
Submission Info
Submission Time | |
---|---|
Task | A - Cookie Exchanges |
User | LayCurse |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1605 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 |