akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int d = sc.nextInt();
    int cnt = 0;

    for (int i = 0; i < n; i++) {
      int x = sc.nextInt();
      int y = sc.nextInt();
      if (Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)) <= d) {
        cnt++;
      }
    }

    System.out.println(cnt);

  }
}

Measured memory_bytes: 59208
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; }
int main()
{
  int n;cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];

  vector<int> cnt(n, 0);
  int maxi = 0;
  rep(i,n) {
    chmax(maxi, a[i]);
    cnt[a[i]]++;
  }
  
  if(maxi % 2 == 0) {
    bool f = true;
    rep(i,maxi/2) {
      if(cnt[maxi-i] < 2) {
	f = false;
      }
    }
    if(cnt[maxi/2] != 1) f = false;
    rep(i,maxi/2) {
      if(cnt[i] > 0) f = false;
    }
    cout << (f ? "Possible" : "Impossible") << "\n";
  }
  else {
    bool f = true;
    rep(i,maxi/2) {
      if(cnt[maxi-i] < 2) {
	f = false;
      }
    }
    if(cnt[(maxi+1)/2] != 2) f = false;
    rep(i,maxi/2) {
      if(cnt[i] > 0) f = false;
    }
    cout << (f ? "Possible" : "Impossible") << "\n";    
  }
  
  return 0;
}


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

typedef long long ll;
# define  pii pair<ll,ll> 
# define pb push_back
# define ff first 
# define ss second 



int main() {
	ll n;
	cin>>n;
	string s;
	cin>>s;
    ll cn=0;
	for(int i=1;i<=n;i++)
	{
		if(s[i]!=s[i-1]) cn++;
	}
    
    cout<<cn<<endl;


     return 0;
	
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main(){
  ll ans = 0;
  int N;
  cin >> N;
  rep(i, N + 1){
    if(i % 3 != 0){
      if(i % 5 != 0)
        ans += i;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
//typedef tree <int,null_type,less <int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#define rep(g, i, n) for (ll g = i; g < n; g++)
#define rev(g, n, i) for (ll g = n - 1; g >= i; g--)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(), v.end()
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define um unordered_multiset
#define us unordered_set
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define cc continue
#define bb break
#define rem 1000000007
#define debug(n1) cout<<"debug... "<<n1<<"\n"
//fflush(stdin);
// do {
// // process permutation
// } while (next_permutation(permutation.begin(),permutation.end()));
int main()
{
    FAST
    // freopen("input1.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    /*ll tests;
    cin>>tests;
    rep (gg,0,tests)
    {}*/
    ll n;
    cin>>n;
    ve <ll> fac;
    rep (i,1,10)
    {
        rep (j,1,10)
        {
            fac.pb(i*j);
        }
    }
    rep (i,0,fac.size())
    {
        if (n==fac[i])
        {
            cout<<"Yes\n";
            return 0;
        }
    }
    cout<<"No\n";

}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] H = new int[N];
		for(int i=0; i<N; i++)
			H[i] = sc.nextInt();
		
		H[0]--;
		
		boolean ok = true;
		for(int i=0; i<N-1; i++) {
			if(H[i+1]<H[i]) {
				ok = false;
				break;
			} else if(H[i+1]>H[i]) {
				H[i+1]--;
			}
		}

		System.out.println(ok ? "Yes" : "No");
		sc.close();
	}
}

Measured memory_bytes: 50060
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <utility>
#include <complex>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <tuple>
#include <bitset>
#include <limits>
#include <algorithm>
#include <array>
#include <random>
#include <complex>
#include <regex>
#include <iomanip>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define fcout cout << fixed << setprecision(10)
#define rep(i,n)    for(int i=0; i<(int)n; i++)
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define all(x) x.begin(), x.end()
#define F first
#define S second
const ll inf = 1e18;
const ll mod = 1e9 + 7;

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

// mod.m での a の逆元 a^(-1) を計算する。
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while(b){
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

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


int main(){
    int n,k;
    cin >> n >> k;
    vint a(n);
    rep(i,n) cin >> a[i];
    int l=0, r=k;
    rep(i, n-k){
        if(a[l] < a[r]){
            cout << "Yes" << endl;
        }else{
            cout<< "No" << endl;
        }
        l++; r++;
    }
}



Measured memory_bytes: 4048
using System;
using System.Linq;
using System.Collections.Generic;

namespace Make_Purse_Light
{
    class Program
    {
        static List<int> Coins = new List<int>() { 10, 50, 100, 500 };
        static bool flag = false;

        private static void Main(string[] args)
        {
            while (true)
            {
                // 会計金額
                int bill = int.Parse(Console.ReadLine());
                if (bill == 0) break;

                // 所持金
                List<int> ownedCoins = Console.ReadLine().Trim().Split(' ').Select(i => int.Parse(i)).ToList();
                // 所持枚数
                int ownedMoney = GetMoney(Coins, ownedCoins);

                // お釣り
                int changeMoney = ownedMoney - bill;
                // お釣り枚数
                List<int> changeCoins = Coins.Reverse<int>().Select(c => GetChange(ref changeMoney, c)).Reverse().ToList();

                // 支払い枚数
                List<int> paymentCoins = GetPayment(ownedCoins, changeCoins);

                WriteLines(paymentCoins);
            }
        }

        private static int GetChange(ref int money, int coin)
        {
            var result = money / coin;
            money = money % coin;
            return result;
        }

        private static void WriteLines(List<int> paymentCoins)
        {
            if (flag) Console.WriteLine(); else flag = true;
            for (int i = 0; i < Coins.Count(); i++)
            {
                if (paymentCoins[i] > 0)
                {
                    Console.WriteLine("{0} {1}", Coins[i], paymentCoins[i]);
                }
            }
        }

        private static int GetMoney(List<int> l1, List<int> l2)
        {
            int result = 0;
            for (int i = 0; i < l1.Count(); i++)
            {
                result += l1[i] * l2[i];
            }
            return result;
        }


        private static List<int> GetPayment(List<int> l1, List<int> l2)
        {
            List<int> result = new List<int>();
            for (int i = 0; i < l1.Count(); i++)
            {
                result.Add(l1[i] - l2[i]);
            }
            return result;
        }
    }
}


Measured memory_bytes: 9828
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<string>
#include<utility>
#include<array>
#include<set>
#include <numeric>
#include <boost/math/common_factor_rt.hpp>
#define EPS (1e-7)
using namespace std;
#define ll long long


int main() {

	int N;
	cin >> N;
	vector<int> H(N);
	string ans = "Yes";
	cin >> H[0];
	H[0] -= 1;
	int temp;
	for (auto i = 1; i < N; i++)
	{
		
		cin >> temp;
		if ((temp - 1) >= H[i - 1]) {
			H[i] = temp - 1;
		}
		else if (temp == H[i - 1]) {
			H[i] = temp;
		}
		else {
			ans = "No";
			break;
		}


	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0;i<n;i++)
#define repb(i, a, b) for(int i=a;i<b;i++)

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

const int INF = 1<<30;

int main(){
  int n;cin>>n;string s, t;cin>>s>>t;
  rep(i, n){
    cout<<s[i]<<t[i];
  }
  cout<<endl;
  return 0;
}


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

const int MAXN = 2e5+5;
const int INF = 1e9+7;
#define ll long long
#define pb push_back
#define endl '\n'
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F first
#define S second

ll poww(ll a, ll b, ll md) {
    return (!b ? 1 : (b & 1 ? a * poww(a * a % md, b / 2, md) % md : poww(a * a % md, b / 2, md) % md));
}

ll MOD(ll a){
    return ((a%INF)+INF)%INF;
}

ll inv(ll a){
    return poww(a,INF-2,INF);
}

int x[MAXN],y[MAXN];
vector<int> adjList[MAXN];
bool visited[MAXN];

void dfs(int start){
    visited[start] = true;
    for(auto u : adjList[start]) if(!visited[u]) dfs(u);
}

int main()
{
    fast_io;
    //cout << fixed << setprecision(15);

    int n,m;cin >> n >> m;
    for(int i=0;i<m;++i){
        int z;
        cin >> x[i] >> y[i] >> z;
        adjList[x[i]].pb(y[i]);
        adjList[y[i]].pb(x[i]);
    }
    int comp=0;
    for(int i=1;i<=n;++i) if(!visited[i]) dfs(i),++comp;
    cout << comp;
}



Measured memory_bytes: 12544
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_range(i, s, e) for (int i = (s); i < (int)(e); i++)
#define rep_rev(i, s, e) for (int i = (s)-1; i >= (int)(e); i--)
#define sort_vec(v) sort((v).begin(),(v).end())
typedef int64_t lint;
// lint mod = 998244353;

int app() {
  int n,t;
  cin>>n>>t;

  vector<int> a(n+1),b(n+1);
  rep(i,n){
    cin>>a[i+1]>>b[i+1];
  }

  int dp[n+1][t];
  int dpo[n+1][t];
  rep(j,t){
    dp[0][j]=0;
    dpo[0][j]=0;
  }

  rep_range(i,1,n+1){
    rep(j,t){
      if(a[i]<=j) dp[i][j]=max(dp[i-1][j-a[i]]+b[i], dp[i-1][j]);
      else dp[i][j]=dp[i-1][j];
      if(a[i]<=j) dpo[i][j]=max(dpo[i-1][j-a[i]]+b[i], max(dp[i-1][j]+b[i], dpo[i-1][j]));
      else dpo[i][j]=max(dp[i-1][j]+b[i], dpo[i-1][j]);
    }
  }

  return dpo[n][t-1];
}

int main(){cout<<app()<<endl;return 0;}


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

class Program
{
	static void Main(string[] args)
	{
		long sum = 0;
		long prev = 0;

		long n = Scan.Long();
		for (long i = 0; i < n; i++)
		{
			long a = Scan.Int();

			if (prev == 1 && a > 0)
			{
				a -= 1;
				sum += 1;
			}
			
			sum += a / 2;
			prev = a - (a / 2) * 2;
		}

		Console.WriteLine(sum);
	}
}



static class Scan
{
	static Queue<string> _queue = new Queue<string>();
	public static string Str()
	{
		return Read();
	}
	public static char Char()
	{
		return Read()[0];
	}
	public static int Int()
	{
		return int.Parse(Read());
	}
	public static long Long()
	{
		return long.Parse(Read());
	}
	public static BigInteger BigInt()
	{
		return BigInteger.Parse(Read());
	}
	public static double Double()
	{
		return double.Parse(Read());
	}
	static string Read()
	{
		if (_queue.Count > 0)
			return _queue.Dequeue();
		foreach (var s in Console.ReadLine().Split()) _queue.Enqueue(s);
		return _queue.Dequeue();
	}
}


Measured memory_bytes: 6968
class BIT(object):
    def __init__(self, N, init=0, mod=1):
        self.N = N
        self.bit = [init for _ in range(N)]
        self.mod = mod

    def add(self, k, w):
        x = k
        while x < self.N:
            self.bit[x] += w % self.mod
            self.bit[x] %= self.mod
            x |= x + 1

    def sum(self, k):
        s = 0
        x = k - 1
        while x >= 0:
            s += self.bit[x]
            s %= self.mod
            x = (x & (x + 1)) - 1
        return s

MOD = 998244353
n, k = map(int, input().split())
seg = [list(map(int, input().split())) for _ in range(k)]
bit = BIT(n, mod=MOD)
bit.add(0, 1)

for i in range(1, n):
    x = 0
    for l, r in seg:
        x += (bit.sum(max(0, i - l + 1)) - bit.sum(max(0, i - r))) % MOD
        x %= MOD
    bit.add(i, x)
print((bit.sum(n) - bit.sum(n - 1)) % MOD)


Measured memory_bytes: 81020
N = int(input()) 
A = list(map(int,input().split()))
 
lis = []
for i in range(N):
    lis.append ([A[i],i+1])
 
lis.sort()
ans = []
for i in range(N):
    ans.append(lis[i][1])
 
print(" ".join(map(str,ans)))


Measured memory_bytes: 28412
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] l = new int[3];
        for(int i = 0;i<3;i++){
            l[i] = sc.nextInt();
        }
        Arrays.sort(l);
        System.out.println(l[0]+l[1]+l[2]*10);
        sc.close();
    }
}

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

int main()
{
    int N, K, x, sum = 0;
    cin >> N >> K;

    for (int count = 0; count < N; count++)
    {
        cin >> x;
        if (x > K)
        {
            sum += 2 * (x - K);
        }
        else if (K - x < x)
        {
            sum += 2 * (K - x);
        }
        else
        {
            sum += 2 * x;
        }
    }

    cout << sum << endl;
}

Measured memory_bytes: 256
N,A,B,C=map(int,input().split())
S=[input() for _ in range(N)]
ans=''
for i in range(N):
    if S[i]=='AB':
        if A==0 and B==0:
            print('No')
            exit()
        elif A==1 and B==1 and i<N-1:
            if 'A' in S[i+1]:
                A+=1
                B-=1
                ans+='A'
            else:
                A-=1
                B+=1
                ans+='B'
        elif A>B:
            A-=1
            B+=1
            ans+='B'
        else:
            A+=1
            B-=1
            ans+='A'
    elif S[i]=='AC':
        if A==0 and C==0:
            print('No')
            exit()
        elif A==1 and C==1 and i<N-1:
            if 'A' in S[i+1]:
                A+=1
                C-=1
                ans+='A'
            else:
                A-=1
                C+=1
                ans+='C'
        elif A>C:
            A-=1
            C+=1
            ans+='C'
        else:
            A+=1
            C-=1
            ans+='A'
    else:
        if B==0 and C==0:
            print('No')
            exit()
        elif B==1 and C==1 and i<N-1:
            if 'B' in S[i+1]:
                B+=1
                C-=1
                ans+='B'
            else:
                B-=1
                C+=1
                ans+='C'
        elif B>C:
            B-=1
            C+=1
            ans+='C'
        else:
            B+=1
            C-=1
            ans+='B'
print('Yes')
for c in ans:
    print(c)

Measured memory_bytes: 16392
def main():
    n = int(input())
    A = [[] for i in range(n)]
    ans = 0
    for i in range(n):
        a = int(input())
        tmp = {}
        for j in range(a):
            x,y = map(int,input().split())
            tmp[x-1] = y
        A[i] = tmp
    #print(A)
    for i in range(2**n):
        kouho = []
        for j in range(n):
            if  (i>>j)&1:
                kouho.append(j)
        honest = {}
        for j in range(n):
            if j in kouho:
                honest[j] = 1
            else:
                honest[j] = 0
        flag = True
        #print(kouho)
        for j in kouho:
            hatugen = A[j]
            for k in hatugen.keys():
                if honest[k]!=hatugen[k]:
                    flag = False
        if flag:
            ans = max(ans,len(kouho))
    print(ans)

main()

Measured memory_bytes: 9224
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
        int n = 0;
        int ans = 0;
        vector <int> skewer;

        cin >> n;

        for(int buf; ~scanf("%d", &buf);)
        {
                skewer.push_back(buf);
        }

        sort(skewer.begin(), skewer.end(), greater<int>());

        for(int i = 0; i < n; i++)
        {
                int s1 = skewer.front();
                skewer.erase(skewer.begin());

                int s2 = skewer.front();
                skewer.erase(skewer.begin());

                ans += s2;
        }

        cout << ans << endl;

        return 0;
}


Measured memory_bytes: 256
$cnt = 0
def merge(left, mid, right)
    $cnt += right - left + 1
    leftArr = $arr[left..mid]
    rightArr = $arr[mid+1..right]
    leftArr << 1000000001
    rightArr << 1000000001
    l = r = 0
    (left..right).each {|i|
        if leftArr[l] < rightArr[r]
            $arr[i] = leftArr[l]
            l += 1
        else
            $arr[i] = rightArr[r]
            r += 1
        end
    }
end

def mergeSort(left, right)
    mid = (left + right)/2
    if left + 1 < right
        mergeSort(left, mid)
        mergeSort(mid+1, right)
        merge(left, mid, right)
    elsif left + 1 == right
        merge(left, mid, right)
    end
end

N = gets.to_i
$arr = gets.split.map &:to_i
mergeSort(0,N-1)
puts $arr * ' ', $cnt

Measured memory_bytes: 222072
/*
─────────────────────
───────────████████──
──────────███▄███████
──────────███████████
──────────███████████
──────────██████─────
──────────█████████──
█───────███████──────
██────████████████───
███──██████████──█───
███████████████──────
███████████████──────
─█████████████───────
──███████████────────
────████████─────────
─────███──██─────────
─────██────█─────────
─────█─────█─────────
─────██────██────────
─────────────────────
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

#define int long long
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define reads(s) string s; cin >> s;
#define readarr(a, n) int a[(n) + 1] = {}; fori (i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; fori (i, 1, n) {fori (j, 1, m) cin >> a[i][j];}

#define print(a) cout << a << endl;
#define printarr(a, n) fori (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) fori (i, 1, n) {fori (j, 1, m) cout << a[i][j] << " "; cout << endl;}
#define all(v) v.begin(), v.end()
#define sz(s) (int)(s.size())
#define pb push_back
#define fi first
#define se second
#define rz resize
#define fori(i, a, b) for (int i = (a); i <= (b); i++)
#define ford(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
#define setprec(x) cout << fixed << setprecision(x);
 
using namespace std;
using namespace __gnu_pbds; 
 
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair <int, int>> vpi;
typedef vector < vector <int> > vvi;
 
const int INF = 4e18;
const int mod = 1e9+7; 

     
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);


    //start from here

    readb(m, d) int ans = 0;

    fori (i, 1, m)
    {
    	fori (j, 10, d)
    	{
    		if(j%10 >= 2 && j/10 >= 2) 
    			if((j%10) * (j/10) == i) ans++;
    	}
    }

    print(ans)

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, L;
  cin >> N >> L;
  
  vector<int> taste(N);
  for (int i = 1; i <= N; i++) {
    taste.at(i-1) = L + i - 1;
  }
  
  sort(taste.begin(), taste.end());
  
  int ans = 0;
  if (taste.at(0) > 0) {
    for (int i = 1; i < N; i++) {
      ans += taste.at(i);
    }
  }
  else if (taste.at(0) <= 0 && 0 < taste.at(N-1)) {
    for (int i = 0; i < N; i++) {
      ans += taste.at(i);
    }
  }
  else {
    for (int i = 0; i < N-1; i++) {
      ans += taste.at(i);
    }
  }
  
  cout << ans << endl;
}

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

int main(){
int n , x[100] ,y[100];
double p[4][4] , max;
max = 0;
cin >> n;
for(int i = 0; i <n; i++){
  cin >> x[i];
}
for(int i = 0; i <n; i++){
  cin >> y[i];
}
//p=1
for(int i = 0; i <n; i++){
  p[0][1] = fabs(x[i] - y[i]);
  p[0][0] += p[0][1];
}
//p=2
for(int i = 0; i <n; i++){
  p[1][1] = fabs(x[i] - y[i]);
  p[1][2] = pow(p[1][1] , 2);
  p[1][3] += p[1][2];
  p[1][0] = sqrt(p[1][3]);
}
//p=3
for(int i = 0; i <n; i++){
  p[2][1] = fabs(x[i] - y[i]);
  p[2][2] = pow(p[2][1] , 3);
  p[2][3] += p[2][2];
  p[2][0] = pow(p[2][3] , 0.33333333333);
}
//p=8
for(int i = 0; i <n; i++){
  p[3][1] = fabs(x[i] - y[i]);
  if( max < p[3][1]){
    max = p[3][1];
  }
}

printf("%.8f\n%.8f\n%.8f\n%.8f\n" , p[0][0] , p[1][0] , p[2][0], max);
return 0;
}


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

int main () {
  string s;
  cin >> s;
  vector<string> data = {"SUN","MON","TUE","WED","THU","FRI","SAT"};

  for (int i = 0; i < 7; i++) {
    if (s == data[i]) { 
      cout << 7-i << endl;
      break;                   
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
vector<int>v;
string s;
int ary[100005] = {0};
int main(){
  int N,ans = 0;

  cin >>N;
  for (int i = 0;i<N;i++){
    int x;
    cin >>x;
    ary[x]++;
    ary[x+1]++;
    ary[x-1]++;
  }
  for(int i = 0;i<100005;i++){
    ans = max(ans ,ary[i]);
  }

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


Measured memory_bytes: 640
#include <cstdio>

int main()
{
        int a,b,c;
        a=b=1;
        for(b=1;b<10;b++)
        {
                for(a=1;a<10;a++)
                {
                c=a*b;
                printf("%dx%d=%d\n",b,a,c);
                }
        }




        return 0;
}

Measured memory_bytes: 0
#include "bits/stdc++.h"
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<vector<long long>> dp(N, vector<long long>(N));
    for (int i = 0; i < N; i++) {
        cin >> dp.at(i).at(i);
    }
    for (int i = 1; i < N; i++) {
        for (int j = 0; j + i < N; j++) {
            dp.at(j).at(j + i) = max(dp.at(j).at(j) - dp.at(j + 1).at(j + i), dp.at(j + i).at(j + i) - dp.at(j).at(j + i - 1));
        }
    }
    cout << dp.at(0).at(N - 1) << endl;
}

Measured memory_bytes: 70656
import sys
s = input()
if 'N' in s:
    if 'S' not in s:
        print('No')
        sys.exit()
if 'W' in s:
    if 'E' not in s:
        print('No')
        sys.exit()
if 'E' in s:
    if 'W' not in s:
        print('No')
        sys.exit()
if 'S' in s:
    if 'N' not in s:
        print('No')
        sys.exit()
print('Yes')

Measured memory_bytes: 9120
#pragma GCC optimize("Ofast")
#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
	long long a,v,b,w,t;
	scanf("%lld%lld%lld%lld%lld",&a,&v,&b,&w,&t);
	if(a>b){
		if(a-v*t<=b-w*t)
			puts("YES");
		else
			puts("NO");		
	}
	else if(a+v*t>=b+w*t)
		puts("YES");
	else
		puts("NO");
}

Measured memory_bytes: 1660
while true do
  n, r = gets.split.map(&:to_i)
  break if n == 0 && r == 0

  p = Array.new(r)
  c = Array.new(r)
  r.times do |i|
    p[i], c[i] = gets.split.map(&:to_i)
    p[i] = p[i].pred
  end

  res = Array.new(n){|i| n - i}

  r.times do |i|
    res[0, n] = res[p[i], c[i]] + res[(0...p[i])] + res[((p[i] + c[i])...res.size)]
  end

  p res[0]
end

Measured memory_bytes: 9856
#include<bits/stdc++.h>
#include<string>
 
using namespace std;
 
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
     
    double pi = acos(-1);
    double r; cin>>r;
    double area = pi*r*r;
    double peri = 2*pi*r;
    
    printf("%.6f %.6f\n",area,peri);
     
    return 0;
     
}


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

int N,T,c,t;
int main(){
	cin >> N >> T;
	int ans = 1e9;
	for(int i=0;i<N;i++){
		cin >> c >> t;
		if(t<=T) ans = min(c,ans);
	}
	if(ans!=1e9) cout << ans << endl;
	else cout << "TLE" << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>

#define N 100

int isEmpty(void);
void push(int);
int pop(void);

int stack[N];
int top = 0;

int main(){
  int x,a,b;
  char str[100];



  while( scanf("%s", str) != EOF ){
    if ( str[0] == '+' ){
      a = pop();
      b = pop();
      push(a + b);
    } else if ( str[0] == '-' ){
      a = pop();
      b = pop();
      push(b - a);
    } else if ( str[0] == '*' ){
      a = pop();
      b = pop();
      push(a * b);

    } else {
      x = atoi(str);
      push(x);

    }
  }

  printf("%d\n",stack[top - 1]);

  return 0;


}

int isEmpty(void){

  if(top == 0){
    return 1; //Stack is Empty                                                  
  }else{
    return 0; //Stack is not Empty                                              
  }

}

void push(int num){
  if(top == N){
    printf("Stack overflow!\n");
    exit(2);
  }
  stack[top] = num;
  top++;
}

int pop(void){
  if(isEmpty() == 1){
    printf("Stack is empty!\n");
    exit(3);
  }
  top--;
  return stack[top];
}




Measured memory_bytes: 2104
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CSnukeFestival solver = new CSnukeFestival();
        solver.solve(1, in, out);
        out.close();
    }

    static class CSnukeFestival {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            int[] b = new int[n];
            int[] c = new int[n];
            long ans = 0;
            int ai = 0;
            int ci = 0;
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }
            for (int i = 0; i < n; i++) {
                b[i] = in.nextInt();
            }
            for (int i = 0; i < n; i++) {
                c[i] = in.nextInt();
            }

            Arrays.sort(a);
            Arrays.sort(b);
            Arrays.sort(c);

        /*
        out.println(Arrays.toString(a));
        out.println(Arrays.toString(b));
        out.println(Arrays.toString(c));
        
         */

            for (int i = 0; i < n; i++) {
                // 各b[i]について考えればいい
                while (ai < n && a[ai] < b[i]) {
                    ai++;
                }
                while (ci < n && c[ci] <= b[i]) {
                    ci++;
                }
                // out.println((long) ai * (long) (n - ci));
                ans += (long) ai * (long) (n - ci);
            }

            out.println(ans);


        }

    }
}



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

#define INF 1001001001
#define LINF 1001001001001001001
#define MOD 1000000007
#define MOD2 998244353

template<class T,class U>bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U>bool chmin(T &a, const U &b){if(b<a){a=b;return 1;}return 0;}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,pii> ppii;

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

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

int main(){
    bool flag=false;
    ll ans=0,sum=0;

    int h,w,n;
    cin >>h>>w>>n;

    ans = min( (n+h-1)/h , (n+w-1)/w );

    //cout <<fixed<<setprecision(16)<< << endl;
    cout<<ans<<endl;
    //if(flag)cout << "Yes" <<endl;
    //else cout << "No" <<endl;
    
    return 0;
}


Measured memory_bytes: 256
package main

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

func main() {
	sc := NewScanner()
	N := sc.NextInt()

	primes := make([]int, 1001)
	nums := make([]int, N + 1)
	for i := 1; i <= N; i++ {
		nums[i] = i
	}
	for i := 2; i <= N; i++ {
		for j := 2; j <= N; j++ {
			for nums[i] % j == 0 {
				nums[i] /= j
				primes[j]++
			}
		}
	}

	ans := 1
	for p := 2; p <= N; p++ {
		ans *= primes[p] + 1
		ans %= 1e9 + 7
	}
	fmt.Println(ans)

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r:rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf) + 1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf) + 1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Measured memory_bytes: 768
#ABC063C
N=int(input())
S=[]
for n in range(N):
	S.append(int(input()))
S.sort()
ans=sum(S)
if ans%10==0:
	for s in S:
		if s%10!=0:
			ans-=s
			break
	else:
		ans=0
print(ans)

Measured memory_bytes: 3060
import java.util.Scanner;


public class Main{
    public static Scanner scan  = new Scanner(System.in);
    public static void main(String[]args){
        int x = nextInt();
        int y = nextInt();
        for(int i = 0;i<100;i++){
            for(int k = 0;k<100;k++){
                if(i+k==x && y==2*i+4*k){
                    print("Yes");
                    System.exit(0);
                }
            }
        }
        print("No");
    }

    public static int nextInt(){
        return Integer.parseInt(scan.next());
    }
    public static long nextLong(){
        return Long.parseLong(scan.next());
    }
    public static String next(){
        return scan.next();
    }
    public static double nextDouble(){
        return Double.parseDouble(scan.next());
    }
    public static float nextFloat(){
        return Float.parseFloat(scan.next());
    }

    //Yes or No
    public static void yesNo(boolean flag){
        if(flag) System.out.println("Yes");
        else System.out.println("No");
    }

    //print
    public static void print(Object a){
        System.out.println(a);
    }


    //gcd
    public static int gcd (int a, int b){
        int tmp;
        while((tmp = a%b) != 0){
            a = b;
            b = tmp;
        }
        return b;
    }


    //lcm
    public static int lcm(int a,int b){
        int tmp;
        long c = a;
        c *= b;
        while((tmp = a%b) != 0){
            a = b;
            b = tmp;
        }
        return (int)(c/b);
    }
}

Measured memory_bytes: 35692
using System;
using System.Collections.Generic;
using System.Linq;
public class Hello{
    public static void Main(){
        var n = int.Parse(Console.ReadLine());
        var s = new HashSet<string>();
        for(var i = 0;i < n;i++){
            s.Add(Console.ReadLine());
        }
        
        Console.WriteLine(s.Count);
    }
}


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


#define int long long int
int a[200001];
int dp[200001];
int solve(int n)
{
	if(dp[n]!=-1)
		return dp[n];
	else
	{
		
		dp[n]=abs(a[n]-a[n-1])+solve(n-1);
		while(true)
		{
			int check;
			check=n-2;
			if(check>=1)
			{
				dp[n]=min(dp[n],abs(a[n]-a[n-2])+solve(n-2));
			}	
			
				break;			
			
			
		}
		return dp[n];
	}
}
int32_t main()
{
	int n;
	cin>>n;
	for(int i=0;i<=200001;i++)
		dp[i]=-1;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	dp[1]=0;
	int ans;
	ans=solve(n);
	cout<<ans<<endl;
	return 0;
}	

Measured memory_bytes: 5760
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  long long n, m, l, b[100][100], a[100][100], c[100][100] = {};
  cin >> n >> m >> l;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
      cin >> a[i][j];
    }
  }
  for(int i = 0; i < m; i++){
    for(int j = 0; j < l; j++){
      cin >> b[i][j];
    }
  }
  for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
      for(int k = 0; k < l; k++){
        c[i][k] += a[i][j] * b[j][k];
      }
    }
  }
  for(int i = 0; i < n; i++){
    for(int j = 0; j < l; j++){
      cout << (j == 0 ? "": " ") << c[i][j];
    }
    cout << endl;
  }
}


Measured memory_bytes: 3272
N = gets.to_i
ABs = readlines.map{_1.split.map(&:to_i)}
M = 10**9 + 7

ans, h = 0, Hash.new{|h, k| h[k] = [0, 0]}
ABs.each do |a, b|
  if b == 0
    a == 0 ? ans += 1 : h[(0/1r)][1] += 1
  else
    (a == 0 || a*b > 0) ? h[Rational(a, b)][0] += 1 : h[-Rational(b, a)][1] += 1
  end
end
ans += h.values.inject(1){|r, (x, y)| r*(2.pow(x, M) + 2.pow(y, M) - 1) % M} - 1
puts ans % M

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

int P[10] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 2};
int Q[10] = {1, 1, 1, 2, 2, 3, 2, 2, 3, 3};
int R[10] = {2, 3, 4, 3, 4, 4, 3, 4, 4, 4};
ll m, a, r, c, h;
int main()
{
    int N;
    cin >> N;
    string s;
    
    for(int i = 0; i < N; ++i) {
        cin >> s;
        if(s[0] == 'M') ++m;
        if(s[0] == 'A') ++a;
        if(s[0] == 'R') ++r;
        if(s[0] == 'C') ++c;
        if(s[0] == 'H') ++h;
    }
    ll D[5];
    D[0] = m, D[1] = a, D[2] = r, D[3] = c, D[4] = h;
    ll res = 0;
    for(int d = 0; d < 10; ++d) {
        res += D[P[d]]*D[Q[d]]*D[R[d]];
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 384
import math

l = input().split()
A, B, H, M = int(l[0]), int(l[1]), int(l[2]), int(l[3])

hhour = [A * math.cos(math.pi * M/30), A * math.sin(math.pi * M/30)]
mmin = [B * math.cos(math.pi * (H+M/60)/6), B * math.sin(math.pi * (H+M/60)/6)]

print(math.sqrt(abs(hhour[0]-mmin[0])**2+abs(hhour[1]-mmin[1])**2))


Measured memory_bytes: 9480
#include<iostream>
#include <string>
using namespace std;
int main()
{
  int a[3];
  int b;
  bool ans=false;
  for(int i=0;i<3;i++){
  cin >> a[i];//入力
    if(a[i]==7){
    b++;
    }
  }
  if(b==2){
  cout << "NO";
  }
  else{
      cout << "YES";
  }
    
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
using namespace std;
 
int main(){
 
 int X, N;
  int d=0;
 int p[101]={0};
  bool ex=0, tr=0;
  
  cin >> X >> N;
  
  for(int i=1;i<=N;i++){ 
    cin >> p[i];
  }
  
  while(1){
    
    ex=1;
	  for(int i=1;i<=N;i++){ 
	    if(X-d == p[i]){
          ex=0;
          break;
        }
	  } 
    
    if(ex==1){
      cout << X-d;
      break;
    }
    
    if(tr==0){
      d=abs(d)+1;
      tr=1;
    }else{
      d*=(-1);
      tr=0;
    }
    
  }
  
  return 0;
}

Measured memory_bytes: 3632
import array

N=int(input())
arr=[input() for _ in range(N)]
dic={}
for i in range(N): #各単語の出現回数を数える
 if arr[i] not in dic:
   dic[arr[i]]=1
 else:
   dic[arr[i]]+=1
count=0
for k in dic.keys():
    count=count+1
print(count)

Measured memory_bytes: 38288
#include <iostream>
#include <vector>
#define ll long long int
using namespace std;
int ketawa(int a){
  int wa=0;
  while(a!=0){
    wa += a%10;
    a /= 10;  
  }
  return wa;
}
int main(){
  int n; cin>>n;
  int ans = n;
  for(int i=1;i<n;++i){
    int temp = ketawa(i) + ketawa(n-i);
    ans  = min(ans,temp);
  }
  cout<<ans<<endl;
}


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

using namespace std;
#define INF 1000007
#define MOD 1000000007
#define int long long
#define maxn 101
#define maxh 1001
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
const int dx[4] = {0, 1, -1, 0}, dy[4] = {1, 0, 0, -1};
typedef std::pair<int, int> P;

vector<bool> prime(maxn + 1, true); //素数テーブル
void prime_table(void) {
    prime[0] = false;
    prime[1] = false;
    for (int i = 2; i * i <= maxn; i++) {
        if (!prime[i]) {
            continue;
        }
        for (int j = i + i; j <= maxn; j += j + i) {
            prime[j] = false;
        }
    }
}

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; }

bool IsPrime(int num) //素数判定
{
    if (num < 2)
        return false;
    else if (num == 2)
        return true;
    else if (num % 2 == 0)
        return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2) {
        if (num % i == 0) {
            return false;
        }
    }

    return true;
}

vector<int> divisor(int n) //約数列挙
{
    vector<int> ret;
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i - 1);
            if (i * i != n) {
                ret.push_back((n / i) - 1);
            }
        }
    }
    sort(ret.begin(), ret.end());
    return (ret);
}

int a, b;

void f(int x) {
    while (x) {
        a++;
        b = x;
        x /= 10;
    }
}

signed main() {
    int H, W;
    cin >> H >> W;
    vector<string> A(H);
    rep(i, H) cin >> A[i];
    vector<vector<int>> ans(H, vector<int>(W, INF));
    vector<vector<int>> dist(H, vector<int>(W, INF));
    queue<P> q;
    auto update = [&](int i, int j, int x) {
        if (dist[i][j] != INF) return;
        dist[i][j] = x;
        ans[i][j] = min(ans[i][j], dist[i][j]);
        q.push(P(i, j));
    };

    rep(si, H)
        rep(sj, W) {
            if (A[si][sj] != '#')continue;
            update(si, sj, 0);
        }
    while (!q.empty()) {
        int i = q.front().first;
        int j = q.front().second;
        q.pop();
        rep(dis, 4) {
            int ni = i + dx[dis];
            int nj = j + dy[dis];
            if (ni < 0 || ni >= H || nj < 0 || nj >= W || (dist[ni][nj] != INF)) continue;
            if (A[ni][nj] == '#') {
                dist[ni][nj] = 0;
                continue;
            }
            update(ni, nj, dist[i][j] + 1);
        }
    }
    int ANS = 0;
    rep(i, H)
        rep(j, W) {
            ANS = max(ANS, ans[i][j]);
        }
    cout << ANS << endl;
}


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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm(a, b) (a)/__gcd((a),(b))*(b)
#define CEIL(a, b) (a) / (b) + (((a) % (b))?1:0)
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 200005;

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

vector<int> Div(int n) {
    vector<int> ret;
    for(int i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);

            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

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

    }

    vector<LL> sum;
    for(int i = 0; i < n; ++i) {
        LL s = v[i];
        sum.pb(s);
        for(int j = i + 1; j < n; ++j) {
            s += v[j];
            sum.pb(s);

        }
    }

    LL x = 0;
    for(int i = 40; i >= 0; --i) {
        LL tmp = (1ll << i);
        int cnt = 0;
        for(int j = 0; j < sum.size(); ++j) {
            if(((x + tmp) & sum[j]) == x + tmp) {
                ++cnt;

            }
        }
        if(cnt >= k) {
            x += tmp;

        }
    }
    cout << x << endl;
    return 0;
}



Measured memory_bytes: 6512
#include <iostream>
using namespace std;
int main(void) {
  for(int i = 0; i < 10007; i++) {
    int x;
    cin >> x;
    if(x == 0)
      break;
    cout << "Case " << i + 1 << ": " << x << endl;
  }
  return 0;
}


Measured memory_bytes: 3076
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int k = Integer.parseInt(sc.next());
        String S = sc.next();
        if(S.length() <= k) System.out.println(S);
        else {
            String s = S.substring(0, k);
            System.out.println(s+"...");
        }
    }
}

Measured memory_bytes: 38488
# import itertools
# import math
# import sys
# import numpy as np

N = int(input())
# S = input()
# n, *a = map(int, open(0))
# H, W, K = map(int, input().split())
# A = list(map(int, input().split()))
# B = list(map(int, input().split()))
# S = input()

# d = sorted(d, reverse=True, key=lambda x:x[0])
# all_cases = list(itertools.permutations(P))
# a = list(itertools.combinations_with_replacement(range(1, M + 1), N))
# itertools.product((0,1), repeat=n)

# A = np.array(A)
# cum_A = np.cumsum(A)
# cum_A = np.insert(cum_A, 0, 0)

data = []
for i in range(N):
    data.append(list(map(int, input().split())))
data = sorted(data, reverse=True, key=lambda x:x[2])

ans_x = 0
ans_y = 0
ans_h = 0
for i in range(101):
    for j in range(101):
        H = -1
        for l in data:
            if H == -1:
                _ = l[2] + abs(l[0] - i) + abs(l[1] - j)
                H = _
            else:
                h_i_cal = max(H - abs(l[0] - i) - abs(l[1] - j), 0)
                if h_i_cal != l[2]:
                    break
        else:
            ans_x = i
            ans_y = j
            ans_h = H

print(ans_x, ans_y, ans_h)


Measured memory_bytes: 9228
#include<stdio.h>
int f(int);
int fib[45];
int main(){
  int i,n;
  scanf("%d",&n );
  for (i = 0; i < n+1; i++) {
    fib[i]=f(i);

  }
  printf("%d\n",fib[n]);
  return 0;
}
int f(int n){
  if (n==0||n==1) {
    return 1;
  }
  else return fib[n-2]+fib[n-1];
}



Measured memory_bytes: 2148
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>
#include <cassert>
#include <bitset>

#define PI 3.141592653589793
 
using namespace std;

int main(){
    double A,B,H,M;
    cin >> A >> B >> H >> M;
    double kakudoA = (H * 30 + M * 0.5) * PI / 180;
    double kakudoB = M * 6 *  PI / 180;
    double delta = abs(kakudoA - kakudoB);
    cout << setprecision(15) << sqrt(A*A + B*B - 2*A*B*cos(delta)) << endl;
}

Measured memory_bytes: 4196
#include<stdio.h>

int main(){

    int S,h,m,s;
    
    scanf("%d",&S);

    h = S/3600;
    S -= 3600*h;

    m = S/60;
    S -= 60*m;

    s =  S;

    printf("%d:%d:%d\n",h,m,s);
return 0;
}

Measured memory_bytes: 592
#include <stdio.h>

int main() {
  int hist[16] = { 0 };
  int A, B, C;
  
  scanf("%d %d %d", &A, &B, &C);
  hist[A]++;
  hist[B]++;
  hist[C]++;
  
  if(hist[5] == 2 && hist[7]==1) printf("YES\n");
  else printf("NO\n");
  
  return 0;
}
  

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <iterator>
#include <climits>
#include <unordered_map>
#include <functional>
#include <queue>

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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

inline int ctoi(char c) {
    return (int)(c -'0');
}

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

bool IsInNum(const char ch) {
    return '0' <= ch && ch <= '9';
}

int main() {
    ll a, b;
    string s;
    cin >> a >> b >> s;

    bool flag = true;
    for (int i = 0; i < a; ++i) {
        flag &= IsInNum(s[i]);
    }

    if (s[a] != '-') {
        flag = false;
    }

    for (int i = 0; i < b; ++i) {
        flag &= IsInNum(s[a + i + 1]);
    }

    cout << (flag ? "Yes" : "No") << endl;

    return 0;
}


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

int main(){
  int n;
  cin >> n;
  vector<int>x(n+5);
  for(int i = 0; i < n; i++){
    cin >> x.at(i);
  }
  
  int ans=0;
  int ansF=0;
  
  for(int i=0; i<n; i++){
    int j=i;
    while(j!=n-1 && x.at(j) >= x.at(j+1) ){
        ans++;
        j++;
    }
    if(ansF<ans){
      ansF = ans;
    }
    ans = 0;
    i=j;
  }
    

  
  cout << ansF << endl;
  
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
const int INF = 1<<29;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin() , v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)


int main(){
    int a, b, k; cin >> a >> b >> k;
    int i = min(a, b), cnt = 0;
    while(1){
        if(a % i == 0 && b % i == 0){
            cnt++;
        }
        if(cnt == k) break;
        i--;
    }
    cout << i << endl;
}

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

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

int h,w;
void dfs(vector<vector<int>> &s,int x,int y){
  if(x<0 || x>=h || y<0 || y>=w) return;
  if(!s[x][y]) return;
  s[x][y] = 0;
  rep(i,8) dfs(s,x+dx[i],y+dy[i]);
}
  
  
int main(){
  while(1){   
    cin>>w>>h; 
    if(!h) break;
    vector<vector<int>> s(h,vector<int>(w));
    rep(i,h)rep(j,w) cin>>s[i][j];
     
    int ans = 0;
    rep(k,250){
      rep(i,h){
        rep(j,w){
          if(s[i][j]){
            dfs(s,i,j);
            ans++;
          }
        }
      }
    }
    cout << ans << endl;
  }
}


Measured memory_bytes: 3184