akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef pair<string , int> s_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define puf push_front
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
//#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
const int64 INF = 1LL << 58;
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; }
template<typename T> void remove(T & vector, unsigned int index){vector.erase(vector.begin() + index);}

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

    ll N, H; cin >> N >> H;
    vel a(N), b(N); rep(i,N) cin >> a[i] >> b[i];

    ll ma = maxel(a); sort(rall(b));

    int cnt = 0;
    rep(i,N) {
        if(b[i] > ma) { H -= b[i]; cnt++; }
        else break;
        if(H <= 0) break;
    }
    if(H <= 0) {cout << cnt << endl; return 0;}
    
    while(true) {
        H -= ma;
        cnt++;
        if(H <= 0) break;
    } 
    cout << cnt << endl;
    return 0;

    
}

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


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

using namespace std;

int x,y;
int c[20][20];
int dp[20][20];

void solve() {
	rep(i,20) rep(j,20) c[i][j]=1;
	rep(i,20) rep(j,20) dp[i][j]=0;

	rep(i,y) rep(j,x) cin>>c[i][j];

	rep(i,x) if(c[0][i]!=1) dp[0][i]=1;
	
	for(int i=0;i<y;i++) {
		for(int j=0;j<x;j++) {
			if(c[i][j]==2) {
				dp[i+2][j] += dp[i][j];
			}
			else if(c[i][j]==0) {
				if(c[i+1][j]!=1) {
					dp[i+1][j] += dp[i][j];
				}
				if(0<=j-1 && c[i+1][j-1]==0) {
					dp[i+1][j-1] += dp[i][j];
				}
				if(j+1 < x && c[i+1][j+1]==0) {
					dp[i+1][j+1] += dp[i][j];
				}
			}
		}
	}


	int ans=0;
	rep(i,x) if(c[y-1][i]!=1) ans+=dp[y-1][i];
	rep(i,x) ans+=dp[y][i];

	cout<<ans<<endl;

}

int main() {
	while(cin>>x>>y) {
		if(x+y==0) return 0;
		solve();
	}
	return 0;
}

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

int main(void) {
  long long W, H, x, y;
  cin >> W >> H >> x >> y;

  cout << fixed << setprecision(6) << W * H / 2.0 << " "
       << (W % 2 == 0 && H % 2 == 0 && x == W / 2 && y == H / 2 ? '1' : '0');

  return 0;
}

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

int main(){
    int n, m, l;
    long long c;
    cin>>n >>m >>l;
    vector<vector<long long> > a(n, vector<long long>(m)), b(m, vector<long long>(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<l;j++){
            c=0;
            for(int k=0;k<m;k++){
                c+=a[i][k]*b[k][j];
            }
            cout<<c;
            if(j!=l-1)cout<<' ';
        }
        cout<<endl;
    }
    return 0;
}



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

const string YES = "Yes";
const string NO = "No";

void solve(long long N, long long A){
    if(N % 500 <= A) cout << YES << endl;
    else cout << NO << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long A;
    scanf("%lld",&A);
    solve(N, A);
    return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
typedef vector<vll> vvll;

#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define no cout<<"No"<<endl
#define NO cout<<"NO"<<endl
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll n,x,t;
  cin>>n>>x>>t;

  ll ans=n/x;
  if(n%x!=0)
    ans++;
  ans*=t;

  cout<<ans<<endl;
}



Measured memory_bytes: 3648
#include<iostream>
using namespace std;
typedef long long ll;
int main()
{
  ll n,i;
  cin>>n;
  ll a[n],b[n];
  for(i=1;i<=n;i++)
    cin>>a[i];
  for(i=1;i<=n;i++)
    b[a[i]]=i;
  for(i=1;i<=n;i++)
    cout<<b[i]<<" ";
}

Measured memory_bytes: 2432
//
//  main.c
//  ITP1_10_B
//
//  Created by k16031kk on 2018/05/29.
//  Copyright © 2018年 AIT. All rights reserved.
//

#include <stdio.h>
#include <math.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    double a, b, C;
    double S, L, h;
    double PI=acos(-1.0);
    scanf("%lf %lf %lf", &a, &b, &C);
    C=C/180.0*PI;
    S=a*b*sin(C)/2;
    L=a+b+sqrt(a*a+b*b-2*a*b*cos(C));
    h=S*2/a;
    printf("%lf\n", S);
    printf("%lf\n", L);
    printf("%lf\n", h);
    return 0;
}



Measured memory_bytes: 2104
#include <iomanip>
#include <iostream>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;

int main(void) {
  ios::sync_with_stdio(false);
  string S, T;
  cin >> S >> T;

  cout << T << S << endl;
  return 0;
}


Measured memory_bytes: 764
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif


using namespace std;

int main ()
{
	int N;
	while( cin >> N , N )
	{
		vector<vector<int>>data;
		data.resize ( N );
		for( size_t i = 0; i < N; i++ )
		{
			data[i].resize ( N );
		}
		int nowx = N / 2  , nowy = N / 2 + 1;
		data[nowy][nowx] = 1;
		for( size_t i = 2; i <= N*N; i++ )
		{
			nowx++;
			nowy++;
			nowx %= N;
			nowy %= N;
			while( data[nowy][nowx] )
			{
				nowy++;
				nowy %= N;
				nowx--;
				nowx += N;
				nowx %= N;
			}
			data[nowy][nowx] = i;
		}
		for( auto x : data )
		{
			for( auto y : x )
			{
				cout <<setw(4)<<right<< y ;
			}
			cout << endl;
		}
	}
}

Measured memory_bytes: 1224
#include <iostream>                                                                                                       

int main(){
   int N;
   std::cin >> N;
   int a[N];
   int ans = 0;
   for(int i=0; i<N; ++i){
      std::cin >> a[i];
      ans += a[i]-1;
   }   
   std::cout << ans << std::endl;
   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
                                        #include<iostream>
                                        #include<cstdio>
                                        #include<vector>
                                        #include<queue>
                                        #include<map>
                                        #include<cstring>
                                        #include<string>
                                        #include <math.h>
                                        #include<algorithm>
                                    //    #include <boost/multiprecision/cpp_int.hpp>
                                        #include<functional>
                           //     #define int long long
                                        #define inf  1000000007
                                        #define pa pair<int,int>
                                        #define ll long long
                                        #define pal pair<double,pa>
                                        #define ppa pair<int,int>
                                        #define ppap pair<pa,pa>
                                        #define ssa pair<string,int>
                                        #define  mp make_pair
                                        #define  pb push_back
                                        #define EPS (1e-10)
                                        #define equals(a,b) (fabs((a)-(b))<EPS)
                                  #define VI vector<int>
                                        using namespace std;
                                        
                                  class pas{
                                    	public:
                                    	int x,y;
                                    	pas(int x=0,int y=0):x(x),y(y) {}
                                    	pas operator + (pas p) {return pas(x+p.x,y+p.y);}
                                    	pas operator - (pas p) {return pas(x-p.x,y-p.y);}
                                    	pas operator * (int a) {return pas(x*a,y*a);}
                                    	pas operator / (int a) {return pas(x/a,y/a);}
                                    //	double absv() {return sqrt(norm());}
                                    	int norm() {return x*x+y*y;}
                                    	bool operator < (const pas &p) const{
                                    		return x != p.x ? x<p.x: y<p.y;
                                    	}
                                    	bool operator == (const pas &p) const{
                                    		return x==p.x && y==p.y;
                                    	}
                                    };

           signed main(){
        
           	int x,a,b;
           	cin>>x>>a>>b;
           	
           	if(a>=b)cout<<"delicious"<<endl;
           	else if(b-a>x)cout<<"dangerous"<<endl;
           	else cout<<"safe"<<endl;
           	return 0;
           	
           	
           }
             

Measured memory_bytes: 256
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    PrintWriter pw = new PrintWriter(System.out);

    int[] spots = new int[6];
    for (int i = 0; i < 6; i++) {
        spots[i] = sc.nextInt();
    }

    Dice dice = new Main().new Dice(spots);

    int q = sc.nextInt();
    for (int i = 0; i < q; i++) {
        int topN = sc.nextInt();
        int frontN = sc.nextInt();
        dice = dice.topOf(topN);
        dice = dice.frontOf(frontN);
        pw.println(dice.right());
    }

    pw.flush();
  }

  class Dice {

    private int[] spots = new int[6];

    public Dice(int[] spots) {
        this.spots = spots;
    }

    public Dice north() {
        return new Dice(new int[]{
            front(),
            bottom(),
            right(),
            left(),
            top(),
            back()
        });
    }

    public Dice west() {
        return new Dice(new int[]{
            right(),
            front(),
            bottom(),
            top(),
            back(),
            left()
        });
    }

    public Dice east() {
        return new Dice(new int[]{
            left(),
            front(),
            top(),
            bottom(),
            back(),
            right()
        });

    }

    public Dice south() {
        return new Dice(new int[]{
            back(),
            top(),
            right(),
            left(),
            bottom(),
            front()
        });
    }

    public Dice rotate() {
        return new Dice(new int[]{
            top(),
            left(),
            front(),
            back(),
            right(),
            bottom()
        });
    }

    public int top() {
        return spots[0];
    }

    public int bottom() {
        return spots[5];
    }

    public int front() {
        return spots[1];
    }

    public int back() {
        return spots[4];
    }

    public int left() {
        return spots[3];
    }

    public int right() {
        return spots[2];
    }

    public Dice topOf(int topN) {
        Dice[] dices = new Dice[]{
            this,
            this.south(),
            this.east(),
            this.west(),
            this.north(),
            this.south().south()
        };
        for (Dice dice : dices) {
            if (dice.top() == topN) {
                return dice;
            }
        }
        return null;
    }

    public Dice frontOf(int frontN) {
        Dice[] dices = new Dice[]{
            this.rotate(),
            this.rotate().rotate(),
            this.rotate().rotate().rotate(),
            this.rotate().rotate().rotate().rotate(),
        };
        for (Dice dice : dices) {
            if (dice.front() == frontN) {
                return dice;
            }
        }
        return null;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("[");
        for (int i = 0; i < spots.length; i++) {
            sb.append(i + ": " + spots[i] + ", ");
        }
        sb.append("]");
        return sb.toString();
    }
  }
}


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

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> d(n);
    for (int i = 0; i < n; i++) {
        int p; cin >> p;
        d[--p] = i;
    }
    vector<int> a(n, 1), b(n+1, 1);
    for (int i = 1; i < n; i++) {
        int diff = d[i] - d[i-1];
        if (diff < 0) a[i] = 1, b[i] = -diff+1;
        else a[i] = diff+1, b[i] = 1;
    }
    for (int i = 1; i < n; i++) a[i] += a[i-1];
    for (int i = n-1; i > 0; i--) b[i] += b[i+1];
    for (int i = 0; i < n; i++) {
        if (i) cout << " ";
        cout << a[i];
    }
    cout << "\n";
    for (int i = 0; i < n; i++) {
        if (i) cout << " ";
        cout << b[i+1];
    }
    cout << "\n";
    return 0;
}

Measured memory_bytes: 896
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = s, i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = s, i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = s; i < (n); ++i)
#define VFORS(i, s, n) for(int i = s; i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = s, i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = s, i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define SZ(x) ((int)(x).size())
#define PB push_back
#define MP make_pair
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end());

using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
using VD = vector<double>;

const int MOD = 1000000007;
const int INF = 1000000000;

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

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

int main(){
    int n; cin >> n;
    int X; cin >> X;
    int ans = 0;
    REP(i, n){
        int x; cin >> x;
        ans = gcd(ans, abs(X-x));
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
//============================================================================
// Name        : Hello.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include<algorithm>
#include <iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<string>
using namespace std;
int main() {

	int n;
	cin>>n;

	int x=0;

	for(int i=1;i<10;i++){
		for(int j=1;j<10;j++){
			if(i*j==n){
				x=1;
			}

		}


	}

	if(x==1){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}



	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
template<class Type>struct is_vector : std::false_type {};
template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T> inline ostream& operator << (ostream& out, const vector<T>& v) {
    if (v.empty())return out;
    constexpr bool is_vector_v = is_vector<T>::value;
    if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr),out << ((++itr != v.end()) ? "\n" : "");
    else for (auto itr = v.begin(); itr != v.end();)out << (*itr),out << ((++itr != v.end()) ? " " : "");
    return out;
}
inline void put() {}
template<class T> inline void put(const T& first) { std::cout << first; printf("\n"); }
template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first; printf(" "); put(rest...); }
inline void putn() {}
template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first; printf("\n"); putn(rest...); }

vector<int> topologicalSort(vector<vector<int>>& path){//pathが二重辺・自己ループなしのDAGであることが前提
    int n = (int)path.size();
    vector<int> res;
    vector<int> entry(n,0);
    queue<int> q;
    for(int i=0;i<n;++i){
        for(int j=0;j<path[i].size();++j){
            entry[path[i][j]]++;
        }
    }
    for(int i=0;i<n;++i){
        if(!entry[i]){
            q.push(i);
        }
    }
    while(!q.empty()){
        int p = q.front();
        q.pop();
        res.push_back(p);
        for(int i=0;i<path[p].size();++i){
            if(entry[path[p][i]]!=0){
                if(--entry[path[p][i]]==0){
                    q.push(path[p][i]);
                }
            }
        }
    }
    return res;
}

int main(){
    int n,m;
    cin >> n >> m;
    vector<int> x(m),y(m);
    vector<vector<int>> path(n);
    REP(i,m){
        cin >> x[i] >> y[i];
        //x[i]--;
        //y[i]--;
        path[x[i]].push_back(y[i]);
    }
    vector<int> res = topologicalSort(path);
    REP(i,res.size()){
        put(res[i]);
    }
    return 0;
}



Measured memory_bytes: 4088
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define pf pop_front
#define mp make_pair
using namespace std;
#define ld long double
#define mod 1000000007

int n,m;
ld dp[3000][3000];

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	
	cin>>n;
	ld p[n];
	for(int i=0;i<n;i++)
		cin>>p[i];
	dp[1][0]=1-p[0];
	dp[1][1]=p[0];
	
	for(int i=2;i<=n;i++)
	{
		dp[i][0]=dp[i-1][0]*(1-p[i-1]);
		for(int j=1;j<i;j++)
		{
			dp[i][j]=dp[i-1][j]*(1-p[i-1])+dp[i-1][j-1]*p[i-1];;
		}
		dp[i][i]=dp[i-1][i-1]*p[i-1];
	}
	ld ans=0;
	for(int i=(int)ceil((ld)n/2);i<=n;i++)
		ans+=dp[n][i];
	cout<<setprecision(10)<<ans<<endl;
}

Measured memory_bytes: 139136
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		double distance;
		double x1,y1,x2,y2;
		x1 = in.nextDouble();
		y1 = in.nextDouble();
		x2 = in.nextDouble();
		y2 = in.nextDouble();
		
		distance = Math.sqrt(Math.pow(x1-x2, 2) + Math.pow(y1-y2, 2));
		System.out.println(distance);
	}
}

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

void solve() {
    ll R, G, B, N;
    cin >> R >> G >> B >> N;
    ll ans = 0;

    REP(r, 3001) REP(g, 3001) {
        ll c = N - r * R - g * G;
        if (c < 0) continue;
        if (c % B != 0) continue;
        ans += 1;
    }

    cout << ans << endl;
}

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


Measured memory_bytes: 256
import bisect

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort()
C.sort()

ans = 0

for b in B:
  a = bisect.bisect_left(A, b)
  c = bisect.bisect_right(C, b)

  ans += a * (len(C) - c)

print(ans)

Measured memory_bytes: 105444
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;
int N;
string S;


string::iterator CountSeqStr(string::iterator start, string *s, int *n){
  *s = *start;
  *n = 0;
  string tmp;
  for(;tmp = *start, tmp == *s && start != S.end(); ++start){
    (*n)++;
  }
  return --start;
}

string F(){
  string retS;
  string s;
  string::iterator it;
  int n;
  for(it= S.begin(); it != S.end(); ++it){
    it = CountSeqStr(it, &s, &n);
    char strn[10000];
    sprintf(strn, "%d", n);
    retS.append(string(strn));
    retS.append(s);
  }
  return retS;
}


int main(){
  while(cin >> N && N){
    cin >> S;
    for(int i=0; i<N; i++){
      string tmp;
      S = F();
    }
    cout << S << endl;
  }
  return 0;
}

Measured memory_bytes: 1384
/*author : Yashvardhan
Sunday, April 12, 2020
5:04 PM
*/

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

using ll = long long;

#define int ll
#define pb push_back
#define vi vector<int>
#define pi pair<int,int>
#define vpi vector<pi>
#define ff first
#define ss second
#define mp make_pair
#define endl '\n'
#define all(a) a.begin(), a.end()
#define initialise(a, x) memset(a, x, sizeof(a))
#define rev(Y) reverse(all(Y))
#define printArr(name,from,to) for(int x = from; x < to; x++) cout << name[x] << " ";


#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS

#ifdef __APPLE__
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << endl;}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << "  ";
	__f(comma + 1, args...);}
#else
#define debug(...)
#endif

template <typename T> ostream& operator << (ostream& os,const vector<T>& v){for(int i=0;i<v.size();++i) os<<v[i]<<" ";return os;} 
template <typename T> ostream& operator << (ostream& os,const set<T>& v){for(auto it:v) os<<it<<" ";return os;} 
template <typename T, typename S> ostream& operator << (ostream& os, const pair<T,S>& v) {os<<v.ff<<" "<<v.ss;return os;}

const int mod = 1e9 + 7;
const int inf = 2e18;
const int ninf = -2e18;

int takemod(int a){return ((a%mod)+mod)%mod;}

int pow(int a, int b, int m)
{
	int ans = 1;
	a %= m;
	while (b)
	{
		if (b & 1)
			ans = (ans * a) % m;
		b /= 2;
		a = (a * a) % m;
	}
	return ans;
}

int modinv(int a){return takemod( pow( takemod(a), mod-2,mod ) );}


signed main()
{

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	#ifdef __APPLE__
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
		freopen("error.txt","w",stderr);
	#endif

	time_t t1, t2;
	t1 = clock();
	
	string s;
	cin >> s;

	for(auto i : s){
		if(i == '7'){
			cout << "Yes" << endl;
			return 0;
		}
	}
	
	cout << "No" << endl; 

	t2 = clock();
	cerr << endl << t2-t1 << endl;
	
	return 0;
}



Measured memory_bytes: 3644
#pragma target("avx")
#pragma optimize("O3")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;

#define REP(i,b,e) for(ll i=b; i<e; i++)
#define ALL(vec) vec.begin(),vec.end()
#define PRINT(vec) printf("[ ");for(auto &i:vec)printf("%ld ",i);puts("]");
#define SCAN(vec) for(auto &i:vec)scanf("%ld",&i)
#define fi first
#define se second

const int MOD = 1e9+7;
const ll INF = 1e18;
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

int main(){
	int n;
	scanf("%d", &n);
	ll a[1+n];
	a[0] = 0;
	std::map<ll,ll> mp;
	mp[0]++;
	REP(i, 1, 1+n){
		scanf("%ld", &a[i]);
		a[i] += a[i-1];
		mp[a[i]]++;
	}
	ll ans = 0;
	for(P p: mp) ans += p.se*(p.se-1)/2;
	printf("%ld\n", ans);
	return 0;
}




Measured memory_bytes: 17728
object Main {
  def main(args: Array[String]): Unit = {
    solve
  }

  def solve(): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val a = new Array[Long](n)
    for (i <- 0 until n) {
      a(i) = sc.nextLong()
    }

    val acc = a.scanLeft(0L)(_ + _)
    var ans = Long.MaxValue
    for (i <- 1 until n) {
      val x = acc(i)
      val y = acc(n) - acc(i)
      ans = math.min(ans, math.abs(x - y))
    }
    println(ans)
  }
}


Measured memory_bytes: 70692
#include <bits/stdc++.h>
 
using namespace std;
 
#define PB(x)	push_back(x)
#define ALL(x)	(x).begin(), (x).end()
#define ALLR(x)	(x).rbegin(), (x).rend()
#define MP(x)	make_pair(x)
 
#define debug(_x)		cerr << #_x << '=' << _x << endl;
#define debug2(_x, _y)	cerr << #_x << '=' << _x << ' ' << #_y << '=' << _y << endl;
#define debugn(_a)		cerr << #_a << ": "; for (const auto _x: _a) cerr << _x << ' '; cerr << endl;
 
#define FAST_IO ios::sync_with_stdio(false); cin.tie(0)
 
#define int long long int
 
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef unsigned long long ull;
 
const int INF = LONG_LONG_MAX >> 1;
const int NINF = LONG_LONG_MIN;
const int mmod = 100000000000ll;

int32_t main() {
	FAST_IO;
	
	int n;
	cin >> n;
	cout << (n+1)/2 << endl;
}
// g++ -Wall -Wextra -Wshadow -fsanitize=undefined


Measured memory_bytes: 256
import sys
 
 
class UnionFind:
    def __init__(self, n):
        self.table = [-1] * n
 
    def _root(self, x):
        if self.table[x] < 0:
            return x
        else:
            self.table[x] = self._root(self.table[x])
            return self.table[x]
 
    def count(self, x):
        return -self.table[self._root(x)]
 
    def find(self, x, y):
        return self._root(x) == self._root(y)
 
    def union(self, x, y):
        r1 = self._root(x)
        r2 = self._root(y)
        if r1 == r2:
            return
        d1 = self.table[r1]
        d2 = self.table[r2]
        if d1 <= d2:
            self.table[r2] = r1
            self.table[r1] += d2
        else:
            self.table[r1] = r2
            self.table[r2] += d1
 
 
n, m, k = map(int, sys.stdin.buffer.readline().split())
abcd = list(map(int, sys.stdin.buffer.read().split()))
uft = UnionFind(n)
friends = [0 for _ in range(n)]
blocks = [set() for _ in range(n)]
for a, b in zip(abcd[0:2 * m:2], abcd[1:2 * m:2]):
    a -= 1
    b -= 1
    uft.union(a, b)
    friends[a] += 1
    friends[b] += 1
for c, d in zip(abcd[2 * m::2], abcd[2 * m + 1::2]):
    c -= 1
    d -= 1
    blocks[c].add(d)
    blocks[d].add(c)
ans = []
for i in range(n):
    ans.append(uft.count(i) - 1 - friends[i] - sum(uft.find(i, j) for j in blocks[i]))
print(*ans)

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

int main()
{
        int k, a,b;
        cin>>k >>a>>b;
        bool ans = false;

        for(int i = a; i<= b;i++)
        {
                if(i % k ==0)
                {
                        ans = true;
                }
        }
        if(ans)
        {
                cout << "OK" << endl;
        }
        else
        {
                cout << "NG" << endl;
        }
}


Measured memory_bytes: 3620
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.replace(/\n$/,"")).split("\n");
while(true){
   var n=Arr.shift()-0;
   if(n===0)break;
   var L=[0,0,0];
   var D=[0,0,0];
   var M=[0,0,0];
   for(var i=0;i<n;i++){
      var arr=(Arr.shift()).split(" ");
      var hm=(arr[0]).split(":");
      var h=hm[0];
      var m1=parseInt(hm[1],10);
      var m2=parseInt(arr[1],10);
      if(m2<m1)m2+=60;
      if(h.match(/11|12|13|14/)){L[2]++;(m2-m1<=8)?L[0]++:L[1]++;}
      if(h.match(/18|19|20/)){D[2]++;(m2-m1<=8)?D[0]++:D[1]++;}
      if(h.match(/00|01|21|22|23|24/)){M[2]++;(m2-m1<=8)?M[0]++:M[1]++;}
   }
   L=(L[2]==0)?"no guest":Math.floor(L[0]/(L[0]+L[1])*100);
   D=(D[2]==0)?"no guest":Math.floor(D[0]/(D[0]+D[1])*100);
   M=(M[2]==0)?"no guest":Math.floor(M[0]/(M[0]+M[1])*100);
   console.log("lunch "+L);
   console.log("dinner "+D);
   console.log("midnight "+M);
}

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

#define int            long long int
#define float          long double
#define setbits(x)     __builtin_popcountll(x)
#define zrobits(x)     __builtin_ctzll(x)
#define mod            1000000007
#define inf            1e18
#define set_pre(x,y)   fixed<<setprecision(y)<<x
#define w(t)           int t; cin>>t; while(t--)

using namespace std;
int32_t main()
{
    int n,w;
    cin>>n>>w;
    vector<pair<int,int>>v(n+1);
    int maxVal=0;
    for(int i=1;i<=n;i++)
    {
        cin>>v[i].first>>v[i].second;
        maxVal+=v[i].second;
    }
    int dp[n+1][maxVal+1];
    for(int i=0;i<=maxVal;i++)
    {
        dp[1][i]=inf;
    }
    dp[1][v[1].second]=v[1].first;
    dp[1][0]=0;
    for(int i=2;i<=n;i++)
    {
        for(int val=0;val<=maxVal;val++)
        {
            dp[i][val]=dp[i-1][val];
            if(v[i].second>val)
                continue;
            dp[i][val]=min(dp[i][val],dp[i-1][val-v[i].second]+v[i].first);
        }
    }
    int ans=0;
    for(int i=0;i<=maxVal;i++)
    {
        if(dp[n][i]<=w)
            ans=i;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 78336
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
B = input().rstrip()
d = {
    "A":"T",
    "T":"A",
    "C":"G",
    "G":"C"
}
print(d[B])

Measured memory_bytes: 2940
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

const int size=10e5+2;
int sizeC;
int arr[size];
int state[size];

int countMin(int n){
  if(n>=sizeC-1)
    return 0;

  if(state[n])
    return state[n];

  return state[n]=min(abs(arr[n]-arr[n+1])+countMin(n+1),abs(arr[n]-arr[n+2])+countMin(n+2));
}
int main(){

  scanf("%d",&sizeC);
  for(int i=0;i<sizeC;i++)
    scanf("%d",&arr[i]);

  state[0]=0;
  state[1]=abs(arr[0]-arr[1]);
  for(int i=2;i<sizeC;i++)
    state[i]=min(state[i-1]+abs(arr[i]-arr[i-1]),state[i-2]+abs(arr[i-2]-arr[i]));
  //cout<<countMin(0)<<endl;
  cout<<state[sizeC-1]<<endl;

  return 0;
}


Measured memory_bytes: 4736
H,W = map(int,input().split())
s = ["."*(W+2)] + ["." + input() + "." for _ in range(H)] + ["."*(W+2)]

out = "Yes"
for i in range(1,H+1):
    for j in range(1,W+1):
        if s[i][j] == "." :
            continue
        for k,l in ((1,0),(-1,0),(0,1),(0,-1)):
            if s[i+k][j+l] == "#":
                break
        else:
            out = "No"
            break
    if out=="No":
        break
print(out)

Measured memory_bytes: 3064
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        Integer[] A = new Integer[N];
        double result = 0;
        for(int i=0;i<N;i++){
            A[i] = scan.nextInt();
        }
        Arrays.sort(A, Comparator.reverseOrder());
        result += A[0]; 
        for(int i = 2;i<N;i++){
            int results = A[i/2];
            result += (double)results;
        }
        System.out.println(String.format("%.0f", result));
    }
}

Measured memory_bytes: 64232
from collections import defaultdict
n,m=map(int,input().split())
h=list(map(int,input().split()))
d=defaultdict(int)
for i in range(m):
    a,b=map(int,input().split())
    d[a]=max(d[a],h[b-1])
    d[b]=max(d[b],h[a-1])

ans=0
for i in range(1,n+1):
    h1=d[i]
    if h[i-1]>h1:
        ans+=1
print(ans)

Measured memory_bytes: 93932
#include <bits/stdc++.h>
using namespace std;
#define int long long
int MOD = (int)1e9 + 7;
int INF = (int)2e18;
// Comment out below and program paste

// #include "UnionFind.hpp"
// #include "power.hpp"

signed main() {
    int N;
    cin >> N;
    int tarou = 0, hanako = 0;
    for (int i = 0; i < N; i++) {
        string a, b;
        cin >> a >> b;
        if (a > b) tarou += 3;
        else if (a == b) {
            ++tarou;
            ++hanako;
        } else {
            hanako += 3;
        }
    }
    cout << tarou << " " << hanako << endl;
}



Measured memory_bytes: 3132
//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

using i8 = ::std::int_least8_t;
using i32 = ::std::int_least32_t;
using i64 = ::std::int_least64_t;
using u8 = ::std::uint_least8_t;
using u32 = ::std::uint_least32_t;
using u64 = ::std::uint_least64_t;
using isize = ::std::ptrdiff_t;
using usize = ::std::size_t;

template <class T = usize> class rep {
	const T f, l;

public:
	class itr {
		friend rep;
		T i;
		constexpr itr(T x) noexcept : i(x) {}

	public:
		void operator++() noexcept { ++i; }
		T operator*() const noexcept { return i; }
		bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	constexpr rep(const T first, const T last) noexcept : f(first), l(last) {}
	itr begin() const noexcept { return itr(f); }
	itr end() const noexcept { return itr(l); }
};
template <class T = usize> class revrep {
	const T f, l;

public:
	class itr {
		friend revrep;
		T i;
		constexpr itr(T x) noexcept : i(x) {}

	public:
		void operator++() noexcept { --i; }
		T operator*() const noexcept { return i; }
		bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	constexpr revrep(const T first, const T last) noexcept : f(first), l(last) {}
	itr begin() const noexcept { return itr(l - 1); }
	itr end() const noexcept { return itr(f - 1); }
};
template <class T> bool maxi(T &a, const T &b) {
	return a <= b ? (a = b, 1) : 0;
}
template <class T> bool mini(T &a, const T &b) {
	return b <= a ? (a = b, 1) : 0;
}
template <class T> bool smaxi(T &a, const T &b) {
	return b <= a ? 0 : (a = b, 1);
}
template <class T> bool smini(T &a, const T &b) {
	return a <= b ? 0 : (a = b, 1);
}
template <class T> using vec_alias = ::std::vector<T>;
template <class T> auto md_vec(usize n, const T &value) {
	return ::std::vector<T>(n, value);
}
template <class... Args> auto md_vec(usize n, Args... args) {
	return ::std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> const T &as_const(const T &v) noexcept { return v; }

#include <algorithm>
#include <cstdio>
#include <utility>
#include <limits>

int main() {
	using ull = unsigned long long;
	ull n, x;
	scanf("%llu%llu", &n, &x);
	::std::vector<ull> s(n), p(n);
	s[0] = 1;
	p[0] = 1;
	for (const auto i : rep<>(1, n)) {
		s[i] = s[i - 1] * 2 + 3;
		p[i] = p[i - 1] * 2 + 1;
	}
	ull ans{ 0 };
	while (n--) {
		if (x == 0) {
			break;
		}
		if (x >= s[n] + 2) {
			ans += p[n] + 1;
			x -= s[n] + 2;
		}
		else {
			x -= 1;
		}
	}
	if (x >= 1) {
		++ans;
	}
	printf("%llu\n", ans);
	return 0;
}


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

#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define mod 1000000007
#define inf 100000000000010
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF LONG_MAX
#define PI 3.1415926535897932384626
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define rep(x,j,n)for(int x=j;x<n;x++)
#define all(x) (x).begin(), (x).end()

typedef vector<pair<ll,ll>> vpi;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll,ll> pi;

bool isprime(ll n)
{
    if(n<=1)return false;
    if(n<=3)return true;
    if(n%2==0||n%3==0)return false;
    for(ll i=5;i*i<=n;i+=6)
    {
        if(n%i==0||n%(i+2)==0)return false;
    }
    return true;
}

ll modexp(ll a,ll b,ll m)
{
    ll r=1;
    a=a%m;
    while(b>0)
    {
        if(b&1)r=(r*a)%m;
        b = b>>1;
        a=(a*a)%m;
    }
    return r%m;
}

struct CustomCompare
{
    bool operator()(const int& lhs, const int& rhs)
    {
        return lhs < rhs;
    }
};

bool comp(pair<ll, ll>a,pair<ll,ll>b)
{
    return a.fi>=b.fi;
}

ll builtin_popcount(ll x)
{
    ll cnt = 0;
    for(ll i=60;i>=0;i--)
    {
        if((1LL<<i)&x)cnt++;
    }
    return cnt;
}

ll addmod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    return (a+b)%mod;
}
ll mulmod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    return (a*b)%mod;
}
/*
const int mxn = 5*(1e6) +10;
vi spf(mxn);
void sieve()
{
    for(ll i =0;i<mxn;i++)spf[i]  = i;
    for(ll i=2;i<mxn;i+=2)spf[i] = 2;
    for(ll i = 3;i*i<mxn;i++)
    {
        if(spf[i]==i)
        {
            for(ll j = i*i;j<mxn;j+=i)
            {
                if(spf[j]==j)spf[j] = i;
            }
        }
    }
}
*/

int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
ll n; cin>>n;
ll a = 0,b = 0,c = 0,d = 0;
while(n--)
{
    string s; cin>>s;
    if(s=="AC")a++;
    else if(s=="WA")b++;
    else if(s=="TLE")c++;
    else d++;
}
cout<<"AC x "<<a<<endl;
cout<<"WA x "<<b<<endl;
cout<<"TLE x "<<c<<endl;
cout<<"RE x "<<d<<endl;
return 0;

}
/*
1
8
1 7 3 4 7 6 2 9
*/


Measured memory_bytes: 3656
#include<iostream>
#include<string>
#include<math.h>
  
using namespace std;
  
int main(){
int a,b;
cin >> a >>b ;
if (a<b){
    cout <<"a < b" <<endl ;
}
else if(a==b){
cout << "a == b"<<endl;
}

else {cout << "a > b"<<endl;
}
return 0;
}


Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
int mod=163577857;
inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}
inline int power(int a,int n,int m){if(n==0)return 1;int p=power(a,n/2,m);p=(p%m*p%m)%m;if(n%2) return (p%m*a%m)%m;else return p;}
vector<int>adj[100009];
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,k;
    cin>>n>>k;
    set<int>s;
    for(int i=0;i<k;i++)
    {
        int m,x;
        cin>>m;
        int a[m];
        for(int j=0;j<m;j++)
           {cin>>x; s.insert(x);}
    }
    cout<<n-s.size();
    return 0;
}


Measured memory_bytes: 5956
n=int(input())
A=list(map(int,input().split()))

s=sum(A)
left=0
right=n-1

while(left+1<right):
    if 2*sum(A[0:(left+right)//2])>s:
        right=(left+right)//2
    elif 2*sum(A[0:(left+right)//2])<s:
        left = (left+right)//2
    else:
        left=(left+right)//2
        right=(left+right)//2
        break

print(min(abs(s-2*sum(A[0:left+1])),abs(s-2*sum(A[0:left]))))

Measured memory_bytes: 26220
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
    int n,flag=1,ans=0;
    cin >> n;
    vector<int> vec(n);
    rep(i,n)cin >> vec.at(i);
    while(1){
        rep(i,n){
            if(!(vec.at(i)%2))vec.at(i)/=2;
            else{
                flag=0;
                break;
            }
        }
        if(!flag)break;
        ans++;
    }
    cout << ans << endl;
}


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

long long ans(long long n){
  if(n==1) return 1;
  if(n%2==0) return ans(n/2)*2+1;
  if(n%2==1) return ans((n-1)/2)*2+1;
}

int main() {
  long long h;
  cin>>h;
  cout<<ans(h)<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        int love = 753;
        int minDiff = 10000;

        for (int i = s.length() - 3; i >= 0; i--) {
            String sub = s.substring(i, i+3);
            int n = Integer.valueOf(sub);
            int diff = Math.abs(love - n);
            if (minDiff > diff)
                minDiff = diff;
        }
        System.out.println(minDiff);
    }
}


Measured memory_bytes: 23252
#include<bits/stdc++.h>
#define ll      long long
#define pb	    push_back
#define F	    first
#define S	    second
#define B	    begin()
#define E	    end()
#define pii     pair < ll , ll >
#define FASTIO  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std ;
int jamil ;
int main()
{
    FASTIO
    int h , w ;
    cin >> h >> w ;
    int c[11][11];
    for ( int i = 0 ; i < 10 ; i++ )
        for ( int j = 0 ; j < 10 ; j++ )
             cin >> c[i][j] ;
    for ( int k = 0 ; k < 10 ; k++ )
        for ( int i = 0 ; i < 10 ; i++ )
            for ( int j = 0 ; j < 10 ; j++ )
            if ( c[i][j] > c[i][k] + c[k][j] )
                c[i][j] = c[i][k] + c[k][j] ;
    int ans = 0 ;
    for ( int i = 0 ; i < h ; i++ )
        for ( int j = 0 ; j < w ; j++ )
        {
            int x ;
            cin >> x ;
            if( x >= 0 )
                ans+=c[x][1];
        }
    cout << ans ;
	return 0 ;
}


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

int main() {
  int N;
  cin >> N;
  int ans = 0;
  
  for (int i = 0; i < N; i++) {
    int l, r;
    cin >> l >> r;
    
    ans += (r - l + 1);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
package main

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

const MAX_LEN = 100000

var sc = bufio.NewScanner(os.Stdin)

type Process struct {
	name string
	time int
}

type Queue struct {
	q [MAX_LEN]Process
	head int
	tail int
}

func GenQueue() Queue {
	return Queue{head: 0, tail: 0}
}

func (queue *Queue) IsEmpty() bool {
	return queue.head == queue.tail
}

func (queue *Queue) EnQueue(name string, time int) {
	queue.q[queue.tail] = Process{name: name, time: time}
	queue.tail = (queue.tail + 1) % MAX_LEN
}

func (queue *Queue) DeQueue() Process {
	if queue.IsEmpty() {
		panic("empty")
	}
	r := queue.q[queue.head]
	queue.head = (queue.head + 1) % MAX_LEN
	return r
}

func main() {
	q := GenQueue();
	
	sc.Scan()
	str := sc.Text()
	s := strings.Split(str, " ")
	n, _ := strconv.Atoi(s[0])
	time, _ := strconv.Atoi(s[1])

	for i := 0; i < n; i++ {
		sc.Scan()
		str = sc.Text()
		s := strings.Split(str, " ")
		time, _ := strconv.Atoi(s[1])
		q.EnQueue(s[0], time)
	}

	all_time := 0

	for {
		if q.IsEmpty() {
			break
		}
		p := q.DeQueue()
		if p.time <= time {
			all_time += p.time
			fmt.Printf("%s %d\n", p.name, all_time);
		} else {
			q.EnQueue(p.name, p.time - time)
			all_time += time
		}
	}
}



Measured memory_bytes: 13504
#include <stdio.h>

int main(){
   int i,n,d,c[100001],j,k;
   long a;
 
   scanf("%d",&n);
   for (i=0;i<n;i++) c[i]=0;
   for (i=0;i<n;i++) {
      scanf("%d",&d);
      if (i==0) j=d;
      c[d]++;
   }
   if (j!=0 || c[0]!=1) {
      puts("0");
      return 0;
   }
   a=1;
   for (i=2;i<n;i++) {
      if (c[i]==0) {
         for (j=i+1;j<n;j++)
            if (c[j]>0) {
               puts("0");
               return 0;
            }
         break;
      }
      for (k=0;k<c[i];k++) a=(a*c[i-1])%998244353;
   }
   printf("%ld\n",a);
   return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#define mod (1e9 + 7)
#define pb push_back
#define ll long long int
#define int long long
using namespace std;
typedef pair<int,int> pii;

signed main(){

  int N;
  cin>>N;

  int t,mon;
  mon=0;
  vector<int> a,b;
  for(int i=0;i<N+1;i++){
    cin>>t;
    a.pb(t);
    mon+=t;
  }
  for(int i=0;i<N;i++){
    cin>>t;
    b.pb(t);
  }

  for(int i=0;i<N;i++){
    if(a[i]>=b[i]) a[i]-=b[i];
    else{
      t=b[i]-a[i];
      a[i]=0;
      a[i+1]=max((int)0,a[i+1]-t);
    }
  }

  for(int i=0;i<N+1;i++){
    mon-=a[i];
  }
  cout<<mon<<endl;
  return 0;
}


Measured memory_bytes: 2548
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define _h cout<<"here"<<endl;
#define fill(a,v) memset(a,v,sizeof(a));
#define all(v) v.begin(),v.end()
#define rep(i,n) for(int i=0;i<n;i+=1)
#define prarr(a,n) rep(i,n) cout<<a[i]<<" \n"[i==n-1];// printf("%s\n"," " );
#define ff first
#define ss second
#define pu push_back
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
template<typename S, typename T> 
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.ff<<", "<<p.ss<<')';return out;}
template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
const int inf = 1e9+10;
const ll INF = 1e18+10;
const int MOD = 1e9+7;
const int MAXN = 2e5+10;

void solve()
{
	int n;
	bool ans = 0;
	ll a, b, c;
	cin >> a >> b >> c;
	if(a+b < c){
		if(4*a*b < (c-a-b)*(c-a-b))
			ans = 1;
	}
	else if(a + b > c){
		ans = 0;
	}
	if(ans)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
}
int main()
{
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t = 1;
	// cin>>t;
	while(t--){
		solve();
	}
	return 0;

}
    

Measured memory_bytes: 256