Submission #3666127
Source Code Expand
#include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <cstring> #include <cctype> #include <cmath> #include <stack> #include <queue> #include <vector> #include <set> #include <map> #include <list> #include <stdio.h> #include <string.h> #include <cstdlib> #include <math.h> #include <bitset> #include <iterator> #include <iomanip> #include <sstream> #include <numeric> #include <cassert> #define INF 2000000000 #define MOD 1000000007 #define sym cout<<"---------"<<endl; #define ll long long #define mk make_pair #define en endl #define RE return 0 #define int ll #define P pair<int,int> using namespace std; int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1}; int gcd(int a,int b){if(a%b==0){return b;}else return gcd(b,a%b);} int lcm(int a,int b){if(a==0){return b;} return a/gcd(a,b)*b;} void no(){ cout<<"No"<<en; } void yes(){ cout<<"Yes"<<en; } signed main(){ int a,b; cin>>a>>b; if(a<b) swap(a, b); if((a+b)%4){ no(); RE; } int sum=(a+b)/4; if((a-b)%2){ no(); RE; } int dif=(a-b)/2; if((sum+dif)%2){ no(); RE; } int x=(sum+dif)/2; int y=sum-x; if(x>=0&&y>=0){ yes(); RE; }else no(); }
Submission Info
Submission Time | |
---|---|
Task | B - Colored Balls |
User | Kazu0714 |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1218 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 1 ms | 256 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 1 ms | 256 KB |
06.txt | AC | 1 ms | 256 KB |
07.txt | AC | 1 ms | 256 KB |
08.txt | AC | 1 ms | 256 KB |
09.txt | AC | 1 ms | 256 KB |
10.txt | AC | 1 ms | 256 KB |
11.txt | AC | 1 ms | 256 KB |
12.txt | AC | 1 ms | 256 KB |
13.txt | AC | 1 ms | 256 KB |
14.txt | AC | 1 ms | 256 KB |
15.txt | AC | 1 ms | 256 KB |
16.txt | AC | 1 ms | 256 KB |
s1.txt | AC | 1 ms | 256 KB |
s2.txt | AC | 1 ms | 256 KB |
s3.txt | AC | 1 ms | 256 KB |