akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n * m) / gcd(n, m);//gl=xy
}
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
using namespace std;

//ここから

void solve(){
  ll n,k;
  cin>>n>>k;
  vector<ll>a(n);
  map<ll,ll>mp;
  rep(i,n)cin>>a[i],mp[a[i]]++;
  vector<ll>v;
  for(auto x:mp){
    v.pb(x.second);
  }
  sort(all(v));
  int ans=0;
  rep(i,v.size()-k)ans+=v[i];
  cout<<ans;
}

int main(){
	ios::sync_with_stdio(false);
  cin.tie(0);
	cout<<fixed<<setprecision(15);
  solve();
	return 0;
}


Measured memory_bytes: 16500
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <map>
#include <queue>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int W,H;
vector<vector<int>> C;
void dfs(int v, int w) {
  C[v][w] = 0;
  for(int dh = -1; dh <= 1; dh++) {
    for(int dw = -1; dw <= 1; dw++) {
      if(v+dh < 0 || v+dh >= H || w+dw < 0 || w+dw >= W) {continue;}
      if(C[v+dh][w+dw] == 0) {continue;}
      dfs(v+dh, w+dw);
    }
  }
}


int main() {

  while(cin >> W >> H) {
    if(W == 0 && H == 0) {break;}
    C.assign(H, vector<int>(W, 0));
    rep(i,H) {
      rep(j, W) {
        //int a;
        cin >> C[i][j];
      }
    }
    int count = 0;
    rep(i,H) {
      rep(j, W) {
        if(C[i][j] == 0) {continue;}
        dfs(i,j);
        count++;
      }
    }
    cout << count << endl;
  }
}


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

using namespace std;
using ll =long long;
using db = double;
using vll = vector<long long>;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;
const ll INF = 1LL << 60;

//ここから書き始める

struct point{ll x; ll y;};
int main()
{
	cout << setprecision(10);
	ll w, h, n;
	cin >> w >> h >> n;
	vector<point> xy(n);
	vector<ll> one_four(n);
	rep(i,n){
		cin >> xy[i].x >> xy[i].y >>one_four[i];
	}
	ll x1 = 0, x2 = w, y1 = 0, y2 = h;
	rep(i,n){
		if(one_four[i] ==1){
			chmax(x1,xy[i].x);
		}
		else if(one_four[i] == 2){
			chmin(x2,xy[i].x);
		}
		else if(one_four[i] == 3){
			chmax(y1,xy[i].y);
		}
		else if(one_four[i] == 4){
			chmin(y2,xy[i].y);
		}
	}
	ll xrange = max((ll)0,x2-x1);
	ll yrange = max((ll)0,y2-y1);
	ll ans =  0 ;
	//xrange, yrangeどっちかが負だったら処理しないようにする
	if(xrange>=0&&yrange>=0){
		ans = max( xrange * yrange , (ll)0);
	}
	cout << ans << endl;

	
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
main(){
  int N,i,f=1,m=1;
  cin>>N;
  int A[N];
  for(i=0;i<N;i++){
    cin>>A[i];
    if(A[i]==1){f++;if(f>m)m=f;}else{f=1;}
  };
  cout<<m<<endl;
  return 0;
}


Measured memory_bytes: 3092
#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

//abc144C
int main(void) {
  long long n, c, i;
  scanf("%lld", &n);
  for(i=sqrt(n); i > 0; i--)
    if(n % i == 0) break;
  printf("%lld", i + n / i - 2);
}

Measured memory_bytes: 128
n,a,b=map(int,input().split())

if a==0:
    print("0")
    exit()
elif b==0:
    print(n)
    exit()

t1=(n//(a+b))
t2=(n%(a+b))

if t2>a:
    print((t1*a)+a)
else:
    print((t1*a)+t2)

Measured memory_bytes: 3064
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

mod = 10**9+7

X,Y = map(int,input().split())

if abs(X-Y) > 1:
    print("Alice")
else:
    print("Brown")


Measured memory_bytes: 6472
use std::io::{self, BufRead};

fn last_char(a: char, b: char) -> Option<(usize, char)> {
  if a == 'R' && b == 'G' || a == 'G' && b == 'R' {
    Some((2, 'B'))
  } else if a == 'G' && b == 'B' || a == 'B' && b == 'G' {
    Some((0, 'R'))
  } else if a == 'B' && b == 'R' || a == 'R' && b == 'B' {
    Some((1, 'G'))
  } else {
    None
  }
}

fn main() {
  let stdin = io::stdin();
  let mut lines = stdin.lock().lines();
  let n: usize = lines.next().unwrap().unwrap().parse().unwrap();
  let s: Vec<char> = lines.next().unwrap().unwrap().chars().collect();
  let mut memo = vec![vec![0; 3]; n];
  if n < 3 {
    println!("0");
    return;
  }

  memo[n-1][0] = if s[n-1] == 'R' { 1 } else { 0 };
  memo[n-1][1] = if s[n-1] == 'G' { 1 } else { 0 };
  memo[n-1][2] = if s[n-1] == 'B' { 1 } else { 0 };

  for i in 1..n {
    memo[n-i-1][0] = memo[n-i][0] + (if s[n-i-1] == 'R' { 1 } else { 0 });
    memo[n-i-1][1] = memo[n-i][1] + (if s[n-i-1] == 'G' { 1 } else { 0 });
    memo[n-i-1][2] = memo[n-i][2] + (if s[n-i-1] == 'B' { 1 } else { 0 });
  }

  let mut count: usize = 0;
  for i in 0..(n-2) {
    for j in (i+1)..(n-1) {
      if let Some((l, c)) = last_char(s[i], s[j]) {
        let k = j * 2 - i;
        count += memo[j+1][l] - (if k < n && s[k] == c { 1 } else { 0 });
      }
    }
  }
  println!("{}", count);
}

Measured memory_bytes: 2420
# coding: utf-8
# Your code here!
N = int(input())
for i in range(N):
   a, b, c = map(int, input().split())
   if a > b:
      a, b = b, a
   if b > c:
      b, c = c, b
   if a > b:
      a, b = b, a
   if c * c - a * a - b * b == 0:
      print("YES")
   else:
      print("NO")


Measured memory_bytes: 5604
#include<bits/stdc++.h>
using namespace std;
int N;
vector<vector<pair<int,int>>> Data;
bool judge(int bit){
  for(int i=0;i<N;i++){
    if(!(bit&(1<<i)))continue;
    for(auto v:Data[i]){
      int x=v.first;
      int y=v.second;
      if(y==0&&(bit&(1<<x)))return false;
      if(y==1&&!(bit&(1<<x)))return false;
    }
  }
  return true;
}
int main(){
  cin>>N;
  Data.resize(N);
  for(int i=0;i<N;i++){
    int tmp;
    cin>>tmp;
    for(int j=0;j<tmp;j++){
      int a,b;
      cin>>a>>b;a--;
      Data[i].push_back(make_pair(a,b));
    }
  }

int ans=0;
for(int bit=0;bit<(1<<N);bit++){
  if(judge(bit)){
    int cnt=0;
    for(int i=0;i<N;i++){
      if(bit&(1<<i))cnt++;
    }
    ans=max(ans,cnt);
  }
}
cout<<ans<<endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define MOD 1000000007

using namespace std;
using ll = long long;

int main() {
	ll n, ans = 0;
	cin >> n;
	vector<ll> l(n);
	rep(i,n)cin >> l[i];
	//sort(l.begin(), l.end());

	for (int i = 0; i < n - 2; i++) {
		for (int j = i + 1; j < n - 1; j++) {
			for (int k = j + 1; k < n; k++) {
				ll a = l[i], b = l[j], c = l[k];
				if(a != b && b != c && c != a) {
					if(a+b>c&&b+c>a&&c+a>b)ans++;
				}
			}
		}
	}

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


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main()
{
    int n;
    cin >> n;
    int x[n], y[n];
    rep(i, 0, n) {
        cin >> x[i];
        y[i] = x[i];
    }
    sort(y, y + n);
    rep(i, 0, n) {
        if (x[i] <= y[n / 2 - 1]) cout << y[n / 2] << endl;
        else cout << y[n / 2 - 1] << endl;
    }
    return 0;
}


Measured memory_bytes: 3712
<?php
 fscanf(STDIN,"%d%d",$n,$d);
 $c = 0;
 for($i=0;$i<$n;$i++){
    fscanf(STDIN,"%d%d",$x,$y);
    $dis = sqrt($x**2+$y**2);
    if($dis<=$d){
      $c++;
    }
 }

 echo $c;





Measured memory_bytes: 16100
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int ba=0;
	string s,t;
	cin>>s>>t;
	for(int i=0;i<3;i++)
	{
		if(s[i]==t[i])
		{
			ba++;
		}
	}
	cout<<ba;
	return 0;
}

Measured memory_bytes: 256
from collections import deque

Q = [deque() for _ in range(3)]
for i in range(3):
    for s in list(input()):
        Q[i].append(ord(s) - ord('a'))

k = Q[0].popleft()
while len(Q[k]) != 0:
    k = Q[k].popleft()

print('ABC'[k])


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


namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define PB push_back
vector<vint> vv;
vint vis;

int dfs(int a){
	// cout<<a<<endl;
	int ret=0;
	rep(i,vv[a].size()){
		int next=vv[a][i];
		if(vis[next]) continue;
		vis[a]=1;
		ret=max(ret,dfs(next));
		vis[a]=0;
	}
	return ret+1;
}
// int solve2(int st){
        // int ret = 0;
        // rep(i,edge[st].size()){
            // int next = edge[st][i];
            // if(visit[next]==0){
                // visit[next]=1;
                // ret = max(solve2(next)+1, ret);
                // visit[next]=0;
            // }
        // }
        // return ret;
    // }
void mainmain(){
	int n;
	while(cin>>n,n){
		// cout<<n<<endl;
		vv=vector<vint>(100);
		vis=vint(100,0);
		rep(i,n){
			int a,b;
			cin>>a>>b;
			a--;
			b--;
			// cout<<a<<" "<<b<<endl;
			vv[a].PB(b);
			vv[b].PB(a);
		}
		int ans=0;
		rep(i,100) vis[i]=0;
		rep(i,100){
			// cout<<"i "<<i<<endl;
			int t=dfs(i);
			// cout<<i<<" "<<t<<endl;
			ans=max(ans,t);
		}
		cout<<ans<<endl;
	}
}



}
main() try{
    mainmain();
}
catch(...){
}

Measured memory_bytes: 1224
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<string.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
long long int mod=1e9+7;
bool debug=false;
typedef long long ll;
int main(){
	int n;
	cin>>n;
	printf("%.8lf\n",(n-n/2)/(double)n);
	return 0;
}

Measured memory_bytes: 256
<?php
fscanf(STDIN, "%d", $max);
$monster = explode( " ",  trim(fgets(STDIN)) );
sort($monster);

while(true)
{
  $result = array($monster[0]);

  $max = count( $monster );
  for( $i=1; $i<$max; $i++ )
  {
    $tmp = $monster[$i] % $monster[0];
    if( $tmp > 0 ) { $result[] = $tmp; }
  }
  sort($result);
  $monster = $result;
  if( count( $result ) == 1  ) { break; }
}

echo $result[0];

Measured memory_bytes: 18932
#include <stdio.h>


int main(){
	int n[2];
	for (int i = 0; i < 3000; i++) {
		scanf("%d", &n[0]);
		scanf("%d", &n[1]);
		if (n[0] == 0 && n[1] == 0)
			break;
		if (n[0] > n[1]) {
			int s = n[0];
			n[0] = n[1];
			n[1] = s;
		}
		printf("%d %d\n", n[0], n[1]);
	}
	return 0;
}


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

using namespace std;

#define S scanf
#define P printf
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define FI first
#define SE second
#define PI acos(-1)
#define PS push
#define PP pop()
#define PSF push_front
#define PSB push_back
#define PPF pop_front()
#define PPB pop_back()
#define MP make_pair
#define LL long long int
#define ULL unsigned long long int
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>
#define PLI pair<long long int,int>
#define PLL pair<long long int,long long int>
#define MII map<int,int>
#define MSI map<string,int>
#define MIS map<int,string>
#define MLI map<long long int,int>
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)





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






int main()
{
    FAST();

    //    freopen("input.txt","r",stdin);
    //    freopen("input.txt","w",stdout);

    int i,n,ans=1;
    cin >> n;
    for(i=0;i<3;i++)
    {
        ans*=n;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
//Link : https://atcoder.jp/contests/code-festival-2016-qualb/tasks/codefestival_2016_qualB_e

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 400002
#define ALP 26
#define mod 1000000007
int terminal[N];
int nextNode[N][ALP],cc[N];

int alwaysWin[N];
int triePos = 1;

int relation[N][ALP][ALP];
int globalValue[ALP][ALP];

void traverse(int node,char *s,int pos,int id) {
  ++cc[node];
  if(s[pos]==0) {
    terminal[node] = id;
    return;
  }
  int alp = s[pos]-'a';
  ++pos;
  if(nextNode[node][alp]==0) {
    nextNode[node][alp] = triePos++;
  }
  traverse(nextNode[node][alp],s,pos,id);
}

void precompute(int root,int alreadyLoseNumber) {
  int ter = terminal[root];
  if(ter!=0) {
    alwaysWin[ter] += alreadyLoseNumber;
    for(int i=0;i<26;++i) {
      for(int j=0;j<26;++j) {
        if(i!=j) {
          relation[ter][i][j] += globalValue[i][j];
        }
      }
    }
    ++alreadyLoseNumber;
  }
  int tmp[ALP];
  for(int i=0;i<26;++i) {
    tmp[i] = 0;
  }
  for(int i=0;i<26;++i) {
    int node = nextNode[root][i];
    if(node==0) {
      continue;
    }
    tmp[i] = cc[node];
  }
  for(int i=0;i<26;++i) {
    int node = nextNode[root][i];
    if(node==0) {
      continue;
    }
    for(int k=0;k<26;++k) {
      if(i!=k) {
        globalValue[i][k] += tmp[k];
      }
    }
    precompute(node,alreadyLoseNumber);
    for(int k=0;k<26;++k) {
      if(i!=k) {
        globalValue[i][k] -= tmp[k];
      }
    }
  }
}

char tmp[N];

int ord[N];
void solve(){
  int n;scanf("%d ", &n);
  for(int i=1;i<=n;++i) {
    scanf("%s ", tmp);
    traverse(0,tmp,0,i);
  }
  precompute(0,0);
  int q;scanf("%d ", &q);
  while(q--) {
    int k;scanf("%d %s ", &k,tmp);
    for(int i=0;i<26;++i) {
      ord[tmp[i]-'a'] = i;
    }
    int r = 1 + alwaysWin[k];
    for(int i=0;i<26;++i) {
      for(int j=0;j<26;++j) {
        if(i==j) {
          continue;
        }
        if(ord[i]>ord[j]) {
          r += relation[k][i][j];
        }
      }
    }
    printf("%d\n", r);
  }
}

int main() {
    //freopen("input.txt","r",stdin);
    solve();
    return 0;
}


Measured memory_bytes: 281984
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<ll, ll>;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
int Inf = (1 << 30);
ll inf = (1LL << 60);
const int MOD = 1e9 + 7;
int main() {
	string s;
	cin >> s;
	int k;
	cin >> k;
	int i;
	if (s == string(s.size(), s[0])) {
		ll tmp = s.size() * k;
		cout << tmp / 2;
		return 0;
	}
	else if (s[s.size() - 1] != s[0]) {
		ll diff = 0;
		ll streak = 1;
		for (int i = 0; i < s.size() - 1; i++) {
			if (s[i] == s[i + 1]) streak++;
			else {
				diff += streak / 2;
				streak = 1;
			}
		}
		diff += streak / 2;
		ll tmp = diff * k;
		cout << tmp;
		return 0;
	}
	else {
		int left = s.size() - 1;
		int right = 0;
		while (s[s.size() - 1] == s[left - 1]) {
			left--;
		}
		while (s[0] == s[right + 1]) {
			right++;
		}
		string t = "";
		for (i = left; i < s.size(); i++) t += s[i];
		for (i = 0; i < right; i++) t += s[i];
		for (i = right; i < left; i++) t += s[i];
		 // cout << t;
		ll tmp = 0;
		ll streak = 1;
		for (i = 0; i < t.size() - 1; i++) {
			if (t[i] == t[i + 1]) streak++;
			else {
				tmp += streak / 2;
				streak = 1;
			}
		}
		tmp += streak / 2;
		ll ans = tmp * (k - 1);
		 // cout << tmp * (k - 1);
		tmp = 0;
		streak = 1;
		for (i = 0; i < s.size(); i++) {
			if (s[i] == s[i + 1]) streak++;
			else {
				tmp += streak / 2;
				streak = 1;
			}
		}
		ans += tmp;
		cout << ans;
	}
	return 0;
}

Measured memory_bytes: 256
N = int(input())
p = int(input())
ans = p - 1
bottom = 1
for _ in range(N-1):
    p = int(input())
    if p == bottom + 1:
        bottom += 1
    elif p % (bottom+1) == 0:
        ans += p // (bottom+1) - 1
    else:
        ans += p // (bottom+1)
print(ans)



Measured memory_bytes: 9044
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;
const double EPS = 1e-9;

void init() {
    
}

long long dp[55];
vector<int> freeday[35];
void solve(int n) {
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i < 35; i++) {
        freeday[i].clear();
    }
    for (int i = 0; i < n; i++) {
        dp[i] = (1ll << i);
        int m; cin >> m;
        for (int j = 0; j < m; j++) {
            int b; cin >> b;
            freeday[b].emplace_back(i);
        }
    }
    for (int i = 0; i < 31; i++) {
        for (int e1 : freeday[i]) {
            for (int e2 : freeday[i]) {
                if (e1 != e2) {
                    dp[e1] |= dp[e2];
                }
            }
        }
        for (int j = 0; j < 55; j++) {
            if (__builtin_popcountll(dp[j]) == n) {
                cout << i << endl;
                return;
            }
        }
    }
    puts("-1");
}

signed main(void) {
    LL n, m, p, a, b, c, x, y, z, q;
    string s;
    bool f = false;
    init();
    while (cin >> n, n) {
        solve(n);
    }
}

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

#define rng(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define pb push_back
#define eb emplace_back
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed

int main() {
  int b, ans = 0;
  ll n, a;
  //string s;
  cin >> n;
  a = 100;
  while(1){
    a += a / 100;
    ans++;
    if(n <= a){
      cout << ans << endl;
      return 0;
    }
  }
  //((a == b)? "Yes" : "No")
  //for(int i = 0; i < n; i++){}
  cout << "No" << endl;
}

Measured memory_bytes: 3636
// Author : ps41

#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
const ll M = 1e9 + 7, N = 1e6 + 5;
ll a[N];
int main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr);
    ll n;
    cin >> n;
    for (ll i = 3; i <= n; i++)
    {
        ll t = 0;
        for (ll j = i - 3; j >= 3; j--)
        {
            t = (t + a[j]) % M;
        }
        a[i] = (1 + t) % M;
    }
    cout << a[n];
}

Measured memory_bytes: 3656
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
using namespace std;
int main(void){
    int A,B,X;
    cin >>A>>B>>X;
    if( (A+B)>=X&&A<=X){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	if(a==b||b==c||a==c)
	{
		if(a==b&&a==c&&b==c)puts("No");
		else puts("Yes");
	}
	else
	{
		puts("No");
	}
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  	int count=0;
	char s[3];
  	scanf("%s",s);
  	if(s[0]=='a'||s[1]=='a'||s[2]=='a') count++;
  	if(s[0]=='b'||s[1]=='b'||s[2]=='b') count++;
  	if(s[0]=='c'||s[1]=='c'||s[2]=='c') count++;
  	if(count==3) printf("Yes\n");
  	else printf("No\n");
	return 0;
}

Measured memory_bytes: 128
n,k = map(int, input().split())
r,s,p = map(int, input().split())
t = input()
total = 0
pre = 'n'

def JSC(hand):
    if hand == 'r':
        return p
    elif hand == 's':
        return r
    else:
        return s

for i in range(k):
    pre = 'n'
    for j in range(n//k+1):
        l = i+j*k
        if l < n:
            if t[l] != pre:
                total += JSC(t[l])
                pre = t[l]
            else:
                pre = 'n'
print(total)

Measured memory_bytes: 3444
#include<stdio.h>
#include<string.h>
int main()
{
				
				char s[5];
				scanf("%s",s);
				char sat[]="SAT",sun[]="SUN",mon[]="MON"
,tue[]="TUE",wed[]="WED",thu[]="THU",fri[]="FRI";
				if(strcmp(s,sat)==0)printf("1\n");
			else	if(strcmp(s,sun)==0)printf("7\n");				
				else	if(strcmp(s,mon)==0)printf("6\n");						
					else	if(strcmp(s,tue)==0)printf("5\n");				
				else	if(strcmp(s,wed)==0)printf("4\n");		
				else	if(strcmp(s,thu)==0)printf("3\n");		
				else	if(strcmp(s,fri)==0)printf("2\n");		
				
	
				
				{
								
				}
			
				
}

Measured memory_bytes: 1660
// D.

#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <map>

using namespace std;

int main(int argc, char *argv[])
{
	int n, ans = 0;
	cin >> n;
	int a[100001];
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
		if (i > 1 && a[i - 1] == (i - 1) && a[i] == i) {
			++ans;
			swap(a[i - 1], a[i]);
		}
	}
	for (int i = 1; i <= n; ++i) {
		if (a[i] == i) {
			++ans;
		}
	}
	cout << ans << endl;
}


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

int main() {
  vector<int> coms(26), chars(26);
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    fill(chars.begin(),chars.end(),0);
    string s;
    cin>>s;
    for(int j=0;j<s.size();j++){
      int c=s.at(j)-97;
      chars.at(c)++;
    }
    if(i==0){
      coms=chars;
      continue;
    }else{
      for(int j=0;j<26;j++){
        if(coms.at(j)!=chars.at(j)){coms.at(j)=min(coms.at(j),chars.at(j));}
      }
    }
  }
  for(int i=0;i<coms.size();i++){
    char c=i+97;
    int cnt=coms.at(i);
    for(int j=0;j<cnt;j++){
      cout<<c;
    }
  }
  cout<<endl;
}

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

int main() {
    int n,k;
    cin >> n >> k;
    bitset<100> ret;
    ret.reset();
    for (int i=1; i<=k; i++) {
        int d;
        cin >> d;
        for (int j=1; j<=d; j++) {
            int a;
            cin >> a;
            ret.set(a-1);
        }
    }

    int count = 0;
    for (int i=0; i<n; i++) {
        if (ret[i]) {
            count++;
        }
    }
    cout << n - count << endl;
	return 0;
}

Measured memory_bytes: 3192
#include<stdio.h>
#pragma GCC optimize("O2")
#pragma GCC optimize("O3")
#pragma GCC target("avx")
#define rep(i,N) for(int i=0;i<(int)N;i++)
const int MOD=1e9+7;
int A[10000];
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline int MPow(int a,int b){return b?1l*MPow(1l*a*a%MOD,b>>1)*(b&1?a:1)%MOD:1;}
int count(const int prime,const int sz)
{
  int max=0;rep(i,sz){int now=0;while(A[i]%prime==0){now++;A[i]/=prime;}if(max<now)max=now;}return max;
}
int main(void)
{
  int N=IN(),x=0,p=1,q=-1;
  rep(i,N){A[i]=IN();x=(x+1l*MPow(A[i],MOD-2))%MOD;}
  x=1l*x*MPow(2,count(2,N))%MOD;
  x=1l*x*MPow(3,count(3,N))%MOD;
  while(q*q<=1e6)
  {
    p+=6,q+=6;
    x=1l*x*MPow(p,count(p,N))%MOD;
    x=1l*x*MPow(q,count(q,N))%MOD;
  }
  rep(i,N){if(A[i]>1){rep(j,N-1-i){if(A[i]==A[i+j+1]){A[i+j+1]=1;}}x=1l*x*A[i]%MOD;}}
  return printf("%d\n",x),0;
}

Measured memory_bytes: 1616
a, b, c, k = map(int, input().split())
ret = 0

if k > 0:
    if a > k:
        ret = k
    else:
        ret = a
    k = k - a

k = k - b

if k > 0:
    if c > k:
        ret = ret - k
    else:
        ret = ret - c

print("{}".format(ret))

Measured memory_bytes: 9088
fun main(args: Array<String>) {
    codefestival2016qualb_a()
}

fun codefestival2016qualb_a() {
    val s = readLine()!!

    val cf = "CODEFESTIVAL2016"

    val answer = s.withIndex().count { it.value != cf[it.index] }

    println(answer)
}


Measured memory_bytes: 31844
#include<stdio.h>

int main(void) {

  int w,k;
  /*一番目に大きい点数*/
  int max1 = 0;
  /*二番目に大きい点数*/
  int max2 = 0;
  /*三番目に大きい点数*/
  int max3 = 0;
  int i;
  
  for(i=0; i<10; i++) {
    scanf("%d",&w);
    if(max1 <= w) {
      max3 = max2;
      max2 = max1;
      max1 = w;
    }
    else if(max2 <= w) {
      max3 = max2;
      max2 = w;
    }
    else if(max3 <= w) {
      max3 = w;
    }

  }
  printf("%d ",max1+max2+max3);

  max1 = max2 = max3 = 0;
  for(i=0; i<10; i++) {
    scanf("%d",&k);
    if(max1 <= k) {
      max3 = max2;
      max2 = max1;
      max1 = k;
    }
    else if(max2 <= k) {
      max3 = max2;
      max2 = k;
    }
    else if(max3 <= k) {
      max3 = k;
    }

  }
  printf("%d\n",max1+max2+max3);


  return 0;
}

Measured memory_bytes: 596
import itertools


x, y, z, k = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
AB = [a + b for (a, b) in list(itertools.product(A, B))]
AB.sort(reverse=True)
ABC = [ab + c for (ab, c) in list(itertools.product(AB[:k], C))]
ABC.sort(reverse=True)

for i in range(k):
    print(ABC[i])


Measured memory_bytes: 273608
//D
#include <iostream>
#include <algorithm>
using namespace std;

const int N=2333;
typedef long long LL;
const int INF=0x3f3f3f3f;
LL num[N];

int main(){
    LL n,z,w;
    cin>>n>>z>>w;
    for(LL i=1;i<=n;i++) cin>>num[i];
    if(n==1) cout<<abs(num[1]-w)<<endl;
    else cout<<max(abs(num[n]-w),abs(num[n-1]-num[n]))<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int n,m,k,i,j,map[105][105],x,y,z;
int main()
{
	ios::sync_with_stdio(0);
	cin>>n>>m>>k;
	x=1;y=1;
	for (i=1;i<=k;i++)
	{
		cin>>z;
		while (z--)
		{
			map[x][y]=i;
			if (x&1)
			{
				if (y<m) y++;
				else x++;
			}
			else
			{
				if (y>1) y--;
				else x++;
			}
		}
	}
	for (i=1;i<=n;i++)
	{
		for (j=1;j<m;j++)
		{
			cout<<map[i][j]<<' ';
		}
		cout<<map[i][m]<<endl;
	}
	return 0;
}

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

using namespace std;

int main()
{
    string weather[] = {"Sunny", "Cloudy", "Rainy"};
    char input[10] = {};
    cin.getline(input, 10);
    if( input[0] == 'S' ){
        cout << weather[1];
    }
    else if( input[0] == 'C' ){
        cout << weather[2];
    }
    else{
        cout << weather[0];
    }
}


Measured memory_bytes: 256
import java.util.Scanner;

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

		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();

		while (true) {
			int h = scan.nextInt();
			int w = scan.nextInt();

			if (h == 0 && w == 0)
				break;

			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			}
			str.append("\n");
		}
		System.out.print(str);

	}
}

Measured memory_bytes: 20688
#include<iostream>
#include<string>
using namespace std;
int main(){
  string S;
  cin>>S;
  int ans=1;
  int leng=S.size();
  for(int i=0;i<leng;i++){
    if(i%2==0){
      if(S[i]=='L')ans=0;
    }
    else{
      if(S[i]=='R')ans=0;
    }
  }
  if(ans==0)cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
}

Measured memory_bytes: 256
# coding: utf-8
# Your code here!
num = int(input())
s = sorted(list(map(int,input().split())),reverse=True)
alice,bob = 0,0
for i,j in enumerate(s):
    if i % 2 == 0:
        alice += j
    else:
        bob += j
print(alice - bob)

Measured memory_bytes: 2940
/*
        @uthor: Kashish Gilhotra
        user: CodeChef, CodeForces, HackerEarth, HackerRank, SPOJ: kashish001
*/

#include <bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
//using namespace boost::multiprecision;
  
#define int long long int 
typedef vector<int> vi;
const int mod = 1e9 + 7; 

//#define CI cpp_int
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL) 
#define debug(...) cerr << "[" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] " 
#define EB emplace_back
#define ALL(v) v.begin(), v.end() 
#define size(v) (int)v.size() 
#define endl "\n"
#define UMO unordered_map
#define USO unordered_set
#define setBits(n) __builtin_popcountll(n)
#define TC int t; cin >> t; while (t--) 

void Panda() {
    int n;
    cin >> n;
    if( n >= 30) cout << "Yes" << endl;
    else cout << "No" << endl;
}
  
int32_t main() {
 
    FAST;

    
    
    Panda();

    return 0; 
} 

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

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}
 
int main() {
  ll q,h,s,d,n;
  cin >> q >> h >> s >> d >> n;
  h=min(2*q,h);
  s=min(2*h,s);
  if(2*s<d) cout<<n*s<<endl;
  else{
    cout<<(n/2)*d+(n%2)*s<<endl;
  }
}
  



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int, int>
#define pll pair<long long,long long>
#define vl vector<long long>
#define vll vector<pll>
#define vi vector<int>
#define vii vector<pii>
#define sws ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
using namespace std;
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAX = 1000002;
const int MOD2 = 998244353;
const int MOD = 1000000007; 
const int INF = 1e8;
const ld EPS = 1e-7;
// Extra
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define trav(a, x) for(auto& a : x)
#define fill(x,y) memset(x,y,sizeof(x))
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
ll dectobin(ll n,ll p[])
{
    ll i=0 ;
    while(n!=0)
    {
        p[i]=n%2 ;
        n/=2 ;
        i++ ;
    }
    return(i-1) ;
}
ll binarySearchCount(ll arr[], ll n, ll key) 
{ 
    ll left = 0; 
    ll right = n - 1; 
  
    ll count = 0; 
  
    while (left <= right) { 
        int mid = (right + left) / 2; 
  
        // Check if middle element is 
        // less than or equal to key 
        if (arr[mid] < key) { 
  
            // At least (mid + 1) elements are there 
            // whose values are less than 
            // or equal to key 
            count = mid + 1; 
            left = mid + 1; 
        } 
  
        // If key is smaller, ignore right half 
        else
            right = mid - 1; 
    } 
  
    return count; 
} 
void printDivisors(ll n,ll k) 
{  ll temp=1  ;
    // Note that this loop runs till square root 
    for (int i=1; i<=sqrt(n); i++) 
    { 
        if (n%i == 0) 
        { 
            // If divisors are equal, print only one 
            if (n/i == i) 
                {
                	if(i<=k && i>temp)
                	temp=i ;
				}
  
            else // Otherwise print both 
                
                {
                if(i<=k && i>temp)
                	temp=i ;
                if(n/i<=k && n/i>temp)
                temp=n/i ;
				}
        } 
    }
	cout<<n/temp<<"\n" ;
	return ; 
} 
ll solve(ll n)
{
	ll temp=-1 ;
	forn(i,n)
	{
		forn(j,3)
		{
			if(j!=temp)
			{
				
			}
		}
	}
}
int main(int argc, char** argv)
{   sws ;
 //tcase
{
ll n,m ;
cin>>n>>m ;
if(n==m)
cout<<"Yes\n" ;
else
cout<<"No\n";

}
  return 0;
}

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

using namespace std;

#define MAX(x,y) (x>y?x:y)
#define MIN(x,y) (x<y?x:y)
#define ABS(x) (x>0?x:-(x))

#define INF 1000000000

void swap(int* a, int* b)
{
	int tmp;
	tmp = *a;
	*a = *b;
	*b = tmp;
}

int gcd(int a, int b)
{
	if (a < b)
		swap(&a, &b);

	if (a % b == 0)
		return b;
	else
		return gcd(b, a % b);
}

int lcm(int a, int b)
{
	return a * b / gcd(a, b);
}

int main()
{
	int N;
	int M;
	int P[200000];
	bool Q[200000] = { false };
	int ans = 0;
	int flag = 0;

	scanf("%d",&N);

	for (int i = 0; i < N; i++)
	{
		scanf("%d", &P[i]);
	}

	int count = 1;

	for (int i = N-1; i > 0 ; i--)
	{
		Q[P[i]] = true;

		if (P[i] == count)
		{
			ans++;
			for (int j = count+1; j < N; j++)
			{
				count++;

				if (Q[j] == false)
					break;
			}
		}

	}
	printf("%d\n", ans+1);
}
		

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define pow(x,y) modpow(x,y)
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define RREPS(i,n) for(ll (i)=(n);(i)>0;(i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());

template<class T> inline void chmin(T& a, T b){
    if (a > b){
        a = b;
    }
}

template<class T> inline void chmax(T& a, T b){
    if (a < b){
        a = b;
    }
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int N;
    cin >> N;
    vector<string> S(N);
    REP(i,N)cin >> S[i];
    sort(ALL(S));
    UNIQUE(S);
    cout << S.size() << "\n";
}

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

int main(){
  int W,H,x,y,r;
  bool flag;
  cin >> W >> H >> x >> y >> r;
  flag = true;

  if((x-r)<0 || (x+r)>W){
    flag = false;
  }
  if((y-r)<0 || (y+r)>H){
    flag = false;
  }

  if(flag==false) cout << "No" << endl;
  else cout << "Yes" << endl;

  return 0;
}


Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std;
int solve(char* x,char* y){
    int n=strlen(x),m=strlen(y);
    vector<vector<int>> dp(n+1,vector<int>(m+1));
    for(int i=0;i<n+1;i++){
        if(!i)continue;
        for(int j=0;j<m+1;j++){
            if(!j)continue;
            if(x[i-1]==y[j-1])dp[i][j]=dp[i-1][j-1]+1;
            else dp[i][j]=max(dp[i][j-1],dp[i-1][j]);
        }
    }
    return dp[n][m];
}
int main(){
    int q;scanf("%d",&q);
    while(q--){
        char x[1000],y[1000];
        scanf("%s%s",x,y);
        printf("%d\n",solve(x,y));
    }
    return 0;
}


Measured memory_bytes: 6816
def main():
    N = int(input())
    A = list(map(int,input().split()))

    bucket = [0]*2

    for i in range(N):
        if A[i]%2 == 0:
            bucket[0] += 1
        else:
            bucket[1] += 1

    if bucket[1]%2 == 0:
        return 'YES'
    else:
        return 'NO'

print(main())


Measured memory_bytes: 14108
#include<map>
#include<ctime>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const long long MOD = 1e9+7;

map<long long,long long> dp;

long long get(long long x)
{
	if(dp.find(x)!=dp.end())
	{
		return dp[x];
	}
	if(x==0)
	{
		return dp[0]=1;
	}
	if(x==1)
	{
		return dp[1]=2;
	}
	return dp[x]=(get(x/2)+get((x-1)/2)+get((x-2)/2))%MOD;
}

int main()
{
	long long n;
	scanf("%lld",&n);
	printf("%lld\n",get(n));
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
const int MAXN = 100100;

int N, M;
vector <int> edge[MAXN];
int nord;
int ord[MAXN];
int par[MAXN];
vector <int> res[MAXN];

void flood (int cloc, int last)
{
    if (par[cloc] != -2) return;

    ord[nord++] = cloc;
    par[cloc] = last;
    for (int neigh : edge[cloc])
    {
        if (neigh == last) continue;
        flood (neigh, cloc);
    }
}

int main()
{
    ios_base::sync_with_stdio(0);
    for (int i = 0; i < MAXN; i++)
        par[i] = -2;

    cin >> N >> M;
    for (int i = 0; i < M; i++)
    {
        int a, b;
        cin >> a >> b;
        a--, b--;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }

    if (M % 2 == 1)
    {
        cout << "-1\n";
        return 0;
    }

    nord = 0;
    flood (0, -1);
    for (int i = 0; i < N; i++)
    {
        for (int neigh : edge[i])
        {
            if (neigh > i)
            {
                if (par[neigh] != i && par[i] != neigh)
                {
                    res[i].push_back(neigh);
                }
            }
        }
    }
    for (int i = N - 1; i > 0; i--)
    {
        int cloc = ord[i];
        if (res[cloc].size() % 2 == 0)
            res[par[cloc]].push_back(cloc);
        else
            res[cloc].push_back(par[cloc]);
    }

    for (int i = 0; i < N; i++)
    {
        for (int neigh : res[i])
            cout << i + 1 << " " << neigh + 1 << "\n";
    }
}

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

int main(void) {
    int N, A, B;
    cin >> N >> A >> B;
    int n1 = min(A, B);
    int n2 = A + B - N;
    if (n2 < 0) {
        n2 = 0;
    }
    cout << n1 << " " << n2;
    return 0;
}

Measured memory_bytes: 256
from operator import itemgetter

n = int(input())

robots = [tuple(map(int, input().split())) for _ in range(n)]
robots = sorted([(x-t, x+t) for x, t in robots], key=itemgetter(1))

counter = 1
now = robots[0][1]
for robot in robots[1:]:
    if now <= robot[0]:
        counter += 1
        now = robot[1]

print(counter)


Measured memory_bytes: 32492
#include <iostream>

using namespace std;

int main() {
  int A[101][101] = {};
  int B[101] = {};
  int n, m;
  int c = 0;

  cin >> n >> m;

  for (int i = 1; i <= n; i++) {
    for( int j = 1; j <= m; j++) {
      cin >> A[i][j];
    }
  }

  for (int i = 1; i <= m; i++) {
    cin >> B[i];
  }

  for (int i = 1; i <= n; i++) {
    for ( int j = 1; j <= m; j++) {
      c += (A[i][j] * B[j]);
    }
    cout << c << "\n";
    c = 0;
  }
  return 0;
}

Measured memory_bytes: 1208
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) int(a.size())
const int N=5e5+10;

int gi() {
	int x=0,o=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
	if(ch=='-') o=-1,ch=getchar();
	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	return x*o;
}

int to[N<<1],nxt[N<<1],tt=1,n,rt1,rt2,h[N],id[N];
vi E1[N],E2[N];
bool vis[N],dir[N];

void adde(int u,int v) {
	to[++tt]=v;nxt[tt]=h[u];h[u]=tt;
	to[++tt]=u;nxt[tt]=h[v];h[v]=tt;
}

void dfs(int u) {
	for(int &i=h[u],v;v=to[i],i;i=nxt[i]) {
		if(vis[i>>1]) continue;
		dir[i>>1]=i&1;vis[i>>1]=1;dfs(v);
	}
}

int main() {
	cin>>n;
	for(int i=1;i<=n;i++) {
		int p=gi();
		if(p<0) rt1=i; else E1[p].pb(i);
	}
	for(int i=1;i<=n;i++) {
		int p=gi();
		if(p<0) rt2=i; else E2[p].pb(i);
	}
	for(int i=1;i<=n;i++) if((sz(E1[i])&1)!=(sz(E2[i])&1)) return cout<<"IMPOSSIBLE",0;
	cout<<"POSSIBLE\n";
	for(int i=1;i<=n;i++) {
		for(auto j:E1[i]) adde(i,j);
		for(auto j:E2[i]) adde(i+n,j+n);
		if(sz(E1[i])&1^1) adde(i,i+n),id[i]=tt>>1;
	}
	adde(0,rt1);adde(0,rt2+n);
	dfs(0);
	for(int i=1;i<=n;i++) {
		if(sz(E1[i])&1) cout<<0<<' ';
		else if(dir[id[i]]) cout<<1<<' ';
		else cout<<-1<<' ';
	}
	return 0;
}


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

using ll = long long;
#define REP(i, n) for(int (i)=0; (i)< (n); ++i)
#define REPR(i, n) for(int (i)=(n); (i)>=0; --i)
#define FOR(i, n, m) for(int (i)=(n); (i)<(m); ++i)
constexpr int INF = 1e9;
//constexpr ll INF = 1LL << 62;
constexpr int mod = 1e9+7;

int main(){
  string N;
  cin >> N;
  REP(i, N.size()){
    if(N[i] == '7'){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}


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

int main()
{
    ios_base::sync_with_stdio(false);
    int n;
    cin>>n;
    int answer =0;
    for(int i=0;i*i<=n;i++){
        answer=i;
    }
    cout<<answer*answer;
    return 0;
}



Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
typedef pair<int, int> P;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int digit(int x) {
	int cnt = 0;
	while (x > 0) {
		cnt += x % 10;
		x /= 10;
	}
	return cnt;
}
int read() {
	int tmp;
	cin >> tmp;
	return tmp;
}
int xor128() {
	static int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	int t = (x xor (x << 11));
	x = y; y = z; z = w;
	return (w = (w xor (w >> 19)) xor (t xor (t >> 8)));
}

signed main() {
	string s;
	cin >> s;
	vector<int>vec;
	rep(i, s.size()) {
		int a = s[i] - '0';
		vec.push_back(a);
	}
	int ma = 0;
	rep(i, s.size() + 1) {
		int cnt = 0;
		rep(j, s.size()) {
			if (j < i) {
				cnt += vec[j];
				//cout << vec[j];
			}
			else if (j == i) {
				cnt += vec[j] - 1;
				//cout << vec[j] - 1;
			}
			else {
				cnt += 9;
				//cout << 9;
			}
		}
		//cout << endl;
		ma = max(ma, cnt);
	}
	cout << ma << endl;

	return 0;
}


Measured memory_bytes: 256
import Data.Array

main = do
  li <- getLine
  let n = read li
  s <- getLine
  let ans = compute n s
  print ans

{-
'a'から'z'までの個数を数えておく
1文字左に移すたびに、左++右--して、両方>0な要素数を数えて最大値をとる
-}

compute :: Int -> String -> Int
compute n s = maximum $ map comCnt $ scanl step (l0,r0) s
  where
    l0 = listArray ('a','z') $ replicate 26 0
    r0 = accumArray (+) 0 ('a','z') [ (c,1) | c <- s ]
    step (la,ra) c = (accum (+) la [(c,1)], accum (+) ra [(c,-1)])
    comCnt (la,ra) = length [ () | i <- ['a'..'z'], la ! i > 0, ra ! i > 0 ]

Measured memory_bytes: 508
import java.util.*;
import java.util.function.Predicate;

public class Main {

    public static void main(String[] args) {
        new Main().run();
    }

    int[] hairetu = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    void run() {
        //入力
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	System.out.println(hairetu[n-1]);
    }
}

Measured memory_bytes: 22740
#include<iostream>
using namespace std;
int main(){
    while(true){
       int i,j,k,n,x,tem=0;
       cin >> n >> x;
       if(n == 0 && x == 0)break;
       for(i=1;i<=n-2;i++){
           for(j=i+1;j<=n-1;j++){
               for(k=j+1;k<=n;k++){
                   if((i+j+k == x) && (i!=j || j!=k ||i!=k))tem = tem+1;
               }
           }
       }
       cout << tem << endl;
    }
}


Measured memory_bytes: 3108
#include <stdio.h>
int main(void){
    int x;
    int i;
    int j;
    int r;
    int c;
    int temp[200][200]={0};
    scanf("%d %d",&r,&c);
    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            scanf("%d",&x);
            temp[i][j]+=x;
        }
    }
    for(j=0;j<r;j++){
        for(i=0;i<c;i++){
            temp[c][j]+=temp[i][j];
        }
    }
    for(i=0;i<=c;i++){
        for(j=0;j<r;j++){
            temp[i][r]+=temp[i][j];
        }
    }
    for(j=0;j<=r;j++){
        for(i=0;i<=c;i++){
            printf("%d", temp[i][j]);
            if(i!=c) printf(" ");                                     
        }
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2104
#include<stdio.h>
int main()
{
    int a,N,s;

    scanf("%d",&N);
    s=0;
    a=1;
    while(a<=N)
    {
        if(a%2!=0)
        {
            s=s+1;
        }
        a++;
    }
    double  x=s;
    double y=N;

   double t;
   t=x/y;


    printf("%.10lf",t);
    return 0;
}


Measured memory_bytes: 128
#define M 26
P[M],A[M],B[M];
int R(a){return P[a]==a?a:(P[a]=R(P[a]));}
char s[99];main(k,l,d,x,y){for(;scanf("%d",&l),l;puts(k<M||d?"NG":"OK")){
	for(k=0;k<M;k++)A[k]=B[k]=0,P[k]=k;
	for(k=0;k<l;k++)scanf("%s",s),x=*s-97,y=s[strlen(s)-1]-97,A[x]++,B[y]++,P[R(x)]=R(y);
	for(d=k=0;k<M;k++){d+=abs(A[k]-B[k]);if((A[k]|B[k])&&R(*s-97)!=R(k))break;}
}exit(0);}

Measured memory_bytes: 584