akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main(void){
    int n,i;
    double *x,*y;
    double distance1=0.0,distance2=0.0,distance3=0.0,distance4=0.0;
    
    scanf("%d",&n);
    x = (double *)malloc(n*sizeof(double));
    y = (double *)malloc(n*sizeof(double));
    for(i=0;i<n;i++){
        scanf("%lf",&x[i]);
    }
    for(i=0;i<n;i++){
        scanf("%lf",&y[i]);
    }
    for(i=0;i<n;i++){
        double now=0.0;
        distance1+=fabs(x[i]-y[i]);//p=1のとき　絶対値を足す
        distance2+=fabs(x[i]-y[i])*fabs(x[i]-y[i]);//p=2のとき　後で平方根をとる　二乗して和をとる
        distance3+=fabs(x[i]-y[i])*fabs(x[i]-y[i])*fabs(x[i]-y[i]);//p=3のとき　後で立方根をとる　三乗して和をとる
        now=fabs(x[i]-y[i]);//p=∞のとき　まず今の絶対値をとる
        if(now>distance4){//今最大のものであるdistance4と新しい距離であるnowを比較
            distance4=now;//もしnowの方が大きかったらdistance4に入れる
        }
    }
    distance2=sqrt(distance2);//平方根をとる
    distance3=cbrt(distance3);//立方根をとる
    printf("%.6lf\n%.6lf\n%.6lf\n%.6lf",distance1,distance2,distance3,distance4);

    return 0;

}


Measured memory_bytes: 2820
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <regex>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define all(a)          (a).begin(), (a).end()
#define sort(a)         sort(all(a))
#define uniq(a)         sort(a);(a).erase(unique(all(a), (a).end())
#define reverse(a)      reverse(all(a))
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define YES()           cout << "YES" << endl
#define NO()            cout << "NO" << endl
#define Yes()           cout << "Yes" << endl
#define No()            cout << "No" << endl
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }
#define pb              push_back
#define fst             first
#define int             long long
#define INF             __LONG_LONG_MAX__

using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int n, m, k, ids;
const int MAX = 310;
int a[MAX][MAX];
vector<string> s(MAX);
 
void dfs(int sx, int sy, int ex, int ey) {
	int pxi = -1, pyi = -1, pxj = -1, pyj = -1;
	for (int i = sx; i <= ex; ++i) {
		for (int j = sy; j <= ey; ++j) {
			if (s[i][j] == '#') {
				if (pxi == -1) pxi = i, pyi = j;
				else if (pxj == -1) pxj = i, pyj = j;
      }
    }
  }
	if (pxj == -1) {
		++ids;
		for (int i = sx; i <= ex; ++i) {
			for (int j = sy; j <= ey; ++j) {
				a[i][j] = ids;
      }
    }
		return;
  }
	if (pxi != pxj) {
		int z = min(pxi, pxj);
		dfs(sx, sy, z, ey);
		dfs(z + 1, sy, ex, ey);
	} else {
		int z = min(pyi, pyj);
		dfs(sx, sy, ex, z);
		dfs(sx, z + 1, ex, ey);
  }
}

void solve() {
	cin >> n >> m >> k;
	rep(i, n) cin >> s[i];

	dfs(0, 0, n-1, m-1);

	for (int i = 0; i < n; ++i, puts(""))
		for (int j = 0; j < m; ++j) cout << a[i][j] << " ";
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ll_s long
#define mod 1000000007
#define forn(i,start,lim) for(ll i=start;i<lim;i++)
#define forn_d(i,start,lim) for(ll i=start;i>=lim;i--)
#define f first
#define s second
#define pb push_back
#define pf push_front
#define mp make_pair
#define debug1(a) cout<<"------\n"<<#a<<" = "<<a<<endl<<"------"<<endl
#define debug2(a,b) cout<<"--------------\n"<<#a<<" = "<<a<<" ; "<<#b<<" = "<<b<<endl<<"--------------"<<endl
#define debug3(a,b,c) cout<<"----------------------\n"<<#a<<" = "<<a<<" ; "<<#b<<" = "<<b<<" ; "<<#c<<" = "<<c<<endl<<"----------------------"<<endl
#define sz(a) (ll)(a.size())
#define debug4(a) cout<<"chu "<<a<<endl
#define endl "\n"

int main()
{
  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  ll n,d,cnt=0;
  cin>>n>>d;
  forn(i,0,n){
    ll x,y;
    cin>>x>>y;
    if(x*x+y*y<=d*d)
      cnt++;
  }

cout<<cnt<<endl;
  return 0;
}


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

#define ll long long 

int main() {
    ios::sync_with_stdio(0); 

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

    map<int, ll> mp; 
    for (auto x : a) mp[x]++;

    ll total = 0; 
    for (auto x : mp) {
        total += max(0LL, x.second * (x.second - 1)/2);
    }

    for (auto x : a) {
        ll curr = total;
        curr -= max(0LL, mp[x] * (mp[x] - 1) / 2);
        curr += max(0LL, (mp[x] - 1) * (mp[x] - 2) / 2);
        cout << curr << endl;
    }

    return 0; 
}



Measured memory_bytes: 11936
#include <bits/stdc++.h>
using namespace std;
// Multiple Gift
typedef pair<int, int> P;

int main(){
    long long X, Y;
    long long a = 0;
    int count = 0;

    cin >> X >> Y;
    a = X;
    while(a <= Y){
        count++;
        a = a * 2;
    }

    cout << count << endl;

    return 0;
}

Measured memory_bytes: 3544
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll ; 
typedef long double ld ;
typedef pair<ll , ll> pll ;

const ll N = 2e5 + 30 , Mod = 998244353 ;
const ll SQ = 330 ;

ll d[N] , cnt[N] ;
ll pw (ll x , ll y) {
	ll res = 1 ;
	while (y) {
		if (y & 1) res = (res * x) % Mod ;
		x = (x * x) % Mod ;
		y >>= 1 ;
	}
	return res ;
}
int main () {
    ios::sync_with_stdio(0), cin.tie(0) ;
    ll n ;
    cin >> n ;
    ll mx = 0 ;
    //cout << pw(2 , 1) << endl;
    for (int i = 1 ; i <= n ;i ++) cin >> d[i] , cnt[d[i]] ++ , mx = max(mx , d[i])  ;
    if (d[1] || cnt[0] > 1) return cout << 0 , 0 ;
    ll ans = 1 ;
    for (int i = 1 ; i <= mx ; i ++) {
    	ans = (ans * pw(cnt[i - 1] , cnt[i])) % Mod ;
	}
	cout << ans << endl;
    return (0) ;
}

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

struct strc{
    string keys;
    int keyv;
    int val;

    strc(int kv,int v){
        keyv=kv;
        val=v;
    }

    strc(string s,int kv,int v){
        keys=s;
        keyv=kv;
        val=v;
    }
};

bool cmp(const strc &a,const strc &b){
    return a.val<b.val;
}

int main(){
    map<int,int> m1;
    vector<strc> v1;

    int ans=0;
    int n,a,k;
    cin >> n>>k;
    int spe=0;

    for (int i = 0; i < n; i++){
        cin >>a;
        if(m1.find(a) != m1.end())m1[a]++;
        else m1[a]=1;
    }

    for (auto i = m1.begin(); i != m1.end(); i++){
        v1.push_back(strc(i->first,i->second));
        spe++;
    }
    
    sort(v1.begin(),v1.end(),cmp);

    for (int i = 0; i < spe-k; i++){
        ans += v1[i].val;
    }

    //cout <<fixed<<setprecision(16)<< << endl;
    cout << ans << endl;

    //if(flag==1)cout << "Yes" <<endl;
    //else cout << "No" <<endl;
    
    return 0;
}


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

using namespace std;

using ll = long long;
using ull = unsigned long long;

template<class T>
T read() {
    T x{};
    cin >> x;
    return x;
}

template<class T>
vector<T> read(int N){
    vector<T> x(N);
    for(int i = 0; i < N; ++i){
        cin >> x[i];
    }
    return x;
}

template<class T>
void write(const T &x){ cout << x << endl; }

int main(){
    auto S = read<string>();
    if(S == "Sunny"){ write("Cloudy"); }
    if(S == "Cloudy"){ write("Rainy"); }
    if(S == "Rainy"){ write("Sunny"); }
}



Measured memory_bytes: 256
input = gets.split(" ")
w = input[0].to_i
h = input[1].to_i
x = input[2].to_i
y = input[3].to_i
r = input[4].to_i

top_x = x
top_y = y + r

bottom_x = x
bottom_y = y - r

right_x = x + r
right_y = y

left_x = x - r
left_y = y


if 0 <= left_x && 0 <= bottom_y && top_y <= h && right_x <= w
	puts "Yes"
else
	puts "No"
end

Measured memory_bytes: 6108
from itertools import accumulate
from math import *
import os, sys
from io import BytesIO
 
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
 
N = int(input())
A = list(map(int, input().split()))
 
 
class FenV:
    def __init__(self, n):
        self.size = n
        self.bit = [0] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.bit[i]
            i -= (i & -i)
        return s
 
    def add(self, i, x):
        while i <= self.size:
            self.bit[i] += x
            i += (i & -i)
 
    def reset(self):
        self.bit = [0] * (self.size + 1)
 
 
BIT = FenV(N + 1)
ng, ok = 10 ** 9 + 1, 0
while abs(ok - ng) > 1:
    X = (ok + ng) // 2
 
    B = [(1 if a >= X else -1) for a in A]
    B = [0] + list(accumulate(B))
 
    tmp = 0
    B_sorted = {b: i for i, b in enumerate(sorted(B), start=1)}
    BIT.reset()
    for j, b in enumerate(B):
        tmp += BIT.sum(B_sorted[b])
        BIT.add(B_sorted[b], 1)
 
    if tmp >= ceil((N * (N + 1) // 2) / 2):
        ok = X
    else:
        ng = X
 
print(ok)


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

int main() {
    long N, M;
    cin >> N >> M;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.begin(), A.end(), greater<int>());
    long double sum = 0;
    for (int i = 0; i < N; i++) {
        sum += A[i];
    }
    if (A[M - 1] >= sum / (long double) (4 * M)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();
    
    if(a%2 == 0 || b%2 == 0) {
    	System.out.println("Even");
    }
    else {
    	System.out.println("Odd");
    }
  }
}

Measured memory_bytes: 21972
// ABC164
// b.cs

using System;

class B
{
    public static void Main()
    {
        string[] str = Console.ReadLine().Split(' ');
        int A = int.Parse(str[0]);
        int B = int.Parse(str[1]);
        int C = int.Parse(str[2]);
        int D = int.Parse(str[3]);


        for (int i = 0; ;)
        {
            C -= B;
            if (C <= 0)
            {
                Console.WriteLine("Yes");
                break;
            }
            A -= D;
            if (A <= 0)
            {
                Console.WriteLine("No");
                break;
            }
        }
    }
}

Measured memory_bytes: 27428
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N, K;
	cin >> N >> K;

	int a[100001] = {};
	ll s[100002], sa[100002];
	s[0] = 0;
	sa[0] = 0;
	rep1(i, N) {
		cin >> a[i];
		s[i] = s[i - 1] + a[i];
		sa[i] = sa[i - 1] + max(a[i], 0);
	}

	ll kotae = 0;
	for (int i = 1; i <= N - K + 1; i++) {
		ll kari = max(s[i + K - 1] - s[i - 1], 0ll) + sa[i - 1] + sa[N] - sa[i + K - 1];
		kotae = max(kotae, kari);
	}
	co(kotae);

	Would you please return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

#ifdef local
	#include "debug/debug.h"
#endif


#ifndef local
	#define deb(x...) ;	
#endif

#define int long long  
#define ll long long
#define vi vector <int>
#define vii vector <pair<int,int> >
#define vvi vector <vi>
#define rep(i,a,b) for (int i=a;i<b;i++)
#define repD(i,a,b) for (int i=a;i>b;i--)
#define pb push_back
#define pii pair <int,int>
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define MOD 1000000007
#define M_PI 3.14159265358979323846 

typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
///*X.find_by_order("index")
///X.order_of_key("key")

///----------------------------------------------------------------------------------

int n, k, p[5001], c[5001];
bool vis[5001];
vvi chains;

int f(vi &chain)
{
	vi vals;
	int sum = 0;
	for (int index: chain) vals.pb(c[index]), sum += c[index];
	rep(i,0,chain.size()) vals.pb(vals[i]);

	vi pref(2*n);
	pref[0] = vals[0];		
	rep(i,1,2*chain.size()) pref[i] = pref[i-1] + vals[i];
	
	int res = 0;
	bool started = false;
	if (sum >= 0) res += sum*(k/chain.size()), started = true;
	
	if (started)
	{
		int rem = k % chain.size();	
		int best = LLONG_MIN;
		if (rem == 0)
		{
			rem = chain.size() - 1;
			res -= sum;
			best = max(best, sum);
		}
		
		rep(i,1, rem+1)
		{
			rep(j,0,chain.size())
			{
				best = max(best, pref[j + i - 1] - (j == 0? 0 : pref[j-1]));
			}
		}
		res += max(0LL, best);
		return res;
	}
	else
	{
		int rem = min(k, (int)chain.size());
		int best = LLONG_MIN;
		if (rem == chain.size())
		{
			rem = chain.size() - 1;
			best = max(best, sum);
		}
		
		rep(i,1, rem+1)
		{
			rep(j,0,chain.size())
			{
				best = max(best, pref[j + i - 1] - (j == 0? 0 : pref[j-1]));
			}
		}
		res = best;
		return res;
	}
	
}
void solve()
{
	cin >> n >> k;
	rep(i,0,n) cin >> p[i], p[i]--;
	rep(i,0,n) cin >> c[i];
	memset(vis, 0, sizeof vis);
	rep(i,0,n)
	{
		if (!vis[i])
		{
			int cur = i;
			vi chain;
			while(true)
			{
				vis[cur] = true;
				chain.pb(cur);
				if (vis[p[cur]]) break;
				cur = p[cur];
			}
			chains.pb(chain);
		}
	}
	int ans = LLONG_MIN;
	for (auto chain: chains) ans = max(ans, f(chain));
	cout << ans << "\n";
	
}
signed main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	
	#ifdef local
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	clock_t TIMER = clock();
	#endif
	
	int t = 1;
	//cin >> t;
	rep(a,0,t)
	{
		//cout<<"Case #"<<a+1<<": ";
		solve();
		#ifdef local
		cout << "\n";
		#endif

	}
	
	#ifdef local
	{TIMER = clock() - TIMER;double time_taken = ((double)TIMER)/CLOCKS_PER_SEC;cerr<<fixed<<setprecision(5)<<"\n\nTime Taken : "<<time_taken<<" seconds\n";}
	#endif
}


Measured memory_bytes: 3924
#include <iostream>
#include <string>
using namespace std;
int main()
{
	int a, b, max, ans;
	cin >> a >> b;
	if(a == b) ans = a+a;
	if(a != b){
		max = (a > b)? a : b;
		ans = max+(max-1);
	}
	cout << ans <<endl;
	return 0;
}

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

#define FIN ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define fore(i,a,b) for(int i = a; i < b; i++)
#define rfor(i, a, b) for(int i = a - 1; i >= b; i--)

ll n,h[100010],dp[100010];
int k;
int main(){
    cin>>n>>k;
    fore(i,0,n)cin>>h[i];

    dp[0] = h[0];
    fore(i,1,k+1){
        dp[i] = abs(h[0]-h[i]);
    }

    fore(i,k+1,n){
        int l = max(0,i-k);
        ll m = 100000000000000;
        for(int j = l; j < i; j++){
            m = min(m,abs(h[j]-h[i])+ dp[j]);
        }
        // cout<<m<<" "<<i<<endl;
        dp[i] = m;
    }
    cout<<dp[n-1]<<endl;
    return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<deque>
using namespace std;

using ll = long long;
const int INF = 1001001001;
const ll LLINF = 1001001001001001001;
const int MOD = 1000000007;

#define rep(i,n) for (int i = 0; i < (n); ++i)

int main(void)
{
  int s, w;
  cin >> s >> w;
  if (s <= w) cout << "unsafe" << endl;
  else cout << "safe" << endl;
}


Measured memory_bytes: 3632
//sapce reduction - O(N)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
double pi = acos(-1.0);
const double EPS=1e-9;
#define MOD ll(1e9L+7)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define t() ll tt;cin>>tt;while(tt--) 


int main()
{
    fastio;
    ll i,j,n,m;
    cin>>n;
    vector<double>prob(n);
    vector<double>dp(n+1);
    // dp[i] = probability of i heads till now
    for(i=0;i<n;i++) cin>>prob[i];
    dp[0]=1-prob[0];
    dp[1]=prob[0];

    for(i=1;i<n;i++)
        for(j=n;j>=0;j--)
            dp[j] = (j>0 ? dp[j-1]*prob[i] : 0) + dp[j]*(1-prob[i]) ;
    
    double ans=0.0;
    for(i=n/2 + 1;i<=n;i++)
        ans += dp[i];
    cout<<fixed<<setprecision(12)<<ans;


}

Measured memory_bytes: 3904
#include "bits/stdc++.h"

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

long long gcd(long long a, long long b){
    if (a % b == 0)return(b);
    else return(gcd(b, a % b));
}

long long lcm(long long a, long long b) {
	return a * b / gcd(a, b);
}


int main() {
	long long A, B, K;
	cin >> A >> B >> K;
	if (K > A) {
		B = max(B + A - K, 0LL);
		A = 0;
	}
	else {
		A -= K;
	}
	cout << A << " " << B;
}

Measured memory_bytes: 256
#-*-coding:utf-8-*-

def main():
    n = int(input())
    arrys = [tuple(map(int, input().split())) for _ in range(n)]
    for i in range(101):
        for j in range(101):
            for x_tmp, y_tmp, h_tmp in arrys:
                if h_tmp != 0:
                    break
            H = h_tmp + abs(x_tmp - i) + abs(y_tmp - j)
            for x_t, y_t, h_t in arrys:
                if h_t != max(H - abs(x_t - i) - abs(y_t - j), 0):
                    break
            else:
                print(i, j, H)
                exit()

if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public final class Main {

    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int x = in.nextInt();
        int t = 0;
        final Map<Long, Integer> map = new HashMap<>();
        while (Math.pow(t, 5) < 1e18) {
            map.put((long) Math.pow(t, 5), t);
            map.put((long) Math.pow(-t, 5), -t);
            t++;
        }
        twoSum(x, map);
    }

    public static void twoSum(int target, Map<Long, Integer> map) {
        for (long num : map.keySet()) {
            if (map.containsKey(target + num)) {
                System.out.println(map.get(target + num) + " " + map.get(num));
                return;
            } else if (map.containsKey(num - target)) {
                System.out.println(map.get(num) + " " + map.get(num - target));
                return;
            }
        }
    }
}


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

int main(){
    int A;
    int a[1000010];
    int B;
    int b[1000010];
    map <int,int> mpa,mpb;
    
    cin>>A;
    for(int i=0;i<A;i++){
        cin>>a[i];
        mpa[a[i]]++;
    }
    cin>>B;
    for(int i=0;i<B;i++){
        cin>>b[i];
        mpb[b[i]]++;
    }
    
    for(int i=0;i<B;i++){
        int x=b[i];
        if(mpb[x]>mpa[x]){
            cout<<"NO"<<endl;
            return 0;
        }
    }
    cout<<"YES"<<endl;
}

Measured memory_bytes: 23936
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<queue>
using namespace std;
#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

signed main()
{
	int X, A;
	cin >> X >> A;
	if (X < A)cout << 0;
	else cout << 10;
}

Measured memory_bytes: 256
{-# LANGUAGE BangPatterns #-}

module Main where

import Data.Char
import Control.Monad
import Control.Applicative


readInt :: IO Int
readInt = read <$> (input `seq` input)
    where input = do
            !c <- getChar
            if isDigit c
                then (c :) <$> input
                else return []

main = putStrLn . f =<< readInt
    where
        f n = let h = n `div` 3600
                  m = (n `div` 60) `mod` 60
                  s = n `mod` 60
              in show h ++ ":" ++ show m ++ ":" ++ show s


Measured memory_bytes: 3616
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

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

    if(r < 1200) {
        cout << "ABC";
    }
    else if(r < 2800) {
        cout << "ARC";
    }
    else {
        cout << "AGC";
    }
    
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
n,a,b = list(map(int,input().split()))

MOD = 10**9+7

def comb(n,r,MOD):
    x = n+1
    y = min(r,n-r)
    
    numer = 1
    denom = 1
    
    for i in range(1,r+1):
        numer = numer*(x-i)%MOD
        denom = denom*(i)%MOD
    
    return numer * pow(denom,MOD-2,MOD) % MOD

nCa = comb(n,a,MOD)
nCb = comb(n,b,MOD)

ans = pow(2,n,MOD)-1 - nCa - nCb

if ans < 0:
    print((ans+MOD)%MOD)
else:
    print(ans%MOD)

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

using namespace std;

int main(){
	int N;
	cin >> N;
	
	int a[N];
	
	for(int i=1;i<=N;i++){
		cin >> a[i-1];
	}
	
	sort(a,a+N);
	
	
	int ans = 0;
	int flag = 0;
	for(int i=N-1;i>=0;i--){
		if(flag % 2 == 0){
			ans += a[i];
		}
		else{
			ans -= a[i];
			
		}
		flag++;
	}
	cout << ans << endl;
	
	
       return 0;
}

Measured memory_bytes: 256
import java.math.*;
import java.io.*;
import java.util.*;
public class Main {

	static int[] w;
	static int[] v;
	static int n;
	static int W;
	static int[][] dp;
	
	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer(br.readLine());
		n=Integer.parseInt(st.nextToken());
		W=Integer.parseInt(st.nextToken());
		w=new int[n];
		v=new int[n];
		dp=new int[n+1][W+1];
		for(int i=0;i<n;i++){
			st=new StringTokenizer(br.readLine());
			v[i]=Integer.parseInt(st.nextToken());
			w[i]=Integer.parseInt(st.nextToken());
			Arrays.fill(dp[i],-1);
		}
		
		
		for(int i=0;i<=W;i++){
			dp[n][i]=0;
		}for(int i=n-1;i>=0;i--){
			for(int j=0;j<=W;j++){
				if(j<w[i]){
					dp[i][j]=dp[i+1][j];
				}
				else{
					dp[i][j]=Math.max(Math.max(dp[i+1][j],dp[i+1][j-w[i]]+v[i]),dp[i][j-w[i]]+v[i]);
				}
			}
		}
		System.out.println(dp[0][W]);
		
		
	}
	

}

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

using namespace std;

int main(){
	const int mod = 1e9+7;
	int n,k;
	cin >> n >> k;
	vector<int> a(n);
	vector<vector<long long> > dp(n,vector<long long>(k+2));
	for(int i = 0; i < n; i++) cin >> a[i];
	for(int i = 0; i <= a[0]; i++) dp[0][i]++;
	for(int i = 0; i < n-1; i++){
		for(int j = 0; j <= k; j++){
			int l = j;
			int r = min(a[i+1]+l+1,k+1);
			dp[i+1][l]+=dp[i][j];
			dp[i+1][r]-=dp[i][j];
		}
		for(int j = 1; j <= k; j++){
			dp[i+1][j]+=dp[i+1][j-1];
			dp[i+1][j]%=mod;
		}
	}
	cout << (dp[n-1][k] + mod)%mod << "\n";
	return 0;
}


Measured memory_bytes: 80624
n=int(input())
S=input()
w,e='W','E'
if e not in S or w not in S:print(0);exit()
ecnt=len([1 for i in list(S) if i==e])
l=[0 for i in range(n)]
l[0]=(0,ecnt-int(S[0]==e))
p0,p1=l[0]
for i in range(1,n):
  l[i]=(p0+int(S[i-1]==w),p1-int(S[i]==e))
  #(l and gyaku,r and gyaku)
  p0,p1=l[i]
print(min([a+s for a,s in l]))

Measured memory_bytes: 55776
package main

import "fmt"

func main() {

	var a1, b1, a2, b2 float64
	fmt.Scanln(&a1, &b1, &a2, &b2)

	n := (a1-a2)*(a1-a2) + (b1-b2)*(b1-b2)

	x := 1.0

	if n == 0 {
		fmt.Println(0)
	} else 
	{
		for i := 0; i < 10000; i++ {
			x = x - (x*x-n)/(2*x)
			if (x*x-n)/(2*x) < 0.00001 {
				break
			}
		}
	fmt.Println(x)
	}
}



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

int main() {
  int n, cnt, result = 0;
  cin >> n;

  for (int i = 1; i <= n; i++) {
    cnt = 0;
    for (int j = 1; j <= i; j += 2)
      if (i % j == 0) cnt++;
    if (cnt == 8) result++;
  }

  cout << result << endl;
}

Measured memory_bytes: 3608
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
vector<int> g[110];
bool used[110];
bool finish[110];
bool ok;
void dfs(int x){
	used[x]=1;
	for(auto y:g[x]){
		if(used[y] && !finish[y]) ok=1;
		if(!used[y]) dfs(y);
	}
	finish[x]=1;
}
int main()
{
    int n, m;
    cin>>n>>m;
    for(int i=0; i<m; i++){
        int s, t;
        cin>>s>>t;
        g[s].push_back(t);
    }
    for(int i=0; i<n; i++){
        if(used[i]) continue;
        dfs(i);
        if(ok){
            cout<<1<<endl;
            return 0;
        }
    }
    cout<<0<<endl;
	return 0;
}



Measured memory_bytes: 3164
N = int(input())
MOD = 10**9+7

ans1 = 1
ans2 = 1
ans3 = 1
for _ in range(N):
    ans1 = (ans1*10)%MOD
    ans2 = (ans2*9)%MOD
    ans3 = (ans3*8)%MOD

ans = ((ans1 + ans3)%MOD - (ans2*2)%MOD)%MOD 
print(ans)    

Measured memory_bytes: 9208
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#include <map>
#define REP(i,n) for(int i = 0; i < (int)n; i++)
using namespace std;

int main(){
  int n;
  cin >> n;
  map<long long,int> cnt;
  vector<long long> v;
  REP(i,n){
    long long a;
    cin >> a;
    cnt[a]++;
    if(cnt[a]==2){
      v.push_back(a);
      cnt[a] = 0;
    }
  }
  sort(v.begin(),v.end(),greater<long long>());
  long long ans;
  if(v.size()==0||v.size()==1){
    ans = 0;
  }else{
    ans = v[0]*v[1];
  }
  cout << ans << endl;
}


Measured memory_bytes: 6528
import sys
input = sys.stdin.readline
from collections import Counter


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    count = Counter(A)
    ans = 0
    for v in count.values():
        if v % 2 == 1:
            ans += 1
    return ans


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))


Measured memory_bytes: 16628
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<ll> &v) {
    std::for_each(v.begin(), v.end(), [](ll x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N, A, B, C, D;
    cin >> N >> A >> B >> C >> D;
    string S;
    cin >> S;
    //超えないと行けない時にめんどくさい
    int cnt = 0;
    int F = max(C, D);
    for(size_t i = A - 1; i < F; i++) {
        if(S[i] == '#') {
            cnt++;
        } else {
            cnt = 0;
        }
        if(cnt >= 2) {
            cout << "No" << endl;
            return 0;
        }
    }

    if(B >= C) {
        cout << "Yes" << endl;
        return 0;
    }

    if(C <= D) {
        cout << "Yes" << endl;
        return 0;
    }
    // AからCへ
    // BからDへ
    if(D <= C) {
        cnt = 0;
        for(int i = B - 2; i < D + 1; i++) {
            if(S[i] == '.') {
                cnt++;
            } else {
                cnt = 0;
            }
            if(cnt >= 3) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

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

int main()
{
    std::string s;
    std::string chars;

    std::cin>>s;

    if(s.length()%2!=0){
        std::cout<<"No"<<"\n";
        return 0;
    }

    for(int i=0; i<s.length();i++){
        if(chars.find(s[i])==std::string::npos){
            chars.push_back(s[i]);
        }
    }

    for(int i=0;i<chars.length();i++){
        int count = 0;
        std::string::size_type pos = s.find(chars[i]);
        while(pos != std::string::npos){
            count++;
            pos = s.find(chars[i], pos+1);
        }
        if(count%2!=0){
            std::cout<<"No"<<"\n";
            return 0;
        }
    }
    std::cout<<"Yes"<<"\n";
    return 0;
}

Measured memory_bytes: 256
o=list(input())
e=list(input())
l=[]
if len(o)==len(e):
    for i in range(len(o)):
        l.append(o[i])
        l.append(e[i])
    print("".join(l))
else:
    for i in range(len(e)):
        l.append(o[i])
        l.append(e[i])
    l.append(o[len(o)-1])
    print("".join(l))


Measured memory_bytes: 3060
def main():
    import sys

    input = sys.stdin.readline

    x, y, z, k = map(int, input().split())
    A = sorted(map(int, input().split()), reverse=True)
    B = sorted(map(int, input().split()), reverse=True)
    C = sorted(map(int, input().split()), reverse=True)

    AB = sorted((a + b for a in A for b in B), reverse=True)[:k]
    ret = sorted((ab + c for ab in AB for c in C), reverse=True)[:k]

    print(*ret, sep='\n')


main()


Measured memory_bytes: 143104
n = int(input())
a = list(map(int, input().split()))
c = 0
for i in range(n-1):
  if i+1 == a[i]:
    a[i],a[i+1] = a[i+1],a[i]
    c += 1

if n == a[n-1]:
  c += 1
print(c)

Measured memory_bytes: 83836
m1 = 0;m2 = 0;m3 = 0
for i in range(1,11):
    m = int(input())
    if m>=m1:
        m3 = m2;m2 = m1;m1 = m
    elif m2<=m<m1:
        m3 = m2;m2 = m
    elif m3<=m<m2:
        m3 = m

print(m1)
print(m2)
print(m3)

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



// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    // Failed to predict input format
    int n, k;
    cin >> n>> k;
    vector<int> sunuke(n+1);
    fill(sunuke.begin(), sunuke.end(), 0);

    int d;
    for(int i = 0; i < k; i++) {
        cin >> d;
        for(int i = 0; i < d; i++) { 
            int a;
            cin >> a;
            sunuke[a] +=1;
        }
    }

    int res = 0;
    for(int i = 1; i < sunuke.size(); i++) {
        if(sunuke[i] == 0) res++;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;

#define REP(i,n) for(long long i = 0; i < (n); i++)
#define FOR(i, m, n) for(long long i = (m);i < (n); ++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;

const ll MOD = (ll)1e9 + 7;
const ll MOD2 = 998244353;
const ll HIGHINF = (ll)1e18;
const ll LOWINF = (ll)1e15;
const long double PI = 3.1415926535897932384626433;

template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max<T>(a,b);}
template <class T> void chmin(T& a, const T b){a=min<T>(a,b);}
void YN(bool flg) {cout << ((flg) ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << ((flg) ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << ((flg) ? "yes" : "no") << endl;}

int main() {
	int A,B,C,D,E;
	cin >> A >> B >> C >> D >> E;
	ll F,G,H,I,J;
	F = A;
	G = B;
	H = C;
	I = D;
	J = E; 
	if(A%10!=0) F = ((A/10)+1)*10;
	if(B%10!=0) G = ((B/10)+1)*10;
	if(C%10!=0) H = ((C/10)+1)*10;
	if(D%10!=0) I = ((D/10)+1)*10;
	if(E%10!=0) J = ((E/10)+1)*10;
	ll ans = 1000;
	
	chmin(ans,A+G+H+I+J);
	chmin(ans,F+B+H+I+J);
	chmin(ans,F+G+C+I+J);
	chmin(ans,F+G+H+D+J);
	chmin(ans,F+G+H+I+E);

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using P = pair<int64_t, int64_t>;
int main() {
    #ifdef DEBUG
    std::ifstream in("/home/share/inputf.in");
    std::cin.rdbuf(in.rdbuf());
    #endif
    int N;
    cin >> N;
    bool p = false, m = false;
    vector<int> x(N);
    for(int i = 0; i < N; i++) {
        cin >> x[i];
    }
    int M;
    vector<P> ans;
    sort(x.begin(), x.end());
    if(x.back() <= 0) {
        M = x.back();
        for(int i = N - 2; i >= 0; i--) {
            ans.push_back({M, x[i]});
            M -= x[i];
        }
    } else if(x.front() >= 0) {
        M = x.front();
        for(int i = 2; i < N; i++) {
            ans.push_back({M, x[i]});
            M -= x[i];
        }
        ans.push_back({x[1], M});
        M = x[1] - M;
    } else {
        int j = 0;
        for(; x[j] < 0; j++);
        M = x.front();
        for(int i = j + 1; i < N; i++) {
            ans.push_back({M, x[i]});
            M -= x[i];
        }
        ans.push_back({x[j], M});
        M = x[j] - M;
        for(int i = 1; i < j; i++) {
            ans.push_back({M, x[i]});
            M = M - x[i];
        }
    }

    cout << M << endl;
    for(int i = 0; i < ans.size(); i++) {
        cout << ans[i].first << " " << ans[i].second << endl;
    }
    return 0;
}

Measured memory_bytes: 3952
#include<cstdio>
#include<iostream>
#include<array>

char O[52], E[52];
char ans[102];
bool Onl = false, Enl = false;
int lg;
int main(){
  std::cin >> O;
  //O = in;
  std::cin >> E;

  for(int l = 0; ; l++){
    if(l % 2){//odd
      if(E[l/2] == '\0'){
        Enl = true;
        if(Onl && Enl){
          lg = l-1;
          break;
        }else{
          continue;
        }
      }
      ans[l] = E[l/2];
    }else{
      if(O[l/2] == '\0'){
        Onl = true;
        if(Onl && Enl){
          lg = l-1;
          break;
        }else{
          continue;
        }
      }
      ans[l] = O[l/2];
    }

  }

  ans[lg] = '\0';
  std::cout << ans;

  return 0;

}


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

#define pb push_back
#define F first
#define S second
#define fo(i,a,b)  for(int i = a; i < b; i++)

using ll = long long;
using ld = long double;
using ul = unsigned long long;
using ii = pair<int, int>;
#define Mosta     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ReadFile            freopen("input.in","r",stdin)
#define WriteFile           freopen("output.txt","w",stdout)
const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f;
const ld EPS = 1e-7;
double Pi=acos(-1);
const ld rad=Pi/180.0;
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
ll nCr (ll n,ll m)
{
    return(m == 0)?1:n*nCr(n-1,m-1)/m;
}
/*****************************************************/

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

    cin >> a >> b >> c;

    if(a+b >= c)
        cout << "Yes\n";
    else
        cout << "No\n";

	return 0;
}


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

int main(){
    long long n;
    cin >> n;
    vector<long long> count(10001, 0);

    for(long long x = 1; x <= 100; x++){
        for(long long y = 1; y <= 100; y++){
            for(long long z = 1; z <= 100; z++){
                long long a = x*x + y*y + z*z + x*y + y*z + z*x;
                if(a <= 10000){
                    count[a]++;
                }
            }
        }
    }

    for(long long i = 1; i <= n; i++){
        printf("%lld\n", count[i]);
    }
    return 0;
}

Measured memory_bytes: 3776
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
  string s, t;
  cin >> s >> t;
  sort(s.begin(), s.end());
  sort(t.begin(), t.end());
  reverse(t.begin(), t.end());
  if (s < t){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

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

#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define irrep(i,n) for(int i = (int)(n-1); i > -1; i--)
#define irrep2(i,n,a) for(int i = (int)(n); i >= (int)(a); i--)
#define fi first
#define se second

using ll = long long;
using v_int = std::vector<int>;
using v2_int = std::vector<v_int>;
using v_ll = std::vector<ll>;
using v2_ll = std::vector<v_ll>;
using v_string = std::vector<std::string>;
using v_bool = std::vector<bool>;
using v2_bool = std::vector<v_bool>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;
using mii = std::map<int, int>;
using mll = std::map<ll, ll>;

const double PI = 3.1415926535897932;
const int INF = 2*(int)1e9;
const ll LINF = (ll)1e18;
const ll MOD = 1000000007;
//const int dc[4] = {1, -1, 0,  0};
//const int dr[4] = {0,  0, 1, -1};
const int dr[8] = {0,  0, 1, -1, 1,  1, -1, -1};
const int dc[8] = {1, -1, 0,  0, 1, -1,  1, -1};

using namespace std; 

template<typename T, typename U> inline
ostream& operator<<(ostream &o, pair<T,U> &p)
{
    return o << "{" << p.first << "," << p.second << "}";
}

template<typename T> inline
istream& operator>>(istream &is, vector<T> &v)
{
    int len = (int)v.size();
    for(int i = 0; i < len; i++) {
        is >> v[i]; 
    }
    return is;
}

template<typename T> inline
ostream& operator<<(ostream &os, vector<T> &v)
{
    int len = (int)v.size();
    for(int i = 0; i < len; i++) { 
        os << v[i];
        if(i != len-1) { os << ","; } 
    } 
    return os;
}

template<typename T> inline
void chmin(T &a, T b) { a = min(a, b); }

template<typename T> inline
void chmax(T &a, T b) { a = max(a, b); }

int main(void) 
{
    int n;
    cin >> n;
    v_ll a(n);
    
    cin >> a;

    irep(i, n-1) {
        a[i+1] += a[i];
    }
    mll mp;
    for(auto sum : a) {
        mp[sum]++;
    }
    ll ans = 0;
    for(auto sum : mp) {
        if(sum.se >= 1) {
            ans += sum.se*(sum.se-1)/2;
            if(sum.fi == 0) { ans += sum.se; }
        }
    }
    cout << ans << endl;
    return 0;
}
/*atcoder*/


Measured memory_bytes: 17168
import numpy

n,k = map(int,input().split())
li = [(int(x)*(int(x)+1))/(2*int(x)) for x in input().split()]
a = numpy.cumsum(li)
ans = 0
for i in range(n-k+1):
    if i == 0:
        ans = a[i+k-1]
    else:
        if ans < (a[i+k-1] - a[i-1]):
            ans = a[i+k-1] - a[i-1]
print(ans)

Measured memory_bytes: 32240
#include <iostream>
#include <math.h>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    int A, B;
    cin >> A >> B;

    /*
    int minN = max(floor(A * 100 / 8), floor(B * 10));
    int maxN = min(floor((A+1) * 100 / 8), floor((B+1) * 10));

    int ans = 0;
    bool ok = false;
    for (int i = minN; i < maxN; i++)
    {
        if(floor(A*8/100) == A && floor(B*1/10) == B){
            ans = i;
            ok = true;
            break;
        }
    }
    if(ok){
        cout << ans << endl;
    }
    else{
        cout << -1 << endl;
    }
    */

    int ans;
    bool ok = false;
    for (int i = 1; i < 10000; i++)
    {
        if(floor(i*8/100) == A && floor(i*10/100) == B){
            ok = true;
            ans = i;
            break;
        }
    }
    if(ok){
        cout << ans << endl;
    }
    else{
        cout << -1 << endl;
    }
}


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

using namespace std;

template <class T>inline T updmax(T& a, T b) {return a = max(a, b);}
template <class T>inline T updmin(T& a, T b) {return a = min(a, b);}

class Solution {
public:
	void solve() {
		map<string, int> msi;
		msi["SUN"] = 7;
		msi["MON"] = 6;
		msi["TUE"] = 5;
		msi["WED"] = 4;
		msi["THU"] = 3;
		msi["FRI"] = 2;
		msi["SAT"] = 1;
		string s;
		cin >> s;
		cout << msi[s] << "\n";
		
		
		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
  int n, m;
  pair<long long, long long >p1[59], p2[59];
  cin >> n>> m;
  for(int i=0;i<n;i++){
    long long x, y;
    cin >> x >> y;
    p1[i] = make_pair(x, y);
  }
  for(int i=0;i<m;i++){
    long long x, y;
    cin >> x >> y;
    p2[i] = make_pair(x, y);
  }
  for(int i=0;i<n;i++){
    long long int mn=2000000000;
    int ans=0;
    for(int j=0;j<m;j++){
      if(mn> abs(p1[i].first-p2[j].first)+abs(p1[i].second-p2[j].second)){
        ans=j+1;
        mn = abs(p1[i].first-p2[j].first)+abs(p1[i].second-p2[j].second);
      }
    }
    cout << ans << endl;
  }
}

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP (i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back

using namespace std;

typedef long long ll;

// const int INF = 1 << 30;
// const ll INF = 1LL << 60;

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

  vector<pair<int, int>> dt(N);
  rep (i, N) cin >> dt[i].S >> dt[i].F;

  sort(rall(dt));

  ll ans = 0;
  priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
  map<int, int> cnt;
  rep (i, K) {
    ans += dt[i].F;
    cnt[dt[i].S]++;
    pq.push(dt[i]);
  }
  ans += (ll)sz(cnt) * sz(cnt);

  ll total = ans;
  REP (i, K, N) {
    if (cnt.count(dt[i].S) != 0) continue;

    while (!pq.empty()) {
      pair<int, int> p = pq.top();
      pq.pop();

      if (cnt[p.S] > 1) {
        ll s = sz(cnt);
        total = total + dt[i].F - p.F + (s + 1) * (s + 1) - s * s;
        cnt[p.S]--;
        cnt[dt[i].S]++;
        ans = max(ans, total);
        break;
      }
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 4724
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())

typedef long long ll;

const int MAX = 1024;
const int INF = 1<<29;

ll dp[MAX][MAX];

ll LCS(string s, string t) {
    memset(dp, 0LL, sizeof(dp));
    int sl = (int)s.size(), tl = (int)t.size();
    rep(sl, i) rep(tl, j) {
        if (s[i] == t[j]) dp[i+1][j+1] = dp[i][j]+1;
        else dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
    }
    return dp[sl][tl];
}

void solve(void){
    int N;
    cin >> N;
    rep(N, i) {
        string s, t;
        cin >> s >> t;
        cout << LCS(s, t) << endl;
    }
}

int main(void){
  solve();
  //cout << "yui(*-v・)yui" << endl;
  return 0;
}



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


ll dp(ll n){
    if(n==1)return 1;
    else{
        return 1+2*dp(n/2);
    }
}

int main(){
    ll h;
    cin>>h;
    ll ct;
    ct=dp(h);
    cout<<ct<<endl;
    return 0;
}





Measured memory_bytes: 256
import java.io.PrintWriter

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = nextList().map(String::toInt)
fun nextLongList() = nextList().map(String::toLong)
fun nextDoubleList() = nextList().map(String::toDouble)

val pw = PrintWriter(System.out)
fun print(s: Any) = pw.print(s)
fun println(s: Any) = pw.println(s)

fun main(args: Array<String>) {
    main()
    pw.flush()
}

fun main() {
    val (N, M) = nextIntList()
    val X = nextIntList()
    if (N >= M) {
        println(0)
    } else {
        val ans = X.sorted().windowed(2) { it[1] - it[0] }.sorted().take(M - N).sum()
        println(ans)
    }
}

fun <T, R> List<T>.windowed(size: Int, transform: (List<T>) -> R): List<R> {
    return (0..this.size - size step 1).map { i ->
        transform(this.slice(i until i + size))
    }
}

Measured memory_bytes: 59812
#include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1, (i)>=0; (i)--)
#define ios() cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
ll const MOD = 1e9+7;
ll const INF = 1e18;
using namespace std;

int main(){
    ll n, m;
    cin >> n >> m;
    ll ans = 0;
    vector<ll> fact(max(n,m)+1, 1);
    for(int i=1; i<fact.size(); i++){
        fact[i] = i*fact[i-1]%MOD;
    }
    if(abs(n-m) == 0){
        ans = fact[n]*fact[m]%MOD*2%MOD;
    }else if(abs(n-m) == 1){
        ans = fact[m]*fact[n]%MOD;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main () {
  long T1, T2, A1, A2, B1, B2;
  cin >> T1 >> T2 >> A1 >> A2 >> B1 >> B2;
  A1 -= B1;
  A2 -= B2;
  if(A1 * T1 + A2 * T2 == 0){
    cout << "infinity" << endl;
  } else {
    if((A1 < 0 && A2 < 0) || (A1 > 0 && A2 > 0))cout << 0 << endl;
    else {
      if(abs(A1 * T1) > abs(A2 * T2))cout << 0 << endl;
      else {
        if(abs(A1 * T1) % (abs(A2 * T2) - abs(A1 * T1)) == 0)cout << (abs(A1 * T1) + (abs(A2 * T2) - abs(A1 * T1)) - 1) / (abs(A2 * T2) - abs(A1 * T1)) * 2<< endl;
        else cout << (abs(A1 * T1) + (abs(A2 * T2) - abs(A1 * T1)) - 1) / (abs(A2 * T2) - abs(A1 * T1)) * 2 - 1<< endl;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 256