akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <cstring>
#include <cassert>
#include <list>
#include <map>
#include <unordered_map>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <limits>
using namespace std;
typedef long long          ll;
typedef unsigned long long ull;
typedef long double        ld;
typedef pair<int,int>      pii;
typedef pair<ll,ll>        pll;
typedef vector<int>        vi;
typedef vector<long long>  vll;
#define left(x)		   (x << 1)
#define right(x) 	   (x << 1) + 1
#define mid(l, r) 	   ((l + r) >> 1)
#define mp                 make_pair
#define pb                 push_back
#define all(a)             a.begin(),a.end()
#define debug(x)	   {cerr <<#x<<" = " <<x<<"\n"; }
#define debug2(x, y)       {cerr <<#x<<" = " <<x<<", "<<#y <<" = " <<y <<"\n";}
#define debug3(x, y, z)    {cerr <<#x<<" = " <<x<<", "<<#y <<" = " <<y <<", "<<#z<<" = "<<z<<"\n";}
#define debug4(x, y, z, w) {cerr <<#x<<" = " <<x<<", "<<#y <<" = " <<y <<", "<<#z<<" = "<<z<<", "<<#w << " = " <<w <<"\n";}
#define ss                 second
#define ff                 first
#define m0(x) 		   memset(x,0,sizeof(x))

template<typename T >T min_ ( T a , T b ) { return a > b ? b : a ; }
template < typename T ,  typename... Ts > T min_( T first , Ts... last ){ return  min_(first, min_(last...)); }
template<typename T >T max_ ( T a , T b ) { return a > b ? a : b ; }
template < typename T ,  typename... Ts > T max_( T first , Ts... last ){ return  max_(first, min_(last...)); }

template<class T, class S> std::ostream& operator<<(std::ostream &os, const std::pair<T, S> &t) {
	os<<"("<<t.first<<", "<<t.second<<")";
	return os;
}
template<typename T> ostream& operator<< (ostream& out, const vector<T>& v) {
    out << "["; size_t last = v.size() - 1; for(size_t i = 0; i < v.size(); ++i) {
    out << v[i]; if (i != last) out << ", "; } out << "]"; return out;
}

ll pwr(ll base, ll p, ll mod){
ll ans = 1; while(p) { if(p&1) ans=(ans*base)%mod; base=(base*base)%mod; p/=2; } return ans;
}
ll gcd(ll a, ll b) {  return b == 0 ? a : gcd(b,a%b); }
ll lcm(ll a, ll b) {  return a*(b/gcd(a,b)); }

const long double PI = (long double)(3.1415926535897932384626433832795);
const ll  mx_ll   = numeric_limits<ll> :: max();
const int mx_int  = numeric_limits<int> :: max();
const int mod = 1e9+7;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
  //  freopen("text.in", "rb", stdin);
    //freopen("  .out", "wb", stdout);

    int n; cin >> n;
   
    ull fans = 0;
    for(int i = 1; i <= n; ++i) {
        if(i%3 != 0 && (i%5 != 0)) { 
            fans += i;
        }
    }
    cout << fans << endl;
    return 0;
}


Measured memory_bytes: 3648
#include <iostream>

using namespace std;
int main() {
    int A, B;

    cin >> A >> B;
    if(A >= 13) {
        cout << B << endl;
    } else if(A >= 6) {
        cout << B / 2 << endl;
    } else {
        cout << 0 << endl;
    }
}

Measured memory_bytes: 256
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define debug(aa, a) fprintf(stderr, aa, a)

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

bool is_prime(ll x) {//素数判定
	for (ll i = 2; i * i <= x; i++) {
		if (x % i == 0) return false;
	}
	return true;
}

int main() {

	int x;
	scanf("%d", &x);
	while (is_prime(x) == false)++x;
	printf("%d\n", x);

	Please AC;
}

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

#ifdef DEBUG
#include ".inc/debug.hpp"
#else
#define debug(...) 42
#define rdfile(...) 42
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    // rdfile("_input.txt");

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

    sort(v.begin(), v.end());

    double val = v[0];
    for (int i = 1; i < N; ++i) {
        val = (v[i] + val) / 2.0;
    }

    printf("%.9f\n", val);

    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 REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))

#define INF 2e9
#define INF_LL 1LL<<60
#define ll long long

typedef pair<ll, ll> P;

int sosu[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,
                47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
int bunkai[25];

const int MAX = 2000005;
const int MOD = 1000000007;

int kaijo(int k, int n) {
    int tmp = 1;
    REP(i, n) {
        tmp *= k;
    }
    
    return tmp;
}

int main(){
    int n;
    cin >> n;
    int ans = 0;

    /* n!を素因数分解 */
    REP(idx, 25) {
        int tmp = 1;
        int n_ = n;
        while(n_ / kaijo(sosu[idx], tmp) > 0) {
            bunkai[idx] += n_ / kaijo(sosu[idx], tmp);
            tmp++;
            n_ = n;
        }
    }

    /* 4 4 2 を探す */
    REP(i, 25) REPN(j, i+1, 25) REPN(k, j+1, 25) {
        if(bunkai[i] >= 2) {
            if(bunkai[j] >= 4 && bunkai[k] >= 4) ans++;
        }
        if(bunkai[i] >= 4) {
            if(bunkai[j] >= 2 && bunkai[k] >= 4) ans++;
            if(bunkai[j] >= 4 && bunkai[k] >= 2) ans++;
        }
    }

    //cout << "ans" << ans << endl;

    /* 14 4 を探す */
    REP(i, 25) REPN(j, i+1, 25) {
        if(bunkai[i] >= 14) {
            if(bunkai[j] >= 4) ans++;
        }
        if(bunkai[i] >= 4) {
            if(bunkai[j] >= 14) ans++;
        }
    }

    //cout << "ans" << ans << endl;

    /* 24 2 を探す */
    REP(i, 25) REPN(j, i+1, 25) {
        if(bunkai[i] >= 24) {
            if(bunkai[j] >= 2) ans++;
        }
        if(bunkai[i] >= 2) {
            if(bunkai[j] >= 24) ans++;
        }
    }

    /* 74を探す */
    REP(i, 25) if(bunkai[i] >= 74) ans++;

/*
    REP(i, 25) {
        cout << bunkai[i] << endl;
    }
*/

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;
string s;
ll dp[100010][13];
ll ten[100010];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>s;
    int n=s.length();
    ten[0]=1;
    rep(i,1,n+1){
        ten[i]=10*ten[i-1]%13;
    }
    if(s[n-1]=='?'){
        rep(i,0,10){
            dp[n-1][i]=1;
        }
    }
    else{
        dp[n-1][s[n-1]-'0']=1;
    }
    rer(i,n-1,0){
        if(s[i]=='?'){
            rep(j,0,10){
                rep(k,0,13){
                    dp[i][(j*ten[n-1-i]+k)%13]+=dp[i+1][k];
                    dp[i][(j*ten[n-1-i]+k)%13]%=MOD;
                }
            }
        }
        else{
            rep(k,0,13){
                dp[i][((s[i]-'0')*ten[n-1-i]+k)%13]+=dp[i+1][k];
                dp[i][((s[i]-'0')*ten[n-1-i]+k)%13]%=MOD;
            }
        }
    }
    cout <<dp[0][5]<<"\n";
}

Measured memory_bytes: 11472
#include<stdio.h>
#include<ctype.h>
#include<string.h>
main(){
  int a=0;
  int b=0;
  int c=0;
  int d=0;
  int e=0;
  char A[11];
  char A2[1001];
  scanf("%s",&A);
  for(c=0;c<strlen(A);c++){
    if(isupper(A[c])){
      A[c]=tolower(A[c]);
    }
  }
  while(1){
    scanf("%s",&A2);
    if(strcmp(A2,"END_OF_TEXT")==0)break;
    for(b=0;b<strlen(A2);b++){
      if(isupper(A2[b])){
	A2[b]=tolower(A2[b]);
      }
    }
    if(strcmp(A,A2)==0){
      a=a+1; 
    }
  }
  printf("%d\n",a);
  return 0;
}

Measured memory_bytes: 552
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define Fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define MOD 1000000007

int main()
{
    Fast;

    string s;
    cin>>s;
    if(s[0]=='0' && s[1]>'0' || (s[0]=='1' && s[1]>='0' && s[1]<='2'))
    {
        if(s[2]=='0')
        {
            if(s[3]>'0' && s[3]<='9')
                cout<<"AMBIGUOUS";
            else
                cout<<"MMYY";
        }
        else if(s[2]=='1')
        {
            if(s[3]>='0' && s[3]<='2')
                cout<<"AMBIGUOUS";
            else
                cout<<"MMYY";
        }
        else
            cout<<"MMYY";
    }
    else
    {
        if(s[2]=='0')
        {
            if(s[3]>'0' && s[3]<='9')
                cout<<"YYMM";
            else
                cout<<"NA";
        }
        else if(s[2]=='1')
        {
            if(s[3]>='0' && s[3]<='2')
                cout<<"YYMM";
            else
                cout<<"NA";
        }
        else
            cout<<"NA";        
    }
}


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

bool cal(int n) {
  int a[10];
  int i=0;
  while (n>0) {
    a[i++]=n%10;
    n/=10;
  }
  if (a[0] == a[4] && a[1] == a[3]) {
      //cout << N << endl;
      return true;
  } else {
      return false;
  }
}

int main (void) {
  int A, B;
  cin >> A >> B;
  int ans=0;
  for (int i=A; i<=B; i++) {
    if (cal(i)) {
      ans++;
    }
  }
  cout << ans;
}

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

int main()
{
  int n;
  int* d;
  cin >> n;
  d = new int[n];
  for(int i = 0; i < n; i++)
    cin >> d[i];
  sort(d, d + n);
  int index = n / 2 - 1;
  cout << d[index + 1] - d[index] << endl;
  delete d;
  return 0;
}

Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using static System.Console;

class Program {
	static void Main() {
		var N = NextInt();
		var M = Pow(10, 9) + 7;
		var ans = 1L;

		for (var i = 1; i <= N; i++) {
			ans = (ans * i) % M;
		}
		WriteLine(ans);
	}

	static long Pow(long a, long b) {
		long result = 1;
		for (var i = 0; i < b; i++) {
			result *= a;
		}
		return result;
	}

	static int NextInt() {
		return int.Parse(NextString());
	}

	static string NextString() {
		var result = new List<char>();
		while (true) {
			int next = Read();
			if (next < 0)
				break;
			var nextChar = (char)next;
			if (!char.IsWhiteSpace(nextChar))
				result.Add(nextChar);
			else if (nextChar != '\r')
				break;
		}
		return string.Join("", result);
	}
}


Measured memory_bytes: 13268
<?php
  $n = trim(fgets(STDIN));
  $last = strlen($n)-1;
  $hon = [2,4,5,7,9];
  $pon = [0,1,6,8];
  if(in_array($n[$last],$hon)){
      echo "hon";
  }else if(in_array($n[$last],$pon)){
      echo "pon";
  }else{
      echo "bon";
  }

Measured memory_bytes: 16112
N,L=input().split()


ApplesTaste=[]
for i in range(int(N)):
    taste=int(L)+i
    ApplesTaste.append(taste)


hu=0
zero=0
for i in ApplesTaste:
    
    if i is 0:
        zero+=1
    if i < 0:
        hu+=1

#0がある
if zero is 1:
    point=ApplesTaste.index(0)
    del ApplesTaste[point]
    print(sum(ApplesTaste))

#0がなく全部負
elif hu > 0 and zero is 0:
    point=len(ApplesTaste)-1
    
    del ApplesTaste[point]
    print (sum(ApplesTaste))

else:
    del ApplesTaste[0]
    print(sum(ApplesTaste))

Measured memory_bytes: 3064
import java.util.Scanner;
 
class Main {
	int w;
	int h;
	int n;
	int[] x;
	int[] y;
	int[] a;
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}
	Main(Scanner sc){
		w = sc.nextInt();
		h = sc.nextInt();
		n = sc.nextInt();
		x = new int[n];
		y = new int[n];
		a = new int[n];
		for(int i=0;i<n;i++){
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
			a[i] = sc.nextInt();
		}
	}
	void solve(){
		int sx = 0,sy = 0;
		int gx = w,gy = h;
		for(int i=0;i<n;i++){
			switch(a[i]){
			case 1:
				sx = Math.max(sx, x[i]);
				break;
			case 2:
				gx = Math.min(gx, x[i]);
				break;
			case 3:
				sy = Math.max(sy, y[i]);
				break;
			case 4:
				gy = Math.min(gy, y[i]);
				break;
			}
		}
		System.out.println((gx-sx)>0&&(gy-sy)>0?(gx-sx)*(gy-sy):0);
	}
}

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

int main() {
  int n;
  cin >>n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i);
  }
  
  bool p=true;
  long long c=1000,s=0;
  
  for(int i=0;i<n;i++){
    
    if(i==n-1){
      if(p!=true)	c += s * a.at(i);
      break;
    }
    
    //yen
    if(p){
      if(a.at(i)<a.at(i+1)){
        s += c/a.at(i);
        c = c % a.at(i);
        p=false;
      }
      else	continue;
    }
    
    //stock
    else{
      if(a.at(i)>a.at(i+1)){
        c = c + s * a.at(i);
        s = 0;
        p=true;
      }
      else	continue;
    }   
  }
  
  cout << c;
  
  return 0;
}


Measured memory_bytes: 3648
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <cstring>
#include <cctype>
#include <sstream>
#include <set>
#include <stack>
#include <map>
#include <queue>
#include <complex>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for(int i = a; i < (int)b; i++)
const int INF = 1<<28;
#define MAX 1401

int dp[MAX][MAX];

int solve(int H, int W) {
	REP(j,W) {
		int v = 1;
		REP(i, H) {
			if(!dp[i][j])
				v = 0;
			dp[i][j] = v++;
		}
	}

	int ans = 0;
	REP(i, H) {
		pair<int, int> p, p2;
		stack< pair<int, int> > s;
		REP(j, W+1) {
			p = make_pair(dp[i][j], j);
			if(s.empty())
				s.push(p);
			else {
				if(s.top().first < p.first)
					s.push(p);
				else if(s.top().first > p.first) {
					int pnt = j;
					while(!s.empty() && s.top().first >= p.first) {
						p2 = s.top(); s.pop();
						ans = max(ans, p2.first * (j - p2.second));
						pnt = p2.second;
					}
					p.second = pnt;
					s.push(p);
				}
			}
		}
	}
	return ans;
}

int main() {
	int H, W; cin >> H >> W;
	REP(i, H) REP(j, W) {
		cin >> dp[i][j];
		dp[i][j] = !dp[i][j];
	}
	cout << solve(H, W) << endl;
	return 0;
}

Measured memory_bytes: 8864
#include <bits/stdc++.h>
#include <iomanip>
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
#define REP(i, a) for (ll i(0), _##i(a); i < _##i; ++i)
#define FOR(i, a, b) for (ll i(a), _##i(b); i <= _##i; ++i)

#ifdef LOCAL
#define _NTH_ARG(_1, _2, _3, _4, _5, _6, N, ...) N
#define _FE_1(_CALL, x) _CALL(x)
#define _FE_2(_CALL, x, ...) _CALL(x) _FE_1(_CALL, __VA_ARGS__)
#define _FE_3(_CALL, x, ...) _CALL(x) _FE_2(_CALL, __VA_ARGS__)
#define _FE_4(_CALL, x, ...) _CALL(x) _FE_3(_CALL, __VA_ARGS__)
#define _FE_5(_CALL, x, ...) _CALL(x) _FE_4(_CALL, __VA_ARGS__)
#define _FE_6(_CALL, x, ...) _CALL(x) _FE_5(_CALL, __VA_ARGS__)
#define FOR_EACH_MACRO(MACRO, ...)                                             \
  _NTH_ARG(__VA_ARGS__, _FE_6, _FE_5, _FE_4, _FE_3, _FE_2, _FE_1)              \
  (MACRO, __VA_ARGS__)
#define watch(x) cerr << "\033[1;32m" #x " = \033[1;34m" << (x) << "\033[0m; ";
#define debug(...)                                                             \
  cerr << "\033[2;31mLine " << __LINE__ << ": \033[0m";                        \
  FOR_EACH_MACRO(watch, __VA_ARGS__)                                           \
  cerr << endl
#else
#define debug(...)
#endif

using namespace std;

template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  return os << '{' << p.first << ", " << p.second << '}';
}

template <class T, class = decltype(begin(declval<T>())),
          class = enable_if_t<!is_same<T, string>::value>>
ostream &operator<<(ostream &os, const T &c) {
  os << '[';
  for (auto it = begin(c); it != end(c); ++it)
    os << (it == begin(c) ? "" : ", ") << *it;
  return os << ']';
}
using ll = long long;

void solve() {
  int n;
  cin >> n;
  vector<double> p(n);
  for (auto &x : p) {
    cin >> x;
  }
  const double INF = numeric_limits<double>::max();
  vector<vector<double>> dp(n, vector<double>(n, INF));
  function<double(int,int)> bt = [&](int idx, int cnt) -> double{
    if (idx == n){
      return cnt > n / 2 ? 1 : 0;
    }
    auto &res = dp[idx][cnt];
    if (res != INF) return res;
    res = p[idx] * bt(idx + 1, cnt + 1) + (1 - p[idx]) * bt(idx + 1, cnt);
    return res;
  };
  cout << fixed << setprecision(10) <<  bt(0, 0) << "\n";
}

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

  int T = 1;
  // cin >> T;
  while (T--) {
    solve();
  }
}


Measured memory_bytes: 70912
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
N = int(input())
# 文字列の入力
oldest_t = 0
oldest_x = 0
oldest_y = 0
for i in range(N):
    t, x, y = map(int, input().split())
    #print(t, x, y)
    distans_t=t-oldest_t
    distans_x=abs(x - oldest_x)
    distans_y=abs(y - oldest_y)
    #print(oldest_t, oldest_x, oldest_y)
    #print(distans_t, distans_x, distans_y)
    distans =  distans_t - distans_x - distans_y
    #print(distans)
    #print()
    if distans >= 0 and distans % 2==0:
        oldest_x = x
        oldest_y = y
        oldest_t = t
        continue
    else:
        print("No")
        exit()


#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])

print("Yes")


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=2e4;
int h,n,dp[N],a,b;
int main(){
	cin>>h>>n;
	memset(dp,0x3f,sizeof(dp));
	dp[0]=0;
	for(int i=1;i<=n;i++){
		cin>>a>>b;
		for(int j=a;j<N;j++)
			dp[j]=min(dp[j],dp[j-a]+b);
	}
	int ans=1e9;
	for(int j=h;j<N;j++)ans=min(ans,dp[j]);
	cout<<ans;
	return 0;
}

Measured memory_bytes: 384
#include <cstdio>  
#include <string>  
#include <cstring>  
#include <cmath>  
#include <iostream>   
#include <algorithm>  
#include<vector>
using namespace std;
#define inf 0x3f3f3f3f
const int maxn = 1e5 + 500;
char a[150][150];
int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= 50; i++)
		for (int j = 1; j <= 100; j++)
			a[i][j] = '.';
	for (int i = 51; i <= 100; i++)
		for (int j = 1; j <= 100; j++)
			a[i][j] = '#';
	int x = 1, y = 1;
	for (int i = 1; i <= 50; i += 2)
	{
		for (int j = 1; j <= 100; j += 2)
		{
			if (y == m)break;
			a[i][j] = '#';
			y++;
		}
		if (y == m)break;
	}

	for (int i = 100; i >= 51; i -= 2)
	{
		for (int j = 1; j <= 100; j += 2)
		{
			if (x == n)break;
			a[i][j] = '.';
			x++;
		}
		if (x == n)break;
	}
	cout << 100 << " " << 100 << endl;
	for (int i = 1; i <= 100; i++)
	{
		for (int j = 1; j <=100; j++)
			cout << a[i][j];
		cout << endl;
	}
	return 0;
}


Measured memory_bytes: 256
N = int(input())
D,X = map(int,input().split())
A = [int(input()) for i in range(N)]
L = []
for i in range(N):
  if (D % A[i] == 0):
    L.append(D//A[i])
  else:
    L.append((D//A[i])+1)
print(sum(L)+X)

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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)
#define debug(vari) cerr << #vari << " = " << (vari) << endl;

int main()
{
    int n, m;
    cin >> n;
    vector<string> s(n);
    rep(i, n) cin >> s[i];
    cin >> m;
    vector<string> t(m);
    rep(i, m) cin >> t[i];

    int ans = 0;
    rep(i, n)
    {
        int cnt = 0;
        rep(j, n)
        {
            if (s[i] == s[j])
            {
                cnt++;
            }
        }
        rep(k, m)
        {
            if (s[i] == t[k])
            {
                cnt--;
            }
        }
        ans = max(ans, cnt);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3588
#include <iostream>
#include <cstdio>
#include <vector>
#include <complex>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <cstring>
#include <stack>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <cassert>
 
using namespace std;
 
typedef long long ll;
typedef ll li;
typedef pair<int,int> PI;
#define EPS (1e-10L)
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define REP(i, n) rep (i, n)
#define F first
#define S second
#define mp(a,b) make_pair((a),(b))
#define list3(a,b,c) mp((a),mp((b),(c)))
#define list4(a,b,c,d) mp((a),list3((b),(c),(d)))
#define pb(a) push_back(a)
#define SZ(a) (int)((a).size())
#define ALL(a) a.begin(),a.end()
#define CLR(a) memset((a),0,sizeof(a))
#define FOR(it,a) for(__typeof(a.begin())it=a.begin();it!=a.end();++it)
template<typename T,typename U> ostream& operator<< (ostream& out, const pair<T,U>& val){return out << "(" << val.F << ", " << val.S << ")";}
template<class T> ostream& operator<< (ostream& out, const vector<T>& val){out << "{";rep(i,SZ(val)) out << (i?", ":"") << val[i];return out << "}";}
void pkuassert(bool t){t=1/t;};
int dx[]={0,1,0,-1,1,1,-1,-1};
int dy[]={1,0,-1,0,-1,1,1,-1};

int n,m;
ll scost[200][200];
ll lcost[200][200];
int z[1000];
ll cost[1000][200];

void solve(){
  rep(i,n)rep(j,n) scost[i][j]=lcost[i][j]=1LL<<30LL;
  rep(i,n) scost[i][i]=lcost[i][i]=0;
  rep(i,m){
    ll x,y,t;
    char s;
    cin >> x >> y >> t >> s;
    --x,--y;
    if(s=='S') scost[x][y]=scost[y][x]=min(scost[x][y],t);
    else lcost[x][y]=lcost[y][x]=min(lcost[x][y],t);    
  }
  rep(k,n)rep(i,n)rep(j,n){
    scost[i][j]=min(scost[i][j],scost[i][k]+scost[k][j]);
    lcost[i][j]=min(lcost[i][j],lcost[i][k]+lcost[k][j]);
  }

  int r;
  cin >> r;
  rep(i,r){ cin >> z[i];--z[i];}
  rep(i,r)rep(j,n) cost[i][j]=1LL<<50LL;
  cost[0][z[0]]=0;
  ll ans=1LL<<60LL;
  rep(i,r-1)rep(j,n){
    rep(k,n){
      ll nc=cost[i][j];
      if(k==j)  nc += lcost[z[i]][z[i+1]];
      else nc += lcost[z[i]][j]+scost[j][k]+lcost[k][z[i+1]];
      cost[i+1][k]=min(cost[i+1][k],nc);
      if(i+1==r-1) ans=min(ans,cost[i+1][k]);
    }
  }
  cout << ans << endl;
}

int main(){
  while(cin >> n >> m && n) solve();
}

Measured memory_bytes: 3360
//#if 1
//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
//#endif
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
int main() {
	int A, B, ans = 0;
	cin >> A >> B;
	for (int i = 0; i <= B-A; i++) {
		if ((A + i) / 10000 == (A + i) % 10 && (A + i) % 10000 / 1000 == (A + i) % 100 / 10)ans++;
	}
	printf("%d\n", ans);

	return(0);
}

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

using namespace std;

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

  int N, K;
  cin >> N >> K;
  vector<int> H(N);
  for (int i = 0; i < N; ++i) {
    cin >> H[i];
  }
  sort(H.begin(), H.end());
  long long sum = 0;
  for (int i = 0; i < N-K; ++i) {
    sum += H[i];
  }
  cout << sum << endl;

	return 0;
}



Measured memory_bytes: 1024
#include<iostream>
using namespace std;
int main()
{
	int s;
	int t;
	cin >> s >> t;
	if (s % 2 == 0 || t % 2 == 0) {
		cout << "Even" << endl;
	}else {
		cout << "Odd" << endl;
	}

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <map>

//#include <bits/stdc++.h>
using namespace std;
#define print(x) cout<<(x)<<endl
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long int
#define pb push_back

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  if(abs(a-c) <= d || (abs(a-b) <= d && abs(b-c) <= d)){
    print("Yes");
  } else {
    print("No");
  }

}


Measured memory_bytes: 888
import cmath
def counter(z,a):
    count= 0
    for i in a:
        if abs(i-z)<=1.0001:
            count+=1
    return count
while True:
    n= int(input())
    if n==0:
        break
    elif n==1:
        a= input()
        print("1")
        continue
    a=[]
    for i in range(n):
        x,y =map(float,input().split())
        a.append(complex(x,y))
    ans=1

    for i in range(0,n):
        for j in range(i+1,n):
            p= (a[j]-a[i])/2
            q= (a[j]+a[i])/2
            if abs(p)> 1:
                continue
            r= ((1-abs(p)**2)**0.5)/abs(p) * p*complex(0,1)
                
            z1= q+r
            z2= q-r

            ans= max(ans,counter(z1,a),counter(z2,a))
    print(ans)


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

int main(void) {
	int N;
	cin >> N;

	vector<int> mt(N);
	for (int i = 0; i < N; i++)
	{
		cin >> mt.at(i);
	}

	int Max = 0;
	for (int i = 0; i < N; i++)
	{
		if (Max < mt.at(i))
		{
			Max = mt.at(i);
		}
	}

	int count = 1;
	for (int i = 0; i < N; i++)
	{
			int S = 0;
			bool J = false;
			for (int j = 0; j < N; j++)
			{
				if (Max > mt.at(j) && S < mt.at(j))
				{
					S = mt.at(j);
					J = true;
				}
				
			}
			if (J)
			{
				Max = S;
				count++;
			}
	
	}
	cout << count << endl;

	return 0;
}

Measured memory_bytes: 256
/* 
 * Project: ABC088B Card Game for Two
 * Author: toms74209200 <https://github.com/toms74209200>
 *
 * Created on 2020/04/01
 * Copyright (c) 2020 toms74209200
 * 
 * This software is released under the MIT License.
 * http://opensource.org/licenses/mit-license.php
 */
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {

    int n;
    cin >> n;

    vector<int> a;

    for (int i=0;i<n;i++) {
        int a_in;
        cin >> a_in;
        a.push_back(a_in);
    }

    std::sort(a.begin(), a.end());

    int diff = 0;

    for (int i=0;i<n/2;i++) {
        diff += a[n-i*2-1] - a[n-i*2-2];
    }
    if (n & 1)
        diff += a[0];

    cout << diff << endl;

}


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

#define ln                 '\n'
#define all(dat)           dat.begin(), dat.end()
#define loop(i, to)        for (int i = 0; i < to; ++i)
#define cont(i, to)        for (int i = 1; i <= to; ++i)
#define circ(i, fm, to)    for (int i = fm; i <= to; ++i)
#define foreach(i, dat)    for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)

typedef long long          num;

using namespace std;

const int nsz = 2e5, inf = 0x3f3f3f3f;
int n, p[nsz + 5], q[nsz + 5], id[nsz + 5], ans[nsz + 5];
pair<int, pair<int, int> > a[nsz + 5];

struct union_find {
	int pr[nsz + 5], siz[nsz + 5];
	
	inline int operator [] (int id) { return qry(id); }
	
	void inline init() {
		cont (u, n) pr[u] = u, siz[u] = 1;
	}
	
	int inline qry(int u) { return pr[u] == u ? u : pr[u] = qry(pr[u]); }
	
	bool inline link(int u, int v) {
		u = qry(u), v = qry(v);
		if (u == v) return 1;
		pr[v] = u;
		siz[u] += siz[v], siz[v] = 0;
		return 0;
	}
};
union_find uf;

vector<int> inline merge(const vector<int> &a, const vector<int> &b) {
	int s1 = a.size(), s2 = b.size();
	vector<int> r;
	for (int i = 0, j = 0; i < s1 || j < s2;) r.push_back(j == s2 || (i < s1 && a[i] < b[j]) ? a[i++] : b[j++]);
	return r;
}

vector<int> solve(int l = 1, int r = n) {
	if (l == r) return vector<int>(1, p[l]);
	int md = (l + r) >> 1;
	vector<int> ls = solve(l, md), rs = solve(md + 1, r);
	int ls_mn = *ls.begin(), rs_mx = rs.back();
	loop (i, ls.size()) if (ls[i] < rs_mx) uf.link(q[ls[i]], q[rs_mx]);
	loop (i, rs.size()) if (rs[i] > ls_mn) uf.link(q[rs[i]], q[ls_mn]);
	return merge(ls, rs);
}

int main() {
	scanf("%d", &n);
	uf.init();
	cont (i, n) scanf("%d%d", &a[i].first, &a[i].second.first), a[i].second.second = i;
	sort(a + 1, a + n + 1);
	cont (i, n) p[i] = a[i].second.first, q[p[i]] = i, id[i] = a[i].second.second;
	solve();
	cont (i, n) ans[id[i]] = uf.siz[uf[i]];
	cont (i, n) {
		printf("%d\n", ans[i]);
	}
}

Measured memory_bytes: 11284
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>

#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

int compare_f(const void* a, const void* b) {
    return *((int64_t*)a) < *((int64_t*)b) ? -1 : 1;
}

int compare_f2(const void* a, const void* b) {
    return *((uint64_t*)a) > * ((uint64_t*)b) ? -1 : 1;
}

static size_t comb(const size_t n, const size_t r) {
    size_t result = 1;

    for (size_t i = 0; i < r; i++) {
        result *= n - i;
        result /= i + 1;
    }

    return result;
}

static uint64_t combU64(const uint64_t n, const uint64_t r) {
    uint64_t result = 1;

    for (uint64_t i = 0; i < r; i++) {
        result *= n - i;
        result /= i + 1;
    }

    return result;
}

static uint64_t gcd(uint64_t m, uint64_t n)
{
    uint64_t temp;

    while (m % n != 0) {
        temp = n;
        n = m % n;
        m = temp;
    }

    return n;
}

int main(void) {
    size_t N, V[20], C[20];

    scanf("%zu\n", &N);
    for (size_t i = 0; i < N; i++) {
        scanf("%zu", &(V[i]));
        scanf((i < N - 1 ? " " : "\n"));
    }
    for (size_t i = 0; i < N; i++) {
        scanf("%zu", &(C[i]));
        if (i < N - 1) {
            scanf(" ");
        }
    }

    size_t sum = 0;

    for (size_t i = 0; i < N; i++) {
        if (C[i] < V[i]) {
            sum += V[i] - C[i];
        }
    }

    printf("%zu\n", sum);

    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<stdio.h>
#include<cctype>
#include<algorithm>
#include<climits>
#include<cmath>
#include<map>
#include<vector>
#define INF INT_MAX
using namespace std;

int N, M;

int main(){
	cin >> N >> M;
	cout << N*(N - 1) / 2 + M*(M - 1) / 2 << endl;

	return 0;
}

Measured memory_bytes: 3600
import java.util.Scanner;

public class Main {
 public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	int inA = in.nextInt();
	int inB = in.nextInt();
	int inC = in.nextInt();
	while (inA != -1 || inB != -1 || inC != -1) {
	 int s = inA * 3600 + inB * 60 + inC;
	 int a = 2 * 3600 - s;
	 int b = a * 3;
	 System.out.format("%02d:%02d:%02d", a / 3600,
		 (a % 3600) / 60, a % 60);
	 System.out.println();
	 System.out.format("%02d:%02d:%02d", b / 3600,
		 (b % 3600) / 60, b % 60);
	 System.out.println();
	 inA = in.nextInt();
	 inB = in.nextInt();
	 inC = in.nextInt();
	}
 }
}

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

// global variables
#define debug(x) cout << #x << ": " << x << endl
typedef long long ll;
const int M = 1e9 + 7;
const int INF = 1e9;

// typedef
typedef pair<int, int> P;
// sort by P.first (asd)
bool comPair(const P &firstElof, const P &secondElof) {
    return firstElof.first < secondElof.first;
}

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

#define MAX_N 1000000

int par[MAX_N];
int par1[MAX_N]; // 親
int par2[MAX_N]; // 親
int rank_tree[MAX_N];
int rank_tree1[MAX_N]; // 木の深さ
int rank_tree2[MAX_N]; // 木の深さ

// n要素で初期化
void init(int n, int *par, int *rank_tree) {
    for (int i = 1; i <= n; i++) { // 1-index. 注意。
        par[i] = i;
        rank_tree[i] = 0;
    }
}

// 木の根を求める
int root(int x, int *par) {
    if (par[x] == x) {
        return x;
    } else {
        return par[x] = root(par[x], par);
    }
}

// xとyの属する集合を併合
void unite(int x, int y, int *par, int *rank_tree) {
    int u = x, w = y;
    x = root(x, par);
    y = root(y, par);
    if (x == y) return;
    if (rank_tree[x] < rank_tree[y]) {
        par[x] = y;
    } else {
        par[y] = x;
        if (rank_tree[x] == rank_tree[y]) rank_tree[x]++;
    }
}

// xとyが同じ集合に属するか否か
bool same(int x, int y, int *par) {
    return root(x, par) == root(y, par);
}

int main() {
    int n, k, l;
    int p, q;
    cin >> n >> k >> l;
    init(n, par1, rank_tree1);
    init(n, par2, rank_tree2);
    for (int i = 0; i < k; i++) {
        cin >> p >> q;
        unite(p, q, par1, rank_tree1);
    }
    for (int i = 0; i < l; i++) {
        cin >> p >> q;
        unite(p, q, par2, rank_tree2);
    }
    map<P, int> roots;
    for (int i = 1; i <= n; i++) {
        roots[P(root(i, par1), root(i, par2))]++;
    }
    for (int i = 1; i <= n; i++) {
        cout << roots[P(root(i, par1), root(i, par2))] << endl;
    }
}


Measured memory_bytes: 24192
#include <iostream>
#include <cstdio>
#include <map>
#include <algorithm>
#include <vector>
#define Sort(a) sort(a.begin(),a.end())
#define ll long long
using namespace std;
ll n,m;
int main() {cin>>n>>m;
vector<pair<ll,ll>>a;
for(ll i=0;i<n;i++)
{
    ll kj1,kj2;cin>>kj1>>kj2;
    a.push_back(make_pair(kj1,kj2));
}
Sort(a);
ll left=m; ll sum=0;
for(ll i=0;i<n;i++){
    ll f=a[i].first,s=a[i].second;
    if(s<=left){sum+=s*f;left-=s;}
    else {sum+=left*f;break;}
}
cout<<sum<<endl;

    return 0;
}

Measured memory_bytes: 2420
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
	vector<int> list(3);
	
	for (int i = 0; i < 3; i++)
	{
		cin >> list[i];
	}

	sort(list.begin(), list.end());
	
	cout << list[2] * 10 + list[1] + list[0] << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
#define ll long long
const int MAXN=100000;
int n,a[MAXN+10],b[MAXN+10],c[MAXN+10];
ll fa[MAXN+10],fb[MAXN+10];
ll sa[MAXN+10],sb[MAXN+10];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i)scanf("%d",a+i);
	for(int i=1;i<=n;++i)scanf("%d",b+i);
	for(int i=1;i<=n;++i)scanf("%d",c+i);
	sort(a+1,a+n+1);sort(b+1,b+n+1);sort(c+1,c+n+1);
	for(int i=1;i<=n;++i)fb[i]=n-(upper_bound(c+1,c+n+1,b[i])-c)+1;
	for(int i=n;i>=1;--i)sb[i]=sb[i+1]+fb[i];
	for(int i=1;i<=n;++i)fa[i]=sb[upper_bound(b+1,b+n+1,a[i])-b];
	for(int i=n;i>=1;--i)sa[i]=sa[i+1]+fa[i];
	printf("%lld",sa[1]);
	return 0;
}

Measured memory_bytes: 4608
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int field[20][20]={0};
  for(;;){
    if(scanf("%1d",&field[5][5]) == EOF) break;
    for(int i=0; i<8; i++)
      for(int j=0; j<8; j++)
	if(i!=0 || j!=0) scanf("%1d",&field[i+5][j+5]);
    for(int i=0; i<8; i++){
      for(int j=0; j<8; j++){
	if(field[i+5][j+5] == 1 && field[i+6][j+5] == 1 && field[i+6][j+6] == 1 && field[i+5][j+6] == 1){cout <<"A"<<endl; goto flag;}
	if(field[i+5][j+5] == 1 && field[i+6][j+5] == 1 && field[i+7][j+5] == 1 && field[i+8][j+5] == 1){cout <<"B"<<endl; goto flag;}
	if(field[i+5][j+5] == 1 && field[i+5][j+6] == 1 && field[i+5][j+7] == 1 && field[i+5][j+8] == 1){cout <<"C"<<endl; goto flag;}
	if(field[i+5][j+5] == 1 && field[i+6][j+5] == 1 && field[i+6][j+4] == 1 && field[i+7][j+4] == 1){cout <<"D"<<endl; goto flag;}
	if(field[i+5][j+5] == 1 && field[i+5][j+6] == 1 && field[i+6][j+6] == 1 && field[i+6][j+7] == 1){cout <<"E"<<endl; goto flag;}
	if(field[i+5][j+5] == 1 && field[i+6][j+5] == 1 && field[i+6][j+6] == 1 && field[i+7][j+6] == 1){cout <<"F"<<endl; goto flag;}
	if(field[i+5][j+5] == 1 && field[i+5][j+6] == 1 && field[i+6][j+5] == 1 && field[i+6][j+4] == 1){cout <<"G"<<endl; goto flag;}
      }
    }
  flag:;
  }
  return 0;
}

Measured memory_bytes: 1204
#include <stdio.h>
#include <math.h>

typedef struct endPoint{
  double x;
  double y;
}endpoint;

void kock(int, endpoint, endpoint);

int main(){

  int n;
  endpoint p1, p2;

  p1.x = 0.0;
  p1.y = 0.0;
  p2.x = 100.0;
  p2.y = 0.0;

  scanf("%d",&n);

  printf("%.8f %.8f\n", p1.x, p1.y);

  kock(n, p1, p2);

  printf("%.8f %.8f\n", p2.x, p2.y);

  return 0;

}

void kock(int n, endpoint p1, endpoint p2){

  endpoint s, t, u;

  if(n==0) 
    return ;
  
  s.x = (2 * p1.x + 1 * p2.x) / 3.0;
  s.y = (2 * p1.y + 1 * p2.y) / 3.0;
  t.x = (1 * p1.x + 2 * p2.x) / 3.0;
  t.y = (1 * p1.y + 2 * p2.y) / 3.0;
  u.x = (t.x - s.x) * cos(M_PI/3) - (t.y - s.y) * sin(M_PI/3) + s.x;
  u.y = (t.x - s.x) * sin(M_PI/3) + (t.y - s.y) * cos(M_PI/3) + s.y;
 
  kock(n-1, p1, s);

  printf("%.8f %.8f\n", s.x, s.y);

  kock(n-1, s, u);

  printf("%.8f %.8f\n", u.x, u.y);

  kock(n-1, u, t);

  printf("%.8f %.8f\n", t.x, t.y);

  kock(n-1, t, p2);

}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
void fastIO(){
  ios_base::sync_with_stdio(0); cin.tie(0);
}


int main(){
  string s;
  cin>>s;
  bool a = s[0]==s[1]||s[1]==s[2]||s[2]==s[3];
  a?cout<<"Bad"<<endl:cout<<"Good"<<endl;
}








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

int main (){
  int N,counter = 1;
  cin >> N;
  vector<int> array (N);
  for (int i =0 ; i<N;i++)
    cin >> array.at(i);
  sort(array.begin(),array.end());
  for(int i = 0;i<N -1;i++){
    if (array.at(i+1) == array.at(i)) continue;
    counter++;
  }
  cout << counter << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
using namespace std;

void solve(){
  int a, b; cin >> a >> b;
  int ans = 0;
  for(int i = a; i <= b; i++){
    string s = to_string(i);
    int j;
    for(j = 0; j < 2; j++){
      if(s[j] != s[4 - j]) break;
    }
    if(j == 2) ans++;
  }
  cout << ans << endl;
  return;
}

int main(){
  solve();
  return 0;
}


Measured memory_bytes: 256
N,T=map(int,input().split())
cost=[]
time=[]
for i in range(N):
    c,t=map(int,input().split())
    if t<=T:
        cost.append(c)
        time.append(t)
if len(time)==0:
    print("TLE")
else :
    print(min(cost))

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

const ll MOD=1000000007;

int  main(){
  int n;
  cin>>n;
  vector<pair<int,int>>K;
  vector<pair<int,int>>G;
  vector<int>KI(n/2);
  vector<int>GU(n/2);
  for(int i=0;i<n/2;i++){
    cin>>KI.at(i)>>GU.at(i);
  }
  sort(KI.begin(),KI.end());
  sort(GU.begin(),GU.end());
  K.push_back(make_pair(1,KI.at(0)));
  G.push_back(make_pair(1,GU.at(0)));
  for(int i=1;i<n/2;i++){
    if(K.at(K.size()-1).second==KI.at(i)){
      K.at(K.size()-1).first=K.at(K.size()-1).first+1;
    }
    else{
      K.push_back(make_pair(1,KI.at(i)));
    }
  }
  for(int i=1;i<n/2;i++){
    if(G.at(G.size()-1).second==GU.at(i)){
      G.at(G.size()-1).first=G.at(G.size()-1).first+1;
    }
    else{
      G.push_back(make_pair(1,GU.at(i)));
    }
  }
  K.push_back(make_pair(0,-1));
  G.push_back(make_pair(0,-1));
  sort(K.begin(),K.end());
  reverse(K.begin(),K.end());
  sort(G.begin(),G.end());
  reverse(G.begin(),G.end());
  if(K.at(0).second==G.at(0).second){
    cout<<n-max(K.at(0).first+G.at(1).first,K.at(1).first+G.at(0).first)<<endl;
  }
  else{
    cout<<n-K.at(0).first-G.at(0).first<<endl;
  }
}

Measured memory_bytes: 1784
#include<bits/stdc++.h>
#define INF 9003372036854775807LL
#define mod 1000000007
#define fixed fixed<<setprecision(12)
#define abs(x,y) (max(x,y)-min(x,y))
#define lol long long
#define mp make_pair
#define fi first
#define se second
using namespace std;
using pii=pair<int, int > ;
lol a[300010];
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  lol n,m,k,r,x,y,z;
  cin >>n;
  set<int> se;
  lol ans=1;
  se.insert(n);
  while(1){
    ans++;
    if(n&1) n=3*n+1;
    else n/=2;
    if(se.find(n)!=se.end()) break;
    se.insert(n);
  }
  cout <<ans<<'\n';
  return (0);
}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		//対象の文字列をセット
		String strTgt = sc.next();

		//文字の位置をセット
		long lngCharPos = sc.nextLong();

		char charResult = 0;
		for(int i = 0;  i < strTgt.length() && i < lngCharPos; i++) {

			//i番目の文字を取得
			charResult = strTgt.charAt(i);

			//「1」以外の場合
			if(charResult != '1') {
				break;
			}

		}

		//アウトプット
		System.out.println(charResult);

	}

}


Measured memory_bytes: 35540
#include <bits/stdc++.h>
#define MAX 200005
#define F first
#define S second
#define MP make_pair
#define INF 1e9
using namespace std;

bool b[MAX];
int a[MAX],pre[MAX],dp[MAX],tag[MAX*4];
pair<int,int> st[MAX*4],v[MAX],tmp;

int sum(int x,int y){
	return pre[y]-pre[x-1];
}

void throwdown(int id,int l,int r){
	if(l==r)return;
	tag[id*2]+=tag[id];
	tag[id*2+1]+=tag[id];
	st[id*2].F+=tag[id];
	st[id*2+1].F+=tag[id];
	tag[id]=0;
	st[id]=max(st[id*2],st[id*2+1]);
}

void modify(int id,int l,int r,int L,int R,int val){
	if(L<=l&&r<=R){
		st[id].F+=val;
		tag[id]+=val;
		return;
	}
	if(r<L||R<l)return;
	int mid=l+r>>1;
	if(tag[id])throwdown(id,l,r);
	modify(id*2,l,mid,L,R,val);
	modify(id*2+1,mid+1,r,L,R,val);
	st[id]=max(st[id*2],st[id*2+1]);
}

pair<int,int> query(int id,int l,int r,int L,int R){
	if(r<L||R<l)return MP(-INF,0);
	if(L<=l&&r<=R)return st[id];
	int mid=l+r>>1;
	if(tag[id])throwdown(id,l,r);
	return max(query(id*2,l,mid,L,R),query(id*2+1,mid+1,r,L,R));
}

void change(int id,int l,int r,int pos,pair<int,int> val){
	if(l==r){
		st[id]=max(st[id],val);
		return;
	}
	int mid=l+r>>1;
	if(tag[id])throwdown(id,l,r);
	if(pos<=mid)change(id*2,l,mid,pos,val);
	else change(id*2+1,mid+1,r,pos,val);
	st[id]=max(st[id*2],st[id*2+1]);
}

int main(){
	int n,q,l,r,cnt=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&b[i]);
		if(b[i]){
			a[i]=1;
			cnt++;
		}
		else a[i]=-1;
		pre[i]=pre[i-1]+a[i];
	}
	scanf("%d",&q);
	for(int i=1;i<=q;i++){
		scanf("%d%d",&l,&r);
		v[i]=MP(l,r);
	}
	sort(v,v+q+1);
	for(int i=0;i<=n*4;i++)st[i]=MP(-INF,0);
	int ans=0,now=0;
	for(int i=1;i<=q;i++){
		int l=v[i].F;
		while(now<l){
			modify(1,1,n,now,n,a[now]);
			/*for(int i=1;i<6;i++){
				printf("~~%d\n",query(1,1,n,i,i).F);
			}*/
			//printf("now: %d %d\n",now,a[now]);
			now++;
		}
		tmp=query(1,1,n,v[i].F,v[i].S);
		dp[i]=max(tmp.F+sum(v[i].F,v[i].S),query(1,1,n,1,v[i].F-1).F+sum(v[i].F,v[i].S));
		dp[i]=max(dp[i],sum(v[i].F,v[i].S));
		/*for(int i=1;i<6;i++){
			printf("~~%d\n",query(1,1,n,i,i).F);
		}*/
		//printf("!!%d: %d\n",query(1,1,n,1,v[i].F-1).S,query(1,1,n,1,v[i].F-1).F);	
		//printf("%d: %d\n",i,dp[i]);
		change(1,1,n,v[i].S,MP(dp[i]-sum(v[i].F,v[i].S),i));
		/*for(int i=1;i<6;i++){
			printf("!!%d\n",query(1,1,n,i,i).F);
		}*/
		ans=max(ans,dp[i]);
	}
	printf("%d\n",cnt-ans);
}


Measured memory_bytes: 13696
#include <iostream>
#include <string>
#include <set>
#include <queue>
using namespace std;

string sed(const string &s, const string &a, const string &b){
	string t;
	int i;
	for(i = 0; i < s.size(); ){
		if(s.compare(i, a.size(), a, 0, a.size()) == 0){
			t += b;
			i += a.size();
		}
		else{
			t += s[i++];
		}
	}
	return t;
}

int solve(int n){
	string a[10], b[10], from, to;
	for(int i = 0; i < n; ++i){
		cin >> a[i] >> b[i];
	}
	cin >> from >> to;

	queue<string> q;
	set<string> st;
	q.push(from);
	q.push(string());
	st.insert(from);

	int ans = 1;
	while(q.size() > 1){
		string &s = q.front();
		if( s.empty() ){
			q.push(s);
			++ans;
		}
		else{
			for(int i = 0; i < n; ++i){
				string t = sed(s, a[i], b[i]);
				if(t == to) return ans;
				if(t.size() < to.size()){
					if(st.insert(t).second){
						q.push(t);
					}
				}
			}
		}
		q.pop();
	}
	return -1;
}

int main(){
	int n;
	while(cin >> n, n != 0){
		cout << solve(n) << '\n';
	}
}

Measured memory_bytes: 1312
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pll = pair<ll, ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define Rep(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define tmax(x, y, z) max((x), max((y), (z)))
#define tmin(x, y, z) min((x), min((y), (z)))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
const ll INF = 1LL << 60;
const ll MM = 1000000000; const ll MOD = MM + 7; const ll MMM=9223372036854775807;//2^63 -1
#define ADD(a,b) a = (a + ll(b)) % MOD
#define MUL(a,b) a = (a * ll(b)) % MOD
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true;} return false;}
template<typename A, size_t N, typename T> void FILL(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
using Graph = vector<vector<ll>>;
ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
ll ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//cout << fixed << setprecision(10);

// ll field[300001][300001];

int main(){
    ll H, W, m; cin >> H >> W >> m;
    map<ll, ll> hh, ww;
    map<pair<ll, ll>, ll> field;
    priority_queue<pair<ll, ll>> pqh, pqw;
    vector<ll> hv, wv;
    rep(i, m){
        ll h, w; cin >> h >> w;
        // field[h][w] = 1;
        hh[h]++;
        ww[w]++;
        field[make_pair(h, w)]++;
    }
    for(auto p: hh) pqh.push(make_pair(p.second, p.first));
    for(auto p: ww) pqw.push(make_pair(p.second, p.first));
    pair<ll, ll> max_h = pqh.top(), max_w = pqw.top();
    hv.push_back(max_h.second), wv.push_back(max_w.second);
    pqh.pop(), pqw.pop();
    while(!pqh.empty()){
        pair<ll, ll> p = pqh.top();
        if(p.first != max_h.first) break;
        hv.push_back(p.second);
        pqh.pop();
    }
    while(!pqw.empty()){
        pair<ll, ll> p = pqw.top();
        if(p.first != max_w.first) break;
        wv.push_back(p.second);
        pqw.pop();
    }

    rep(i, hv.size()){
        rep(j, wv.size()){
            if(!field.count(make_pair(hv[i], wv[j]))){
                cout << max_h.first + max_w.first << endl;
                return 0;
            }
        }
    }

    cout << max_h.first + max_w.first - 1 << endl;
}


Measured memory_bytes: 77748
n, x = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)
r = 0
t1 = a.shift
a.each{|t2|
	if t1 + t2 > x
		decr2 = [t2, t1 + t2 - x].min
		r += decr2
		t2 -= decr2
		if t1 + t2 > x
			decr1 = t1 + t2 - x
			r += decr1
			t1 -= decr1
		end
	end
	t1 = t2
}
p r

Measured memory_bytes: 11140
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,k;
  cin>>n>>k;
  int d[k];
  vector<int>v[k];
  set<int>s;
  for(int i=0;i<k;i++)
  {
    cin>>d[i];
    for(int j=0;j<d[i];j++)
    {
      int x;
      cin>>x;
      v[i].push_back(x);
      s.insert(x);
    }
  }
  int ans=0;
  set<int>::iterator i;
  int t=s.size();
  cout<<abs(t-n);
  //cout<<ans;
}

Measured memory_bytes: 3664