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

using namespace std;

#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define INF 1000000000
#define INFL (1LL << 60)
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

int main(){
  int n, d, x;
  cin >> n >> d >> x;
  int a[n];
  REP(i, n) cin >> a[i];
  REP(i, d){
    REP(j, n){
      if(i%a[j] == 0) x++;
    }
  }
  cout << x << endl;
	return 0;
}

Measured memory_bytes: 256
use proconio::input;
use std::f64;


fn main() {
    input!{
        a: f64,
        b: f64,
        h: f64,
        m: f64,
    }
    let a_t = h / 12.0 * 2.0 * f64::consts::PI + m / 60.0 * (2.0 * f64::consts::PI / 12.0);
    let b_t = m / 60.0 * 2.0 * f64::consts::PI;
    let a_x = a * a_t.sin();
    let a_y = a * a_t.cos();
    let b_x = b * b_t.sin();
    let b_y = b * b_t.cos();
    let ans = ((a_x - b_x).powf(2.0) + (a_y - b_y).powf(2.0)).sqrt();
    println!("{}", ans);
}


Measured memory_bytes: 2976
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;
typedef pair<int,int> pii;

int main() {
	int n, k, t, u, v, l;
	cin >> n >> k >> t >> u >> v >> l;
	vector<int> d(n);
	rep(i,n) {
		cin >> d[i];
	}
	int id = 0;

	double res = 0;
	double T = 0.0;
	int hold = 0;
	for(int i=1; i<=l; i++) {
		if( T < 1.0/v && hold>0 ) {
			hold--;
			T += t;
		}

		if( T >= 1.0/v ) {
			res += 1.0/v;
			T -= 1.0/v;
		} else if(T > 0.0) {
			double dist = 1.0 * T * v;
			res += dist / v;
			res += (1.0-dist) / u;
			T = 0.0;
		} else {
			res += 1.0 / u;
		}

		if(d[id] == i) {
			id++;
			if( hold == k || T == 0.0 ) {
				T = t;
			} else {
				hold++;
			}
		}
	}
	cout << fixed << setprecision(10) << res << endl;

	return 0;
}

Measured memory_bytes: 1272
#include<iostream>
#include<cmath>
#include<cstring>
#include<vector>
using namespace std;
int a[4][4],v[4][4];
int b[105];
int n;
int main()
{
	for(int i=1;i<=3;i++)
	{
		for(int j=1;j<=3;j++)
		{
			cin>>a[i][j];
		}
	}
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>b[i];
	}
	memset(v,0,sizeof(v));
	for(int i=0;i<n;i++)
	{
		int flag=0;
		for(int j=1;j<=3;j++)
		{
			
			for(int k=1;k<=3;k++)
			{
				if(a[j][k]==b[i])
				{
					v[j][k]=1;
					flag=1;
					break;
				}	
			}
			if(flag==1)	break;
		}
	}
	int flag=0;
	for(int i=1;i<=3;i++)
	{
		if(v[i][1]==1&&v[i][2]==1&&v[i][3]==1||v[1][i]==1&&v[2][i]==1&&v[3][i]==1)
		{
			flag=1;
		}
	}
	if(v[1][1]==1&&v[2][2]==1&&v[3][3]==1||v[1][3]==1&&v[2][2]==1&&v[3][1]==1)
		flag=1;
	if(flag)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	long long n;
	cin>>n;
	long long a[n];
	for(int i=0;i<n;++i)
		cin>>a[i];
	long long x=0;
	for(int i=0;i<n-1;++i)
		for(int j=i+1;j<n;++j)
			x+=a[i]*a[j];
	cout<<x<<endl;
	return 0;
}

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

#define ll long long
#define ii pair<ll, ll>
#define dd pair<double, double>
#define pb(i) push_back(i)
const double PI = 3.14159265359;
const int inf = 1e9+77;
const int mod = 1e9+7;
const double eps = 1e-7;
//int dir1[8] = {0, 0, 1, -1, 1, -1, 1, -1};
//int dir2[8] = {1, -1, 0, 0, 1, 1, -1, -1};
int dir1[4] = {0, 0, 1, -1};
int dir2[4] = {1, -1, 0, 0};

const int N = 1<<22;

int n;
int mat[25][25];

ll dp[22][N];

ll solve(int a, int b)
{

    if( (b > (1<<n)-1) || a > 21)
        return 0;

    //cout << a << ' ' << b << '\n';

    ll &h = dp[a][b];
    if( b == ((1<<n) -1) && a == n )
        return h = 1;
    
    if(h != -1)
        return h;

    int i, j;

    h = 0;
    for(i = 0; i < n; i++)
        if(mat[a][i] == 1 && ((1<<i) & b) == 0)
            h = (h + solve(a+1, (1<<i) | b))%mod;

    return h;
}

int main()
{
    int i, j;

    memset(mat, 0, sizeof(mat));
    memset(dp, -1, sizeof(dp));

    cin >> n;
    for(i = 0; i < n; i++)
        for(j = 0; j < n; j++)
            cin >> mat[i][j];

    cout << solve(0, 0) << '\n';
}

Measured memory_bytes: 724540
n=97
p=print
r=range
def a(i,j,k,l=0):p(chr(43+l*17),i,j,k)
def b(i):a(i,i,i+1)
def d(x,i,j):
	for t in r(30):
		b(j+t-1);a(j+t,n,j+t)
		for s in r(j+t,j+29):b(s)
		a(j+29,x,i+t,1);b(j+t-1);a(j+t,i+t,j+t)
p(3933)
a(0,1,n)
a(2,n,n,1)
a(0,n,3)
a(1,n,4)
d(3,5,36)
d(4,36,67)
for t in r(59):
	a(2,2,2)
	for s in r(t+1):
		if t-30<s<30:a(5+t-s,36+s,98);a(n,98,99,1);a(2,99,2)

Measured memory_bytes: 9224
//By SiriusRen
#include <bits/stdc++.h>
using namespace std;
const int N=200050;
int n,m,q,xx,yy,l[N],r[N],f[555][555];
int main(){
	scanf("%d%d%d",&n,&m,&q);
	for(int i=1;i<=m;i++){
		scanf("%d%d",&l[i],&r[i]);
		f[l[i]][r[i]]++;
	}
	for(int i=1;i<=n;i++){
		for(int j=i;j<=n;j++){
			f[i][j]+=f[i][j-1];
		}
	}
	for(int i=1;i<=q;i++){
		scanf("%d%d",&xx,&yy);
		int ans=0;
		for(int j=xx;j<=yy;j++)ans+=f[j][yy];
		printf("%d\n",ans);
	}
}

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

using ll = long long;
using db = double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;
#define endl "\n"

ll gcd(ll a, ll b, ll *x, ll *y) {
	if (b == 0) {
		(*x) = 1;
		(*y) = 0;
		return a;
	}
	else {
		ll X, Y;
		ll val = gcd(b, a%b, &X, &Y);
		(*x) = Y;
		(*y) = X - (a/b)*Y;
		return val;
	}
}

void testCase() {
	ll a, b, x, y;
	cin >> a >> b;
	x = y = 0;
	if (a >= b)
		gcd(a, b, &x, &y);
	else
		gcd(b, a, &y, &x);
	cout << x << " " << y << endl;
}

int main() {
	ios_base :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	testCase();
	return 0;
}


Measured memory_bytes: 3148
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
 
using namespace std;
 
#define pai 3.14159265359
#define mod 1000000007

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

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


/*
unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count();
mt19937 g1.seed(seed1);
*/
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<pii, pii> ppiipii;
typedef pair<int, pii> pipii;
typedef pair<pii, int> ppiii;
typedef pair<int, ppiii> pippiii;
typedef pair<int, ll> pill;
typedef pair<int, double> pid;
// note to self, the below two triggers someone
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;

int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d\n", max(a*b, max(a+b, a-b)));
}


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

using namespace std;

int main()
{
    int x,a,b;
    while (cin>>x>>a>>b)
    {
        if (abs(x-a)>abs(x-b))
            cout<<"B"<<endl;
        else
            cout<<"A"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
// Hail god Yato
 
#include <bits/stdc++.h> 
using namespace std;
 
#define add(x) accumulate(x)
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end() 
#define rep(i, a, b) for (int i=a; i<(b); i++)
#define hs ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
#define PI 3.14159265
const ll mod = 1000000007;
const ll INF = 1e18;
const ll MAX = 100001;
//
//
                void solve(){
                        double a,b,d;
                        cin>>a>>b>>d;
                        if( a*a*b/2>=d ){
                                cout<<(PI/2-atan(2*d / (a*b*b)))*180/PI;
                        }
                        else
                                cout<<(PI/2-atan(a/(2*b-d*2/(a*a))))*180/PI;
                }
                int main(){ 
                        hs;
                        cout<<fixed<<setprecision(8);
                        ll t;
                        t=1;
                        // cin>>t;
                        for (int i=1; i<=t; i++){
                                //printf("Case #%d: ", i);
                                solve();
                         }
        return 0; 
}         
 

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

int main(){
    int n, x;
    while(1) {
        cin >> n >> x;
        if (n == 0 && x == 0) break;
        
        int sum, res = 0;
        for (int i = 1; i <= n; i++) {
            for (int j = i+1; j <= n; j++) {
                for (int k = j+1; k <= n; k++) {
                    sum = i + j + k;
                    if (sum == x) res++;
                }
            }
        }
        cout << res << endl;
    }
}


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

int main(){
  int n, s;
  cin >> n >> s;
  int a[n];
  rep(i,n) cin >> a[i];
  vector<vector<ll>> dp(n+1,vector<ll>(s+1,0));
  dp[0][0] = 1;
  rep(i,n) {
    rep(j,s+1) {
      (dp[i+1][j] += 2*dp[i][j]) %= mod;
      if(j + a[i] <= s) (dp[i+1][j+a[i]] += dp[i][j]) %= mod; 
    }
  }
  cout << dp[n][s] << endl;
  return 0;
}


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

#define int long long

using namespace std;

int a[100001];
int b[100001];
int p[100001];

 main () {
	int n, x;
	cin >> n;
	for (int i = 1;i <= n;i ++) {
		cin >> p[i];
	}
	a[1] = 1;
	for (int i = 2;i <= n;i ++) a[i] = a[i - 1] + 50000; 
	b[n] = 1;
	for (int i = n - 1;i >= 1;i --) b[i] = b[i + 1] + 50000;
	for (int i = 1;i <= n;i ++) {
		a[p[i]] += i;
	}
	for (int i = 1;i <= n;i ++) cout << a[i] << ' ';
	cout << endl;
	for (int i = 1;i <= n;i ++) cout << b[i] << ' ';
	return 0;
}

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

int main() {
    int H, W;
    cin >> H >> W ;
    int i,j;
       
    while( (H != 0) or (W != 0)){ 
        i = 1;
       
        while(i <= H){
             j = 1;
            while(j <= W){
                cout << "#" ;
                j = j + 1;
            }
            cout << endl;
            i = i + 1;
        }
        cout<<  endl;
        cin >> H >> W;    
        }
        
        
    }
    



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

#define debug(var)  do{std::cerr << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cerr << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cerr << e << " "; } std::cerr << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<ll> v1;
typedef vector<v1> v2;
typedef vector<v2> v3;

typedef unordered_map<ll, unordered_map<ll, ll>> graph;

const ll INF = 1ll << 50;
const ll mod = 1000000007;

string a,b;

int main(){
    cin >> a >> b;
    string c = a + b;
    ll x = stoi(c);
    ll y = 1;
    while(x > y*y){
        y++;
    }
    if(y*y == x){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}


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

using namespace std;

int main() {
    char S[3];
    cin >> S;
    int a,b;

    for(int i=0;i<3;i++){
        if(S[i]=='A') a++;
        if(S[i]=='B') b++;
    }   
    string res =  (a*b) != 0?"Yes":"No";
    cout << res;

}

Measured memory_bytes: 256
n = int(input())
l_a = list(map(int,input().split()))
l_b = list(map(int,input().split()))
if sum(l_a)<sum(l_b):
  print(-1)
  exit()
l_sa = sorted(list(i-j for i,j in zip(l_a,l_b)))
s = 0
cou =0
#print(l_sa)
for i in l_sa:
  if i<0:
    s += i
    cou +=1
  else:
    break
#print(s,cou)
l_sb = l_sa[::-1]
for i in l_sb:
  if s<0:
    s += i
    cou += 1
    #print(s,cou)
  else:
    break
print(cou)

Measured memory_bytes: 19536
# -*- coding: utf-8 -*-
N = int(input())
F = []
P = []

for i in range(N):
    F.append( list(map(int, input().split())))
for i in range(N):
    P.append( list(map(int, input().split())))

e_list = []

for i in range(1,1024):
    temp = i
    temp_l = []
    for j in range(10):
        temp_l.append(temp % 2)
        temp = temp // 2

    temp_l.reverse()
    e_list.append(temp_l)

ans = []

for wk in e_list:
    plice = 0
    for fi,pi in zip(F,P):
        c_num = 0
        for f,e in zip(fi,wk):
            if e == 1 and e == f:
                c_num += 1

        plice += pi[c_num]
    ans.append(plice)

print(max(ans))


Measured memory_bytes: 3316
import sys
c = [list(map(int, input().split())) for _ in range(3)]

a = [0] * 3
b = [0] * 3

for i in range(3):
    b[i] = c[0][i]

for i in range(1,3):
    a[i] = c[i][0] - b[0]

for i in range(3):
    for j in range(3):
        if c[i][j] == a[i] + b[j]:
            pass
        else:
            print("No")
            sys.exit()
print("Yes")

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt(),n=sc.nextInt();
		int[] array = new int[n];
		for(int i=0;i<n;i++) {
			array[i]=sc.nextInt();
		}
		int max=0;
		for(int i=1;i<n;i++) {
			if((array[i]-array[i-1])>=max) {
				max = array[i]-array[i-1];
			}
		}
		if(k-array[n-1]+array[0]>=max) max=k-array[n-1]+array[0];
		System.out.println(k-max);
	}
}

Measured memory_bytes: 84368
// https://atcoder.jp/contests/abc089/tasks/abc089_c
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
const int SZ = 5;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    string s;
    cin >> n;
    vector<int> cnt(SZ);

    for (int i = 0; i < n; i++) {
        cin >> s;
        if (s[0] == 'M')
            cnt[0]++;
        else if (s[0] == 'A')
            cnt[1]++;
        else if (s[0] == 'R')
            cnt[2]++;
        else if (s[0] == 'C')
            cnt[3]++;
        else if (s[0] == 'H')
            cnt[4]++;
    }
    int ans = 0;
    REP(i, SZ) FOR(j, i + 1, SZ) FOR(k, j + 1, SZ) {
        ans += (cnt[i] * cnt[j] * cnt[k]);
    }

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


Measured memory_bytes: 256
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut iter = buf.split_whitespace();

    let a = iter.next().unwrap().parse::<usize>().unwrap();
    let b = iter.next().unwrap().parse::<usize>().unwrap();

    let product = a * b;
    let result = match product % 2 {
        0 => "Even",
        1 => "Odd",
        _ => "Impossible",
    };

    println!("{}", result);
}


Measured memory_bytes: 4352
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    s = S()
    if "9" in s:
        print("Yes")
    else:
        print("No")
    return

#B
def B():
    return

#C
def C():
    n = II()
    A = {}
    for i in range(n):
        k = II()
        if not k in A:
            A[k] = 1
        else:
            A[k] += 1
    ans = 0
    for item in A.values():
        ans += item % 2
    print(ans)
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()


Measured memory_bytes: 38512
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define all(c) (c).begin(),(c).end()

using namespace std;
main(){
    while(1){
        ll n;cin>>n;
        if(!n)break;
        vector<ll> a(n);
        rep(i,n)cin>>a[i];
        ll sum = accumulate(all(a),0LL);
        int cnt = 0;
        rep(i,n){
            cnt += (a[i]*n <= sum);
        }
        cout << cnt <<endl;
    }
}


Measured memory_bytes: 3168
// author: pankaj_m05

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

typedef long long ll;


int main(void) {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
	int n;
	cin >> n;
	cout << ((1000 - (n % 1000)) % 1000);
    return 0;
}

Measured memory_bytes: 3684
#include <iostream>
#include <string>
#include <algorithm>
#define	MOD  1000000007;
using namespace std;

int main()
{
	int N, L;
	cin >> N >> L;
	string S[100];
	for (int i = 0; i < N; i++)
	{
		cin >> S[i];
	}

	sort(S, S + N);

	string ans;
	for (int i = 0; i < N; i++)
	{
		ans += S[i];
	}

	cout << ans << endl;

	return 0;
}

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

using namespace std;

/**templates**/
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;

#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define sull(x) scanf("%llu",&x)
#define sf(x) scanf("%lf",&x)
#define ss(x) scanf(" %s",x)
#define sc(x) scanf(" %c",&x)
#define pi acos(-1.0)
#define pb push_back
#define mp make_pair
#define aa first
#define bb second
#define sz(x) (ll)(x).size()
#define cas printf("Case %lld: ",++t)
#define casline printf("Case %lld:\n",++t)
//#define cas cout<<"Case "<<++t<<": "
//#define casline cout<<"Case "<<++t<<":"<<endl;
#define distance(x1,y1,x2,y2)((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
#define endl "\n"
#define bug cout<<"bugggggggggggg "<<endl;
#define fast ios_base::sync_with_stdio(0);cin.tie(nullptr); ///no printf/scanf
#define clean fflush(stdout)

const ll mod = 1000000007;
const ll inf = 1LL<<62;
const ll mx = 100005;
const double eps = 1e-10;

ll dx[10]={1,0,-1,0};
ll dy[10]={0,-1,0,1};

ll power(ll a,ll b)
{
    if(b==0)return 1;
    ll x=power(a,b/2);
    x=x*x;
    if(b%2)x=x*a;
    return x;
}

ll bigmod(ll a,ll b)
{
    if(b==0)return 1;
    ll x=bigmod(a,b/2)%mod;
    x=(x*x)%mod;
    if(b%2)x=(x*a)%mod;
    return x;
}


ll Set(ll N,ll pos){return N=N | (1LL<<pos);}
ll reset(ll N,ll pos){return N= N & ~(1LL<<pos);}
bool check(ll N,ll pos){return (bool)(N & (1LL<<pos));}

/**
double cosine_rule(double a,double b,double c)
{
    double res=(a*a+b*b-c*c)/(2*a*b);
    res=acos(res);
    return res;
}
*/

ll arr[2*mx];

int main()
{
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);
//    fast; ///no printf/scanf
    /** Use "long double"(%Lf) instead of double for precision safety*/
    ll tst,a,b,c,k,n,m,res=0,ans=0,t=0;
    sl(n),sl(m);
    for(ll i=1;i<=n;i++)
    {
        sl(arr[i]);
    }
    sort(arr+1,arr+1+n,greater<ll>());
    for(ll i=m+1;i<=n;i++)
    {
        res+=arr[i];
    }
    cout<<res<<endl;



    return 0;
}


Measured memory_bytes: 5188
#include <bits/stdc++.h>
#pragma warning (disable:4996)
using namespace std;
#define ll long long 
#define ull unsigned long long
const int maxn = 1e5 + 5;
int a[maxn];
int l[maxn];
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> a[i];
	int cnt = 1;
	int maxx = 0;
	l[n] = 0;
	for (int i = n; i >= 2; i--)
	{
		if (a[i] <= a[i - 1])
		{
			l[i - 1] = l[i] + 1;
		}
		else
			l[i - 1] = 0;
		maxx = max(maxx, l[i]);
	}
	maxx = max(maxx, l[1]);
	cout << maxx;

	return 0;
}

Measured memory_bytes: 1024
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

n=int(input())

x=n
for i in range(n,10**6): 
   if is_prime(i):
       break


print (i) 



Measured memory_bytes: 2940
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		String x = scn.next();
		String y = scn.next();
      	char[] c1 = x.toCharArray();
      	char[] c2 = y.toCharArray();
      	int cx = (int)c1[0];
      	int cy = (int)c2[0];
      	if(cx>cy) System.out.println(">");
      	if(cy>cx) System.out.println("<");
      	if(cx==cy) System.out.println("=");
	}
}


Measured memory_bytes: 35604
#include<bits/stdc++.h>
using namespace std;
main()
{
	string s;
	cin>>s;
	long int n = s.length();
    long int res=1;
	int flag=1;
	for(long int i=1;i<n;++i)
	{
		if(flag==1)
		{
			if(s[i]!=s[i-1])
			{
				++res;
			}
			else
			{
				++i;
				if(i<=n-1)
				++res;
			flag=2;
         }
		}
		else
		{
			++res;
			flag=1;
		}
	}
    cout<<res;
	
}

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


Measured memory_bytes: 3540
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

//みなさん天才的ですよね

ll num[524300];
const int ma = (1 << 19) - 1;
bool query(ll n) {
	int n2 = (n & ma) + 1;
	while (num[n2]) {
		if (num[n2] == n + 1) return 1;
		n2 = n2 * 61 % 524287;
	}
	return 0;
}
void add(ll n) {
	int n2 = (n & ma) + 1;
	while (num[n2]) {
		if (num[n2] == n + 1) {
			return;
		}
		n2 = n2 * 61 % 524287;
	}
	num[n2] = n + 1;
}

int KH[300001], KW[300001];
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	int H, W, M;
	cin >> H >> W >> M;

	rep(i, M) {
		int h, w;
		cin >> h >> w;

		KH[h]++;
		KW[w]++;
		add(ll(h) * W + w);
	}

	int saidaih = -1;
	int hh[300001], h = 0;
	rep1(i, H) {
		if (saidaih < KH[i]) {
			saidaih = KH[i];
			h = 1;
			hh[0] = i;
		}
		else if (saidaih == KH[i]) {
			hh[h++] = i;
		}
	}
	int saidaiw = -1;
	int ww[300001], w = 0;
	rep1(i, W) {
		if (saidaiw < KW[i]) {
			saidaiw = KW[i];
			w = 1;
			ww[0] = i;
		}
		else if (saidaiw == KW[i]) {
			ww[w++] = i;
		}
	}

	if (ll(h) * w > M) {
		co(saidaih + saidaiw);
		return 0;
	}
	int atta = 0;
	rep(i, h) rep(j, w) {
		if (!query(ll(hh[i]) * W + ww[j])) {
			atta = 1;
			break;
		}
	}

	if (atta) co(saidaih + saidaiw);
	else co(saidaih + saidaiw - 1);

	Would you please return 0;
}

Measured memory_bytes: 12356
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <tuple>
#define FOR0(var, max) for (ui (var) = 0; (var) < (max); ++(var))
#define FOR_INV(var, min, max) for (ui (var) = (max) - 1; (var) + 1 > (min); --(var))
#define FORITER(var, iter) for (auto (iter) = (var).begin(); (iter) != (var).end(); (iter)++)
#define FORITER_INV(var, iter) for (auto (iter) = (var).rbegin(); (iter) != (var).rend(); (iter)++)

using namespace std;

using uc = unsigned char;
using ui = unsigned int;
using ul = unsigned long long int;
using si = signed int;
using sl = signed long long int;

const static ul NMAX = 20000;

static ul N;
static ul Pi[NMAX];
static sl Ai[NMAX];
static sl Bi[NMAX];
static sl Ci[NMAX];

bool check(void) {
  FOR0(i, N - 1) {
    if (!((Ai[i] < Ai[i + 1]) && (Bi[i] > Bi[i + 1]) && (Ai[Pi[i]] + Bi[Pi[i]] < Ai[Pi[i + 1]] + Bi[Pi[i + 1]]))) {
      return false;
    }
  }
  return true;
}

void solve(void) {
  FOR0(i, N) {
    Ci[Pi[i]] = i + 1;
  }
  si offsetA = 0;
  si offsetB = 0;
  si aoff = 0;
  FOR0(i, N) {
    Ai[i] = i + 1 + offsetA;
    Bi[i] = 2 * N - i - 1 + offsetB;
    si t = Ci[i] - (Ai[i] + Bi[i]);
    if (t < 0) {
      Bi[i] += t;
      offsetB += t;
    } else {
      Ai[i] += t;
      offsetA += t;
    }
    t = max(abs(Ai[i]), abs(Bi[i]));
    if (aoff < t) {
      aoff = t;
    }
  }
  FOR0(i, N) {
    Ai[i] += aoff + 1;
    Bi[i] += aoff + 1;
  }

}

int main(void) {
  cin >> N;
  FOR0(i, N) {
    cin >> Pi[i];
    Pi[i] -= 1;
  }
  solve();
  FOR0(i, N) {
    cout << Ai[i] << " ";
  }
  cout << endl;
  FOR0(i, N) {
    cout << Bi[i] << " ";
  }
  cout << endl;
  // cout << (check() ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T> vector<vector<T>> make_vector_2d(int n, int m, T initialValue) {
    auto r = vector<vector<T>>(n);
    for (int i = 0; i < n; i++) r[i] = vector<T>(m,initialValue);
    return r;
}
template <typename T> vector<vector<vector<T>>> make_vector_3d(int n, int m, int l, T initialValue) {
    auto r = vector<vector<vector<T>>>(n);
    for (int i = 0; i < n; i++) {
        r[i] = vector<vector<T>>(m);
        for (int j = 0; j < m; j++) r[i][j] = vector<T>(l, initialValue);
    }
    return r;
}

int main() {

    int n,k;
    cin >> k >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];

    int minDis = a[n-1] - a[0];
    for (int i = 1; i < n; i++) {
        minDis = std::min(minDis, k - (a[i] - a[i - 1]));
    }

    cout << minDis << endl;

    return 0;

}


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

#+++++
		
def main():
	k, s = map(int, input().split())
	c=0
	for x in range(k+1):
		for y in range(k+1):
			ccc=s-(x+y)
			c+=1 if ccc <= k and 0<= ccc else 0
	
	print(c)
	
	
#+++++

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 3060
let rec fix f x = f (fix f) x;;
(0,read_line())|>fix(fun f (i,s)->
	if i>=String.length s then [] else s.[i]::f (i+1,s))
	|> List.fold_left(fun (c,p) v->(if p=v then c else c+1),v)(-1,':')
	|> fst |> print_int

Measured memory_bytes: 9472
#include<algorithm>
#include<cmath>
#include<climits>
#include<cstdio>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
const ll MOD = 1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,s,e) for(int i=s;i<e;i++)
#define reple(i,s,e) for(int i=s;i<=e;i++)
#define revrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()

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

int main()
{
	int N, x;
	cin >> N >> x;

	vll a(N);
	rep(i, N) cin >> a[i];

	ll count = 0;

	rep(i, N - 1)
	{
		int diff = a[i] + a[i + 1] - x;

		if (diff > 0)
		{
			//右側から先に引く
			if (a[i + 1] > diff)
			{
				a[i + 1] -= diff;
				count += diff;
				diff = 0;
			}
			else
			{
				diff -= a[i + 1];
				count += a[i + 1];
				a[i + 1] = 0;
			}

			//あまりは左側から引く
			if (diff > 0)
			{
				count += diff;
				a[i] -= diff;
				diff = 0;
			}
		}
	}

	cout << count << endl;

	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
typedef long long int lli;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};

const int n = 26;

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

    // 満足度が下がる値
    vector<int> bad(n);
    rep(i, n) cin >> bad[i];

    // そのコンテストをその日に開いた時の満足度
    vector<vector<int>> score(days+1, vector<int>(n));
    for(int d = 1; d <= days; d++){
        rep(i, n) cin >> score[d][i];
    }

    // 最後にそのコンテストが開かれたのが何日前か
    vector<int> preD(n, 0);

    // 日付毎で満足度が最大になるコンテストを開く
    vector<int> sats(days+1, 0), cons(days+1, 0);
    for(int d = 1; d <= days; d++){
        int maxSat = 0, maxCon = 0;

        // d日のi番目のコンテストを開いたときの満足度を計算し、最大になるコンテストと満足度を記録する
        rep(i,n){
            int conSat = score[d][i] + sats[d-1];
            vector<int> copyPreD = preD;
            rep(j,n){
                if (i == j) continue;
                copyPreD[j]++;
                conSat -= bad[j] * copyPreD[j];
            }
            if (chmax(maxSat, conSat)){
                maxCon = i;
            }
        }

        // 最も良いスコアとコンテストを更新
        sats[d] = maxSat;
        cons[d] = maxCon+1;

        // 開いたコンテストの最終日を更新
        rep(i,n){
            if (i == maxCon) preD[i] = 0;
            else preD[i]++;
        }
    }

    for(int d = 1; d <= days; d++){
        cout << cons[d] << endl;
    }
}

Measured memory_bytes: 3680
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using P = pair<ll,ll>;
using um = unordered_map<ll,ll>;
#define fl cout<<flush;
#define endl '\n'
template <typename T> inline void prt(T v){cout<<v<<'\n';}
template <typename T> inline bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template <typename T> inline bool chmin(T &a, const T &b){if (a>b){a=b;return 1;}return 0;}
const ll INF=1LL<<60;
const ll MOD=(ll)1e9+7;
const ll MOD2=998244353;
const ld pi=3.14159265358979323846;
const ld eps=1e-10;

signed main(void){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    string S;
    cin >> S;
    ll n=S.size();
    cout<<string(n,'x')<<endl;

    return 0;
}



Measured memory_bytes: 3648
//Bismillah Hir Rehmanir Rahim
//Allah knows best
using namespace std;
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#define mini -10000000000000000
#define start ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define f(i, a, n) for( i=a; i<n;i++)
#define ll long long
#define pi 3.141592653589793
#define vi              vector<int>
#define si              set<int>
#define pb              push_back
#define mp              make_pair
#define mod             1000000007
#define rr              return 0
#define ff              first
#define in              insert
#define ss              second
#define setbits(x)      __builtin_popcountll(x)
#define zrbits(x)       __builtin_ctzll(x)
#define deb(x)          cout << #x << " = " << x << endl
int vis[200001];
ll cc;
vector<ll>v[200001];
void dfs(ll s)
{
    vis[s]=1;
    cc++;
    for(auto a: v[s])
    {
         if(!vis[a])
            dfs(a);
    }
}
int main()
{
    ll a,n,i,j,k,m,b;
    cin>>n>>m;
    //vector<int>v[n+1];
    for(i=0;i<m;i++)
    {
        cin>>a>>b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    ll cnt=0;
    ll mx=0;
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            cc=0;
            dfs(i); cnt++;
             //deb(cc);
            mx=max(mx,cc);
        }
    }
    cout<<mx<<endl;
   return 0;
}


Measured memory_bytes: 21564
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <complex>
#include <valarray>
#include <fstream>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <random>

#define _overload(a, b, c, d, ...) d
#define _rep1(X, A, Y) for (int (X) = (A);(X) <= (Y);++(X))
#define _rep2(X, Y) for (int (X) = 0;(X) < (Y);++(X))
#define rep(...) _overload(__VA_ARGS__, _rep1, _rep2)(__VA_ARGS__)
#define rrep(X,Y) for (int (X) = Y-1;(X) >= 0;--(X))
#define all(X) (X).begin(),(X).end()
#define _size(X) (int)((X).size())
#define mod(n, m) (((n)%(m)+(m))%m)
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
const int INFINT = 1 << 30;                          // 1.07x10^ 9
const ll INFLL = 1LL << 60;                          // 1.15x10^18
const double EPS = 1e-10;
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};


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

  int n;
  string s;

  cin >> n;
  cin >> s;

  int r = 0, b = 0;
  rep(i, n) {
      if (s[i] == 'R') ++r;
      else ++b;
  }

  if (r > b) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int N,i,f,g,best,point=0;
	
	char moji[100]={0};
	int count[100]={0};
	int flag;
	
	scanf("%d",&N);
	
	char M[100][100];
	
	for(i=0;i<3;i++){
	scanf("%s",&M[i]);
	}
	
	/*
	for(i=0;i<3;i++){
	printf("%c\n",M[i][3]);
	}
	*/
	
	for(i=0;i<N;i++){//N文字を１文字ずつ
		char moji[100]={0};
			int count[100]={0};
		for(f=0;f<3;f++){//何段目
			//探索M[i][f]について
			//printf("%c\n",M[f][i]);
			
			for(g=0;g<N;g++){//gはmojiとcountの番号
				
				if(moji[g]==0){
					moji[g]=M[f][i];
					count[g]=1;
					break;
				}else if(moji[g]==M[f][i]){
					count[g]+=1;
					break;
				}
			}
			
		}
		//１文字目を整理し終わった
		best=0;
		for(f=0;f<100;f++){
			if(count[best]<=count[f])best=f;
		}
		//printf("kosuu %d\n",count[best]);
		//printf("point %d\n",3-count[best]);
		point+=3-count[best];
			for(f=0;f<10;f++){
			//printf("%c",moji[i]);
			}
			//printf("\n");
			for(f=0;f<10;f++){
			//printf("%d",count[i]);
			}
			//printf("\n");
	}
	
	printf("%d",point);
}

Measured memory_bytes: 128
import sys
sys.setrecursionlimit(10**6)
def input():
	return sys.stdin.readline()[:-1]

n = int(input())
b = list(map(int, input().split()))
adj = [[] for _ in range(n)]
for _ in range(n-1):
	u, v = map(int, input().split())
	adj[u-1].append(v-1)
	adj[v-1].append(u-1)

def dfs(x, p):
	s = set()
	for v in adj[x]:
		if v != p and b[v] < b[x]:
			s.add(dfs(v, x))
	res = 0
	while res in s:
		res += 1
	return res

ans = []
for i in range(n):
	if dfs(i, -1) != 0:
		ans.append(i+1)
print(*ans)

Measured memory_bytes: 51420
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <set>
#include <queue>
#include <limits>
#include <deque>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <map>
#include <iomanip>
#include <ios>
#include <iostream>
#include <vector>
#include <cwchar>
#include <cwctype>
#define mp make_pair
#define fs first
#define se second
#define memset(a,t) memset(a,t,sizeof(a))
#define all(v) v.begin(),v.end()
#define eprintf(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define MN 0LL
#define Mx 200000005
#define Mn -Mx
#define MX 20000000000000005
using namespace std;
int readint(){
	char c;
	while(c=getchar(),(c<'0'||c>'9')&&c!='-');
	bool flag=(c=='-');
	if(flag)c=getchar();
	int x=0;
	while(c>='0'&&c<='9'){
		x=x*10+c-48;
		c=getchar();
	}
	return flag?-x:x;
}
inline string tos(int x){
	string s;
	while(x) s=(char)(x%10+'0')+s,x/=10;
	return s;
}
map<int,int> cnave[200005];
int a[200005],b[200005];
inline int finda(int t){
	if(a[t]==t) return a[t];
	int x=finda(a[t]);
	a[t]=x;
	return x;
}
inline int findb(int t){
	if(b[t]==t) return b[t];
	int x=findb(b[t]);
	b[t]=x;
	return x;
}
int main(){
	ios_base::sync_with_stdio(false);
	int n,p,q,i,j,x,y;
	cin>>n>>p>>q;
	for(i=0;i<n;i++) a[i]=b[i]=i;
	for(i=0;i<p;i++){
		cin>>x>>y;
		x--,y--;
		a[finda(x)]=finda(y);
	}
	for(i=0;i<q;i++){
		cin>>x>>y;
		x--,y--;
		b[findb(x)]=findb(y);
	}
	for(i=0;i<n;i++){
		finda(i);
		findb(i);
		cnave[a[i]][b[i]]++;
	}
	for(i=0;i<n;i++) cout<<cnave[a[i]][b[i]]<<" ";
	cout<<endl;
	return 0;
}


Measured memory_bytes: 20224
#include<stdio.h>
int main()
{
    int n,i;
    scanf("%d",&n);
    int sum=0;
    int a[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++)   
    {
        if(a[i]%2==0)
        {
            if(a[i]%3==0 || a[i]%5==0)
            {
                sum=0;
            }
            else
            {
                sum=1;
                break;
            }
        } 
        
    } 
    
          if(sum==0)
    {
        printf("APPROVED\n");
    }
    else if(sum==1)   
    {
        printf("DENIED\n");
    }
    return 0;
}    
  
     

Measured memory_bytes: 128
from numpy import*;p=print;i=int;n=i(input());c=i(sqrt(n*2))
if c*c+c-n*2:p('No')
else:a=eye(c+1,c,0,i);t=triu_indices(c);a[t]=a[1:].T[t]=r_[:n]+1;p('Yes');p(c+1);[p(c,*r)for r in a]

Measured memory_bytes: 18804
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<queue>
#include<stack>
#include<cmath>
using namespace std;

const int MAXN = 1e5 + 5;
const int INF = 0x3f3f3f3f;
int high[MAXN];
int dp[MAXN];//跳到石头编号为i的最小花费
int n, k;

int main() {

    cin >> n >> k;
    memset(dp, 0, sizeof(dp));
    for(int i = 1; i <= n; i++)
        cin >> high[i];

    dp[1] = 0;
    for(int i = 2; i <= n; i++) {
        dp[i] = dp[i - 1] + abs(high[i - 1] - high[i]);
        for(int j = 1; j <= k&&j<i; j++) {
            dp[i] = min(dp[i], dp[i - j] + abs(high[i - j] - high[i]));
        }
    }
    cout << dp[n] << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <climits>

using namespace std;

#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)

//???
class Point {
public:
    double x, y;
    
    Point (double x = 0, double y = 0):x(x), y(y){}
    Point operator + (Point p){return Point(x + p.x, y + p.y);}
    Point operator - (Point p){return Point(x - p.x, y - p.y);}
    Point operator * (double a){return Point(a * x, a * y);}
    Point operator / (double a){return Point(x / a, y / a);}
    
    double norm(){return x*x + y*y;};
    double absolute(){return sqrt(norm());};
    
    bool operator < (const Point &p) const{
        return x != p.x ? x < p.x : y < p.y;
    }
    
    bool operator == (const Point &p) const{
        return equals(x, p.x) && equals(y, p.y);
    }
    
};
typedef Point Vector;                               //????????????
typedef struct Segment{Point p1, p2;}Segment;       //??????
//????????????a????????????
double norm(Vector a){
    return a.x * a.x + a.y * a.y;
}

//????????????a,b?????????
double dot(Vector a, Vector b){
    return a.x * b.x + a.y * b.y;
}

//??????s(p1p2)???????????????p????°???±
Point project(Segment s, Point p){
    Vector base = s.p2 - s.p1;
    double r = dot(p - s.p1, base) / norm(base);
    return s.p1 + base * r;
}

//??????s(p1p2)???????§°?????¨?????????p???????±????
Point reflect(Segment s, Point p){
    return p + (project(s, p) - p) * 2.0;
}


int main(){
    
    int x0, y0, x1, y1, x2, y2;
    
    int q;
    
    cin >> x0 >> y0 >> x1 >> y1;
    cin >> q;
    
    Segment s = {Point(x0, y0), Point(x1, y1)};
    
    for (int i = 0; i < q; i++) {
        cin >> x2 >> y2;
        Point p2 = Point(x2, y2);
        
        Point ans = reflect(s, p2);
        
        printf("%.8lf %.8lf\n", ans.x, ans.y);
    }

    
    return 0;
}

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

using namespace std;

int main() {

	string S;
	int ans = 0;

	cin >> S;

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

		if (S[i] == '+')
			ans++;

		else
			ans--;

	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
//Arayi
//#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <vector>
#include <cstring>
#include <ctime>
#include <set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <ctime>
#include <climits>
#include <cassert>
#include <chrono>
#include <random>
#include <complex>

#define fr first
#define sc second
#define MP make_pair
#define ad push_back
#define PB push_back
#define fastio ios_base::sync_with_stdio(false); cin.tie(0);
#define lli long long int
#define y1 arayikhalatyan
#define j1 jigglypuff
#define ld long double
#define itn int
#define pir pair<int, int> 
#define all(x) (x).begin(), (x).end()
#define str string
#define enl endl
#define en endl
#define cd complex<long double>
#define vcd vector<cd>
#define vii vector<int>
#define vlli vector<lli>
using namespace std;

lli gcd(lli a, lli b) { return (b == 0LL ? a : gcd(b, a % b)); }
ld dist(ld x, ld y1, ld x2, ld y2)
{
    return sqrt((x - x2) * (x - x2) + (y1 - y2) * (y1 - y2));
}
lli S(lli a)
{
    return (a * (a + 1LL)) / 2;
}
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
char vow[] = { 'a', 'e', 'i', 'o', 'u' };
int dx[] = { 1, -1, 0, 0, -1, -1, 1, 1, 0 };
int dy[] = { 0, 0, 1, -1, -1, 1, -1, 1, 0 };


const int N = 2e5 + 30;
const lli mod = 36000;
const ld pi = acos(-1);
const int T = 238;
const ld e = 1e-13;

lli bp(lli a, lli b = mod - 2LL)
{
    lli ret = 1;
    while (b)
    {
        if (b & 1) ret *= a, ret %= mod;
        a *= a;
        a %= mod;
        b >>= 1;
    }
    return ret;
}
ostream& operator<<(ostream& c, pir a)
{
    c << a.fr << " " << a.sc;
    return c;
}
struct pt
{
    lli x, y;
    int ind;
    int bl;
    bool operator==(const pt& a)
    {
        return ind == a.ind;
    }
    bool operator<(const pt& b)
    {
        if (x == b.x) return y < b.y;
        return x < b.x;
    }
};




int a[N];
int n;
int main()
{
    fastio;
    for (int x = 1; x <= 100; x++)
    {
        for (int y = 1; y <= 100; y++)
        {
            for (int z = 1; z <= 100; z++)
            {
                a[x * x + y * y + z * z + x * y + x * z + y * z]++;
            }
        }
    }
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cout << a[i + 1] << endl;
    }
    return 0;
}

/*


  __
*(><)*
  \/ /
  ||/
--||
  ||
  /\
 /  \
/    \
*/

Measured memory_bytes: 3784
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using Debug;
//using static System.Globalization.CultureInfo;
//using Edge = Pair<long, int>;
using System.Text;
class Program
{ 
    static void Main(string[] args)
    {
        Solve();
        //WriteLine(Solve());
    }
    static void Solve()
    {
        var num = Input.num;
        var ar = Input.ar;
        var m = Input.num;
        var ts = Input.ar; var ct = new Dictionary<int, int>();
        for (var i = 0; i < num; i++)
            if (ct.ContainsKey(ar[i])) ct[ar[i]]++;
            else ct.Add(ar[i], 1);
        foreach (var t in ts)
        {
            if (!ct.ContainsKey(t) || ct[t] == 0) { WriteLine("NO"); return; }
            ct[t]--;
        }WriteLine("YES");
    }
    
}

public class Input
{
    public static string read => ReadLine().Trim();
    public static int[] ar => read.Split(' ').Select(int.Parse).ToArray();
    public  static int num => ToInt32(read);
    public static long[] arL => read.Split(' ').Select(long.Parse).ToArray();
    public  static long numL => ToInt64(read);
    public static char[][] gred(int h) 
        => Enumerable.Repeat(0, h).Select(_ => read.ToCharArray()).ToArray();
    public static int[] ar1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => num).ToArray();
    public static long[] arL1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => numL).ToArray();
    public static int[][] ar2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => ar).ToArray();
    public static long[][] arL2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => arL).ToArray();
    public static T getValue<T>(string g)
    {
        var t = typeof(T);
        if (t == typeof(int))
            return (T)(object)int.Parse(g);
        if (t == typeof(long))
            return (T)(object)long.Parse(g);
        if (t == typeof(string))
            return (T)(object)g;
        if (t == typeof(char))
            return (T)(object)char.Parse(g);
        if (t == typeof(double))
            return (T)(object)double.Parse(g);
        if (t == typeof(bool))
            return (T)(object)bool.Parse(g);
        return default(T);
    }
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}


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

int main(){
    string s;
    cin >> s;
    if(s=="SUN")cout << 7;
    if(s=="MON")cout << 6;
    if(s=="TUE")cout << 5;
    if(s=="WED")cout << 4;
    if(s=="THU")cout << 3;
    if(s=="FRI")cout << 2;
    if(s=="SAT")cout << 1;

}

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

using namespace std;

int main(void) {
  int N;
  cin >> N;
  string A, B, C;
  cin >> A >> B >> C;
  int c = 0;
  for (int i = 0; i < N; i++) {
    if (A[i] == B[i] && A[i] == C[i]) {
      
    } else if ((A[i] == B[i] && A[i] != C[i]) || (B[i] == C[i] && A[i] != B[i]) || (A[i] == C[i] && A[i] != B[i])) {
      c++;
    } else {
      c += 2;
    }
  }
  cout << c << endl;
  return 0;
}


Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  a,b=LI()
  return max(0,a-2*b)

# main()
print(main())


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

vector<ll> f(const vector<ll> &a) {
	const int n = (int) a.size();
	vector<ll> dp(n + 1, 0);
	ll sum = 0;
	for (int i = 1; i <= n; ++i) {
		const ll x = a[i - 1];
		sum += x;
		dp[i] = min(sum, dp[i - 1] + (x - 2 < 0 ? 2 - x : x & 1));
	}
	return dp;
}

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

	int n;
	cin >> n;
	vector<ll> a(n);
	for (ll &x : a)
		cin >> x;

	vector<ll> dp = f(a);

	for (int i = 1; i <= n; ++i) {
		const ll x = a[i - 1];
		dp[i] = min(dp[i], dp[i - 1] + (x == 0 ? 1 : (x - 1) & 1));
	}

	reverse(a.begin(), a.end());
	vector<ll> dp2 = f(a);

	ll ans = 1LL << 60;
	for (int i = 0; i <= n; ++i) {
		ans = min(ans, dp[i] + dp2[n - i]);
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 5504