akhauriyash/Code-Regression huggingface dataset:
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


N,K = MI()

if N-2*K+1 < 0:
    print(-1)
    exit()

ANS = [[0]*3 for _ in range(N)]
for i in range(K+2*N,K+3*N):
    ANS[i-(K+2*N)][2] = i

if N % 2 == 0:
    for i in range(N//2):
        ANS[2*i][0] = K+i
        ANS[2*i][1] = K+N+(N//2)+i
        ANS[2*i+1][0] = K+(N//2)+i
        ANS[2*i+1][1] = K+N+i

else:
    for i in range(N//2):
        ANS[2 * i][0] = K + i
        ANS[2 * i][1] = K + N + (N // 2) + i
        ANS[2 * i + 1][0] = K + (N // 2) + 1 + i
        ANS[2 * i + 1][1] = K + N + i
    ANS[-1][0] = K+(N//2)
    ANS[-1][1] = K+(2*N-1)

for i in range(N):
    a,b,c = ANS[i]
    print(a,b,c)


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

using ll = long long;

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

    int N, K; cin >> N >> K;
    vector<int> X(N), Y(N);
    for (int i = 0; i < N; i++) {
        cin >> X[i] >> Y[i];
    }
    set<int> sx(X.begin(), X.end());
    set<int> sy(Y.begin(), Y.end());
    map<int,int> x2i, i2x, y2i, i2y;
    
    {
        int i = 0;
        for (auto it = sx.begin(); it != sx.end(); it++) {
            x2i[*it] = i;
            i2x[i] = *it;
            i++;
        }
    }
    {
        int i = 0;
        for (auto it = sy.begin(); it != sy.end(); it++) {
            y2i[*it] = i;
            i2y[i] = *it;
            i++;
        }
    }
    vector<vector<int>> c(sx.size(), vector<int>(sy.size(), 0));
    for (int i = 0; i < N; i++) {
        c[x2i[X[i]]][y2i[Y[i]]]++;
    }
    vector<vector<int>> s(sx.size(), vector<int>(sy.size(), 0));
    for (int i = 0; i < sx.size(); i++) {
        for (int j = 0; j < sy.size(); j++) {
            s[i][j] = c[i][j];
            if (i > 0) s[i][j] += s[i-1][j];
            if (j > 0) {
                s[i][j] += s[i][j-1];
                if (i > 0) {
                    s[i][j] -= s[i-1][j-1];
                }
            }
        }
    }

    ll ans = LLONG_MAX;
    for (int ixl = 0; ixl < sx.size()-1; ixl++) {
        for (int ixr = ixl+1; ixr < sx.size(); ixr++) {
            for (int iyl = 0; iyl < sy.size()-1; iyl++) {
                for (int iyr = iyl+1; iyr < sy.size(); iyr++) {
                    int pts = s[ixr][iyr];
                    if (ixl > 0) pts -= s[ixl-1][iyr];
                    if (iyl > 0) {
                        pts -= s[ixr][iyl-1];
                        if (ixl > 0) {
                            pts += s[ixl-1][iyl-1];
                        }
                    }
                    if (pts >= K) {
                        int w = i2x[ixr] - i2x[ixl];
                        int h = i2y[iyr] - i2y[iyl];
                        ll a = (ll)w * h;
                        if (a < ans) ans = a;
                    }
                }
            }
        }
    }
    cout << ans << endl;
}


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

using namespace std;
using ll = long long;
using P = pair<int,int>;
using ull= unsigned long long;
const ll K_MAX=1e5+5;




int main(){
  int n,k;
  cin >>n>>k;
  vector<int> a(n);
  rep(i,n){
    cin>>a[i];
  }

  
  rep(i,k){
    int c_n=0;
    vector<int> b(n);
  	rep(j,n){// j番目の数．// 累積和
      if(a[j]==n)c_n++;
      int l=max(0,j-a[j]);
      int r=min(n-1,j+a[j]);
      b[l]++;
      if(r<n-1)b[r+1]--;
    }
    if(c_n==n) break;

    rep1(j,n-1) {
      b[j]+=b[j-1];
    }

    
    a=b;
  }
  
  rep(i,n){
    cout<<a[i]<<" ";
    
  }
  
 

}


Measured memory_bytes: 4840
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(void) {
    vector<int> v(5);
    for(int i=0; i<5; i++) {
        cin >> v[i];
    }

    cout << find(v.begin(), v.end(), 0) - v.begin() + 1 << endl;
    return 0;
}


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

using namespace std;

typedef long long int int64;

const int H = 15;
const int W = 1005;
int matr[H][W];
int whatType[H];
int aa[H];
int ans = H*W;
int h, w, k;

int checkk() {
	for(int hh = 1; hh <= h; hh++)
		aa[hh] = 0;
	for(int j = 1; j <= w; j++) {
		for(int i = 1; i <= h; i++)
			aa[whatType[i]] += matr[i][j];
		for(int i = 1; i <= h; i++)
			if(aa[whatType[i]] > k) return 100000000;
		for(int i = 1; i <= h; i++)
			aa[i] = 0;
	}
	int curAns = 0;
	for(int j = 1; j <= w; j++) {
		for(int i = 1; i <= h; i++)
			aa[whatType[i]] += matr[i][j];
		bool flag = false;
		for(int i = 1; i <= h; i++)
			if(aa[whatType[i]] > k)
				flag = true;
		if(flag) {
			for(int hh = 1; hh <= h; hh++)
				aa[whatType[hh]] = 0;
			curAns++;
			j--;
		}
	}
	return curAns;
}

void fillRecursion(int pr, int curr) {
	whatType[curr] = pr;
	for(int i = curr+1; i <= h; i++) {
		fillRecursion(pr + 1, i);
		whatType[i] = pr;
	}
	int ch = checkk();
	ans = min(ans, ch + (pr-1));
}


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> h >> w >> k;
	for(int i = 1; i <= h; i++) {
		for(int j = 1; j <= w; j++) {
			char cc;
			cin >> cc;
			matr[i][j] = cc - '0';
		}
	}
	
	fillRecursion(1, 1);
	
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main() {
	int h, w, cnt;
	char s[51][51];
	scanf("%d%d", &h, &w);
	for (int i = 0; i < h; i++) {
		scanf("%s", s[i]);
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (s[i][j] == '.') {
				cnt = 0;
				for (int x = -1; x < 2; x++) {
					for (int y = -1; y < 2; y++) {
						if ((x == 0 && y == 0) || j + x < 0 || i + y < 0 ||
							j + x == w || i + y == h)
							continue;
						if (s[i + y][j + x] == '#') cnt++;
					}
				}
				s[i][j] = cnt + '0';
			}
		}
	}
	for (int i = 0; i < h; i++) {
		printf("%s\n", s[i]);
	}
	return 0;
}

Measured memory_bytes: 128
/*

                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    prayer
*/

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(_,v.size())cout<<" "<<v[_];cout<<endl;
#define show2d(v) rep(__,v.size()){rep(_,v[__].size())cout<<" "<<v[__][_];cout<<endl;}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};

signed main(){
	int n,w,k;
	cin>>n>>w>>k;
	int m=w-1;
	int MOD=1000000007;
	vi dp(w);
	dp[0]=1;
	rep(i,n){
		vi ndp(w);
		rep(j,1<<m){
			vi t(m);
			rep(l,m)if(1<<l&j)t[l]=1;
			bool h=true;
			rep(l,m-1)if(t[l]==t[l+1]&&t[l])h=false;
			if(!h)continue;
			rep(l,w){
				if(l&&t[l-1])(ndp[l]+=dp[l-1])%=MOD;
				else if(l!=w-1&&t[l])(ndp[l]+=dp[l+1])%=MOD;
				else (ndp[l]+=dp[l])%=MOD;
			}
		}
		dp=ndp;
	}
	cout<<dp[k-1]<<endl;
}















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

int n,a[maxn],cnt,ans;

int main(){
	scanf("%d",&n);
	for (int i = 1 ; i <= n ; i++){
		scanf("%d",&a[i]);
		if ( a[i] == a[i - 1] ) cnt++;
		else{
			ans += cnt / 2;
			cnt = 1;
		}
	}
	ans += cnt / 2;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <deque>
using namespace std;

typedef long long i64;
typedef pair<i64, double> pii;

int N, L;

deque<pii> q;

int main() {
  i64 sum = 0;
  double val = 0;
  
  scanf("%d%d", &N, &L);
  
  for (int i = 1; i <= N; ++i) {
    double t;
    int v;

    scanf("%lf%d", &t, &v);
    sum += v, val += t * v;
    while (q.size() > 1 && sum - q.back().first >= L) {
      sum -= q.back().first, val -= q.back().first * q.back().second;
      q.pop_back();      
    }

    int rest = sum - L, n = q.size();
    
    if (rest) {
      q[n - 1].first -= rest;
      val -= q[n - 1].second * rest;
      sum -= rest;
    }
    
    printf("%.9lf\n", (double) val / L);
    
    q.push_front(make_pair(v, t));

    while (q.size() >= 2 && q[1].second >= q[0].second) {
      q[1].second = (q[1].second * q[1].first + q[0].second * q[0].first) / (q[1].first + q[0].first);
      q[1].first += q[0].first;
      q.pop_front();
    }

  }
  return 0;
}


Measured memory_bytes: 18196
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(),(x).end())
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define repr(i, m, n) for(int i = m; i >= n; i--)
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;}
#define y0 y3487465 //j0
#define y1 y1347829 //j1
#define INF 1000000007 //4000000000000000037
#define PI (acos(-1))
#define MOD 1000000007
using namespace std;
typedef long long ll;



void Main(){

  int N,M;
  cin>>N>>M;

  int onetry=1900*M+100*(N-M);

  int kak=pow(2,M);

  int ans=onetry*kak;

  cout<< ans<<"\n";
}

//-----------------------------------
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
}
//-----------------------------------


Measured memory_bytes: 384
n = int(input())
s = "abcdefghij"

class Node:
    def __init__(self, string, index):
        self.children = []
        self.string = string
        self.index = index

    def get_children(self):
        parent = self.string
        for i, c in enumerate(s[:self.index+1]):
            self.children.append(Node(parent+c, self.index if self.index>i else i+1))
        return self.children

root = Node("a", 1)
children = [root]
for _ in range(n-1):
    parents, children = children, []
    for parent in parents:
        children.extend(parent.get_children())
for child in children:
    print(child.string)

Measured memory_bytes: 49092
import java.util.*;
public class Main { 
	public static ArrayList<Integer> list = new ArrayList<Integer>();
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		makeList();
		Collections.sort(list);
		while(true) {
			int n = stdIn.nextInt();
			if(n == 1) break;
			System.out.print(n+":");
			for(int i = 0; i < list.size(); i++) {
				int a = list.get(i);
				if(a > n) break;
				if(n % a == 0) {
					System.out.print(" " + a);
				}
			}
			System.out.println();
		}
	}
	
	public static void makeList() {
		list.add(6);
		for(int i = 2; i <= 300000; i++) {
			int a = 7 * i - 1;
			int b = 7 * i - 6;
			if(a >= 400000 || b >= 400000) break;
			if(isPrime(a)) {
				list.add(a);
			}
			if(isPrime(b)) {
				list.add(b);
			}
		}
	}
	
	public static boolean isPrime(int n) {
		for(int i = 0; i < list.size(); i++) {
			if(n % list.get(i) == 0) {
				return false;
			}
		}
		return true;
	}
}

Measured memory_bytes: 35400
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define oo 0x3f3f3f3f

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    vector<ll>S(10000001);
    for(int i=1; i<S.size(); i++)
    for(int j=i; j<S.size(); j+=i)
        S[j]++;

    int n;
    cin>>n;
    ll res= 0;
    for(int i=1; i<=n; i++)
        res+=i*S[i];

    cout<<res;
}


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

const int inf = 1e9 + 7;
pair<int, int> xy1[107];
pair<int, int> xy2[107];


int N;

bool vis[207][207];

//int fnc_pre_and_post()
//{
//    for (int i = 0; i <= 200; i++) for (int j = 0; j <= 200; j++) vis[i][j] = 0;
//
//    int cnt = 0;
//    for (int i = 1; i <= N; i++) {
//        int sumx = inf, sumy = inf;
//        for (int j = N+1; j <= 2*N; j++) {
//            if (x[j] > x[i] && y[j] > y[i] && !vis[x[j]][y[j]]) {
//                if (x[j] < sumx && y[j] < sumy) sumx = x[j], sumy = y[j];
//            }
//        }
//        if (sumx != inf) cnt++, vis[sumx][sumy] = 1; //cout << sumx << ' ' << sumy << endl;
//    }
//
//    return cnt;
//}

int later_fnc_post()
{
    int cnt = 0;
    for (int i = 1; i <= N; i++) {
        int sumx = -1, sumy = -1;
        for (int j = 1; j <= N; j++) {
            if (xy2[i].first > xy1[j].first && xy2[i].second > xy1[j].second  && !vis[ xy1[j].first  ][ xy1[j].second  ]) {
                if (xy1[j].second > sumy) sumx = xy1[j].first, sumy = xy1[j].second;
            }
        }
        if (sumx != -1) cnt++, vis[sumx][sumy] = 1; //cout << sumx << ' ' << sumy << endl;
    }

    return cnt;
}

int main()
{
    cin >> N;
    for (int i = 1; i <= N; i++) cin >> xy1[i].first >> xy1[i].second;
    for (int i = 1; i <= N; i++) cin >> xy2[i].first >> xy2[i].second;

    sort(xy1, xy1+N);
    sort(xy2, xy2+N);

    int ans = later_fnc_post();

    cout << ans << endl;
}

/*

3
0 0
2 6
8 0

3 7
4 2
9 1
*/


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define ALL(v) (v).begin(), (v).end()
#define ios() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;
constexpr ll MOD = 10e9+7;
constexpr ll INF = 1LL << 60;
constexpr int Inf = 1e9;
inline int in() {int x; cin >> x; return x;}
template <typename T> inline void out(const T& x) {cout << x << endl;}
template <class T> inline bool chmin(T &a, T b){if (a > b){a = b;return 1;}return 0;}
template <class T> inline bool chmax(T &a, T b){if (a < b){a = b;return 1;}return 0;}
//UP = 0;RIGHT = 1; DOWN = 2; LEFT =3;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b)
{
  if (a < b)
    gcd(b, a);
  int r;
  while ((r = a % b))
  {
    a = b;
    b = r;
  }
  return b;
}
void eratos(bool * isPrime,int max){
  fill(isPrime,isPrime + max,true);
  isPrime[0] = false; 
  isPrime[1] = false; 
  for(int i=2; i<=max/i; ++i) 
      if(isPrime[i]) 
          for(int j=2; j<=max/i; ++j) 
              isPrime[i*j] = false;    
}
//

signed main()
{
  ios();
  int N = in();
  int A[2][N];
  rep(i,2)rep(j,N) cin >> A[i][j];
  rep(i,2)rep(j,N-1) A[i][j+1] += A[i][j];

  int max = A[0][0] + A[1][N-1];
  for(int i = 1 ;i< N;i++)
  {
    chmax(max,A[0][i] + A[1][N-1] - A[1][i-1]);
  }
  cout << max << endl;
}


Measured memory_bytes: 256
#include<iostream>

int main() {

	int a,b;
	scanf("%d%d", &a,&b);
	
	int num = b - a;
	int sum = 0;
	for (int i = 1; i <= num; i++) {
		sum += i;
	}

	printf("%d\n", sum - b);

	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define SIZE 100
#define rep(i, N) for (i = 0; i < N; i++) //制御変数iを用いてN回転
#define array(N, t) (t*)calloc(N, sizeof(t)) //t型N要素の1次元配列を動的確保後0クリア(freeを忘れずに)
#define zero(a); {int iter; rep(iter, sizeof(a)/sizeof((a)[0])) (a)[iter]=0;} //1次元配列aのゼロ初期化?
typedef long long ll;
void print_log(); //とりあえず文字を出力してどこまで実行できているか確認(for debug)
void printa_int(int *a, int size); //int型の1次元配列aを出力(for debug)

int main() {
    int N;
    scanf("%d", &N);
    N %= 10;
    switch (N) {
    case 3:
        printf("bon\n");
        break;
    case 0:
    case 1:
    case 6:
    case 8:
        printf("pon\n");
        break;
    case 2:
    case 4:
    case 5:
    case 7:
    case 9:
        printf("hon\n");
        break;
    default:
        break;

    }
    return 0;
}

void print_log() {
    printf("===finish!===\n");
}

void printa_int(int *a, int size) {
    int i;
    printf("[");
    for (i = 0; i < size; i++)
        printf("%d, ", a[i]);
    printf("]\n");
}

Measured memory_bytes: 1660
#include<stdio.h>
int A[1000000],n;
int binarySearch(int key){
	int left = 0;
	int right = n;
	int mid;
	while(left < right){
		mid = (left + right) / 2;
		if(key == A[mid]){
			return 1;
		}
		if(key > A[mid]){
			left = mid + 1;
		}
		else if(key < A[mid]){
			right = mid;
		}
	}
	return 0;
}
int main(){
	int i,q,k,sum = 0;
	scanf("%d", &n);
	for(i = 0;i < n;i++){
		scanf("%d",&A[i]);
	}
	scanf("%d",&q);
	for(i = 0;i < q;i++){
		scanf("%d", &k);
		if(binarySearch(k)){
			sum++;
		}
		
	}
	printf("%d\n",sum);
	return 0;
}


Measured memory_bytes: 2160
#include <stdio.h>
#define ll long long
#define rep(i,l,r,d) for(ll i=(l);i<(r);i+=(d))
int main(void){
    ll N, X, m[105], MIN=1e5;
    scanf("%lld %lld", &N, &X);
    rep(i, 0, N, 1){
        scanf("%lld", m+i);
        X -= m[i];
        if(m[i] < MIN) MIN = m[i];
    }
    printf("%lld\n", N + X/MIN);
    return 0;
}


Measured memory_bytes: 128
import scala.io.StdIn.{readInt,readLine}
import scala.collection.mutable.ArrayBuffer

object Main {
  def main(args:Array[String]) = {
    val n = readInt
    val pre = readLine.split(" ").map(_.toInt)
    val in = readLine.split(" ").map(_.toInt)
    val post = new ArrayBuffer[Int]

    var pos = 0
    def scan(l:Int, r:Int):Unit = {
      if(l<r) {
        val root = pre(pos)
        pos += 1
        val m = in.indexWhere(_==root)
        scan(l,m)
        scan(m+1,r)
        post += root
      }
    }

    scan(0, pre.length)
    println(post.toArray.mkString(" "))
  }
}

Measured memory_bytes: 44096
n=int(input())
s_list=[]
t_list=[]
for i in range(n):
    s,t=input().split()
    t=int(t)
    s_list.append(s)
    t_list.append(t)
x =input()
print(sum(t_list[s_list.index(x):])-t_list[s_list.index(x)])

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;string s;
cin>>n>>s;
int red=0;int blue=0;
for(int i=0;i<n;i++)
{ if(s[i]=='R')red++;else blue++;
}
if(red>blue)
cout<<"Yes\n";
else
cout<<"No\n";
}

Measured memory_bytes: 256
#include<iostream>
#include<set>
#define ll long long int
using namespace std;
int main()
{
    int n;  cin >> n;
    ll k;   cin >> k;
    int a[n + 1];
    bool visited[n + 1];
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
        visited[i] = false;
    }
    int ce = 1;
    while(visited[ce] == false)
    {
        visited[ce] = true;
        ce = a[ce];
    }
    // cout << "Cycle/End: " << ce << '\n';
    int len = 1;
    int node = 1;
    while(k > 0 && node != ce)
    {
        node = a[node];
        k--;
    }
    if(k == 0)
    {
        cout << node << '\n';
        return 0;
    }
    // cout << "Node: " << node << '\n';
    // cout << "K: " << k << '\n';
    node = a[ce];
    while(node != ce)
    {
        len++;
        node = a[node];
    }
    // cout << "Len: " << len << '\n';
    int v = k % len;
    int ans = ce;
    while(v > 0)
    {
        ans = a[ans];
        v--;
    }
    cout <<  ans << '\n';
}

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

int main(){
	std::vector<int> H_list;
	std::vector<int> W_list;
	int H, W;
	std::cin >> H >> W;
	while((H != 0) && (W != 0)){
		H_list.push_back(H);
		W_list.push_back(W);
		std::cin >> H >> W;
	}
	for (int idx = 0; idx < H_list.size(); idx++){
		for (int i = 0; i < W_list[idx]; i++){
			std::cout << "#";
		}
		std::cout << std::endl;
		for (int i = 0; i < H_list[idx]-2; i++){
			std::cout << "#";
			for (int j = 0; j < W_list[idx]-2; j++){
				std::cout << ".";
			}
			std::cout << "#" << std::endl;
		}
		for (int i = 0; i < W_list[idx]; i++){
			std::cout << "#";
		}
		std::cout << std::endl << std::endl;
	}
}


Measured memory_bytes: 3048
import java.util.*;
import static java.lang.Integer.*;
//import static java.lang.Long.*;
//import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		int c = parseInt(sc.next());
		int d = parseInt(sc.next());
		sc.close();
		out.println(Math.min(a, b)+Math.min(c, d));
	}
}


Measured memory_bytes: 21716
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNextInt()) {
            int a = scan.nextInt();
            int b = scan.nextInt();
            int sum = (a + b);
            int count = 0;
            do {
                sum /= 10;
                count++;
            } while (sum > 0);
            System.out.println(count);
        }
    }
}



Measured memory_bytes: 26184
#include <stdio.h>
#include<string.h>
int main()
{
    int test,i,a,b,x,y;
   scanf("%d",&a);
   if(a==5 || a==7 || a==3)
   {
       printf("YES\n");
   }else{
       printf("NO\n");
   }
   
    
    return 0;
}


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

int main() {
    map<string, int> m;
    
    int n;
    cin >> n;
    string input;

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

    cout << "AC x " << m["AC"] << endl;
    cout << "WA x " << m["WA"] << endl;
    cout << "TLE x " << m["TLE"] << endl;
    cout << "RE x " << m["RE"] << endl;
    
    return(0);
}


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

bool prime[55556];

int main() {
  int N;
  cin >> N;
  for (int i = 2; i <= 55555; i++) prime[i] = true;
  for (int i = 3; i <= 55555; i += 2) {
    for (int j = 3; j <= sqrt(i); j++) {
      if (i % j == 0) {
        prime[i] = false;
        break;
      }
    }
  }

  for (int i = 11; i <= 55555 && N; i += 2) {
    if (prime[i] && i % 5 == 1) {
      cout << i;
      N--;
      if (N == 0)
        cout << endl;
      else
        cout << " ";
    }
  }
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<29;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

bool isvalid(vector<vector<int>> &dist, int x, int y) {
    int H = dist.size();
    int W = dist[0].size();
    return x >= 0 && x < W && y >= 0 && y < H;
}

void dfs(vector<string> &M, vector<vector<int>> &dist, int x, int y) {
    queue<pair<int, pair<int,int>>> q;
    q.push(mp(0, mp(0, 0)));

    while(!q.empty()) {
        pair<int, pair<int,int>> p = q.front(); q.pop();
        int d = p.first;
        int x = p.second.first;
        int y = p.second.second;
        if (dist[y][x] <= d) continue;
        dist[y][x] = d;
        for (int k = 0; k < 4; k++) {
            int tx = x + dx[k];
            int ty = y + dy[k];
            if (!isvalid(dist, tx, ty)) continue;
            if (M[ty][tx] == '#') continue;
            if (dist[ty][tx] > d + 1) {
                q.push(mp(d + 1, mp(tx, ty)));
            }
        }
    }
}

int main() {
    int H, W;
    cin >> H >> W;
    vector<string> M;
    for (int i = 0; i < H; i++) {
        string s;
        cin >> s;
        M.push_back(s);
    }

    vector<vector<int>> dist(H, vector<int>(W, INF));
    dfs(M, dist, 0, 0);

    int k = dist[H - 1][W - 1];
    if (k == INF) {
        cout << -1 << endl;
        return 0;
    }
    int cnt = 0;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (M[i][j] == '#') cnt++;
        }
    }
    cout << H * W - (k + 1) - cnt << endl;

    return 0;
}

Measured memory_bytes: 256
function main(input) {
  let x = parseInt(input[0]);
  let money = 100;

  let i;
  for(i=0;money<x;i++){
    money = Math.floor(money + money/100);
  }
  console.log(i);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));

Measured memory_bytes: 29760
#include <bits/stdc++.h>
#include <set>
#define ll long long 
#include <string>
#define pb push_back
#define mp make_pair
# define pi 3.14159265358979323846
#define mod 1000000007
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
void fastio()
{					
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

}
ll int multiply(ll int a,ll int b)
{
	ll int ans=(a%mod*b%mod)%mod;
	return ans;
}
ll int add(ll int a, ll int b)
{
	ll int ans=(a%mod+b%mod)% mod;	
	return ans;
}


void solve()
{
	ll int n,w,i,j;
	cin>>n>>w;
	vector<pair<ll int ,ll int > > v(n+1);
	for(i=1;i<=n;i++)
		{
			ll int x,y;
			cin>>x>>y;
			v[i]=mp(x,y);
		}
		// for(i=1;i<=n;i++)
		// 	cout<<v[i].first<<" "<<v[i].second<<endl;

	ll int dp[n+1][w+1];
	memset(dp,0,sizeof dp);
	
	for(i=0;i<=n;i++)
	{
		for(j=0;j<=w;j++)
		{
			if (j==0)
			{
				
				dp[i][j]=0;
				continue;

			}
			// if (i==0)
			// {
			// 	dp[i][j]=0;
			// 	continue;
			// }
			ll int op1=(i>=1)?dp[i-1][j]:0;
			ll int op2=(v[i].first>j || i==0)?0:v[i].second+dp[i-1][j-v[i].first];
			dp[i][j]=max(op1,op2);

		}
	}
	// for(i=0;i<=n;i++)
	// 	{for(j=0;j<=w;j++)
	// 		cout<<dp[i][j]<<' ';
	// 	cout<<endl;}
	cout<<dp[n][w]<<endl;

}
int  main()
{
	fastio();
	ll int t;
	t=1;
	// cin>>t;
	while(t--)
	{
		solve();
	}
	

}




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

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
const ll INF = 2e18;
const int inf = 1e9+10;
const int maxN = 2e5 + 10;
const int maxD = 15;
const int maxH = 100; 
const int MOD = 998244353;

ll a[maxN];
ll b[maxN];
int main()
{
	int n;
	cin>>n;
	ll sum = 0;
	for(int i=1;i<=n;i++)
	{
		ll y = n/i;
		sum += (i+y*i)*y/2;
	}
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 3580
from collections import Counter
n = int(input())
A = list(map(int, input().split()))
Ca = {k:v for k, v in Counter(A).items() if v>=2}
ans = {}
al = 0
for k, v in Ca.items():
    al += v*(v-1)//2
for k, v in Ca.items():
    ans[k] = al - v*(v-1)//2 + (v-1)*(v-2)//2
for a in A:
    if a in ans:
        print(ans[a])
    else:
        print(al)


Measured memory_bytes: 26908
#include <stdio.h>
#include <stdlib.h>
#define MAX 2000000
 
 
void maxHeapify(int i);

int H,A[MAX+1];
 
int main(){
    int i;
    scanf("%d", &H);

    for ( i = 1; i <= H; i++){
        scanf("%d", &A[i]);
    }
    for ( i = H/2;i >= 1; i--){
        maxHeapify(i);
    }
    for ( i = 1; i <= H; i++){
        printf(" %d", A[i]);
    }

    printf("\n");

    return 0;
}

void maxHeapify(int i){
    int largest, tmp;
    int l = i*2;
    int r = i*2+1;

    if(l <= H && A[l] > A[i]){
        largest = l;
    }
    else {
        largest = i;
    }
    if (r <= H && A[r] > A[largest]){
        largest = r;
    }
 
    if (largest != i){
        tmp = A[i];
        A[i] = A[largest];
        A[largest] = tmp;
        maxHeapify(largest);
    }
}

Measured memory_bytes: 2552
def main():
    import sys
    input = sys.stdin.readline
    N,M,Q = map(int,input().split())
    
    A = [[0]*(N+2) for i in range((N+2))]
    
    for _ in range(M):
        L,R = map(int,input().split())
        A[R][1] += 1
        A[R][L+1] -= 1
        A[N+1][1] -= 1
        A[N+1][L+1] += 1
    
    for i in range(1,N+2):
        for j in range(1,N+2):
            A[i][j] += A[i][j-1]
    
    for j in range(1,N+2):
        for i in range(1,N+2):
            A[i][j] += A[i-1][j]       
    
    for _ in range(Q):
        p,q = map(int,input().split())
        print(A[q][p])
    
    
main()

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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl




typedef long long ll;
const ll mod = 1e9+7;
const int maxn = 1e6 + 5;



int n,m;
int a[maxn],b[maxn];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
    string s,t;
    cin>>s>>t;
    n=s.length();
    m=t.length();
    
    for (int i=1; i<=n; i++) {
	a[i] = s[i-1]=='A';
    }

    for (int i=1; i<=m; i++) {
	b[i] = t[i-1]=='A';
    }


    for (int i=1; i<=n; i++) {
	a[i] += a[i-1];
    }

    for (int i=1; i<=m; i++) {
	b[i] += b[i-1];
    }

    int q; cin>>q;

    while (q--) {
	int l,r,i,j;
	cin>>l>>r>>i>>j;

	int X = (r-l+1 - (a[r]-a[l-1])) - (a[r]-a[l-1]);
	int Y = (j-i+1 - (b[j]-b[i-1])) - (b[j]-b[i-1]);

	X%=3;X+=3;X%=3;
	Y%=3;Y+=3;Y%=3;

	if (X==Y) {
	    cout<<"YES\n";
	} else {
	    cout<<"NO\n";
	}
    }
  

    return 0;
}


Measured memory_bytes: 5456
/*
				C++
				encoding: UTF-8
				Last Modified: 2019/09/01 17:32:40

*/

#include <bits/stdc++.h>
#ifdef LOCAL_PROJECT
#	include <prettypr.hpp>
#endif

using namespace std;

// clang-format off

#define		 ll                     long long
#define		 ve                     vector
#define		 pb                     push_back
#define		 endl                   "\n";
#define		 ff                     first
#define		 ss                     second
#define		 pii                    pair<int, int>
#define		 len(v)                 int(v.size())
#define		 all(v)                 v.begin(), v.end()
#define		 reset(a, b)            memset(a, b, sizeof(a));
#define		 fr(i, s, n)            for (int i = s ; i < n ; ++i)
#define		 dfr(i, s, n)           for (int i = s ; i > n ; --i)

void pr () {
    cout << "\n";
}

template < typename T, typename... ARGS > void pr (const T& t, ARGS... args) {
    cout << t << " ";
    pr (args...);
}

// clang-format on

signed main () {
	ios_base::sync_with_stdio (false), cin.tie (nullptr);
	string s, t;
	cin >> s >> t;
	int ans = 0;
	fr (i, 0, 3) {
		if (s[i] == t[i]) ans++;
	}
	pr (ans);
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        int n = sc.nextInt();
        char[][] s = new char[n][];
        int[][] az = new int[n][26];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next().toCharArray();
            for (int j = 0; j < s[i].length; j++) {
                az[i][s[i][j] - 'a']++;
            }
        }
        int min;
        char c;
        for (int i = 0; i < 26; i++) {
            c = (char) ('a' + i);
            min = 50;
            for (int j = 0; j < n; j++) {
                min = Math.min(min, az[j][i]);
            }
            for (int j = 0; j < min; j++) {
                sb.append(c);
            }
        }
        System.out.println(sb);
    }
}

Measured memory_bytes: 23764
#include<stdio.h>

int main(void)
{
  int a, b;

  scanf("%d %d", &a, &b);
  if(a > b)
    printf("a > b\n");
  else if(a < b)
    printf("a < b\n");
  else if(a == b)
    printf("a == b\n");

  return 0;
}

Measured memory_bytes: 580
class UnionFind():
    def __init__(self,n):
        self.n=n
        self.parents=[-1]*n

    def find(self,x):
        if self.parents[x]<0:
            return x
        else:
            self.parents[x]=self.find(self.parents[x])
            return self.parents[x]

    def union(self,x,y):
        x=self.find(x)
        y=self.find(y)
        if x==y:
            return
        elif self.parents[x]>self.parents[y]:
            x,y=y,x
        self.parents[x]+=self.parents[y]
        self.parents[y]=x

    def size(self,x):
        return -self.parents[self.find(x)]

    def same(self,x,y):
        return self.find(x)==self.find(y)

    def members(self,x):
        root=self.find(x)
        return [i for i in range(self.n) if self.find(i)==root]

    def roots(self):
        return [i for i,x in enumerate(self.parents) if x<0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r:self.menbers(r) for r in self.roots()}

    def __str__(self):
        return " \n".join('{}:{}'.format(r,self.members(r)) for r in self.roots())

if __name__ == '__main__':
    N,M=list(map(int,input().split()))
    LIST=[list(map(int,input().split())) for i in range(M)]
    union_find=UnionFind(N)
    for l in LIST:
        union_find.union(l[0]-1,l[1]-1)

    print(union_find.group_count())


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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define ALL(name) name.begin(),name.end()
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 998244353;
#define MAX_N 100010

// x の n 乗 を m で余りをとったもの
ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1;
    while ( n > 0) {
        if (n & 1) { res = res * x % mod; } // 最下位ビットが立っているときに x^(2^i) を掛ける
        x = x * x % mod;                    // x を順次 2 乗していく
        n >>= 1;
    }
    return res;
}

ll N;
vector<ll> D;

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

    cin >> N;
    D.resize(N);
    REP(i, N) { cin >> D[i]; }

    // 0 がない
    if(D[0] > 0) {
        printf("0\n");
        return 0;
    }
    SORT(D);

    // 0 が 2 つ以上
    if(D[0] == 0 && D[0] == D[1]) {
        printf("0\n");
        return 0;
    }
    int cur = -1;
    int tmp = 1;
    map<ll, ll> cnt;
    REP(i, N) {
        if(cur != D[i]) {
            // 深さに飛びがある
            if(abs(cur - D[i]) > 1) {
                printf("0\n");
                return 0;
            }
            if(cur >= 0) { cnt[cur] = tmp; }
            tmp = 0;
            cur = D[i];
        }
        tmp++;
    }
    cnt[cur] = tmp;

    ll ans = 1;
    for(int i = 2; i <= N; ++i) {
        if(cnt.count(i) == 0) { break; }

        ll ans_t = mod_pow(cnt[i-1], cnt[i], MOD);
        ans *= ans_t;
        ans %= MOD;

    }

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

    return 0;
}


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

int main() {
    int K, X; cin >> K >> X;
    for (int i = X - K + 1; i < X + K; i++) {
        if (i == X + K) {
            cout << i << endl;
        } else {
            cout << i << ' ';
        }
    }
    cout << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <queue>

using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define pb(x) push_back(x)
#define int long long

int N;
vector<int> et[100000];
vector<int> ec[100000];
int q, r;
int x, y;
int dist[100000];

void dfs(int v, int p = -1, int d = 0) {
	dist[v] = d;
	rep(i, et[v].size()){
		if (et[v][i] == p) continue;
		dfs(et[v][i], v, d + ec[v][i]);
	}
}

signed main(void){
	cin >> N;
	rep(i, N-1){
		int a, b, c;
		cin >> a >> b >> c;
		a--; b--;
		et[a].pb(b);
		et[b].pb(a);
		ec[a].pb(c);
		ec[b].pb(c);
	}

	cin >> q >> r;
	r--;
	dfs(r);

	rep(i, q){
		cin >> x >> y;
		x--; y--;
		cout << dist[x]+dist[y] << endl;
	}

	return 0;
}

Measured memory_bytes: 21376
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    String[]C = new String[h];

    for(int i=0; i<h; i++) {
    	C[i] = sc.next();
    }
    for(int i=0; i<h; i++) {
    		System.out.println(C[i]);  
            System.out.println(C[i]);
    }
}
}


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

int main() {
    int N, A, B;
    cin >> N >> A >> B;
    int count = 0;
    int sum = 0;

    for(int i=1; i <= N; i++) {
        int dig_sum = 0;
        int num = i;
        while(num) {
            dig_sum += (num % 10);
            num /= 10;
        }
        if(dig_sum >= A && dig_sum <= B) sum += i;
    }
    cout << sum << endl;
}

Measured memory_bytes: 3604
//submitted by HimJ
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define fr(i,s,e) for(i=s;i<e;i++)
#define ms(arr,val) memset(arr,val,sizeof(arr))
using namespace std;
const int mxn=500+1;
ll arr[mxn][mxn];
ll d[mxn][mxn];
ll c;
ll n,ans=1e18;
ll col[3][31];
void solve()
{
    
    int i,j,k;
    fr(i,1,n+1)
    {
        fr(j,1,n+1)
        {
            fr(k,1,c+1)
            col[(i+j)%3][k]+=d[arr[i][j]][k];
            
        }
    }

}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  ll t=1;
  //cin>>t;
    while(t--){
            cin>>n>>c;
      ll i,j,k;      
      ans=1e18;
      ms(col,0);
    fr(i,1,c+1)
    {
        fr(j,1,c+1)
        cin>>d[i][j];
    }
    fr(i,1,n+1)
    fr(j,1,n+1)
    cin>>arr[i][j];
    ll temp=0;
    solve();
    fr(i,1,c+1)
    {
    	temp=0;
        temp=col[0][i];
        fr(j,1,c+1)
        {
            if(i==j)
                continue;
            temp+=col[1][j];
            fr(k,1,c+1)
            {
                if(i==k||j==k)
                    continue;
                temp+=col[2][k];
                //cout<<i<<" "<<j<<" "<<k<<" "<<temp<<"\n";
                ans=min(ans,temp);
                temp-=col[2][k];
            }
            temp-=col[1][j];
        }
    }
      cout<<ans;      

    }
  return 0;
  }



Measured memory_bytes: 2304
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a) 
#define DEBUG(x) 
#define DEBUGS(v) 
#endif
/* clang-format on */

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll x, t;
  cin >>x >> t;
  cout << max(0ll, x-t) << endl;
  return 0;
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int a, b;
	cin >> a >> b;
	int res1 = 0, res2 = 0;
	rep(i, b) {
		res1 += a * pow(10, i);
	}
	rep(i, a) {
		res2 += b * pow(10, i);
	}
	string S = to_string(res1), T = to_string(res2);
	if (S > T) dunk(T);
	else dunk(S);
	return 0;
}

Measured memory_bytes: 384
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	return n
}

func main() {
	sc.Split(bufio.ScanWords)
	N := nextInt()
	max, cnt := 0, 0
	for i := 0; i < N; i++ {
		cnt++
		if nextInt() == 0 {
			cnt = 0
		}
		if cnt > max {
			max = cnt
		}
	}
	fmt.Println(max + 1)
}



Measured memory_bytes: 1092
#include<stdio.h>
int main()
{
    char a;
    int i, j;
    int x[26]={0};
    while(scanf("%c", &a)!=EOF){
        for(i=0;i<26;i++){
            if(a=='a'+i||a=='A'+i){
                x[i]++;
            }
        }
    }
    for(j=0;j<26;j++){
        printf("%c : %d\n",'a'+j,x[j]);
    }
    return 0;
}

Measured memory_bytes: 540
#!/usr/bin/env python3


def isPalindrome(s: str):
    return list(s) == list(reversed(s))

S = input()
N = len(S)

s2 = S[0:(N - 1)//2]
s3 = S[(N + 1)//2:]

if all([isPalindrome(x) for x in [S, s2, s3]]):
    print("Yes")
else:
    print("No")





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

int main() {
 string s1,s2;
  int cnt=0;
   cin>>s1>>s2;
  if(s1.at(0)==s2.at(0)) cnt++;
   if(s1.at(1)==s2.at(1)) cnt++;
   if(s1.at(2)==s2.at(2)) cnt++;
  
   cout<<cnt<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
 
#define pb push_back
// #define mp make_pair
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define hell1 1000000007
#define hell2 1000000009
#define pi 3.1415926535
#define ms(s, n) memset(s, n, sizeof(s))
#define prec(n) fixed<<setprecision(n)
#define eps 0.000001
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define ll unsigned long long
#define ld long double 
#define no_of_digits(n) floor(log10(n)) + 1
#define see(x) cerr << (#x) << " is " << (x) << endl
#define INF 1e13
#define LL_MAX 1e18
// memset(array, -1, sizeof(array[0][0]) * row * count)
using namespace std;
 
ll mult(ll a,ll b, ll p=hell1){   return ((a%p)*(b%p))%p; }
ll multbig(ll a,ll b,ll mod=hell1){   if(a==0 or b==0) return 0;if(a==1 or b==1) return (a*b)%mod;ll cur=multbig(a,b/2,mod);cur=(2*cur)%mod;if(b%2) cur=(cur+a)%mod;return cur;}
ll add(ll a, ll b, ll p=hell1){ if(a>=p) a%=p; if(b>=p) b%=p; if(a+b>p) return (a + b)%p; else return a+b;}
ll sub(ll a, ll b, ll p=hell1){return (a%p - b%p + p)%p;}
ll fpow(ll n, ll k, ll p = hell1) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = mult(r,n,p); n = mult(n,n,p);} return r;}
ll inv(ll a, ll p = hell1) {return fpow(a, p - 2, p);}
ll inv_euclid(ll a, ll m = hell1){ll m0 = m;ll y = 0, x = 1;if (m == 1)return 0;while (a > 1){ll q = a / m;ll t = m;m = a % m, a = t;t = y;y = x - q * y;x = t;}if (x < 0)x += m0;return x;}
int isPowerof2(ll x) { return (x && !(x & x-1)); } 
ll log2(ll x) { ll res = 0; while (x >>= 1) res++; return res; } 
bool isPerfectSquare(long double x) {long double sr = sqrt(x); return ((sr - floor(sr)) == 0); }
bool check(ll i,ll j,ll n){return (i>=0 && i<n && j>=0 &&  j<n);} //matrix boundary checking
 
 
ll ceil(const ll &a, const ll &b){return (a - 1)/b + 1;}
 
// max({a, b, c, d})
// cout << fixed for removing e notation
 
bool comp(pair<ll, ll>a, pair<ll, ll>b)
{
    if(a.se*b.fi + b.se > b.se*a.fi + a.se) return true;
    else return false;
}
 
void convert(int arr[], int n) 
{ 
    int temp[n+1];
    for(int i=1;i<=n;i++)
        temp[i] = arr[i]; 
    // memcpy(temp, arr, n*sizeof(int)); 
  
    sort(temp+1, temp+n+1);   
    unordered_map<int, int> umap;
    int val = 1; 
    for (int i = 1; i <= n; i++) 
        umap[temp[i]] = val++;
    for (int i = 1; i <= n; i++) 
        arr[i] = umap[arr[i]]; 
}
 
bool prime[10000005];
void SieveOfEratosthenes(int n) 
{
    memset(prime, true, sizeof(prime)); 
    prime[0] = prime[1] = 0;
    for (int p=2; p*p<=n; p++) 
    {
        if (prime[p] == true) 
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
    }
}

int foo(int a, int b, int c)
{
    return (abs(a-b) + abs(b-c) + abs(a-c));
}


ll getFirstSetBitPos(ll n) 
{ 
    return log2(n & -n) + 1; 
} 

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

    int a[n];

    vector<int>ans;

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

    int cnt = 0;
    for(int i=n-1;i>=0;i--)
    {
        if(a[i] <= a[i-1]) cnt++;
        else
        {
            ans.pb(cnt);
            cnt = 0;
        }
    }

    cout << *max_element(all(ans)) << "\n";

}


Measured memory_bytes: 1276
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int A, B, C, D;
    
    cin >> A >> B >> C >> D;
    
    int AB = A * B;
    
    int CD = C * D;
    
    if ( AB < CD )
    cout << CD << endl;
    
    else if ( AB > CD )
    cout << AB << endl;
    
    else 
    cout << AB << endl;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define me BOSS
#define bug() cout<<"AIkahne aise"<<endl
ll A[5000001],bin[5000001];
vector<ll>v;
map<int,int>myMap;
set<int>mySet;
vector<pair<ll,ll> >vp;
/*void bti(ll n)
{
ll k=1;
  while(n!=0)
    {
    bin[k++]=n%2;
    n/=2;
    }
}*/
/*void sieve()
{
    for(ll i=3; i<=2000; i+=2)
    {
        for(ll j=i*i; j<=4000000; j+=i)
            A[j]=1;
    }
    v.push_back(2);
    for(ll i=3; i<=4000000; i+=2)
        if(A[i]==0)
            v.push_back(i);
}*/
int main()
{
    ll r,c,a,b;
    cin>>r>>c>>a>>b;
    if(a>c/2||b>r/2)
        cout<<"-1"<<endl;
    else
    {
        for(int i=1; i<=b; i++)
        {
            for(int j=1; j<=c; j++)
            {

                if(j<=a)
                {
                    cout<<"1";
                }
                else
                    cout<<"0";
            }
            cout<<endl;
        }
        for(int i=b+1; i<=r; i++)
        {
            for(int j=1; j<=c; j++)
            {
                if(j<=a)
                    cout<<"0";
                else
                    cout<<"1";
            }
            cout<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 1280
using System;
class Program
{
    static void Main(string[] args)
    {
		string[] input = Console.ReadLine().Split(' ');
		int n = int.Parse(input[0]);
        int k = int.Parse(input[1]);     
		string[] numList = Console.ReadLine().Split(' ');
		int answer;
		answer = (int)Math.Ceiling((double)(n-1) / (double)(k - 1));
		Console.WriteLine(answer);
    }
}


Measured memory_bytes: 16480
#include<bits/stdc++.h>
#define maxn 3200
using namespace std;
const int mod = 1000000007;
char s[maxn];
int f[maxn][maxn];
int main(){
	ios::sync_with_stdio(false);
	int N;
	cin >> N >> s + 1;
	for(int i = 1; i <= N; i += 1) f[1][i] = 1;
	for(int i = 1; i <= N; i += 1){
		for(int j = 1; j <= N; j += 1) f[i][j] = (f[i][j] + f[i][j - 1]) % mod;
		for(int j = 1; j <= N - i; j += 1){
			if(s[i] == '>') f[i + 1][j] = (f[i][N] - f[i][j] + mod) % mod;
			else f[i + 1][j] = (f[i][j] - f[i][0] + mod) % mod;
		}
	}
	cout << f[N][N];
}

Measured memory_bytes: 39168