akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
int main()
{
    char s1[4],s2[4];
    gets(s1);
    gets(s2);
    int c=0;
    for(int y=0;y<3;y++){
        if(s1[y]==s2[y]){
            c++;
        }
    }
    printf("%d\n",c);
    return 0;
}


Measured memory_bytes: 128
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>

using namespace std;

int main() {

	int a, b, c;
	cin >> a >> b >> c;

	if ((a + b)  == c || (a + c) == b || (b + c) == a || (a + b + c) == 0) 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<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)

#define INF 2e9
#define ll long long

int main(){
    int h, w;
    cin>>h>>w;
    char a[h][w];
    REP(i, h){
        REP(j, w){
            cin>>a[i][j];
        }
    }
    REP(i, w+2){
        cout<<"#";
    }
    cout<<endl;
    REP(i, h){
        cout<<"#";
        REP(j, w){
            cout<<a[i][j];
        }
        cout<<"#"<<endl;
    }
    REP(i, w+2){
        cout<<"#";
    }
    cout<<endl;
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;

const int INF = (int) 1e9 + 123;
const ll LINF = (ll) 1e18 + 123;
const ld EPS = (ld) 1e-12;
const ll MOD = (ll) 1e9 + 7;

#define sz(x) (int) (x).size()
#define mp(x, y) make_pair(x, y)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lb(s, t, x) (int) (lower_bound(s, t, x) - s)
#define ub(s, t, x) (int) (upper_bound(s, t, x) - s)
#define rep(i, f, t) for (auto i = f; i < t; i++)
#define per(i, f, t) for (auto i = f; i >= t; i--)

ll power(ll x, ll y, ll mod = MOD) {
    if (y == 0) {
        return 1;
    }
    if (y & 1) {
        return power(x, y - 1, mod) * x % mod;
    } else {
        ll tmp = power(x, y / 2, mod);
        return tmp * tmp % mod;
    }
}

void add(ll &x, ll y, ll mod = MOD) {
    x += y;
    if (x >= mod) x -= mod;
    if (x < 0) x += mod;
}

ll sum(ll x, ll y, ll mod = MOD) {
    add(x, y, mod);
    return x;
}

ll mult(ll x, ll y, ll mod = MOD) {
    return (x * y) % mod;
}

ll div(ll x, ll y, ll mod) {
    return x * power(y, mod - 2, mod);
}

template<typename A, typename B> bool mini(A &x, const B &y) {
    if (y < x) {
        x = y;
        return true;
    }
    return false;
}

template<typename A, typename B> bool maxi(A &x, const B &y) {
    if (y > x) {
        x = y;
        return true;
    }
    return false;
}

template<typename T> void read(T first, T last) {
    while (first != last) {
        cin >> *(first++);
    }
}

template<typename T> void print(T first, T last) {
    while (first != last) {
        cout << *(first++) << " ";
    }
    cout << "\n";
}

void run();

#define TASK ""

int main() {
#ifdef LOCAL
    if (strlen(TASK) > 0) {
        cerr << "Reminder: you are using file i/o, filename: " TASK "!" << endl << endl;
    }
#endif
#ifndef LOCAL
    if (strlen(TASK)) {
        freopen(TASK ".in", "r", stdin);
        freopen(TASK ".out", "w", stdout);
    }
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
#endif
    cout << fixed << setprecision(12);
    run();
    return 0;
}

// == SOLUTION == //

const int N = (int) 1e5 + 123;

int n, m;
int cnt[N];

void run() {
    cin >> n >> m;
    rep(i, 0, m) {
        int u, v;
        cin >> u >> v;
        cnt[u]++;
        cnt[v]++;
    }
    rep(i, 1, n + 1) {
        if (cnt[i] % 2) {
            cout << "NO\n";
            return;
        }
    }
    cout << "YES\n";
}


Measured memory_bytes: 640
#include<cstdio>
 
#define rep(i,n) for(int i=0;i<(n);i++)
 
using namespace std;
 
int main(){
    int n,T,H,L; scanf("%d%d%d%d",&n,&T,&H,&L);
    int t[100],h[100];
    rep(i,n) scanf("%d%d",t+i,h+i);
 
    int yen=0;
    while(1){
        rep(i,n){
            if(t[i]>0){
                t[i]--;
                T++;
                yen+=10;
                if(T>L){ printf("%d\n",i+1); return 0; }
            if(yen==90){
                int back=yen-90;
                if(T<back/10){ printf("%d\n",i+1); return 0; }
                T-=back/10;
                //t[i]+=back/10;
                yen=0;
            }
            }
            else if(h[i]>0){
                h[i]--;
                H++;
                yen+=100;
            //if(yen>=90){
                int back=yen-90;
                if(T<back/10){ printf("%d\n",i+1); return 0; }
                T-=back/10;
                t[i]=back/10;
                yen=0;
            //}
            }
            else{
                printf("%d\n",i+1);
                return 0;
            }
        }
    }
}

Measured memory_bytes: 1032
from heapq import *
n,m=map(int,input().split())
a=list(map(int,input().split()))
q=[]
for i in a:
    heappush(q,-i)
for i in range(m):
    s=heappop(q)
    heappush(q,-(-s//2))
print(sum(int(-q[i])for i in range(n)))

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

int main(){
  int n;
  cin >> n;
  string name;
  map<char, long long> mp;
  for(int i = 0; i < n; i++){
    cin >> name;
    if(name[0] == 'M' || name[0] == 'A' || name[0] == 'R' || name[0] == 'C' || name[0] == 'H'){
      mp[name[0]]++;
    }
  }
  long long march[] = {mp['M'], mp['A'], mp['R'], mp['C'], mp['H']};
  long long res = 0;
  for(int i = 0; i < 5; i++){
    for(int j = i + 1; j < 5; j++){
      for(int k = j + 1; k < 5; k++){
        res += march[i] * march[j] * march[k];
      }
    }
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 764
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <math.h>
using namespace std;

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

    for (int i = 0; i < 10000; i++) {
        if (a % 2 || b % 2 || c % 2) {
            cout << i << endl;
            quick_exit(0);
        }
        int a1 = (b + c) / 2;
        int b1 = (c + a) / 2;
        int c1 = (a + b) / 2;
        a = a1;
        b = b1;
        c = c1;
    }

    cout << -1 << endl;

    return 0;
}

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

int main() {
	int n, a, temp[10] = {}, ans = 0, ma = 0, temp2 = 0, count1, count2;

	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> a;
		temp[a % 3]++;
	}

	if (temp[1] == 0 && temp[2] == 0) {
		ans = 1;
	}
	else {
		ans += temp[0];
		if (temp[1] == temp[2]) {
			ans += temp[1] + temp[2];
		}
		else if (temp[1] > temp[2]) {
			if (temp[1] - temp[2] <= 3) {
				ans += temp[2] * 2 + (temp[1] - temp[2]); 
			}
			else ans += temp[2] * 2 + 3;
		}
		else {
			if (temp[2] - temp[1] <= 3) {
				ans += temp[1] * 2
					+ (temp[2] - temp[1]);
			}
			else ans += temp[1] * 2 + 3;
		}

	}

	cout << ans << endl;

	//cin >> ans;

	return 0;
}


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

int main() {
  string S,T;
  cin>>S>>T;
  if(S==T){
    cout<<"Yes"<< endl;
    return 0;
  }
  for(int i=0;i<S.size()-1;i++){
    T=T.back()+T.substr(0,S.size()-1);
    if(S==T){
      cout<<"Yes"<< endl;
      return 0;
    }
  }
  cout<<"No"<< endl;
  return 0;
}

Measured memory_bytes: 3624
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int N;
		long M;
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		M = sc.nextInt();
		long[] a = new long[(int) N];
		double check = 0;
		for (int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
			check += a[i];
		}
		;
		check = check / 4f / M;
		int count = 0;
		while (N - 1 >= 0) {
			count += ((double)a[N - 1] >= check) ? 1 : 0;
			N--;
		}
		System.out.println(count >= M ? "Yes" : "No");
	}
}

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

using namespace std;

int main(){

	int taropoint = 0, hanakopoint = 0, n;
	string taro, hanako;

	cin >> n;

	for (int i = 0; i < n;i++){
		cin >> taro >> hanako;
		if (taro > hanako){
			taropoint += 3;
		}
		else if (taro < hanako){
			hanakopoint += 3;
		}
		else{
			taropoint++;
			hanakopoint++;
		}
	}

	cout << taropoint << ' ' << hanakopoint << endl;

	return 0;
}


Measured memory_bytes: 3188
#include <iostream>
#include <set>

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

	int a[ n ];
	for( int i = 0; i < n; i++ ) {
		std::cin >> a[ i ];
	}

	bool is2 = false;
	std::set<int> s;
	for( int i = 0; i < n; i = a[ i ] - 1 ) {
		auto r = s.insert( a[ i ] - 1 );
		if( r.second == false ) {
			is2 = false;
			break;
		}
		if( a[ i ] == 2 ) {
			is2 = true;
			break;
		}
	}

	int size = s.size();
	std::cout << ( is2 ? size : -1 ) << std::endl;
	return 0;
}


Measured memory_bytes: 5376
def digit_sum(n):
    ans = 0
    while n > 0:
        ans += n % 10
        n //= 10
    return ans


def solve():
    N = int(input())

    if N % digit_sum(N) == 0:
        print("Yes")
    else:
        print("No")


# Solve
if __name__ == "__main__":
    solve()


Measured memory_bytes: 38256
def main():
    n = int(input())
    red = []
    red_used = [[False for _ in range(2 * n)] for _ in range(2 * n)]
    for _ in range(n):
        rp = list(map(int, input().split()))
        red.append(rp)
        red_used[rp[0]][rp[1]] = True
    ans = 0
    red.sort(key=lambda x: x[1], reverse=True)
    blue = [list(map(int, input().split())) for _ in range(n)]
    blue.sort(key=lambda x: x[0])
    for bx, by in blue:
        for rx, ry in red:
            if rx < bx and ry < by and red_used[rx][ry]:
                red_used[rx][ry] = False
                ans += 1
                break
    print(ans)


if __name__ == '__main__':
    main()


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

int main() {
	int n,k;
	int a[200010],b[200100]={0};
	cin >>n >>k;
	for(int i=0;i<n;i++) cin >> a[i];
	for(int i=0;i<n;i++) b[a[i]]++;
	sort(b,b+n+1,greater<int>());
	int res=0;
	for(int i=k;i<n;i++){
		res += b[i];
	}
	cout <<res<<endl;
}

Measured memory_bytes: 1792
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let n: i32 = read();
    let a: i32 = read();
    let b: i32 = read();
    let mut ans = 0;
    for i in 1..n + 1 {
        let sum: i32 = i.to_string().chars().map(|c| c as i32 - 48).sum();
        if a <= sum && sum <= b {
            ans += i;
        }
    }
    println!("{}", ans);
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
    ll n,x,zb=0;
    cin >> n;
    vector<ll>V;
    for (int i=0;i<n;i++) {
        cin >> x;
        zb=zb^x;
        V.push_back(x);
    }

    for (int i=0;i<n;i++) {
        x=V[i];
        x=zb^x;
        cout << x << " ";
    }
}


Measured memory_bytes: 5364
#include <cstdio>
#include <iostream>
#include <cmath>
#include <set>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
using namespace std;
typedef long long ll;
int n,k;
ll a[100000+10];
const int N = 100000 + 5;
const int MOD = (int)1e9 + 7;
ll F[N], Finv[N], inv[N];//F是阶乘，Finv是逆元的阶乘 
void init(){
    inv[1] = 1;
    for(int i = 2; i < N; i ++){
        inv[i] = (MOD - MOD / i)  * inv[MOD % i] % MOD;
    }
    F[0] = Finv[0] = 1;
    for(int i = 1; i < N; i ++){
        F[i] = F[i-1] * 1ll * i % MOD;
        Finv[i] = Finv[i-1] * 1ll * inv[i] % MOD;
    }
}
int comb(int n, int m){//comb(n, m)就是C(n, m) 
    if(m < 0 || m > n) return 0;
    return ((F[n]  * Finv[n - m]) % MOD * Finv[m]) % MOD;
}
int main()
{
    //freopen("a.in","r",stdin);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>k;
    for(int i=1;i<=n;i++)cin>>a[i];
    sort(a+1,a+n+1);
    ll ans=0;
    //for(int i=1;i<=n;i++)cout<<a[i]<<endl;
    init();
    ll maxn=0,minn=0;
    for(int i=k;i<=n;i++){
    	maxn+=(comb(i-1,k-1)*a[i])%MOD;
    	maxn%=MOD;
   	}
   	for(int i=1;i<=n-k+1;i++){
   		minn+=(comb(n-i,k-1)*a[i])%MOD;
   		minn%=MOD;
   	}
   	cout<<(maxn-minn+MOD)%MOD<<endl;
    return 0;
}

Measured memory_bytes: 3328
map = {"" => 0}

N = gets.chomp.to_i
for n in 0...N
  key = gets.chomp
  if map.include?(key)
    map[key] += 1
  else
    map[key] = 1
  end
end

M = gets.chomp.to_i
for m in 0...M
  key = gets.chomp
  if map.include?(key)
    map[key] -= 1
  else
    map[key] = -1
  end
end

puts map.max{ |x, y| x[1] <=> y[1] }[1]


Measured memory_bytes: 1788
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<queue>
using namespace std;
typedef long long int ll;
typedef std::pair<int, int> PA;
#define rep(i,n) for(int i=0;i<(int)n;i++)
 
int main(void){
	int n; cin >> n;
	int res = 0;
	vector<int> a(n), b(n), c(n-1);
	rep(i, n)cin >> a[i];
	rep(i, n)cin >> b[i];
	rep(i, n - 1)cin >> c[i];
	int tmp = 10000;
	rep(i, n) {
		res += b[a[i]-1];
		if (tmp + 1 == a[i])res += c[a[i]-2];
		//cout << res << " ";
		tmp = a[i];
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PI 3.141592653589793
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, a, n) for (int i = a; i < (n); i++)
#define rrep(i, n, k) for (int i = (n); i >= (k); i--);
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
#define pi pair<int, int>
#define pl pair<ll, ll>
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;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>vector<T> make_vector(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto make_vector(size_t a, Ts... ts){return vector<decltype(make_vector<T>(ts...))>(a, make_vector<T>(ts...));}
const int MOD = 1e9+ 7;
const int INF = numeric_limits<int>::max() - 1e8;
const ll INFLL = numeric_limits<ll>::max() - 1e17;

int main() {
    int N, M, K;
    cin >> N >> M >> K;
    bool check = false;
    for (int i = 0; i <= N; i++) {
        for (int j = 0; j <= M; j++) {
            int base = M * i + N * j;
            base -= i * j * 2;
            if (base == K) check = true;
        }
    }
    cout << (check ? "Yes" : "No") << endl;
}


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

using ll = long long;

ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

int main() {
    ll f[2001], mod = 1e9 + 7, N, K;
    f[0] = 1;
    rep(i, 2000) f[i + 1] = (f[i] * (i + 1)) % mod;
    cin >> N >> K;
    for (int i = 1; i <= K; i++) {
        if (i > K || i - 1 > N - K) cout << 0 << endl;
        else {
            ll ans = f[K - 1] * mod_pow(f[i - 1], mod - 2, mod);
            ans %= mod;
            ans *= mod_pow(f[K - i], mod - 2, mod);
            ans %= mod;
            ans *= f[N - K + 1];
            ans %= mod;
            ans *= mod_pow(f[i], mod - 2, mod);
            ans %= mod;
            ans *= mod_pow(f[N - K - i + 1], mod - 2, mod);
            ans %= mod;
            cout << ans << endl;
        }
    }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int zet(long long int a){
  if(a > 0)return a;
  return -a;
}
int main(void){
  int n;
  scanf("%d",&n);
  long long int a,ans = 0,cnt = 0,min = 10000000000;
  for(int i = 0;i < n;i++){
    scanf("%lld",&a);
    if(a < 0){
      cnt++;
    }
    a = zet(a);
    if(min > a)min = a;
    ans += a;
  }
  if(cnt % 2 > 0)ans -= 2 * min;
  printf("%lld\n",ans);
  return 0;
}

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

int main(){
  while(1){
    int n,q,e[1000],w[1000],que[1000],f;
  string str[1000];
  cin>>n>>q;
  if(n+q==0) break;
  for(int i=0;i<n;i++)cin>>str[i]>>e[i]>>w[i];
    for(int i=0;i<q;i++) cin>>que[i];

    for(int i=0;i<q;i++){
      f=0;
      for(int j=0;j<n;j++)if(e[j]-(w[j]-que[i])>0 && e[j]-(w[j]-que[i])<=e[j]) cout<<str[j]<<" "<<e[j]-(w[j]-que[i])<<endl,f=1;
      if(f==0) cout<<"Unknown"<<endl;
  }
  }
  return 0;
}

Measured memory_bytes: 1280
n=int(input())
lst_s=list()

verdicts = {"AC":0, "WA":0, "TLE":0, "RE":0}

for i in range(n):
    s=input().upper()
    lst_s.append(s)

for s in lst_s:
    for verdict in verdicts:
        if s == verdict:
            verdicts[s] += 1

for verdict in verdicts:
    print(verdict, "x", verdicts[verdict])


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

int main() {
  int x,n;
  cin>>x>>n;
  vector<int>p(n);
  for(int i=0;i<n;i++) cin>>p[i];
  int ans=101;
  int y;
  for(int i=0;i<=101;i++){
    bool c=true;
    for(int j=0;j<n;j++){
      if(p[j]==i) c=false;
    }
    if(c && ans>abs(x-i)){
      ans=abs(x-i);
      y=i;
    }
  }
  cout<<y<<endl;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector< ll > vi;
typedef vector< vi > vvi;
#define pb push_back

int main(void)
{
    char a[101],b[101];
    cin >> a >> b;
    int n_a = strlen(a), n_b = strlen(b);
    if(n_a>n_b)
       { cout << "GREATER";
        return 0;}
    else if(n_b>n_a)
       { cout << "LESS";
        return 0;}
    else
   { 
       int p = 0;
       while(p<n_a && a[p]==b[p]) p++;
       if(p==n_a)
        cout << "EQUAL"<< endl;
        else if(a[p]>b[p])
        cout << "GREATER" << endl;
        else
        {
            cout << "LESS" << endl;
        }    
    }
    return 0;
}

Measured memory_bytes: 256
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
# import math
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)
n=l()[0]
A=l()
d={}
for i in range(n):
    if A[i] not in d:
        d[A[i]]=0
    d[A[i]]+=1
ans=0
for k in d:
    if(d[k]<k):
        ans+=d[k]
    else:
        ans+=(d[k]-k)
print(ans)
    


Measured memory_bytes: 20032
// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> void get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'; t=getchar());
	if(t=='-')neg=true,t=getchar();
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) get1(a),get1(b)
#define get3(a,b,c) get1(a),get2(b,c)
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);
 
int x,y,z,n,a[100111],b[100111],c[100111];
LL ans,d[100111],sum;
pair<LL,int> p[100111];
int getans(LL x,bool pr=0)
{
	int ret=0;
	ans=0;
	for(int i=1;i<=n;i++)
	{
		d[i]=c[i]+x;
		ans+=b[i];
		if(d[i]<0)p[i]=mp(-b[i],0);
		else p[i]=mp(d[i]-b[i],1);
		if(pr)printf("%d p= %lld %d\n",i,p[i].ff,p[i].ss);
	}
	sort(p+1,p+n+1);reverse(p+1,p+n+1);
	for(int i=1;i<=n-y;i++)
	{
		ans+=p[i].ff;
		ret+=p[i].ss;
	}
	return ret;
}
int main()
{
	get3(x,y,z);n=x+y+z;
	for(int i=1;i<=n;i++)
	{
		get3(a[i],b[i],c[i]);
		b[i]-=a[i];c[i]-=a[i];sum+=a[i];a[i]=0;
	}
	LL l=-10000000000ll,r=-l,mid;
	while(l<r-1)
	{
		mid=(l+r)/2;
		if(getans(mid)<z)l=mid;
		else r=mid;
	}
	getans(r);
	printf("%lld\n",ans+sum-r*z);
	return 0;
}

Measured memory_bytes: 3712
#include <iostream>
#include <algorithm>

using namespace std;

const int MAX_N = 2e5 + 5;

int a [MAX_N], b [MAX_N];

int main () {
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }

  sort(a, a + n);
  sort(b, b + n);

  int meda, medb;
  if (n % 2 == 0) {
    meda = a[n / 2 - 1] + a[n / 2];
    medb = b[n / 2 - 1] + b[n / 2];
  } else {
    meda = a[n / 2];
    medb = b[n / 2];
  }

  cout << medb - meda + 1 << endl;
}


Measured memory_bytes: 5168
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
bool f = false;
void output(string word){
  if(word[word.size()-1]==','||word[word.size()-1]=='.'){
    word = word.substr(0,word.size()-1);
  }
  if(3<=word.size()&&word.size()<=6){
    if(f){
      cout<<' ';
    }else{
      f = true;
    }
    cout<<word;
  }
}

int main(void){
  string sentence;
  stringstream ss;
  getline(cin,sentence);
  ss<<sentence;
  string part;
  while(ss>>part){
    int tmp=0;
    REP(i,part.size()){
      if(i==part.size()-1){
        output(part.substr(tmp));
      }else if(part[i]=='.'||part[i]==','){
        output(part.substr(tmp,i-tmp));
        tmp = i+1;
      }
    }
  }
  cout<<endl;
  return 0;
}

Measured memory_bytes: 0
#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n, m, k, l;
        cin >> n >> m >> k >> l;
        if(n == 0)
            return 0;

        vector<pair<int, string> > x(n);
        map<string, int> index;
        for(int i=0; i<n; ++i){
            cin >> x[i].second >> x[i].first;
            x[i].first *= -1;
        }
        sort(x.begin(), x.end());
        for(int i=0; i<n; ++i){
            x[i].first *= -1;
            index[x[i].second] = i;
        }

        vector<bool> fav(n, false);
        for(int i=0; i<m; ++i){
            string s;
            cin >> s;
            fav[index[s]] = true;
        }

        if(n == m || n == k){
            cout << min(m, k) << endl;
            continue;
        }

        int a = 0;
        int b = min(m, k);
        while(a < b){
            int c = (a + b + 1) / 2;

            int tmp = k - c;
            int i = -1;
            while(i+1 < n && tmp >= 0){
                ++ i;
                if(!fav[i])
                    -- tmp;
            }

            long long rest = l;
            tmp = c;
            int j = -1;
            while(tmp > 0){
                ++ j;
                if(fav[j]){
                    if(i < n){
                        if(x[j].second < x[i].second)
                            rest -= max(0, x[i].first - x[j].first);
                        else
                            rest -= max(0, x[i].first - x[j].first + 1);
                    }

                    -- tmp;
                }
            }

            if(rest >= 0)
                a = c;
            else
                b = c - 1;
        }

        cout << a << endl;
    }
}

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

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

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 (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const ll INF = 1e9+7;


int H, W, d, ans=0;
char out[505][505] = {};
void oset(int i, int j, char c){
	if( i>=0 && j>=0 && i<H && j<W )
		out[i][j] = c;
}

int main(){
	//ios_base::sync_with_stdio(0);

	cin >> H >> W >> d;
	int d2 = d*2;

	if( d % 2 ){
		rep(i,H){ rep(j,W) cout << ((i+j)%2 ? 'R' : 'B'); cout << endl; }
	}else{
		//rep(i,H){
		//	rep(j,W){
		//		if(i%d2 == 0) cout << ( (j%d2 < d) ? 'R' : 'Y');
		//		if(i%d2 == 1) cout << ( (j%d2 < d) ? 'R' : 'Y');
		//	}
		//	cout << endl;
		//}
		reps(i,-4,H/d+2) reps(j,-4,W/d+2){
			char c1 = ( (i+j)%2 ) ? 'R' : 'Y';
			char c2 = ( (i+j)%2 ) ? 'B' : 'G';
			int y1 = i*d;
			int x1 = j*d;
			int y2 = i*d + d/2;
			int x2 = j*d + d/2;
			oset(y1, x1, c1);
			oset(y2, x2, c1);
			rep(l,d) rep(k,l+1){
				if( l+k < d ){
					//cout << l << " " << k << endl;
					oset(y1 + l, x1 + k, c1);
					oset(y1 + l, x1 - k, c1);
					oset(y2 + l, x2 + k, c2);
					oset(y2 + l, x2 - k, c2);
				}
			}
		}
		rep(i,H){ rep(j,W) cout << out[i][j]; cout << endl; }
	}

	return 0;
}

Measured memory_bytes: 768
// Copyright 2020 yaito3014
#include <iostream>

int main() {
  int L, R, d;
  std::cin >> L >> R >> d;
  int ans = 0;
  for (int i = L; i <= R; ++i)
    if (i % d == 0) ++ans;
  std::cout << ans << '\n';
}


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

#define eb emplace_back
#define INF 1LL<<62
#define FLT_INF pow(10.0, 16)

using ll = long long;
using vll = vector<ll>;
using ull = unsigned long long;
using int2 = pair<int, int>;

template <typename A> string to_string(const A& v);
string to_string(const string& s) { return '"'+ s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }

template <typename A, typename B> string to_string(const pair<A, B>& p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A> string to_string(const A& v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename T>
void sort(vector<T>& val) {
  sort(val.begin(), val.end());
}

template <typename T>
void sort_b(vector<T>& val) {
  sort(val.begin(), val.end(), greater<T>());
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...);
#endif

#define COMMON_MOD 998244353
#define PI 3.14159265

// sort(a.begin(), a.end(), less<ll>()); greater<ll>()
// cout<<fixed<<setprecision(20)<<(s/kl)*2;

int main() {

  ios::sync_with_stdio(false);
  cin.tie(0);

  ll n;
  cin >> n;

  ll sum_q = 0;

  for (ll i = 1; i*i <= n; i++) {

    if ((n % i) == 0) {
      if ((i > 1) && (n % (i - 1) == n / (i - 1))) {
        sum_q += (i - 1);
      }
      if (i*i != n) {
        if (n % ((n / i) - 1) == n / ((n / i) - 1)) {
          sum_q += ((n / i) - 1);

        }
      }
    }

  }
  cout << sum_q;
  cout << endl;
  return 0;
}


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

using namespace std; 

int main(){
    int n;
    cin>>n;
    vector<string> s(n);
    for(int i=0;i<n;i++)
        cin>>s[i];
    sort(s.begin(),s.end());
    s.erase(unique(s.begin(),s.end()),s.end());
    int sz;
    sz=s.size();
    cout<<sz<<endl;
}

Measured memory_bytes: 9572
import numpy as np
n,m = map(int,input().split())
base = np.zeros(n)
seen = np.zeros(n)
base[0] = 1
sign = 0

for i in range(m):
  s,c = map(int,input().split())
  if (seen[s-1] == 0) or (base[s-1] == c):
    base[s-1] = c
    seen[s-1] = 1
    sign = 1
  else:
    sign = 2
    break
ans = 0
if (sign == 2) or ((base[0] == 0) and (n > 1)):
  ans = -1
else:
  for i in range(1,len(base)+1):
    ans += base[-i]*(10**(i-1))
    
if (m == 0) and (n == 1):
  ans = 0
print(int(ans))

Measured memory_bytes: 12396
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-9;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}
vector<pair<int,pair<int,int> > > g[110000];
long long ijk[110000][2];
int v[110000][2];
long long ans[110000];
int main(){
	int a,b,c,d;
	scanf("%d%d%d%d",&a,&b,&c,&d);
	c--;d--;
	for(int i=0;i<b;i++){
		int p,q,r,s;
		scanf("%d%d%d%d",&p,&q,&r,&s);p--;q--;
		g[p].push_back(make_pair(q,make_pair(r,s)));
		g[q].push_back(make_pair(p,make_pair(r,s)));
	}
	for(int i=0;i<a;i++)for(int j=0;j<2;j++)ijk[i][j]=inf;
	ijk[c][0]=0;
	ijk[d][1]=0;
	priority_queue<pair<long long,pair<int,int> > >Q;
	Q.push(make_pair(0LL,make_pair(c,0)));
	Q.push(make_pair(0LL,make_pair(d,1)));
	while(Q.size()){
		long long cost=-Q.top().first;
		int at=Q.top().second.first;
		int ty=Q.top().second.second;
		Q.pop();
		if(v[at][ty])continue;
		v[at][ty]=1;
		for(int i=0;i<g[at].size();i++){
			int to=g[at][i].first;
			if(v[to][ty])continue;
			if(ty==0&&ijk[to][ty]<=cost+g[at][i].second.first)continue;
			if(ty==1&&ijk[to][ty]<=cost+g[at][i].second.second)continue;
			if(ty==0){
				ijk[to][ty]=cost+g[at][i].second.first;
			}else{
				ijk[to][ty]=cost+g[at][i].second.second;
			}
			Q.push(make_pair(-ijk[to][ty],make_pair(to,ty)));
		}
	}
	long long ret=inf;
	for(int i=a-1;i>=0;i--){
		ret=min(ret,ijk[i][0]+ijk[i][1]);
		ans[i]=1000000000000000LL-ret;
	}
	for(int i=0;i<a;i++)printf("%lld\n",ans[i]);
}


Measured memory_bytes: 12788
N = int(input())
Count = {}
for _ in range(N):
    s = input()
    if s not in Count:
        Count[s] = [1, 0]
    else:
        Count[s][0] += 1
M = int(input())
for _ in range(M):
    s = input()
    if s not in Count:
        Count[s] = [0, 1]
    else:
        Count[s][1] += 1
ANS = []
for t in Count.values():
    ANS.append(t[0] - t[1])
print(max(0, max(ANS)))


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

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

    int H, W ,N;
    cin >> H >> W >>N;
    int r, c;
    string S, T;
    cin >> r >> c >> S >> T;

    int left = 1;
    int right = W;
    int top = 1;
    int bottom = H;
    for (int i = N - 1; i >= 0; --i) {
        char t = T[i];
        if (t == 'L' && right < W) {
            right++;
        } else if (t == 'R' && left > 1) {
            left--;
        } else if (t == 'U' && bottom < H) {
            bottom++;
        } else if (t == 'D' && top > 1) {
            top--;
        }
        
        char s = S[i];
        if (s == 'L') {
            left++;
        } else if (s == 'R') {
            right--;
        } else if (s == 'U') {
            top++;
        } else if (s == 'D') {
            bottom--;
        }
        if (left > right || top > bottom) {
            cout << "NO" << '\n';
            return 0;
        }
    }

    if (top <= r && r <= bottom && left <= c && c <= right) {
        cout << "YES" << '\n';
    } else {
        cout << "NO" << '\n';
    }

    return 0;
}


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

using namespace std;

int cnty[300001];
int cntx[300001];

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

	int h,w,m,y,x;
	set <pair<int,int>> p;
	cin >> h >> w >> m;

	for(int i=0;i<m;i++)
	{
		cin >> y >> x;
		p.insert(make_pair(y,x));
		cnty[y]++;
		cntx[x]++;
	}

	vector <int> sy,sx;
	int Maxy = 0;
	int Maxx = 0;

	for(int i=1;i<=h;i++)
	{
		Maxy = max(Maxy,cnty[i]);
	}
	for(int i=1;i<=w;i++)
	{
		Maxx = max(Maxx,cntx[i]);
	}

	for(int i=1;i<=h;i++)
	{
		if(Maxy==cnty[i])
		{
			sy.push_back(i);
		}
	}
	for(int i=1;i<=w;i++)
	{
		if(Maxx==cntx[i])
		{
			sx.push_back(i);
		}
	}

	int res = 0;

	for(int i=0;i<min(10,(int)(sy.size()));i++)
	{
		int y = sy[i];
		for(auto x : sx)
		{
			int num = cnty[y] + cntx[x];
			if(p.find(make_pair(y,x))!=p.end())
			{
				num -= 1;
			}
			res = max(res,num);
		}
	}

	for(int i=0;i<min(10,(int)(sx.size()));i++)
	{
		int x = sx[i];
		for(auto y : sy)
		{
			int num = cnty[y] + cntx[x];
			if(p.find(make_pair(y,x))!=p.end())
			{
				num -= 1;
			}
			res = max(res,num);
		}
	}	

	cout << res << '\n';

	return 0;
}


Measured memory_bytes: 23796
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
using namespace std;
string a[10];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    for(int i=1;i<=5;i++)
        cin>>a[i];
    for(int i=1;i<=5;i++)
        if(a[i]=="0")
        {
            cout<<i<<'\n';
            return 0;
        }
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  int oldt = 0, oldx = 0, oldy = 0;
  bool can = true;
  int t, x, y;
  rep(i,n) {
    cin >> t >> x >> y;
    int dt = t - oldt;
    int dx = x-oldx;
    int dy = y-oldy;
    
    if (dt < abs(dx)+abs(dy) || dt%2 != (abs(dx)+abs(dy))%2) {
      can = false;
      break;
    }
    
      oldx = x;
      oldy = y;
      oldt = t;
  }
  
  if(can) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    int arr[3];
    arr[0]=a+b;
    arr[1]=b+c;
    arr[2]=c+a;
    sort(arr,arr+3);
    cout<<arr[0]<<endl;


    return 0;
}

Measured memory_bytes: 3600
#include <iostream>

using namespace std;

typedef long long ll;

ll replace(ll &N, ll &K)
{
    ll a = abs(N - K);
    if (N < a)
    {
        return N;
    }
    else
    {
        if (N % K == 0)
            return 0;
        return replace(a, K);
    }
}

ll fun(ll N, ll K)
{
    ll amari = N % K;
    return min(amari, abs(amari - K));
}

int main()
{

    ll N, K;
    cin >> N >> K;

    //cout << replace(N, K) << endl;

    cout << fun(N, K) << endl;

    return 0;
}

Measured memory_bytes: 256
arr = input().split()
h = int(arr[0])
w = int(arr[1])


c = [['-'] * w for i in range(h)]

for i in range(h):
    arr = input()
    arr = list(arr)
    c[i] = arr

x = [['-'] * w for i in range(2*h)]

for i in range(h):
    x[i*2] = c[i]
    x[i*2+1] = c[i]

for i in range(2*h):
    for j in range(w):
        print(x[i][j],end='')
    print('')


Measured memory_bytes: 4724
#include<iostream>
#include<math.h>
#include<vector>
#include<array>
#include<algorithm>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll INF=1e18;

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

    ll N;
    cin >> N;
    vector<ll> height(N);
    vector<ll> dp(N);

    for (int i=0; i<N; i++) cin >> height[i];
    for (int i=0; i<N; i++) dp[i] = INF;

    dp[0] = 0;
    for (int i=1; i<N; i++) {
        dp[i] = min(dp[i], dp[i-1] + abs(height[i] - height[i-1]));
        if (i > 1) dp[i] = min(dp[i], dp[i-2] + abs(height[i] - height[i-2]));
    }

    cout << dp[N-1] << '\n';

    return 0;
}

Measured memory_bytes: 1792
#pragma comment(linker, "/STACK:512000000")
#define _CRT_SECURE_NO_WARNINGS
/*#if !defined(YCM) && 0
#define _FORTIFY_SOURCE 0
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("avx,tune=native")
#include <stdio.h>
#endif*/
//#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;

#define all(a) a.begin(), a.end()
typedef long long li;
typedef long double ld;
void solve(bool);
void precalc();
clock_t start;
int main() {
#ifdef AIM
    freopen("/home/alexandero/ClionProjects/ACM/input.txt", "r", stdin);
    //freopen("/home/alexandero/ClionProjects/ACM/output.txt", "w", stdout);
    //freopen("out.txt", "w", stdout);
#else
    //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
#endif
    start = clock();
    int t = 1;
    cout.sync_with_stdio(0);
    cin.tie(0);
    precalc();
    cout.precision(10);
    cout << fixed;
    //cin >> t;
    int testNum = 1;
    while (t--) {
        //cout << "Case #" << testNum++ << ": ";
        //cerr << testNum << endl;
        solve(true);
        //cerr << testNum - 1 << endl;
    }
    cout.flush();
#ifdef AIM1
    while (true) {
      solve(false);
  }
#endif

#ifdef AIM
    cerr << "\n\n time: " << (clock() - start) / 1.0 / CLOCKS_PER_SEC << "\n\n";
#endif

    return 0;
}

//BE CAREFUL: IS INT REALLY INT?

template<typename T>
T binpow(T q, T w, T mod) {
    if (!w)
        return 1 % mod;
    if (w & 1)
        return q * 1LL * binpow(q, w - 1, mod) % mod;
    return binpow(q * 1LL * q % mod, w / 2, mod);
}

template<typename T>
T gcd(T q, T w) {
    while (w) {
        q %= w;
        swap(q, w);
    }
    return q;
}
template<typename T>
T lcm(T q, T w) {
    return q / gcd(q, w) * w;
}

template <typename T>
void make_unique(vector<T>& a) {
    sort(all(a));
    a.erase(unique(all(a)), a.end());
}

template<typename T>
void relax_min(T& cur, T val) {
    cur = min(cur, val);
}

template<typename T>
void relax_max(T& cur, T val) {
    cur = max(cur, val);
}

void precalc() {}

//#define int li
//const int mod = 1000000007;

void solve(bool read) {
    string s = "AKIHABARA";
    string q;
    cin >> q;
    vector<int> poses;
    for (int i = 0; i < s.length(); ++i) {
        if (s[i] == 'A') {
            poses.push_back(i);
        }
    }
    for (int mask = 0; mask < (1 << poses.size()); ++mask) {
        vector<int> no_pos(s.length(), 0);
        for (int i= 0; i < poses.size(); ++i) {
            if (mask & (1 << i)) {
                no_pos[poses[i]] = 1;
            }
        }
        string cur;
        for (int i= 0; i < s.length(); ++i) {
            if (!no_pos[i]) {
                cur += s[i];
            }
        }
        if (cur == q) {
            cout << "YES\n";
            return;
        }
    }
    cout << "NO\n";
}

Measured memory_bytes: 764
/// Code By t_bone_289 (Tushar Singh)
/// An Immature Programmer.... I'm still developing !!
#include<bits/stdc++.h>
using namespace std;
#define pll pair<ll,ll>
#define fi first
#define se second
#define mp make_pair
#define pb emplace_back
#define endl '\n'
#define M 1000000007
typedef long long ll;
typedef double d;
typedef long double ld;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll a,b;
    cin>>a>>b;
    for(ll i=1;i<=3;i++)
    {
        if((a*i*b)&1)
        {
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
    return 0;
    return 0;
}



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

string s, cc;
long long ans = 0, cnt = 0;
int main()
{
    cin >> s;
    int n = s.size();
    for (int i = 0; i < n; i++)
    {
        if (s[i] == 'B' && s[i+1] == 'C')
        {
            cc.push_back('K');
            i++;
        }
        else
            cc.push_back(s[i]);
    }
//    cout << cc << endl;
    for (int i = 0; i < cc.size(); i++)
    {
        if (cc[i] == 'A')
            cnt++;
        else if (cc[i] == 'K')
        {
        ans += cnt;
        }
        else
            cnt = 0;
    }
    cout << ans;
}


Measured memory_bytes: 776
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <tuple>

using namespace std;

bool cmp(tuple<int, int, int> a, tuple<int, int, int> b) {
	int a1, a2, a3, b1, b2, b3;
	tie(a1, a2, a3) = a, tie(b1, b2, b3) = b;
	if (a1 != b1) return a1 > b1;
	if (a2 != b2) return a2 < b2;
	return a3 < b3;
}

int main() {
	int T, P, R; 
	while (cin >> T >> P >> R, T) {
		vector<vector<int> > pena(T, vector<int>(P));
		vector<tuple<int, int, int> > score(T);
		for (int i = 0; i < T; ++i) get<2>(score[i]) = i + 1;
		while (R--) {
			int tid, pid, time;
			string message;
			cin >> tid >> pid >> time >> message;
			tid--, pid--;
			if (message[0] == 'W') pena[tid][pid]++;
			else {
				get<0>(score[tid])++;
				get<1>(score[tid]) += pena[tid][pid] * 1200 + time;
			}
		}
		sort(score.begin(), score.end(), cmp);
		for (auto ans : score)
			cout << get<2>(ans) << " " << get<0>(ans) << " " << get<1>(ans) << endl;
	}

	return 0;
}


Measured memory_bytes: 3156
#include<bits/stdc++.h>
using namespace std;
#define re register ll
#define F(x,y,z) for(re x=y;x<=z;x++)
typedef long long ll;
#define I inline void
struct P
{
	int x,y;
	friend bool operator < (P l,P r)
	{
		return l.y<r.y;	
	} 
}p[1010000];
int n,m,X,Y;
int main()
{
cin>>n;
F(i,1,n)
{
	cin>>X>>Y;
	p[i].x=X-Y;p[i].y=X+Y;
}
stable_sort(p+1,p+1+n);
X=p[1].y;Y=1;
F(i,2,n)
{
	if(p[i].x>=X)
	{
		X=p[i].y;Y++;	
	}
}
cout<<Y;
	return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#define loop(i,b,n) for(int i = b; i<n; i++)
#define rep(i,n)  loop(i,0,n)
#define INF 10000
#define  MAX 1e7
using namespace std;

int main (){
    vector<bool>check(MAX+1);
    rep(i, MAX+1)
    check[i] = true;
    vector<int>Primenumber(MAX+1,0); //Primearray
    int counter =0;                  //Primearray counter;
    for(int i = 2; i<MAX+1;i++){
        if(check[i]){
            for(int j = 2;i*j<MAX;j++)
                check[i*j] = false;//?´???°??????Primearray???????´??????????????????°?????¨???false???
            Primenumber[counter] = i;
            counter++;
        }
    }
    int n; while(cin >> n){
    int bigans = 0,sans= 0;
    for(int i = n+1 ;n<MAX;i++)
        if(check[i]){bigans = i; break;}
    for(int i = n-1; i>1;i--)if(check[i]){sans = i; break;}
        cout << sans << " " << bigans<< endl;  }  return 0;
} 

Measured memory_bytes: 42996
import sys
sys.setrecursionlimit(10**9)
import heapq

def main():
    n = int(input())
    a = list(map(int, input().split()))

    one_third = a[0:n]
    three_third = [-x for x in a[2*n:3*n]]
    heapq.heapify(one_third)
    heapq.heapify(three_third)

    one_sum = [0]*(n+1)
    one_sum[0] = sum(one_third)
    three_sum = [0]*(n+2)
    three_sum[n+1] = -sum(three_third)
    for i in range(n, 2*n):
        two_num_for_one = a[i]
        min_num = heapq.heappushpop(one_third, two_num_for_one)
        one_sum[i-n+1] = one_sum[i-n] - min_num + two_num_for_one

        two_num_for_three = -a[3*n-i-1]
        max_num = -heapq.heappushpop(three_third, two_num_for_three)
        three_sum[2*n-i] = three_sum[2*n-i+1] - max_num - two_num_for_three

    score = -float('inf')
    for i in range(n+1):
        score = max(score, one_sum[i]-three_sum[i+1])

    print(score)        
    return


if __name__ == "__main__":
    main()
    sys.exit(0)

Measured memory_bytes: 117188
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace ziyuutyou
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var k = int.Parse(Console.ReadLine());
            var num = 1;

            for(var i=0;i<n;i++)
            {
                var temp = num;
                if(temp * 2 - temp < k)
                {
                    num = num * 2;
                }
                else
                {
                    num = num + k;
                }
            }
            Console.WriteLine(num);
        }
    }
}

Measured memory_bytes: 13140
N = int(input())
A=[int(x) for x in input().split()]
H= True
A.sort()
if N%2==0:
  for i in range(N):
    if A[i] != 2*(i//2)+1:
      H=False
else:
  if A[0]!=0:
    H=False
  for i in range(1,N):
    if A[i]!=2*((i-1)//2)+2:
      H=False
print(2**(N//2)%(10**9+7) if H else '0')


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

#define PI 3.1415926535897932
#define MOD 1000000007
#define INF 1e9

#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO  cout << "NO"  << endl
#define No  cout << "No"  << endl

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;

int d(int n)
{
    int res = 0;
    while(n > 0)
    {
        res++;
        n /= 10;
    }
    return res;
}

void solve()
{
    int N; cin >> N;
    int ans = 0;
    REP1(i, N)
    {
        if(d(i) % 2 == 1) ans++;
    }
    cout << ans << endl;
} 
    
int main() 
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
using namespace std;
int main(){
  int n, c=0, r=1;
  cin >> n;
  for(int i=1; i<=n; i++){
    if(i%(int)pow(10, r)==0) {i=i*10-1; r+=2; continue;}
    c++;
  }
  cout << c;
  return 0;
}

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

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vvll = vector<vll>;
using vst = vector<st>;
using vchar = vector<char>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
ll mod = 1000000007;

int main(){
  ll n;
  cin >> n;
  ll ans = 0;
  set<ll> divn_1;
  rep(i, 1, sqrt(n - 1) + 1){
    if((n - 1) % i == 0){
      divn_1.insert(i);
      divn_1.insert((n - 1) / i);
    }
  }
  set<ll> divn;
  rep(i, 1, sqrt(n) + 1){
    if(n % i == 0){
      divn.insert(i);
      divn.insert(n / i);
    }
  }
  vrep(i, divn){
    ll nn = n;
    if(i ==  1) continue;
    while(nn % i == 0) nn /= i;
    if(nn % i == 1) ans++;
  }
  cout << ans + divn_1.size() - 1 << endl;
}

Measured memory_bytes: 512