akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class Main {
	static boolean[] vis;
	static PriorityQueue<Integer> list;
	static ArrayList<Integer>[] adj;
	static int[] v;

	static void go(int node) {
		vis[node] = true;
		list.add(v[node]);
		for (int x : adj[node]) {
			if (!vis[x])
				go(x);
		}
	}

	public static void main(String[] args) {
		InputReader r = new InputReader(System.in);
		int n = r.nextInt();
		int m = r.nextInt();
		v = new int[n];
		for (int i = 0; i < v.length; i++) {
			v[i] = r.nextInt();
		}
		adj = new ArrayList[n];
		vis = new boolean[n];
		for (int i = 0; i < adj.length; i++) {
			adj[i] = new ArrayList<Integer>();
		}
		for (int i = 0; i < m; i++) {
			int from = r.nextInt();
			int to = r.nextInt();
			adj[from].add(to);
			adj[to].add(from);
		}
		PriorityQueue<Integer> all = new PriorityQueue<Integer>();
		int components = 0;
		long res = 0;
		for (int i = 0; i < adj.length; i++) {
			if (!vis[i]) {
				components++;
				list = new PriorityQueue<Integer>();
				go(i);
				res += list.poll();
				for (int x : list)
					all.add(x);
			}
		}
		if (components == 1) {
			System.out.println(0);
			return;
		}
		if (all.size() < components - 2) {
			System.out.println("Impossible");
			return;
		}
		for (int i = 0; i < components - 2; i++)
			res += (long) all.poll();
		System.out.println(res);
	}

	static class InputReader {
		private BufferedReader reader;
		private StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}

		public InputReader(FileReader stream) {
			reader = new BufferedReader(stream);
			tokenizer = null;
		}

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
		}

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

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

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

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


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


int main() {
    int N;
    cin >> N;
    int sum = 0;
    
    int first, second;
    
    for(int i = 0; i < N; i++){
        cin >> first >> second;
        sum += (second - first) + 1;
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
open System
open System.Collections.Generic
open System.Linq
open System

// Following contents are my library. The Main processes are on the bottom of this code.

let puts = Console.WriteLine : 'a -> unit
let put = Console.Write : 'a -> unit
let Read() = Console.ReadLine()
let Reads () = Console.ReadLine().Split()
let ReadInt () = Read() |> int
let ReadDouble () = Reads() |> (fun x -> x.[0], x.[1])
let ReadTriple () = Reads() |> (fun x -> x.[0], x.[1], x.[2])
let ReadQuadruple () = Reads() |> (fun x -> x.[0], x.[1], x.[2], x.[3])
let FuncDouble f1 f2 (t1, t2) = (f1 t1, f2 t2)
let FuncTriple f1 f2 f3 (t1, t2, t3) = (f1 t1, f2 t2, f3 t3)
let FuncQuadruple f1 f2 f3 f4 (t1, t2, t3, t4) = (f1 t1, f2 t2, f3 t3, f4 t4)

let ReadIntQuadruple () = ReadQuadruple() |> FuncQuadruple int int int int
let ReadIntTriple () = ReadTriple () |> FuncTriple int int int
let ReadIntDouble () = ReadDouble () |> FuncDouble int int
let ensmallen l = l % 1000000007L
let manhattan x y = abs (fst x - fst y) + abs (snd x - snd y)
let sayYESNO b = if b then puts "YES" else puts "NO"


// The main contents of this submission are below this line.

let a, b, c, d = ReadIntQuadruple()
let l = min b d - max a c
if l <= 0 then puts 0 else puts l


Measured memory_bytes: 11220
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iomanip>
#include <vector>
#include <cstdio>
#include <float.h>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <stack>
#include <functional>
 
using namespace std;
 
#define endl '\n'
#define MOD 1000000007
#define INF 1ll<<30
#define MAX 100010
#define eps 1e-11
#define bit_max 1ll<<32
#define _USE_MATH_DEFINES



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
 //   freopen("input.txt","r",stdin);
   // freopen("output.txt","w",stdout);
    int n;
    cin>>n;
    long long int cost[n],a[n];
    for(int i=0;i<n;i++)
    {
    	cin>>a[i];
    	cost[i] = 0;
    }
    cost[0]=0;
    cost[1] = cost[0]+abs(a[1]-a[0]);
    for(int i=2;i<n;i++)
    {
    	cost[i] = min(cost[i-1]+abs(a[i]-a[i-1]), cost[i-2]+abs(a[i]-a[i-2]));
    }
    cout<<cost[n-1]<<endl;
 	
    

	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-9;

bool isPrime(ll x){
    ll i;
    if(x < 2)return 0;
    else if(x == 2) return 1;
    if(x%2 == 0) return 0;
    for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0;
    return 1;
}

signed main(void)
{
    string s;
    cin >> s;
    map <ll, ll> mp;
    
    rep(i, 4) {
        mp[s[i]] ++;
        if (mp[s[i]] > 2) {
            mes("No");
            re0;
        }
    }
    if (mp.size() != 2) {
        mes("No");
        re0;
    }
    mes("Yes");
    
    
}

Measured memory_bytes: 3592
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Joy
 */

#include <bits/stdc++.h>
#define REP(i, N) for (ll i = 0; i < (N); ++i)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define INF 1e9
#define INFL 1e18
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

class EGetEverything {
public:
	void solve(std::istream& in, std::ostream& out) {
        int N, M;
        in >> N >> M;
        ll a[M];
        int c[M] = {};
        REP(i, M) {
            in >> a[i];
            int b;
            in >> b;
            REP(j, b) {
                int x;
                in >> x;
                x--;
                c[i] |= (1<<x);
            }
        }
//        REP(i, M) out << a[i] << ' ';
//        out << '\n';
//        REP(i, M) out << c[i] << ' ';
//        out << '\n';
        vector<vector<ll>> dp(M+1, vector<ll>((1<<N), INF));
        dp[0][0] = 0;
        for (int i = 0; i < M; i++) {
            for (int j = 0; j < (1<<N); j++) {
                if (dp[i][j] == INF) continue;
                dp[i+1][j] = min(dp[i+1][j], dp[i][j]);
                dp[i + 1][j | c[i]] = min(dp[i+1][j|c[i]], min(dp[i][j | c[i]], dp[i][j] + a[i]));
            }
        }
//        REP(i, M+1) {
//            REP(j, (1<<N)) {
//                out << dp[i][j] << ' ';
//            }
//            out << '\n';
//        }
        if (dp[M][(1<<N)-1] == INF) dp[M][(1<<N)-1] = -1;
        out << dp[M][(1<<N) - 1] << '\n';
	}
};


int main() {
	EGetEverything solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 32384
EPS = 10**(-10)

N = int(input())
points = [list(map(float,input().split())) for _ in range(N)]

def dist(p0,p1):
    x0,y0 = p0
    x1,y1 = p1
    return ((x1-x0)**2+(y1-y0)**2)**0.5

def canMakeRectangle(p0,p1,p2):
    x0,y0 = p0
    x1,y1 = p1
    x2,y2 = p2
    if abs((y1-y0)*(x2-x0)-(y2-y0)*(x1-x0))<EPS:
        return False
    else:
        return True

def circumcircle(p0,p1,p2):
    x0,y0 = p0
    x1,y1 = p1
    x2,y2 = p2
    l0,l1,l2 = dist(p1,p2),dist(p2,p0),dist(p0,p1)
    r = l0*l1*l2/(((l0+l1+l2)*(-l0+l1+l2)*(l0-l1+l2)*(l0+l1-l2))**0.5)
    a = ((l0**2)*(l1**2+l2**2-l0**2)*x0+(l1**2)*(l2**2+l0**2-l1**2)*x1+(l2**2)*(l0**2+l1**2-l2**2)*x2)/((l0**2)*(l1**2+l2**2-l0**2)+(l1**2)*(l2**2+l0**2-l1**2)+(l2**2)*(l0**2+l1**2-l2**2))
    b = ((l0**2)*(l1**2+l2**2-l0**2)*y0+(l1**2)*(l2**2+l0**2-l1**2)*y1+(l2**2)*(l0**2+l1**2-l2**2)*y2)/((l0**2)*(l1**2+l2**2-l0**2)+(l1**2)*(l2**2+l0**2-l1**2)+(l2**2)*(l0**2+l1**2-l2**2))
    return r,a,b

def circle(p0,p1):
    x0,y0 = p0
    x1,y1 = p1
    r = dist(p0,p1)/2
    a = (x1-x0)/2+x0
    b = (y1-y0)/2+y0
    return r,a,b

def check(c,P):
    r,a,b = c
    for p in P:
        if dist((a,b),p) > r+EPS:
            return False
    return True

ans = float('inf')

for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if canMakeRectangle(points[i],points[j],points[k]):
                r,a,b = circumcircle(points[i],points[j],points[k])
                if check((r,a,b),points):
                    ans = min(ans,r)

for i in range(N-1):
    for j in range(i+1,N):
        r,a,b = circle(points[i],points[j])
        if check((r,a,b),points):
            ans = min(ans,r)

print(ans)

Measured memory_bytes: 58712
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF (1 << 30 - 1)
#define LLINF (1LL << 60)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

signed main() {
    cin >> N;
    vi a(N);
    cin >> a;
    map<int, int> mp;
    REP(i, N) {
        if (a[i] >= 3200)
            a[i] = 3200;
        mp[a[i] / 400]++;
    }
    int size = mp.size();
    int n = ((mp[8] > 0) ? size - 1 : size);
    dump(mp, size, n);
    int mn = n == 0 ? 1 : n;
    int mx = n + mp[8];
    cout << mn << " " << mx << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mod 1000000007
#define djfs first
#define akdk second
#define N 100000000
#define fo(i,m,n) for(int i=m;i<n;i++)
#define M 7
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
using ll=long long;
using ul=unsigned long long;
using pii=pair<int,int>;
using vvi=vector<vector<int>>;
using vi=vector<int>;
using pll=pair<ll,ll>;
using vsi=vector<set<int>>;
using vll=vector<ll>;

ll power(ll a,ll n){
    ll j=0;
    ll x=1;
    while(1ll<<j<=n){
        if(1ll<<j&n)
            x=(x*a)%mod;

        a=a*a%mod;
        j++;
    }

    return x;
}

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

int lb(vi &a,int x){
    int n=a.size();
    int l=0;
    int r=n-1;
    int ind=-1;
    while(l<=r){
        int mid=(l+r)/2;
        if(x>=a[mid]){
            l=mid+1;
            ind=mid;
        }
        else
            r=mid-1;

    }

    return ind+1;

}

int up(vll &a,ll x){
    int n=a.size();
    int l=0;
    int r=n-1;
    int ind=-1;

    while(l<=r){
        int mid=(l+r)/2;
        if(a[mid]>x){
            r=mid-1;
            ind=mid;
        }
        else
            l=mid+1;

    }

    return ind;
}

ll max(ll a,ll b){
    if(a>b)
        return a;
    else
        return b;

}

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

}

void yn(bool a){
    if(a)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;

}


bool isodd(int a,int b,int agx,int agy){

    return (abs(a-agx)+abs(b-agy))%2;

}
int fap(vi &par,int x){
    if(par[x]!=x)
        par[x]=fap(par,par[x]);

    return par[x];
}

void unin(vi &par,vi &rank,int x,int y){
    int px=fap(par,x);
    int py=fap(par,y);

    if(px!=py){
        if(rank[px]<rank[py])
            swap(px,py);

        par[py]=px;
        rank[px]+=rank[py];
    }
}

struct fenwick_tree
{
    vll bit;
    int n;
    fenwick_tree(int n){
        this->n=n;
        bit=vll(n+1);
    }

    void update(int idx,ll val){
        while(idx<=n){
            bit[idx]+=val;
            idx+=idx&-idx;
        }
    }

    void rupdate(int l,int r,int x){
        update(l,x);
        update(r+1,-x);
    }

    ll query(int idx){
        ll tot=0;
        while(idx){
            tot+=bit[idx];
            idx-=idx&-idx;
        }

        return tot;
    }

};


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

    cout<<!x<<endl;


}


Measured memory_bytes: 3624
N, A, B, C = map(int, input().split())
L = [0]*N
for i in range(N):
    L[i] = int(input())
INF = 10 ** 9


def dfs(times, a, b, c):  
    if times == N:
        return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
    no_pattern = dfs(times + 1, a, b, c)
    a_pattern = dfs(times + 1, a + L[times], b, c) + 10
    b_pattern = dfs(times + 1, a, b + L[times], c) + 10
    c_pattern = dfs(times + 1, a, b, c + L[times]) + 10

    return min(no_pattern, a_pattern, b_pattern, c_pattern)


print(dfs(0,0,0,0))

Measured memory_bytes: 9068
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
  int K;
  string S;
  cin >> K >> S;
  if(S.size() <= K){
    cout << S;
  }
  else{
    for(int i=0;i<K;i++){
      cout << S.at(i);
    }
    cout <<"..." << endl;
  }
 
}

Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
	int n;
	scanf("%d", &n);
	int* input = (int*)malloc(n * sizeof(int));
	for (int i = 0; i < n; i++)
	{
		scanf("%d", input + i);
	}
	int cnt = 1, last = input[0];
	for (int i = 1; i < n; i++)
	{
		if (input[i] <= last)
		{
			cnt++;
			last = input[i];
		}
	}
	printf("%d", cnt);
}

Measured memory_bytes: 896
def main():
    import sys

    input = sys.stdin.readline
    N = int(input())
    prev = 0
    x = 0
    y = 0

    for i in range(N):
        a, b, c = map(int, input().split())
        dis = abs(b - x) + abs(c - y)
        diff = a - prev
        if diff >= dis and diff % 2 == dis % 2:
            prev = a
            x = b
            y = c
        else:
            print("No")
            exit(0)
    print("Yes")


main()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define ll long long
using namespace std;
void solve()
{
	int a,b,c;
	cin>>a>>b>>c;
	int x=a;
	a=c;
	c=b;
	b=x;
	cout<<a<<" "<<b<<" "<<c;
}
int main()
{
//	int t;cin>>t;
//	while(t--)
	solve();
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <iomanip>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <stdexcept>
#include <algorithm>
#include <set>
#include <map>
#include <stdlib.h>
using namespace std;
int main(){
    string S;
    cin >> S;
    if(S == "SSS"){
        cout << "0" << endl;
    }
    else if (S == "SSR")
    {
        cout << "1" << endl;
    }
    else if (S == "SRS")
    {
        cout << "1" << endl;
    }
    else if (S == "SRR")
    {
        cout << "2" << endl;
    }
    else if (S == "RSS")
    {
        cout << "1" << endl;
    }
    else if (S == "RSR")
    {
        cout << "1" << endl;
    }
    else if (S == "RRS")
    {
        cout << "2" << endl;
    }
    else if (S == "RRR")
    {
        cout << "3" << endl;
    }
}

Measured memory_bytes: 3596
#include <stdio.h>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <iomanip>

#define rep(i,a,b) for(long long i=a;i<b;i++)

using namespace std;
int combination(int n, int r)
{
	if (r == 0 || r == n)
		return (1);
	else if (r == 1)
		return (n);
	return (combination(n - 1, r - 1) + combination(n - 1, r));
}

int main(void) {

	long long N=0,A=0,B=0;
	
	long long c = 0;
	cin >> A>>B;

	c = B - A;

	rep(i,1,c+1){
	
		N += i;

		
		
	}
	
	
	cout << N-B << endl;

	

	return 0;

}


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

int main()
{
    int n;
    long double a, ans = 0;
    cin >> n;
    rep (i, n)
    {
        cin >> a;
        ans += (long double)1 / a;
    }

    ans = (long double)1 / ans;
    cout << ans << endl;
    return 0;
}

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

fib = []
ans = 0
for i in range(n+1):
    if i == 0 or i == 1:
        ans = 1
        fib.append(ans)
    else:
        ans = fib[i-1] + fib[i-2]
        fib.append(ans)

print(ans)


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

int main() {
  int n;cin>>n;
  for(int i=1;i<=n;i++){
    int ans=i*1.08;
    if(ans==n){
      cout<<i<<endl;
      return 0;
    }
  }
  cout<<":("<<endl;
}

Measured memory_bytes: 3596
#include<cstdio>
#include<cstring>
#include<queue>
using namespace std;
#define ll long long
inline char tc(void){
	static char fl[10000],*A=fl,*B=fl;
	return A==B&&(B=(A=fl)+fread(fl,1,10000,stdin),A==B)?EOF:*A++;
}
inline ll read(void){
	ll a=0,f=1;static char c;
	while((c=tc())<'0'||c>'9')c=='-'?f=-1:0;
	while(c>='0'&&c<='9')a=a*10+c-'0',c=tc();
	return a*f;
}
ll n,dps,aoe,hp[100005];
bool check(ll x){
	ll sum=x;
	for(int i=1;i<=n;++i){
		if(hp[i]>1ll*aoe*x)
			sum-=(hp[i]-aoe*x-1)/dps+1;
	}
	return sum>=0;
}
int main(void){
	ll i,l=0,r=1e9+10,mid;
	n=read(),dps=read(),aoe=read(),dps-=aoe;
	for(i=1;i<=n;++i)
		hp[i]=read();
	while(l<=r){
		mid=l+r>>1;
		if(!check(mid))l=mid+1;
		else r=mid-1;
	}
	printf("%lld",l);
	return 0;
}

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

signed main() {
  int n,k;
  cin >> n >> k;

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

  for (int i = k + 1; i <= n; i++) {
    if(a[i] > a[i - k]) {
      cout << "Yes" << '\n';
    } else {
      cout << "No" << '\n';
    }
  }

}

Measured memory_bytes: 4828
//package april2020;

import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

public class Main {
	static long[] dp;
	static int n,k, a[];
	static long MOD = (long)1e9+7;
	public static void main(String[] args) throws IOException {
		FastReader scn = new FastReader();
		OutputStream out = new BufferedOutputStream ( System.out );
		n = scn.nextInt();
		a = new int[n];
		long[] ps = new long[n];
		for(int i =0;i<n;i++) {
			a[i] = scn.nextInt();
			if(i>0)
				ps[i]=ps[i-1]+a[i];
			else
				ps[i]=a[i];
		}
		long[][] dp = new long[n][n];
		
//		for(int i=1;i<n;i++) {
//			dp[i][i]=0;
//		}
		for(int l=n-1;l>=0;l--) {
			for(int r=l;r<n;r++) {
				if(l==r) {
					dp[l][r]=0;
				}else {
					dp[l][r] = Long.MAX_VALUE;
					for(int i=l;i<=r-1;i++) {
						dp[l][r] = Math.min(dp[l][r], dp[l][i]+dp[i+1][r]+ps[r]-((l==0)?0:ps[l-1]));
					}
				}
			}
		}
		out.write((dp[0][n-1]+"\n").getBytes());
		out.close();
	}
	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
}


Measured memory_bytes: 23892
import java.io.IOException;
import java.util.NoSuchElementException;

import java.io.InputStream;

@SuppressWarnings("unchecked")
public class Main {
    public static void main(String[] args) throws IOException {
        FastScanner fs = new FastScanner();

        final int N = fs.nextInt();

        if (N == 2) {
            int A = fs.nextInt();
            int B = fs.nextInt();
            System.out.println(A + B);
        } else {
            System.out.println("Hello World");
        }
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
        if (hasNextByte()) return buffer[ptr++];
        else return -1;
    }
    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
        while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
        return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if(b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 21844
#include <cstdio>
using namespace std;

int main()
{
	double n;
	int cnt = 0;
	
	scanf("%lf", &n);
	while (n >= 1){
		cnt++;
		if (n == 3){
			break;
		}
		n /= 3;
	}
	
	printf("%d\n", cnt);
	
	return 0;
}

Measured memory_bytes: 1052
#define _USE_MATH_DEFINES
#define INF 100000000
#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair <int,int> P;

static const double EPS = 1e-8;

int main(){
  int agent_num;
  while(~scanf("%d",&agent_num)){
    if(agent_num == 0) break;
    vector<int> agent_info[101];
    for(int i=1;i<=agent_num;i++){
      int node_num;
      scanf("%d",&node_num);
      
      int to_node;
      for(int j=0;j<node_num;j++){
	scanf("%d",&to_node);
	agent_info[i].push_back(to_node);
      }
    }
    int leaked_num;
    int leak[101];
    scanf("%d",&leaked_num);
    for(int j=0;j<leaked_num;j++){
      scanf("%d",leak+j);
    }

    int criminal_num = 0;
    int criminal_idx = 0;
    for(int i=1;i<=agent_num;i++){
      int count = 0;
      for(int j=0;j<agent_info[i].size();j++){
	for(int k=0;k<leaked_num;k++){
	  if(leak[k] == agent_info[i][j]){
	    count++;
	    break;
	  }
	}
	
      }
      if(count >= leaked_num){
	criminal_idx = i;
	criminal_num++;
      }
    }

    printf("%d\n",criminal_num != 1 ? -1: criminal_idx);
  }
}

Measured memory_bytes: 1256
/**
	Language: C++
	Author  : 21
**/

#include <bits/stdc++.h>

using namespace std;

#define FastIO() ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define Debug(v) cerr << '\n' << #v << ":\t" << v << '\n'

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< ii > vii;

int main() {
	FastIO();
	string s;
	cin >> s;
	if (s == "ABC") cout << "ARC";
	else cout << "ABC";
	cout << '\n';
	return 0;
}


Measured memory_bytes: 3652
/**
 * Author RDP
 * 
**/
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <bitset>
#define endl '\n'
#define bp(x) __builtin_popcount(x)
#define zf(x) __builtin_clz(x)
#define zl(x) __builtin_ctz(x)
#define par(x) __bultin_parity(x)
#define FAST_IO ios::sync_with_stdio(0); std::cin.tie(0);
typedef long long ll;
using namespace std;

void test_case()
{
    FAST_IO
    ll n,k;
    cin >> n >> k;
    if( n < k)
    {
        cout << min(n , abs(n - k)) <<endl;
    }
    else if( n%k == 0)
    {
        cout << '0' <<endl;
    }
    else 
    {
        cout << ((n/k) + 1 ) * k - n <<endl;
    }
    return ;
}
int main()
{
    FAST_IO
    test_case();
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
int main()
{
  int n, k;
  cin>>n>>k;
  int a[n+1];
  for(int i=1;i<=n;i++) cin>>a[i];
  long long int dp[n+1][k+1];
  for(int i=0;i<=n;i++) dp[i][0]=1;
  for(int j=1;j<=k;j++) dp[0][j]=1;
  for(int i=1;i<=n;i++) for(int j=1;j<=k;j++) dp[i][j]=(dp[i][j-1]+dp[i-1][j]-((j>a[i])?dp[i-1][j-a[i]-1]:0))%mod;
  cout<<(dp[n][k]-((k>0)?dp[n][k-1]:0)+mod)%mod;
}

Measured memory_bytes: 82412
X = int(input())
for A in range(-118, 120):
    for B in range(-119, 119):
        if 1 <= pow(A, 5) - pow(B, 5) and A - B >= 1:
            if pow(A, 5) - pow(B, 5) == X:
                print(A, B)
                exit()

Measured memory_bytes: 67516
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int n,a[1<<18],h[1<<18];
ll tot;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",a+i),h[a[i]]++;
	for(int i=1;i<=n;i++)tot+=1ll*h[i]*(h[i]-1)/2;
	for(int i=1;i<=n;i++)printf("%lld\n",tot-(h[a[i]]-1));
	return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using ld = long double;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const long double PI = acos(-1.0L);
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
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; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int x, a, b;
  cin >> x >> a >> b;
  if (abs(x-a) < abs(x-b))
    cout << 'A' << endl;
  else
    cout << 'B' << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

const int MAX_N = 50;
const int MAX_M = 50;
int N, M;
int a[MAX_N], b[MAX_N];
int c[MAX_M], d[MAX_M];

void _main() {
  cin >> N >> M;
  rep(i, 0, N) cin >> a[i] >> b[i];
  rep(i, 0, M) cin >> c[i] >> d[i];

  rep(i, 0, N) {
    int max = inf;
    int ans = 0;
    rep(j, 0, M) {
      int tmp = abs(c[j]-a[i]) + abs(d[j]-b[i]);
      if (tmp < max) {
        max = tmp;
        ans = j;
      }
    }
    cout << (ans + 1) << "\n";
  }
}

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

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int n = sc.NextInt();

        int answer = 800 * n - 200 * (n / 15);

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 11092
#include <algorithm>
#include <string.h>
#include <iostream>
#include <stdio.h>

using namespace std;

typedef long long ll;
ll a, b, c, k;

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

	if (k <= a) {
		cout << k << endl;
	}
	else if (k <= a + b) {
		cout << a << endl;
	}
	else {
		cout << a - (k - a - b) << endl;
	}

	return 0;
}

Measured memory_bytes: 3600
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cctype>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<cstring>
//#include<windows.h>
//#include<time.h>
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define mer make_pair
#define mme memset
using namespace std;

const double pie1=3.1415926;//π1
const double pie2=3.14159265358979;//π2
const double pie3=3.14159265358979323846;//π3
const int vbi=999999999;
const int vli=-vbi;
const long long vbl=999999999999999999;
const long long vll=-vbl;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<pii,int> piii;
typedef pair<pii,pii> pi4;
typedef pair<pll,ll> plll;
typedef pair<int,pii> ipii;
typedef pair<ll,pll> lpll;
typedef pair<pll,pll> pl4;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef set<int> sti;
typedef set<ll> stl;
typedef set<pii> spi;
typedef set<pll> spl;
priority_queue<int> pqi;
priority_queue<ll> pql;
queue<int> qi;
queue<ll> ql;

/*void bin_v(){
	char bin[1000];
	gets(bin);
}*/

bool pss(int a){
	for(int i=2;i<=sqrt(a);i++)
		if(a%i==0)
			return false;
	return true;
}
/////////////////////////////////////////////////////////////////////////////////////////

int main(){
	//my name is Veex
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	int a[n+10];
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	ll sum=0;
	for(int i=1;i<=n;i++){
		if(a[i]==0)
			continue;
		else if(a[i+1]==0||i==n)
			sum+=a[i]/2;
		else{
			if(a[i]%2==1){
				a[i]--;
				a[i+1]--;
				sum++;
			}
			sum+=a[i]/2;
			a[i]=0;
		}
//			cout<<i<<' '<<sum<<endl;
	}
	cout<<sum;
	return 0;
}


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

using namespace std;

template<typename S, typename T>
ostream& operator<<(ostream& out, const pair<S, T> p) {
    out << "(" << p.first << "," << p.second << ")";
    return out;
}

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
    for (auto a: v)
        out << a << " ";
    return out;
}

template<typename T>
ostream& operator<<(ostream& out, const set<T>& S) {
    for (auto a: S)
        cout << a << " ";
    return out;
}

template<typename T>
ostream& operator<<(ostream& out, const multiset<T>& S) {
    for (auto a: S)
        cout << a << " ";
    return out;
}

template<typename S, typename T>
ostream& operator<<(ostream& out, const map<S, T>& M) {
    for (auto m: M)
        cout << "(" << m.first << "->" << m.second << ") ";
    return out;
}

template<typename S, typename T>
pair<S, T> operator+(pair<S, T> a, pair<S, T> b) {
    return make_pair(a.first + b.first, a.second + b.second);
}

template<typename S, typename T>
pair<S, T> operator-(pair<S, T> a, pair<S, T> b) {
    return make_pair(a.first - b.first, a.second - b.second);
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n, m;
    vector<pair<int, int>> A;
    vector<vector<int>> B;
    cin >> m >> n;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        A.emplace_back(a - 1, b);
    }
    // cout << "A: " << A << endl;
    B.resize(m);
    for (int i = 0; i < m; i++)
        B[i].clear();
    for (int i = 0; i < n; i++)
        B[A[i].first].push_back(A[i].second);
    for (int i = 0; i < m; i++)
        sort(B[i].begin(), B[i].end());
    // cout << "B: " << B << endl;
    for (int i = 0; i < n; i++) {
        int p = lower_bound(B[A[i].first].begin(), B[A[i].first].end(), A[i].second) - B[A[i].first].begin();
        cout << setfill('0') << setw(6) << A[i].first + 1 << setfill('0') << setw(6)  << p + 1 << endl;
    }

    return 0;
}


Measured memory_bytes: 7796
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

int main() {
    int W[10], K[10];
    for (int i = 0; i < 10; i++) {
        cin >> W[i];
    }
    for (int i = 0; i < 10; i++) {
        cin >> K[i];
    }
    sort(W, W+10, greater<int>());
    sort(K, K+10, greater<int>());
    cout << W[0] + W[1] + W[2] << ' ';
    cout << K[0] + K[1] + K[2] << endl;
    return 0;
}

Measured memory_bytes: 0
#include <cstdio>
#include <cassert>
#include <vector>
#include <algorithm>

std::vector <std::pair <double, double> > list;

double l, m, r;

inline std::pair <double, double> operator + (std::pair <double, double> a, std::pair <double, double> b)
{
	return std::make_pair(a.first + b.first, a.second + b.second);
}

inline std::pair <double, double> operator - (std::pair <double, double> a, std::pair <double, double> b)
{
	return std::make_pair(a.first - b.second, a.second - b.first);
}

inline std::pair <double, double> inter(std::pair <double, double> a, std::pair <double, double> b)
{
	return std::make_pair(std::max(a.first, b.first), std::min(a.second, b.second));
}

inline bool check(double x)
{
	std::pair <double, double> delta = std::make_pair(r * x, l * x);
	std::vector <std::pair <double, double> > tmp;
	bool flag = false;
	for (int i = 0; i < (int)list.size(); i ++)
	{
		std::pair <double, double> now = inter(list[i] + delta, std::make_pair(-m, m));
		if (now.first <= now.second)
		{
			flag = true;
			tmp.push_back(now);
		}
		now = inter(list[i] - delta, std::make_pair(-m, m));
		if (now.first <= now.second)
		{
			flag = true;
			tmp.push_back(now);
		}
	}
	list.clear();
	if (!flag)
		return false;
	std::sort(tmp.begin(), tmp.end());
	for (int i = 0; i < (int)tmp.size(); i ++)
	{
		double nowr = tmp[i].second;
		int r = i;
		while (r + 1 < (int)tmp.size() && tmp[r + 1].second <= nowr)
		{
			r ++;
			nowr = std::max(nowr, tmp[r].second);
		}
		list.push_back(std::make_pair(tmp[i].first, nowr));
		i = r;
	}
	return true;
}

int main()
{
	int n;
	scanf("%d%lf%lf%lf", &n, &l, &m, &r);
	assert(n <= 100);
	l /= 2;
	list.push_back(std::make_pair(0, 0));
	bool ans = true;
	for (int i = 1; i <= n; i ++)
	{
		double x;
		scanf("%lf", &x);
		if (ans)
			ans = check(x);
	}
	if (ans)
		puts("Yes");
	else
		puts("No");
	return 0;
}

Measured memory_bytes: 1084
#include <iostream>

using namespace std;

int main()
{
	for(int w=0;cin>>w,w!=-1;){
		int p=1150;
		w-=10; p+=max(min(w,10)*125,0);
		w-=10; p+=max(min(w,10)*140,0);
		w-=10; p+=max(w*160,0);
		cout<<4280-p<<endl;
	}
	return 0;
}

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

ll gcd(ll a, ll b){return b!=0 ? gcd(b, a%b) : a;}
ll lcm(ll a, ll b){return a / gcd(a, b) * b;}



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



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

using namespace std;

using ll = long long;

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

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

    int sum = std::accumulate(A.begin(), A.end(), 0);
    sort(A.begin(), A.end(), std::greater<int>());

    bool ans;
    if (double(A[M - 1]) < double(sum / (4.0 * M))) ans = false;
    else ans = true;

    cout << (ans ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String []args) throws IOException {
    	FastScanner in  = new FastScanner(System.in);
    	PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false);
    	solve(in, out);
    	in.close();
    	out.close();
    }
    static long gcd(long a, long b){ return (b==0) ? a : gcd(b, a%b); }
    static int gcd(int a, int b){ return (b==0) ? a : gcd(b, a%b); }
    static class FastScanner{
	BufferedReader reader;
	StringTokenizer st;
	FastScanner(InputStream stream){reader=new BufferedReader(new InputStreamReader(stream));st=null;}
	String next(){while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}
	     st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
	String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}
	int    nextInt()   {return Integer.parseInt(next());}
	long   nextLong()  {return Long.parseLong(next());}
	double nextDouble(){return Double.parseDouble(next());}
	char   nextChar()  {return next().charAt(0);}
	int[]  nextIntArray(int n)         {int[] arr= new int[n];   int i=0;while(i<n){arr[i++]=nextInt();}  return arr;}
	long[] nextLongArray(int n)        {long[]arr= new long[n];  int i=0;while(i<n){arr[i++]=nextLong();} return arr;}
	int[]  nextIntArrayOneBased(int n) {int[] arr= new int[n+1]; int i=1;while(i<=n){arr[i++]=nextInt();} return arr;}
	long[] nextLongArrayOneBased(int n){long[]arr= new long[n+1];int i=1;while(i<=n){arr[i++]=nextLong();}return arr;}
	void   close(){try{reader.close();}catch(IOException e){e.printStackTrace();}}
    }
    
    /********* SOLUTION STARTS HERE ************/
    
    private static void solve(FastScanner in, PrintWriter out){
        int n = in.nextInt();
        int r = in.nextInt();
        if(n>9) out.println(r);
        else out.println(r+100*(10-n));
        
    }
    
    /************* SOLUTION ENDS HERE **********/
}

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

typedef long long ll;
const ll INF = 1010000000000000017LL;
const ll MOD = 1000000007LL;

#define REP(i, n) for(ll i = 0 ; i < n; i++)

//#define DEBUG(fmt, ...)
#define DEBUG(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)

int main(){
    std::cout<<std::fixed<<std::setprecision(10);

    ll N;
    cin >> N;

    ll A = 0;
    vector<ll> G(N);
    vector<ll> K(N+1);
    for(int i = 1; i <= N; i++){
        ll v;
        cin >> v;
        A+=v;
        if((i)%2){
           // odd
           K[i] = ((i-2)>0 ? K[i-2] : 0) + v;
        }else{
           // even
           G[i] = ((i-2)>0 ? G[i-2] : 0) + v;
        }
    }
    A = A/2;

    for(int i = 1; i <= N; i++){
        ll ans = 0;
        if((i%2)){
            // odd
            ans = A - ( ((i-2)>0 ? K[i-2]:0) + G[N-1] - G[i-1] );
        }else{
            ans = A - ( ((i-2)>0 ? G[i-2]:0) + K[N] - K[i-1] );
        }
        cout << 2*ans << " ";
    }
    cout << endl;
}


Measured memory_bytes: 2944
Imports System.Collections.Generic
Imports System.Console
Module Program
    Sub Main()
        Dim tmp As String() = Console.ReadLine().Split(New Char() {","c})
        Dim a As String = tmp(0)
        Dim b As String = tmp(1)
        Dim c As String = tmp(2)
        Dim s As String = a +" "+ b +" "+ c
        Console.WriteLine(s)
    End Sub
End Module


Measured memory_bytes: 11092
#include <iostream>

int main(){
  int n;
  std::cin >> n;
  const int N = n;
  int a[N];
  int min = 0;
  for (int i = 0; i < N; i++){
    int count = 0;
    std::cin >> a[i];
    while (1){
      if (a[i] % 2 == 0){
        a[i] /= 2;
        count++;
      }else{
        if (min >= count | i == 0){
          min = count;
        }
        // std::cout << count << std::endl;
        break;
      }
    }
  }
  std::cout << min << std::endl;
  return 0;
}

Measured memory_bytes: 3564
#include <stdio.h>

int main(void){
  int data[]={1,0,0};
  int x,y,tmp;
  char a,b;

  while(1){
    scanf("%c,%c",&a,&b);
    if(feof(stdin))break;

    x=(int)a-'A';
    y=(int)b-'A';

    tmp=data[x];
    data[x]=data[y];
    data[y]=tmp;
  }
  if(data[0]==1){
    printf("A\n");
  }
  else if(data[1]==1){
    printf("B\n");
  }
  else{
    printf("C\n");
  }
  return(0);
}

Measured memory_bytes: 528
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
// #define mp make_pair
#define ff first
#define ss second
#define setbits(x) __builtin_popcount(x)
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll x, ll y, ll p)
{
    ll res = 1;     
    x = x % p;  
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
  
        y = y>>1;
        x = (x*x) % p;   
    } 
    return res; 
}
const ll MOD = 1000000007;
const int N = int(3e5) + 999;
// #define int long long int

map<int,int> mp;
int prime[1000005];

void spf(){
	int mx = 1000001;
	for(int i=2;i*i<=mx;i++){
		if(prime[i]==0)
			for(int j=i;j<=mx;j+=i){
				prime[j] = i;
			}
	}
	for(int i=1;i<=mx;i++)
		if(prime[i]==0)
			prime[i] = i;
}

int32_t main(){
    IOS;
    int n;
    spf();
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++){
    	int a;
    	cin>>a;
    	arr[i] = a;
    	while(a>1){
    		int cnt = 0;
    		int s = prime[a];
    		while(prime[a]==s){
    			cnt++;
    			a/=s;
    		}
    		mp[s]=max(mp[s],cnt);
    	}
    }
    ll num=1;
    for(auto it:mp){
    	num = num*power(it.ff,it.ss,MOD);
    	num%=MOD;
    }
    ll ans = 0;
    for(int i=0;i<n;i++){
    	ll tmp = 1;
    	tmp = num*power(arr[i],MOD-2,MOD);
    	tmp%=MOD;
    	ans+=tmp;
    	ans%=MOD;
    }
    cout<<ans<<endl;

    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int64_t abs(int64_t n) {
  if (n < 0) {
    n = -n;
  }
  return n;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}

int main() {
  string s;
  cin >> s;
  int tmp1 = 0, tmp2 = 0;
  rep(i, s.size()) {
    if (s.at(i) == '0') {
      tmp1++;
    } else {
      tmp2++;
    }
  }
  cout << min(tmp1, tmp2)*2 << endl;
}

Measured memory_bytes: 512
import math

A,B,H,M = map(int, input().split())

# 余弦定理を用いる
# ans^2 = A^2 + B^2 -2AB * math.cos(math.radians(rad))
rad = abs(H % 12 * 30 + 0.5 * M - M * 6)

if rad > 180:
  rad = 360 - rad

print(math.sqrt(A ** 2 + B ** 2 -2 * A * B * math.cos(math.radians(rad))))

Measured memory_bytes: 9504
using System;
using System.Linq;

namespace abc_050_B
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int[] s = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int mao = 0;
            for (int i = 0; i < a; i++)
            {
                mao += s[i];
            }int f = int.Parse(Console.ReadLine());
            for (int i = 0; i < f; i++)
            {
                int[] d = Console.ReadLine().Split().Select(int.Parse).ToArray();
                Console.WriteLine(mao + d[1] - s[d[0]-1]);
            }
        }
    }
}

Measured memory_bytes: 13268