akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

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

#define INF 1 << 30
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)



vector<bool> gen_sosuu(vector<bool> sosuu){
  int size = sosuu.size();
  REP(i,size){
    sosuu[i] = true;
  }
  sosuu[0] = false;
  sosuu[1] = false;
  sosuu[2] = true;
  FOR(i,2,sqrt(size)+1){
    if(sosuu[i] == false) continue;
    for(int j = 2; i*j<size;j++){
      sosuu[i*j] =false;
    }
  }
  return sosuu;
}



/*
使い方
ノード数nの要素を持つint型配列par,ranを宣言し、init()を呼ぶ
*/

int n,m;
int par[100001];
int ran[100001];
bool used[100001] = {false};
void init(int n,int par[],int ran[]){
  REP(i,n){
    par[i] = i;
    ran[i] = 0;
  }
}

int find(int x,int par[]){
  if(par[x] == x){
    return x;
  }else{
    return par[x] = find(par[x], par);
  }
}

void unite(int x, int y, int par[], int ran[]){
  x = find(x,par);
  y = find(y,par);
  if(x == y) return;

  if(ran[x] < ran[y]){
    par[x] = y;
  }else{
    par[y] = x;
    if(ran[x] == ran[y]) ran[x]++;
  }
}

bool same(int x, int y,int par[]){
  return find(x,par) == find(y,par);
}


int main(){
  cin >> n >> m;
  init(m,par,ran);
  REP(i,n){
    int k;
    int p;
    cin >> k >> p;
    p--;
    used[p] = true;
    REP(j,k-1){
      int c;
      cin >> c;
      c--;
      used[c] = true;
      unite(p,c,par,ran);
    }
  }
  int tmp = 0;
  int u;
  REP(i,m){
    if(used[i]) tmp++,u=i;
  }
  int cnt = 0;
  REP(i,m){
    if(same(i,u,par)) cnt++;
  }
  if(tmp == cnt){
    cout << "YES" <<endl;
  }else{
    cout << "NO" <<endl;
  }
}



Measured memory_bytes: 1152
#include<stdio.h>
#define zyougen 150
int i, j, num, gyou, retu, kosuu, omomi, A[zyougen][zyougen]={0};
int point, finnum=0; min[zyougen], kyori, used[zyougen], box[zyougen]={0};
 
int nearest(int used[]){
int best=10000000, next;
 for(i=0; i<num; i++){
   if (used[i] != -1) {
     if(best > min[i]){
       best = min[i];
       next = i;
     }
   }
 }

 finnum++;

 if(finnum == num-1){
   next = -1;
 }

 return next; 
}
 
int main(){
 
 scanf("%d", &num);
 for(i=0; i<num; i++){
   scanf("%d %d", &gyou, &kosuu);
   for(j=1; j<=kosuu; j++){
     scanf("%d %d", &retu, &omomi);
     A[gyou][retu] = omomi;
   }
   min[i] = 10000000;
 }

 point = 0;
 used[point] = 1;
 min[point] = 0;
 
 while(point != -1){
   for(i=0; i<num; i++){
     if (A[point][i] >= 1) {
       kyori = min[point] + A[point][i];
       if (min[i] > kyori) {
         min[i] = kyori;
       }
       if (used[i] == 0) {
         used[i] = 1;
       }
     }
   }
   used[point] = -1;
   point = nearest(used);
 }
 
 
 for(i=0; i<num; i++){
   printf("%d %d\n", i, min[i]);
 }
 
 return 0;
}

Measured memory_bytes: 1816
#include<bits/stdc++.h>
#define maxn 200005
#define ll long long
#define pii pair<int,int>
using namespace std;
int arr[maxn];
int cal(int n,multiset<pii> s) {
	int ret = 1234567891;
	memset(arr,-1,sizeof arr);
	int cnt = 0;
	multiset<int> done;
	while(!s.empty()) {
		pii now = *s.rbegin();
		int val = now.first , idx = now.second;
		s.erase(s.lower_bound(now));
		done.insert(val);
		if(arr[idx] == -1)
			cnt++;
		else
			done.erase(done.lower_bound(arr[idx]));
		arr[idx] = val;
			
		if(cnt == n)
			ret = min(ret,(*done.rbegin()) - (*done.begin()));
	}
	return ret;
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	multiset<pii> s,done;
	for(int i=1,x,y;i<=n;i++) {
		cin >> x >> y;
		s.insert(pii{x,i});
		s.insert(pii{y,i});
	}
	int Rmax = s.rbegin()->first , Bbase = -1;
	for(pii now : s)
		if(now.second == s.rbegin()->second) {
			Bbase = now.first;
			break;
		}
	done.insert(pii{Bbase,s.rbegin()->second});
	s.erase(s.lower_bound(pii{Bbase,s.rbegin()->second}));
	s.erase(s.lower_bound(*s.rbegin()));
	
	int Bmax = Bbase;
	memset(arr,-1,sizeof arr);
	int cnt = 1;
	ll ans = 1234567891234567891ll;
	if(n == 1)
		ans = 0;
	else {
		while(!s.empty()) {
			pii now = *s.rbegin();
			int Rmin = now.first , idx = now.second;
			s.erase(s.lower_bound(now));
			if(s.empty()) {		// final case
				done.insert(pii{arr[idx],idx});
				ans = min(ans,(ll)(Rmax - Rmin) * cal(n,done));
			}
			else {
				if(arr[idx] == -1)
					cnt++;
				if(cnt == n) {
					int Bmin = s.begin()->first;
					ans = min(ans,(ll)(Rmax - Rmin) * (max(Bmax,arr[idx]) - Bmin));
				}
				
				if(arr[idx] == -1)
					arr[idx] = Rmin;
				else
					Bmax = max(Bmax,Rmin);
			}
			done.insert(now);
		}
	}
	cout << ans << endl;
	return 0;
}


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

int main() {
	char a,b;
  		cin>>a>>b;
 // int x,y;
  
 /* if(a=='A') x=1;
  if(a=='B') x=2;
  if(a=='C') x=3;
  if(a=='D') x=4;
  if(a=='E') x=5;
  if(a=='F') x=6;
  
  if(b=='A') y=1;
  if(b=='B') y=2;
  if(b=='C') y=3;
  if(b=='D') y=4;
  if(b=='E') y=5;
  if(b=='F') y=6;
  
  if(x<y) cout<<"<"<<endl;
  else if(x>y) cout<<">"<<endl;
  else cout<<"="<<endl;
  */
  if(a<b) cout<<"<"<<endl;
  else if(a>b) cout<<">"<<endl;
  else cout<<"="<<endl;
  
  
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int n,i,o,a[6]={0};
	float num;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%f",&num);
		if(num < 165.0)
			a[0]++;
		else if(num < 170.0)
			a[1]++;
		else if(num <175.0)
			a[2]++;
		else if(num <180.0)
			a[3]++;
		else if(num <185.0)
			a[4]++;
		else 
			a[5]++;
	}
	for(i=0;i<6;i++){
		printf("%d:",i+1);
		for(o=0;o<a[i];o++)
			printf("*");
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 636
#include<cstdio>
#include<cmath>
#include<climits>
#include<algorithm>
#include<sstream>
#include<iostream>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<list>
#include<map>
#include<vector>

using namespace std;


#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define ll long long

#define IMIN INT_MIN;
#define IMAX INT_MAX;


int main(){
	int a, b, c;
	cin >> a >> b >> c;
	cout << min(b / a, c) << endl;


	return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<string>
#include<bitset>
#include<cfloat>
#include<iomanip>
#include<numeric>

//#define int long long
#define repi(i,start,end) for(int (i)=(start),TemPNuM=(int)(end);(i)<TemPNuM;++(i))
#define rep(i,end) repi((i),0,(end))
#define rfor(x,v) for(auto& (x) : (v))
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fsort(v,lambda) sort(all((v)),(lambda))
#define vin(v) rep(i,(v).size())cin >> (v)[i];
#define vpin(v) rep(i,(v).size())cin>>v[i].first>>v[i].second

using namespace std;
using ll =  long long;
using pint =  pair<int,int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vpint = vector<pint>;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T>void put_double(T a){if(cout.precision()!=12)cout<<setprecision(12);cout<<a<<endl;}
template<class T>void print(T a){cout << a << endl;}
//lambda: [](int x, int y){return x<y;}

signed main(void) {
    ll n, k; cin >> n >> k;
    vint a(n); vin(a);
    const ll mod = 1e9 + 7;
    ll ord = 0, rev = 0;
    rep(i, n) {
        rep(j, n) {
            if(i == j) continue;
            if(a[i] > a[j]) {
                ord++;
                if(i < j) rev++;
            }
        }
    }
    ll inner_ord = rev * k % mod;
    ll outer_ord = k * (k - 1) / 2 % mod * ord % mod;
    ll ans = (inner_ord + outer_ord) % mod;
    print(ans);
    return 0;
}


Measured memory_bytes: 256
h,w = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))

ans = [[0 for i in range(w)] for i in range(h)]

memo = 0
for i in range(len(a)):
    for k in range(a[i]):
        ans[memo//w][memo%w] = i+1
        memo += 1

for i in range(1,len(ans),2):
    ans[i].reverse()


for i in range(h):
    for j in range(w):
        print(ans[i][j]," ",end="")
    print('')






Measured memory_bytes: 4124
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0; i<(int)(n);i++)

int main(){
  int n;
  cin >> n;
  vi data(n);
  rep(i,n){
    cin >> data.at(i);
  }
  sort(data.begin(),data.end());
  vector<long> two(50);
  two.at(0) = 1;
  for(int i=1;i<50;i++){
    two.at(i) = 2 * two.at(i-1);
  }
  long tmp;
  double f,d;
  double answer = 0;
  for(int i=1;i<n;i++){
    tmp = two.at(n-i);
    f = 1.0/((double)tmp);
    d = (double)data.at(i);
    answer += f*d;
  }
  tmp = two.at(n-1);
  f = 1.0/((double)tmp);
  d = (double)data.at(0);
  answer += f*d;
  cout << fixed << setprecision(20);
  cout << answer << endl;
}

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

int main() {
  
  double n;
  cin >> n;
  
  int count = 0;
  
  for ( int i = 1; i <= n ; i++){
    if ( i % 2 != 0 ){
      count++;
    }
  }
  
  cout << count / n << endl;
 
  
}



Measured memory_bytes: 256
local function str2tbl(s)
    local t = {string.byte(s, 1, #s)}
    for i=1, #t do
        t[i] = string.char(t[i])
    end
    return t
end

-- http://www.lua.org/pil/11.4.html
local function List_new()
    local tbl = {}
    local first = 1
    local last = 0
    local function count()
        return last - first + 1
    end
    local function pushright(value)
        local new_last = last + 1
        last = new_last
        tbl[last] = value
    end
    local function popleft(value)
        --if first > last then error("list is empty") end
        local value = tbl[first]
        tbl[first] = nil
        first = first + 1
        return value
    end
    return pushright, popleft, count
end

------
local H, W = io.read("*n", "*n", "*l")
local grid = {}
for i=1, H do
    grid[i] = str2tbl(io.read("*l"))
end
--[[
for i=1, H do
    for j=1, W do
        print(i,j, grid[i][j])
    end
end
]]
local loops = 0
local count = 0
local blacks_pushright, blacks_popleft, blacks_count = List_new()
local blacks_used = {}
for i=1, 1000*1000 + 1000 do
    blacks_used[i] = false
end
local function not_blacks_used(i, j)
    if not blacks_used[i*1000+j] then
        blacks_used[i*1000+j] = true
        return true
    end
    return false
end
for i=1, H do
    for j=1, W do
        local c = grid[i][j]
        loops = loops + 1
        if c == '#' then
            if not_blacks_used(i, j) then
                blacks_pushright({i, j})
            end
        end
    end
end

local cur_count = 0
while blacks_count() > 0 do
    for bc=blacks_count(),1,-1 do
        local t = blacks_popleft()
        local i, j = t[1], t[2]
        for dyx=0,3 do
            local y01, x01 = dyx/2 - dyx/2%1, dyx%2
            local dy = y01 * (-1 + 2 * x01)
            local dx = (1 - y01) * (-1 + 2 * x01)
            --print(dyx,y01,x01,dy,dx)
            local x = i + dx
            local y = j + dy
            if x >= 1 and x <= H and y >= 1 and y <= W then
                if not_blacks_used(x, y) then
                    blacks_pushright({x, y})
                end
            end
        end
    end
    count = count + 1
end
print(count-1)

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

#define RESIDUE(u,v) (capacity[u][v] - flow[u][v])
#define RCOST(u,v) (cost[u][v] + h[u] - h[v])
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define LL long long

void disp(vector<int> v){
  for(int i=0;i<v.size();i++){
    cout << v[i] << " ";
  }
  cout<<endl;
}

template <typename T>
class undigraph {
public:
  struct edge{
    int from;
    int to;
    T cost;
  };
  
  vector< vector<int> > v;
  vector<edge> edges;

  int n;

  undigraph(int n){
    v.resize(n);
  }

  void add(int from,int to,T cost = 1){
    v[from].push_back(edges.size());
    v[to].push_back(edges.size());
    edges.push_back({from, to, cost});
  }
};

template <typename T>
vector <T> dijkstra(const undigraph<T> &g, int start) {
  vector<T> dist(g.n, numeric_limits<T>::max());
  priority_queue<pair<T, int>, vector<pair<T, int> >, greater<pair<T, int> > > s;
  dist[start] = 0;
  s.emplace(dist[start], start);

  while(!s.empty()){
    /*
    cout<<dist[0] << " " <<dist[1]<< " " <<dist[2]<< " " <<dist[3]<< " " <<dist[4]<< " " <<dist[5]<< " " <<dist[6] <<endl;
    cout<<s.top().first << " "<<s.top().second <<endl;
    */
    int expected = s.top().first;
    int base = s.top().second;
    /*
    if(expected != dist[base]){
      continue;
    }
    */
    s.pop();
    for(int id:g.v[base]){
      auto &e = g.edges[id];
      int to = base ^ e.from ^ e.to;
      if(dist[base] + e.cost < dist[to]){
	dist[to] = dist[base] + e.cost;
	s.emplace(dist[to],to);
      }
    }
  }
  return dist;
}

int i,j;

int main(){
  int n,m,a,b;
  cin>>n>>m;
  undigraph<int> g(n);
  g.n=n;
  REP(i,m){
    cin>>a>>b;
    g.add(a-1,b-1);
  }
  int ret=0;
  REP(i,m){
    g.edges[i].cost = 100000;
    //cout<<"dbg " << g.edges[i].from <<" " <<  g.edges[i].to<<endl;
    vector<int> dist = dijkstra(g,0);
    //cout<<"dbg " << g.edges[i].from <<" " <<  g.edges[i].to<<endl;
    REP(j,n){
      if(dist[j] >= 100000){
	//cout<<"dbg"<<endl;
	ret++;
	break;
      }
    }
    g.edges[i].cost = 1;
  }
  cout<<ret<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int main(){
    string s,t;
    cin >> s >> t;
    map<char,set<int>> mp;
    rep(i,alpha.size()){
        mp[alpha[i]].insert(1e5+5);
    }
    rep(i,s.size()){
        mp[s[i]].insert(i);
    }
    long long ans = 0;
    long long now = -1;
    long long ss = s.size();
    rep(i,t.size()){
        if(mp[t[i]].size()==1){
            cout << -1 << endl;
            return 0;
        }
        int tmp = *mp[t[i]].upper_bound(now);
        if(tmp==1e5+5){
            ans++;
            now = *mp[t[i]].begin();
        }
        else{
            now = tmp;
        }
    }
    cout << ans*ss+now+1 << endl;
}

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

int main()
{
	int n, m;
	cin >> n >> m;
	vector<int> array(n);

	for (int i = 0; i < m; i++)
	{
		int a, b;
		cin >> a >> b;
		array.at(a - 1) += 1;
		array.at(b - 1) += 1;
	}
	for (int l = 0; l < n; l++)
		cout << array.at(l) << endl;

	return (0);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define ii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define INF 100000000000000000
#define modulo 1000000007
#define mod 998244353
#define int long long int
using namespace std;


int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int a, b, c, d, k;
	cin >> a >> b >> c >> d >> k;

	a = a * 60 + b;
	c = c * 60 + d;

	cout << c - a - k;
}

Measured memory_bytes: 3612
package main

import (
        "fmt"
)

func solution(n, m int, lr [][]int) int {
        lo, hi := -1<<31, 1<<31
        for i := 0; i < m; i++ {
                lo = max(lo, lr[i][0])
                hi = min(hi, lr[i][1])
        }
        out := hi - lo + 1
        if out < 0 {
                return 0
        }
        return out
}

func min(x, y int) int {
        if x < y {
                return x
        }
        return y
}

func max(x, y int) int {
        if x > y {
                return x
        }
        return y
}

func main() {
        var n, m int
        fmt.Scan(&n, &m)
        lr := make([][]int, m)
        for i := 0; i < m; i++ {
                l, r := 0, 0
                lr[i] = make([]int, 2)
                fmt.Scan(&l, &r)
                lr[i][0], lr[i][1] = l, r
        }
        fmt.Println(solution(n, m, lr))
}

Measured memory_bytes: 6784
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <cmath>
#include <cctype>
#include <map>

const int INT_INF = 1000000000;                 // 10^9
const long long LONG_INF = 1000000000000000000; // 10^18

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;

    for (int i = 0; i < m; i++)
    {
        int a;
        cin >> a;
        n -= a;
    }

    if (n < 0)
    {
        cout << -1 << endl;
    }
    else
    {
        cout << n << endl;
    }

    return 0;
}

Measured memory_bytes: 3636
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv)
{
	char a[3];
	scanf("%s",a);
	if(a[0]=='9' || a[1] == '9'){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define MAX 100005

int n,a,b,c;
vector<int> G[MAX];
int size[MAX];
int par[MAX];
int dep[MAX];
int depth[MAX];
int parent[MAX];

void idfs(int pos,int prev){
  int m=-1;
  parent[pos]=prev;
  if(G[pos].empty())return;
  for(int i=0;i<(int)G[pos].size();i++){
    int to=G[pos][i];
    if(to==prev)continue;
    depth[to]=depth[pos]+1;
    idfs(to,pos);
    size[pos]+=size[to];
    if(m==-1||size[m]<size[to]){
      m=to;
    }
  }
  par[m]=pos;
}

int calc(int x){
  if(par[x]==x)return x;
  return par[x]=calc(par[x]);
}

void init(){
  for(int i=0;i<MAX;i++){
    size[i]=1;
    par[i]=i;
  }
  for(int i=0;i<n;i++){    
    scanf("%d",&a);
    while(a--){
      scanf("%d",&b);
      G[i].push_back(b);
    }
  }
  
  depth[0]=0;
  idfs(0,-1);
  for(int i=0;i<n;i++){
    calc(i);
    int p=par[i];
    while(p>0){
      p= par[ parent[p] ];      
      dep[i]++;
    }
  }  
}

int main(){
  while( scanf("%d",&n)!=EOF){
    init();
    int q;
    scanf("%d",&q);
    while(q--){
      scanf("%d %d",&a,&b);

      while(par[a]!=par[b]){
        if(dep[a]<dep[b])swap(a,b);
        a=parent[par[a]];
      }
      printf("%d\n",(depth[a]<depth[b]?a:b));      

    }
    break;
  }

  
  return 0;
}

Measured memory_bytes: 16028
n,d = gets.split.map(&:to_i)
x = []
y = []
n.times do
    line = gets.split.map(&:to_i)
    x << line.shift
    y << line
end
y.flatten!

ans = []

(0...n).each do |i|
    ans << Math.sqrt(x[i].abs ** 2 + y[i].abs ** 2)
end

result = 0
ans.each do |j|
    if d >= j
        result += 1
    end
end

puts result

Measured memory_bytes: 32200
// template version 1.15
using namespace std;
#include <bits/stdc++.h>

// varibable settings
#define int long long
const int INF=1e18;

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(a, b, c) make_tuple(a, b, c)
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

#define divceil(a,b) ((a)+(b)-1)/(b)
#define is_in(x, a, b) ((a)<=(x) && (x)<(b))
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define slice(l, r) substr(l, r-l)

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
    #include "lib/dump.hpp"
#else
    #define dump(...) 42
    #define dump_1d(...) 42
    #define dump_2d(...) 42
    #define cerrendl 42
#endif
//}}}

int gcd(int a, int b){
    if (b>a) swap(a,b);
    if (b==0) return a;
    return gcd(b, a%b);
}

signed main() {
    int k;cin>>k;

    int ans = 0;
    rep(i, 1, k+1){
        rep(j, 1, k+1){
            rep(h, 1, k+1){
                ans += gcd(gcd(i, j), h);
            }
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3656
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		long n = as.nextLong();
		long l = 1;
		for(int i=1;i<n+1;i++){
			l = l*i%1000000007;
		}
		System.out.println(l);
	}
}


Measured memory_bytes: 23764
input()
a = list(map(int, input().split(" ")))
count = 0
arrayCount = []
for i in range(0, len(a) - 1):
    if a[i] >= a[i + 1]:
        count += 1
    else:
        arrayCount.append(count)
        count = 0
arrayCount.append(count)
print(max(arrayCount))

Measured memory_bytes: 14252
n, m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [0]
for i in a:
    b.append((b[-1] + i) % m)
c = {}
for i in b:
    if i in c:
        c[i] += 1
    else:
        c[i] = 1
d = 0
for i in c:
    d += c[i] * (c[i] - 1) // 2
print(d)

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

int main()
{
	int n;
	string s;
	cin>>n>>s;
	
	int x=0,maxv=0;
	for(int i=0;i<n;i++){
		if(s[i]=='I') x++;
		else x--;
		maxv=max(maxv,x);
	}
	
	cout<<maxv<<endl;
	return 0;
}


Measured memory_bytes: 256
n,m,p = map(int,input().split())
graph = [[] for _ in range(n)]
INF = float("inf")
dist = [INF]*n
dist[0] = 0

for _ in range(m):
	f,t,c = map(int,input().split())
	graph[f-1].append((t-1,p-c))
#print(graph)

for _ in range(n):
	update = False
	for f,e in enumerate(graph):
		for t,c in e:
			if dist[f] != INF and dist[t] > dist[f] + c:
				dist[t] = dist[f] + c
				update = True
	if not update:
		break
else:
	prev = dist[-1]
	for _ in range(n):
		for f,e in enumerate(graph):
			for t,c in e:
				if dist[f] != INF and dist[t] > dist[f] + c:
					dist[t] = -INF
	if dist[-1] != prev:
		print(-1)
		exit()
#print(dist)

print(max(0,dist[-1]*(-1)))

Measured memory_bytes: 54616
n = int(input())
ls_w = list(map(int, input().split()))

s0 = 0
for i in range(n):
    s0 += ls_w[i]

for t in range(n):
    s1, s2 = 0, 0
    for j in range(0, t):
        s1 += ls_w[j]
    for k in range(t, n):
        s2 += ls_w[k]
    if abs(s2 - s1) <= s0:
        s0 = abs(s2 - s1)
print(s0)

Measured memory_bytes: 3064
#include<stdio.h>

int main() {
	char a[5];
	int ans = 0;
	for (int i = 0; i < 4; i++) {
		scanf("%c", &a[i]);
		
	}
	for (int i = 0; i < 4; i++) {
		if (a[i] == '+')ans++;
		if (a[i] == '-')ans--;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 128
/*
**    Author : Dhiraj Govindvira
**      Date : 09-Sep-2020 ~ Wednesday
**      Time : 08:42:04 PM
*/

#ifdef Dhiraj
    #include "D:/dhiraj/Programming/debug.h"
#else
    #include <bits/stdc++.h>
    using namespace std;
    #define d(...) 11
    #define cerr if(0) cerr
#endif

// Macro --------------------------------------------------------------------

#define ll                  long long int
#define FOR(i, a, b, s)     for(ll i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define FOR1(b)             FOR(i, 0, b, 1)
#define FOR2(i, b)          FOR(i, 0, b, 1)
#define FOR3(i, a, b)       FOR(i, a, b, (a) <= (b) ? 1 :-1)
#define FOR4(i, a, b, s)    FOR(i, a, b, s)
#define GET5(a, b, c, d, e, ...) e
#define FORC(...)           GET5(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)
#define loop(...)           FORC(__VA_ARGS__)(__VA_ARGS__)
#define all(x)              x.begin(), x.end()
#define rall(x)             x.rbegin(), x.rend()
#define endl                '\n'

// Template -----------------------------------------------------------------

// multiple input
template <typename... T> 
inline void inp(T&... args) {
    ((cin >> args), ...);
}
// scan vector
template <typename T> 
inline istream& operator >>(istream &in, vector<T> &a) {
    for(auto &x : a) in >> x;
    return in;
}
// scan pair
template <typename T, typename U> 
inline istream& operator >>(istream &in, pair<T, U> &a) {
    in >> a.first >> a.second; 
    return in;
}

// Solve --------------------------------------------------------------------

void solve(int &T)
{
    ll n, d;
    cin >> n >> d;

    ll ans = 0;
    loop(n) {
        ll x, y;
        cin >> x >> y;
        ans += (x * x + y * y <= d * d);
    }
    cout << ans << endl;
}

// Main ---------------------------------------------------------------------

int main()
{
    #ifdef Dhiraj
        freopen("D:/dhiraj/Programming/i1.txt", "r", stdin);
        freopen("D:/dhiraj/Programming/o1.txt", "w", stdout);
        // freopen("D:/dhiraj/Programming/e1.txt", "w", stderr);
    #endif

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

    int t = 1;
    for(int i = 1; i <= t; i++) {
        cerr << "Case #" << i << "\n";
        solve(i);
    }
    return 0;
}

Measured memory_bytes: 3560
def combinations_count(all, pick=2):
    tmp_p = [x for x in range(all, all-pick, -1)]
    tmp = [x for x in range(pick, 0, -1)]
    return int(eval("*".join(map(str,tmp_p))) / eval("*".join(map(str,tmp))))

N = int(input())
s = {}
for n in range(N):
    tmp = "".join(sorted(list(input())))
    if tmp in s:
        s[tmp] = s[tmp] + 1
    else:
        s[tmp] = 0


ans = 0
for val in s.values():
    if val != 0:
        ans += combinations_count(val+1)
print(ans)

Measured memory_bytes: 17932
/*  Bismillahir Rahmanir Rahim
 *  Author: Md Asfakur Rahat.
 *  asfakurrahat7@gmail.com
 *  BUBT
*/
#include<bits/stdc++.h>

using namespace std;


char Uplowch(char ch){if(ch >= 'A' &&  ch <= 'Z') ch += 32; return ch;}
char Lowupch(char ch){if(ch >= 'a' &&  ch <= 'z') ch -= 32; return ch;}
bool Isalpha(char ch){if((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) return true; return false;}
int Strtoint(string str){stringstream ss(str);int x = 0;ss >> x ;return x ;}
string Intostr(int x){stringstream ss; ss << x; string str = ss.str(); return str;}


#define     O_0_O               ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define     ll                  long long
#define     nl                  '\n'
#define     fa                  ' '
#define     ff                  first
#define     ss                  second
#define     floop(begin,end,k)  for(k=begin;k<end;k++)
#define     rloop(end,begin,k)  for(k=begin-1;k>=end;k--)
#define     all(p)              (p).begin(),(p).end()
#define     sz(a)               (ll)a.size()
#define		gcd(a,b)            __gcd(a,b)
#define		lcm(a,b)            (a*b)/gcd(a,b)
#define     sqr(a)              (a)*(a)
#define     cube(a)             (a)*(a)*(a)
#define     pb                  push_back
#define     pi                  acos(-1.0)
#define     Mx                  1e6+5
#define     vi                  vector<int>
#define     vll                 vector<ll>
#define     vc                  vector<char>
#define     vs                  vector<string>
#define     tem                 template<class T
#define     r(a)                cin>>a
#define     write(a)            cout<<a
#define     test(t)             cin>>t;while(t--)
#define     haha                cout<<"YES"<<nl
#define     nono                cout<<"NO"<<nl


void  inline File_Read()
{
        /// File Reader.......................
        #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
        #endif
}


tem>T abs(T a){ return (a<0?-a:a);}

bool matchs(string s,string p){int i,len=sz(p);floop(0,sz(s)-len,i){if(p==s.substr(i,len))return true;}return false;}


typedef string str;
typedef double ld;



ll arll[100010];
int ari[100010];
char arc[100005];
map<char,int>mci;
map<string,int>msi;
map<int,int>mii;

/// For loop Variable

ll i,j,k,tc;

int main()
{
        //File_Read();
        /// Optimizer...............
        O_0_O;
        /// Main code............
        /// Created:
		ll n;
		cin>>n;
		ll ans=0;
		floop(1,n+1,i)
		{
			if(i%3!=0 && i%5!=0 )
				ans+=i;
		}
		cout<<ans<<nl;
        return 0;
}


Measured memory_bytes: 3664
#ALDS1_8_B
class Node:
    def __init__(self, key):
        self.key = key
        self.parent = None
        self.left = None
        self.right = None

class Tree:
    def __init__(self):
        self.root = None
        self.list = []
    
    def insert(self, node_tobe_added):
            y = None #「xの親」って書いてあるけど、「zの親」では？
            x = self.root
            while x != None:
                #ここで親を設定する。xを一つずつ葉に進めて、yに代入する。yがｚの親になる。
                y = x
                if node_tobe_added.key < x.key:
                    x = x.left
                else:
                    x = x.right
            #ここでyがzの親に設定される。
            node_tobe_added.parent = y 
            
            #yがNoneなら何もないということなのでzがrootになる。
            if y == None:
                self.root = node_tobe_added
            elif node_tobe_added.key < y.key:
                #node_tobe_addedをyの左の子にする
                y.left = node_tobe_added
            else:
                #node_tobe_addedをyの右の子にする
                y.right = node_tobe_added
                
    def find(self, key):
        x = self.root
        while x != None and key != x.key:
            if key < x.key:
                x = x.left
            else:
                x = x.right
        return x
                
    def preParse(self, node):
        if node == None:
            return
        self.list.append(node.key)
        self.preParse(node.left)
        self.preParse(node.right)
    
    def inParse(self, node):
        if node == None:
            return
        self.inParse(node.left)
        self.list.append(node.key)
        self.inParse(node.right)

T = Tree()

N = int(input())
for i in range(N):
        order, *key = input().split() #printの場合はkeyがないので、*をつけて配列として扱う。
        if order == "print":
            T.list = []
            T.inParse(T.root)
            print(" " + " ".join(map(str, T.list)))
            T.list = []
            T.preParse(T.root)
            print(" " + " ".join(map(str, T.list)))
        elif order == "insert":#insertの場合
            T.insert(Node(int(key[0]))) #なぜかわからないがintにしないとWAになる。
        else:
            if T.find(int(key[0])):
                print("yes")
            else:
                print("no")


Measured memory_bytes: 118468
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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

		Scanner sc = new Scanner(System.in);
		List<String> k = new ArrayList<String>();
		while (true) {
			String line = sc.nextLine();
			k.add(line);
			if (line.equals("-1 -1 -1")) {
				break;
			}
		}
		for (String string : k) {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		}

	}

}

Measured memory_bytes: 25996
def myinput(rownum):
    res = []
    for i in range(rownum):
        temp = input().split(" ")
        res += temp
    return res

def main():
    r = myinput(2)
    n = r[0]
    k = r[1]
    h = r[2:]
    count = 0
    for i in h:
        if int(i) >= int(k):
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Measured memory_bytes: 48036
#include<cstdio>
#include<iostream>
using namespace std;
const int MAXN = 100010;
const int MOD = 1e9+7;
int n;
struct edge{
	int next, to;
	edge(int N=0,int T=0):next(N),to(T){}
}e[MAXN<<1];
int fir[MAXN], num = 0;
inline void join(int a,int b){e[++num]=edge(fir[a],b);fir[a]=num;}
int f[MAXN][2];
void dfs(int u, int fa)
{
	f[u][0] =1ll; f[u][1] = 1ll;
	for(int i=fir[u];i;i=e[i].next)
	{
		int v = e[i].to;
		if(v == fa)continue;
		dfs(v, u);
		f[u][1] = 1ll*f[u][1]*f[v][0]%MOD;
		f[u][0] = 1ll*f[u][0]*(1ll*f[v][0]+f[v][1])%MOD; 
	}
}
int main()
{
	scanf("%d",&n);
	for(int i=1,a,b;i<n;i++)
		scanf("%d%d",&a,&b),join(a,b),join(b,a);
	dfs(1, 0);
	printf("%d\n",(1ll*f[1][0]+f[1][1])%MOD);
	return 0;
}

Measured memory_bytes: 8576
import java.io.InputStream;
import java.io.IOException;
import java.util.NoSuchElementException;

public class Main {
    public static void main(final String[] args) {
        final MyScanner sc = new MyScanner();
        final int n = sc.nextInt();
        System.out.println(n / 2 + n % 2);
    }
}

class MyScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int pointer = 0;
    private int bufLength = 0;

    private boolean hasNextByte() {
        if (pointer < bufLength) {
            return true;
        } else {
            pointer = 0;
            try {
                bufLength = in.read(buffer);
            } catch (final IOException e) {
                e.printStackTrace();
            }
            if (bufLength <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte()) {
            return buffer[pointer++];
        } else {
            return -1;
        }
    }

    private static boolean isNumberChar(final int c) {
        return '0' <= c && c <= '9';
    }

    private static boolean isPrintableChar(final int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[pointer])) {
            pointer++;
        }
        return hasNextByte();
    }

    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        final StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long num = 0;
        boolean isNegative = false;
        int b = readByte();
        if (b == '-') {
            isNegative = true;
            b = readByte();
        }
        if (!isNumberChar(b)) {
            throw new NumberFormatException();
        }
        while (true) {
            if (isNumberChar(b)) {
                num *= 10;
                num += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return isNegative ? -num : num;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        final long temp = nextLong();
        if (temp < Integer.MIN_VALUE || Integer.MAX_VALUE < temp) {
            throw new NumberFormatException();
        }
        return (int) temp;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 32420
#include<cstdio>
#include<queue>
#include<vector>
#include<cstring>
#include<map>
#include<set>
#define maxn 1000005
#define INF 0x3f3f3f3f
using namespace std;
typedef pair<int,int> PII;
int n,m,cnt,dist[maxn],fa[maxn];
vector<int> G[maxn];
queue<int> q;
map<int,int> id[maxn];
int find(int x)
{
	if(fa[x]==x) return x;
	return fa[x]=find(fa[x]);
}
void bfs()
{
	dist[1]=0;
	q.push(1);
	while(!q.empty())
	{
		int u=q.front(); q.pop();
		for(int i=0;i<G[u].size();i++)
		{
			int v=find(G[u][i]);
			if(dist[v]<0)
			{
				dist[v]=dist[u]+1;
				q.push(v);
			}
		}
	}
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<maxn;i++) fa[i]=i;
	for(int i=1;i<=n;i++) id[i][0]=++cnt;
	memset(dist,-1,sizeof(dist));
	for(int i=1;i<=m;i++)
	{
		int u,v,c;
		scanf("%d%d%d",&u,&v,&c);
		if(!id[u][c]) id[u][c]=++cnt;
		u=find(id[u][c]);
		if(!id[v][c]) id[v][c]=++cnt;
		v=find(id[v][c]);
		fa[v]=u;
	}
	for(int i=1;i<=n;i++)
		for(map<int,int>::iterator it=id[i].begin();it!=id[i].end();it++)
		{
			int f1=find(it->second);
			G[i].push_back(f1);
			G[f1].push_back(i);
		}
	bfs();
	printf("%d\n",dist[n]==-1?(-1):(dist[n]/2));
}

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


#define long long ll;


/*

int main() {
	cin >> N >> S;
	for (int i = 0; i < 1000; i++) {
		int c[3] = {i / 100, (i / 10) % 10, i % 10};
		int f = 0;
		for (int j = 0; j < N; j++) {
			if (S[j] == ('0' + c[f])) f++;
			if (f == 3) break;
		}
		if (f == 3) cnt++;
	}
	cout << cnt << endl;
	return 0;
}




int main(){


 long long n;
 cin>>n;

 int enable = 0; long long price=0;

 for(long long i=1;i<=n;i++){


    if( (int)(i*1.08) == n){

        enable = 1;
        price = i;
         break;
        }
 }

  //cout<<price<<" "<<enable<<endl;

 if(enable == true)
    cout<<price<<endl;
 else
    cout<<":("<<endl;

return 0;
}

*/


int main(){

 int n; cin>>n;
  int k = n/100;

  if(n >= 100*k && n<= 105*k)
    cout<<"1"<<endl;
  else cout<<"0"<<endl;

 return 0;
}
















Measured memory_bytes: 256
#include<stdio.h>

int Search(int key, int A[], int n)
{
  int left, right, mid;
  left = 0;
  right = n;
  while(left < right)
    {
      mid = (left + right) / 2;
      if(A[mid] == key)
	{
	  return 1;
	}
      else if(key < A[mid])
	{
	  right = mid;
	}
      else
	{
	  left = mid + 1;
	}
    }
  return 0;
}
int main()
{
  int n, i, S[100000], q, key, sum = 0;
  scanf("%d", &n);
  for(i = 0; i < n; i++)
    {
      scanf("%d", &S[i]);
    }
  scanf("%d", &q);
  for(i = 0; i < q; i++)
    {
      scanf("%d", &key);
      if(Search(key, S, n))
	{
	  sum++;
	}
    }
  printf("%d\n", sum);
  return 0;
}



Measured memory_bytes: 2140
/**************************************************************************
Coded by: Saba Karimi(_VINTAGE)
Institution: AIT PUNE
***************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back 
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define ld long double
#define int long long int 
#define F first 
#define S second
/**************************************************************************/
signed main() 
{
    fast;
    int n;
    cin>>n;
    int a[n+1];
    for(int i=1;i<=n;i++)
        cin>>a[i];
    int pre[n+1]={};
    for(int i=n;i>=2;i--)
    {
        pre[i] = a[i]-a[i-1];
    }
    pre[1] = a[1];
    int ans = 0;
    for(int i=1;i<=n;i++)
        if(pre[i]>0)
            ans+=pre[i];
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
/*
*/

#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd
#define prev asdgSHJsfgsdfhdsh

#define eps 1e-8
#define M_PI 3.141592653589793
#define bsize 512

#define ldouble long double
using namespace std;

#define bs 1000000007

const int N = 1200031;

int n,c,D[531][531],cnt[531][531];

int main(){
//	freopen("apache.in","r",stdin);
//	freopen("apache.out","w",stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
//	cin.tie(0);

	cin>>n>>c;

	for (int i=1;i<=c;i++){
		for (int j=1;j<=c;j++){
			cin>>D[i][j];
		}
	}

	for (int i=1;i<=n;i++){
		for (int j=1;j<=n;j++){
			int v;
			cin>>v;
			cnt[(i+j)%3][v]++;
		}
	}

	long long ans=1e9;

	for (int c1=1;c1<=c;c1++){
		for (int c2=1;c2<=c;c2++){
			for (int c3=1;c3<=c;c3++){
				if (c1==c2||c1==c3||c2==c3)
					continue;
				long long here=0;
				for (int q=1;q<=c;q++){
					here+=cnt[1][q]*D[q][c1]+cnt[2][q]*D[q][c2]+cnt[0][q]*D[q][c3];
				}
				ans=min(ans,here);
			}
		}
	}

	cout<<ans<<endl;

//	cin.get(); cin.get();
	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll N=2e5+5;
char a[N];
ll prfx[N],sfx[N],n,ans=N;
int main(){
    cin.tie(NULL); cout.tie(NULL);
    ios_base:: sync_with_stdio(false);
    cin>>n;
    for(ll i=1;i<=n;i++)cin>>a[i];
    for(ll i=1;i<=n;i++)prfx[i]=prfx[i-1]+(a[i]=='#');
    for(ll i=n;i>=1;i--)sfx[i]=sfx[i+1]+(a[i]=='.');
    for(ll i=0;i<=n;i++)ans=min(ans , prfx[i] + sfx[i+1] );
    cout<<ans;
}





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

int main() {
  string osr;
  char ans;

  cin >> osr;
  int size = osr.size();

  if(osr[0] == 'x' && osr[size-1] == 'x')
    ans	= 'x';
  else
    ans = 'o';

  cout << ans << endl;

  return 0;
}




Measured memory_bytes: 3192
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

#define all(v) v.begin(), v.end()

const ll mod=1000000007;

ll countBits(ll in){
  int res=0;
  for(;in>0;in>>=1){
    if((in&0x01)!=0){
      res++;
    }
  }
  return res;
}

template<typename T>
void show2dVector(vector<vector<T>>& v){
  for(int i=0;i<v.size();i++){
    int m=v[i].size();
    cout<<i<<" : ";
    for(int j=0;i<m;i++){
      cout<<v[i][j]<<" ";
    }
    cout<<endl;
  }
}

void bfs(const vector<vector<int>>&g, int v, vector<bool>& seen){
  seen[v]=true;
  cout<<v<<" ";
  for(auto next: g[v]){
    if(seen[next]){
      continue;
    }
    bfs(g,next,seen);
  }
}

bool dfs(vector<vector<int>> &g,int start,int goal,vector<bool>&seen){
  bool res=false;
  seen[start]=true;
  if(start==goal){
    return true;
  }
  for(auto next: g[start]){
    if(seen[next]){
      continue;
    }
    res=dfs(g,next,goal,seen);
    if(res){
      break;
    }
  }
  return res;
}

ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}

char toLowerCase(char c){
  if(isLowerCase(c)){
    return c;
  }else{
    return c+'a'-'A';
  }
}
char toUpperCase(char c){
  if(isLowerCase(c)){
    return c-('a'-'A');
  }else{
    return c;
  }
}
ll powm(ll a,ll n, ll m){
  ll ret=1;
  while(n>0){
    if(n%2==1){
      ret=(ret*a)%m;
    }
    n>>=1;
    a=(a*a)%m;
  }
  return ret;
}

const string yesno(bool ans){
  return (ans?"Yes":"No");
}
void func(vector<int>& l, int depth, int idx){
  ;
}
int main() {
  int h,w,n;cin>>h>>w>>n;
  int val=max(h,w);
  int ans=(n+val-1)/val;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3564
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>

using namespace std;
#define vsort(v) sort(v.begin(), v.end());
#define vunique(v) unique(v.begin(), v.end());

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

	int M;
	cin >> M;
	cout << 24 - M + 24 << endl;
}


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

struct node{
  unsigned int key;
  struct node *next;
  struct node *prev;
};

typedef struct node *NodePointer;

NodePointer nil;

NodePointer listSearch(int key){
  NodePointer p;
  for(p=nil->next;p!=nil;p=p->next){
    if(p->key==key) return p;
  }

  return NULL;
}

void init(){
  nil = malloc(sizeof(struct node));
  nil->next= nil;
  nil->prev=nil;
}

void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if(cur == nil) break;
    if(isf==0) printf(" ");
    printf("%d",cur->key);
    cur= cur->next;
    isf=0;
  }
  printf("\n");
}

void deleteNode(NodePointer t){
  t->prev->next=t->next;
  t->next->prev=t->prev;

  free(t);

  return;
}

void deleteFirst(){
  NodePointer t= nil->next;
  if(t==nil) return;
  deleteNode(t);
}

void deleteLast(){
  NodePointer t=nil->prev;
  if(t==nil) return;
  deleteNode(t);
}

void delete(int key){
  NodePointer t;
  t=listSearch(key);
  if(t==NULL) return;
  else deleteNode(t);

  return;
}

void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key=key;

  x->prev=nil;
  x->next=nil->next;
  nil->next->prev=x;
  nil->next=x;
}


int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {insert(key); np++; size++;}
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
	if ( com[6] == 'F' ) deleteFirst();
	else if ( com[6] == 'L' ) deleteLast();
      } else {
	delete(key); nd++; 
      }
      size--;
    }
  }

  printList();
  return 0;
}



Measured memory_bytes: 32952
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
using Graph = vector<vector<int> >;


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

template<class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template<class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template<class T, class V>
typename enable_if<is_class<T>::value == 0>::type fill(T &t, const V &v) {
    t = v;
}
template<class T, class V>
typename enable_if<is_class<T>::value != 0>::type fill(T &t, const V &v){
    for (auto &e : t) fill(e, v);
}

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }



Graph G;
vector<int> deg;
vector<bool> seen;

int main() {
    int N; cin >> N;
    G.assign(N, vector<int>());
    deg.assign(N, 0);
    seen.assign(N, 0);
    for (int i = 0; i < N-1; ++i) {
        int a, b; cin >> a >> b; --a, --b;
        G[a].push_back(b);
        G[b].push_back(a);
        deg[a]++, deg[b]++;
    }
    bool res = true;
    queue<int> que;
    for (int i = 0; i < N; ++i) if (deg[i] == 1) que.push(i);
    while (!que.empty()) {
        int v = que.front(); que.pop();
        if (seen[v]) continue;
        seen[v] = true;

        //COUT(v);
        
        int nv = -1;
        for (auto e : G[v]) if (!seen[e]) nv = e;
        if (nv == -1) {
            res = false;
            break;
        }
        seen[nv] = true;
        for (auto nv2 : G[nv]) {
            if (seen[nv2]) continue;
            deg[nv2]--;
            if (deg[nv2] == 1) que.push(nv2);
        }

        //COUT(nv);
    }
    if (res) cout << "Second" << endl;
    else cout << "First" << endl;
}


Measured memory_bytes: 6400