akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

typedef unsigned long long int ull;
typedef long double ldb;
typedef long long int ll;

#define for01(k,n)  for (ll i=k; i<n; i++)
#define for02(k,n)  for (ll j=k; j<n; j++)
#define for03(k,n)  for (ll k=k; k<n; k++)
#define for11(k,n)  for (ll i=k; i<=n; i++)
#define for12(k,n)  for (ll j=k; j<=n; j++)
#define for13(k,n)  for (ll k=k; k<=n; k++)

#define pb push_back
#define mp make_pair
#define pf push_front
#define popf pop_front
#define popb pop_back
#define vll vector<ll>
#define f first
#define s second
#define pp pair <ll, ll>
#define lb lower_bound
#define ub upper_bound
#define emp empty()
#define beg begin()
#define en end()
#define si size()
#define bk back()
#define deci(n)  fixed<<setprecision(n)
#define mll map<ll,ll>
#define mint map<int,int>
#define mll_it map<ll,ll>::iterator
#define mint_it map<int,int>::iterator

#define p0(a) cout << a << " "
#define p1(a) cout << a << "\n"

#define mem(a,n) memset(a, n, sizeof(a)); // n = 0 OR -1 only

#define MAX LLONG_MAX
#define MIN LLONG_MIN
#define MOD1 1000000007
#define MOD2 998244353

#define BOOST ios_base::sync_with_stdio(false); cin.tie(NULL)



// CUSTOM HASH FUNCTION - O(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);
    }
};


//gp_hash_table - Open Address Hash Table

//gp_hash_table<int, int> table;

const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash {
    int operator()(int x) const { return x ^ RANDOM; }
};
//gp_hash_table<key, int, chash> table;


// Indexed Set
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indSet;

/* FUNCTIONS:
1. The function "find_by_order" returns an iterator to the element at a given position:
2. The function "order_of_key" returns the position of a given element
	-> If the element does not appear in the set, we get the position that the element
	   would have in the set
	-> O(log n)*/

void swap(multimap<char, int>& mp1, multimap<char, int>&mp2, char c1, char c2)
{
    auto it1 = mp1.find(c1);
    auto it2 = mp2.find(c2);

    //p1(it1->s << " " << it2->s);
    mp1.erase(it1);
    mp2.erase(it2);

    mp1.insert(mp(c2, it2->s));
    mp2.insert(mp(c1, it1->s));
}


int main()
{
  BOOST;
  ll n,m;
  cin >> n >> m;
  
  ll ans = 0;
  
  if(n >= m)
  	ans = m/2;
  else
    ans = max(m/4, (m-2*n)/4 + n);
  
  p1(ans);
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
		string s;
		char ss[3];
		getline(cin,s);
		
		s[0]-=32;
		ss[0]=s[0];
		int z=1;
		for(int i=1;i<29;i++){
			if(s[i]==' '){
				s[i+1]-=32;
				ss[z]=s[i+1];
				z++;
			}
		}
		cout<<ss;
		
		
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 3e5 + 100;

int main() {
	ios::sync_with_stdio(0);
	int a[4];
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	if (a[0] != a[2] && (a[0] == a[1] || a[1] == a[2]))
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int fir(int x){ return x*(x+1)/2;}
int main()
{
	int a,b,i;
	scanf("%i %i",&a,&b);
	int snow;
	for(i=1;i<999;i++)
	{
		if(fir(i)>a && fir(i+1)>b)
		{
			if(fir(i)-a==fir(i+1)-b){ snow=fir(i)-a;break;}
		}
	}
	printf("%i\n",snow);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#define ffor(_a,_f,_t) for(int _a=(_f),__t=(_t);_a<__t;_a++)
#define all(_v) (_v).begin() , (_v).end()
#define sz size()
#define pb push_back
#define SET(__set, val) memset(__set, val, sizeof(__set))
#define FOR(__i, __n) ffor (__i, 0, __n)
typedef long long LL;

using namespace std;

LL A, B;

LL mysqrt(LL x) {
	LL y = sqrt(x);
	if (y * y > x)
		y--;
	if ((y + 1LL) * (y + 1LL) <= x)
		return y + 1;
	return y;
}

int main() {
	int tests;
	cin >> tests;
	FOR (test, tests) {
		cin >> A >> B;
		if (A * B <= 1000) {
			LL ret = 0LL;
			bool usedi[A * B + 1];
			bool usedj[A * B + 1];
			SET(usedi, 0);
			SET(usedj, 0);
			ffor (i, 1, A * B + 1)
				for (int j = A * B; j > 0; j--) {
					if (usedi[i] || usedj[j])
						continue;
					if (i == A || j == B)
						continue;
					if (i * j < A * B) {
						usedi[i] = true;
						usedj[j] = true;
						ret++;
					}
				}
			cout << ret << endl;
			continue;
		}
		LL ret = 0LL;
		LL mm = A * B - 1;
		LL s = mysqrt(mm);
		ret += 2 * s;
		if (s * (s + 1) > mm)
			ret--;
		if (s >= min(A, B))
			ret--;
		cout << ret << endl;
		//cout << "ret = " << ret << "; s = " << s << "; mm  = " << mm << endl;
	}
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.ArrayList;

public class Main {

  public static void main(String[] args) {

    ArrayList<Integer> spade = new ArrayList<Integer>();
    ArrayList<Integer> heart = new ArrayList<Integer>();
    ArrayList<Integer> club = new ArrayList<Integer>();
    ArrayList<Integer> dia = new ArrayList<Integer>();
    for (int i = 1; i <= 13; i++) {
      spade.add(i);
      heart.add(i);
      club.add(i);
      dia.add(i);
    }

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    for (int i = 0; i < n; i++) {
      String sign = scan.next();
      int num = scan.nextInt();

      switch (sign) {
      case "S":
        spade.remove((Object) num);
        break;

      case "H":
        heart.remove((Object) num);
        break;

      case "C":
        club.remove((Object) num);
        break;

      case "D":
        dia.remove((Object) num);
        break;
      }

    }

    int j = 0;
    while (j < spade.size()) {
      System.out.println("S " + spade.get(j));
      j++;
    }
    
    j = 0;
    while (j < heart.size()) {
      System.out.println("H " + heart.get(j));
      j++;
    }
    
    j = 0;
    while (j < club.size()) {
      System.out.println("C " + club.get(j));
      j++;
    }
    
    j = 0;
    while (j < dia.size()) {
      System.out.println("D " + dia.get(j));
      j++;
    }

  }

}



Measured memory_bytes: 26268
#include <bits/stdc++.h>
#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long

using namespace std;

int main() {
  int n;
  scanf("%d", &n);

  vector<int> d(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &d[i]);
  }

  sort(d.begin(), d.end());

  int h = d.size() / 2;
  int l = d[h - 1];
  int u = d[h];

  cout << u - l << endl;
}


Measured memory_bytes: 640
package main

import (
	"fmt"
)

func main() {
	var a, b, c int
	fmt.Scanf("%d %d %d", &a, &b, &c)

	if answer(a, b, c) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func answer(a int, b int, c int) bool {
	if c-a-b<0 {
		return false
	}
	return 4*a*b < (c-a-b)*(c-a-b)
}


Measured memory_bytes: 512
#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

// -----------------------------------------------
// Framework <https://github.com/vain0x/procon>
// -----------------------------------------------

#[cfg(debug_assertions)]
include!{"./procon/debug.rs"}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($($arg:expr),*) => {};
}

#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}

// -----------------------------------------------
// Solution
// -----------------------------------------------

fn main() {
    let S = rl().chars().vec();
    let N = S.len();

    if S[0] == '0' || S[N - 1] == '1' {
        println!("-1");
        return;
    }

    // N=5 -> 0,1,(2,3)
    // N=6 -> 0,1,2 (,2,3,4)
    for i in 0..N / 2 {
        let j = N - 2 - i;
        if S[i] != S[j] {
            println!("-1");
            return;
        }
    }

    let mut u = 1;
    for i in 0..N - 1 {
        let v = i + 2;
        println!("{} {}", u, v);
        if S[i] == '1' {
            u = v;
        }
    }
}


Measured memory_bytes: 5500
import java.io.*;
import java.util.*;

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

	while(!(a == 0 && b == 0)){
	    if (a > b) {
		System.out.println(b + " " + a);
	    }
	    else {
		System.out.println(a + " " + b);
	    }
	    a = sc.nextInt();
	    b = sc.nextInt();
	}
    }
}

Measured memory_bytes: 36140
import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    if(line.equals("Sunny")) {
      System.out.println("Cloudy");
    } else if(line.equals("Cloudy")) {
      System.out.println("Rainy");
    } else if(line.equals("Rainy")) {
      System.out.println("Sunny");
    }
  }
}

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

using ll = long long;

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int h = 0;
    ll sum=0;
    rep(i,n) {
        h = max(h, a[i]);
        sum += h-a[i];
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3972
#include <iostream>

using namespace std;

int main(){

  struct locate{
    int a;
    int b;
    int c;
    int d;
  };

  int N;
  int r[50] = {};
  int t[50] = {};
  int key[50] = {};
  int key2[50] = {};
  int rou[50] = {};
  int rou2[50] = {};
  locate loc[50] = {};
  cin >>  N ;

  for(int i = 0;i < N;i++){

    cin >> r[i] >> t[i];
    if(r[i] % 100 == 0) key2[i] = 1;
    if(200 > r[i] && r[i] >= 100) key[i] = 1;
    else if(300 > r[i] && r[i] >= 200) key[i] = 2;
    else if(400 > r[i] && r[i] >= 300) key[i] = 3;
    else if(500 > r[i] && r[i] >= 400) key[i] = 4;
    else  key[i] = 5;

    if(t[i] % 30 == 0 || t[i] == 0) rou2[i] = 1;
    if(t[i] < 30) rou[i] = 1;
    else if(t[i] < 60) rou[i] = 2;
    else if(t[i] < 90) rou[i] = 3;
    else if(t[i] < 120) rou[i] = 4;
    else if(t[i] < 150) rou[i] = 5;
    else if(t[i] < 180) rou[i] = 6;
    else rou[i] = 7;

    if(key2[i] == 1 && rou2[i] == 1){
      loc[i].a = (rou[i] - 1) * 5 + key[i];
      loc[i].b = 0;
      loc[i].c = 0;
      loc[i].d = 0;
    }     

    else if(key2[i] == 1 && rou2[i] == 0){
      loc[i].a = (rou[i] - 1) * 5 + key[i];
      loc[i].b =  rou[i] * 5 + key[i];
      loc[i].c = 0;
      loc[i].d = 0;
    }

    else if(key2[i] == 0 && rou2[i] == 1){
      loc[i].a = 5 * rou[i] - (5 - key[i]);
      loc[i].b =   5 * rou[i] - (5 - key[i]) + 1;
      loc[i].c = 0;
      loc[i].d = 0;
    }

    else {
      loc[i].a = (rou[i] - 1) * 5 + key[i];
      loc[i].b = (rou[i] - 1) * 5 + key[i] + 1;
      loc[i].c = rou[i] * 5 + key[i];
      loc[i].d = rou[i] * 5 + key[i] + 1;
    }

  }

  for(int i = 0;i < N;i++){
    //cout << "key = " << key[i] << endl;
    //cout << "key2 = " << key2[i] << endl;
    //cout << "rou = " << rou[i] << endl;
    //cout << "rou2 = " << rou2[i] << endl;
    if(loc[i].a != 0) cout << loc[i].a ;
    if(loc[i].b != 0) cout << ' ' <<  loc[i].b ;
    if(loc[i].c != 0) cout << ' ' <<  loc[i].c ;
    if(loc[i].d != 0) cout << ' ' <<  loc[i].d ;
    cout << '\n';
  }
}

Measured memory_bytes: 3056
M = 10**9 + 7
n,a,b = map(int, input().split())

def modinv(n):
    return pow(n, M-2, M)

def comb(n, r):
    num = 1
    for i in range(n,n-r,-1):
        cur = i
        while cur%M == 0:
            cur //= M
        num = (num*cur)%M

    denom = 1
    for i in range(1,r+1):
        cur = i
        while cur%M == 0:
            cur //= M
        denom = (denom*cur)%M

    return num * modinv(denom) % M


print((pow(2, n, M) - comb(n, a) - comb(n, b) - 1) % M)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
int K, X;

int main()
{
    cin >> K >> X;
    if (500 * K >= X)
    {

        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}


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

#define sz(a) ((int)a.size())
#define forn(i,n) for(int i=0;i<(int)n;i++)
#define forse(i,s,e) for(int i=(int)s;i<(int)e;i++)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second

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

dbl PI=3.141592653589793;


void solve(){
	int n,k=0;
	cin >> n;
	vector<int> a(n);
	forn(i,n){
	   	cin >> a[i];
		k^=a[i];
	}
	forn(i,n) a[i]^=k;
	for(auto i:a) cout << i << ' ';
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); 
	int T=1;
//	cin >> T;
	for(int c=1;c<=T;c++){
		solve();
	}
}


Measured memory_bytes: 3956
#include <iostream>
#include <string>


using namespace std;

int main()
{
    string s,t;
    cin >> s >> t;
    t.erase(t.length()-1,1);
    if(s == t)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <assert.h>
#include <numeric>
#include <math.h>
#include <climits>

using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;

template <typename T>
T gcd(T a, T b) {
    if(a < b) gcd(b, a);
    if (b == 1) return 1;
    T r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}


int main() {
    int R, G, B, N;
    cin >> R >> G >> B >> N;
    ll cnt = 0;
    for (int r = 0; r*R <= N; r++) {
        for (int g = 0; r*R + g*G <= N; g++) {
            if ((N - r*R - g*G)%B == 0) {
                cnt++;
            }
        }
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
N,M=map(int,input().split())
ab=[list(map(int,input().split())) for _ in [0]*M]
g=[set() for _ in [0]*N]
[g[b-1].add(a-1) for a,b in ab]
[g[a-1].add(b-1) for a,b in ab]
q=[i for i,gg in enumerate(g) if len(gg)==1]
cnt=0
while(q):
    cnt+=len(q)
    for i in q:
        g[i]=set()
        for j in range(N):
            g[j]=g[j]-{i}
    q=[i for i,gg in enumerate(g) if len(gg)==1]
print(min(cnt,M))

Measured memory_bytes: 3192
s=int(input())
mod=10**9+7

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

ans=0

for i in range(1,667):
    x=s-3*i
    if x<0:
        break
    
    ans+=cmb(i+x-1,x)
    ans%=mod


print(ans)

Measured memory_bytes: 68156
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;


int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(12);

    int r, g, b;
    cin >> r >> g >> b;
    int x = 0;
    for (auto d : {r, g, b}) {
        x = x * 10 + d;
    }

    if (x % 4 == 0) {
        cout << "YES\n";
    } else {
        cout << "NO\n";
    }

    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define PI 3.141592653589793

int main() {
	int x = 0, n = 0;
	cin >> x >> n;
	vector<int> p(n, 0);
	
	vector<int> v(102, 0);
	for (int i = 0; i <= 101; i++) {
		v[i] = i;
	}

	for (int i = 0; i < n; i++) {
		cin >> p[i];
		v[p[i]] = 99999999;
	}
	
	int ite = 0;
	int min = 100000000;
	for (int i = 101; i >= 0; i--) {
		if (min >= abs(x - v[i])) {
			ite = i;
			min = abs(x - v[i]);
		}
	}
	cout << ite;
}

Measured memory_bytes: 3628
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
    let mut iter = $s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
  ($($r:tt)*) => {
    let mut s = {
      use std::io::Read;
      let mut s = String::new();
      std::io::stdin().read_to_string(&mut s).unwrap();
      s
    };
    let mut iter = s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
}

macro_rules! input_inner {
  ($iter:expr) => {};
  ($iter:expr, ) => {};

  ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
    let $var = read_value!($iter, $t);
    input_inner!{$iter $($r)*}
  };
}

macro_rules! read_value {
  ($iter:expr, ( $($t:tt),* )) => {
    ( $(read_value!($iter, $t)),* )
  };

  ($iter:expr, [ $t:tt ; $len:expr ]) => {
    (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  };

  ($iter:expr, chars) => {
    read_value!($iter, String).chars().collect::<Vec<char>>()
  };

  ($iter:expr, usize1) => {
    read_value!($iter, usize) - 1
  };

  ($iter:expr, $t:ty) => {
    $iter.next().unwrap().parse::<$t>().expect("Parse error")
  };
}

fn main() {
  input! {
    s: String, t: String,
    a: i8, b: i8,
    u: String,
  }
  
  println!("{} {}",
    if s == u { a - 1 } else { a },
    if t == u { b - 1 } else { b }
  );
}

Measured memory_bytes: 4352
import fractions
a,b,c,d=map(int,input().split())
CD=fractions.gcd(c,d)
cd=(c*d)//CD
width=b-a
cnt=0
if width%c==0:
  if a%c==0:
    cnt+=(width//c)+1
  else:
    cnt+=(width//c)
else:
  if c-(a%c)+b%c>=c:
    if a%c==0 or b%c==0:
      cnt+=(width//c)+1
    else:
      cnt+=(width//c)
  else:
    cnt+=(width//c)+1

if width%d==0:
  if a%d==0:
    cnt+=(width//d)+1
  else:
    cnt+=(width//d)
else:
  if d-(a%d)+b%d>=d:
    if a%d==0 or b%d==0:
      cnt+=(width//d)+1
    else:
      cnt+=(width//d)
  else:
    cnt+=(width//d)+1

if width%cd==0:
  if a%cd==0:
    cnt-=(width//cd)+1
  else:
    cnt-=(width//cd)
else:
  if cd-(a%cd)+b%cd>=cd:
    if a%cd==0 or b%cd==0:
      cnt-=(width//cd)+1
    else:
      cnt-=(width//cd)
  else:
    cnt-=(width//cd)+1

print(b-a+1-cnt)


Measured memory_bytes: 5304
#include <bits/stdc++.h>
using namespace std;
const int N=2e5+10;
int q[N];
int main()
{
	cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);
	int ans=0,n;
	double d,s;
	cin>>n>>d;
	long long  x,y;
	for(int i=0;i<n;i++)
	{
		cin>>x>>y;
		s=sqrt(x*x+y*y);
		if(s<=d)ans++;
	}
	cout<<ans;
	return 0;



}


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


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

int main() {
  long long n, a, b;
  cin >> n >> a >> b;
  long long ans = n/(a+b)*a;
  ans += ( n%(a+b) > a ) ? a : n%(a+b);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3608
h,w=map(int,input().split())
arr=[]
for i in range(h):
	s=str(input())
	arr.append(s)
if(h==1 and w==1):
	if(arr[0][0]=='.'):
		print("Yes")
	else:
		print("No")
elif(h==1 and w>1):
	if(arr[0][0]=='#'):
		print("No")
	elif(arr[0][w-1]=='#'):
		print("No")
	else:
		for j in range(1,w-1):
			if(arr[0][j]=='#'):
				if(arr[0][j-1]!='#' and arr[0][j+1]!='#'):
					print("No")
					flag=1
					break
		if(flag==0):
			print("Yes")

elif(h>1 and w==1):
	if(arr[0][0]=='#'):
		print("No")
	elif(arr[h-1][0]=='#'):
		print("No")
	else:
		flag=0
		for j in range(1,h-1):
			if(arr[j][0]=='#'):
				if(arr[j-1][0]!='#' and arr[j+1][0]!='#'):
					print("No")
					flag=1
					break
		if(flag==0):
			print("Yes")
else:
	flag=0
	for j in range(1,w-1):
			if(arr[0][j]=='#'):
				if(arr[0][j-1]!='#' and arr[0][j+1]!='#' and arr[1][j]!='#'):
					print("No")
					flag=1
					break
	if(flag==0):
		for j in range(1,w-1):
			if(arr[h-1][j]=='#'):
				if(arr[h-1][j-1]!='#' and arr[h-1][j+1]!='#' and arr[h-2][j]!='#'):
					print("No")
					flag=1
					break
	if(flag==0):
		for j in range(1,h-1):
			if(arr[j][0]=='#'):
				if(arr[j-1][0]!='#' and arr[j+1][0]!='#' and arr[j][1]!='#'):
					print("No")
					flag=1
					break
	if(flag==0):
		for j in range(1,h-1):
			if(arr[j][w-1]=='#'):
				if(arr[j-1][w-1]!='#' and arr[j+1][w-1]!='#' and arr[j][w-2]!='#'):
					print("No")
					flag=1
					break
	if(flag==0):				
		for j in range(1,h-1):
			for k in range(1,w-1):
				if(arr[j][k]=='#'):
					if(arr[j-1][k]!='#' and arr[j+1][k]!='#' and arr[j][k-1]!='#' and arr[j][k+1]!='#'):
						print("No")
						flag=1
						break
			if(flag==1):
				break
	if(flag==0):
		print("Yes")



Measured memory_bytes: 3316
S = input()
n = len(S)
maze = [1] * n
# 前から見る
for i in range(0,n-1):
    if S[i] == S[i+1] == 'R':
        #print('before',maze)
        maze[i+2] += maze[i]
        maze[i] = 0
        #print('after',maze)
# 後ろから見る
for i in range(n-1,0,-1):
    if S[i] == S[i-1] == 'L':
        maze[i-2] += maze[i]
        maze[i] = 0
# 答え
print(*maze)


Measured memory_bytes: 6400
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair<int, int>
#define vi vector<int>
#define pb emplace_back
#define sz(x) (int)x.size()
#define all(v) v.begin(), v.end()
#define x first
#define y second
#define rep(i, j, k) for(i=j; i<k; i++)
#define sep(i, j, k) for(i=j; i>k; i--)
const int N = 2e5+5, inf = 1e9+7;
int n, k, i, j;
int A[N][3];
int dp[N][3];

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int i, j, a, b, ans = 0;
    cin>>n;
    rep(i, 1, n+1) for(int j: {0, 1, 2}) cin>>A[i][j];
    rep(i, 1, n+2) 
    for(int j:{0, 1, 2}) for(int k:{0, 1, 2})
        if(j!=k) dp[i][k] = max(dp[i][k], dp[i-1][j]+A[i][k]);
    cout<<max(dp[n+1][0], dp[n+1][1]);
}

Measured memory_bytes: 8448
#include <stdio.h>
int main(){
    int a,b;
    scanf("%d %d",&a,&b);
    if(a < b){
    printf("a < b\n");
}
    else if(a > b){
    printf("a > b\n");
}
    else if(a == b){
    printf("a == b\n");
}
    return 0;
}


Measured memory_bytes: 1952
import java.util.*;

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

        if (13 <= A) {
            System.out.println(B);
        } else if (6 <= A) {
            System.out.println(B/2);
        } else {
            System.out.println(0);
        }
    }
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size(); i++) {
    ans += s[i] == '1';
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define si(n) scanf("%d",&n);
#define PI acos(-1.0)
#define sl(n) scanf("%lld",&n);
#define sf(n) scanf("%lf",&n);
#define ss(n) scanf("%s",n);
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define forc(i,j,n) for(ll i=j;i<n;i++)
#define pb push_back
#define sor(n) sort(n.begin(),n.end())
#define sorcmp(n) sort(n.begin(),n.end(),cmp)
#define rev(n) reverse(n.begin(),n.end())
#define pi(x)  prllf("%d",x);
#define pl(x)  prllf("%lld",x);
#define pf(x)  prllf("%.10lf",x);
#define ps(x)  prllf("%s",x);
#define en() prllf("\n");
#define random_shuffle(r...)random_shuffle(r,[](int _){return rand()%_;})
#define SQR(a) (a)*(a)
#define sp(x) fixed<<setprecision(x)
#define mod 100000007
#define endl '\n'
#define pii pair<int,int>
#define pll pair<ll,ll>
#define bug cout<<"Here"<<endl
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);}
template <typename T> T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}
ll powmod(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%mod;a = a*a%mod;b >>= 1;}return ans;}



int main()
{
    int  n,m;
    cin>>n>>m;
    vector<int>g[n+2];
    int cost[n];
    map<int,int>mp;
    for(int i=0;i<n;i++)
    {
        cin>>cost[i];
        mp[i+1]=cost[i];
    }

    for(int i=0;i<m;i++)
    {
        int x,y;
        cin>>x>>y;
        g[x].pb(y);
        g[y].pb(x);
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
    {
        int p=cost[i-1];
        bool flag=true;
        for(int j=0;j<g[i].size();j++)
        {
            int v=g[i][j];
            int c=cost[v-1];
            if(p<=c) {flag=false; break;}

        }

        if(flag) cnt++;
    }

    cout<<cnt<<endl;

}



















Measured memory_bytes: 13808
#include <bits/stdc++.h>
    using namespace std;
     
    #define fill(a,val) memset(a, (val), sizeof a)
    #define pb push_back
    #define lli long long int
    #define scantype int
    #define endl "\n"
    #define unique(x) x.erase(unique(x.begin(),x.end()), x.end())
    #define debug(x) cerr << #x " = " << (x) << '\n'
    #define what_is(x) cerr << #x << " is " << x << endl;
     
    lli MOD  = 1000000007;
    lli inf = 1e15;
     
    void scan(scantype &x);

    lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
    lli string_to_number(string s){lli x=0; stringstream convert(s); convert>>x; return x;}
    lli add(lli a,lli b){lli x = (a+b)%MOD; return x; }
    lli mul(lli a,lli b){lli x = (a*b)%MOD; return x; }
    lli sub(lli a,lli b){lli x = (a-b+MOD)%MOD; return x; }
    lli div(lli a,lli b){lli x = a;lli y = powermod(b,MOD-2,MOD);lli res = (x*y)%MOD;return res;}

    bool isprime(long long int n)
    {
        if(n ==1 )
            return false;
        if(n == 2)
            return true;
        for(long long int i =2;i<=n/i;i++)
        {
            if(n%i == 0)
                return false;
        }
        return true;
    }
    lli h[100003];
    lli n;

    lli a,b;
    bool chk(lli t)
    {
        lli te[n];
        for (lli i = 0;i<n;i++)
            te[i] = h[i]-t*b;
        lli temp = 0;
        for( lli i = 0;i<n;i++){
            lli c = ceil(te[i]/float(a-b));
            if(c>0)
                temp += c;
        }
       // debug(temp);
        if(temp >t)
            return false;
        return true;
    }


    int main(void)
    {
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);   
        lli t;
        t = 1;
        while(t--)
        {
            cin>>n>>a>>b;
            for(lli i = 0;i<n;i++)
                cin>>h[i];
            lli s= 1;
            lli ed = 1000000000;
            lli ans =0;
            while(s<ed)
            {
                lli t = (s+ed)>>1;
                if(chk(t))
                {
                    ans = t;
                    ed = t;
                }
                else
                    s = t+1;
            }
            cout<<ans;



        }    


        
        return 0;    
    }
     


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

using namespace std;

struct Pond
{
  int up,down,left,right;
  vector<int> canal;
  vector<int> moat;
  int min,max;
  void make(int up,int down,int left,int right,vector<int> canal,vector<int>moat)
  {
    this->up=up; this->down=down; this->left=left; this->right=right;
    this->canal=canal; this->moat=moat;
  }
  void setVals(){
    max= *max_element(canal.begin(),canal.end());
    min= *min_element(moat.begin(),moat.end());
  }
  bool isMake()
  {
    return (max<min);
  }
};

int calc(Pond pond)
{
  int sum=0;
  for(int i=0;i<pond.canal.size();i++){
    sum+=pond.min-pond.canal[i];
  }
  return sum;
}
void print(vector<int> list){
  for(int x:list) cout<<x<<" ";
  cout<<endl;
}
int main()
{
  while(1){
    int depth,width;
    vector<int> canal(0),moat(0);
    cin>>depth>>width;
    int stage[depth][width];
    if((depth==0)and(width==0)) return 0;
  
    for(int i=0;i<depth;i++){
      for(int j=0;j<width;j++){
	cin>>stage[i][j];
      }
    }
    int mx=0;
    for(int up=0;up<depth-1;up++){
      for(int left=0;left<width-1;left++){
	for(int down=up+2;down<depth;down++){
	  for(int right=left+2;right<width;right++){
	    //cout<<"up="<<up<<" down="<<down<<endl;
	    //cout<<"left="<<left<<" right="<<right<<endl;
	    canal.resize(0);
	    moat.resize(0);
	    for(int s=up;s<=down;s++){
	      for(int t=left;t<=right;t++){
		//cout<<"s="<<s<<" t="<<t<<endl;
		if((s!=up and s!=down)and(t!=left and t!=right)){
		  //cout<<"canal.push("<<stage[s][t]<<")"<<endl;
		  canal.push_back(stage[s][t]);
		}else{
		  //cout<<"moat.push("<<stage[s][t]<<")"<<endl;
		  moat.push_back(stage[s][t]);
		}
	      }
	    }
	    //print(canal);
	    //print(moat);
	    Pond pond;
	    pond.make(up,down,left,right,canal,moat);
	    pond.setVals();
	    //cout<<"make pond:"<<endl;
	    if(pond.isMake()){
	      //cout<<"judge=YES"<<endl;
	      mx=max(mx,calc(pond));
	    }else{
	      //cout<<"judge=NO"<<endl;
	    }
	  }
	}
      }
    }
    //cout<<"count="<<count<<endl;
    cout<<mx<<endl;
  }
  return 0;
}



Measured memory_bytes: 3140
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long n,k,ans=0;
  cin >> n >> k;
  vector<long> a(n),cum(n+1);
  multiset<long> ms,ms2;
  for(long i=0;i<n;i++) cin >> a[i];
  
  for(long i=0;i<n;i++) cum[i+1]=cum[i]+a[i];
  for(long i=0;i<n;i++) {
    for(long j=i+1;j<=n;j++) {
      ms.insert(cum[j]-cum[i]);
    }
  }
  for(long x=(1L<<40);x>=1;x/=2) {
    ms2=ms;
    long aaa=0;
    for(auto itr=ms2.begin();itr!=ms2.end();) {
      if((*itr)&x) {
        itr++;
      } else {
        ms2.erase(itr);
        aaa++;
        itr++;
      }
    }
    if(ms2.size()>=k) {
      ans+=x;
      ms=ms2;
    }
  }
  cout << ans << endl;
}

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

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)

int main()
{
  string s, t;
  bool ok = false;
  cin >> s >> t;
  forll(i, 0, s.size()){
	forll(j, 0, s.size()){
	  if (t[j] != s[(i + j) % s.size()])
		break;
	  if (j == s.size() - 1)
		ok = true;
	}
  }
  if (ok == true)
	cout << "Yes";
  else
	cout << "No";
}

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

using namespace std;

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	string s;
	cin >> s;
	sort(s.begin(), s.end());
	if (s.front() < s.back()) cout << "Yes\n";
	else cout << "No\n";
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

typedef long long ll;

int cnv(int n){
	if(n<=3)
		return n;
	else{
		if(n==4)
			return 5;
		else
			return n+2;
	}
}

void dfs(int num){
	if(num==0)
		return;
	dfs(num/8);
	cout<<cnv(num%8);
}

int main(){

	int n;
	while(cin>>n&&n!=0){
		dfs(n);
		cout<<endl;
	}


	return 0;
}


//int fourOrSixPlace(ll num){
//	int idx=-1;
//	int cnt=0;
//	while(num>0){
//		if(num%10==6||num%10==4){
//			idx=cnt;
//		}
//		num/=10;
//		cnt++;
//	}
//	return idx;
//}
//
//int main(){
//
//	//int cc=0;
//	//for(ll i = 1; i <= 100000; i++){
//	//	int ret=fourOrSixPlace(i);
//	//	if(ret!=-1)
//	//		cc++;
//	//}
//	//cout<<cc<<endl;
//	ll n;
//	while(cin>>n&&n!=0){
//		ll cnum=0;
//		ll cnt=0;
//		while(1){
//
//			cnum+=100000;
//			if(cnum>n)
//				break;
//			int ret=fourOrSixPlace(cnum);
//			if(ret==-1){
//				n+=67232;
//			}
//			else{
//				n+=67232;
//				cnum+=(ll)pow(10.0,ret);
//				n+=(ll)pow(10.0,ret);
//			}
//		}
//
//		if(true){
//			cnum-=100000;
//			cnum++;
//
//			for(ll i = cnum; i <= n; i++){
//				int ret=fourOrSixPlace(i);
//				if(ret!=-1){
//					if(ret==0){
//						n++;
//					}
//					else{
//						n+=(ll)pow(10.0,ret);
//						i+=(ll)pow(10.0,ret);
//					}
//				}
//			}
//		}
//		cout<<n<<endl;
//	}
//
//
//	return 0;
//}

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

typedef long long ll;

const int MAXN = 3002;

ll dp[MAXN][MAXN];
bool vis[MAXN][MAXN];
int A[MAXN],N;

ll solve(int i,int j){

	if(vis[i][j]) return dp[i][j];

	vis[i][j] = 1;

	if(i == j) return dp[i][j] = A[i];

	return dp[i][j] = max(A[i] - solve(i+1,j), A[j] - solve(i,j-1));

}

int main(){

	cin >> N;
	for(int i = 1;i<=N;i++){
		cin >> A[i];
	} 

	cout << solve(1,N) << endl;

	return 0;

}


Measured memory_bytes: 78464
n, x = map(int,input().split())
a = list(map(int,input().split()))
a.sort()

cnt = 0
for i in a:
    if x >= i:
        x = x - i
        cnt = cnt + 1
    else:
        x = x - i
        break

if x > 0:
    cnt = cnt - 1
print (cnt)


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

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) (a).begin(),(a).end()

template<typename T1, typename T2> inline void chkmin(T1 & x, const T2 & y) {if (y < x) x = y;}
template<typename T1, typename T2> inline void chkmax(T1 & x, const T2 & y) {if (x < y) x = y;}

void read() {
	int a;
	cin >> a;
	int ans;
	if (a <= 599) {
		ans = 8;
	} else if (a <= 799) {
		ans = 7;
	} else if (a <= 999) {
		ans = 6;
	} else if (a <= 1199) {
		ans = 5;
	} else if (a <= 1399) {
		ans = 4;
	} else if (a <= 1599) {
		ans = 3;
	} else if (a <= 1799) {
		ans = 2;
	} else {
		ans = 1;
	}
	cout << ans << endl;
}

void run() {

}

void write() {

}

signed main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout.precision(20), cout.setf(ios::fixed);
	read();
	run();
	write();
	return 0;
}

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

ll grundy(ll h){
	h++;
	return h&-h;
}

struct node{
	node*nx[2];
}pool[200000];
node*root[2];
int pointer=0;

void add(string&s){
	if(root[s[0]-'0']==NULL){
		root[s[0]-'0']=&pool[pointer++];
	}
	node*t=root[s[0]-'0'];
	for(int i=1;i<s.size();i++){
		if(t->nx[s[i]-'0']==NULL){
			t->nx[s[i]-'0']=&pool[pointer++];
		}
		t=t->nx[s[i]-'0'];
	}
}
ll L;
ll x=0;
void dfs(node*t,ll h){
	if(t==NULL){
		x^=grundy(h);
		return;
	}
	if(t->nx[0]==NULL&&t->nx[1]==NULL)return;
	dfs(t->nx[0],h-1);
	dfs(t->nx[1],h-1);
}

char S[200000];
int main(){
	int n;scanf("%d%lld",&n,&L);L--;
	rep(i,n){
		scanf("%s",S);
		string s=S;
		add(s);
	}
	rep(i,2){
		dfs(root[i],L);
	}
	puts(x?"Alice":"Bob");
}

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

string str;
int main () {
	cin >> str;
	int cnt = 0,ans = 0;
	for (auto c : str) {
		if (c == 'A' || c == 'G' || c == 'C' || c == 'T') {
			cnt++;
		} else {
			ans = max(ans,cnt);
			cnt = 0;
		}
	}
	
	cout << max(ans,cnt) << endl;
}

Measured memory_bytes: 256
'use strict'
const main = (input: string) => {
    const std: string[] = input.split('\n')
    const n: number = ~~std[0]
    const s: string = std[1]
    const alphabet: string[] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')
    const r = s.split('').map(v => {
        const index = alphabet.indexOf(v)
        return alphabet[index+n]
    })
    console.log(r.join(''))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim())

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

typedef struct {
    int num[6], temp;
}dice_struct;
dice_struct dice1, dice2;

void setting1(int d[]) {
    for (int i = 0; i < 6; i++) {
        dice1.num[i] = d[i];
    }
}

void setting2(int d[]) {
    for (int i = 0; i < 6; i++) {
        dice2.num[i] = d[i];
    }
}


void throw_dice(char order) {
    switch (order) {
        case 'R':
            dice1.temp = dice1.num[1];
            dice1.num[1] = dice1.num[3];
            dice1.num[3] = dice1.num[4];
            dice1.num[4] = dice1.num[2];
            dice1.num[2] = dice1.temp;
            break;
        case 'E':
            dice1.temp = dice1.num[0];
            dice1.num[0] = dice1.num[3];
            dice1.num[3] = dice1.num[5];
            dice1.num[5] = dice1.num[2];
            dice1.num[2] = dice1.temp;
            break;
        case 'S':
            dice1.temp = dice1.num[0];
            dice1.num[0] = dice1.num[4];
            dice1.num[4] = dice1.num[5];
            dice1.num[5] = dice1.num[1];
            dice1.num[1] = dice1.temp;
            break;
        case 'W':
            dice1.temp = dice1.num[0];
            dice1.num[0] = dice1.num[2];
            dice1.num[2] = dice1.num[5];
            dice1.num[5] = dice1.num[3];
            dice1.num[3] = dice1.temp;
            break;
        case 'N':
            dice1.temp = dice1.num[0];
            dice1.num[0] = dice1.num[1];
            dice1.num[1] = dice1.num[5];
            dice1.num[5] = dice1.num[4];
            dice1.num[4] = dice1.temp;
            break;            
    }
        
}

int isSame() {
    for (int i = 0; i < 6; i++) {
        if (dice1.num[i] != dice2.num[i]) {
            return 0;
        }
    }
    return 1;
}


int main(int argc, char const *argv[]) {

    int n1[6], n2[6];
    for (int i = 0; i < 6; i++) {
        cin >> n1[i];
    }
    setting1(n1);

    for (int i = 0; i < 6; i++) {
        cin >> n2[i];
    }
    setting2(n2);

    int judge = -1;
    for (int i = 0; i < 4; i++) {
        throw_dice('E');
        for (int j = 0; j < 4; j++) {
            throw_dice('S');
            for (int k = 0; k < 4; k++) {
                throw_dice('W');
                for (int l = 0; l < 4; l++) {
                    throw_dice('N');
                    for (int m = 0; m < 4; m++) {
                        throw_dice('E');
                        for (int n = 0; n < 4; n++) {
                            if (judge != 1)  {
                                judge = isSame();
                                if (judge) {
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    if (judge) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}



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

using namespace std;

int main(){
    int A, B;
    scanf("%d %d", &A, &B);
    if((A + B) % 2){
        puts("IMPOSSIBLE");
    }
    else{
        printf("%d\n", (A + B) / 2);
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <cmath>
typedef long long ll;
using namespace std;
#define bhasad ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);;
#define mod 1000000007
#define pi 3.14159265358979323846
int power(int x, int y) 
{ 
    int res = 1;      // Initialize result 
  
    x = x % mod;  // Update x if it is more than or 
                // equal to p 
  
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % mod; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % mod; 
    } 
    return res; 
} 
  
// Returns n^(-1) mod p 
int modInverse(int n) 
{ 
    return power(n, 1e9-2); 
} 
  
// Returns nCr % p using Fermat's little 
// theorem. 
int nCrModPFermat(int n, int r) 
{ 
   // Base case 
   if (r==0) 
      return 1; 
  
    // Fill factorial array so that we 
    // can find all factorial of r, n 
    // and n-r 
    int fac[n+1]; 
    fac[0] = 1; 
    for (int i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%mod; 
  
    return (fac[n]* modInverse(fac[r]) % mod * 
            modInverse(fac[n-r]) % mod) % mod; 
} 
int main()
{
	bhasad
	int t=1;
	//cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		string s;
		cin>>s;
		if(s.length()>n)
		{
			cout<<s.substr(0,n)+"..."<<endl;
		}
		else
		{
			cout<<s<<endl;
		}
	}
}

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

constexpr int N = 100009;
int n, M, p[N], f[N], ans[N];
vector<vector<int>> g(N), fw(N), bw(N), answ(N);

void dfs(int u, int par) {
    p[u] = par;
    f[u] = 1;
    for(int v : g[u]) {
        if(v != p[u]) {
            dfs(v, u);
            f[u] = 1ll * (f[v] + 1) * f[u] % M;
        }
    }
}

void dfs(int u) {
    if(p[u] != -1) {
        int v = p[u];
        int j = lower_bound(g[v].begin(), g[v].end(), u) - g[v].begin();
        ans[u] = (f[u] + 1ll * f[u] * answ[v][j] % M) % M;
        for(int i = 0; i < g[u].size(); ++i) {
            int k = i - 1;
            int l = i + 1;
            int val = 1;
            if(k >= 0) val = 1ll * val * fw[u][k] % M;
            if(l < g[u].size()) val = 1ll * val * bw[u][l] % M;
            answ[u][i] = (val + 1ll * val * answ[v][j] % M) % M;
        }
    } else {
        ans[u] = f[u];
        for(int i = 0; i < g[u].size(); ++i) {
            int k = i - 1;
            int l = i + 1;
            int val = 1;
            if(k >= 0) val = 1ll * val * fw[u][k] % M;
            if(l < g[u].size()) val = 1ll * val * bw[u][l] % M;
            answ[u][i] = val;
        }
    }
    for(int v : g[u]) {
        dfs(v);
    }
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    cin >> n >> M;
    for(int i = 0; i < n - 1; ++i) {
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    dfs(1, -1);
    for(int i = 0; i < N; ++i) {
        if(g[i].empty()) continue;
        sort(g[i].begin(), g[i].end());
        g[i].erase(remove(g[i].begin(), g[i].end(), p[i]), g[i].end());
        answ[i].resize(g[i].size());
        int val = 1;
        int q = g[i].size();
        for(int j = 0; j < q; ++j) {
            val = 1ll * (f[g[i][j]] + 1) * val % M;
            fw[i].push_back(val);
        }
        val = 1;
        for(int j = q - 1; j >= 0; --j) {
            val = 1ll * (f[g[i][j]] + 1) * val % M;
            bw[i].push_back(val);
        }
        reverse(bw[i].begin(), bw[i].end());
    }
    dfs(1);
    for(int i = 1; i <= n; ++i) {
        cout << ans[i] << '\n';
    }
}


Measured memory_bytes: 26880
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_s(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;

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

  unordered_map<int, bool> a_count;

  rep(i, n) {
    int a;
    cin >> a;
    if (a_count[a]) {
      cout << "NO" << endl;
      return 0;
    }
    a_count[a] = true;
  }

  cout << "YES" << endl;

}


Measured memory_bytes: 8520
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n,a,q,b,c,i,ans = 0;scanf("%lld",&n);
  map<ll,ll> m;
  for(i=0;i<n;i++){
    scanf("%lld",&a);ans += a;
    if(m.find(a) == m.end()) m[a] = 1;
    else m[a]++;
  }
  scanf("%lld",&q);
  for(i=0;i<q;i++){
    scanf("%lld%lld",&b,&c);
    if(m.find(b) != m.end()){
      ans += m[b]*(c-b);
      if(m.find(c) == m.end()) m[c] = m[b];
      else m[c] += m[b];
      m.erase(b);
    }
    printf("%lld\n",ans);
  }
}

Measured memory_bytes: 7740
N=int(input())
B=list(map(int,input().split()))
if N==2:
    A=[B[0],B[0]]

else:
    
    A=[B[0]]
        
    for i in range(N-2):
        A.append(min(B[i],B[i+1]))

    A.append(max(A[N-2],B[N-2]))
print(sum(A))

Measured memory_bytes: 3064
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<i64>();
    let (n, k) = (v[0], v[1]);

    if k > (n - 1) * (n - 2) / 2 {
        println!("-1");
        return;
    }
    let mut edges = vec![];
    for i in 1..n {
        edges.push((0, i));
    }
    let mut current_edges = (n - 1) * (n - 2) / 2;
    'outer: for i in 1..n {
        for j in i + 1..n {
            if current_edges == k {
                break 'outer;
            }
            edges.push((i, j));
            current_edges -= 1;
        }
    }
    println!("{}", edges.len());
    for (a, b) in edges {
        println!("{} {}", a + 1, b + 1);
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
//P,Q大きさNの順列で、Pの辞書順aとQの辞書順bの差を求める


int main(){
  int K,X;
  cin >> K >> X;
  if(500*K >= X) cout << "Yes" <<endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
#include <functional>
#include <map>
#include <queue>
#include <set>
#include <stack>
using namespace std;
#define rep(i, m, n) for (int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for (int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
using Edge = pair<int, long long>;
using Graph = vector<vector<Edge>>;
typedef vector<ll> vec;
typedef vector<vector<ll>> mat;
typedef vector<vector<vector<ll>>> mat3;
typedef vector<string> svec;
typedef vector<vector<string>> smat;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9 + 7;
// constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
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;
}
// ~~~~~~~~~~~~~~memo~~~~~~~~~~~~~~
// for (int i = 0; i < n; ++i)
// vector<long long> v(n), c(n);
// cout << res << endl;
// cout << res << '\n';
// int型の2次元配列(h×w要素の)の宣言
// vector<vector<int>> data(h, vector<int>(w));
// rotate(s.begin(), s.begin() + 1, s.end());
// sort(all(a),greater<int>());
// s.substr(0,2) 先頭から2文字切り出す
// for (auto it = mp.rbegin();it != mp.rend(); ++it)
int gcd(int a, int b) {
    while (a != b) {
        if (a > b) {
            if (a % b == 0)
                return b;
            else
                a = a % b;
        }
        if (a < b) {
            if (b % a == 0)
                return a;
            else
                b = b % a;
        }
    }
    return a;
}

int main() {
    ll a;
    string b;
    cin >> a >> b;
    ll b100 = (b[0]-'0')*100+(b[2]-'0')*10+(b[3]-'0');
    cout << a*b100/100 << '\n';

    return 0;
}


Measured memory_bytes: 3632