akhauriyash/Code-Regression huggingface dataset:
/*********************
*  Author: xuziyuan  * 
*********************/
 
#include <bits/stdc++.h>
 
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define LL long long
#define pii pair <LL,LL>
#define fi first
#define se second
#define pb push_back
#define mpr make_pair
 
using namespace std;
 
LL n,m,x,y,re[60],ans=0,pw[60];
vector <pii> g[60];
vector <LL> pass;
bool ok;
 
void dfs(LL pos,LL to,LL no)
{
  if(pos==to)
  {
    ok=true;
    return;
  }
  rep(i,g[pos].size())
  {
    if(g[pos][i].fi==no) continue;
    pass.pb(g[pos][i].se);
    dfs(g[pos][i].fi,to,pos);
    if(ok) return;
    pass.pop_back();
  }
}
 
int main()
{
  pw[0]=1;
  repn(i,52) pw[i]=pw[i-1]*2;
  cin>>n;
  rep(i,n-1)
  {
    cin>>x>>y;
    g[x].pb(mpr(y,i));
    g[y].pb(mpr(x,i));
  }
  cin>>m;
  rep(i,m)
  {
    cin>>x>>y;
    ok=false;
    dfs(x,y,0);
    rep(j,pass.size()) re[i]|=(LL)pow(2,pass[j]);
    pass.clear();
  }
  rep(i,(1<<m))
  {
    LL cnt=0,now=0;
    rep(j,m)
    {
      if((i&(1<<j))==0) continue;
      now|=re[j];
      cnt++;
    }
    LL c=0;
    while(now>0)
    {
      c+=now%2;
      now/=2;
    }
    if(cnt&1) ans-=pw[n-1-c];
    else ans+=pw[n-1-c];
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
function Main(input) {
  input = input.split(" ");
  const A = parseInt(input[0], 10);
  const B = parseInt(input[1], 10);
  const C = parseInt(input[2], 10);
  var K = parseInt(input[3], 10);

  var count = 0;
  if (A < K) {
    count += A;
    K -= A;
  } else {
    console.log(K);
    return;
  }

  if (B < K) {
    K -= B;
    count -= K;
    console.log(count);
    return;
  } else {
    console.log(A);
    return;
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 29728
#include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
using namespace std;

int main(){
	int n;
	while(scanf("%d",&n),n){
		map<int,int> table;
		int t,maxi = 0;
		for(int x=0;x<n;++x){
			int j;scanf("%d",&j);
			table[j]++;
			if(table[j]>maxi){
				maxi = table[j];t = j;
			}
		}
		if(maxi>(n/2)){
			cout<<t<<endl;
		}else{
			cout<<"NO COLOR"<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 2748
#include<stdio.h>
#define _USE_MATH_DEFINES
#include<math.h>

int main(void){

	double r,a,b;

	scanf("%lf",&r);

	a = r*r*M_PI;
	b =2*r*M_PI;

	printf("%f %f\n",a,b);

	return 0;
}

Measured memory_bytes: 648
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0
a = [] 
x = [[0] * 3 for i in range(3)]
for i in range(3):
    a.append([int(x) for x in input().split()])
n = iin()
b = [0] * n
for i in range(n):
    b[i] = iin()

for i in range(3):
    for j in range(3):
        for f in range(n):
            if a[i][j] == b[f]:
                x[i][j] = 1
for i in range(3):
    if sum(x[i]) == 3:
        neko = neko + 1
    nya = x[0][i] + x[1][i] + x[2][i]
    if nya == 3:
        neko = neko + 1
nya = x[0][0]+ x[1][1] + x[2][2]
if nya == 3:
    neko = neko + 1
nya = x[0][2]+ x[1][1] + x[2][0]
if nya == 3:
    neko = neko + 1
if neko > 0:
    py()
else:
    pn()

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

int main() {
    unsigned int n;
    int t, a;
    cin >> n >> t >> a;
    vector<int> h(n);
    for (auto &tmp : h)
        cin >> tmp;
    double min = abs(a - (t - h[0] * 0.006));
    int num = 0;
    for (int i = 1; i < n; i++){
        double value = abs(a - (t - h[i] * 0.006));
        if (min > value){
            min = value;
            num = i;
        }
    }
    cout << num + 1 << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
n,m = map(int,input().split())
a = list(map(int,sys.stdin))
a.append(0)
prev=0
cur=1
m=0
for i in range(1,n+1):
  if a[m]==i:
    prev,cur = cur,0
    m += 1
  else:
    prev,cur = cur,(cur+prev)%1000000007
print(cur)

Measured memory_bytes: 7068
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
from math import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

a,b,h,m=map(int,input().split())
hun=360*m/60
ji=360*(h*60+m)/720
sita=abs(hun-ji)
# if sita==0:
#     print(abs(a-b))
#     quit()
# print(sita)
if sita==180:
    print(a+b)
    quit()
if sita==0:
    print(abs(a-b))
    quit()

if sita>180:
    sita=360-sita
# print(sita)
hen1=b*math.cos(math.radians(180-sita))+a
hen2=b*math.sin(math.radians(sita))
print(((hen1)**2+(hen2)**2)**0.5)

Measured memory_bytes: 69712
#include <iostream>
using namespace std;
int main(){
    string s,t,u;
    int a,b;
    cin>>s;
    cin >>t;
    cin>>a;
    cin>>b;
    cin>>u;
    if (u==s){
        a--;
        cout<<a<<' '<<b;
    } else if (u==t){
        b--;
        cout<<a<<' '<<b;
    }

    return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    int A[m];
    int sum = 0;
    for (int i = 0; i < m; i++) {
        cin >> A[i];
        sum += A[i];
    }
    if (sum > n) {
        cout << -1 << endl;
    } else {
        cout << n - sum << endl;
    }
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++){
        if(s[i]=='?')s[i]='D';
        cout<<s[i];
    }
    cout<<endl;
    return 0;
}


Measured memory_bytes: 3712
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

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

using ll = long long;

ll N, M;

int main()
{
  scanf( "%lld%lld", &N, &M );

  printf( "%lld\n", N*(N-1)/2+M*(M-1)/2 );

  return 0;
}

Measured memory_bytes: 764
package main

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

var scanner = bufio.NewScanner(os.Stdin)

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

func lowerBound(a []int, x int, n int) int {
	l := 0
	h := n
	for l < h {
		mid := (l + h)/2
		if x <= a[mid] {
			h = mid
		} else {
			l = mid + 1
		}
	}
	return l
}

// func binarySearch(target int, ints []int) bool {
// 	low := 0
// 	high := len(ints)-1
// 	for low <= high {
// 		mid := (low + high)/2
// 		guess := ints[mid]
// 		if guess == target {
// 			return true
// 		}
// 		if guess > target {
// 			high = mid - 1
// 		} else {
// 			low = mid + 1
// 		}
// 	}
// 	return false
// }

func main() {
	scanner.Split(bufio.ScanWords)
	n := nextInt()
	a := make([]int, n)
	for i := range a {
		a[i] = nextInt()
	}
	q := nextInt()
	for i := 0; i < q; i++ {
		k := nextInt()
		fmt.Println(lowerBound(a, k, n))
	}
}



Measured memory_bytes: 5892
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc126_a

n, k = map(int, input().strip().split())
word = input()
res = ''

for i in range(n):
    s = word[i]
    if i == k - 1:
        s = s.lower()
    res += s

print(res)


Measured memory_bytes: 9032
#include <iostream>

using namespace std;

int main() {
  int N;
  cin >> N;
  long long ans = 1;
  int M = 1000000000 + 7;
  for(int i = 1; i <= N; i++) {
    //ans = ans * i;
    ans = ans * i % M;
  }
  cout << ans % M << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int *arr=new int[n];
  int *dp=new int[n];
  for(int i=0;i<n;++i)
  {
	cin>>arr[i];
  }
  dp[0]=0;
  dp[1]=abs(arr[0]-arr[1]);
  for(int i=2;i<n;++i)
  {
    dp[i]=min(dp[i-1]+abs(arr[i]-arr[i-1]),dp[i-2]+abs(arr[i]-arr[i-2]) );
  }
 
  cout<<dp[n-1]<<endl;
  return 0;
}

Measured memory_bytes: 1024
#define _CRT_SECURE_NO_WARNINGS

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

typedef unsigned int uint;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef map<int, int> mii;
typedef pair<int, ii> edge;


#define sc(x)  scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mem(arr,val) memset(arr,val,sizeof arr)
#define sz(v) (int)v.size()
#define rsz(v) v.resize
#define clr(v) v.clear()
#define rev(v) reverse(all(v))
#define lop(i,end) for(int i=0; i<end; i++)
#define rlop(i,start) for(int i=start-1; i>=0; i--)
#define loop(i,start,end) for(int i=start; i<end; i++)
#define rloop(i,start,end) for(int i=start-1; i>=end; i--)
#define PB push_back
#define pb pop_back
#define mP make_pair
#define f first
#define s second

const ll OO = (ll)(4e18) + 9;
const int MOD = (int)(1e9) + 7;
const int oo = 2147483647;
const double EPS = 1e-8;
const double PI = acos(-1.0);

//enum dir { D, R, U, L , dr, ur, dl, ul };
int dx[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dy[] = { 0, 1, 0, -1, 1, 1, -1, -1 };

string abc = "abcdefghijklmnopqrstuvwxyz";
string vowels = "aeiouy"; //and sometimes "aeiouy"

template<typename X, typename Y> bool ckmin(X& a, Y b) { return a > b ? a = b, true : false; }
template<typename X, typename Y> bool ckmax(X& a, Y b) { return a < b ? a = b, true : false; }
bool cklex(string &a, string b) {
	if (b == "") return false;
	if (a == "") return a = b, true;
	if (sz(a) < sz(b)) return false;
	if (sz(b) < sz(a)) return a = b, true;
	if (a < b) return false;
	return a = b, true;
}

int dcmp(ld d1, ld d2) { return fabs(d1 - d2) <= EPS ? 0 : d1 > d2 ? 1 : -1; } //Compare Double Numbers
ll gcd(ll x, ll y) { return !y ? x : gcd(y, x%y); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
int conv_2_1(int r, int c, int nCol) { return (nCol*r) + c + 1; } //convert index from 2D array to 1D array. (Zero-indexed)
ii conv_1_2(int n, int nCol) { return{ n / nCol, n % nCol }; } //convert index from 1D array to 2D array (row, col). (Zero-indexed)
template<typename T> void inter(T X) { cout << X << endl; fflush(stdout); }



void _solveD_() {

}

void _solveC_() {

}

void _solveB_() {
	int n, x, y, cnt = 0, flag = 0;
	cin >> n;
	lop(i, n) {
		cin >> x >> y;
		if (x == y) cnt++;
		else {
			flag |= cnt > 2;
			cnt = 0;
		}
	}
	flag |= cnt > 2;
	if (flag) cout << "Yes\n";
	else cout << "No\n";
}


int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	int t = 1, tt = 0;
	//cin >> t;
	while (tt++ != t) {
		_solveB_();
	}


	return 0;
}


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

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout<<setprecision(15);

    //I don't care about anybody, and fuck ratings! I'll go to google!
    int n; cin>>n;
    vector<int> a(n);
    for(int i = 0; i<n; i++) cin>>a[i];
    int ans = 0;
    for(int i = 0; i<n; i++){
        for(int j = i+1; j<n; j++) ans += a[i]*a[j];
    }
    cout<<ans<<"\n";
    return 0;
}


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

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
#define rep(i, s, n) for(int i = (int)(s); i < (int)(n); i++)

ll INF = 1ll << 60;

void chmin(int &a, int b){
  if(a > b)
    a = b;
}
void chmax(int &a, int b){
  if(a < b)
    a = b;
}

void llchmin(ll &a, ll b){
  if(a > b)
    a = b;
}
void llchmax(ll &a, ll b){
  if(a < b)
    a = b;
}

int main(){
  int h, w, k;
  cin >> h >> w >> k;
  vector<string> sheet(h);
  rep(i, 0, h)
    cin >> sheet[i];
  
  ll ans = 0;
  
  for(int tmp1 = 0; tmp1 < (1 << 6); tmp1++){
    bitset<6> s1(tmp1);
    
    if(h < 6 && s1.test(h))
      break;
    
    for(int tmp2 = 0; tmp2 < (1 << 6); tmp2++){
      bitset<6> s2(tmp2);
      
      if(w < 6 && s2.test(w))
        break;
      
      vector<string> sh = sheet;
      
      rep(i, 0, 6){
        if(i >= h)
          continue;
        if(s1.test(i)){
          rep(j, 0, w)
            sh[i][j] = 'r';
        }
      }
      rep(i, 0, 6){
        if(i >= w)
          continue;
        if(s2.test(i)){
          rep(j, 0, h)
            sh[j][i] = 'r';
        }
      }
      
      int cnt = 0;
      
      rep(i, 0, h){
        rep(j, 0, w){
          if(sh[i][j] == '#')
            cnt++;
        }
      }
      
      if(cnt == k)
        ans++;
      
    }
  }
  
  cout << ans << endl;
  
  return 0;
  
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
int dp[100001],color[100001];
vector<int> e[100001];

void paint(int v,int d,int c){
	if(!color[v]) color[v]=c;
	if(dp[v]<d && d>0){
		dp[v]=d;
		for(auto u:e[v]) paint(u,d-1,c);
	}
}

int main(){
	int N,M,Q,a,b;
	cin>>N>>M;
	rep(i,M){
		cin>>a>>b;
		e[a].push_back(b);
		e[b].push_back(a);
	}
	cin>>Q;
	int v[Q],d[Q],c[Q];
	rep(i,Q)cin>>v[i]>>d[i]>>c[i];
	rep(i,Q){
		int j=Q-1-i;
		paint(v[j],d[j],c[j]);
	}
	rep(i,N)cout<<color[i+1]<<endl;
}

Measured memory_bytes: 8440
# include <bits/stdc++.h>
# define speed ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
# define int long long

using namespace std;

const int N = 500;

set < int > st;
map < int, int > used;

void rec( int x ) {

    if ( x > 3234566667 ) {
        return;
    }
    if ( st.find(x) != st.end() || used[x] ) {
        return;
    }
    used[x] = 1;
    int p = -1, ok = 1, n = x;

    while ( x ) {

        if ( p == -1 ) {
            p = x % 10;
        }
        else {
            if ( abs( p - (x % 10) ) > 1 ) {
                ok = 0;
            }
            p = x % 10;
        }
        for ( int i = -1; i <= 1; i++ ) {

            if ( (x % 10) + i >= 0 && (x % 10) + i < 10 ) {
                rec( x * 10 + (x % 10) + i );
            }
        }
        x /= 10;
    }
    if ( ok ) {
        st.insert(n);
    } 
}

int32_t main() {
    speed;
    int k;

    cin >> k;

    for ( int i = 1; i <= 9; i++ ) {
        rec( i );
    }

    for ( int i = 0; i < k - 1; i++ ) {
        st.erase( st.begin() );
    }
    cout << *st.begin();
} 
  

Measured memory_bytes: 13312
#include<bits/stdc++.h>
using namespace std;
signed main(){
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  long long Q,team=0,C,A,N;
  cin>>Q;
  for(int i=0;i<Q;i++){
    cin>>C>>A>>N;
    while(true){
      if(C>0 && A>0 && N>0){
	team++;
	C--;
	A--;
	N--;
	continue;
      }
      else if(C>=2 && A>=1){
	team++;
	C-=2;
	A--;
	continue;
      }
      else if(C>=3){
	team++;
	C-=3;
	continue;
      }
      else{
	cout<<team<<'\n';
	team=0;
	break;
      }
    }
  }
  return(0);
}



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

int main() {
  int n, m;
  cin >> n >> m;
  vector<string> s(n);
  for (int i = 0; i < n; i++) {
    cin >> s.at(i);
  }
  mf_graph<int> t(n * m + 2);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m - 1; j++) {
      if (s[i][j] == '#' or s[i][j + 1] == '#') continue;
      if ((i + j) % 2 == 0) {
        t.add_edge(i * m + j, i * m + j + 1, 1);
      } else {
        t.add_edge(i * m + j + 1, i * m + j, 1);
      }
    }
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '#' or s[i + 1][j] == '#') continue;
      if ((i + j) % 2 == 0) {
        t.add_edge(i * m + j, i * m + j + m, 1);
      } else {
        t.add_edge(i * m + j + m, i * m + j, 1);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '#') continue;
      if ((i + j) % 2) {
        t.add_edge(i * m + j, n * m + (i + j) % 2, 1);
      } else {
        t.add_edge(n * m + (i + j) % 2, i * m + j, 1);
      }
    }
  }
  cout << t.flow(n * m, n * m + 1) << endl;
  for (auto e : t.edges()) {
    if (e.from >= n * m or e.to >= n * m or e.flow == 0) continue;
    int i0 = e.from / m, j0 = e.from % m, i1 = e.to / m, j1 = e.to % m;
    assert(s[i0][j0] == '.');
    assert(s[i1][j1] == '.');
    if (i1 == i0 + 1) {
      s[i0][j0] = 'v';
      s[i1][j1] = '^';
      assert(j0 == j1);
    } else if (i1 == i0 - 1) {
      s[i0][j0] = '^';
      s[i1][j1] = 'v';
      assert(j0 == j1);
    } else if (j1 == j0 + 1) {
      s[i0][j0] = '>';
      s[i1][j1] = '<';
      assert(i0 == i1);
    } else if (j1 == j0 - 1) {
      s[i0][j0] = '<';
      s[i1][j1] = '>';
      assert(i0 == i1);
    } else {
      abort();
    }
  }
  for (int i = 0; i < n; i++) {
    cout << s.at(i) << endl;
  }
}


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

using namespace std;

#define int long long
#define ALL(x) (x).begin(),(x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

typedef pair<int,int> PI;
typedef pair<int,pair<int,int>> PII;
static const int INF=1010000000000000017LL;
static const double eps=1e-12;
static const double pi=3.14159265358979323846;
static const int dx[4]={1,-1,0,0};
static const int dy[4]={0,0,1,-1};
static const int ddx[8]={1,-1,0,0,1,1,-1,-1};
static const int ddy[8]={0,0,1,-1,1,-1,1,-1};

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

int mod=1000000007;
int N;
int mem[1000005][2][2];

int calc(int n,int b0,int b9){
    if(mem[n][b0][b9]!=-1)return mem[n][b0][b9];
    if(n==N){
        if(b0==1&&b9==1)return 1;
        else return 0;
    }
    int ret=0;
    for(int i=0;i<=9;++i){
        if(i==0)ret=(ret+calc(n+1,1,b9))%mod;
        else if(i==9)ret=(ret+calc(n+1,b0,1))%mod;
        else ret=(ret+calc(n+1,b0,b9))%mod;
    }
    return mem[n][b0][b9]=ret%mod;
}

void init(){
    for(int i=0;i<1000005;++i)for(int j=0;j<2;++j)for(int k=0;k<2;++k)mem[i][j][k]=-1;
}

signed main(){
    init();
    cin>>N;
    cout<<calc(0,0,0)<<endl;
}

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

int main(){
    int N, K; cin >> N >> K;
    vector<int> nums(K);
    for (int i=0; i<K; i++){
        cin >> nums.at(i);
    }
    int now=N;
    bool judge=false;
    while (!judge){
        int temp=now;
        judge=true;
        while (temp>0){//嫌いな数字リストと各位の数字を照合=>ひとつも該当しなければtrue, ひとつでも該当したらfalse
            for (int n : nums){
                if (temp%10==n) {
                    judge=false;
                    break;
                }
            }
            temp/=10;
        }
        if (judge){
            cout << now << endl;
            break;
        }
        now++;
    }
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		StringTokenizer st = new StringTokenizer(str, " ");
		int a = Integer.parseInt(st.nextToken());
		int b = Integer.parseInt(st.nextToken());

		if(a < b){
			System.out.println("a < b");
		}else if(a > b){
			System.out.println("a > b");
		}else if(a == b){
			System.out.println("a == b");
		}

	}
}


Measured memory_bytes: 24116
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  ll a, b, x;
  cin>>a>>b>>x;
  ll r, l;
  r = b/x+1;
  l = (a-1)/x+1;
  if (a==0)l = 0;
  cout<<r-l<<endl;
}


Measured memory_bytes: 3640
#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#define TASK "movetofront"
#pragma comment(linker, "/STACK:810886422")
#include <cstdio>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <chrono>
#include <cstdlib>
#include <cstring>
#include <assert.h>
#include <algorithm>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <functional>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <random>
#include <complex>
using namespace std;

const int MOD = 998244353;
const int INF = 1000000017;
const double EPS = 1e-9;
const int HASH_POW = 29;
const long double PI = acos(-1.0);
mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

long long nextLong(long long l, long long r) {
	uniform_int_distribution <long long> foo(l, r);
	return foo(rnd);
}

double nextDouble(double l, double r) {
	uniform_real_distribution <double> foo(l, r);
	return foo(rnd);
}

double workTime() {
	return double(clock()) / CLOCKS_PER_SEC;
}

void myReturn(int code = 0) {
#ifdef MYDEBUG
	cout << "\nTime = " << fixed << setprecision(3) << workTime() << endl;
#endif
	exit(code);
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
#ifdef MYDEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	/*freopen(TASK".in", "r", stdin);
	freopen(TASK".out", "w", stdout);*/
	/*freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);*/
#endif

	long long a, b, c;
	cin >> a >> b >> c;
	if (b >= c) {
		cout << b + c << endl;
	}
	else if (a + b >= c) {
		cout << b + c << endl;
	}
	else {
		cout << a + 2 * b + 1 << endl;
	}

	myReturn();
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>

using namespace std;

int main(){
	int M[10];
	for(int i = 0; i < 10; i++){
		cin >> M[i];
	}
	sort(M, M + 10);
	reverse(M, M + 10);
	cout << M[0] << "\n";
	cout << M[1] << "\n";
	cout << M[2] << "\n";
	return 0;
}

Measured memory_bytes: 1172
fun main(args: Array<String>) {

    val n = readLine()!!.toInt()
    val b = readLine()!!.split(" ").map(String::toInt)

    println(abc140c(n, b))
}

// 0 153 10 10 23
// 0 0   10 10 10 23
fun abc140c(n: Int, bList: List<Int>): Any? {

    val a = mutableListOf<Int>()

    a.add(bList[0])

    for (i in bList.indices) {

        if (i == bList.size - 1) {
            a.add(bList[i])
            break
        }

        // 自分と一個前のbのminを採用
        val tmp = Math.min(bList[i], bList[i + 1])
        a.add(tmp)
    }
    return a.sum()
}


Measured memory_bytes: 37928
#include "bits/stdc++.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define FOR(i,init,a) for(int i=init; i<a; i++)
#define rep(i,a) FOR(i,0,a)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()
#define chmin(a,b) a=min(a,b);
#define chmax(a,b) a=max(a,b);

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N,now=0;
    cin>>N;
    
    ll cnt=0;
    rep(i,N){
        int a;
        cin>>a;
        if(now==0){
            cnt+=a-1;
            now=1;
        }else{
            if(now>=a) continue;
            int k=a/(now+1);
            if(a%(now+1)==0) k--;
            cnt+=k;
            if(a==now+1) now++;
        }
        //cout3(a,now,cnt)
    }
    cout1(cnt)
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>

int main(int argc, char *argv[]) {
  int n;
  std::cin >> n;
  int v = -1, j = 0, max = -1;
  for (int i = 0; i < n; ++i) {
    int h;
    std::cin >> h;
    if (v < h) {
      max = std::max(max, i - j - 1);
      j = i;
    }
    v = h;
  }
  max = std::max(max, n - j - 1);

  std::cout << max << std::endl;
}


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

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int mi = INT_MAX;
  for (int i = 0; i < s.size() - 2; i++) {
    int x = atoi(s.substr(i, 3).c_str());
    // printf("%d\n", x);
    mi = min(mi, abs(x - 753));
  }
  cout << mi << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int N=2e5+6;
typedef long long LL;
char s[N];
int n,dep[N],fa[N],sz[N];
int lmax[N],lmin[N],maxQlen[N];
vector<int>G[N];
struct data{
	int a,b;
	inline data operator+(const int&x)const{return(data){a+x,b+x};}
}len[N];
inline data merge(const data&X,const int&Y){
	int A=X.a,B=X.b;
	if(A<Y)B=A,A=Y;else if(B<Y)B=Y;
	return(data){A,B};
}
void dfs(int now){
	sz[now]=s[now]^'0';
	len[now]={0,-0x3f3f3f3f};maxQlen[now]=(!sz[now])*0x3f3f3f3f+sz[now];
	for(int to:G[now])
	if(!dep[to]){
		fa[to]=now,dep[to]=dep[now]+1;
		dfs(to);
		sz[now]+=sz[to];
		len[now]=merge(len[now],len[to].a+1);
		if(sz[to])maxQlen[now]=min(maxQlen[now],len[to].a+1);
	}
}
void solve(int now){
	lmax[now]=min(len[now].a-1,len[now].b+1);
	if(s[now]=='1')lmin[now]=0;else lmin[now]=maxQlen[now];
	for(int to:G[now])if(dep[to]>dep[now]){
		data lsD=len[to];
		int lsL=maxQlen[to],nw=(lsD.a+1==len[now].a?len[now].b+1:len[now].a+1);
		len[to]=merge(len[to],nw);
		if(sz[1]!=sz[to])maxQlen[to]=min(maxQlen[to],nw);
		solve(to);
		len[to]=lsD,maxQlen[to]=lsL;
	}
}
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n;
	for(int i=1;i<n;++i){
		int u,v;
		cin>>u>>v;
		G[u].push_back(v),G[v].push_back(u);
	}
	cin>>(s+1);
	dfs(dep[1]=1);
	solve(1);
	LL ans=1;
	for(int i=1;i<=n;++i)
	if(lmax[i]>=lmin[i])ans+=lmax[i]-lmin[i]+1;
	cout<<ans<<'\n';
	return 0;
}

Measured memory_bytes: 29568
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int H,M,S,flg=1;
    while(cin>>H>>M>>S){
        flg=1;
        if(H==-1)break;
        S+=M*60;
        S+=H*3600;
        S=7200-S;
        continu:;
        if(S/3600<10)cout<<"0";
        cout<<S/3600<<":";
        if((S%3600)/60<10)cout<<"0";
        cout<<(S%3600)/60<<":";
        if((S%3600)%60<10)cout<<"0";
        cout<<(S%3600)%60<<endl;
        if(flg==1){
            flg=0;S*=3;goto continu;
        }
    }
    return 0;
}

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

int main() {
  
    int N;
    int SA,SB = 0;
    int sum;
    int total;
    
    cin>>N;
    
    for(int i=0;i<N;i++)
    {
        
    cin>>SA>>SB;
       sum = SB-SA+1;
        total +=sum;
    }
    
    
    cout<<total<<endl;
    
}
    
    
    
  



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main()
{
    int a, b;
    cin >> a >> b;
    cout << ( ( a * b ) % 2 == 0 ? "Even" : "Odd" ) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
using namespace std;

int main(){
  int n;
  int tower, floor, room, num;
  scanf("%d", &n);

  int information[4][3][10] = {0};
  for(int i = 0; i < n; i++){
    scanf("%d %d %d %d", &tower, &floor, &room, &num);
    information[tower-1][floor-1][room-1] += num;
  }
  for(int i = 0; i < 4; i++){
    for(int j = 0; j < 3; j++){
      for(int l = 0; l < 10; l++){
	printf(" %d", information[i][j][l]);
      }
      printf("\n");
    }
    if(i==3){
      break;
    }
    printf("####################\n");
  }
}



Measured memory_bytes: 2708
def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

used = {}
used[0] = 0
gg = {}

def dfs(n, a, b, c, d):
    global used
    # print(n)
    if n in used: return used[n]
    ret = n*d
    for i in range(-4, 4):
        now = n + i
        if now%2==0 and now > 0 and abs(i) < 2: ret = min(ret, abs(i)*d + a + dfs(now//2, a, b, c, d))
        if now%3==0 and now > 0 and abs(i) < 3: ret = min(ret, abs(i)*d + b + dfs(now//3, a, b, c, d))
        if now%5==0 and now > 0: ret = min(ret, abs(i)*d + c + dfs(now//5, a, b, c, d))
    used[n] = ret
    return ret
        


def solve():
    n,a,b,c,d = NextInts()
    global used
    used = {}
    gg = {}
    used[0] = 0
    used[1] = d
    used[2] = min(d*2, d+a)
    return dfs(n, a, b, c,d)
    
def main():
    t = NextInt()
    ans = [solve() for i in range(t)]
    for i in range(t):
        print(ans[i])

if __name__ == "__main__":
    main()


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

int main() {
  int N, K;
  cin >> N >> K;
  int l[55];
  for(int i = 0; i < N; i++) cin >> l[i];
  sort(l,l + N,greater<int>());

  int sum = 0;
  for(int i = 0; i < K; i++) sum += l[i];
  cout << sum << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second

void solve() {
	string s;
	cin >> s;
	int n = s.length();
	int c1 = 0, c2 = 0;
	char t;
	rep(i, n) {
		if (i % 2)t = '0';
		else t = '1';
		if (s[i] != t)c1++;
	}
	rep(i, n) {
		if (i % 2==0)t = '0';
		else t = '1';
		if (s[i] != t)c2++;
	}
	cout << min(c1, c2) << endl;
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	//stop
	return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int N;
int dp[100000];
int high[100000];


int rec(int N){
  
  if(dp[N]!=-1) return dp[N];
  else{
    dp[N]=min(rec(N-2)+abs(high[N-2]-high[N]),
	    rec(N-1)+abs(high[N-1]-high[N]));
  }
  return dp[N];
}



int main(int argc, char *argv[]){
  int h;
  cin>>N;
  for(int i=0; i<N; i++){
    cin>>h;
    high[i]=h;
    dp[i]=-1;
    
  }
  //forループ
  /*  for(int i=1; i<N; i++){
    if(i==1){
      dp[i]=dp[i-1]+abs(high[i]-high[i-1]);
    }
    else{
      dp[i]=min(dp[i-2]+abs(high[i-2]-high[i]),dp[i-1]+abs(high[i-1]-high[i]));
    }
    
  }
  cout<<dp[N-1]<<endl;*/
  dp[0]=0;
  dp[1]=dp[0]+abs(high[1]-high[0]);
  cout<<rec(N-1)<<endl;
}
  

Measured memory_bytes: 4096
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<climits>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<iomanip>
using namespace std;

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define rep2(i,j,n) for(int i=(j);i<=(n);i++)
#define all(i) i.begin(),i.end()

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<int, int> pi;
typedef long long i64;

int main() {
	int n;
	cin >> n;
	int ans = 0;
	rep(i, 0, n) {
		int l, r;
		cin >> l >> r;
		ans += r - l;
	}
	ans += n;
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#define LEN 100001

int main(void) {
  int N, n[LEN] = {}, v, cnt = 0;
  int i, tmp;

  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &v);
    if (v >= LEN) cnt++;
    else n[v]++;
  }

  for (i = 1; i < LEN; i++) {
    if (n[i] == 0) continue;
    tmp = n[i] - i;
    if (tmp > 0) cnt += tmp;
    else if (tmp < 0) cnt += n[i];
  }
  printf("%d\n", cnt);

  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int main(){
    cout << fixed << setprecision(10);
    int n;
    bool ok = 0;
    int cnt = 0;
    cin >> n ;
    set<int> si;
    rep(i,n){
        int x;
        cin >> x;
        if(x <= 399) si.insert(0);
        else if( x<= 799) si.insert(1);
        else if(x<=1199) si.insert(2);
        else if(x <=1599) si.insert(3);
        else if(x<=1999) si.insert(4);
        else if(x<=2399) si.insert(5);
        else if(x<=2799) si.insert(6);
        else if(x <= 3199) si.insert(7);
        else {
            //cout << "Yes" << endl;
            ok = 1;
            cnt ++;
        }
    }
    if(!ok){
        cout << si.size() << endl;
        cout << si.size() << endl;
    }else{
        //cout << cnt << endl;
        if(si.size()!=0) cout << si.size()  << endl;
        else cout << 1 << endl;
        cout << si.size()+cnt << endl;
    }
    return 0;
}

Measured memory_bytes: 256
n = int(input())
alist = []
for i in range(n):
    alist.append(int(input()))

amax = max(alist)
anslist = [amax]*n
if alist.count(amax)>=2:
    for i in anslist:
        print(i)
    exit()

if alist.count(amax)==1:
    maxindex = alist.index(amax)
    del alist[maxindex]
    anslist[maxindex]= max(alist)
    for i in anslist:
        print(i)
    exit()


Measured memory_bytes: 70488
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const long long INF = 1LL << 60;
using Graph = vector<vector<int>>;

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

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

inline int gcd(int a, int b) { return (a % b == 0) ? b : gcd(b, a % b); }
inline int fac(int n) { return (n == 0) ? 1 : n * fac(n - 1); }

int count_matches(string a, string b) {
    bool alpha[27] = {};
    int cnt = 0;
    for (int i = 0; i < a.length(); i++)
    {
        int code = a[i] - 'a';
        if (alpha[code] == false && find(b.begin(), b.end(), a[i]) != b.end())
        {
            alpha[code] = true;
            cnt++;
        }
    }
    return cnt;
}

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int max = 0;
    for (int i = 1; i < n; i++)
    {
        string a = s.substr(0, i);
        string b = s.substr(i, s.size());
        int matches = count_matches(a, b);
        if (matches > max) {
            max = matches;
        }
    }

    cout << max << endl;
    return 0;
}

Measured memory_bytes: 3596
#pragma GCC optimize ("-O3")
#include <bits/stdc++.h>  
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <fstream>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<ll> v32;
typedef vector<vector<ll> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<vector<p64> > vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// #define INF 1e18
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
  
void solve()
{
	string s,t;
	cin>>s>>t;
	int n=s.length(),m=t.length();
	s="a"+s;
	t="a"+t;
	vv64 dp(n+1,v64(m+1,0));
	vector<vector<p64> > last(n+1,vp64(m+1,p64(-1,-1)));
	for (int i=1; i<=n; i++)
	{
		for (int j=1; j<=m; j++)
		{
			if (dp[i][j-1]<dp[i-1][j])
			{
				dp[i][j]=dp[i-1][j];
				last[i][j]=last[i-1][j];
			}
			else
			{
				dp[i][j]=dp[i][j-1];
				last[i][j]=last[i][j-1];				
			}
			if (s[i]==t[j])
			{
				dp[i][j]=dp[i-1][j-1]+1;
				last[i][j]=p64(i,j);
			}
		}
	}
	// cout<<dp[n][m]<<endl;
	vector<char> ans;
	p64 current=last[n][m];
	for (int i=1; i<=dp[n][m]; i++)
	{
		ans.push_back(s[current.fi]);
		current=last[current.first-1][current.second-1];
	}
	reverse(all(ans));
	for (int i=0; i<dp[n][m]; i++)
		cout<<ans[i];
}
int main() 
{ 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
 
    int t=1;
    while (t--)
    {
        solve();
    }
    return 0;   
} 

Measured memory_bytes: 211584
#include <iostream>
#include <string>
#include <vector>

using namespace std;

class Solution {
 private:
  int c(int n) {
    if (n < 2) return 0;
    return n * (n - 1) / 2;
  }

 public:
  int hAndV(const vector<vector<char>>& squares, int k) {
    int n = squares.size(), m = squares[0].size();
    int w = n + m;

    int ans = 0;
    auto test_row = [&](int sel, int row) { return sel & (1 << row); };
    auto test_col = [&](int sel, int col) { return sel & (1 << (n + col)); };
    for (int sel = 0; sel < (1 << w); ++sel) {
      int count = 0;
      for (int row = 0; row < n; ++row) {
        if (!test_row(sel, row)) continue;
        for (int col = 0; col < m; ++col) {
          if (!test_col(sel, col)) continue;
          if (squares[row][col] == '#') ++count;
        }
      }
      if (count == k) ++ans;
    }
    return ans;
  }
};

int main() {
  int h, w, k;
  cin >> h >> w >> k;

  vector<vector<char>> squares(h, vector<char>(w));
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) cin >> squares[i][j];
  }

  Solution sol;
  const int ans = sol.hAndV(squares, k);
  cout << ans << endl;
  return 0;
}


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

int n, k, q, a[100000];

int main()
{
    cin >> n >> k >> q;
    for (int i = 0; i < q; i++)
    {
        int x; cin >> x;
        a[--x]++;
    }
    for (int i = 0; i < n; i++)
    {
        cout << ((k - q + a[i] > 0)? "Yes\n":"No\n");
    }
}

Measured memory_bytes: 3928
from sys import stdin

in_strings = lambda: stdin.readline()[:-1] # s = in_strings()
in_int = lambda: int(stdin.readline()) # N = in_int()
in_intlist = lambda: list(map(int, stdin.readline().split())) # List = in_intlist()

S = in_strings()
if S[:4] == 'YAKI':
    print('Yes')
else:
    print('No')


Measured memory_bytes: 2940
h,w = map(int,input().split())

road_count = 0
lis = [list('#'*(w+2))]
for _ in range(h):
    li = input()
    for i in li:
        if i == '.':
            road_count += 1
    li = '#' + li + '#'
    lis.append(list(li))
lis.append(list('#'*(w+2)))

#print(lis)
dp = [[999]*(w+2) for _ in range(h+2)]

if lis[1][1] == '#':
    dp[1][1]=1
else:
    dp[1][1]=0

#print(dp)
#(開始x,開始y)
step = [[1,1]]
while len(step)>0:
    x,y = step.pop(0)
    if x > h:
        continue
    if y > w:
        continue
    #print(x,y)
    if dp[x+1][y] == 999:
        step.append([x+1,y])
        if lis[x+1][y] != '#':
            dp[x+1][y] = min(dp[x][y],dp[x+1][y-1])
        else:
            if lis[x][y] == '#' and lis[x+1][y-1] == '#':
                dp[x+1][y] = min(dp[x][y],dp[x+1][y-1])
            elif lis[x][y] == '#':
                dp[x+1][y] = min(dp[x][y],dp[x+1][y-1]+1)
            elif lis[x+1][y-1] == '#':
                dp[x+1][y] = min(dp[x][y]+1,dp[x+1][y-1])
            else:
                dp[x+1][y] = min(dp[x][y],dp[x+1][y-1])+1
    if dp[x][y+1] == 999:
        step.append([x,y+1])
        if lis[x][y+1] != '#':
            dp[x][y+1] = min(dp[x][y],dp[x-1][y+1])
        else:
            if lis[x][y] == '#' and lis[x-1][y+1] == '#':
                dp[x][y+1] = min(dp[x][y],dp[x-1][y+1])
            elif lis[x][y] == '#':
                dp[x][y+1] = min(dp[x][y],dp[x-1][y+1]+1)
            elif lis[x-1][y+1] == '#':
                dp[x][y+1] = min(dp[x][y]+1,dp[x-1][y+1])
            else:
                dp[x][y+1] = min(dp[x][y],dp[x-1][y+1])+1
#print(lis)
#print(dp)
print(dp[h][w])

Measured memory_bytes: 3432
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define P pair<int,int>
#define PI 3.141592653589793
const int INF = 1001001001;


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

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

mint choose(int n, int x) {
	mint aa = 1, bb = 1;
	rep(i, x) {
		aa *= n - i;
		bb *= i + 1;
	}
	return aa / bb;
};
int main() {
	ll x, y;
	cin >> x >> y;
	if ((x + y) % 3 != 0) {
		cout << 0;
		return 0;
	}
	ll n = (x + y) / 3;
	if (x - n < 0 || y - n < 0) {
		cout << 0;
		return 0;
	}
	mint ans = choose(n, x - n);
	cout << ans.x;
}

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

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

int main(){
    int H, W; cin >> H >> W;
    vector<string> maze(H);
    rep(i, H) cin >> maze[i];

    vector<vector<int>> dist(H, vector<int>(W, -1));

    queue<pair<int, int>> que;

    rep(i, H){
        rep(j, W){
            if(maze[i][j] == '#'){
                dist[i][j] = 0;
                que.push(make_pair(i, j));
            }
        }
    }

    while(!que.empty()){
        auto current_pos = que.front();
        que.pop();
        int x = current_pos.first;
        int y = current_pos.second;
        
        rep(i, 4){
            auto nx = x + dx[i];
            auto ny = y + dy[i];
            if(nx < 0 || H <= nx || ny < 0 || W <= ny) continue;
            if(maze[nx][ny] == '#') continue;

            if(dist[nx][ny] == -1){
                que.push(make_pair(nx, ny));
                dist[nx][ny] = dist[x][y] + 1;
            }
        }
    }
    int res = 0;
    rep(i, H){
        rep(j, W){
            res = max(res, dist[i][j]);
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 13456
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
using ll = long long;

using I = ll;
template <class F>
I lower_bound(I i0, I i1, F f) {
    while (i0 < i1) {
        I i = (i0 + i1) / 2;
        if (f(i)) i1 = i; else i0 = i + 1;
    }
    return i0;
}

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

    int n;
    cin >> n;

    ll k;
    cin >> k;
    
    vector<int> a(n), f(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    for (int i = 0; i < n; i++) {
        cin >> f[i];
    }
    sort(f.begin(), f.end());

    I t = lower_bound(0LL, (ll)1.1e+12, [&](I t) {
        ll s = 0;
        for (int i = 0; i < n; i++) {
            if ((ll)a[i] * f[i] > t) {
                s += a[i] - t / f[i];
            }
        }
        return s <= k;
    });

    cout << t << endl;

    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
//const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

int gcds(int a, int b){
    int c = a % b;
    while (c != 0){
        a = b;
        b = c;
        c = a % b;
    }
    return b;
}

int main() {
    int a, b, c, x; cin >> a >> b >> c >> x;
    int ans = 0;
    rep(i,a+1){
        rep(j,b+1){
            rep(k,c+1){
                if (500 * i + 100 * j + 50 * k == x) ans++;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using ld = long double;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const long double PI = acos(-1.0L);
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  while (cin >> n && n) {
    vector<int> score(n);
    rep(i, n)
      cin >> score[i];
    sort(score.begin(), score.end());
    int ans = 0;
    for (int i = 1; i+1 < n; i++)
      ans += score[i];
    ans /= n-2;
    cout << ans << '\n';
  }
  return 0;
}


Measured memory_bytes: 3036
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define vv vector<lli>
#define vp vector<pair<lli,lli>>
#define vpp vector<pair<lli,pair<lli,lli>>>
#define lims(w) (w).begin(),(w).end()
#define rlims(w) (w).rbegin(),(w).rend()
#define pb push_back
#define mp make_pair
#define f(i,a,b) for(lli i=a;i<b;i++)
#define ff first
#define ss second
#define sz(a) (lli)(a.size())
lli inf = (1e18 + 2);

int main()
{
	lli x;
	cin>>x;

	if(x >= 1800 && x <= 1999)
		cout<<"1"<<endl;
	else if(x >= 1600)
		cout<<"2"<<endl;
	else if(x >= 1400)
		cout<<"3"<<endl;
	else if(x >= 1200)
		cout<<"4"<<endl;
	else if(x >= 1000)
		cout<<"5"<<endl;
	else if(x >= 800)
		cout<<"6"<<endl;
	else if(x >= 600)
		cout<<"7"<<endl;
	else
		cout<<"8"<<endl;

	return 0;
}


Measured memory_bytes: 3632