akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))
#define repr(i, a, n) for(int (i) = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define RNG(x, a, n) &((x)[a]), &((x)[n])
#define ADD(a, b) ((((a+MOD)%MOD)+((b+MOD)%MOD))%MOD)
#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define PI 3.1415926535897
#define EPS (1e-10)
#define INF INT_MAX
#define INFLL LLONG_MAX
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using MII = std::map<int, int>;
using TIII = std::tuple<int, int, int>;
using MCI = std::map<char, int>;
using VPII = std::vector<PII>;
using namespace std;


int N;
int x[110], y[110], h[110];


bool judgeH(int H, int Cx, int Cy){
	rep(i, 0, N)
		if(max(H-abs(x[i]-Cx)-abs(y[i]-Cy), 0) != h[i]) return false;
	return true;
}


int judge(int Cx, int Cy){
	SI s;
	rep(i, 0, N) s.insert(abs(x[i]-Cx)+abs(y[i]-Cy)+h[i]);
	for(int H : s)
		if(judgeH(H, Cx, Cy) && H > 0) return H;
	return -1;
}


void solve(){
	int cx = -1, cy = -1;
	int H = -1;
	repe(i, 0, 100){
		repe(j, 0, 100){
			H = judge(i, j);
			if(H != -1){ cx = i; cy = j; i = 101; break; }
		}
	}
	cout << cx << ' ' << cy << ' ' << H << endl;
}


signed main(){
	cin >> N;
	rep(i, 0, N) cin >> x[i] >> y[i] >> h[i];

	solve();

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
typedef pair<pll, pll> P;
const ll INF = 1ll<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;
const bool debug = 0;
//---------------------------------//

int n, m, s, t;
vector<pii> g[2][112345]; // 0:yen, 1:snuuk
ll dist[2][112345];
ll ans[112345];

struct Edge {
	int u, v, a, b;
};

struct Edge edge[112345];

void dijkstra(int st, int mode) {
	fill(dist[mode], dist[mode + 1], INF);
	
	priority_queue<pll, vector<pll>, greater<pll> > pq; // cost, pos
	pq.push(pll(0, st));
	dist[mode][st] = 0;
	while (!pq.empty()) {
		pll cur = pq.top(); pq.pop();
		int curpos = cur.se;
		ll curcost = cur.fi;
		
		if (dist[mode][curpos] < curcost) continue;
		
		REP(i, g[mode][curpos].size()) {
			int nextpos = g[mode][curpos][i].fi;
			ll nextcost = curcost + g[mode][curpos][i].se;
			
			if (chmin(dist[mode][nextpos], nextcost)) {
				pq.push(pll(nextcost, nextpos));
			}
		}
	}
}

int main() {
	cin >> n >> m >> s >> t;
	s--; t--;
	REP(i, m) {
		int u, v, a, b;
		scanf("%d %d %d %d", &u, &v, &a, &b);
		u--; v--;
		edge[i] = (Edge){u, v, a, b};
		g[0][u].push_back(pii(v, a));
		g[0][v].push_back(pii(u, a));
		g[1][u].push_back(pii(v, b));
		g[1][v].push_back(pii(u, b));
	}
	
	dijkstra(s, 0);
	dijkstra(t, 1);
	
	ll prmx = 0;
	for (int i = n - 1; i >= 0; i--) {
		ll cur = 1e15;
		cur -= dist[0][i];
		cur -= dist[1][i];
		chmax(prmx, cur);
		ans[i] = prmx;
	}
	
	REP(i, n) printf("%lld\n", ans[i]);
	
	return 0;
}


Measured memory_bytes: 18684
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<iomanip>
#include<stack>
#include<string.h>
#include<cstring>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define sz(a) (int)a.size()
using namespace std;

int main() {
	int x, n;
	cin >> x >> n;
	set<int> se;
	rep(i, n) {
		int ai;
		cin >> ai;
		se.insert(ai);
	}
	int ans = 100101;
	int anss;
	for (int i = 250; i >= -250; i--) {
		if (se.count(i)) continue;
		if (ans >= abs(i - x)) {
			ans = abs(i - x);
			anss = i;
		}
	}
	cout << anss << endl;
}

Measured memory_bytes: 3604
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n,*a = map(int,read().split())

from collections import Counter

d = Counter(a)

kind = 0
x = 0
for k,v in d.items():
    x += v-1
    kind += 1

#print(kind,x)

if kind==1:
    print(1)
elif x%2==0:
    print(kind)
elif x%2==1:
    print(kind-1)







Measured memory_bytes: 21860
// #include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>

#include <map>

using namespace std;
 
#define mt make_tuple
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ALL(a) begin(a), end(a)
#define SZ(a) ((int)(a).size())
 
#ifdef __DEBUG
#define debug if (true)
#else
#define debug if (false)
#endif
 
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll dict[200005];
ll prefix[200005];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  ll N;
  cin >> N;

  for (ll i = 0; i < N; ++i) {
    cin >> dict[i];
  }

  prefix[0] = 0;

  for (ll i = 0; i < N; ++i) {
    prefix[i + 1] = prefix[i] + dict[i];
  }

  map<ll, ll> check;

  for (ll i = 0; i <= N; ++i) {
    auto it = check.find(prefix[i]);
    if (it != check.end()) {
      ll count = it->second;
      check.erase(it);
      check.insert(mp(prefix[i], count + 1));
    } else {
      check.insert(mp(prefix[i], 1));
    }
  }

  ll answer = 0;

  for (auto x : check) {
    ll count = x.second;
    answer += count * (count - 1) / 2;
  }

  cout << answer << "\n";

  return 0;
}

Measured memory_bytes: 15872
#include <bits/stdc++.h>
using namespace std;

int main(){
    int a, b, c;
    cin >> a >> b >> c;

         if(a == b && b != c) cout << "Yes" << endl;
    else if(b == c && c != a) cout << "Yes" << endl;
    else if(c == a && a != b) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <array>
#include <climits>
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;

template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; }
template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }
 
enum FACE {SOUTH, EAST, TOP, BOTTOM, WEST, NORTH};
 
typedef array<int, 6> A;
 
struct dice {
	A value;
 
	dice(const A &value_):value(value_) {}
 
	void roll(FACE a, FACE b, FACE c, FACE d) {
		const int t = value[a];
		value[a] = value[b];
		value[b] = value[c];
		value[c] = value[d];
		value[d] = t;
	}
 
	int operator[](int f) const { return value[f]; }
 
	void north() { roll(TOP, SOUTH, BOTTOM, NORTH); }
	void east()  { roll(TOP, WEST,  BOTTOM, EAST ); }
	void ccw()   { roll(NORTH, EAST, SOUTH, WEST ); }
};
 
int calc(vector<dice> &dies) {
	int res = 0;
	for(int i = 0; i < 6; ++i) {
		unordered_map<int, int> cnt;
		for(const auto &d : dies) {
			++cnt[d[i]];
		}
 
		int mx = 0;
		for(const auto &e : cnt) {
			chmax(mx, e.second);
		}
 
		res += dies.size() - mx;
	}
 
	return res;
}
 
int dfs(unsigned idx, vector<dice> &dies) {
	if(idx == dies.size()) return calc(dies);

	int res = INT_MAX;
 
	for(int i = 0; i < 4; ++i) {
		for(int j = 0; j < 4; ++j) {
			dies[idx].north();
			chmin(res, dfs(idx + 1, dies));
		}
		dies[idx].ccw();
	}

	dies[idx].east();
	for(int i = 0; i < 2; ++i) {
		for(int j = 0; j < 4; ++j) {
			dies[idx].north();
			chmin(res, dfs(idx + 1, dies));
		}
		dies[idx].ccw();
		dies[idx].ccw();
	}

	return res;
}
 
int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	for(int n; cin >> n && n;) {
		unordered_map<string, int> encoder;
		vector<dice> dies;
		dies.reserve(n);
 
		for(int i = 0; i < n; ++i) {
			A value;
			for(auto &e : value) {
				string s;
				cin >> s;
 
				if(!encoder.count(s)) encoder.insert({s, encoder.size()});
				e = encoder.at(s);
			}
 
			dies.emplace_back(value);
		}
 
		cout << dfs(1, dies) << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1232
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;




    int main(){
        int a;
        std::cin >> a;
        int l = a/100;
        int r = a%100;
        if(1 <= l && l <= 12){
        if(1 <= r && r <= 12)printf("AMBIGUOUS\n" );
        else printf("MMYY\n" );
    }else{
        if(1 <= r && r <= 12)printf("YYMM\n" );
        else printf("NA\n" );
    }
    }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int maxAvailable(vector<ll>& X, vector<ll>& Y, vector<char>& C, int N, int K) {
  vector<vector<int> > B(2*K+1, vector<int>(2*K+1));
  rep(n, 2) {
    rep(i, N) {
      ll x = X[i], y = Y[i];
      char c = C[i];
      if(c == 'W') {
        x = (x + K) % (2 * K);
        y = y % (2 * K);
      } else {
        x = x % (2 * K);
        y = y % (2 * K);
      }
      x = (x + n * K) % (2 * K);
      y = (y + n * K) % (2 * K);
      if(x >= K-1) {
        if(y >= K-1) {
          B[x-K+1][y-K+1]++;
          B[x+1][y+1]++;
          B[x+1][y-K+1]--;
          B[x-K+1][y+1]--;
        } else {
          B[x-K+1][0]++;
          B[x+1][y+1]++;
          B[x+1][0]--;
          B[x-K+1][y+1]--;

          B[x-K+1][y+K+1]++;
          B[x+1][y+K+1]--;
        }
      } else {
        if(y >= K-1) {
          B[0][y-K+1]++;
          B[x+1][y+1]++;
          B[x+1][y-K+1]--;
          B[0][y+1]--;

          B[x+K+1][y-K+1]++;
          B[x+K+1][y+1]--;
        } else {
          B[0][0]++;
          B[x+1][y+1]++;
          B[x+1][0]--;
          B[0][y+1]--;

          B[0][y+K+1]++;
          B[x+1][y+K+1]--;

          B[x+K+1][0]++;
          B[x+K+1][y+1]--;

          B[x+K+1][y+K+1]++;
        }
      }
    }
  }
  rep(i, 2*K) rep(j, 2*K) if(j != 0) B[i][j] += B[i][j-1];
  rep(j, 2*K) rep(i, 2*K) if(i != 0) B[i][j] += B[i-1][j];
  int ans = 0;
  rep(i, 2*K) rep(j, 2*K) ans = max(ans, B[i][j]);
  // rep(i, 2*K) {
  //   rep(j, 2*K) {
  //     cout << B[i][j] << ' ';
  //   }
  //   cout << endl;
  // }
  return ans;
}

int main() {
  int N, K;
  cin >> N >> K;
  vector<ll> X(N), Y(N);
  vector<char> C(N);
  rep(i, N) cin >> X[i] >> Y[i] >> C[i];
  cout << maxAvailable(X, Y, C, N, K) << endl;
  return 0;
}



Measured memory_bytes: 17664
fun main(args: Array<String>) {
    val (a, b, c) = listOfLong()
    val d = c - a - b
    val ans = d > 0 && d * d > 4 * a * b
    println(if (ans) "Yes" else "No")
}
fun Long.isEven() = (this % 2L) == 0L
fun Long.isOdd() = !this.isEven()
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun nextInt(offset: Int = 0) = nextInt() + offset
fun nextLong() = java.lang.Long.parseLong(next())
fun nextLong(offset: Long = 0L) = nextLong() + offset
fun nextDouble() = next().toDouble()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
fun listOfInt(offset: Int = 0) = listOfString().map { Integer.parseInt(it) + offset }
fun listOfLong() = listOfString().map { java.lang.Long.parseLong(it) }
fun listOfLong(offset: Long = 0L) = listOfString().map { java.lang.Long.parseLong(it) + offset }
fun listOfDouble() = listOfString().map { it.toDouble() }


Measured memory_bytes: 37812
//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n↑入力 ↓出力');
  Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  var list = nextIntArray();
  var output = [];
  for(var i = 0; i < N; i++){
    if(i % 2 == 0){
      output.push(list[i]);
    }else{
      output.unshift(list[i]);
    }
  }
  if(N % 2 == 1){
    var tmp = [];
    for(var i = 0; i < N; i++){
      tmp.push(output.pop());
    }
    output = tmp;
  }
  myout(myconv(output, 8));
}


Measured memory_bytes: 72200
import java.util.*;
public class Main{
    static Scanner kbd = new Scanner(System.in);
    public static void main(String[] args){
	double n = kbd.nextDouble();
	double max = n;
	double min = n;
	while(kbd.hasNext()){
	    n = kbd.nextDouble();
	    if(n > max) max = n;
	    if(n < min) min = n;
	}
	System.out.println(max-min);
    }
}

Measured memory_bytes: 18676
#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 55;

int n, m;
char a[N][N];
int vis[N][N];
int dx[4]={-1, +1, 0, 0};
int dy[4]={0, 0, +1, -1};

int bfs(int x, int y)
{
    memset(vis,0,sizeof(vis));
	queue<pair<int,int>> q;
	q.push({x,y});
	vis[x][y]=1;
	int an=0;
	while(!q.empty())
    {
        int le=q.size();
        for(int i=0;i<le;i++){
        pair<int,int> tt=q.front();
        q.pop();
        int x=tt.first;
        int y=tt.second;
        for(int i=0;i<4;i++)
        {
           int x1 = x+dx[i],y1=y+dy[i];
           if(x1<0||y1<0||x1>=n||y1>=m||a[x1][y1]=='#')
            continue;
           if(vis[x1][y1]==0)
           {
               vis[x1][y1]=1;
               q.push({x1,y1});
           }
        }
        }
        an++;
    }
    return  an-1;
}


int32_t main()
{
	cin>>n>>m;
	int an=0;
	for(int i=0;i<n;i++)
        for(int j=0;j<m;j++)
        cin>>a[i][j];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(a[i][j]=='.')
            {
                an = max(an,bfs(i,j));
               // cout<<i<<" "<<j<<" "<<bfs(i,j)<<endl;
            }
        }
    }
    cout<<an;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<vector>
#include<array>
#include<algorithm>
#include<numeric>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

int main(){
    ll N;cin>>N;
    ll M=sqrt(N)/1;
    while(M>0){
        ll n=N;
        if(n%M==0){
            cout<<M+n/M-2<<endl;
            return 0;
        }
        M--;
    }
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<int> ans(n, 0);
	int a;
	rep(i,n-1){
		cin >> a;
		ans[a-1]++;
	}
	rep(i,n) cout << ans[i] << endl;
	return 0;
}

Measured memory_bytes: 3992
#define _USE_MATH_DEFINES
//
#include <bits/stdc++.h>
//
using namespace std;
//
#define krep(i, k, n) for (int i = k; i < n; ++i)
#define rep(i, n) for (int i = 0; i < n; ++i)
#define toupp(s) transform(s.begin(), s.end(), s.begin(), ::toupper) // string
#define tolow(s) transform(s.begin(), s.end(), s.begin(), ::tolower) // string
#define pb(v) push_back(v)
#define all(v) v.begin(), v.end()
#define mp make_pair
#define __sort(v) sort(v.begin(), v.end())               // vector
#define __stable_sort(v) stable_sort(v.begin(), v.end()) // vector
#define __exists(c, v) (find(all(c), (v)) != (c).end())  // vector
#define __unique(v)                                                            \
  __sort(v);                                                                   \
  v.erase(unique(v.begin(), v.end()), v.end()) // vector
#define __swap(a, b, tmp)                                                      \
  tmp = a;                                                                     \
  a = b;                                                                       \
  b = tmp;
#define __memset(a) memset(a, 0, sizeof(a));
//
#define dumpVar(v) cerr << setw(30) << #v " = [" << v << "]" << endl
#define dumpArr(v, n)                                                          \
  for (int i = 0; i < n; ++i) {                                                \
    cerr << v[i] << ", ";                                                      \
  }                                                                            \
  cerr << endl
#define dumpPair(p) cerr << "<" << p.first << ", " << p.second << ">" << endl
//
typedef long long ll;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
//
int main() {
  ios::sync_with_stdio(false);
  //
  /* code start */

  int N = 0;
  int ans = 0;
  vector<int> vi;

  cin >> N;

  for (int i = 0; i < N; ++i) {
    int tmp;
    cin >> tmp;
    vi.push_back(tmp);
  }

  for (int i = 0; i < N; ++i) {
    for (int j = i + 1; j < N; ++j) {
      int tmp = vi[i] * vi[j];
      cerr << tmp << " "; // FIXME
      ans += vi[i] * vi[j];
    }
    cerr << endl;
  }

  cout << ans << endl;
  /* code end   */
  //
  return 0;
}

Measured memory_bytes: 256
N = int(input())


def count_pairs(a_list):
    count = 0
    if len(a_list) == 0:
        return 0
    if len(a_list) == 1:
        return a_list[0] // 2
    for index in range(len(a_list)):
        if not index == len(a_list)-1:
            pairs = a_list[index] // 2
            count += pairs
            a_list[index] -= pairs*2

            pairs = min(a_list[index], a_list[index + 1])
            a_list[index + 1] -= pairs
            a_list[index] -= pairs
            count += pairs
        else:
            count += a_list[index] // 2

    return count

a_sub_list = []
count = 0
for _ in range(N):
    a = int(input())
    if a == 0:
        count +=count_pairs(a_sub_list)
        a_sub_list = []
    else:
        a_sub_list.append(a)


count += count_pairs(a_sub_list)

print(count)


Measured memory_bytes: 7200
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
typedef long long ll;


int main()
{
    double l;
    scanf("%lf",&l);

    l=l/3;
    l=l*l*l;

    printf("%lf\n",l);
    
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;

int main(){
  string S; cin >> S;
  
  bool flag = true;
  for(int i=0; i<S.size(); i++){
    if(i%2 == 0 && S.at(i) == 'L'){
      //奇数
      flag = false;
      break;
    }
    
    if(i%2 != 0 && S.at(i) == 'R'){
      //偶数
      
      flag = false;
      break;
    }
  
  }
  
  if(flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  
}


Measured memory_bytes: 256
/**/
#include <iostream>
#include <vector>
using namespace std;

int CalcTheDaySatisfaction(int d, const int N, vector<int>& c, vector<int>& s, int t, vector<int>& last)
{
    int ret = 0;

    // d日目にA[t]Cを開催すると上がる満足度を足す
    ret += s[t];

    // 低下する満足度を計算する
    for( int i = 0; i < N; ++i )
        ret -= c[i] * (d - last[i]);

    return ret;
}


int main()
{
    const int N = 26;

    // 入力
    int D;
    cin >> D;

    vector<int> c(N);
    for( int i = 0; i < N; ++i )
        cin >> c[i];

    vector<vector<int>> s(D);
    for( int i = 0; i < D; ++i ){
        vector<int> tmp(N);
        for( int j = 0; j < N; ++j )
            cin >> tmp[j];
        s[i] = tmp;
    }


    // B問題
    //// 入力
    vector<int> t(D);
    for( int i = 0; i < D; ++i )
        cin >> t[i];
    for( int i = 0; i < D; ++i )
        --t[i];

    //// 満足度計算
    int satisfication = 0;
    vector<int> last(N, 0);
    for( int i = 0; i < D; ++i ){
        // last(d, i)を更新する
        last[t[i]] = i + 1;

        // 満足度を更新する
        satisfication += CalcTheDaySatisfaction(i + 1, N, c, s[i], t[i], last);

        // 出力
        cout << satisfication << endl;
    }

    return 0;
}
/**/

Measured memory_bytes: 3676
//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
using namespace std;

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (ll)(m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,-1,0,0,1,1,-1,-1};
vector<ll>dy={0,0,1,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}
//mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll n,m,k;cin>>n>>m>>k;
  vector<ll>a(n),b(m);
  rep(i,0,n)cin>>a[i];
  rep(i,0,m)cin>>b[i];
  ll sum=0,now=m;
  ll idx=m-1;
  for(auto z:b)sum+=z;
  rep(i,0,n+1){
    while(idx>=0&&sum>k){
      sum-=b[idx];
      now--;
      idx--;
    }
    if(sum<=k)chmax(res,now);
    if(i<n){
      now++;
      sum+=a[i];
    }
  }
  cout<<res<<endl;
  return 0;
}

Measured memory_bytes: 6360
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

int N, M;
vector<int> adj[200'001];
bool visited[200'001];

void Dfs(int src, vector<int> &cycle)
{
    visited[src] = true;
    for (auto &a : adj[src])
        if (visited[a] == false)
            Dfs(a, cycle);
    cycle.emplace_back(src);
}

int main()
{
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    set<vector<int> > s;
    cin >> N >> M;
    for (int i = 0; i < M; ++i)
    {
        int a, b;
        cin >> a >> b;
        s.insert({ a, b });
    }
    for (auto &i : s)
    {
        adj[i[0]].emplace_back(i[1]);
        adj[i[1]].emplace_back(i[0]);
    }

    int maxVal = 0;
    vector<int> cycle;
    for (int i = 1; i <= N; ++i)
    {
        if (visited[i] == false)
        {
            Dfs(i, cycle);
            maxVal = max(maxVal, (int)cycle.size());
            cycle.clear();
        }
    }
    
    cout << maxVal;

    return 0;
}

Measured memory_bytes: 46652
import sys
input = sys.stdin.readline

n = int(input())
edges = [[] for _ in range(n)]

for i in range(n-1):
    a,b = map(int,input().split())
    edges[a-1].append((b-1,i))
    edges[b-1].append((a-1,i))

ans = [-1] * (n-1)

q = [0]
visit = [False] * n
visit[0] = True

while q:
    l = q.pop(-1)
    li = []
    for i,j in edges[l]:
        if not visit[i]:
            q.append(i)
            visit[i] = True
        li.append(j)
    li = list(set(li))
    li2 = []
    for i in li:
        li2.append(ans[i])
    li2.sort()
    if li2[0] == -1:
        li2 = li2[1:]
    count = 1
    for i in li:
        while ans[i] == -1:
            if count not in li2:
                ans[i] = count
            count += 1

print(max(ans))
for i in ans:
    print(i)


Measured memory_bytes: 70048
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define fore(x, c) for(auto &&x : c)
#define rep(i, a, n) for(int i = a, i##len = (int)(n); i < i##len; ++i)
#define rrep(i, a, n) for(int i = (int)(n - 1); i >= a; --i)
#define sz(c) ((int)c.size())
#define contains(c, x) (c.find(x) != end(c))
#define inseg(l, x, r) ((l) <= (x) && (x) < (r))
#define dump(...)
#define pb push_back
#define eb emplace_back
#define _ 0
const signed INF_ = 1001001001; const long long INF = 1001001001001001001LL;
const int DX[9] = {0,1,0,-1,1,1,-1,-1,0}, DY[9] = {-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is, vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
  is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a, const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a, const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap = priority_queue<T, deque<T>, greater<T>>;
struct before_main_function {
  before_main_function() {
      cin.tie(nullptr); ios::sync_with_stdio(0);
      cout << setprecision(15) << fixed;
  }
} before_main_function;
// clang-format on
//------------------8<------------------------------------8<--------------------

signed main() {
  int a;
  string b;
  cin >> a >> b;

  int ans = a * (b[0] - '0') * 100;
  int p = 10;
  rep(i, 0, 2) {
    ans += a * (b[2 + i] - '0') * p;
    p /= 10;
  }
  cout << ans / 100 << endl;
  return (0 ^ _ ^ 0);
}



Measured memory_bytes: 3648
#include <iostream>
using namespace std;
typedef long long LL;
const LL p = 1e9 + 7;

LL pow(LL a, LL b, LL p) {
    LL ans = 1;
    a %= p;
    while (b) {
        if (b & 1) {
            ans = (ans % p) * (a % p) % p;
        }
        b /= 2;
        a = (a % p) * (a % p) % p;
    }
    ans %= p;
    return ans;
}

LL inv(LL x, LL p) {
    return pow(x, p - 2, p);
}

LL C(LL n, LL m, LL p) {
    if (m > n) {
        return 0;
    }
    LL up = 1, down = 1;
    for (int i = n - m + 1; i <= n; i++) {
        up = up * i % p;
    }
    for (int i = 1; i <= m; i++) {
        down = down * i % p;
    }
    return up * inv(down, p) % p;
}

LL Lucas(LL n, LL m, LL p) {
    if (m == 0) {
        return 1;
    }
    return C(n % p, m % p, p) * Lucas(n / p, m / p, p) % p;
}

int main() {
    LL n, a, b, ans = 0;
    cin >> n >> a >> b;
    LL cnt = pow(2, n, p);
    ans = (cnt - 1 - C(n, a, p) - C(n, b, p) + (p << 1)) % p;
    //ans = (cnt - 1 - Lucas(n, a, p) - Lucas(n, b, p) + (p << 1)) % p;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N,M,ans;
  cin >> N >> M;
  
  if(N>1){
    ans=(N*(N-1))/2;
  }else{
    ans=0;
  }
  
  if(M>1){
    ans+=((M*(M-1))/2);
  }else{
    ans+=0;
  }
  
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream> 
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
	int n, k, x,y=0;
	cin >> n >> k;
	rep(i, n) {
		cin >> x;
		if (x > k) {
			y += (x - k) ;
		}
		else if (k - x < x) {
			y += (k - x) ;
		}
		else {
			y += x ;
		}
	}
	cout << y*2 << endl;
	return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>

using namespace std;

int main() {
    long long N, A, B;
    cin >> N >> A >> B;

    long long ans = 0;
    if (A % 2 == B % 2) {
        ans = abs(A - B) / 2;
    } else {
        ans = min(A - 1, N - B) + 1 + (B - A - 1) / 2;
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

int main () {
  int N;
  cin >> N;
  
  vector<int> data(N);
  for (int i = 0; i < N; i++) {
    cin >> data.at(i);
  }
  
  int count = 0;
  bool even = true;
  while (even) {
    for (int i = 0; i < N; i++) {
      if (data.at(i) % 2 == 1) {
        even = false;
      }
    }
    if (even) {
      for (int i = 0; i < N; i++) {
        data.at(i) /= 2;
      }
      count ++;
    }
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define N 100010
using namespace std;
int n,op[2][N];
vector<int> G[N];

int used[1<<3][1<<3][1<<3][N],mem[1<<3][1<<3][1<<3][N];
int calc(int X,int Y,int T,int pos){
  int XY = op[0][pos]=='X'? X:Y;
  if(op[1][pos] == '|') return T | XY;
  if(op[1][pos] == '&') return T & XY;
  if(op[1][pos] == '^') return T ^ XY;
}

int dfs(int X,int Y,int T=0,int pos=0,int turn=0){
  if(G[pos].empty()) return T;
  if(used[X][Y][T][pos]++) return mem[X][Y][T][pos];
  
  int res = turn==0? 0:7;
  for(int nx:G[pos]) {
    int nT = calc(X,Y,T,nx);
    int r = dfs(X, Y, nT, nx, !turn);
    res = turn==0? max(res,r) : min(res,r);
  }
  return mem[X][Y][T][pos] = res;
}

int main(){
  int m;
  cin>>n>>m;
  
  for(int i=1;i<n;i++){
    string str;
    cin>>str;
    op[0][i] = str[4];
    op[1][i] = str[3];
  }
  
  for(int i=0,a,b;i<n-1;i++)cin>>a>>b,G[a].push_back(b);

  while(m--){
    int X,Y;
    cin>>X>>Y;
    
    int x = 0,y = 0,xy[2][2] = {},cnt=0;
    for(int i=19;i>=0;i--){
      int a = X>>i&1, b = Y>>i&1;
      if(a == 0 && b == 0)continue;
      if(xy[a][b]||cnt++ >= 3) continue;
      xy[a][b] = 3 - cnt;
      x = x*2 + a;
      y = y*2 + b;
    }
    while(cnt++<3) x*=2,y*=2;
    int r = dfs(x,y), ans = 0;
    for(int i=0;i<20;i++) {
      int a = X>>i&1, b = Y>>i&1;
      if(a == 0 && b == 0)continue;
      ans += (r>>xy[a][b]&1)<<i;
    } 
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 81624
//package Beg_167;
import java.util.*;

public class Main{
	public static void main(String[] args) {
		Scanner t = new Scanner(System.in);
		String p = t.nextLine();
		String[] l = p.split(" ");
		long [] list=new long[4];
		for (int i=0;i<l.length;i++) {
			list[i]=Long.parseLong(l[i]);
			
		}
		long a = list[0];
		long b=list[1];
		long c=list[2];
		long k=list[3];
		
		if (a>=k) {
			System.out.println(k);
		}
		else if ((a+b)>k) {
			System.out.println(a);
		}
		else {
			long q = k-a-b;
			System.out.println(a-q);
		}
	}
}

Measured memory_bytes: 35744
#include<bits/stdc++.h>
using namespace std;

const int INF=1e9;

int main()
{
   int N; cin>>N;
   vector<int> h(N);
   for(int i=0;i<N;i++) cin>>h[i];

   vector<int> dp(N,INF);
   dp[0]=0;
   for(int i=0;i<N;i++){
      if(i+1<N) dp[i+1]=min(dp[i+1],dp[i]+abs(h[i]-h[i+1]));
      if(i+2<N) dp[i+2]=min(dp[i+2],dp[i]+abs(h[i]-h[i+2]));
   }
   cout<<dp[N-1]<<endl;
   return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;

int main(){
    int n; cin >> n;
    vector<int> v;
    for(int i=0;i<n;i++){
        int a; cin >> a;
        v.push_back(a);
    }
    sort(v.begin(),v.end());
    for(int i=1;i<n;i++){
        if(v[i-1]==v[i]){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}

Measured memory_bytes: 1400
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def ngram(data,n):
    return [data[i:i+n] for i in range(len(data))]

def main():
    s = input().rstrip()
    datas=ngram(s,3)
    answers=[]
    
    for data in datas:
        answers.append(abs(753-int(data)))
    print(min(answers))

if __name__=="__main__":
    main()

Measured memory_bytes: 9080
#include <iostream>
#include <string>
#include <vector>
#include <tuple>

using namespace std;
typedef tuple<char, int> chunk;

#define rep(i, n) for(int i = 0; i < (int)(n); ++i)

int main() {
  string s;
  long k;

  cin >> s >> k;

  int length = s.length();
  if (length == 1) {
    cout << k / 2 << endl;
    return 0;
  }

  vector<chunk> chunks;
  int same = 1;
  rep(i, length - 1) {
    if (s[i] == s[i + 1]) {
      same++;
    } else {
      chunks.push_back({ s[i], same });
      same = 1;
    }
  }
  chunks.push_back({ s[length - 1], same });

  if (chunks.size() == 1) {
    cout << get<1>(chunks[0]) * k / 2 << endl;
    return 0;
  }

  if (k == 1) {
    long changes = 0;
    rep(i, chunks.size()) {
      changes += get<1>(chunks[i]) / 2;
    }
    cout << changes << endl;
    return 0;
  }

  long changes = 0;
  rep(i, chunks.size()) {
    changes += get<1>(chunks[i]) / 2;
  }
  changes *= k;

  auto front = chunks.front();
  auto back = chunks.back();
  if (get<0>(front) == get<0>(back)) {
    int connected = (get<1>(front) + get<1>(back)) / 2;
    int disconnected = get<1>(front) / 2 + get<1>(back) / 2;
    changes += (k - 1) * (connected - disconnected);
  }

  cout << changes << endl;

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <iomanip>
#include <numeric>
 
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
ll N,K;
ll A[200005];
ll sosuu[200005];
bool found;
ll ans;
ll si;
priority_queue<ll> so[200005];
ll m;
map<ll,ll> mm;
char a;
int main() {
    cin >> N>> K;
    for(int i=0;i<N;i++){
        cin >> A[i];
    }
    sort(A,A+N);
    for(int i=0;i<K;i++){
        ans += A[i];
    }
    cout << ans << endl;
        
}


Measured memory_bytes: 9896
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;


int main()
{
    const int N = 2019;
    long long l, r;
    cin >> l >> r;
    r = min(r, l+N);
    int ans = N-1;
    for (long long i=l; i <= r; ++i) {
        for (long long j=i+1; j <= r; ++j) {
            if (ans > i*j%N) {
                ans = i*j%N;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <climits>

bool is_hash(char c) {
    return c == '#';
}

int main(int argc, const char *argv[])
{
    int N;
    std::string S;
    std::cin >> N >> S;

    int num_hash = 0;
    int num_dot = 0;
    for (auto c : S) {
        if (is_hash(c)) ++num_hash;
        else            ++num_dot;
    }


    int left_dot = 0;
    int right_hash = num_hash;
    int min_count = num_hash + num_dot - right_hash - left_dot;
    for (auto c : S) {
        if (is_hash(c)) --right_hash;
        else            ++left_dot;

        int left_hash_plus_right_dot = num_hash + num_dot - right_hash - left_dot;
        min_count = std::min(min_count, left_hash_plus_right_dot);
    }

    std::cout << min_count << std::endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<vector>

#define req(i,n) for(i=0; i<(n); i++)
#define req2(i,k,n) for(i=(k); i<(n); i++)

using namespace std;

int main()
{
	int n,k,a,i;
	cin >> n >> k;
	vector<int> backet(n,0);
	
	req(i,n){
		cin >> a;
		backet[a-1]++;
	}

/*	
	req(i,n)
		cout << backet[i] << endl;
		cout << "sort" << endl;
*/
	sort(backet.rbegin(), backet.rend());

	int count = 0;
	req2(i,k,n)
		count += backet[i];
	
/*	
	req(i,n)
		cout << backet[i] << endl;
*/
	cout << count << endl;

}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;

int main(void){
    int Xor = 0, n, temp;
    cin >>  n;
    vector<int> arr;
    for(int i = 0;i < n;i += 1){
        cin >> temp;
        Xor ^= temp;
        arr.push_back(temp);
    }
    for(int i = 0;i < n;i += 1){
        cout << (Xor ^ arr[i]) << " ";
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 4180
#include <iostream>
using namespace std;

int main()
{
    int w,h,x,y,r;
    cin >> w >> h >> x >> y >> r;

    if( x <= w-r && x >= r && y >= r && y <= h-r){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}



Measured memory_bytes: 3112
import math 
a,b,x = map(int, input().split())
heifht_org = x /a / a
V = a * a * b

if 2 * x >= V:
    theta = math.degrees(math.atan(2 * (b - heifht_org)/a))
else:
    theta = 90 - math.degrees(math.atan(2 * x/a/b/b)) 

print(theta)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
using LL = long long;
int main() {
  LL N, M;
  cin >> N >> M;
  if(N > M) swap(N, M);
  if(3<=N) {
    cout<<(N-2)*(M-2)<<endl;
  } else if(N==1) {
    if(M==1) cout<<1<<endl;
    else if(M==2) cout<<0<<endl;
    else cout<<M-2<<endl;
  } else {
    cout<<0<<endl;
  }
}


Measured memory_bytes: 256
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    int[] a = new int[n + 5];
    int[] b = new int[n + 5];
    int[] c = new int[n + 5];
    int res = 0;

    for (int i = 0; i < n; i++) {
      a[i] = sc.nextInt();
    }

    for (int i = 0; i < n; i++) {
      b[i] = sc.nextInt();
    }

    for (int i = 0; i < n - 1; i++) {
      if (i != n - 1) c[i] = sc.nextInt();
    }

    for (int i = 0; i < n; i++) {
      int cur = a[i] - 1;
      res += b[cur];
      if (i != n - 1) {
        int next = a[i+1] - 1;
        if (cur + 1 == next) res += c[cur];
      }
    }

    System.out.println(res);
  }
}


Measured memory_bytes: 23764
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int a,b,c;
  string s;
  cin>>a>>b>>c;
  int n=10*b+c;
  if(n%4==0)
    cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;


}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long []a = new long[N];
		for(int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
		}
		sc.close();
		long []b = new long[N + 1];
		for(int i = 1; i <= N; i++) {
			b[i] += b[i - 1] + a[i - 1];
		}
		int l = N * (N + 1) / 2;
		long []c = new long[l];
		int idx = 0;
		for(int i = 0; i < N; i++) {
			for(int j = i + 1; j <= N; j++) {
				c[idx] = b[j] - b[i];
				idx++;
			}
		}
		Arrays.sort(c);
		String []bit = new String[l];
		for(int i = 0; i < l; i++) {
			bit[i] = Long.toBinaryString(c[i]);
		}
//		for(String s : bit) {
//			System.out.println(s);
//		}
//		System.out.println("---------");
		Map<Integer, List<String>> map = new HashMap<Integer, List<String>>();
		List<Integer> key = new ArrayList<Integer>();
		for(int i = 0; i < l; i++) {
			String t = bit[i];
			int len = t.length();
			for(int j = 0; j < t.length(); j++) {
				if(t.charAt(j) == '1') {
					if(map.containsKey(len - j)) {
						map.get(len - j).add(t);
					}else {
						List<String> list = new ArrayList<String>();
						list.add(t);
						map.put(len - j, list);
						key.add(len - j);
					}
				}
			}
		}
		Collections.sort(key, Collections.reverseOrder());
		List<String> d = new ArrayList<String>();
		int g = 1000;
		for(int k : key) {
			if(map.get(k).size() >= K) {
				for(String s : map.get(k)) {
					d.add(s);
					g = Math.min(g, s.length());
				}
				break;
			}
		}
		if(d.size() == 0) {
			System.out.println(0);
		}else {
			List<String> d1 = new ArrayList<String>();
			for(int i = 0; i < d.size(); i++) {
				String t = d.get(i);
				d1.add(t.substring(t.length() - g, t.length()));
			}
			int len = d1.get(0).length();
//			for(String t : d1) {
//				System.out.println(t);
//			}
			boolean []id = new boolean[d1.size()];
			for(int i = 0; i < d1.size(); i++) {
				id[i] = true;
			}
			boolean flag = true;
			for(int i = 1; i < len; i++) {
				int cnt = 0;
				for(int j = 0; j < d1.size(); j++) {
					//System.out.println(d1.get(j));
					if(d1.get(j).charAt(i) == '1' && id[j]) {
						cnt++;
					}
				}
				//System.out.println(cnt);
				if(cnt >= K) {
					flag = false;
					for(int j = 0; j < d1.size(); j++) {
						if(d1.get(j).charAt(i) == '0') {
							id[j] = false;
						}
					}
				}
			}
			if(flag) {
				System.out.println((long)Math.pow(2, len - 1));
			}else {
				long ans = (long)Math.pow(2, 50) - 1;
				for(int i = 0; i < d1.size(); i++) {
					if(id[i]) {
						ans = ans & Long.parseLong(d1.get(i), 2);
					}
				}
				System.out.println(ans);
			}
		}
	}
}

Measured memory_bytes: 274084
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n,a,b;
  cin >> n >> a >> b;
  int k=max(a-b,b-a);
  if((k+1)%2 == 0){
    cout << "Borys" << endl;
  }
  else {
    cout << "Alice" << endl;
  }
  
  return 0;
}

    
  


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const ll LINF = 1LL << 60;
const int MOD = 1'000'000'007;

template <typename T>
void print(const T &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

// const int MAX = 1010;

int dp[110][110] = {INF};

int main()
{
    int h, w;
    cin >> h >> w;
    vector<vector<int>> g(h, vector<int>(w, 0));

    for (int i = 0; i < h; i++)
    {
        string line;
        cin >> line;
        for (int j = 0; j < w; j++)
        {
            if (line[j] == '.')
            {
                g[i][j] = 0;
            }
            else
            {
                g[i][j] = 1;
            }
        }
    }
    dp[0][0] = 0;
    for (int j = 1; j < w; j++)
    {
        if (g[0][j] && !g[0][j - 1])
        {
            dp[0][j] = dp[0][j - 1] + 1;
        }
        else
        {
            dp[0][j] = dp[0][j - 1];
        }
    }
    for (int i = 1; i < h; i++)
    {
        if (g[i][0] && !g[i - 1][0])
        {
            dp[i][0] = dp[i - 1][0] + 1;
        }
        else
        {
            dp[i][0] = dp[i - 1][0];
        }
    }

    for (int i = 1; i < h; i++)
    {
        for (int j = 1; j < w; j++)
        {
            // マスが白の場合
            if (!g[i][j])
            {
                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1]);
            }
            else
            {
                dp[i][j] = min(dp[i - 1][j] + (g[i - 1][j] + g[i][j]) % 2, dp[i][j - 1] + (g[i][j - 1] + g[i][j]) % 2);
            }
        }
    }
    // for (int i = 0; i < 3; i++)
    // {
    //     for (int j = 0; j < 3; j++)
    //     {
    //         cout << dp[i][j];
    //     }
    //     cout << endl;
    // }
    if (g[0][0])
    {
        cout << dp[h - 1][w - 1] + 1 << endl;
    }
    else
    {
        cout << dp[h - 1][w - 1] << endl;
    }
    return 0;
}

Measured memory_bytes: 3700
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <queue>
#include <queue>
#include <stack> 
#include <sstream>
#include <set>

typedef  long long ll;
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = { 0, 1, 0,-1};
const int INF = 1e9;
#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
int guki (int a){
    if(a%2==0) return 0;
    else return 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){
    int x = gcd(a,b);
    return (a*b/x);
}

using namespace std;
ll k (ll a){
    a--;
    ll ans =0;
    while(a != 0){
        ans += a;
        a--;
        
    }
    return ans;
}


int main(){
    ll n;
    cin >> n;

    ll ans = 1000000000000;


    for(ll i = sqrt(n) ; 0 < i ; i--){
        if(n%i==0){
            ll y = n/i;
            ll x = (y-1)+(i-1);
            ans = min(ans,x);
        }
    }

    cout << ans <<endl;
}



Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define f(i,a,b) for (int i = a; i < b; i++)
#define IN(i,a,b) (a<=i&&i<=b)

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	clock_t start = clock();
#endif

	int n;
	ll a,b,c,d;
	cin>>n>>a>>b>>c>>d;
	ll m = abs(b-a);
	bool found = 0;
	f(x,0,n) found |= IN(m,c*(n-1-x)-d*x,d*(n-1-x)-c*x);
	cout << (found?"YES":"NO") << endl;

#ifdef LOCAL
	cout << setprecision(12) << (long double)(clock()-start) / CLOCKS_PER_SEC << endl;
#endif
	
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;

int main() {
	char m[10][10] = {
		"",
		".,!? ",
		"abc",
		"def",
		"ghi",
		"jkl",
		"mno",
		"pqrs",
		"tuv",
		"wxyz",
	};

	int n; cin >> n;
	for (int t = 0; t < n; ++t) {
		string ans = "";
		string str; cin >> str;
		int Key = -1, cnt = 0;
		for (int i = 0; i < str.size(); ++i) {
			int key = str[i]-'0';
			if (key == 0) {
				if (cnt > 0) {
					ans += m[Key][(cnt-1)%strlen(m[Key])];
				}
				cnt = 0;
			}
			else {
				Key = key;
				++cnt;
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 1216