akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;
 
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;}
 
const ll INF=1e9+7;

ll n,m,q;
vector<ll> a,b,c,d;
ll ans=0;

void dfs(vector<ll> A){
    if(A.size()==n){
        ll sum=0;
        rep(i,q){
            if(A[b[i]]-A[a[i]]==c[i]){
                sum+=d[i];
            }
        }
        ans=max(ans,sum);
        return ;
    }
    ll beg=1;
    if(A.size()!=0){
        beg=A.back();
    }
    for(ll i=beg;i<=m;i++){
        A.push_back(i);
        dfs(A);
        A.pop_back();
    }
    return ;
}

int main(){
    cin >> n >> m >> q;
    
    rep(i,q){
        ll x,y,z,w;
        cin >> x >> y >> z >> w;
        x--; y--;
        a.push_back(x);
        b.push_back(y);
        c.push_back(z);
        d.push_back(w);
    }
    vector<ll> A;
    dfs(A);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll mod=1e9;

int main(){
  int M,D;  
  int cnt(0);
  cin>>M>>D;
  for (int i(1);i<=M;i++){
    for (int j(1);j<=D;j++){
      if (i==(j/10)*(j%10)&&j/10>=2&&j%10>=2) cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 764
#include <cmath>
#include <iostream>

using namespace std;

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

    if (abs(a - c) <= d)
        cout << "Yes\n";
    else if (abs(a - b) <= d && abs(b - c) <= d)
        cout << "Yes\n";
    else
        cout << "No\n";
}


Measured memory_bytes: 256
N, K = map(int, input().split())
nK = (N // K)
if K % 2 == 0:
    if (K//2) <= (N % K):
        rnK = nK + 1
    else:
        rnK = nK
else:
    rnK = 0
print(nK**3 + rnK**3)

Measured memory_bytes: 2940
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <tuple>
#include <numeric>
#define rep(i, s, g) for ((i) = (s); (i) < (g); ++(i))
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1ll << 60);

int main(void)
{
    ll n;
    double t, a;
    double tmp = 1000000000;

    cin >> n >> t >> a;

    ll ans = 0;

    for (int i = 0; i < n; i++)
    {
        double h;
        cin >> h;

        if (tmp > abs(a - (t - 0.006 * h)))
        {
            tmp = abs(a - (t - 0.006 * h));
            ans = i + 1;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <climits>

using namespace std;
#define forn(x, n)         for (int x = 0; x < n; x++)
#define forr(x, n)         for (int x = n; x >= 0; x--)
#define for1(x, n)         for (int x = 1; x < n; x++)
#define fore(x, a, b, c)   for (int x = a; x <= b; x += c)
#define all(container)     (container).begin(), container.end()
#define rall(container)    (container).rbegin(), container.rend()
#define sz(container)      (int) (container).size()
#define pb                 push_back
#define eb                 emplace_back
#define fi                 first
#define sc                 second

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#ifdef LOCAL_DEFINE
    #include "DEBUG.hpp"
#else
    #define eprint(...) 0
#endif
template<class T> bool smin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool smax(T &a, T b) { return a < b ? (a = b, true) : false; }

const int N = 100010;
char verdict[20];

int main(void)
{
    int n;
    scanf("%d", &n);
    int tle = 0, wa = 0, ac = 0, rte = 0;
    forn(i, n) {
        scanf("%s", verdict);
        string v = string(verdict);
        if (v == "TLE") tle++;
        else if (v == "WA") wa++;
        else if (v == "AC") ac++;
        else rte++;
    }
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", ac, wa, tle, rte);
    return 0;
}

Measured memory_bytes: 3864
package main

import (
	"fmt"
	"sort"
	"strconv"
)

var pows = []int{1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824}

func main() {
	var n int
	fmt.Scan(&n)

	values := make([]int, n)
	dic := make(map[int]int)
	for i := 0; i < n; i++ {
		var str string
		fmt.Scan(&str)

		v, _ := strconv.Atoi(str)
		dic[v] = dic[v] + 1

		values[i] = v
	}
	sort.Sort(sort.Reverse(sort.IntSlice(values)))

	count := 0
	for _, v := range values {
		rest, _ := dic[v]
		target := find(v)
		if v == target {
			dic[target] = dic[target] - (rest/2)*2
			count = count + rest/2
			continue
		}
		t, _ := dic[target]
		if t > 0 {
			dic[target] = dic[target] - min(t, rest)
			dic[v] = dic[v] - min(t, rest)
			count = count + min(t, rest)
		}
	}
	fmt.Println(count)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func find(n int) int {
	for _, p := range pows {
		if p > n {
			return p - n
		}
	}
	return -1
}


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

using namespace std;
typedef long long ll;

const ll INF = 1e9;
const ll MOD = 1e9 + 7;

int f(ll n) {
  vector<pair<ll, ll>> res;
  for (ll p = 2; p * p <= n; p++) {
    if (n % p != 0) {
      continue;
    }
    int num = 0;
    while (n % p == 0) {
      num++;
      n /= p;
    }
    res.push_back(make_pair(p, num));
  }
  if (n != 1) {
    res.push_back(make_pair(n, 1));
  }
  int ans = 1;
  for (auto itr = res.begin(); itr != res.end(); itr++) {
    ans *= (itr->second + 1);
  }
  return ans;
}

int main() {
  int N;
  cin >> N;
  int ans = 0;
  for (int i = 1; i <= N; i++) {
    if (i % 2 == 0) continue;
    if (f(i) == 8) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
/*input
7
6 7 8
8 8 3
2 5 2
7 8 6
4 6 8
2 3 4
7 5 1
*/
#include <bits/stdc++.h>
using namespace std;

int dp[100005][5], a[100005][5];

int main(){

	int n; scanf("%d", &n);
	for(int i = 1; i <= n; i++){
		scanf("%d%d%d", &a[i][1], &a[i][2], &a[i][3]);
	}
	memset(dp, 1000000000, sizeof dp);
	dp[1][1] = a[1][1], dp[1][2] = a[1][2], dp[1][3] = a[1][3];
	for(int i = 2; i <= n; i++){
		for(int j = 1; j <= 3; j++){
			for(int k = 1; k <= 3; k++){
				if(j == k) continue;
				dp[i][j] = max(dp[i][j], dp[i - 1][k] + a[i][j]);
			}
		}
	}
	int ans = 0;
	for(int i = 1; i <= 3; i++) ans = max(ans, dp[n][i]);
	printf("%d\n", ans);
	return 0;
}

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

int main()
{
    int a,b[100000];
    long long min = 1000001;
    long long max = -1000001;
    long long sum = 0;

    cin >> a;
    //cout << "\n" << endl;
    for (int i=1; i<=a; i++){
        cin >> b[i];
        if (min > b[i]) min = b[i];
        if (max < b[i]) max = b[i];
        sum += b[i];
    }
    cout << min << " " << max << " " << sum << endl;
    return 0;
}

Measured memory_bytes: 3120
from collections import Counter

while True:
    try:
        card = list(map(int, input().split(",")))

    except:
        break

    counter = Counter(card)
    mc = counter.most_common()
    if len(mc) == 2:
        if mc[0][1] == 4:
            print("four card")
        else:
            print("full house")
    elif len(mc) == 3:
        if mc[0][1] == 3:
            print("three card")
        else:
            print("two pair")
    elif len(mc) == 4:
        print("one pair")
    else:
        t = sorted([mc[i][0] for i in range(len(mc))])
        if t[4]-t[3] == t[3]-t[2] == t[2]-t[1] and \
            (t[1]-t[0] or (t[0] == 1 and t[4] == 13)):
            print("straight")
        else:
            print("null")

Measured memory_bytes: 7916
import java.util.*;

class Main {
        public static void main(String args[]) {
                Scanner sc = new Scanner(System.in);
                while (true) {
                        String[] S = new String[3];
                        S[0] = sc.next();
                        if (S[0].equals("0")) {
                                break;
                        }
                        S[1] = sc.next();
                        S[2] = sc.next();
                        boolean f = true;
                        for (int i = 0; i < 3; i++) {
                                if (S[i].charAt(0) == S[i].charAt(1) && S[i].charAt(1) == S[i].charAt(2) && S[i].charAt(0) != '+') {
                                        System.out.println(S[i].charAt(0));
                                        f=false;
                                        break;
                                }
                                if (S[0].charAt(i) == S[1].charAt(i) && S[1].charAt(i) == S[2].charAt(i) && S[0].charAt(i) != '+') {
                                        System.out.println(S[0].charAt(i));
                                        f=false;
                                        break;
                                }
                        }
                        if (f && S[0].charAt(0) == S[1].charAt(1) && S[1].charAt(1) == S[2].charAt(2) && S[0].charAt(0) != '+') {
                                System.out.println(S[0].charAt(0));
                                f=false;
                        }
                        if (f && S[0].charAt(2) == S[1].charAt(1) && S[1].charAt(1) == S[2].charAt(0) && S[0].charAt(2) != '+') {
                                System.out.println(S[0].charAt(2));
                                f=false;
                        }
                        if (f) {
                                System.out.println("NA");
                        }
                }
        }
}

Measured memory_bytes: 25916
// 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, b;
  cin >> a >> b;
  cout << a * b << endl;
  return (0 ^ _ ^ 0);
}



Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
  int s,w;
  cin>>s>>w;
  if(s <= w)
  {
    cout << "unsafe" <<endl;
  }else
  {
    cout << "safe" <<endl;
  }
    return 0;
}

Measured memory_bytes: 3592
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    int k ; 
    int s ;
    cin >> k >> s ;
    int  z ,ans;
    for(int i = 0 ; i <= k ; i++){
       for(int j = 0 ; j <= k ; j++ ){
           z = s - i - j ;
           if(0<= z && z <= k){
               ans ++ ;
           }
       }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int k = scan.nextInt();
        int x = scan.nextInt();

        int yen = 0;
        for(int i=0;i<k; i++) {
            yen += 500;
        }
        if(yen >= x)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
}

Measured memory_bytes: 21844
using System;
using System.Collections.Generic;
using System.Globalization;

class Program
 {
    static void Main(string[] args)
    {
        string nyuryoku;
        string[] temp = new string[4];
        double result;
        nyuryoku = Console.ReadLine();
        temp = nyuryoku.Split(' ');
        result = Math.Sqrt(Math.Pow(double.Parse(temp[2]) - double.Parse(temp[0]),2) + Math.Pow(double.Parse(temp[3]) - double.Parse(temp[1]),2));
        Console.WriteLine("{0:f8}",result);
    }
 }



Measured memory_bytes: 18012
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
#define f first
#define s second

int  main() {
    ll y = 1 ;
    while(1) {
        ll x ;
        cin >> x ;
        if (x==0) return  cout << y << endl,0 ;
        y++ ;
    }


}


Measured memory_bytes: 3568
def acc(n):
    return n * (n + 1) // 2


def calc(a, b):
    if a > b:
        return acc(a) + acc(max(b - 1, 0))
    else:
        return acc(b) + acc(max(a - 1, 0))


s = input()
lc = 0
hc = 0
pre = None
ans = 0
for si in s:
    if pre == '>' and si == '<':
        ans += calc(hc, lc)
        lc, hc = 0, 0
    if si == '<':
        lc += 1
    else:
        hc += 1
    pre = si
ans += calc(hc, lc)

print(ans)


Measured memory_bytes: 4116
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
void *wmem;
template<class T> inline void walloc1d(T **arr, int x, void **mem = &wmem){
  static int skip[16]={0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
  (*mem) = (void*)( ((char*)(*mem)) + skip[((unsigned long long)(*mem)) & 15] );
  (*arr)=(T*)(*mem);
  (*mem)=((*arr)+x);
}
template<class T1> void sortA_L(int N, T1 a[], void *mem = wmem){
  sort(a, a+N);
}
template<class T1> void rsortA_L(int N, T1 a[], void *mem = wmem){
  sortA_L(N, a, mem);
  reverse(a, a+N);
}
inline 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;
  }
}
inline void rd(long long &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;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(long long x){
  char f[20];
  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');
  }
}
inline void wt_L(double x){
  printf("%.15f",x);
}
char memarr[96000000];
int N;
int A;
int B;
long long V[50];
long long c[51][51];
int main(){
  double r1;
  int i, m, u;
  long long r2=0;
  wmem = memarr;
  rd(N);
  rd(A);
  rd(B);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<(N);Lj4PdHRW++){
      rd(V[Lj4PdHRW]);
    }
  }
  rsortA_L(N,V);
  for(i=0;i<(51);i++){
    c[i][0] = 1;
  }
  for(i=(1);i<(51);i++){
    int j;
    for(j=(1);j<(51);j++){
      c[i][j] = c[i-1][j-1] + c[i-1][j];
    }
  }
  u = m = 0;
  for(i=0;i<(N);i++){
    if(V[i] > V[A-1]){
      u++;
    }
    if(V[i]==V[A-1]){
      m++;
    }
  }
  if(u){
    B = A;
  }
  {
    int KL2GvlyY;
    long long Q5VJL1cS;
    if(A==0){
      Q5VJL1cS = 0;
    }
    else{
      Q5VJL1cS = V[0];
      for(KL2GvlyY=(1);KL2GvlyY<(A);KL2GvlyY++){
        Q5VJL1cS += V[KL2GvlyY];
      }
    }
    r1 = (double)Q5VJL1cS/ A;
  }
  for(i=(A);i<(B+1);i++){
    if(i-u >= 0){
      r2 += c[m][i-u];
    }
  }
  wt_L(r1);
  wt_L('\n');
  wt_L(r2);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190902-1

// --- original code ---
// int N, A, B;
// ll V[50];
// 
// ll c[51][51];
// {
//   int i, u, m;
//   double r1;
//   ll r2 = 0;
//   
//   rd(N,A,B,V(N));
//   rsortA(N,V);
// 
//   rep(i,51) c[i][0] = 1;
//   rep(i,1,51) rep(j,1,51) c[i][j] = c[i-1][j-1] + c[i-1][j];
// 
//   u = m = 0;
//   rep(i,N){
//     if(V[i] > V[A-1]) u++;
//     if(V[i]==V[A-1]) m++;
//   }
//   if(u) B = A;
// 
//   r1 = (double)sum(V(A)) / A;
//   rep(i,A,B+1) if(i-u >= 0) r2 += c[m][i-u];
// 
//   wtLn(r1,r2);
// }


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

int main(){
	
	int a,b,c,t;
	
	cin >> a >> b >> c;
	
	while(1){
		if(c<=b && b<=a)break;
	if(a>b){
		t = a;
		a = b;
		b = t;
	}else if(b>c){
		t = b;
		b = c;
		c = t;
	}else if(c>a){
		t = c;
		c = a;
		a = t;
		}
	}
	cout << c <<" "<< b << " " << a <<endl;
}

Measured memory_bytes: 1164
sx,sy,tx,ty = map(int,input().split())

ans = ''
ans += 'U'*(ty-sy)
ans += 'R'*(tx-sx)
ans += 'D'*(ty-sy)
ans += 'L'*(tx-sx)

ans += 'L'
ans += 'U'*(ty-sy+1)
ans += 'R'*(tx-sx+1)
ans += 'DR'
ans += 'D'*(ty-sy+1)
ans += 'L'*(tx-sx+1)
ans += 'U'
print(ans)

Measured memory_bytes: 9044
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <string>
#include <set>
#include <algorithm>
using namespace std;
typedef long long LL;

LL n;
LL a[100];

int main()
{
	scanf("%lld%lld%lld%lld", &a[14], &a[12], &a[1], &a[2]);
	scanf("%lld", &n);
	LL per = min(a[14] * 4, min(a[12] * 2, a[1]));
	bool flag = false;
	if (per * 2 <= a[2]) flag = true;
	if (n & 1) {
		if (flag) printf("%lld\n", n * per);
		else printf("%lld\n", (n - 1) / 2 * a[2] + per);
	}
	else {
		if (flag) printf("%lld\n", n * per);
		else printf("%lld\n", (n / 2) * a[2]);
	}
	return 0;
}

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

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define REPS(i, m, n) for (int i = (m); i <= (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) for (int i = 0; i <= (int)(n); i++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define rreps(i, x) for (int i = (int)(x); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
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; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) { fill( (T*)array, (T*)(array+N), val ); }


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

    int N; cin >> N;
    vector<int> p(N);
    rep(i, N) cin >> p[i];
    int cnt = 0, ans = 0;
    REPS(i, 1, N) {
        if (p[i-1] == i) {
            if (cnt) {cnt = 0; continue;}
            ans++;
            cnt++;
        } else {
            cnt = 0;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <stdlib.h>
#include <stdlib.h>
using namespace std;

int main()
{
    int a,b,x;
    cin>>a>>b>>x;
    if((x>=a)&&(x<=(a+b)))
            cout<<"YES"<<endl;
            else
                cout<<"NO"<<endl;
                return 0;
    }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
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;
}
using ll = long long;
const ll MOD = 1e9 + 7;
const long long INF = 1LL << 60;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a.at(i);

    string answer = "APPROVED";
    rep(i, n)
    {
        if (a.at(i) % 2 == 0)
        {
            if (a.at(i) % 3 == 0 || a.at(i) % 5 == 0)
            {
                continue;
            }
            else
            {
                answer = "DENIED";
                cout << answer << endl;
                return 0;
            }
        }
    }
    cout << answer << endl;
    return 0;
}

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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
using ld = long double;
const ul mod = 1000000007;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, x, m;
    cin >> n >> x >> m;

    vector<ll> g(m, -1);
    ll now = x % m;
    ll loop_point;
    while (true) {
        ll next = now * now % m;
        if (g[next] != -1) {
            g[now] = next;
            loop_point = next;
            break;
        } else {
            g[now] = next;
            now = next;
        }
    }

    ll loop_size = 0, loop_sum = 0;
    ll point = loop_point;
    while (true) {
        loop_size++;
        loop_sum += point;
        if (g[point] == loop_point) {
            break;
        } else {
            point = g[point];
        }
    }

    ll ans = 0;
    point = x % m;
    while (point != loop_point && n != 0) {
        ans += point;
        point = g[point];
        n--;
    }
    ans += loop_sum * (n / loop_size);
    n %= loop_size;
    point = loop_point;
    while (n != 0) {
        ans += point;
        point = g[point];
        n--;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 3988
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
  private static class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
      reader = new BufferedReader(new InputStreamReader(in));
      tokenizer = null;
    }

    public String next() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public String nextLine() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          return reader.readLine();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }

      return tokenizer.nextToken("\n");
    }

    public long nextLong() {
      return Long.parseLong(next());
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }

    public double nextDouble() {
      return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = nextInt();
      return a;
    }

    public long[] nextLongArray(int n) {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = nextLong();
      return a;
    }
  }

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    long n = sc.nextLong() - 1;
    String name = "";
    while (n >= 0) {
      long d = n % 26;
      name = (char) (97 + (int) d) + name;
      n /= 26L;
      n -= 1L;
    }
    System.out.println(name);
  }
}

Measured memory_bytes: 37224
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>


int main(){
	int i, j, h, w;
	char str[105];
	int count[30];

	for (i = 0; i < 26; i++) count[i] = 0;
	scanf("%d%d", &h, &w);
	for (i = 0; i < h; i++) {
		scanf("%s", str);
		//printf("%s", str);
		for (j = 0; j < w; j++) {
			count[str[j] -'a']++;
		}
	}
	//for (j=0;j<26;j++)printf("%d ", count[j]);	
	int p1 = 0, p2 = 0, p4 = 0;
	if (h % 2 == 0 && w % 2 == 0) {
		p4 = h*w / 4;
	} else if (h % 2 == 0 && w % 2 != 0) {
		p4 = h * (w - 1) /4;
		p2 = h/2;
	} else if (h % 2 != 0 && w % 2 == 0) {
		p4 = (h - 1) * w /4;
		p2 = w / 2;
	} else {
		p1 = 1;
		p4 = (h - 1) * (w - 1) / 4;
		p2 = (h*w - p4*4 - p1) / 2;
	}
	
	int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
	for (j = 0; j < 26; j++) {
		if (count[j] == 0)continue;
		if (count[j] % 4 == 0) c4++;
		else if (count[j] % 4 == 1) c1++;
		else if (count[j] % 4 == 2) c2++;
		else c3++;
	}
	/*
	printf("p1:%d\n", p1);
	printf("p2:%d\n", p2);
	printf("p4:%d\n", p4);

	printf("c1:%d\n", c1);
	printf("c2:%d\n", c2);
	printf("c3:%d\n", c3);
	printf("c4:%d\n", c4);
	*/
	int ans = 0;
	if (p1 == c1 + c3 && p2 >= c2+c3 && (p2-c2-c3)%2 == 0) {
		ans = 1;
	}

	printf("%s\n", (ans == 1) ? ("Yes"):("No"));

	return 0;
}


Measured memory_bytes: 128
//#include "stdafx.h"
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <functional>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <tuple>
#include <numeric>

using namespace std;

/*-----------------------------------------------------------------------------
　定義
 -------------------------------------------------------------------------------*/
#define REP(i, n)				for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n)			for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define INF						2e9
#define MOD						(1000 * 1000 * 1000 + 7)
#define Ceil(x, n)				(((((x))+((n)-1))/n))		/* Nの倍数に切り上げ割り算 */
#define CeilN(x, n)				(((((x))+((n)-1))/n)*n)		/* Nの倍数に切り上げ */
#define FloorN(x, n)			((x)-(x)%(n))				/* Nの倍数に切り下げ */
#define IsOdd(x)				(((x)&0x01UL) == 0x01UL)			
#define IsEven(x)				(!IsOdd((x)))						
#define	BitSetV(Val,Bit)		((Val) |= (Bit))			
#define	BitTstV(Val,Bit)		((Val) & (Bit))				
#define ArrayLength(x)			(sizeof( x ) / sizeof( x[ 0 ]))
#define MAX_DWORD				(0xFFFFFFFF)
#define	MAX_SDWORD				((SDWORD)0x7FFFFFFF)
#define	MIN_SDWORD				((SDWORD)0x80000000)
#define	MAX_QWORD				((QWORD)0xFFFFFFFFFFFFFFFF)
#define	MIN_QWORD				((QWORD)0x0000000000000000)
#define	MAX_SQWORD				((SQWORD)0x7FFFFFFFFFFFFFFF)
#define	MIN_SQWORD				((SQWORD)0x8000000000000000)
#define M_PI					3.14159265358979323846

typedef long					SDWORD;
typedef long long				SQWORD;
typedef unsigned long			DWORD;
typedef unsigned long long int	QWORD;
typedef pair<int, int>			P;

/*-----------------------------------------------------------------------------
　処理
 -------------------------------------------------------------------------------*/
#define N_MAX	(200 * 1000)
#define K_MAX	(10)
#define M_MAX	(10)
#define H_MAX	(1000)
#define W_MAX	(1000)

int main()
{
	int N, K;
	cin >> N >> K;
	
	vector<int> bou(N);
	REP(i, N) {
		cin >> bou[i];
	}
	sort(bou.rbegin(), bou.rend());

	int ans = 0;
	REP(i, K) ans += bou[i];
	cout << ans;
	cout << endl;
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//clock_t start=clock();clock_t end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef pair<pii,pii> P;
typedef tuple<ll,ll,ll> tl;
typedef pair<double,double> pdd;
typedef vector<vector<ll>> mat;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll mod5=1000000009;
ll inf=1LL<<62;
double pi=3.141592653589793238462643383279L;
double eps=1e-14;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
#define srep(itr,st) for(auto itr=st.begin();itr!=st.end();itr++)
#define mrep(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define Max(a,b) a=max(a,b)
#define Min(a,b) a=min(a,b)
typedef pair<pii,pii> e;
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
#define umh unordered_map<ll,ll,custom_hash>
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll c=gcd(a,b);
    return a*b/c;
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
    now%=md;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}
ll popcount(ll n){
    ll ret=0;
    ll u=n;
    while(u>0){
        ret+=u%2;
        u/=2;
        
    }
    return ret;
}

int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    int n;cin>>n;
    int m;cin>>m;
    int sum=0;
    rep(i,0,m){
        int a;cin>>a;
        sum+=a;
    }
    cout<<max(-1,n-sum)<<endl;
}


Measured memory_bytes: 3664
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define REP(i, n) for (int i = 0; i < (n); i++)

using namespace std;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> S(N);
  REP(i, N) cin >> S[i];
  vector<vector<int>> divs(N + 1);
  for (int i = 1; i <= N; i++) {
    for (int j = i; j <= N; j += i) {
      divs[j].push_back(i);
    }
  }
  const long long INF = 1e18;

  vector<vector<pair<int, long long>>> back(N);
  vector<vector<pair<int, long long>>> front(N);
  for (int d = 1; d <= N - 1; d++) {
    {
      int x = N - 1;
      long long s = 0;
      while (x >= 0) {
        s += S[x];
        back[d].emplace_back(x, s);
        x -= d;
      }
      reverse(back[d].begin(), back[d].end());
    }
    {
      int x = 0;
      long long s = 0;
      while (x <= N - 1) {
        s += S[x];
        front[d].emplace_back(x, s);
        x += d;
      }
    }
  }

  auto check = [&](int a, int b) {
    if (a <= b || b <= 0) return -INF;
    if (a % (a - b) == 0) {
      long long k = a / (a - b);
      if ((a - b) * (k - 1) + a < N - 1) return -INF;
    }
    long long res = 0;
    res += lower_bound(back[a - b].begin(), back[a - b].end(), make_pair(a, -INF))->second;
    res += lower_bound(front[a - b].begin(), front[a - b].end(), make_pair(N - 1 - a, -INF))->second;
    return res;
  };
  long long ans = 0;
  for (int A = 1; A <= N - 1; A++) {
    for (int k : divs[N - 1 - A]) {
      int B = A - (N - 1 - A) / k;
      ans = max(ans, check(A, B));
    }
  }
  cout << ans << '\n';
}


Measured memory_bytes: 70316
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
using namespace std;

int N;

void func(){

	priority_queue<int> Q;

	int tmp,ans = -1;

	for(int i = 0; i < N; i++){
		scanf("%d",&tmp);
		Q.push(tmp);
	}

	int pre = -1,count = 1;
	while(!Q.empty()){
		if(pre == Q.top()){
			count++;
		}else{
			if(count > N/2){
				ans = pre;
			}
			count = 1;
		}
		pre = Q.top();
		Q.pop();
	}
	if(count > N/2){
		ans = pre;
	}

	if(ans == -1){
		printf("NO COLOR\n");
	}else{
		printf("%d\n",ans);
	}
}

int main(){

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func();
	}

	return 0;
}

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

typedef long long ll;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define ANS(n) cout << (n) << endl

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(a);i>=(b);i--)

#define ALL(obj) (obj).begin(),(obj).end()

#define pii pair<int,int>

#define pb(a) push_back(a)
#define mp make_pair

int main()
{
	int n,m;
	cin >> n >> m;
	vector<pair<ll,ll>> ab;
	FOR(i,0,n){
		int a,b;
		cin >> a >> b;
		ab.pb(mp(a,b));
	}
	sort(ALL(ab));
	ll ans = 0;
	int shop = 0;
	while(m > 0){
		if(m > ab[shop].second){
			m -= ab[shop].second;
			ans += ab[shop].first * ab[shop].second;
		}else{
			ans += ab[shop].first * m;
			break;
		}
		shop++;
	}
	ANS(ans);
	return 0;
}


Measured memory_bytes: 2420
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int ans = 0;
		if (a == b) {
			ans = a * 2;
		} else {
			ans = Math.max(a, b) + Math.max(a, b) - 1;
		}
		System.out.println(ans);
	}

}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
#define MAX 1e9
void solve(){
  int H,n;
	cin >> H  >> n;
  	int a[n],b[n],dp[H+1];
	for(int i = 0; i < n; ++i){
		cin >> a[i] >> b[i];
	}
	dp[0]=0;
  	for(int i=1;i<=H;i++) dp[i]=MAX;
  	for(int hlth=0;hlth<=H;hlth++){
      for(int i=0;i<n;i++){
        dp[hlth]=min(dp[hlth],dp[max(0,hlth-a[i])]+b[i]);
      }
    }
  cout<<dp[H];
}
int main(){	
	solve();
	return 0;
}

Measured memory_bytes: 256
#n=int(input())
x,y=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
flag=False
for i in range(x+1):
    j=x-i
    foot=i*2+j*4
    if foot==y:
        flag=True
        break
if flag:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9112
#include<stdio.h>
int main()
{
    int count=0;
    int a,b,c,d,n;
    while(scanf("%d",&n)!=EOF)
    {
        count=0;
        for(a=0; a<10; a++)
            for(b=0; b<10; b++)
                for(c=0; c<10; c++)
                    for(d=0; d<10; d++)
                        if(a+b+c+d==n)
                            count++;
        printf("%d\n",count);
    }
    return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<ctype.h>
typedef long long LL;
#define rep(i,n) for(LL i=0; i<(LL)(n); i++)

//qsort
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

//比較
int max(int a, int b){
	if (a>b) return a;
	else return b;
}

int min(int a,int b) {
	if(a>b) return b;
	else return a;
}


//main関数
int main(){
	int n;
	int a[200000];
	long long sum = 0;
	long long res = 0;
	scanf("%d", &n);
	for(int i = 0; i < n ; i++){
		scanf("%d", &a[i]);
		sum += a[i];
	}
	qsort(a, n, sizeof(int) , compare_int);
 	int cnt = 0;
 	int i= n-1;
 	while(cnt < n-1 ){
 		if( i == n-1){
 			res += a[i];
 			cnt ++;
 		}
 		else if( cnt + 2 <= n-1){
 			res += 2*a[i];
 			cnt += 2;
 		}
 		else {
 			res += a[i];
 			cnt++;
 		}
 		i--;
 	}
 	printf("%lld",res);
	return 0;
}







Measured memory_bytes: 3100
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

    int V, E;
    cin >> V >> E;
    vector<vector<P>> edge(V);
    REP(i, E) {
        int s, t, d;
        cin >> s >> t >> d;
        edge[s].emplace_back(d, t);
        edge[t].emplace_back(d, s);
    }
    vector<int> used(V);
    priority_queue<P, vector<P>, greater<P>> pq;
    pq.emplace(0, 0);
    int res = 0;
    while (!pq.empty()) {
        int c, i;
        tie(c, i) = pq.top();
        pq.pop();
        if (used[i]) continue;
        used[i] = true;
        res += c;
        for (auto &p : edge[i]) {
            int d, j;
            tie(d, j) = p;
            if (!used[j]) {
                pq.emplace(d, j);
            }
        }
    }
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 6748
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long n,a,b;
  cin >> n >> a >> b;
  if(a>b||(n==1&&a!=b)){
    cout << 0 << endl;
  }
  else if(a==b||n==2){
    cout << 1 << endl;
  }
  else{
    cout << (b-a)*(n-2)+1 << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>

int main()
{
	long long N;
	int K;

	std::cin >> N >> K;

	// NをK進法にする 
	int ans = -1;
	int gen_num = 0;
	for(int i=0; gen_num<N; i++)
	{
		int degit = 1;
		for(int j=1; j<=i; j++)
		{
			degit *= K;
		}
		gen_num = degit - 1;
//		printf("%d\n", gen_num);
		ans++;
	}
	std::cout << ans << std::endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
using namespace std;

/*
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long ll;

#define fi first
#define se second

using Graph = vector<vector<int>>;

int main()
{
    string s;
    cin >> s;
    if (s == "ABC")
    {
        cout << "ARC" << endl;
    }
    else
    {
        cout << "ABC" << endl;
    }

    return 0;
}


Measured memory_bytes: 3592
n=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]

bsum=0
for i in b: 
    bsum += i

csum=0
for i in range(0,n-1):
    if a[i]+1 == a[i+1]:
        csum += c[a[i]-1]
        
        
print(bsum+csum)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>

#include <bitset>
#include <cassert>
#include <queue>
#include <random>
#include <stack>
#include <iomanip>

using namespace std;

#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define repf(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define repr(i, a, b) for (ll i = (ll)a; i > (ll)b; i--)

#define repv(x, arr) for (auto &x : arr)
#define all(v) (v).begin(), (v).end()
#define vec(name, num) vector<ll> name((num), 0);
#define mp(a, b) make_pair(a, b)
#define op(i) cout << (i) << endl;
#define F first
#define S second

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const ll mod = 1e9 + 7;
const ll infl = 1e17;


int main()
{
    ll n, m;
    cin >> n >> m;
    vll x(n,0);
    ll a, b;
    rep(i,m){
        cin >> a >> b;
        x[a - 1]++;
        x[b - 1]++;
    }
    rep(i,n){if(x[i]%2==1){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <numeric>
#include <set>
#include <unordered_set>
#include <queue>
#include <cmath>
 
using namespace std;
#define ll long long
#define rep(i, n) for(int i = 0;i < n;i++)
#define FOR(i, n, m) for(int i=n; i<m; ++i)

using Graph = vector<vector<int>>;

// 深さ優先探索
vector<bool> seen;
void dfs(const Graph &G, int v) {
    seen[v] = true; // v を訪問済にする

    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v); // 再帰的に探索
    }
}

int main() {
  ll N, M;
  ll A[5];
  rep(i,5){
    cin >> A[i];
    if(A[i]==0){
      N=i;
    }
  }
  
  
  cout << N+1 << endl;
  
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <vector>


using namespace std;
#define PI acos(-1)

int main(){
    int N,M,X;
    cin>>N>>M>>X;
    
    vector<int> C(N);
    vector<vector<int>> A(N,vector<int>(M));
    rep(i,N){
        cin>>C[i];
        rep(l,M){
            cin>>A[i][l];
        }
    }
    int ans=10000000;
    for(int i=0;i<(1<<N);i++){
        vector<int> skill(M);
        int sum=0;
        bitset<12>b(i);
        rep(j,N){
            if(b[j]){
             rep(l,M)skill[l]+=A[j][l];
             sum+=C[j];
            }
        }
        bool ok=true;
        rep(k,M){
         if(skill[k]<X){
          ok=false;
          break;
          }
        }  
        if(ok)ans=min(ans,sum);
        
    }
	if(ans==10000000){
	    cout<<-1<<endl;
	    return 0;}
	cout<<ans<<endl;
}



Measured memory_bytes: 3644
#include <iostream>

using namespace std;

long f(long n, long x) { return n < 0 ? 0 : n / x + 1; }

int main() {
  long a, b, x;
  cin >> a >> b >> x;
  cout << f(b, x) - f(a - 1, x) << endl;
  return 0;
}


Measured memory_bytes: 256
n, m = map(int, input().split())
x = list(map(int, input().split()))
l = []
if n >= m:
    print(0)
else:
    x = set(x)
    x = list(x)
    x.sort()
    for i in range(m - 1):
        l.append(x[i + 1] - x[i])
    l.sort()
    l.reverse()
    del l[0:n - 1]
    print(sum(l))

Measured memory_bytes: 14928
#m = int(input())
n, m = map(int, input().split())
#al = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]
switch = []
kl = []
for i in range(m):
    temp = list(map(int, input().split()))
    kl.append(temp[0])
    switch.append(temp[1:])
pl = list(map(int, input().split()))
# print(switch)

pattern = [[0 for _ in range(n)] for _1 in range(2**n)]
for i in range(2**n):
    for j in range(n):
        if ((i >> j) & 1):  # 二進数iの下から数えてj桁目が1か否か
            pattern[i][j] = 1

ans = 0
for ptnum, spt in enumerate(pattern):
    islit = True
    for lightnum in range(m):
        count = 0
        for s in switch[lightnum]:
            if spt[s-1] == 1:
                count += 1
        if count % 2 != pl[lightnum]:
            islit = False
            break
    if islit:
        ans += 1
print(ans)


Measured memory_bytes: 9244
N, X = map(int, input().split())

# メモ化するための初期化
a, p = [1], [1]
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)

def f(N, X):
    # レベル0
    if N == 0:
        # 0層以下
        if X <= 0: # X <= 0 や X > a_N を許容し解説本文から簡略化
            return 0
        # 1層以上 (レベル0から実質1層のみ)
        else:
            return 1
    # レベル1以上
    # B ~ 以下
    elif X <= 1 + a[N - 1]:
        return f(N - 1, X - 1)
    # B ~ P ~ B 以下
    else:
        return p[N - 1] + 1 + f(N - 1, X - 2 - a[N - 1])

print(f(N, X))


Measured memory_bytes: 3064
#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>
#include <string.h>
#include <vector>

#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

typedef int64_t ll;

const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INTMAX = 2147483647;
const ll LLMAX = 9223372036854775807;

template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

using namespace std;


class A {
	string s;
public:
	A()
	{
		cin >> s;
	}
	void solve()
	{
		int ans = 700;

		REP(i, 3)
			if (s[i] == 'o')
				ans += 100;

		cout << ans << endl;
	}
};


int main()
{
	A solution;
	solution.solve();

	return 0;
}

Measured memory_bytes: 256