Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions Codeforces/1075A.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include <math.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

#define sp system("pause")
#define FOR(i,a,b) for(int i=a;i<=b;++i)
#define FORD(i,a,b) for(int i=a;i>=b;--i)
#define REP(i,n) FOR(i,0,(int)n-1)
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define MS0(x) memset(x,0,sizeof(x))
#define MS1(x) memset(x,1,sizeof(x))
#define SORT(a,n) sort(begin(a),begin(a)+n)
#define REV(a,n) reverse(begin(a),begin(a)+n)
#define ll long long
#define pii pair<int,int>
#define MOD 1000000007

int a[101];

int main(){

ll int n,x,y;
cin>>n>>x>>y;
ll int bmove,wmove;
wmove=min(abs(x-1),abs(y-1));
bmove=min(abs(x-n),abs(y-n));

if(wmove<=bmove){
cout<<"White\n";
}
else{
cout<<"Black";
}
return 0;
}
51 changes: 51 additions & 0 deletions Codeforces/1294A.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include <math.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

#define sp system("pause")
#define FOR(i,a,b) for(int i=a;i<=b;++i)
#define FORD(i,a,b) for(int i=a;i>=b;--i)
#define REP(i,n) FOR(i,0,(int)n-1)
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define MS0(x) memset(x,0,sizeof(x))
#define MS1(x) memset(x,1,sizeof(x))
#define SORT(a,n) sort(begin(a),begin(a)+n)
#define REV(a,n) reverse(begin(a),begin(a)+n)
#define ll long long
#define pii pair<int,int>
#define MOD 1000000007

//int a[100000];

int main(){

int t, a,b,c,n;
cin>>t;
REP(tc, t){
cin>>a>>b>>c>>n;
int sum=a+b+c+n;
if(sum%3!=0 || sum/3<a || sum/3<b || sum/3<c)
cout<<"NO"<<endl;
else
cout<<"YES"<<endl;

}
return 0;
}
9 changes: 9 additions & 0 deletions Codeforces/964A.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <iostream>
using namespace std;

int main() {
int n;
cin >> n;
cout << n / 2 + 1 << endl;
return 0;
}