akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)


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

    int N;
    cin >> N;
    string S[N];
    rep(i,N) cin >> S[i];

    int count=0;
    int ans=0;
    sort(S,S+N);
    rep(i,N){
        if(S[i]==S[i+1]) count++;
        else {
            ans =max(count,ans);
            count=0;
        }
    }
    rep(i,N){
        if(S[i]==S[i+1]) count++;
        else if(ans==count) {
        cout<< S[i] << endl;
        count=0;
        }
        else count=0;
    }


}

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

int main() {
  int N, M; cin >> N >> M;
  int E_N = 2*M;
  pair<int, int> E[E_N];
  for (int i = 0; i < M; i++) {
    int a, b; cin >> a >> b; a--; b--;
    E[2*i] = make_pair(a, -1);
    E[2*i+1] = make_pair(b, a);
  }
  sort(E, E+E_N, [](pair<int, int> a, pair<int, int> b) {
    return a.first < b.first;
  });
  bool is_open[N]; for (int i = 0; i < N; i++) is_open[i] = false;
  queue<int> Q;
  int c = 0;
  for (int i = 0; i < E_N; i++) {
    if (E[i].second >= 0) {
      if (is_open[E[i].second]) {
        c++;
        while (!Q.empty() && Q.front() < E[i].first) {
          is_open[Q.front()] = false;
          Q.pop();
        }
      }
    } else {
      Q.push(E[i].first);
      is_open[E[i].first] = true;
    }
  }
  cout << c << endl;
}

Measured memory_bytes: 5396
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())

a, b, c = map(int, input().split())
print(max(0, b + c - a))

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

typedef long long ll;

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

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

int main() {
    int n;
    ll a[3000];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];

    ll ans = 0;
    for (int i = 0; i < n; i++) ans += a[i] - 1;
    cout << ans << endl;
}


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

using namespace std;

/**
 *  Name: Chris M. Perez
 *  University: Interamerican University Metro Campus
 *
**/

#define endl '\n'
#define MOD 10e9
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define gcd(x , y) __gcd(x , y)
#define all(x) (x).begin() , (x).end()
#define forn(i , a , b) for(int i=(a);i<(b);i++)
#define forrange(j , a , b) for(int j=(a);j<=(b);j++)
#define nestedforn(i , a , b , j , c , d) for(int i=(a);i<=(b);i++) for(int j=(c);j<=(d);j++)
#define sort_all(x) sort(all(x))
#define zeros_at_beginning(x) __builtin_clz(x)
#define zeros_at_end(x) __builtin_ctz(x)
#define ones(x) __builtin_popcount(x)
#define parity_even_or_odd_ones __builtin_parity(x)

typedef vector<int> vi;
typedef pair<int , int> pii;
typedef tuple<int , int , int> tiii;
typedef vector<pii> vpii;
typedef vector<tiii> vtiii;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long long ll;
typedef long long int lli;

             
inline int input(){
  int n;
  scanf("%d" , &n);
  return n;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;

#ifdef LOCAL_DEFINE
  freopen("input.txt" , "rt" , stdin);
#endif

  vector<int> v(3);
  forn(i , 0 , 3) cin >> v[i];
  cout << (v[0] * v[1]) / 2 << endl;
  
     
#ifdef LOCAL_DEFINE
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif  
  return 0;
}

Measured memory_bytes: 256
//IIT Kanpur FacelessMen India
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define REP(i,a) for(int i=0;i<a;++i)
#define REPP(i,a,b) for(int i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define foreach( gg,itit )  for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define mp make_pair
#define pb push_back
#define all(s) s.begin(),s.end()
#define present(c,x) ((c).find(x) != (c).end())
const double EPS = 1e-8;
const int mod = 1e9+7;
const int N = 1e6+10;
const ll INF = 1e18;

//#define DEBUG
ll power(ll x,ll y){
  ll t=1;
  while(y>0){
    if(y%2) y-=1,t=t*x%mod;
    else y/=2,x=x*x%mod;
  }
  return t;
}
#ifdef DEBUG
#define dprintf(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#else
#define dprintf(fmt,...)
#endif

vector<int> G[N],a[2];
int u[N];
void dfs(int v,vector<int> &a){
  u[v]=1;
  a.pb(v);
  int lo=0;
  REP(i,G[v].size()) if(u[G[v][i]]==0&&lo==0) dfs(G[v][i],a),lo++;
}
int main(){
  // freopen("product.in","r",stdin);
  // freopen("product.out","w",stdout);
  int n,m;
  scanf("%d%d",&n,&m);
  REP(i,m){
    int x,y; scanf("%d%d",&x,&y);
    x--;y--;
    G[x].pb(y); G[y].pb(x);
  }
  int p=0;
  a[0].pb(0);
  u[0]=1;
  REP(i,G[0].size()) if(u[G[0][i]]==0&&p<2){
    dfs(G[0][i],a[p]);
    p++;
  } 
  if(p==2){
    reverse(all(a[1]));
    REP(i,a[0].size()) a[1].pb(a[0][i]);
    a[0]=a[1];
  }
  printf("%d\n",(int)a[0].size());
  REP(i,a[0].size()) printf("%d ",a[0][i]+1);
  printf("\n");
  return 0;
}


Measured memory_bytes: 31992
#include <functional>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;

int main() {
   string n;
   
 
   cin >> n;
  
   int size = n.size();
   int min = 100000;
  
   for(int i = 0;i<size-2;i++){
     
    // char a = n[i]+n[i+1]+n[i+2];
     char a = n[i];
     char b = n[i+1];
     char c = n[i+2];
     
     int str = (int)(a - '0');
     int str2 = (int)(b - '0');
     int str3 = (int)(c - '0');
     
     int sum = str*100+str2*10+str3;
     int count = 753 - sum;
     //cout << count << endl; 
   //  cout << sum << endl; 
     
     if(count<0){
      
       count = -count;
     }
     if(count<min){
       
       min = count;
       
     }
     
     
   }
  
   cout << min << endl;
   
   //cout << n << endl;
  
  
  
  
  return 0;
}

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

int main(){
    long N,K,Q;
    cin >> N >> K >> Q;
    long A[Q];
    long Point[N];
    for(long i=0; i<Q; i++){
        cin >> A[i];
    }

    for(long i=0; i<N; i++){
        Point[i]=K;
    } 
    for(long i=0; i<Q; i++){
        Point[ A[i]-1 ]+=1;
    }
    for(long i=0; i<N; i++){
        Point[i]-=Q;
    }    

    for(long i=0; i<N; i++){
        if(Point[i]<=0){
            cout << "No" << endl;
        }else{
            cout << "Yes" << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 2176
/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/1/13 19:59:06

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 1e5;
const int Inf = 1 << 30;

char s[105],pos[20];

int main()
{
	int len,p;
	pos[1] = 'k';pos[2] = 'e';pos[3] = 'y';pos[4] = 'e';pos[5] = 'n';pos[6] = 'c';pos[7] = 'e';
	pos[8] = '?';
	while(~scanf(" %s",s + 1)){
		p = 1;
		len = strlen(s + 1);
		for(int i = 1;i <= len;i++){
			if(pos[p] != s[i]) break;
			else p++;
		}
		for(int i = len - 7 + p;i <= len;i++){
			if(s[i] != pos[p]) break;
			else p++;
		}
		if(p == 8) printf("YES\n");
		else printf("NO\n");
	}
    return 0;
}

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

int main() {
int N,p,q,people;
people=0;
cin>>N;
for(int i = 0;i<N;i++){
cin>>p>>q;
people +=q-p+1;
}
cout<<people;}


Measured memory_bytes: 3564
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include <string>
#include <iostream>
#include <stack>
#include <bitset>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const ll mod = 1e9+7;
const int inf  = 0x3f3f3f3f;

struct cmp
{
	bool operator()(const pii & a, const pii & b)
	{
		return a.second > b.second;
	}
};

const int maxn = 1e5+5;
std::vector<int> vv;
struct fff
{
	int l,r;
}vp[maxn];

struct Node
{
	int l,r,num;
}node[maxn<<2];
void build(int l,int r,int no)
{
	node[no].l  = l;
	node[no].r = r;
	node[no].num = 0;
	if(l == r)
		return;
	int mid = l + r >> 1;
	build(l,mid,no<<1);
	build(mid + 1, r, no<<1|1);
}
void down(int no)
{
	node[no<<1].num = node[no].num;
	node[no<<1|1].num = node[no].num;
	node[no].num = 0;
}


void update(int l,int r,int num,int no)
{
	if(node[no].l > r || node[no].r < l)
		return;
	if(node[no].l >= l && node[no].r <= r)
	{
		node[no].num = num;
		return;
	}
	if(node[no].num)
		down(no);
	update(l,r,num,no<<1);
	update(l,r,num,no<<1|1);
}
int vis[maxn];
int ans;
void query(int no)
{
	if(node[no].num != 0)
	{
		if(vis[node[no].num] == 0)
		{
			ans ++ ;
			vis[node[no].num] = 1;
		}
		return;
	}
	if(node[no].l == node[no].r)
		return;
	query(no<<1);
	query(no<<1|1);
}
int getid(int x)
{
	return lower_bound(vv.begin(),vv.end(),x) - vv.begin() + 1;
}

int main()
{
	ll a,b,n;
	scanf("%lld%lld%lld",&a,&b,&n);
	ll ans ;
	if(n >= b)
	{
		ans = a * (b - 1) / b;
	}
	else
		ans = a * n / b;
	printf("%lld\n",ans);
}

Measured memory_bytes: 3232
#include <stdio.h>

int main(void)
{
	int a1,a2,a3;
	
	scanf("%d %d %d",&a1,&a2,&a3);
	if(a1+a2+a3<=21){
		printf("win");
	}else{
		printf("bust");
	}
	
	return 0;
}

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

int main() {
  int A = 0;
  int B = 0;
  cin >> A >> B;
  int a = A + B;
  int b = A - B;
  int c = A * B;

  vector<int> vec = {a, b, c};
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  cout << vec.at(0) << endl;
}


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

int n, ans;
string s, x;

int main(){
    cin >> n;
    cout << 0 << "\n"; cout.flush();
    cin >> s;
    for (int i = 16; i >= 0; i--){
        if (n <= ans + (1 << i)) continue;
        cout << ans + (1 << i) << "\n"; cout.flush();
        cin >> x;
        if ((x != s) == ans % 2) ans |= (1 << i); 
    }
}

Measured memory_bytes: 852
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using TP = tuple<ll,ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
}
signed main(){
  init_io();
  ll d,t,s;
  cin >> d >> t >> s;
  d -= s*t;
  if(d<=0) cout << "Yes\n";
  else cout <<"No\n";
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
const int MOD = 1000000007;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    LL X,Y;cin >> X >> Y;
    int ans;
    while(X <= Y){
        ans++;
        X *= 2;
    }
    cout << ans << endl;
}

/*
    double X,Y;cin >> X >> Y;
        X = log(X)/log(2);
        Y = log(Y)/log(2);
        X = Y - X ;

        int ans = floor(X) + 1;
        cout << ans << endl;
*/

// 上の計算では一個だけ通らなかった。おそらく、小数点以下で誤差が生じて通らないものがあるっぽい。
// doubleの割り算とか繰り返すやつは危険なので、なるべく避けるほうがいい。



Measured memory_bytes: 256
a, b = input().split()
aa = []
bb = []
for i in range(int(b)):
    aa.append(a)
for i in range(int(a)):
    bb.append(b)
a = "".join(aa)
b = "".join(bb)

if aa < bb:
    print(a)
else:
    print(b)


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



int main()
{
    char x;
    cin>>x;
    char temp = x;
    char b_x = tolower(temp);

    if(b_x==x)
    {
        cout<<"a"<<endl;
    }
    else
    {
        cout<<"A"<<endl;
    }
    return 0;
}

Measured memory_bytes: 3636
#include <cstdio>
#include <algorithm>

int n;
int a[100010];

int main(void)
{
	int i;
	int w = -1;
	int p,q;

	//freopen("x.in","r",stdin);

	scanf("%d",&n);
	for(i = 1;i <= n;++i)
		scanf("%d",&a[i]);

	for(i = 1;i <= n;++i)
		w = std::max(w,a[i]);
	for(i = 1;i <= n;++i)
		if(a[i] != w && a[i] != w - 1)
			return puts("No"),0;
	p = q = 0;
	for(i = 1;i <= n;++i)
		if(a[i] == w)
			++p;
		else
			++q;
	if(!q){
		if(2 * w <= n)
			return puts("Yes"),0;
		if(w == n - 1)
			return puts("Yes"),0;
		puts("No");
		return 0;
	}
	if(w > q && 2 * (w - q) + q <= n)
		return puts("Yes"),0;
	puts("No");

	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = (1LL << 31) - 1;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100 * 3

int n, t, l, b;
double power[200];

int main() {
	REP(i, 200) {
		power[i] = pow(6, i);
		//cout << power[i] << endl;
	}
	while (cin >> n >> t >> l >> b&&n + t + l + b) {
		double dp[200][200][2] = {};
		set<int> sb, sl;
		REP(i, l) {
			int num;
			cin >> num;
			sl.insert(num);
		}
		REP(i, b) {
			int num;
			cin >> num;
			sb.insert(num);
		}
		dp[0][0][0] = 1;
		REP(i, t) {
			REP(j, n) {
				if (sl.find(j) != sl.end()) {
					dp[i + 1][j][1] += dp[i][j][0] * 6.0;
					FOR(k, 1, 6 + 1) {
						if (j + k <= n) {
							if (sb.find(j + k) != sb.end()) {
								dp[i + 1][0][0] += dp[i][j][1];
							}
							else dp[i + 1][j + k][0] += dp[i][j][1];
						}
						else {
							if (sb.find(n - (j + k - n)) != sb.end()) {
								dp[i + 1][0][0] += dp[i][j][1];
							}
							else dp[i + 1][n - (j + k - n)][0] += dp[i][j][1];
						}
					}
				}
				else {
					FOR(k, 1, 6 + 1) {
						if (j + k <= n) {
							if (sb.find(j + k) != sb.end()) {
								dp[i + 1][0][0] += (dp[i][j][0] + dp[i][j][1]);
							}
							else dp[i + 1][j + k][0] += (dp[i][j][0] + dp[i][j][1]);
						}
						else {
							if (sb.find(n - (j + k - n)) != sb.end()) {
								dp[i + 1][0][0] += (dp[i][j][0] + dp[i][j][1]);
							}
							else dp[i + 1][n - (j + k - n)][0] += (dp[i][j][0] + dp[i][j][1]);
						}
					}
				}
			}
		}
		double ans = 0;
		REP(k, 2) {
			REP(i, t + 1) {
				ans += (dp[i][n][k] / power[i]);
			}
		}
		printf("%.10lf\n", ans);
	}
}

Measured memory_bytes: 4136
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c,d,e,k,f;
  cin >> a >> b >> c >> d >> e >> k;
  f = e - a;

  if (f <= k) {
    cout << "Yay!" << endl;
  }
  else {
    cout << ":(" << endl;
  }
}

Measured memory_bytes: 256
/*
 It's better to sleep happy and tired rather than disappointed and frustrated
 There's only 1 thing that's impossible and that is defeating a man who doesn't give up
*/
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mx2 102
#define mx3 1003
#define mx4 10004
#define mx5 100005
#define mx6 1000006
#define mod 1000000007
#define PI 3.14159265
#define deb(x) cout << #x << " " << x << endl;
#define fo(i,n) for(int i=0 ; i<n ; i++)
#define Fo(i,k,n) for(int i=k ; i<n ; i++)
 
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<pair<int,int>,int> piii;

const int inf=0x3f3f3f3f;
int n, m , arr[2*mx5], a;
string str;
 
int main() {
	ios::sync_with_stdio(false);
	//int t;cin>>t;while(t--)
	{
		cin >> n;
		for(int i = 2; i <= n ; i++) {
			cin >> a;
			arr[a]++;
		}
		for(int i = 1 ; i <=n ; i++) {
			cout << arr[i] << "\n";
		}
	}
	return 0;
}


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

int main() {
  int n;
  double ans;
  
  cin >> n;
  
  if(n%2==0){
    ans = 0.5;
  }
  else{
    ans = n - n/2;
    ans = ans / n;
  }
  
  cout << ans << endl;
  
}


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

Measured memory_bytes: 3636
#![allow(non_snake_case)]
#![allow(unused_imports)]
 
use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;

#[fastout]
fn main() {
    input!{ x: usize }

    let mut money: usize = 100;
    let mut ans = 0;
    while money < x {
        money = (money as f64 * 1.01) as usize;
        ans += 1;
    }


    println!("{}", ans);
}


Measured memory_bytes: 2188
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    ll D;
    cin >> D;
    vector<ll> vec(26);
    rep(i,26){
        cin >> vec[i];
    }
    vector<vector<ll> > happiness(D, vector<ll>(26));
    rep(i,D){
        rep(j,26){
            cin >> happiness[i][j];
        }
    }
    vector<ll> ans(D);
    rep(i,D){
        cin >> ans[i];
        ans[i]--;
    }
    vector<ll> sadistic(26,0);
    ll point = 0;
    rep(i,D){
        rep(j,26){
            sadistic[j] += vec[j];
        }
        point += happiness[i][ans[i]];
        sadistic[ans[i]] = 0;
        rep(j,26){
            point -= sadistic[j];
        }
        cout << point << endl;
    }
}


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

const ll MX = 1e18;
const long double PI = acos(-1);

int main()
{
    int x, y;
    cin >> x >> y;
    int ans = 4*x - y;
    int ans1 = y - 2*x;
    if(ans >= 0 && ans1 >= 0 && ans % 2 == 0 && ans1 % 2 == 0)
        pri("Yes");
    else
        pri("No");
    return 0;
}


Measured memory_bytes: 3636
#include <stdio.h>

int main(void){
	char s[100001],*p=s;
	char c;
	int n=0;
	
	scanf("%s", s);
	c = *p;
	while (*(++p)){
		if (c != *p){
			c = *p;
			n++;
		}
	}
	
	printf("%d\n", n);
	return 0;
}
	

Measured memory_bytes: 384
N=int(input())
xl=[]
for i in range(N):
  x,l=map(int,input().split())
  xl.append([x-l,x+l])

XL=sorted(xl,key=lambda x:x[1])

w=1
robot=XL[0]
for i in XL:
  if robot[1] <= i[0]:
    w+=1
    robot=i
print(w)

Measured memory_bytes: 22588
n = input()
op_cnt = len(n) - 1 #隙間(+,-入れるところ)の個数
for i in range(2 ** op_cnt):
    op = ["-"] * op_cnt # あらかじめ["-".."-"]というリスト作っとく
    for j in range(op_cnt):
        if ((i >> j) & 1):
            op[op_cnt -1 -j] = "+" #フラグが立っていた場所を+で上書き

    formula = ""
    for p,q in zip(n,op+[""]):
        formula += (p+q)
    if eval(formula) == 7:
        print(formula + "=7")
        break


Measured memory_bytes: 9080
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for(int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

vector<P> G[MAX_N];

int now = 0;
int ans = 0;

int col[MAX_N];

void dfs(int x){
    int keep = now;
    rep(i,G[x].size()){
        if(col[G[x][i].second] != -1){
            ;
        }else{
            col[G[x][i].second] = (now + 1) % ans;
            now++;
            dfs(G[x][i].first);
        }
    }
    now = keep;
}

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

    int cnt[n] = {};
    rep(i,n)col[i] = -1;

    rep(i,n-1){
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(P(b,i));
        G[b].push_back(P(a,i));
        cnt[a]++;
        cnt[b]++;
        ans = max(ans, cnt[a]);
        ans = max(ans, cnt[b]);
    }

    dfs(0);



    cout << ans << endl;
    rep(i,n-1)cout << col[i] + 1 << endl;

    return 0;
}




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

using namespace std;
 
#define PB(x)	push_back(x)
#define ALL(x)	(x).begin(), (x).end()
#define ALLR(x)	(x).rbegin(), (x).rend()
#define MP(x)	make_pair(x)
 
#define debug(_x)		cerr << #_x << '=' << _x << endl;
#define debug2(_x, _y)	cerr << #_x << '=' << _x << ' ' << #_y << '=' << _y << endl;
#define debugn(_a)		cerr << #_a << ": "; for (const auto _x: _a) cerr << _x << ' '; cerr << endl;

#define FAST_IO ios::sync_with_stdio(false); cin.tie(0)

#define int long long int

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef unsigned long long ull;

const int INF = LONG_LONG_MAX>>1;
const int NINF = LONG_LONG_MIN/2;

const int N = 200009;

int a[N];
int m = 2019;

int32_t main() {
	FAST_IO;
	
	string s;
	cin >> s;
	
	int n = (int)s.size();
	
	int ans = 0;
	reverse(ALL(s));
	int p = 1;
	map<int, int> cnt;
	cnt[0] = 1;
	for (int i = 1; i <= n; i++) {
		a[i] = (a[i-1] + (s[i-1]-'0')*p%m)%m;
		p*=10;
		p%=m;
		ans += cnt[a[i]];
		cnt[a[i]]++;
	}
	
	cout << ans << endl;
}

// g++ -Wall -Wextra -Wshadow -fsanitize=undefined


Measured memory_bytes: 5264
/*
First solve the problem,then write the code.
Author-Manas Singh(@manassingh557)
*/

// #pragma GCC optimize ("Ofast")
// #pragma GCC optimization("O3")
// #pragma GCC optimization("unroll-loops")
// #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma,tune=native")
// #pragma GCC optimize ("-ffloat-store")

#include<bits/stdc++.h>

#define ll long long
#define ld long double

#define mod 1000000007
#define f first
#define s second
#define pb push_back
#define mp make_pair

#define endl "\n"

#define mii map<int,int>
#define mll map<ll,ll>
#define pii pair<int,int>
#define pll pair<<ll,ll>
#define vii vector<int>
#define vll vector<ll>

#define rep(i,end) for(int i=0;i<end;i++)
#define repi(i,start,end) for(int i=start;i<=end;i++)
#define repd(i,start,end) for(int i=start;i>=end;i--)

#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

using namespace std;

int main()
{
	fast;
	int n;
	cin>>n;
	ll ans=1;
	repi(i,2,n)
	{
	    ans=((ans%mod)*(i%mod))%mod;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

int s(long n);

int main() {
    long n;
    std::cin >> n;
    std::cout << (n % s(n) == 0 ? "Yes\n": "No\n");
}

// -------------------------------------------- //
int s(long n) {
    int sum = 0;

    while(n > 0) {
        sum += n % 10;
        n /= 10;
    }

    return sum;
}

Measured memory_bytes: 3532
N,K=list(map(int,input().split(" ")))

ans=0
l=1
r=0
for z in range(1,N+1):
  l=0
  p=z
  while True:
    if p>=K:
      break
    p*=2
    l+=1
  if l==0:
    f=N
    #r=N-z
    #break
  else:
    f=N*2**l

  ans+=1/f

ans+=r

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
#define vall(x) (x).begin(), (x).end()
using namespace std;
using lli = long long int;
void YESNO(bool), YesNo(bool);
template <class T1, class T2> bool chmin(T1 &l, const T2 &r);
template <class T1, class T2> bool chmax(T1 &l, const T2 &r);
template <class T1, class T2> void vadd(vector<T1> &v, T2 x);

#define int long long int

void solve(std::string S, std::string T) {
  int ret = 1e4;
  rep(i, S.size()) {
    if (i + T.size() > S.size())
      continue;
    int tmp = 0;
    for (int j = i; j < i + T.size(); j++) {
      if (S[j] != T[j - i]) {
        tmp++;
      }
    }
    chmin(ret, tmp);
  }
  cout<< ret << endl;
}

signed main() {
  std::string S;
  std::cin >> S;
  std::string T;
  std::cin >> T;
  solve(S, T);
  return 0;
}

// -- lib
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }

template <class T1, class T2> bool chmin(T1 &l, const T2 &r) {
  return (l > r) ? (l = r, true) : false;
}

template <class T1, class T2> bool chmax(T1 &l, const T2 &r) {
  return (l < r) ? (l = r, true) : false;
}

template <class T1, class T2> void vadd(vector<T1> &v, T2 x) {
  for (auto &s : v)
    s += T2(x);
}


Measured memory_bytes: 3640
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(int i=0;i<n;++i)
#define REPR(i,n) for(int i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(int i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define MP make_pair

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  int n, a, b;
  scanf("%d %d %d", &n, &a, &b);

  printf("%d\n",min(a * n, b));
  return 0;
}



Measured memory_bytes: 256
n, m = map(int, input().split())
A = [list(map(int, input().split())) for i in range(n)]
B = [list(map(int, input().split())) for i in range(m)]

ans = []
for a in A:
    cur = float('inf')
    for i, b in enumerate(B):
        x = abs(a[0] - b[0]) + abs(a[1] - b[1])
        if  x < cur:
            cur = x
            checkpoint = i + 1
    ans.append(checkpoint)
    
for i in range(n):
    print(ans[i])

Measured memory_bytes: 3064
#include <cstdio>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <list>
#include <cstring>
#include <string>
#include <limits.h>
#include <cmath>
#include <algorithm>

using namespace std;

typedef long long int LLN;

const int max_n = 100000 + 7;
int arr_spot[max_n];

int main(){
    int N = 0;
    while(scanf("%d", &N) != -1){
        for(int i = 0; i < N; ++i){
            scanf("%d", arr_spot + i + 1);
        }
        arr_spot[0] = 0;
        arr_spot[N + 1] = 0;

        int max_cost = 0;
        for(int i = 1;i <= N + 1; ++i){
            max_cost += abs(arr_spot[i] - arr_spot[i - 1]);
        }

        for(int i = 1; i <= N; ++i){
            int pre_diff = (arr_spot[i] - arr_spot[i - 1]);
            int post_diff = (arr_spot[i] - arr_spot[i + 1]);

            int behalf = 0;
            if(pre_diff * post_diff > 0){
                pre_diff = abs(pre_diff);
                post_diff = abs(post_diff);

                int half_behalf = min(pre_diff, post_diff);
                behalf = half_behalf * 2;
            }

            printf("%d\n", max_cost - behalf);
        }
    }

    return 0;
}


Measured memory_bytes: 1536
n, a, b = map(int, input().split())
h = [int(input()) for _ in range(n)]

import math
def ok(x):
    t = 0
    for i in range(n):
        r = h[i] - b*x
        if r < 0:
            continue
        else:
            t += math.ceil(r/(a-b))
    if t <= x:
        return True
    else:
        return False

l = 0
r = 10**14+1
while l+1 < r:
    c = (l+r)//2
    if ok(c):
        r = c
    else:
        l = c
print(r)

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

int main(){
  int a,b;
  cin >> a >> b;
  
  if(a > b){
    cout << (a * 2) - 1 << endl;
  }else if(a == b){
    cout << a * 2 << endl;
  }else{
    cout << (b * 2) - 1 << endl;
  }
}

Measured memory_bytes: 256
import math
a,b,x = map(int,input().split())
if a*a*b/2 <= x:
    j = 2*(b/a - x/(a**3))
    #print(j)
    j = math.atan(j)
    #print(j)
    ans = math.degrees(j)
    print(ans)
else:
    j = b*b*a/(2*x)
    #print(j)
    j = math.atan(j)
    #print(j)
    ans = math.degrees(j)
    print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>

constexpr int M = 3000;
long long items[M + 2][M + 2];
long long table[M + 2][M + 2][4] = {{}};

int main()
{
    int R, C, K;
    std::cin >> R >> C >> K;
    for (int i = 0; i < K; i++)
    {
        int x, y, value;
        std::cin >> x >> y >> value;
        items[x][y] = value;
    }
    for (int x = 0; x <= R; x++)
    {
        for (int y = 0; y <= C; y++)
        {
            for (int count = 0; count <= 3; count++)
            {
                table[x + 1][y][0] = std::max(table[x + 1][y][0], table[x][y][count]);
                table[x + 1][y][1] = std::max(table[x + 1][y][1], table[x][y][count] + items[x + 1][y]);
                table[x][y + 1][count] = std::max(table[x][y + 1][count], table[x][y][count]);
                if (count < 3)
                {
                    table[x][y + 1][count + 1] = std::max(table[x][y + 1][count + 1], table[x][y][count] + items[x][y + 1]);
                }
            }
        }
    }

    std::cout << std::max({table[R][C][0], table[R][C][1], table[R][C][2], table[R][C][3]}) << std::endl;
}

Measured memory_bytes: 355516
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        //System.setIn(Main.class.getClassLoader().getResourceAsStream("input"));
        Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        double a = sc.nextInt();
        double b = sc.nextInt();
        double x = sc.nextInt();
        double h = (x/(a*a));
        double angle = 0.0;
        if(x >= a*a*b/2) {
            double p = 2.0*x/(a*a) - b;
            angle = Math.atan((b-p)/a);
        }
        else {
            double p = 2*x/(b*a);
            angle = Math.atan(b/p);
        }
        //angle = Math.atan(2*h*a);
        System.out.println(180.0*(angle/Math.PI));
    }
}


Measured memory_bytes: 21844
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Integer n = sc.nextInt();
        Integer[] a = new Integer[n];
        Integer max = 0, sum=0;
        for(int i=0;i<n;i++){
            a[i] = sc.nextInt();
            sum += a[i];
            max = Math.max(a[i], max);
        }
        if(max < sum - max){
            System.out.println(new String("Yes"));
        }
        else{
            System.out.println(new String("No"));
        }
    }
}

Measured memory_bytes: 23124
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a/gcd(a,b)*b;
}


signed main(void) {
    int n;
    while(cin >> n,n){
        vector<vi> dp(n,vi(n));
        rep(i,n){
            string s;
            cin >> s;
            rep(j,n)if(s[j] == '.')dp[i][j] = 1;
        }
        loop(i,1,n)loop(j,1,n)if(dp[i][j] == 1){
            dp[i][j] = min(min(dp[i-1][j],dp[i][j-1]),dp[i-1][j-1])+1;
        }
        int ans = 0;
        rep(i,n)rep(j,n)ans = max(ans,dp[i][j]);
        cout << ans << endl;
    }
}



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

using namespace std;

#ifdef ACMTUYO
struct RTC{~RTC(){cerr << "Time: " << clock() * 1.0 / CLOCKS_PER_SEC <<" seconds\n";}} runtimecount;
#define DBG(X) cerr << #X << " = " << X << '\n';
#else
struct RTC{};
#define DBG(X)
#endif

#define fast_io() ios_base::sync_with_stdio(false)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define sz(x) ((int)(x).size())
#define all(c) (c).begin(),(c).end()
#define forn(i, n) for (int i = 0; i < (n); i++)
typedef long long int ll;

int main() {
  ll X;
  scanf("%lld", &X);
  ll answer = 1;
  for (ll base = 2; base <= X; base++) {
    ll num = base;
    for (ll pot = 2; ;pot++) {
      num *= base;
      if (num <= X) {
        answer = max(answer, num);
      } else {
        break;
      }
    }
  }
  printf("%lld\n", answer);
  return 0;
}

Measured memory_bytes: 256
n,m,x,y=gets.split.map(&:to_i)
a=gets.split.map(&:to_i).max
b=gets.split.map(&:to_i).min
z=[]
for i in (x+1)..y
    z.push(i)
end
puts z.all?{|e|a>=e||e>b} ? "War" : "No War"

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

string s;
int n, k, a[MAX];
ll f[MAX][MAX];

ll dp(int x, int lim, int cnt){
    if(x > n) return cnt == k;
    if(f[x][cnt] != -1 && !lim) return f[x][cnt];
    ll res = 0;
    int h = lim?a[x]:9;
    for(int i = 0; i <= h; i++){
        res += dp(x+1, lim&&(i==h), cnt+(i>0));
    }
    if(!lim) f[x][cnt] = res;
    return res;
}

int main()
{
    memset(f, -1, sizeof(f));
    string s;
    cin >> s >> k;
    n = s.length();
    for(int i = 0; i < s.length(); i++){
        a[i+1] = s[i]-'0';
    }
    ll ans = dp(1, 1, 0);
    cout << ans << endl;

    return 0;
}

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

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

    int a[5], b[5], diff[5], m=0;
    
    rep(i, 5){
        cin >> a[i];
        
        int c = a[i] % 10;
        
        b[i] = (c == 0)? a[i] : a[i] + (10 - c);
        diff[i] = b[i] - a[i];
        m = max(m, diff[i]);
    }
    
    int ind;
    rep(i, 5){
        if(diff[i] == m){
            ind = i;
        }
    }
    
    int sum = 0;
    
    rep(i, 5){
        if(i == ind){
            sum += a[i];
        }else{
            sum += b[i];
        }
    }
    
    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

static const int N = 100;

void trace(int A[], int n, int count){
  int i;
  for(i = 0; i < n; i++){
    if(i > 0)printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
  printf("%d\n", count);
}

int main(){
  int i, j, n,a;
  int count=0;
  int A[N];

  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d", &A[i]);
  }
  
  for(i = 0; i < n; i++){
    for(j = n - 1; j >= i + 1; j--){
      if(A[j] < A[j-1]){
	a = A[j];
	A[j] = A[j-1];
	A[j-1] = a;
	count++;
      }
    }
  }
  trace(A, n, count);
  
  return 0;
}

Measured memory_bytes: 604
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,l,r) for(ll i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(ll i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define pb push_back
#define eb emplace_back
#define SZ(x) ((ll)(x).size())
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
template<class T = ll> using V = vector<T>;
template<class T = ll> using VV = V<V<T>>;
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; }
inline void Yes(bool b = true) {cout << (b ? "Yes" : "No") << '\n';}
inline void YES(bool b = true) {cout << (b ? "YES" : "NO") << '\n';}
inline void err(bool b = true) {if(b) {cout << -1 << '\n'; exit(0);}}
template<class T> inline void fin(bool b = true, T e = 0) {if(b) {cout << e << '\n'; exit(0);}}
template<class T> T Roundup_div(T x, T y) {return (x+(y-1))/y;}
const ll INF = 1e18;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n, k; cin >> n >> k;
    int a[n];
    REP(i,n) cin >> a[i];
    sort(a, a+n);

    auto f = [&] (int m){
        if(k - a[m] <= 0 or m == n) return true;
        if(m == -1) return false;
        VV<> dp(n, V<>(k+1, 0));
        dp[0][0] = 1;
        int j = 0;
        REP(i,n){
            if(i == m) continue;
            j++;
            REP(l,k+1){
                chmax(dp[j][l], dp[j-1][l]);
                chmax(dp[j][min(l+a[i],k)], dp[j-1][l]);
            }
        }
        for(int i = k-a[m]; i<k; i++) if(dp[n-1][i]) return true;
        return false;
    };

    int ng = -1, ok = n;
    while(ok - ng > 1){
        int mid = (ok + ng) / 2;
        if(f(mid)) ok = mid;
        else ng = mid;
    }
    cout << ok << '\n';
}

Measured memory_bytes: 198756
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;cin >>N;
  	int a = N * 2;
    vector<int> leng(a);
    int count = 0;
    for(int i = 0;i < a; i++){
      cin >> leng.at(i);
      cout << endl;
    }
    sort(leng.begin(),leng.end());
    
    for(int j = 0;j <= a - 2;j += 2){
        count += min(leng.at(j),leng.at(j + 1));
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	S = input()
	S = S[:-1]
	T = input()
	T = T[:-1]

	ans = 0
	if S[0] == T[0]:
		ans += 1
	if S[1] == T[1]:
		ans += 1
	if S[2] == T[2]:
		ans += 1

	print(ans)


if __name__ == "__main__":
	main()


Measured memory_bytes: 38484
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())

    if N < 1000:
        print('ABC')
    else:
        print('ABD')

    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9016
// #include <bits/stdc++.h>
#include<climits>
#include<cmath>
#include<cstdio>
#include<deque>
#include<map>
#include<set>
#include<vector>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<numeric>
#include<string>
#include<tuple>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define pt pop_front
#define pk pop_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}

inline void solve(void){
  long N,A,B,C,D;
  in(N);
  in(A,B,C,D);
  long lower=A-(N-1)*D-C-D,upper=A-(N-1)*C-C-D;
  rep(i,N){
    lower+=C+D;
    upper+=C+D;
    if(B>=lower&&B<=upper){
      out("YES");
      return;
    }
  }
  out("NO");
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


Measured memory_bytes: 256
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
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;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int n, m;
vector<int> a;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
  string s;
    cin >> s;
    int ans = s[0]-'0';
  ans+=s[1]-'0';
  ans+=s[2]-'0';
    cout << ans << "\n";
}


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

int main(void) {
    ll H,N; cin >> H >> N;
    for(ll i=0; i<N; i++) {
        ll A; cin >> A;
        H-=A;
        if(H<=0) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 3640
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        x: i128,
        k: i128,
        d: i128
    };
    let x = x.abs();
    if k * d <= x {
        println!("{}", x - k * d);
    } else {
        let pos = if (k - x / d) % 2 == 0 {
            x % d
        } else {
            (x % d - d).abs()
        };
        println!("{}", pos);
    }
}


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

int main(int argc, char *argv[])
{
    int a, b;
    cin >> a >> b;

    if (a * b % 2 == 0)
        cout << "Even" << endl;
    else
        cout << "Odd" << endl;

    return 0;
}

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

using namespace std;
#define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i))

int main()
{
	int a, b, c, x, ans;
	cin >> a >> b >> c;
	x = max(a, max(b, c));
	if ((3 * x - a - b - c) % 2 == 0)
	{
		ans = (3 * x - a - b - c) / 2;
	}
	else
	{
		ans = (3 * x - a - b - c) / 2 + 2;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;

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

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

    map<int, int> m;
    for (int i = 0; i < n; i++) {
        m[a[i]]++;
    }

    long long ans = 0;

    for (auto& p : m) {
        if (p.second < p.first) {
            ans += p.second;
        } else if(p.second > p.first) {
            ans += p.second - p.first;
        }
    }

    cout << ans << endl;
}


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

using namespace std;

#define PI 3.14159265358979323846264338327950L

int main(void) {
	long long N, Q, B, C, ans = 0, tmp_A;
	vector<long long> A(100010, 0);

	cin >> N;

	for (long long i = 0; i < N; i++) {
		cin >> tmp_A;
		A[tmp_A]++;
		ans = ans + tmp_A;
	}

	cin >> Q;


	for (long long i = 0; i < Q; i++) {
		cin >> B >> C;
		ans = ans - B * A[B];
		ans = ans + C * A[B];

		A[C] = A[C] + A[B];
		A[B] = 0;


		printf("%lld\n", ans);
	}



	return 0;
}



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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ALL(a) (a).begin(),(a).end()

using namespace std;
using ll = long long;

const double PI = 3.14159265358979;

void solve()
{
  int a, b;
  string s;
  cin >> a >> b >> s;
  bool ok = true;
  for(int i = 0; i < a; ++i)
  {
    ok &= isdigit(s[i]);
  }
  ok &= (s[a] == '-');
  for(int i = 0; i < b; ++i)
  {
    ok &= isdigit(s[a + 1 + i]);
  }

  cout << (ok ? "Yes" : "No");
}

int main()
{
  fastio;
  solve();

  return 0;
}

Measured memory_bytes: 3600
#python3

def main():
    s = input()
    n = len(s)
    
    ans = 0
    cnt = 0 
    for i in range(n):
        if not ((s[i] == 'A') or (s[i] == 'T') or (s[i] == 'C') or (s[i] == 'G')):
            cnt = 0
        else:
            cnt += 1
        ans = max(cnt, ans)
    print(ans)
main()

Measured memory_bytes: 3060