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

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

using namespace std;

using ll = long long;
using ul = unsigned long long;
ll mod = 1000000007;

int main() {
source:
    ll a, b, c, k;
    cin >> a >> b >> c >> k;
    ll ans = b - a;
    if (k % 2 == 0) {
        ans *= -1;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int lld;
typedef vector<lld> vll;
#define pb push_back
#define rep(i,a,b) for(i=a;i<b;i++)
#define srt(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define mod 1000000007
#define pi 3.1415926535
lld a,b,c,d,e,f,g,h,i,j,k=0,l=0,m=1,n=1,o,q=0,r=0,u,v,w,x,y,z,s,t,p=0;
lld temp=0,ans=0;
double f1,f2,f3,f4,f5,f6;
char c2,c3,c4,c5,c6;
vll v11;
pair<lld,lld>p1,p2,p3;
map<lld,lld>mv;lld a12[200005],a13[200005];
bool b11[500006],c11[500006];lld a11[500006];
lld gcd(lld a, lld b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b);  
}
void dfs(lld i,vector<lld>vg[],lld m)
{
    if(b11[i]==true)    return;
    b11[i]=true;
    for(auto x11:vg[i])
    {
        if(b11[x11]==false)
        {
            dfs(x11,vg,m);
        }
    }
}
int main()
{
  ios::sync_with_stdio(false);cin.tie(0);
  t=1;
  //cin>>t;
  while(t--)
  {
    string s3,s1,s2;
    cin>>n;lld bn,a11,p1,n1,c11,cn;
    lld a1[n+1]={0},b1[n],c1[n+1];vector<lld>vg[n+1];
    map<char,lld>m1,m2;queue<lld>q2;vll v1,v2;r=0;temp=0;
    cout<<(1-n);
    cout<<endl;
  }
  return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <math.h>
using namespace std;
int main(void){
    int n;
    cin>>n;
    int a=n,b=0;
    for(int i=1;i<=n;i*=10){
        b+=a%10;
        a/=10;
    }
    if(n%b==0)cout<<"Yes\n";
    else cout<<"No\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int
int main(){
  long long a,b;
  cin >> a >> b;
  cout << a*(a-1)/2+b*(b-1)/2 << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int a = 0;
		int b = 0;
		int c = 0;
		int div = 0;

		try(Scanner scan = new Scanner(System.in)) {
			a = scan.nextInt();
			b = scan.nextInt();
			c = scan.nextInt();

			for(int i = a; i <= b; i++) {
				if(c % i == 0) {
					div++;
				}
			}
			System.out.println(div);
		}
	}
}

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

int main() {
	int x, y;
	cin >> x >> y;
	while (!(x == 0 && y == 0)) {
		if (x < y) {
			cout << x << " " << y << endl;
		}
		else {
			cout << y << " " << x << endl;
		}
		cin >> x >> y;
	}
	return 0;
}

Measured memory_bytes: 3080
#ifndef ___Class_BIT
#define ___Class_BIT

// ------ Includes ------ //
#include <vector>
#pragma warning(disable : 4146)

// ------ Class ------ //
template <typename Type>
class BIT {
private:
	unsigned size_; std::vector<Type> v;
	Type sum(unsigned r) {
		Type ret = 0;
		while (r > 0) {
			ret += v[r];
			r -= r & (-r);
		}
		return ret;
	}
public:
	BIT() {};
	BIT(unsigned size__) {
		for (size_ = 1; size_ < size__;) size_ <<= 1;
		v.resize(size_ + 1, 0);
	}
	inline void add(unsigned i, Type x) {
		i++;
		while (i <= size_) {
			v[i] += x;
			i += i & -i;
		}
	}
	inline Type sum(unsigned l, unsigned r) {
		return sum(r) - sum(l);
	}
	bool operator[](unsigned x) {
		return sum(x, x + 1);
	}
};

#endif

#include <iostream>
#include <algorithm>
#pragma warning(disable : 4996)
using namespace std;
int n, a[300009], b[300009]; pair<int, int> x[300009]; vector<int> w[100009];
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d%d", &a[i], &b[i]);
		x[i] = make_pair(a[i], b[i]);
	}
	sort(x, x + n);
	for (int i = 0; i < n; i++) w[x[i].second].push_back(i);
	BIT<long long> bit(n), cnt(n);
	for (int i = 0; i < n; i++) {
		bit.add(i, x[i].first);
		cnt.add(i, 1);
	}
	int ret = 0;
	for (int i = 1; i <= 100000; i++) {
		int l = 0, r = n + 1;
		while (l + 1 < r) {
			int m = (l + r) / 2;
			long long sum = bit.sum(0, m);
			long long u = cnt.sum(0, m);
			if (u * i < sum) r = m;
			else l = m;
		}
		ret = max(ret, (int)cnt.sum(0, l));
		for (int j = 0; j < w[i].size(); j++) {
			bit.add(w[i][j], -x[w[i][j]].first);
			cnt.add(w[i][j], -1);
		}
	}
	printf("%d\n", ret);
	return 0;
}

Measured memory_bytes: 21324
/*
ID: hafiz.i1
TASK: milk2
LANG: C++
*/
#include<bits/stdc++.h>

#define ll long long
#define debug(x) cout<<x<<"DE"<<endl;

using namespace std;



int main()
{
//    freopen("milk2.in", "r", stdin);
//    freopen("milk2.out", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll n,m,s=0;
    cin>>n>>m;
    ll a[n+1],b[n+1];vector<pair<ll,ll>>v;
    for(int i=1;i<=n;i++){
        cin>>a[i]>>b[i];
        v.push_back({a[i],b[i]});
    }
    sort(v.begin(),v.end());
    for(int i=1;i<=n;i++){
        if(v[i-1].second>=m)s+=(m*v[i-1].first),m=0;
        else s+=(v[i-1].second*v[i-1].first),m-=v[i-1].second;
        if(m==0)break;
    }
    cout<<s<<endl;
}


Measured memory_bytes: 6596
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
using namespace std;
typedef long long  ll;
typedef pair<double, double> P;

/** Problem0069 : Drowing Lots II **/
int amida[10][30], N, M, H, D;

int check(int n)
{
	rep(i, D) {
		if (amida[n][i]==1)
			n++;
		else if (amida[n][i]==-1)
			n--;
	}
	return n;
}

int main()
{
	while (cin>>N, N) {
		cin >> M >> H >> D;
		M--; H--;
		memset(amida, 0, sizeof(amida));

		rep(d, D) {
			rep(i, N-1) {
				char bo; cin >> bo;
				if (bo=='1') {
					amida[i][d] = 1;
					amida[i+1][d] = -1;
				}
			}
		}
		
		if (check(M)==H) {
			cout << 0 << endl;
			continue;
		}
		
		rep(d, D) {
			rep(i, N-1) {
				if (amida[i][d] == 0 && amida[i+1][d] == 0) {
					amida[i][d] = 1; amida[i+1][d] = -1;
					if (check(M)==H) {
						cout << d+1 << " " << i+1 << endl;
						goto end;
					}
					amida[i][d]=0; amida[i+1][d] = 0;
				}
			}
		}
		
		cout << 1 << endl;
	end:;
	}
	return 0;
}

Measured memory_bytes: 1160
#include<iostream>    // ???????????????????§?????????£????????????
using namespace std;
#include<stdio.h>

typedef struct fox { int val; fox *prev, *next; } fox_t;

fox_t* init()
{
	fox_t* head = new fox_t;
	head->val = -1;
	head->next = NULL;
	head->prev = NULL;
	return head;
}

fox_t* make_tail(fox_t* head)
{
	fox_t* tail = new fox_t;
	tail->val = -1;
	head->next = tail;
	tail->next = NULL;
	tail->prev = head;
	return tail;
}

bool isEmpty(fox_t* head, fox_t* tail)
{
	return (head->next == tail ? true : false);
}

fox_t* b_insert(fox_t* tail, int data)
{
	fox_t* fox = new fox_t;
	fox->val = data;
	fox->prev = tail->prev;
	fox->next = tail;
	tail->prev->next = fox;
	tail->prev = fox;
	return fox;
}
// docking.
void unionfox(fox_t* head1, fox_t* tail1, fox_t* head2, fox_t* tail2)
{
	if(isEmpty(head1, tail1) || isEmpty(head2, tail2)) return;
	fox_t* fox = tail1->prev;
	fox->next = head2->next;
	head2->next->prev = fox;
	tail2->prev->next = tail1;
	tail1->prev = tail2->prev;
	delete tail2;
	delete head2;
}

int main()
{
	int color[100001];
	int c_num = 0;
	fox_t* foxhead[100001];
	fox_t* foxtail[100001];
	int i, n, m, q;
	int a, b;
	cin >> n >> m;
	for(i = 0; i <= n; i++){
		color[i] = -1;
		foxhead[i] = init();
		foxtail[i] = make_tail(foxhead[i]);
	}
	int c_a, c_b, val;

	for(i = 0; i < m; i++){
		cin >> a >> b;
		c_a = color[a];
		c_b = color[b];
		if(c_a < c_b){ swap(c_a, c_b); swap(a, b); }  // color[a] >= color[b].
		if(c_a < 0 && c_b < 0){
			color[a] = c_num; color[b] = c_num;
			b_insert(foxtail[c_num], a);
			b_insert(foxtail[c_num], b);
			c_num++;
		}else if(c_b < 0){
			color[b] = c_a;
			b_insert(foxtail[c_a], b);
		}else if(c_a == c_b){
			continue;
		}else{ // color[a] != color[b].
			fox_t* fox = foxhead[c_b]->next;
			while(fox != foxtail[c_b]){
				val = fox->val;
				color[val] = c_a;
				fox = fox->next;
			};
			unionfox(foxhead[c_a], foxtail[c_a], foxhead[c_b], foxtail[c_b]);
		}
	}
	cin >> q;
	for(i = 0; i < q; i++){
		cin >> a >> b;
		if(color[a] >= 0 && (color[a] == color[b])){
			printf("yes\n"); }else{ printf("no\n"); 
			}
	}
	return 0;
}

Measured memory_bytes: 12468
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] x = Console.ReadLine().Split().Select(long.Parse).ToArray();
            long N = x[0];
            long K = x[1];
            //list
            long[] A = new long[N];
            long[] B = new long[N];

            int[] y = new int[2];

            for (long i = 0; i < N; i++)
            {
                y = Console.ReadLine().Split().Select(int.Parse).ToArray();
                A[i] = y[0];
                B[i] = y[1];
            }

            Array.Sort(A, B);

            long ans = -1;
            long sum = 0;

            for (int i = 0; i < N; i++)
            {
                sum += B[i];
                if (sum >= K) 
                {
                    ans = A[i];
                    break;
                }
            }
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 19000
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		BigInteger mul = BigInteger.valueOf(2);
		for (int i = 3; i <= 1501; i += 2) {
			boolean ok = true;
			for (int j = 3; j * j <= i; j += 2) {
				if (i % j == 0) {
					ok = false;
					break;
				}
			}
			if (ok) {
				mul = mul.multiply(BigInteger.valueOf(i));
			}
		}
		int N = sc.nextInt();
		mul = mul.add(BigInteger.valueOf(2));
		System.out.println(mul);
		for (int i = 0; i < N; ++i) {
			int b = i + 2;
			for (int j = 2; j <= b; ++j) {
				if (b % j == 0) {
					System.out.println(j);
					break;
				}
			}
		}
	}

}

Measured memory_bytes: 13000
#include<bits/stdc++.h>
#define faster  ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ull unsigned long long
#define pb push_back
const double PI = acos(-1.0);
using namespace std;

int main()
{
    faster

    int n;
    cin>>n;

    int a[n],b[n],c[n];

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

        if(i!=0)
        {
            a[i]=a[i]+max(b[i-1],c[i-1]);
            b[i]=b[i]+max(a[i-1],c[i-1]);
            c[i]=c[i]+max(a[i-1],b[i-1]);
        }
    }


    //cout<<a[n-1]<<" "<<b[n-1]<<" "<<c[n-1]<<endl;

    cout<<max(a[n-1],max(b[n-1],c[n-1]))<<endl;









    return 0;
}


Measured memory_bytes: 4808
#include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
#define int lint
const int INF = 1e7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, k, n) for (int i = (k); i < (int)(n); ++i)
typedef pair<int, int> P;
typedef vector<lint> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(), (x).end()
#define pb push_back
struct UnionFind
{
    vector<int> data;
    UnionFind(int sz)
    {
        data.assign(sz, -1);
    }
    bool unite(int x, int y)
    {
        x = root(x), y = root(y);
        if (x == y)
            return (false);
        if (data[x] > data[y])
            swap(x, y);
        data[x] += data[y];
        data[y] = x;
        return (true);
    }
    int root(int k)
    {
        if (data[k] < 0)
            return (k);
        return (data[k] = root(data[k]));
    }
    int size(int k)
    {
        return (-data[root(k)]);
    }
};
signed main()
{
    int n, m;
    cin >> n >> m;
    UnionFind uf(n);
    vi a(m);
    vi b(m);
    rep(i, m)
    {
        cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
    }
    reverse(all(a));
    reverse(all(b));
    vi ans;
    lint cc = (n * (n - 1)) / 2;
    rep(i, m)
    {
        if (i != 0)
        {
            if (uf.root(a[i - 1]) != uf.root(b[i - 1]))
            {
                cc -= uf.size(a[i - 1]) * uf.size(b[i - 1]);
                uf.unite(a[i - 1], b[i - 1]);
            }
        }
        ans.push_back(cc);
    }
    reverse(all(ans));
    rep(i, m)
    {
        cout << ans[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 4596
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define Mid ((l+r)/2)
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define drep(i,a,b) for(int i=(a);i>=(b);--i)
#define file(a) freopen(#a".in","r",stdin),freopen(#a".out","w",stdout);
const int maxn=1e6+5,mod=1e9+7,inf=0x3f3f3f3f;
int n,m,Q,K,T;
int read(){
    int x=0,f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    return x*f;
}int a[maxn],p[maxn];
bool pd1(){
    int Max=0;
    rep(i,1,n)Max=max(Max,a[i]);
    rep(i,2,Max){
        int fl=0;
        for(int j=1;j*i<=Max;++j){
            fl+=p[i*j];
        }if(fl>1)return false;
    }return true;
}
int gcd(int a,int b){
    if(!b)return a;
    return gcd(b,a%b);
}
bool pd2(){
    int res=a[1];
    rep(i,2,n)res=gcd(res,a[i]);
    if(res==1)return true;
    return false;
}
signed main(){
    //file(a);
    n=read();
    rep(i,1,n)a[i]=read(),p[a[i]]++;
    if(pd1())puts("pairwise coprime");
    else if(pd2())puts("setwise coprime");
    else puts("not coprime");


    return 0;
}


Measured memory_bytes: 11416
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=500000004;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
char in[6];
int main(){
	scanf("%s",in);
	if((in[0]==in[1]&&in[2]==in[1])||(in[1]==in[2]&&in[2]==in[3]))printf("Yes\n");
	else printf("No\n");
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    vector<vector<int>> v(n, vector<int>(3, 0));
    for(int i=0; i<n; i++)
        cin>>v[i][0]>>v[i][1]>>v[i][2];
        
    vector<vector<int>> hpy = v;
    
    for(int i=1; i<n; i++)
    {
        hpy[i][0] = max(hpy[i-1][1], hpy[i-1][2])+hpy[i][0];
        hpy[i][1] = max(hpy[i-1][0], hpy[i-1][2])+hpy[i][1];
        hpy[i][2] = max(hpy[i-1][1], hpy[i-1][0])+hpy[i][2];
        //cout<<hpy[i][0]<<" "<<hpy[i][1]<<" "<<hpy[i][2]<<endl;
    }
    cout<<max({hpy[n-1][0], hpy[n-1][1], hpy[n-1][2]})<<endl;
    return 0;
}

Measured memory_bytes: 11136
/*
    Only way to go is UP 
    H1s3nb3rg's Here !!
*/
#define _USE_MATH_DEFINES
#include <bits/stdc++.h> 
#include <cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<int,int> pi;
typedef uint64_t i64;
typedef vector<int> vi;
typedef vector<pi> vpi;
typedef vector<vector<ll>> v2ll;
const int MOD = 1e9+7;
#define FAST_IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MAIN int main(){FAST_IO;ll tc;cin>>tc;while(tc--){solver();}ret0;}
#define MAIN1 int main(){FAST_IO;solver();ret0;}
#define rep(i,b,e) for(__typeof(e)i=(b)-((b)>(e));i!=(e)-((b)>(e));i+=1-2*((b)>(e)))
#define repa(i,x)  for(auto i:x)
#define vin(x) for(auto &i:x){cin>>i;}
#define vin1(x) for(ll i=1;i<x.size();i++){cin>>x[i];}
#define dbg(x) for(auto i:x){cout<<i<<" ";}cout<<ENDL;
#define dbg2(x) for(auto &i:x){for(auto j:i){cout<<j<<" ";}cout<<endl;}
#define dbgp(x) for(auto i:x){cout<<i.ff<<" "<<i.ss<<endl;}
#define ENDL "\n"
#define VALL(a) a.begin(),a.end()
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define MP(a,b) make_pair(a,b)
#define ff first
#define ss second
#define ret0 return 0;
#define ret return;
#define pb(x) push_back(x)
/*----------------------------*/
ll fc(vector<ll> &v,ll n)
{
    if(v[n]<0)
        return n;
    return v[n]=fc(v,v[n]);
}
void uni(vector<ll> &v,ll a,ll b)
{
    ll x=fc(v,a);
    ll y=fc(v,b);
    if(x==y)
        return;
    v[x]+=v[y];
    v[y]=x;
    return;
}

void solver(){
    ll n ,r;
    cin>>n>>r;
    vll dsu(n+1,-1);
    while(r--){
        ll a,b;
        cin>>a>>b;
        uni(dsu,a,b);
    }
    ll res=-1;
    for(auto i:dsu)
        if(i<0)
            res=max(res,abs(i));
    cout<<res<<ENDL;
    ret;
}

MAIN1


Measured memory_bytes: 4772
import sys
import math
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate #リストを与えると累積和を返す
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache #メモ化
from fractions import gcd

def main():
    x = int(input())
    print(360//math.gcd(x, 360))
    
    return 0

if __name__ == "__main__":
    main()

Measured memory_bytes: 10536
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		new Main().run();
	}

	@SuppressWarnings("unchecked")
	private void run() throws IOException {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		List<Integer>[] G = new ArrayList[n];
		for (int i = 0; i < n; i++)
			G[i] = new ArrayList<Integer>();
		int[] deg = new int[n];
		for (int i = 0; i < m; i++) {
			int u = scanner.nextInt() - 1;
			int v = scanner.nextInt() - 1;
			G[u].add(v);
			deg[v]++;
		}
		boolean ambig = false;
		Deque<Integer> deque = new ArrayDeque<Integer>();
		for (int i = 0; i < n; i++) {
			if (deg[i] == 0)
				deque.push(i);
		}
		while (!deque.isEmpty()) {
			if (deque.size() >= 2)
				ambig = true;
			int u = deque.poll();
			System.out.println(u + 1);
			for (int v : G[u]) {
				deg[v]--;
				if (deg[v] == 0)
					deque.push(v);
			}
		}
		System.out.println(ambig ? 1 : 0);
	}
}

Measured memory_bytes: 96332
#include <bits/stdc++.h>
#define pb push_back
#define boostup ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long int ll;
ll power(ll a, ll n) {ll p = 1;while (n > 0) {if(n%2) {p = p * a;} n >>= 1; a *= a;} return p;}
ll power(ll a, ll n, ll mod) {ll p = 1;while (n > 0) {if(n%2) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;}
using namespace std;
double polyapothem(double n) 
{ 
  
    // Side and side length cannot be negative 
    // Degree converted to radians 
    return 1 / (2 * tan((180 / n) * 3.14159 / 180.00000000)); 
}
int main()
{
    boostup;
    ll a,b,h,m;
    cin>>a>>b>>h>>m;
    double hour_angle = 0.5 * (h * 60 + m);  
    double minute_angle = 6 * m;  
  
    // Find the difference between two angles  
    double angle = abs(hour_angle - minute_angle);  
  
    // Return the smaller angle of two possible angles  
    angle = min(360 - angle, angle);  
    double len=sqrt(a*a+b*b-2*a*b*cos((angle*3.141592653589793238)/180.0000000));
    cout<<fixed<<setprecision(15)<<len<<endl;
}


Measured memory_bytes: 4240
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;

typedef long long int ll;

int main(){
	ll n;
	vector<int> a;
	vector<int> b;
	vector<int> c;
	ll ans = 0;
	scanf("%lld",&n);
	for(int i=0;i<n;i++){
		int t;
		scanf("%d",&t);
		a.push_back(t);
	}
	for(int i=0;i<n;i++){
		int t;
		scanf("%d",&t);
		b.push_back(t);
	}
	for(int i=0;i<n;i++){
		int t;
		scanf("%d",&t);
		c.push_back(t);
	}
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());
	sort(c.begin(),c.end());
	for(int i=0;i<n;i++){
		ans += (distance(a.begin(),lower_bound(a.begin(),a.end(),b[i]))) * distance(c.end(), upper_bound(c.begin(),c.end(),b[i]));
	}
	printf("%lld\n",-ans);
}


Measured memory_bytes: 1784
def solve(n,h):
    if n ==1:
        return 0
    elif n ==2:
        return abs(h[1]-h[0])
    else:
        s = [0] *n
        s[1] =abs(h[1]-h[0])
        for i in range(2, n):
            s[i] = min(s[i-1]+abs(h[i]-h[i-1]), s[i-2]+abs(h[i]-h[i-2]))
        return s[n-1]

n = int(input())
h = list(map(int,input().split()))
ans = solve (n,h)
print(ans)
                       

Measured memory_bytes: 13928
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

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

using namespace std;

int main() {
	string a, b, c;
	cin >> a >> b >> c;
	cout << 'A' << b.front() << 'C' << endl;

	return 0;
}

Measured memory_bytes: 256
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define pb            push_back
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)

const int INF = 1e9;

// code
// ------------------------------------------------
int main() {

  unsigned long long a,b,x;
  cin >> a >> b >> x;

  unsigned long long ans = b / x - a / x + (a % x ? 0 : 1);

  cout << ans << endl;

  return 0;
}

// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    string S;
    int Q;
    cin >> S;
    cin >> Q;

    deque<char> S_deque;
    for(int i=0;i<S.size();i++){
        S_deque.push_back(S[i]);
    }
    int t,f,t_sum;
    char c;
    t_sum=0;
    for(int i=0;i<Q;i++){
        cin >> t;
        if(t==1){
            t_sum++;
            t_sum%=2;
        }else{
            cin >> f >> c;
            if((f+t_sum)%2==1){
                S_deque.push_front(c);
            }else{
                S_deque.push_back(c);
            }
        }
    }

    if(t_sum==1){
        for(int i=0;i<S_deque.size();i++){
            cout << S_deque[S_deque.size()-i-1];
        }
    }else{
        for(int i=0;i<S_deque.size();i++){
            cout << S_deque[i];
        }
    }

    cout << endl;

    


}

Measured memory_bytes: 896
// 2つの整数値の比較
#include<stdio.h>
using namespace std;

int main(){
  int a, b;
  scanf("%d %d", &a, &b);
  if (a>b){
    printf("a > b\n");
  } else if(a==b){
    printf("a == b\n");
  } else{
    printf("a < b\n");
  }
  return 0;
}


Measured memory_bytes: 2624
def solve():
    n = int(input())
    a = tuple(int(x) for x in input().split())

    memo = tuple([None] * n for _ in range(n))
    for i, aa in enumerate(a):
        memo[i][i] = aa

    for l in range(n - 1, -1, -1):
        for r in range(l, n):
            if memo[l][r] is None:
                memo[l][r] = max(a[r] - memo[l][r - 1], a[l] - memo[l + 1][r])

    print(memo[0][n - 1])


if __name__ == '__main__':
    solve()


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

int main(){
  int N;cin>>N;
  if(N>=30) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 3592
import math

import numpy as np
from scipy.spatial import distance

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

radian_hour_hand = math.radians(360 * (H + M / 60) / 12)
# print(radian_hour_hand)
radian_minute_hand = math.radians(360 * M / 60)
# print(radian_minute_hand)
radian_diff = radian_hour_hand - radian_minute_hand

x_hour_hand = A * math.cos(radian_hour_hand)
y_hour_hand = A * math.sin(radian_hour_hand)
# x_hour_hand = A * math.cos(0)
# y_hour_hand = A * math.sin(0)
vector_hour_hand = np.array([x_hour_hand, y_hour_hand])
coord_hour_hand = (x_hour_hand, y_hour_hand)
# print(vector_hour_hand)

x_minute_hand = B * math.cos(radian_minute_hand)
y_minute_hand = B * math.sin(radian_minute_hand)
# x_minute_hand = B * math.cos(radian_diff)
# y_minute_hand = B * math.sin(radian_diff)
vector_minute_hand = np.array([x_minute_hand, y_minute_hand])
coord_minute_hand = (x_minute_hand, y_minute_hand)
# print(vector_minute_hand)

vector_diff = vector_hour_hand - vector_minute_hand
distance = distance.euclidean(coord_hour_hand, coord_minute_hand)
# print(vector_diff)

# print(np.linalg.norm(vector_diff))
print(distance)

Measured memory_bytes: 44632
// We only fail when we stop trying
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()



int main()
{
  double L;
  cin >> L;
  double ans = (L / 3) * (L / 3) * (L / 3);
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pair;
const int inf = 1000000000; //10^9
const ll inff = 1000000000000000000; //10^18

int main(){
    ll n, a, b;
    cin >> n >> a >> b;
    if ((a+b) % 2 == 0) {
        cout << abs(a - (b + a) / 2) << endl;
        return 0;
    }
    cout << min(a-1, n-b) + 1 + ((b - a - 1) / 2) << endl;

    return 0;
}

Measured memory_bytes: 3460
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr<<" "<<(hoge)<<endl;
#define DBG cerr<<"!"<<endl;
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

typedef struct E{
  ll to,cost;
}edge;
const ll MAX_V=200100;
const ll Inf=1e18;
vector<vector<edge>>E(MAX_V);
ll d[MAX_V];
void dijkstra(ll s){
  priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>>que;
  fill_n(d,MAX_V,Inf);
  d[s] = 0;
  que.push(pair<ll,ll>(0,s));
  while(!que.empty()){
    pair<ll,ll> p = que.top();
    que.pop();
    ll v = p.second;
    if(d[v] < p.first)continue;
    for(int j = 0;j < E[v].size();j++){
      edge t = E[v][j];
      if(d[t.to] > d[v] + t.cost){
	d[t.to] = d[v] + t.cost;
	que.push(pair<ll,ll>(d[t.to],t.to));
      }
    }
  }
}
ll nxt[222222];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,m;cin>>n>>m;
  for(int i=0;i<n;i++)nxt[i]=llINF;
  for(int i=0;i<m;i++){
    ll f,t,c;
    cin>>f>>t>>c;
    E[--f].pb({--t,c});
    nxt[f]++;
    nxt[t+1]--;
  }
  bool fl=true;
  for(int i=0;i<n-1;i++){
    nxt[i+1]+=nxt[i];
    if(nxt[i] == 0)fl=false;
  }
  if(fl == false){cout<<-1<<endl;return 0;}
  for(int i=0;i<n-1;i++)
    E[i+1].pb({i,0});
  dijkstra(0);
  if(d[n-1] == Inf)cout<<-1<<endl;
  else cout<<d[n-1]<<endl;
  return 0;
}


Measured memory_bytes: 13304
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end()     //昇順
#define RALL(x) (x).rbegin(), (x).rend()  // 降順
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
const long long mod = 1e9 + 7;
typedef long long ll;
typedef priority_queue<int> PQ;
typedef vector<long long> VL;
typedef vector<bool> VB;
typedef vector<int> VI;  // VI a(n);
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<VS> VSS;
typedef vector<VC> VCC;
typedef vector<VI> VII;  // VII a(n,VI(m)) n * m
typedef vector<VL> VLL;
typedef pair<int, int> PII;
typedef map<int, int> MP;  // MP a;
typedef vector<pair<ll, ll>> PS;

template <class T, class U>
bool chmax(T &a, U b) {
  if (a <= b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>
bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
  os << "}";
  return os;
}

// g++ -std=c++11 prac.cpp
// operator << (cout,a);
// chmin(min,a)
     
int main() {
  ll n,k, x=0, y=0 , z = 0, h,w, sum = 1, Max = -1, Min = 3e9+1;
  double m;
  string u;
  bool ok=true;
  cin >> n >> m;
  k = m*100 + 0.5;
  sum = n*k;
  pri(sum/100);
  return 0;
}

Measured memory_bytes: 3772
using System;
using System.Collections.Generic;
using System.IO.Pipes;
using System.Linq;
using System.Numerics;
using System.Threading;

namespace Atcoder
{
	class Program
	{
		//string s = Console.ReadLine();
		//int[] intArray = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
		//int H = intArray[0];
		//int W = intArray[1];
		//int N = int.Parse(Console.ReadLine());
		//List<int> A = new List<int>(Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray());
		//Boolean ok = false;

		//Console.WriteLine(ans);
		//Console.WriteLine("Yes");
		//Console.WriteLine("No");
		//Console.ReadKey();
		//Console.WriteLine(cnt);

		//string[] strArray = Console.ReadLine().Split(' ').ToArray();
		//string S = strArray[0];
		//string T = strArray[1];
		static void Main(string[] args)
		{
			int[] AB = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
			int A = AB[0];
			int B = AB[1];
			string sa = "";
			string sb = "";
			string ans = "";

			for (int i = 0; i < B; i++)
				sa += A + "";
			for (int i = 0; i < A; i++)
				sb += B + "";

			if (sa.CompareTo(sb) == -1)
				ans = sa;
			else
				ans = sb;
			Console.WriteLine(ans);
		}

		/// <summary>
		/// 回文
		/// </summary>
		/// <param name="Target"></param>
		/// <param name="len"></param>
		/// <returns></returns>
		static bool Palindrome(string Target , int len)
        {
			bool yes = true;

			for(int i = 0;i < len; i++)
            {
				if(Target[i] != Target[len - 1 - i])
                {
					yes = false;
					break;
                }
            }
			return yes;
        }

		/// <summary>
		/// アナグラム
		/// </summary>
		/// <param name="word1"></param>
		/// <param name="word2"></param>
		/// <returns></returns>
		static bool IsAnagramOf(string word1, string word2)
		{
			return word1.OrderBy(x => x).SequenceEqual(word2.OrderBy(x => x));
		}
		/// <summary>
		/// 最小公倍数
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <returns></returns>
		public static BigInteger Lcm(BigInteger a, BigInteger b)
		{
			return a * b / Gcd(a, b);
		}

		/// <summary>
		/// 最大公約数
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <returns></returns>
		public static BigInteger Gcd(BigInteger a, BigInteger b)
		{
			if (a < b)
				// 引数を入替えて自分を呼び出す
				return Gcd(b, a);
			while (b != 0)
			{
				var remainder = a % b;
				a = b;
				b = remainder;
			}
			return a;
		}
	}
}

Measured memory_bytes: 28500
#include <bits/stdc++.h>
#define fi first
#define se second
#define NAME ""
using namespace std;
typedef long long LL;
typedef pair <LL, LL> pLL;
typedef pair <int, int> pii;
const int NMAX = 5e5+7;


int main() {
    ios::sync_with_stdio(0); cin.tie(); cout.tie(0);
    //freopen(NAME".inp", "r", stdin);
    //freopen(NAME".out", "w", stdout);
    LL a, b, c;
    cin >> a >> b >> c;
    if(c <= b+a+1)
        cout << b+c;
    else
        cout << b*2 + a + int(c-a > 1);
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	//var N int
	var N int
	var count int
	var S string
	var str string

	fmt.Scan(&N)
	fmt.Scan(&S)
	for k, r := range S {
		if k == 0 {
			str = string(r)

			continue
		}
		if str != string(r) {
			str = string(r)
			count++
		}
	}
	fmt.Println(count + 1)
}


Measured memory_bytes: 1664
#include<iostream>
   
using std::cin;
using std::cout;
using std::endl;
   
int main()
{
int x,y;
   
while(cin>>x>>y&&!(x==0&&y==0))
{
if(x>y)std::swap(x,y);
cout<<x<<" "<<y<<endl;
}
return 0;
}

Measured memory_bytes: 3080
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func dist(a, b []int) int {
	x := a[0] - b[0]
	if x < 0 {
		x *= -1
	}
	y := a[1] - b[1]
	if y < 0 {
		y *= -1
	}
	return x + y
}

func main() {
	sc.Split(bufio.ScanWords)
	N := nextInt()
	A := make([][]int, N)
	for i := range A {
		A[i] = []int{nextInt(), nextInt()}
	}
	fmax, fmin := -1000000000, 1000000000
	imax, imin := 0, 0
	for i, a := range A {
		tmp := a[0] - a[1]
		if tmp > fmax {
			fmax = tmp
			imax = i
		}
		if fmin > tmp {
			fmin = tmp
			imin = i
		}
	}
	ans := dist(A[imax], A[imin])
	fmax, fmin = -1000000000, 1000000000
	imax, imin = 0, 0
	for i, a := range A {
		tmp := a[0] + a[1]
		if tmp > fmax {
			fmax = tmp
			imax = i
		}
		if fmin > tmp {
			fmin = tmp
			imin = i
		}
	}
	d := dist(A[imax], A[imin])
	if d > ans {
		ans = d
	}
	fmt.Println(ans)
}


Measured memory_bytes: 16676
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;}

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
int main() {
    int m,n;
    cin >> m >> n;
    
    cout << mint(m).pow(n) << endl;
}




Measured memory_bytes: 3104
#include <algorithm>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define eps LDBL_EPSILON
#define moder 1000000007
#define int long long
#define ll long long
#define double long double
#define INF LLONG_MAX/3
#define P pair<int,int>
#define prique priority_queue<int,vector<int>,greater<int>>
using namespace std;
signed main(){
	int a, b, t;
	cin >> a >> b >> t;
	cout << b * (t / a) << endl;
}

Measured memory_bytes: 764
<?php
define('MOD', pow(10, 9) + 7);

fscanf(STDIN, "%d", $N);
$A = array_map('intval', explode(' ', trim(fgets(STDIN))));
$ans = 0;
$sum = 0;
for ($i = $N - 1; $i > 0; $i--) {
    $sum += $A[$i];
    $sum %= MOD;
    // echo $sum . PHP_EOL;
    $ans += $A[$i - 1] * $sum;
    $ans %= MOD;
    // echo $ans . PHP_EOL;
}
printf("%d", $ans);


Measured memory_bytes: 37924
# 2020/02/16
# AtCoder Beginner Contest 155 - B

# Input
n = int(input())
a = list(map(int,input().split()))

# Calc
ans = "APPROVED"
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            ans = "DENIED"
            break

# Output
print(ans)


Measured memory_bytes: 2940
S = input()
T = input()
mic = len(T)
if T in S:
  print(0)
else:
  for i in range(len(S)-len(T)+1):
    counter = 0
    for l in range(len(T)):
      if T[l] != S[i+l]:
        counter+=1
    mic = min(mic,counter)
  print(mic)

Measured memory_bytes: 73168
def main():
    N = int(input())
    A = list(map(int, input().split()))

    count = 0

    for i, a in enumerate(A):
        if i % 2 == 1:
            continue
        elif a % 2 == 0:
            continue
        count += 1
    
    print(count)



if __name__ == '__main__':
    main()

Measured memory_bytes: 61712
#include <iostream>
#include <string>
#include <algorithm> 
#include <cstdlib>
#include <map>
#include <queue>
#include <vector>
#include <utility>
#include <climits>
#include <numeric>
#include <math.h>
#define ll long long
#define INF INT_MAX 
using namespace std;
int main(){
	ll A,B;
	cin >> A >> B;
	if(A*B<=0){
		cout << "Zero" << endl;
		return 0;
	}else if(A<0&&B<0){
		if(abs(A+B)%2==0){
			cout << "Negative" << endl;
		}else{
			cout << "Positive" << endl;
		}
	}else{
		cout << "Positive" << endl;
	}
}



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

namespace tst
{
    class Program
    {
        public static void Main()
        {
            string[] In1 = Console.ReadLine().Split(' ');
            int n = int.Parse(In1[0]);
            int m = int.Parse(In1[1]);
            string[] In2 = Console.ReadLine().Split(' ');
            int[] A = new int[n];
            int sum = 0;
            for(int i=0; i<n; i++)
            {
                A[i] = int.Parse(In2[i]);
                sum += A[i];
            }
            double border = sum / (4.0 * m);
            int cnt = 0;
            for(int i=0; i<n; i++)
            {
                if (A[i] >= border) cnt++;
            }
            if (cnt >= m)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
using pi=pair<int,int>;
#define int long
signed main(){
  int N,C,r=0;
  cin>>N>>C;
  vector<vector<pi>> v(C);
  int s,t,c;
  for(int i=0;i<N;++i){
    cin>>s>>t>>c;
    v[c-1].emplace_back(s,t);
  }
  for(int i=0;i<C;++i){
    if(v[i].empty())continue;
    sort(v[i].begin(),v[i].end());
    vector<pi> vv;
    vv.push_back(v[i][0]);
    int szvv=1;
    for(int j=1;j<v[i].size();++j){
      if(v[i][j].first==v[i][j-1].second)vv[szvv-1].second=v[i][j].second;
      else vv.push_back(v[i][j]),++szvv;
    }
    v[i]=vv;
  }
  
  vector<int> T(100010,0);
  for(auto& vv:v)for(auto& p:vv)++T[p.first-1],--T[p.second];
  for(int i=1;i<100010;++i)r=max(r,T[i]+=T[i-1]);
  cout<<max(r,T[0]);
}

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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define ALL(v) v.begin(), v.end()

ll N, A;

int main() {
    cin >> N;
    ll res = 0;
    REP (i, N) {
        cin >> A;
        res ^= A;
    }
    cout << ((res == 0) ? "Yes" : "No") << endl;
}

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

int main(){
    int n;
    cin >> n;
    vector<int> l(n);
    for(int i = 0; i < n; i++)cin >> l[i];

    sort(l.begin(), l.end());
    int ans = 0;
    for(int i = 0; i < n; i++){
        for(int j = i+1; j < n; j++){
            for(int k = j+1; k < n; k++){
                if (l[i] == l[j] || l[j] == l[k])continue;
                if (l[i] + l[j] > l[k])ans++;
            }
        }
    }

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

Measured memory_bytes: 3200
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#include<complex>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef complex<double> P;
struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};
P pin(){
	double x,y;
	cin>>x>>y;
	P p(x,y);
	return p;
}
void PIN(P* a,int n){
	rep(i,n)a[i]=pin();
}
double dot(P a,P b){
	return real(conj(a)*b);
}
double cross(P a,P b){
	return imag(conj(a)*b);
}
int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
} 
bool intersectSS(const L &s, const L &t) {
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
         ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}
int main(){
	int n;
	cin>>n;
	while(n--){
		P p[4];
		PIN(p,4);
		L a=L(p[0],p[1]);
		L b=L(p[2],p[3]);
		cout<<intersectSS(a,b)<<endl;
	}
}

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

int main() {
  int N , a , b , c , d;
  cin >> N;
  a = N / 1000 % 10;
  b = N / 100 % 10;
  c = N / 10 % 10;
  d = N % 10;
  
  if ( b == c && ( a == b || c == d ) ) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 384
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    print(max(A)-min(A))


if __name__ == '__main__':
    main()


Measured memory_bytes: 9152
N,Z,W = list(map(int,input().split()))
A = list(map(int,input().split()))
if N==1:
    X = abs(W-A[0])
    print(X)
else:
    X = abs(W-A[N-1])
    Y = abs(A[N-1]-A[N-2])
    print(max(X,Y))


Measured memory_bytes: 64316
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
    int t;
    cin >> t;
    string arr[t];;
    for(int i=0;i<t;i++)
cin >> arr[i];

sort(arr,arr+t);

int count=0;
for(int i=0;i<t-1;i++)
{
    if(arr[i]==arr[i+1])
        count++;
}
  
     cout <<  t-count;
     
     return 0;
}
    
        
        

Measured memory_bytes: 9800
#include <stdio.h>

int main(){
	printf("1x1=1\n"
           "1x2=2\n"
           "1x3=3\n"
           "1x4=4\n"
           "1x5=5\n"
           "1x6=6\n"
           "1x7=7\n"
           "1x8=8\n"
           "1x9=9\n"
           "2x1=2\n"
           "2x2=4\n"
           "2x3=6\n"
           "2x4=8\n"
           "2x5=10\n"
           "2x6=12\n"
           "2x7=14\n"
           "2x8=16\n"
           "2x9=18\n"
           "3x1=3\n"
           "3x2=6\n"
           "3x3=9\n"
           "3x4=12\n"
           "3x5=15\n"
           "3x6=18\n"
           "3x7=21\n"
           "3x8=24\n"
           "3x9=27\n"
           "4x1=4\n"
           "4x2=8\n"
           "4x3=12\n"
           "4x4=16\n"
           "4x5=20\n"
           "4x6=24\n"
           "4x7=28\n"
           "4x8=32\n"
           "4x9=36\n"
           "5x1=5\n"
           "5x2=10\n"
           "5x3=15\n"
           "5x4=20\n"
           "5x5=25\n"
           "5x6=30\n"
           "5x7=35\n"
           "5x8=40\n"
           "5x9=45\n"
           "6x1=6\n"
           "6x2=12\n"
           "6x3=18\n"
           "6x4=24\n"
           "6x5=30\n"
           "6x6=36\n"
           "6x7=42\n"
           "6x8=48\n"
           "6x9=54\n"
           "7x1=7\n"
           "7x2=14\n"
           "7x3=21\n"
           "7x4=28\n"
           "7x5=35\n"
           "7x6=42\n"
           "7x7=49\n"
           "7x8=56\n"
           "7x9=63\n"
           "8x1=8\n"
           "8x2=16\n"
           "8x3=24\n"
           "8x4=32\n"
           "8x5=40\n"
           "8x6=48\n"
           "8x7=56\n"
           "8x8=64\n"
           "8x9=72\n"
           "9x1=9\n"
           "9x2=18\n"
           "9x3=27\n"
           "9x4=36\n"
           "9x5=45\n"
           "9x6=54\n"
           "9x7=63\n"
           "9x8=72\n"
           "9x9=81\n");
	return 0;
}

Measured memory_bytes: 524
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <map>
#include <cstdio>
#include <math.h>
#include <utility>
#include <list>
#include <functional>
using namespace std;

#define ll long long
#define vecint vector<int>
#define Pii pair<int, int>

#define REP(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define print(a) cout << a << endl

#define MOD 1000000007
#define NIL -1

int N;
vector<int> L;

void solve(){
  int ans=0;
  sort(L.begin(),L.end());
  rep(i,N){
    ans+=L[2*i];
  }
  print(ans);
  return;
}

int main(){
  cin>>N;
  rep(i,2*N){
    int x;
    cin>>x;
    L.push_back(x);
  }

  solve();

  return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))

template<class T> T gcd(T a, T b){ return ((b == 0) ? a : gcd(b, a % b)); }

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	ll a, b, c;
	cin >> a >> b >> c;
	c -= a + b;
	if(c <= 0) cout << "No" << endl;
	else if(sq(c) > (4 * a * b)) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/




Measured memory_bytes: 256