akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>

using namespace std;

struct edge {int from, to, dist;};

const int INF = 99999;

int Dijkstra(const vector<edge>& es, int n, int s, int t){
	int* cal_graph = new int[n*n];
	int* d = new int[n];
	bool* used= new bool[n];
	int dist;
	for(int j=0; j<n*n; j++){cal_graph[j]=INF;}
	for(int j=0; j<n; j++){cal_graph[j*n+j]=0;}
	for(int j=0; j<es.size(); j++){ cal_graph[ ((&es[j])->from)*n + (&es[j])->to ] = (&es[j])->dist;}

	fill(d,d+n, INF); fill(used,used+n,false); d[s]=0;
	while(true){
		int v = -1;
		for(int u=0; u<n; u++){ if(!used[u] && (v==-1 || d[u]<d[v])){v=u;}}
		if(v==-1){ break;}
		used[v]=true;
		for(int u=0; u<n; u++){ d[u] = min(d[u],d[v]+cal_graph[v*n+u]);}
	}
	dist = d[t];

	delete[] cal_graph;
	delete[] d;

	return dist;
}

int main()
{
	int w, h, ans;

	while(true){
		cin >> w >> h;
		if(w==0 && h==0){return 0;}
		int g;
		vector<edge> es;
		edge e;

		for(int i=0; i<h; i++){
			for(int j=0; j<w-1; j++){
				cin >> g;
				if(g==0){
					(e.from)=i*w+j; (e.to)=i*w+j+1; (e.dist)=1; es.push_back(e);
					(e.from)=i*w+j+1; (e.to)=i*w+j; (e.dist)=1; es.push_back(e);
				}
			}
			if(i!=(h-1)){
				for(int j=0; j<w; j++){
					cin >> g;
					if(g==0){
						(e.from)=i*w+j; (e.to)=i*w+j+w; (e.dist)=1; es.push_back(e);
						(e.from)=i*w+j+w; (e.to)=i*w+j; (e.dist)=1; es.push_back(e);
					}
				}			
			}
		}

		ans = INF; ans = min(ans,Dijkstra(es, w*h, 0, w*h-1));
		if(ans!=INF){cout << ans+1 << endl;}
		else{cout << 0 << endl;}
	}
}

Measured memory_bytes: 6428
#include<iostream>

using namespace std;


void trace(int arr[] , int n){
    int i;
    for(i = 0 ; i < n ; i++){
        if( i > 0){
            cout << " ";
        }
        cout << arr[i];
    }
    cout << endl;
}

void insertionSort(int arr[], int n){
    int key, i, j;
    for(int i = 1 ; i < n ; i++){
        key = arr[i];
        j = i - 1 ;
        while (j >= 0 && arr[j] > key){
            arr[j+1] = arr[j];
            j--;
        }
        arr[j+1] = key;
        trace(arr,n);
    }
}


int main(){
    int n;
    cin >> n;
    int num[n];
    for(int i = 0 ; i < n ; i++){
        cin >> num[i];
    }

    trace(num,n);
    insertionSort(num,n);

    return 0;

}


Measured memory_bytes: 3108
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,a[N],b[N],c[N],fa[N],len,nw=0,ans=0;
map<int,int>vis;bool f__k[N];
int find(int x)
{return fa[x]==x?x:fa[x]=find(fa[x]);}
void mg(int x,int y)
{
    if(find(x)!=find(y))
        fa[find(x)]=find(y),f__k[find(y)]=1;
}
int main()
{
//  freopen("duliu.in","r",stdin);
//  freopen("duliu.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]),vis[a[i]]++,nw^=a[i];
    vis[nw]++,a[n+1]=nw,nw=0;
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&b[i]),vis[b[i]]--,nw^=b[i];
        if(vis[b[i]]<0)return puts("-1"),0;
    }
    b[++n]=nw;
    for(int i=1;i<=n;i++)c[i]=a[i];
    sort(c+1,c+n+1);
    len=unique(c+1,c+n+1)-c-1;
    for(int i=1;i<=n;i++)
        a[i]=lower_bound(c+1,c+len+1,a[i])-c;
    for(int i=1;i<=n;i++)
        b[i]=lower_bound(c+1,c+len+1,b[i])-c;
    for(int i=1;i<=n;i++)fa[i]=i;
    for(int i=1;i<=n;i++)
    {
        if(a[i]!=b[i])
        {
            if(i<n)ans++;
            mg(a[i],b[i]);
        }
    }
    if(!ans)return puts("0"),0;
    f__k[a[n]]=f__k[b[n]]=1;
    for(int i=1;i<=len;i++)
        if(fa[i]==i&&f__k[i])ans++;
    cout<<ans-1;
}

Measured memory_bytes: 8192
#include <bits/stdc++.h>
#define s second
#define f first
#define N (1<<19)
int bit[N+1];
using namespace std;
typedef pair<int,int> P;
typedef pair<P,string> PP;
 
int sum(int i){
  int s=0;
  while(i>0){
    s+=bit[i];
    i-=i&-i;
  }
  return s;
}
 
void add(int i,int x){
  while(i<=N){
    bit[i]+=x;
    i+=i&-i;
  }
}
 
vector <PP> used;
int get_pos(PP a){
  int L=0,M,R=used.size();
  while(L<R){
    M=(L+R)/2;
    if(used[M]<a)R=M;
    else L=M+1;
  }
  return L-1;
}
 
int search(int x){
  int L=0,M,R=used.size();
  while(L<R){
    M=(L+R)/2;
    if(sum(get_pos(used[M]))>=x) R=M;
    else L=M+1;
  }
  return L;
}
 
void Stop(string a){cout <<a<<" is not working now."<<endl;}
void Begin(string a){cout <<a<<" is working hard now."<<endl;}

vector <PP> in;
map <string,int> M,M2;
set <PP> S;
 
int main(){
  int n;
  cin>>n;
  S.insert(PP(P(1e9,1e9),""));
  for(int i=0;i<n;i++){
    string str;
    int a;
    cin>>str>>a;
    M[str]=a,M2[str]=i;
    in.push_back(PP(P(a,i),str));
    S.insert(in.back());
}
  
  int m;
  cin>>m;
  char ch[20021];
  string str[20021];
  int sc[20021];
  for(int i=0;i<m;i++){
    cin>>ch[i]>>str[i];
    if(ch[i]=='+')cin>>sc[i];
    if(ch[i]=='+')S.insert(PP(P(sc[i],(i+n)),str[i]));
  }
  
  for(set<PP>::iterator it=S.begin();it!=S.end();it++)used.push_back(*it);
  reverse(used.begin(),used.end());
  for(int i=0;i<n;i++) add(get_pos(in[i]),1);
  
  int num=n;
  for(int i=0;i<m;i++){
    PP nx=PP(P(sc[i],(i+n)),str[i]);
    if(ch[i]=='+'){
      int a=search(num*0.2);
      M[str[i]]=sc[i],M2[str[i]]=(n+i);
      int c=get_pos(nx);
      add(c,1);
      int b=search((++num)*0.2);
      b>=c? Begin(str[i]):Stop(str[i]);
      if(b&&a<b&&used[b].s!=str[i])Begin(used[b].s);
      if(a&&a>b&&used[a].s!=str[i])Stop(used[a].s);
    }
 
    else if(ch[i]=='-'){
      nx.f=P(M[str[i]],M2[str[i]]);
      nx.s=str[i];
      
      int a=search(num*0.2);
      M.erase(str[i]),M2.erase(str[i]);
      add(get_pos(nx),-1);
      int b=search((--num)*0.2);
      if(a&&b<a&&used[a].s!=str[i])Stop(used[a].s);
      if(b&&b>a)Begin(used[b].s);
    }
  }
  return 0;
}

Measured memory_bytes: 18916
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
#define ll long long

int main(){
  int n;
  cin>>n;
  if(n==25){
    cout<<"Christmas"<<endl;
  }else if(n==24){
    cout<<"Christmas Eve"<<endl;
  }else if(n==23){
    cout<<"Christmas Eve Eve"<<endl;
  }else if(n==22){
    cout<<"Christmas Eve Eve Eve"<<endl;
}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    if(a>b)
    {
        cout<<a+max(a-1,b);
    }
    else if(b>a)
    {
        cout<<b+max(a,b-1);
    }
    else
    {
        cout<<a+b;
    }

}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
typedef pair<int,int> P;
int N,M,a,tmp,cnt,maxm;
int used[100];
P t[100];
int main(){
  cin>>N>>M;
  for(int i=0;i<M;i++)cin>>t[i].first>>t[i].second;
  for(int i=0;i<M;i++)used[i]=0;
  cnt=0;
  a=1;
  while(a!=N+1){
    maxm=0;
    for(int i=0;i<M;i++){
      if(t[i].first<=a&&maxm<t[i].second){
	maxm=t[i].second;
	tmp=i;
      }
    }
    if(used[tmp])break;
    used[tmp]=1;
    a=maxm+1;
    cnt++;
    
  }
  if(a==N+1)cout<<cnt<<endl;
  else cout<<"Impossible"<<endl;
  return 0;
}

Measured memory_bytes: 1160
import sys
input = sys.stdin.readline

n,k,q = map(int,input().split())
a = [int(input()) for _ in range(q)]

tmplist = [0 for i in range(n)]
tmp = q-k
for i in a:
  tmplist[i-1] += 1

for i in tmplist:
  if i > tmp:
    print('Yes')
  else:
    print('No')

Measured memory_bytes: 49592
from collections import deque

def getMaxDistance(s,startY,startX):
  d = deque()
  distances = [[0 for _ in range(w)] for j in range(h)]
  dx = [-1, 0, 1, 0]
  dy = [0, 1, 0, -1]
  maxDistance = 0
  d.append(startX)
  d.append(startY)
  while d:
    x = d.popleft()
    y = d.popleft()
    if s[y][x]=='#': continue
    maxDistance = max(maxDistance, distances[y][x])
    for i in range(4):
      xx = x + dx[i]
      yy = y + dy[i]
      if not (0 <= yy < h and 0 <= xx < w): continue
      if s[yy][xx] != '.': continue
      if distances[yy][xx] != 0: continue
      if xx == startX and yy == startY: continue
      d.append(xx)
      d.append(yy)
      distances[yy][xx] = distances[y][x] + 1
  return maxDistance

h,w=map(int,input().split())
s=[list(input()) for _ in range(h)]
maxDistance = 0
for i in range(h):
  for j in range(w):
    maxDistance = max(maxDistance, getMaxDistance(s,i,j))
print(maxDistance)

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

#ifdef LOCAL
	#define D(a) cerr << #a << " = " << a << endl
#else
	#define D(a)
	#define cerr false && cerr
#endif
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define dforsn(i,s,n) for(int i=int(n-1);i>=int(s);i--)
#define forsn(i,s,n) for(int i=int(s);i<int(n);i++)
#define dforn(i,n) dforsn(i,0,n)
#define forn(i,n) forsn(i,0,n)
#define all(a) a.begin(),a.end()
#define si(a) int((a).size())
#define pb emplace_back
#define mp make_pair
#define snd second
#define fst first
#define endl '\n'
using pii = pair<int,int>;
using vi = vector<int>;
using ll = long long;

const int N = 1e5, K = 2;

int n;
vi adj[N];

int color[N], n_color[K]; 
int s, t;
void paint(int u = 0, int p = -1, int cur_color = 1) {
    color[u] = cur_color;
    n_color[cur_color==1]++;

    int next_color = -1 * cur_color;
    for (int v : adj[u]) if (v != p) {
        if (!color[v]) paint(v, u, next_color);
        else s = u, t = v;
    }
}

int need[N];
int calc_needs(int u = 0, int p = -1) {
    need[u] = color[u];

    for (int v : adj[u]) if (v != p) {
        if ((u == s && v == t) || (u == t && v == s)) continue;

        need[u] += calc_needs(v, u);
    } 

    return need[u];
}

bool in_cycle[N];
bool find_cycle(int u = s, int p = -1) {
    if (u == t) in_cycle[u] = true;

    for (int v : adj[u]) if (v != p) {
        if ((u == s && v == t) || (u == t && v == s)) continue;
        
        if (find_cycle(v, u)) in_cycle[u] = true;
    }

    return in_cycle[u];
}

ll calc_cost() {
    ll cost = 0;
    forn(u, n) cost += abs(need[u]);
    return cost;
}

void no() {
    cout << -1 << endl;
    exit(0);
}

int main() {
	fastio;

    int m; cin >> n >> m;
    forn(_, m) {
        int u, v; cin >> u >> v; u--, v--; 
        adj[u].pb(v), adj[v].pb(u); 
    }

    paint();
    int dif_colors = n_color[1] - n_color[0];

    ll ans;
    if (m == n - 1) { // árbol
        if (dif_colors != 0) no();

        calc_needs();

        ans = calc_cost();
    }
    else if (color[s] == color[t]) { // ciclo impar
        if (abs(dif_colors) % 2 == 1) no();

        int need_add = dif_colors / 2;
        color[s] -= need_add, color[t] -= need_add;
        calc_needs();

        ans = abs(need_add) + calc_cost();
    }
    else { // ciclo par
        if (dif_colors != 0) no();

        calc_needs();

        find_cycle();
        vi sorted_needs; sorted_needs.pb(0);
        forn(u, n) if (in_cycle[u] && u != s) sorted_needs.pb(need[u]);
        sorted_needs.pb(0);

        sort(all(sorted_needs)); 
        int opt_move = sorted_needs[si(sorted_needs) / 2];

        color[s] += opt_move, color[t] -= opt_move;
        calc_needs();

        ans = abs(opt_move) + calc_cost();
    }

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


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

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

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

int main(){
	int h, w, k;
	scanf("%d %d %d", &h, &w, &k);
	int sx, sy;
	bool fie[h][w];
	getchar();
	rep(i, 0, h){
		rep(j, 0, w){
			char c = getchar();
			if(c=='S') sx=i, sy=j;
			fie[i][j] = (c=='#');
		}
		getchar();
	}

	ll ans = 1e18;
	std::queue<PP> que;
	que.emplace(0, P(sx, sy));
	while(!que.empty()){
		ll d = que.front().fi;
		P p = que.front().se;
		que.pop();
		if(fie[p.fi][p.se]) continue;
		fie[p.fi][p.se] = true;
		ll cost = std::min({p.fi, h-p.fi-1, p.se, w-p.se-1});
		ans = std::min(ans, std::max(1l,(d+k-1)/k) + (cost+k-1)/k);
		if(cost==0) continue;
		rep(i, 0, 4){
			ll nx = p.fi+dx[i], ny = p.se+dy[i];
			if(!fie[nx][ny]) que.emplace(d+1, P(nx, ny));
		}
	}
	printf("%ld\n", ans);
	return 0;
}


Measured memory_bytes: 896
import sys
N=int(input())
table=[]
for i in range(N):
    x,y=map(int,input().split())
    table.append((x,y))
L=[0,0]
for x,y in table:
    L[(x+y)%2]=1
if sum(L)==2:
    print(-1)
    sys.exit()
def f(a,b):
    pas=''
    s=a[::-1]
    t=b[::-1]
    A=[0]*31
    B=[0]*31
    for i in range(len(s)):
        if s[i]=='1':
            A[i]=1
    for i in range(len(t)):
        if t[i]=='1':
            B[i]=1
    n=31
    for i in range(n):
        if A[i]==0 and B[i]==0:
            pas+='L'
        if A[i]==0 and B[i]==1:
            pas+='D'
        if A[i]==1 and B[i]==0:
            pas+='U'
        if A[i]==1 and B[i]==1:
            pas+='R'
        
    return pas
if L[0]==1:
    m=32
    d=[1]+[pow(2,i) for i in range(31)]
    ans=[]
    S=[]
    for x,y in table:
        S.append((x-1,y))
    for x,y in S:
        a='R'
        u=(x+y+(pow(2,31)-1))//2
        v=(x-y+(pow(2,31)-1))//2
        u=bin(u)[2:]
        v=bin(v)[2:]
        a+=f(u,v)
        ans.append(a)       
else:
    m=31
    d=[pow(2,i) for i in range(31)]
    ans=[]
    S=table
    for x,y in S:
        a=''
        u=(x+y+(pow(2,31)-1))//2
        v=(x-y+(pow(2,31)-1))//2
        u=bin(u)[2:]
        v=bin(v)[2:]
        a+=f(u,v)
        ans.append(a)      

print(m)
print(' '.join(map(str,d)))
for s in ans:
    print(s)

Measured memory_bytes: 44400
import java.util.*;

class IntStack {
    int[] arr;
    int top;
    int MAX;

    public IntStack(int max) {
        this.MAX = max;
        arr = new int[max];
    }

    void initialize() {
        top = 0;
    }

    boolean isEmpty() {
        return top == 0;
    }

    boolean isFull() {
        return top >= MAX - 1;
    }

    void push(int x) {
        if (isFull()) {
            throw new RuntimeException("オーバーフロー");
        }
        top++;
        arr[this.top] = x;
    }

    int pop() {
        if (isEmpty()) {
            throw new RuntimeException("アンダーフロー");
        }
        top--;
        return arr[this.top + 1];
    }
}

public class Main {
    
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        IntStack stack = new IntStack(200);
        stack.initialize();

        while (sc.hasNext()) {
            if (sc.hasNextInt()) {
                stack.push(sc.nextInt());
            } else {
                String s = sc.next();
                int res;
                if (s.equals("+")) {
                    res = stack.pop() + stack.pop();
                } else if (s.equals("-")) {
                    res = - stack.pop() + stack.pop();
                } else if (s.equals("*")) {
                    res = stack.pop() * stack.pop();
                } else {
                    throw new RuntimeException("hoge");
                }
                stack.push(res);
            }
        }

        System.out.println(stack.pop());
    }
}


Measured memory_bytes: 26804
#include <bits/stdc++.h>
using namespace std;
int a[55], b[55], c[55], d[55];
int main() {
	int n, m;
	scanf("%d %d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%d %d", &a[i], &b[i]);
	for (int i = 1; i <= m; i++) scanf("%d %d", &c[i], &d[i]);
	for (int i = 1; i <= n; i++) {
		int minn = 999999999, mini;
		for (int j = 1; j <= m; j++) {
			if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < minn) {
				minn = abs(a[i] - c[j]) + abs(b[i] - d[j]);
				mini = j;
			}
		}
		printf("%d\n", mini);
	}
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
	int n,a,b,c,d,s[4][3][10];
	for(int i=0;i<4;i++)
		for(int j=0;j<3;j++)
			for(int k=0;k<10;k++)
				s[i][j][k]=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b>>c>>d;
		s[a-1][b-1][c-1]+=d;
	}
	for(int i=0;i<4;i++){
		for(int j=0;j<3;j++){
			for(int k=0;k<10;k++){
				cout<<" "<<s[i][j][k];
			}
			cout<<endl;
		}
		if(i!=3){
		for(int j=0;j<20;j++)
			cout<<"#";
		cout<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1164
#include<bits/stdc++.h>
using namespace std;
#define tezi ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
typedef long long ll;

int main(){
    tezi;
    ll n, k;
    cin >> n >> k;
    vector<int> a(n + 1);
    for(int i = 1; i <= n; ++i){
        cin >> a[i];
    }
    vector<int> v;
    map<int, int> m;
    int cur = 1, start = 0;
    m[1] = 0;
    v.push_back(1);
    while(1){
        int new_pos = a[cur];
        if(m.find(new_pos) != m.end()){
            start = m[new_pos];
            break;
        }
        m[new_pos] = (int)v.size();
        v.push_back(new_pos);
        cur = new_pos;
    }
    if(k < start) cout << v[k] << "\n";
    else{
        k -= start;
        vector<int> v1;
        for(int i = start; i < (int)v.size(); ++i){
            v1.push_back(v[i]);
        }
        cout << v1[k % (ll)v1.size()] << "\n";
    }
    return 0;
}


Measured memory_bytes: 13872
import sys
L,R = map(int, input().split())

#if R-L > 2019:
#  print (0)
#else:
#  mod1 = L%2019
#  mod2 = R%2019
#  if mod2 < mod1:
#    print (0)
#    sys.exit()
#  else:
modmin =2019 -1
for i in range(L,R):
  for j in range(i+1,R+1):
    mod3 = (i*j)%2019
    if mod3 == 0:
      print(0)
      sys.exit()
    elif modmin > mod3:
      modmin = mod3

print(modmin)


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

int W, H; 
vector<vector<int>> C(55, vector<int>(55));

void dfs(int h, int w){
  C[h][w] = 0;

  for(int dx=-1; dx<=1; dx++){
    for(int dy=-1; dy<=1; dy++){
      if(0 <= h+dx && h+dx < H && 0 <= w+dy && w+dy < W){
        if(C[h+dx][w+dy] == 1){
          dfs(h+dx, w+dy);
        }
      }
    }
  }
}

int main(){ 
  while(true){
    cin >> W >> H;
    if(W == 0 && H == 0) break;

    for(int h = 0; h<H; h++){
      for(int w =  0; w<W; w++){
        cin >> C[h][w];
      }
    }

    int ans = 0;
    for(int h = 0; h<H; h++){
      for(int w =  0; w<W; w++){
        if(C[h][w] == 1){
          dfs(h, w);
          ans++;
        }
      }
    }

    cout << ans << endl;
  }
}


Measured memory_bytes: 3296
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.function.LongSupplier;

public class Main{ // 

	static class ConsoleScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			try {
				while (!st.hasMoreElements())
					st = new StringTokenizer(br.readLine());
				return st.nextToken();
			} catch (IOException e) {
				throw new AssertionError(e);
			}
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}
	}

	static LongSupplier now = new LongSupplier() {
		private long t = System.currentTimeMillis();

		@Override
		public long getAsLong() {
			long a = t;
			t = System.currentTimeMillis();
			long ans = t - a;
			return ans;
		}
	};

	public static void main(String args[]) {
		ConsoleScanner cin = new ConsoleScanner();
		PrintWriter cout = new PrintWriter(System.out);
		solve(cin, cout);
		cout.flush();
	}

	static int tr(Object... objects) {
		System.out.println("tr:" + Arrays.deepToString(objects));
		return 0;
	}

	private static void solve(ConsoleScanner cin, PrintWriter cout) {
		// assert solve(1) == 1;

		int n = cin.nextInt();

		now.getAsLong();

		String ans = solve(n);
		cout.println(ans);

		assert 0 == tr("elapsed", now.getAsLong());
	}

	private static String solve(int n) {
		if (n % 10 == 9 || n / 10 == 9)
			return "Yes";
		return "No";
	}

}


Measured memory_bytes: 23252
#include<stdio.h>
int main()
{
    int n,i,j;
    int H,W;
    char sb[10000];
    char str[100][100];
    while(~scanf("%d %d",&H,&W))
    {
        for(i=0; i<H; i++)
            scanf("%s",str[i]);
        for(i=0; i<H; i++)
        {
            for(j=0; j<W; j++)
            {
                if(str[i][j]=='.')
                {
                    str[i][j]='0';
                }
            }
        }
        for(i=0; i<H; i++)
        {
            for(j=0; j<W; j++)
            {
                if(str[i][j]=='#')
                {
                    if(i!=0)
                    {
                        if(str[i-1][j-1]!='#'&&j!=0)
                            str[i-1][j-1]++;
                        if(str[i-1][j]!='#')
                            str[i-1][j]++;
                        if(str[i-1][j+1]!='#'&&j+1!=W)
                            str[i-1][j+1]++;
                    }
                    if(str[i][j-1]!='#'&&j!=0)
                        str[i][j-1]++;
                    if(str[i][j+1]!='#')
                        str[i][j+1]++;
                    if(i+1!=H)
                    {
                        if(str[i+1][j-1]!='#'&&j!=0)
                            str[i+1][j-1]++;
                        if(str[i+1][j]!='#')
                            str[i+1][j]++;
                        if(str[i+1][j+1]!='#'&&j+1!=W)
                            str[i+1][j+1]++;
                    }


                }
            }
        }
        for(i=0; i<H; i++)
        {
            for(j=0; j<W; j++)
                printf("%c",str[i][j]);
            printf("\n");
        }
    }
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
const int dy[] = { 0, 1, 0, -1}, dx[] = { 1, 0, -1, 0};
int H, W;

bool isend(const string& str){
  bool color;
  for(int i = 0; i < 3; i++){
    if(count( str.begin(), str.end(), "RGB"[i]) == H * W) return true;
  }
  return false;
}
int getx( int pos){
  return pos % W;
}
int gety( int pos){
  return pos / W;
}
int getpos( int y, int x){
  return y * W + x;
}

string change( string str, char pre, char c){
  if(pre == c) return str;
  queue< int > que;
  que.push(0);
  str[0] = c;
  while(!que.empty()){
    int p = que.front(); que.pop();
    for(int i = 0; i < 4; i++){
      int ny = gety(p) + dy[i], nx = getx(p) + dx[i];
      if(ny < 0 || ny >= H || nx < 0 || nx >= W) continue;
      if(str[getpos(ny,nx)] != pre) continue;
      str[getpos(ny,nx)] = c;
      que.push(getpos(ny,nx));
    }
  }
  return str;
}

int bfs(string str){
  queue< string > que;
  map< string, int > used;
  que.push(str);
  used[str] = 0;
  while(!que.empty()){
    string s = que.front(); que.pop();
    if(isend(s)) return used[s];
    for(int i = 0; i < 3; i++){
      string newstr = change(s,s[0],"RGB"[i]);
      if(used.find(newstr) != used.end()) continue;
      used[newstr] = used[s] + 1;
      que.push(newstr);
    }
  }
}
int main(){
  while( cin >> W >> H, W){
    string mas;
    for(int i = 0; i < H; i++){
      for(int j = 0; j < W; j++){
        char c;
        cin >> c;
        mas += c;
      }
    }
    cout << bfs(mas) << endl;
  }
}

Measured memory_bytes: 2648
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>

using namespace std;

long long MOD = 1000000007;

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

    if((A+B)%2==1){
        cout << "IMPOSSIBLE" << endl;
        return 0;
    }else{
        cout << (A+B)/2 << endl;
    }

}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <stdlib.h>
#include <set>
typedef long long ll;
using namespace std;

int main() {
	int x,a,b;
	cin>>x>>a>>b;
	if(abs(x-a)<abs(x-b)){
		cout<<"A"<<endl;
	}else{
		cout<<"B"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;
#define RET(ans) {cout<<ans<<endl;return 0;} 

    // 二次元ベクターの基本
    /*
    vector<vector<int>> dp; // 宣言
    dp.resize(n); // 1次元めの要素数決定
    dp[i].push_back(int); // プッシュバック
    rep(i,n){
        sort(dp[i].begin(),dp[i].end()); // 二次元めを昇順ソート
    }
    */

    // 整数スキャン（複数）
    /*
    int x,y,z;
    scanf("%d%d%d",&x,&y,&z);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s; cin >> s;
    */

    // n個の文字列スキャン
    /*
    vector<string> slist;
    rep(i,n){
        string s; cin >> s;
        slist.push_back(s);
    }
    */

int main() {
    int n;
    scanf("%d",&n);
    ll a[n] = {};
    int sum = 0;
    rep(i,n){
        scanf("%lld",&a[i]);
        if(a[i]%2==1){
            sum++;
        }
    }

    if(sum%2==0)yn;

    return 0;
}
 
 


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

int n, q, now, ans, maxn, m;
int memo[1000] = {0};
string s;
// char s[1000];

int main() {
  int i, j;
  while(1) {
    cin >> n >> q;
    if(n + q == 0) break;
    ans = 0;
    maxn = 0;
    for(i = 0; i < n; ++i) {
      cin >> m;
      for(j = 0; j < m; ++j) {
        cin >> now;
        ++memo[now];
      }
    }
    for(i = 0; i < 1000; ++i) {
      if(memo[i] >= q && memo[i] > maxn) {
        maxn = memo[i];
        ans = i;
      }
      memo[i] = 0;
    }
    cout << ans << endl;
  }
  return 0;
}



Measured memory_bytes: 3004
#include<bits/stdc++.h>
using namespace std;
namespace FAST_IO
{
	template<typename T> void read(T &a)
	{
		a=0;
		int f=1;
		char c=getchar();
		while(!isdigit(c))
		{
			if(c=='-')
			{
				f=-1;
			}
			c=getchar();
		}
		while(isdigit(c))
		{
			a=a*10+c-'0';
			c=getchar();
		}
		a=a*f;
	}
	template <typename T> void write(T a)
	{
		if(a<0)
		{
			a=-a;
			putchar('-');
		}
		if(a>9)
		{
			write(a/10);
		}
		putchar(a%10+'0');
	}
	template <typename T> void writeln(T a)
	{
		write(a);
		puts("");
	}
}
int main()
{
	int n;
	cin>>n;
	for(int i=n;i<=999;i++)
	{
		stringstream q;
		q<<i;
		string t;
		q>>t;
		for(int j=1;j<3;j++)
		{
			if(t[j]!=t[j-1])
			{
				goto A;
			}
		}
		cout<<i<<endl;
		return 0;
		A:
		continue;
	}
}

Measured memory_bytes: 256
//Solution for aoj:0212 Highway Express Bus
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>
using namespace std;
typedef pair<int, int>P;
typedef pair < P, int > PP;
#define f first
#define s second

//struct S {
//	int cost, to, num;
//	S(int c, int t, int n) : cost(c), to(t), num(n){}
//	bool operator>(const S &s) const {
//		return cost > s.cost;
//	}
//};

const int INF = 1 << 29;
int c, n, m, s, d, ans;
int tocost[1000][100];
vector<P> town[1000];


void dijkstra(){
	priority_queue<PP, vector<PP>, greater<PP> > pq;
	pq.push({ { 0, s }, c });
	while (!pq.empty()){
		PP a = pq.top();
		pq.pop();
		for (int i = 0; i < town[a.f.s].size(); i++){
			int tt = town[a.f.s][i].f, cc = town[a.f.s][i].s;
			if (tocost[tt][a.s] > cc + a.f.f){
				tocost[tt][a.s] = cc + a.f.f;
				pq.push({ { cc + a.f.f, tt }, a.s });
			}
			if (a.s&&tocost[tt][a.s-1] > cc/2 + a.f.f){
				tocost[tt][a.s-1] = cc/2 + a.f.f;
				pq.push({ { cc / 2 + a.f.f, tt }, a.s - 1 });
			}
		}
	}
}
	int main(){
		while (cin >> c >> n >> m >> s >> d&&c&&n&&m&&s){
			for (int i = 0; i < 1000; i++)
				fill(tocost[i], tocost[i] + 100, INF);
			tocost[s][c] = 0;
			ans = INF;
			for (int i = 0; i < 1000; i++)
				town[i].clear();
			for (int i = 0; i < m; i++){
				int a, b, c;
				cin >> a >> b >> c;
				town[a].push_back({ b, c });
				town[b].push_back({ a, c });
			}
			dijkstra();
			for (int i = 0; i <= c; i++)
				ans = min(ans, tocost[d][i]);
			cout << ans << endl;
		}
		return 0;
	}

Measured memory_bytes: 1652
// Problem : F - Distance Sums
// Contest : AtCoder - AtCoder Regular Contest 103
// URL : https://atcoder.jp/contests/arc103/tasks/arc103_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int,ll > pil;
typedef pair<ll ,int> pli;
typedef pair<ll ,ll > pll;
#define rep(i,l,r) for(i=(l);i<=(r);++i)
#define per(i,l,r) for(i=(l);i>=(r);--i)
#define REP(i,l,r) for(i=(l);i< (r);++i)
#define PER(i,l,r) for(i=(l);i> (r);--i)
#define mp make_pair
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define fi first
#define se second
#define it iterator
template<class IT>inline void cmx(IT &a,IT b){if(a<b)a=b;}
template<class IT>inline void cmn(IT &a,IT b){if(b<a)a=b;}
template<class IT>inline bool bmx(IT &a,IT b){if(a<b){a=b;return true;}else return false;}
template<class IT>inline bool bmn(IT &a,IT b){if(b<a){a=b;return true;}else return false;}
const int N=100005;
map<ll,int>M;
pli D[N];
int S[N],F[N];
inline void ac(){
	int n,i,a,s;ll w,d;
	scanf("%d",&n);
	rep(i,1,n){scanf("%lld",&D[i].fi);M[D[i].fi]=D[i].se=i;}
	sort(D+1,D+n+1);
	per(i,n,2){
		w=D[i].fi;
		a=D[i].se;
		//printf("w=%lld a=%d\n",w,a);
		s=++S[a];
		if((s<<1)>=n){printf("-1");return;}
		d=w+(s<<1)-n;
		if(!M[d]){printf("-1");return;}
		S[F[a]=M[d]]+=s;
		//printf("f=%d\n",F[a]);
	}
	w=-S[D[1].se];
	rep(i,1,n)w+=S[i];
	if(w==D[1].fi){rep(i,1,n)if(a=F[i])printf("%d %d\n",i,a);}
	else printf("-1");
}
int main(){
	//freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	
	ac();
	return 0;
}
#undef rep
#undef per
#undef REP
#undef PER
#undef mp
#undef pb
#undef pf
#undef pob
#undef pof
#undef fi
#undef se
#undef it

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

int main() {
  long a,b;
  cin >> a>>b;
  long rta = sqrt(a)/1;
  long rtb = sqrt(b)/1;
  vector<long> ba(2000001);
  vector<long> bb(2000001);
  for(int i=0;i<2000001;i++){
    ba[i]=0;
    bb[i]=0;
  }
  for(int i=2;i<=rta*2;i++){
    while(a%i==0){
      ba[i] =1;
      a /=i;
    }
  }

  for(int i=2;i<=rtb*2;i++){
    while(b%i==0){
      bb[i] =1;
      b /=i;
    }
  }

int ans=1;
for(int i=0;i<2000001;i++){
  if(ba[i]==1&&bb[i]==1) ans++;
}
if(a!=1&&a==b) ans++;
  //cout<<a<<" "<<b<<endl;
cout<<ans<<endl;

  }


Measured memory_bytes: 31488
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <cstdio>
#include <numeric>
#include <iomanip>

using namespace std;

using ll = long long;

int main()
{
    ll x;
    cin >> x;
    if(x >= 30)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3132
#include <iostream>
#include <cstring>
#include <cstdio>
#define ll long long
using namespace std;

inline int read(){
	int sum=0,f=1;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-') f=-1;c=getchar();}
	while(c<='9'&&c>='0'){sum=sum*10+c-'0';c=getchar();}
	return f*sum;
}

const int N=3005;
const int Mod=1000000007;
int n,m;
ll f[N][N][2];

signed main(){
	n=read();m=read();
	for(int i=1;i<=n;i++) f[0][i][0]=1;
	f[0][0][1]=1;
	for(int i=0;i<m;i++){
		for(int j=0;j<=n;j++){
			if(j)/*黑白*/{
				if(j>1) f[i+1][j][0]=(f[i+1][j][0]+f[i][j][0])%Mod;
				f[i+1][j][1]=(f[i+1][j][1]+f[i][j][1])%Mod;
				if(j==1) f[i+1][j][1]=(f[i+1][j][1]+f[i][j][0])%Mod;
			}
			if(j<n)/*白黑*/{
				f[i+1][j][0]=(f[i+1][j][0]+f[i][j][0])%Mod;
				f[i+1][j][1]=(f[i+1][j][1]+f[i][j][1])%Mod;
			}
			if(j)/*黑黑*/{
				if(j>1) f[i+1][j-1][0]=(f[i+1][j-1][0]+f[i][j][0])%Mod;
				f[i+1][j-1][1]=(f[i+1][j-1][1]+f[i][j][1])%Mod;
				if(j==1) f[i+1][j-1][1]=(f[i+1][j-1][1]+f[i][j][0])%Mod;
			}
			if(j<n)/*白白*/{
				f[i+1][j+1][0]=(f[i+1][j+1][0]+f[i][j][0])%Mod;
				f[i+1][j+1][1]=(f[i+1][j+1][1]+f[i][j][1])%Mod;
			}			
	   }
	}
	ll ans=0;
	for(int i=0;i<=n;i++) ans=(ans+f[m][i][1])%Mod;
	printf("%lld\n",ans);	
	return 0;
}


Measured memory_bytes: 141184
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  string emp = "";

  for(int i= 0;i < s.size();i++){
    if(s[i] == ',')emp += ' ';
    else emp += s[i];
  }

  cout << emp << endl;


}


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

int main()
{
	string S, res;
	cin >> S;
	ll n = S.size(), md = -1, MAX = 1, s = stoll(S);
	vector<int> digit = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
	for (int i = 0; i < n; i++) {
		MAX *= 10;
	}
	do {
		ll val = 0;
		string v;
		for (int i = 0; i < n; i++) {
			val = val * 10 + digit[i];
			v.push_back('0' + digit[i]);
		}
		ll d = min(MAX - abs(s - val), abs(s - val));
		if (d > md) {
			md = d;
			res = v;
		}
	} while (next_permutation(digit.begin(), digit.end()));
	cout << res << endl;
	return 0;
}

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

using namespace std;

int main()
{
	long long a0 = 2, a1 = 1, a2;
	int n;
	cin >> n;
	if (n == 0)
		cout << "2\n";
	else if (n == 1)
		cout << "1\n";
	else {
		for (int i = 2; i <= n; i++) {
			a2 = a0 + a1;
			a0 = a1;
			a1 = a2;
		}

		cout << a2 << '\n';
	}
	return 0;
}


Measured memory_bytes: 256
import sys
import copy
import  math
import bisect
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

a, b, c, d, e, f = na()
m = f // (100 * a)
n = f // c
wli = []
sli = []
for i in range(m+1):
    for j in range(m+1):
        x = 100 * a * i + 100 * b * j
        if 0 < x <= f:
            wli.append(x)
for i in range(n):
    for j in range(n):
        y = c * i + d * j
        if y <= f:
            sli.append(y)
ans = [0, 0, 0]
for x in wli:
    for y in sli:
        if x + y <= f and 100 * y <= e * x:
            p = y * 100 / (x + y)
            if ans[2] <= p:
                ans = [x + y, y, p]
print(*ans[:2])




Measured memory_bytes: 13000
//17571@nith.ac.in @Ankit Verma
#include <bits/stdc++.h>
#define ff  first
#define ss  second
#define pb  push_back
#define ll  long long
#define ld  long double
#define eb  emplace_back
#define ull unsigned long long
#define all(v) v.begin(), v.end()
#define rep(i,x,n)  for(int i=x;i<n;i++)
#define repr(i,x,n) for(int i=x;i>=n;i--)
#define bolt ios::sync_with_stdio(false)
using namespace std;

void IoI() {
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
}

int32_t main() {
	//IoI();
	bolt;
	cin.tie(nullptr);
	cout.tie(nullptr);
	int k, n; cin >> k >> n;
	int sum = 0; vector <int> ar(n);
	rep (i, 0, n) {
		cin >> ar[i];
	}
	sum = (ar[0] - ar[n - 1]) + k;
	rep (i, 1, n) {
		sum = max(sum, ar[i + 1] - ar[i]);
	}
	cout << k - sum << endl;
	

	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cmath>

int main(){
  int n;
  double s[1000];


  while(true){
    std::cin >> n;
    if(n==0) break;

    double sum=0, mean=0, var=0;

    for(int i=0; i<n; i++){
      std::cin >> s[i];
      sum += s[i];
    }

    mean = sum / n;

    for(int i=0; i<n; i++){
      var += (s[i] - mean)*(s[i] - mean);
    }
    var = var / n;

    printf("%.8lf\n", sqrt(var));
  }
}



Measured memory_bytes: 3196
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <tuple>
#include <set>
#include <queue>
#include <numeric>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	int n, x;
	cin >> n >> x;
	vector<tuple<long long, long long, long long>> values(n);
	vector<tuple<long long, int>> data(n);
	long long sum = 0;
	for (int i = 0; i < n; ++i) {
		long long b, l, u;
		cin >> b >> l >> u;
		values[i] = make_tuple(b, l, u);
		data[i] = make_tuple((x - b) * u + b * l, i);
		sum += b * l;
	} 
	sort(data.begin(), data.end());
	vector<int> indexes(n);
	for (int i = 0; i < n; ++i) {
		indexes[get<1>(data[i])] = i;
	}
	long long res = 0;
	vector<bool> used(n);
	int maxn = 0;
	for (int i = n - 1; i >= 0; --i) {
		if (sum < get<0>(data[i])) break;
		sum -= get<0>(data[i]);
		used[get<1>(data[i])] = true;
		res += x;
		maxn = i - 1;
	}
	long long delta = x;
	if (sum > 0) {
		for (int i = 0; i < n; ++i) {
			long long del1;
			if (used[i]) {
				auto s1 = sum + get<0>(data[indexes[i]]) - get<0>(data[maxn]);
				del1 = (s1 <= get<0>(values[i]) * get<1>(values[i])) ? (s1 - 1 + get<1>(values[i])) / get<1>(values[i]) : (get<0>(values[i]) + (s1 - get<0>(values[i]) * get<1>(values[i]) - 1 + get<2>(values[i])) / get<2>(values[i]));
			}
			else {
				del1 = (sum <= get<0>(values[i]) * get<1>(values[i])) ? (sum - 1 + get<1>(values[i])) / get<1>(values[i]) : (get<0>(values[i]) + (sum - get<0>(values[i]) * get<1>(values[i]) - 1 + get<2>(values[i])) / get<2>(values[i]));
			}
			delta = min(delta, del1);
		}
	}
	else delta = 0;
	res += delta;
	cout << res << endl;
	return 0;
}


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

int main()
{
	int64_t n, mod = 1000000007;
	string s;
	cin >> n >> s;

	vector<int64_t> cnt(26, 0);
	for (auto &c : s)
	{
		cnt[c - 'a']++;
	}

	int64_t ans = 1;

	for (auto &x : cnt)
	{
		(ans *= x + 1) %= mod;
	}
	ans--;

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
//#define int long long
typedef vector<int>Vl;
typedef vector<vector<int>>Vv;
typedef pair<int,int>pii;
typedef vector<pii>Vll;
typedef vector<pair<int,pair<int,int> > >Vlll;
#define S second
#define F first
#define mp make_pair
#define ms(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define sl(n) cin>>n 
#define pl(n) cout<<n<<" "
const int Nx=1e6+2;
const int inf=(int)(1e19+10LL);
const int mod=1e9+7;
#define PI 3.14159265358979323846264338327950L
void solve(){
  long double a,b,h,m;
  sl(a);sl(b);sl(h);sl(m);
  long double rad=((2.0*PI)/12.0)*((h+m/60.0)-(m/5.0));
  long double ans=a*a+b*b-2*a*b*cosl(rad);
  ans=sqrt(ans);
  cout<<fixed<<setprecision(9)<<ans<<endl;
}

signed main(){
  int test=1;
  //sl(test);
  int t=0;
 while(t++<test){
 //	cout<<"Case #"<<t<<": ";
 	solve();
 }
 
}

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

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            var w = Console.ReadLine().Split(' ').ToArray();

            BigInteger x = BigInteger.Parse(w[0]);
            BigInteger y = BigInteger.Parse(w[1]);

            BigInteger z = y / x;
            var p = Math.Floor(BigInteger.Log(z, 10));


            int temp = 3 * int.Parse(p.ToString());
            int i;
            for (i = temp; i <= temp + 10; i++)
            {
                BigInteger a = x * BigInteger.Pow(2, i);
                if(a > y)
                {
                    i = i - 1;
                    break;
                }
            }

            Console.WriteLine(i + 1);

        }
    }
}

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


int main(){
  int N;
  cin >> N;
  vector<int> A(N+1);
  vector<int> B(N);
  
  for(auto& a : A){
    cin >> a;
  }
  for(auto& b : B){
    cin >> b;
  }

  long long int ans = 0;
  for(int ii=0; ii<N; ii++){
    int removed_mobs = min(A[ii], B[ii]);
    ans += removed_mobs;
    A[ii] -= removed_mobs;
    B[ii] -= removed_mobs;

    removed_mobs = min(A[ii+1], B[ii]);
    ans += removed_mobs;
    A[ii+1] -= removed_mobs;
    B[ii] -= removed_mobs;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <map>
#include <functional>

using namespace std;
using ll = long long;
// constexpr int MOD = 1e9+7;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
ll gcd(ll a, ll b){ return (b == 0) ? a : gcd(b, a % b); }
ll lcm(ll a, ll b){ return a/gcd(a, b)*b; };

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Unique(a) a.erase(unique(Range(a)), a.end());
#define Reverse(c) reverse(Range(c))
#define Vec2(T, n, m, xs) vector<vector<T>> xs(n, vector<T>(m))
#define Sum(a) accumulate(Range(a), 0)
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) for(const auto &e : xs) cout << e << " "; cout << "\n"
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")

int main(void){
    Cin(ll, a, b);
    ll ans = 0;
    if(b-a <= 10){
        for(ll x = a; x <= b; x ++) ans ^= x;
    }
    else{
        for(ll x = a; x % 4 != 0; x ++) ans ^= x;
        for(ll x = b; x % 4 != 3; x --) ans ^= x;
    }
    Cout(ans);
}


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

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define debug(x) cerr << #x << ": " << x << endl

using namespace std;

typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;
struct edge{int from, to; ll cost;};

const ll MOD = 1000000007;
const long double EPS = 1e-10;

int main() {
    std::ios::sync_with_stdio(0); cin.tie(0);
    int n, max_a = 55555, cnt = 0;
    cin >> n;
    vector<int> fact(max_a+1, 1);
    for(int i=2;i<=max_a;i++){
        if(!fact[i]) continue;
        int j = 2*i;
        while(j <= max_a){
            fact[j] = 0;
            j += i;
        }
        if(i % 5 == 1){
            cout << i << " ";
            cnt++;
            if(cnt == n) break;
        }
    }
    cout << endl;
}

Measured memory_bytes: 512
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		int c=sc.nextInt();
		int d=sc.nextInt();
		
		int max;
		System.out.println(Math.max(a*b, c*d));
	}
}


Measured memory_bytes: 23892
#include <bits/stdc++.h>
#define LLI long long int
#define FOR(v, a, b) for(LLI v = (a); v < (b); ++v)
#define FORE(v, a, b) for(LLI v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(LLI v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define fst first
#define snd second
#define popcount __builtin_popcount
#define UNIQ(v) v.erase(unique(ALL(v)), v.end())
#define bit(i) (1LL<<i)
#define sz(v) ((LLI)(v).size())

#ifdef DEBUG
#include <misc/C++/Debug.cpp>
#else
#define dump(...) ((void)0)
#endif

#define gcd __gcd

using namespace std;
template <class T> constexpr T lcm(T m, T n){return m/gcd(m,n)*n;}

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}
template <typename T, typename U> istream& operator>>(istream &is, pair<T,U> &p){is >> p.first >> p.second; return is;}

template <typename T, typename U> bool chmin(T &a, const U &b){return (a>b ? a=b, true : false);}
template <typename T, typename U> bool chmax(T &a, const U &b){return (a<b ? a=b, true : false);}
template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}


class Doubling{
public:
  int n;
  int m;
  vector<vector<int>> table;
  
  // 常に、next[i] >= i を満たすようにする。
  Doubling(const vector<int> &next): n(next.size()), m(ceil(log2(n))+1), table(m, vector<int>(n)){
    REP(i,n) table[0][i] = next[i];
    FOR(i,1,m){
      REP(j,n){
	int k = table[i-1][j];
	if(k>=0 and k<n){
	  table[i][j] = table[i-1][k];
	}
      }
    }
  }

  int distance(int a, int b){ // aからbに移動する(超える)最小回数 (a<=b)
    int ret = 0;
    int cur = a;

    while(1){
      if(table[0][cur] >= b){
	++ret;
	break;
      }

      if(table[0][cur] <= cur) return -1;

      int next = -1;
      int diff = 0;
      
      FOR(i,0,m){
	if(table[i][cur] < b and table[i][cur] >= 0){
	  next = table[i][cur];
	  diff = (1<<i);
	}
      }

      if(next >= cur){
	ret += diff;
	cur = next;
      }else{
	return -1;
      }
    }
    
    return ret;
  }

};

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

  int N;
  while(cin >> N){
    vector<int> x(N); cin >> x;
    int L; cin >> L;

    vector<int> next(N);

    REP(i,N){
      next[i] = upper_bound(ALL(x), x[i]+L) - x.begin() - 1;
    }

    Doubling doubling(next);

    int Q; cin >> Q;
    REP(i,Q){
      int a,b; cin >> a >> b;
      --a, --b;
      if(a>b) swap(a,b);

      int ans = doubling.distance(a,b);
      
      cout << ans << endl;
    }
  }
  
  return 0;
}


Measured memory_bytes: 8696
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    int N,M;
    cin >> N >> M;
    vector<ll> H(N);
    rep(i,N) cin >> H[i];
    vector<vector<int>> R(N,vector<int>(0));
    rep(i,M){
        int A,B;
        cin >> A >> B;
        A--;B--;
        R[A].push_back(B);
        R[B].push_back(A);
    }
    int ans = 0;
    for(int i=0;i<N;i++){
        bool OK = true;
        for(int j=0;j<R[i].size();j++){
            if(H[i] - H[R[i][j]] <= 0){
                OK = false;
            }
        }
        if(OK) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 9068