akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;

namespace _20200711
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            var max = 140;
            var dic = new Dictionary<int, int>();
            for (var x = 1; x <= max; ++x)
            {
                for (var y = 1; y <= max; ++y)
                {
                    for (var z = 1; z <= max; ++z)
                    {
                        var f = x * x + y * y + z * z + x * y + y * z + z * x;
                        if (f > n)
                        {
                            break;
                        }
                        if (dic.ContainsKey(f))
                        {
                            ++dic[f];
                        }
                        else
                        {
                            dic.Add(f, 1);
                        }
                    }
                }
            }
            for (var f = 1; f <= n; ++f)
            {
                Console.WriteLine(dic.ContainsKey(f) ? dic[f] : 0);
            }
        }
    }
}


Measured memory_bytes: 28176
# -*- coding: utf-8 -*-
rate = int(input())
dan = 0

if rate < 600:
    dan = 8
elif rate < 800:
    dan = 7
elif rate < 1000:
    dan = 6
elif rate < 1200:
    dan = 5
elif rate < 1400:
    dan = 4
elif rate < 1600:
    dan = 3
elif rate < 1800:
    dan = 2
else:
    dan = 1
    
print(str(dan))

Measured memory_bytes: 9120
import java.util.*;
import java.util.stream.Stream;

public class Main{
	public static void main(String[] args){
		
		
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();   
        int count = 0;
        
        String con = String.valueOf(S);
        String s[] = con.split("");
        int con2[] = Stream.of(s).mapToInt(Integer::parseInt).toArray();

        
        for(int i=0; i<con2.length; i++){
        	if(con2[i] == 1){
        		count++;
        	}
        }
        
    
	   
	   System.out.println(count);
	 }
}


Measured memory_bytes: 28500
#include <stdio.h>
#define MAX 100
#define BLACK 2
#define GRAY 1
#define WHITE 0

int n,A[MAX][MAX],d[MAX],color[MAX],cnt = 0;

int main(){
  int i,j,v,u,k,c,l,m,y,min;

  scanf("%d",&n);

  for(i = 0; i < n; i++){
    for(j = 0; j < n; j++){
      A[i][j] = 99999999;
    }
  }

  for(i = 0; i < n; i++){
    scanf("%d%d",&u,&k);
    for(j = 0; j < k; j++){
      scanf("%d%d",&v,&c);
      A[u][v] = c;
    }
  }

  for(i = 0; i < n; i++){
    color[i] = 0;
    d[i] = 99999999;
  }

  d[0] = 0;
  color[0] = GRAY;
  while(1){
    min = 99999999;
    l = -1;
    for(i = 0; i < n; i++){
      if(color[i] != BLACK && d[i] < min){
	min = d[i];
	l = i;
      }
    }

    if(l == -1) break;

    color[l] = BLACK;

    for(m = 0; m < n; m++){
      if(color[m] != BLACK && A[l][m] != 99999999){
	if(A[l][m] + d[l] < d[m]){
	  d[m] = A[l][m] + d[l];
	  color[m] = GRAY;
	}
      }
    }
  }

  for(i = 0; i < n; i++){
    printf("%d %d\n",i,d[i]);
  }

  return 0;
}



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

int main()
{
    int n, i, count = 0;

    cin >> n;

    int a[n + 1];

    for (i = 1; i <= n; i++)
    {
        cin >> a[i];
        if (i % 2 && a[i] % 2)
        {
            count++;
        }
    }

    cout << count << "\n";
    return 0;
}

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

int main(){
  vector<int> a(3);
  cin >> a.at(0) >> a.at(1) >> a.at(2);
  sort(a.begin(),a.end());
  string ans;
  if(a.at(0) + a.at(1) == a.at(2)) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>
#include <queue>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()

vector<pll> G[100000];
ll cost[100000];
bool used[100000];

void dijkstra(int n) {
    used[n] = true;
    priority_queue<pll> que;
    for (auto e : G[n]) que.push(e);

    while (!que.empty()) {
        auto edge = que.top(); que.pop();
        if (used[edge.second]) continue;

        used[edge.second] = true;
        cost[edge.second] = edge.first;

        for (auto e : G[edge.second]) {
            if (used[e.second]) continue;
            que.push({e.first + edge.first, e.second});
        }
    }
}

int main() {
    int N, a, b, c, Q, K;
    cin >> N;
    REP(i, N - 1) {
        cin >> a >> b >> c;
        G[a - 1].push_back({c, b - 1});
        G[b - 1].push_back({c, a - 1});
    }
    cin >> Q >> K;

    dijkstra(K - 1);

    int x, y;
    REP(i, Q) {
        cin >> x >> y;
        cout << cost[x - 1] + cost[y - 1] << endl;
    }
    return 0;
}

Measured memory_bytes: 10352
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl

using namespace std;

typedef long long int lli;

int main() {
    int M;
    cin >> M;
    cout << 48 - M << endl;
    return 0;
}

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

ans = 0
for x in edges:
    l = list(range(n))
    for y in edges:
        if y != x:
            l = [l[y[0]-1] if l[i] == l[y[1] - 1] else l[i] for i in range(n)]
    if len(set(l)) != 1:
        ans += 1
print(ans)


Measured memory_bytes: 3060
import copy
S = input()
N = len(S)

def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True
      
if is_kaibun(S) and is_kaibun(S[:((N-1)//2)]) and is_kaibun(S[((N+2)//2):]):
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3444
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
#define rep(i,a,b) for (int i = a; i < b; i++)
#define repn(i,a,b) for (int i = a; i >=b ;i--)
#define MOD 1000000007


int main(){
ios::sync_with_stdio(0);
cin.tie(0);
   ll a,b;cin>>a>>b;
   cout<<a*b; 
 
return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
long long a,b[1000010],c,d,now,now_,ans;
int main()
{
	cin>>a;
	for(int s=0;s<a;s++)
	{
		cin>>b[s];
	}
	b[a]=-1;
	sort(b,b+a);
	for(int s=0;s<a;s++)
	{
		now=b[s];
		now_++;
		if(b[s]!=b[s+1])
		{
			if(now>now_)ans=ans+now_;
			else if(now<now_)ans+=now_-now;
			now_=0;
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 1024
# 入力
n, k = map(int, input().split())
xs = list(map(int, input().split()))

if 0 in xs:
    xs.remove(0)
    k -= 1

puls = [x for x in xs if x > 0][:k]
minus = [x for x in xs[::-1] if x < 0][:k]
xs = minus[::-1] + [0] + puls
k += 1

crange = []
if len(minus) < len(puls):
    crange = [(len(xs)-p-k, len(xs)-p-1) for p in range(len(xs)-k+1)]
else:
    crange = [(p, p+k-1) for p in range(len(xs)-k+1)]

print(min([min(xs[c2]-2*xs[c1], 2*xs[c2]-xs[c1]) for c1, c2 in crange]))


Measured memory_bytes: 17340
#include <iostream>
#include <stdio.h>

using namespace std;

int main() {
	int h,m,s;
	
	cin >> s;

	h=s/3600;
	s=s%3600;
	m=s/60;
	s=s%60;
	
	printf("%d:%d:%d\n", h,m,s);

	return 0;
}

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

N = int(input())
L = list(map(int, input().split()))
ret = 0
for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            if L[i]<L[j]+L[k] and L[j]<L[i]+L[k] and L[k]<L[i]+L[j]:
                if L[i] != L[j] and L[j] != L[k] and L[i]!=L[k]:
                    ret += 1

print(ret)


Measured memory_bytes: 9136
import java.util.Scanner;

public class Main{
	char[] alp;
	int alpha, beta;
	
	Main(){
		Scanner sc = new Scanner(System.in);
		alp = new char[26];
		for(int i = 0; i < 26; i++){
			alp[i] = (char)('a'+i);
		}
		int n = Integer.parseInt(sc.nextLine());
		for(int k = 0; k < n; k++){
			String str = sc.nextLine();
			String res = "";
			char[] ch = str.toCharArray();
			alpha = 1;
			boolean f = true;
			do{
				for(beta = 0; beta < 26 && f; beta++){
					res = "";
					for(int i = 0; i < str.length(); i++){
						if(ch[i] == ' '){
							res += ch[i];
							continue;
						}
						res += alp[(alpha*(int)(ch[i]-'a')+beta)%26];
					}
					f = check(res);
				}
				for(alpha++; (alpha%2 == 0 || alpha%13 == 0) && f; alpha++);
			} while(f);
			
			System.out.println(res);
		}
	}
	
	boolean check(String str){
		String[] st = str.split(" ");
		boolean f = true;
		
		for(String s: st){
			if(s.equals("this") || s.equals("that")){
				f = false;
				break;
			}
		}
		
		return f;
	}
	
	public static void main(String[] args){
		new Main();
	}
}

Measured memory_bytes: 12000
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <queue>
#include <utility>
#include <set>

#define REP(i,a,b) for(int i=int(a);i<int(b);i++)

using namespace std;

typedef long long int lli;
typedef pair<int,int> pii;

struct Data {
    int cost;
    int x;
    int y;
    Data(int c, int x, int y) : cost(c), x(x), y(y) {}
};

bool operator<(Data d1, Data d2) {
    return d1.cost < d2.cost;
}

class UnionFind {
private:
    int N;
    vector<int> parents;
public:
    UnionFind(int n) : N(n) {
        parents.resize(N);
        REP (i, 0, N) parents[i] = i;
    }

    int Find(int x) {
        if (x == parents[x]) return x;
        else return parents[x] = Find(parents[x]);
    }

    void Union(int x, int y) {
        int px = Find(x);
        int py = Find(y);
        parents[px] = py;
    }

    bool isSame(int x, int y) {
        return Find(x) == Find(y);
    }


};

int main () {
    int N;
    cin >> N;
    vector<pii> x;
    vector<pii> y;
    x.reserve(N);
    y.reserve(N);
    set<pii> s;
    REP (i, 0, N) {
        int xx, yy;
        cin >> xx >> yy;
        if (s.count(make_pair(xx, yy)) == 0) {
            x.push_back(make_pair(xx, s.size()));
            y.push_back(make_pair(yy, s.size()));
            s.insert(make_pair(xx, yy));
        }
    }
    N = s.size();
    sort(x.begin(), x.end());
    sort(y.begin(), y.end());

    vector<Data> Edge;

    REP (i, 0, N) {
        auto itx = lower_bound(x.begin(), x.end(), x[i]);
        int index = distance(x.begin(), itx);
        if (index != 0) {
            Edge.push_back(Data(x[index].first - x[index - 1].first, x[index - 1].second, x[index].second));
        }
        if (index != N - 1) {
            Edge.push_back(Data(x[index + 1].first - x[index].first, x[index + 1].second, x[index].second));
        }

        auto ity = lower_bound(y.begin(), y.end(), y[i]);
        index = distance(y.begin(), ity);
        if (index != 0) {
            Edge.push_back(Data(y[index].first - y[index - 1].first, y[index - 1].second, y[index].second));
        }
        if (index != N - 1) {
            Edge.push_back(Data(y[index + 1].first - y[index].first, y[index + 1].second, y[index].second));
        }
    }
    sort(Edge.begin(), Edge.end());
    lli cost = 0;
    UnionFind uf(N);
    REP (i, 0, Edge.size()) {
        auto e = Edge[i];
        if (!uf.isSame(e.x, e.y)) {
            cost += e.cost;
            uf.Union(e.x, e.y);
        }
    }
    cout << cost << endl;
    return 0;
}


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

int main(){
	int m_min = 100;
	int m_max = 0;
	int h_min = 100;
	int h_max = 0;
	for(int i = 0;i<4;i++){
		int s;
		cin>>s;
		if(m_min >s){
			m_min = s;
		}
		m_max += s;
	}
	m_max -= m_min;
	for(int i = 0;i<2;i++){
		int h;
		cin>>h;
		if(h_min >h){
			h_min = h;
		}
		h_max += h;
	}
	h_max -= h_min;
	m_max += h_max;
	cout<<m_max<<endl;
	return 0;
}

Measured memory_bytes: 3056
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
#include<fstream>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define out(str) cout << str << endl
#define ALL(a) (a).begin(),(a).end()
#define INF (1<<29)

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

int N,K;
string S;

int main(){
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    cin>>N>>K>>S;
    S[K-1] = tolower(S[K-1]);
    out(S);
    
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
    public void exec() throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);
    	String W = br.readLine();
    	int count=0;
    	while(true) {
        	String line = br.readLine();
        	if ("END_OF_TEXT".equals(line))
        		break;
        	String[] words = line.split(" ");
        	for(String word: words)
        		if(W.toLowerCase().equals(word.toLowerCase())) 
        			count++;
    	}
    	out.println(count);
        out.flush();
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
}

Measured memory_bytes: 24368
#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define LOOP(i) while(i--)
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

class Data{
public:
	int first;
	double second;
	string third;
};

int main(){
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	int N;
	while(cin>>N){
		N %= 39;
		if(!N) N=39;
		printf("3C%02d\n",N); 
	}
	
	return 0;
}



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

const int INF = 1 << 29;

int main(void){
    int n,ma,mb;
    cin >> n >> ma >> mb;
    int a[n],b[n],c[n];
    rep(i,n)cin >> a[i] >> b[i] >> c[i];
    
    int alina = INF;
    
    int dp[n+1][n*11][n*11];
    rep(i,n+1){
        rep(j,n*11){
            rep(l,n*11)dp[i][j][l] = INF;
        }
    }
    dp[0][0][0] = 0;
    
    rep(i,n){
        for(int j = 0;j <= 10*n;j++){
            for(int l = 0;l <= 10*n;l++){
                dp[i+1][j][l] = dp[i][j][l];
                if(j >= a[i] && l >= b[i]){
                    dp[i+1][j][l] = min(dp[i+1][j][l],dp[i][j-a[i]][l-b[i]]+c[i]);
                }
                if(j / ma == l / mb && j % ma == 0 && l % mb == 0 && i > 0 && j > 0){
                    alina = min(alina,dp[i+1][j][l]);
                }
            }
        }
    }
    
    if(alina == INF)alina = -1;
    cout << alina << endl;
}

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

int main()
{
    int a1, a2, a3;
    cin >> a1 >> a2 >> a3;
    if (a1 + a2 + a3 > 21)
        cout << "bust" << endl;
    else
        cout << "win" << endl;
}


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

typedef long long int ll;

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  
  int n, w;
  cin >> n >> w;
  
  vector<ll> dp(w+1, 0);
  
  for(int i=1;i<=n;++i)
  {
    int wi;
    ll v;
    cin >> wi >> v;
    for(int j = w; j >= wi; --j)
      if(j-wi == 0 || dp[j-wi]) dp[j] = max(dp[j], dp[j-wi] + v);
  }
  
  cout << *max_element(dp.begin(), dp.end()) << endl;
  
  return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		sc.close();
		int count = 0;
		for (char c : S.toCharArray()) {
			if (c == '1') {
				count++;
			}
		}
		
		System.out.println(count);
	}
}

Measured memory_bytes: 22868
#include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<algorithm>
#define N 200010
using namespace std;
inline int read()
{
	int neg=1,num=0;char c=getchar();
	for(;!isdigit(c);c=getchar())if(c=='-')neg=-1;
	for(;isdigit(c);c=getchar())num=(num<<1)+(num<<3)+c-'0';
	return neg*num;
}
int n,a[N],s[N],l[N],r[N];
long long ans;
int main()
{
	n=read();
	for(int i=1;i<=n;i++)a[i]=read();
	for(int i=1;i<=n;i++)
		for(l[i]=i;l[i]>1 && a[l[i]-1]>a[i];l[i]=l[l[i]-1]); 
	for(int i=n;i>=1;i--)
		for(r[i]=i;r[i]<=n && a[r[i]+1]>a[i];r[i]=r[r[i]+1]);
	for(int i=1;i<=n;i++)ans+=1ll*a[i]*(r[i]-i+1)*(i-l[i]+1);
	printf("%lld",ans);
	return 0;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
typedef long long ll;
int main(){

	map<int,int> m;
	rep(i,4) {
		int a;
		cin >> a;
		m[a]++;
	}

	if (m[1]&&m[9]&&m[7]&&m[4]) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, 1000000)

	s := getString()

	ans := 0
	for _, v := range s {
		if v == '1' {
			ans++
		}
	}
	out(ans)
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
using ll = long long;
using P = pair<int, int>;

int main(){
    ll x; cin >> x;
    ll ans = x/11; 
    int r = x % 11;
    int add = 0;
    if(r > 0) add = 1;
    if(r > 6) add = 2;
    cout << ans * 2 + add << endl;
}

Measured memory_bytes: 256
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N = int(input())
    W = list(map(int, input().split()))
    wts = [0 for _ in range(N + 1)]
    for i in range(N):
        wts[i + 1] = wts[i] + W[i]

    ans = 10 ** 9 + 7
    for i in range(N):
        ans = min(ans, abs(wts[i + 1] - (wts[N] - wts[i + 1])))

    print(ans)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner number = new Scanner(System.in);
		int a  = number.nextInt();
		double[] b = new double[a];
		int c = 0;
		double d;

		for(int i = 0;i < a;i++) {
			b[i] = number.nextInt();
			c++;
			d = b[i] / 3;
			for(double j = 2;j < Math.sqrt(b[i]) + 1;j++) {
				if(b[i] % 2 == 0 && b[i] > 2) {
					
					c--;
					break;
				}
				if(b[i] % j == 0 && b[i] != 2) {
				
					c--;
					break;
				}
				
			}
			
		}
		System.out.println(c);
	}
}



Measured memory_bytes: 40168
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
using namespace std;


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

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

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

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}


#define REP(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define RALL(v) (v).rbegin(),(v).rend()
#define PB push


#define MOD 1000000007LL
#define EPS 1e-10

int main()
{
	int N, i;
	cin >> N >> i;
	cout << ( N - i + 1 ) << endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<math.h>
#include<algorithm>
using namespace std;
typedef long long ll;

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


int main() {
	long double d, t, s;
	cin >> d >> t >> s;
	if (d / s > t)cout << "No";
	else cout << "Yes";
	return 0;
}

Measured memory_bytes: 3704
s = input()

# 0 スタートの文字列に変換
ans1 = s[::2].count('1') + s[1::2].count('0')
# 1 スタートの文字列に変換
ans2 = s[::2].count('0') + s[1::2].count('1')
ans = min(ans1, ans2)

print(ans)

Measured memory_bytes: 3188
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main(void){
    // Here your code !
    int n,t,m;
    cin >> n;
    
    (t = ceil((sqrt(1+8*n)-1) / 2));
    m = (t*(t+1))/2;
    
    for(int i = 1; i <= t; i++){
        if( n == m - i ){
        }
        else{
            cout << i << endl;
        }
    }
    
    
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
  char s[1];
  scanf("%s",s);
  if(s[0]>='a' && s[0]<='z')
  {
    printf("a");
  }
  else if(s[0]>='A' && s[0]<='Z')
  {
  	printf("A");
  }
  
}

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

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main(void){
    int N;
    long x;
    scanf("%d%ld",&N,&x);

    long* A;
    NEW(A,N);
    for(int i=0;i<N;i++){
        scanf("%ld",&A[i]);
    }

    long ans=0;
    for(int i=1;i<N;i++){
        int diff=A[i]+A[i-1]-x;
        if(diff>0){
            if(A[i]>=diff)A[i]-=diff;
            else{
                A[i-1]-=(diff-A[i]);
                A[i]=0;
            }
            ans+=diff;
        }
    }
    printf("%ld\n",ans);

    return 0;
}

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

using namespace std;
#define ll long long
#define ld long double
#define  P pair<ll,ll>
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,m,n) for(ll i=n; i>=(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define VEC2(x,a,b) vector<vector<ll>> x = vector<vector<ll>>(a,vector<ll>(b,0))
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "; cout<<endl
#define cout(n) cout<<fixed<<setprecision(n)
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    if(n >= 3) cout<<0<<endl;
    else if(n == 1) cout<<2<<endl;
    else cout<<1<<endl;
}



Measured memory_bytes: 3164
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
using namespace std;
vector<bool> prime_table(int n) {
  vector<bool> prime(n + 1, true);
  if(n >= 0) prime[0] = false;
  if(n >= 1) prime[1] = false;
  for(int i = 2; i * i <= n; i++) {
    if(!prime[i]) continue;
    for(int j = i + i; j <= n; j += i) {
      prime[j] = false;
    }
  }
  return prime;
}
int main() {
    int Q;
    cin >> Q;
    auto primes = prime_table(100000);
    vector<int> s(primes.size(), 0);
    for (int i = 1; i < s.size(); i++) {
        s[i] = s[i - 1] + (primes[i] && primes[(i + 1) / 2]);        
    }
    for (int i = 0, l, r; i < Q; i++) {
        cin >> l >> r;
        cout << s[r] - s[l - 1] << endl;
    }
}


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

int main(){
  int n,d;
  cin >> n >> d;
  int ans = 0;
  
  int w = 2*d+1;
  
  ans = (n+w-1)/w;
  
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define st first
#define nd second                   
#define fori(i, a, b, c) 	for (int i = (int)(a); i <= (int)(b); i += (int)(c))
#define ford(i, a, b, c) 	for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define MOD 998244353

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef long long lol;
typedef vector<lol> vlol;

ifstream in ("input");

const int NR = 3e3 + 5;
lol a[15][1005], sp[15][1005];
int n, k, m, sol = (1<<30);
string s;
vi b;
int main()	{
	ios::sync_with_stdio(false);
	 int mask, i, j, linii, sw;
	cin >> n >> m >> k;
	fori(i, 1, n, 1){
		cin >> s;
		fori(j, 0, m-1, 1)
		   a[i][j+1] = s[j] -'0';
	}

	fori(i, 1, n, 1)                          
	fori(j, 1, m, 1)
	a[i][j] += a[i-1][j];
	
	fori(mask, 0, (1<<(n-1))-1, 1)	{
		sw = 0;
		b.clear();
		b.pb(0);
		fori(i, 0, n-1, 1)	{
			if ((1<<i)&mask)
				b.pb(i+1);
		}	
		b.pb(n);
	        fori(j, 1, m, 1)
		fori(i, 1, b.size()-1, 1)	{	
		sp[i][j] = a[b[i]][j] - a[b[i-1]][j];
		if (sp[i][j] > k) 
			sw = -1;
		}
		if (sw == -1)	continue;

		linii = b.size()-2;		

		fori(j, 1, m, 1) 	{
			sw = 0 ;
			fori(i, 1, b.size()-1, 1){
				sp [i][j] += sp[i][j-1];
				if (sp[i][j] > k)	sw = 1;	
			}
			if (!sw)	continue;
			linii++;
			fori(i, 1, b.size()-1, 1){
				sp[i][j] = a[b[i]][j] - a[b[i-1]][j];
			}
		}
		sol = min (sol, linii);
	}		
	cout << sol;


}












Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

int main(){
  int x,k,q;
  cin>>x>>k;
  vector<int> rt(k);
  rep(i,k) cin>>rt[i];
  rt.pb(INF);
  cin>>q;
  vector<pair<int,int>> a(q);
  vector<pair<int,int>> t(q);
  rep(i,q){
    cin>>t[i].first>>a[i].first;
    t[i].second = a[i].second = i;
  }
  sort(all(a));
  sort(all(t));
  vector<int> pos(q);
  rep(i,q) pos[a[i].second] = i;

  int l=-1, r=q;
  int vl=a[0].first, vr=a[q-1].first;
  int tp = 0;
  int unf = 0;
  vector<int> ans(q);
  rep(i,q+1){
    while(tp<q && t[tp].fi <= rt[i]){
      int idx = t[tp].se;
      int base;
      if(pos[idx] <= l){
        base = vl;
      } else if(pos[idx] >= r){
        base = vr;
      } else {
        base = a[pos[idx]].fi + unf;
      }
      int df = t[tp].fi - ( (i==0) ? 0 : rt[i-1]);
      if(i%2==0) df *= -1;
      ans[idx] = min(x, max(0,base+df));
      tp++;
    }
    if(tp==q) break;

    int df = (i==0) ? rt[0] : (rt[i]-rt[i-1]);
    if(i%2==0) df *= -1;
    vl = min(x, max(0, vl + df));
    vr = min(x, max(0, vr + df));
    unf += df;
    if(i%2 == 0) {
      int lf = l, ri = r;
      while(ri - lf > 1){
        int mid = (ri + lf)/2;
        if(a[mid].fi + unf <= 0) lf = mid;
        else ri = mid;
      }
      l = lf;
    }
    else {
      int lf = l, ri = r;
      while(ri - lf > 1){
        int mid = (ri + lf)/2;
        if(a[mid].fi + unf >= x) ri = mid;
        else lf = mid;
      }
      r = ri;
    }
    // dbg(a,l,r,unf,vl,vr);
  }

  rep(i,q) cout << ans[i] << endl;

  return 0;
}


Measured memory_bytes: 3960
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int S = sc.nextInt();
		int ans = 0;
//
		if (K * 3 == S) {
			System.out.println("1");
			System.exit(0);
		}
//
		if (K == S) {
			System.out.println(K * 3);
			System.exit(0);
		}

		for (int x = 0; x <= K; x++) {
			for (int y = 0; y <= K; y++) {
//				for (int z = 0; z <= K; z++) {
					if (S - (x + y) <= K && S - (x + y) >= 0) {
						ans++;
					}


//				}
			}
		}





		System.out.println(ans);


		sc.close();
	}


}


Measured memory_bytes: 9684
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef vector<int> vei;
typedef vector<string> ves;
typedef vector<vector<int>> ve_vei;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define fs first
#define sc second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
 
int main() {
	//cout.precision(10);
	cin.tie(0);
	ios::sync_with_stdio(false);

    int N; cin >> N;
    vector<ll> A(N);
    rep(i,N) cin >> A[i];

    int cnt = 0;
    bool ans = true;
    while(ans){
        rep(i,N) {
            if(A[i] % 2 == 1) {
                ans = false;
                break;
            }
            else A[i] = A[i] / 2;
        }
        if(ans) cnt++;
    }
    cout << cnt << endl;
    return 0;

}

Measured memory_bytes: 256
#include <cassert>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <unordered_set>
#include <algorithm>
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
using namespace std;

typedef long long ll;

using namespace std;

ll vs[100000+10];
ll cs[100000+10];
int n;
// x以上の握手の、個数と合計
pair<ll, ll> calc(ll x) {
  ll cnt = 0;
  ll sum = 0;
  REP(i, n) {
    // x - vs[i] 以上の要素の最初
    ll t = lower_bound(vs, vs + n, x - vs[i]) - vs;
    // cerr << ">>> " << x << " " << i << " " << vs[i] << " " << t << " " << x - vs[i] << endl;;
    cnt += n - t;
    sum += cs[n] - cs[t] + (n - t) * vs[i];
  }
  return make_pair(cnt, sum);
}

int main(void) {
  ll m;
  scanf("%d%lld", &n, &m);
  REP(i, n) {
    scanf("%lld", &vs[i]);
  }
  sort(vs, vs + n);
  REP(i, n) {
    // cerr << " " << vs[i];
    cs[i+1] = cs[i] + vs[i];
  }
  // cerr << endl;
  ll left = 0;
  ll right = vs[n-1] * 2 + 1;
  while(left + 1 < right) {
    ll mid = (left + right) / 2;
    pair<ll, ll> p = calc(mid);
    // cerr << ">> " << left << " " << right << " " << p.first << " " << p.second << endl;
    if(p.first <= m) {
      right = mid;
    } else {
      left = mid;
    }
  }
  pair<ll, ll> p = calc(right);
  // cerr << "> " << right << " " << p.first << " " << p.second << endl;
  ll res = p.second - (p.first - m) * left;
  cout << res << endl;
  
  return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <vector>
using namespace std;
int N, M;
vector <int> G[1005];
bool A[1005][1005];
int Min[1005][1005], Max[1005][1005];
bool Use[1005];
int Pos[1005][1005];
pair <int, int> E[200005];
void DFS(int node)
{
    Use[node] = 1;
    for(int i = 0; i < G[node].size(); i++)
    {
        int neighb = G[node][i];
        if(Use[neighb] == 0)
            DFS(neighb);
    }
}
void precalcA(int node)
{
    for(int i = 1; i <= N; i++)
        Use[i] = 0;
    DFS(node);
    for(int i = 1; i <= N; i++)
        A[node][i] = Use[i];
}
void DFS2(int node, int a, int b)
{
    Min[a][node] = b;
    for(int i = 0; i < G[node].size(); i++)
    {
        int neighb = G[node][i];
        if(neighb == a)
            continue;
        if(Min[a][neighb] == 0)
            DFS2(neighb, a, b);
    }
}
void precalcMin(int node)
{
    for(int j = 0; j < G[node].size(); j++)
    {
        int neighb = G[node][j];
        if(Min[node][neighb] == 0)
            DFS2(neighb, node, j + 1);
    }
}
void DFS3(int node, int a, int b)
{
    Max[a][node] = b;
    for(int i = 0; i < G[node].size(); i++)
    {
        int neighb = G[node][i];
        if(neighb == a)
            continue;
        if(Max[a][neighb] == 0)
            DFS3(neighb, a, b);
    }
}
void precalcMax(int node)
{
    for(int j = G[node].size() - 1; j >= 0; j--)
    {
        int neighb = G[node][j];
        if(Max[node][neighb] == 0)
            DFS3(neighb, node, j + 1);
    }
}

void Read()
{
    cin >> N >> M;
    for(int i = 1; i <= M; i++)
    {
        int x, y;
        cin >> x >> y;
        G[x].push_back(y);
        Pos[x][y] = G[x].size();
        E[i] = make_pair(x, y);
    }
}

void Solve()
{
    for(int i = 1; i <= N; i++)
        precalcA(i);
    for(int i = 1; i <= N; i++)
    {
        precalcMin(i);
        precalcMax(i);
    }
    for(int i = 1; i <= M; i++)
    {
        int x = E[i].first, y = E[i].second;
        int cnt = 0;
        if(A[y][x] == 1)
            ++cnt;
        if(Min[x][y] != Pos[x][y] || Max[x][y] != Pos[x][y])
            ++cnt;
        if(cnt == 2 || cnt == 0)
            cout << "same\n";
        else
            cout << "diff\n";
    }
}
int main()
{
    Read();
    Solve();
    return 0;
}


Measured memory_bytes: 17152
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[][]a = new String[3][3];
        for(int i=0; i<3; i++) {
            for(int j=0; j<3; j++) {
                a[i][j] = sc.next();
            }
        }
        int n = sc.nextInt();
        for(int i=0; i<n; i++) {
            String b = sc.next();
            for(int j=0; j<3; j++) {
                for(int k=0; k<3; k++) {
                    if(b.equals(a[j][k])) {
                        a[j][k] = "0";
                    }
                }
            }
        }
        for(int i=0; i<3; i++) {
            if(a[i][0].equals("0") && a[i][1].equals("0") && a[i][2].equals("0")) {
                System.out.println("Yes");
                return;
            }
            if(a[0][i].equals("0") && a[1][i].equals("0") && a[2][i].equals("0")) {
                System.out.println("Yes");
                return;
            }
        }
        if(a[0][0].equals("0") && a[1][1].equals("0") && a[2][2].equals("0")) {
            System.out.println("Yes");
            return;
        }
        if(a[0][2].equals("0") && a[1][1].equals("0") && a[2][0].equals("0")) {
            System.out.println("Yes");
            return;
        }
        System.out.println("No");
    }
}

Measured memory_bytes: 21972
n = gets.to_i
h = Hash.new (0)
a = ['M', 'A', 'R', 'C', 'H']

n.times do
  h[gets.chomp![0]] += 1
end

cnt = a.combination(3).map do |i, j, k|
  h[i] * h[j] * h[k]
end.inject(:+)

p cnt


Measured memory_bytes: 2044
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
    int n, m, a[111], mm, sum = 0;
    cin>>n>>m;
    mm = m;
    for (int i = 0; i < n; i++) {
        cin>>a[i];
        sum += a[i];
    }
    for (int i = 0; i < n; i++) {
        if (a[i] * 4 * m >= sum) mm--;
    }
    if(mm <= 0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int[] a = sc.nextIntArray(n);
        Arrays.sort(a);
        System.out.println(a[n/2]-a[n/2-1]);
        
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
            return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }
    
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) a[i] = nextLong();
        return a;
    } 
}


Measured memory_bytes: 34036
n,c=map(x->parse(Int,x),split(readline()))
L=R=Rmax=Lmax=0
x=[]
v=[]
for i=1:n
	X,V=map(x->parse(Int,x),split(readline()))
	push!(x,X)
	push!(v,V)
	L+=V
end
ans=L-x[n]
for i=n:-1:1
	L-=v[i]
	R+=v[i]
	Rmax=max(Rmax,R-c+x[i])
	ans=max(ans,L-(i>1?x[i-1]*2:0)+Rmax)
end
for i=1:n
	L+=v[i]
	R-=v[i]
	Lmax=max(Lmax,L-x[i])
	ans=max(ans,R-(i<n?(c-x[i+1])*2:0)+Lmax)
end
println(ans)

Measured memory_bytes: 169104
import java.io.*;
import java.lang.*;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
import java.math.BigInteger;

public class Main {
    static InputReader in = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = in.next();
        String t = in.next();
        String u = in.next();
        StringBuilder ans = new StringBuilder();
        ans.append(s);
        ans.append(t);
        ans.append(u);
        String a = ans.toString();
        int n = Integer.parseInt(a);
        out.println(n%4==0?"YES":"NO");
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

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

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public boolean hasNext() {
            String next = null;
            try {
                next = reader.readLine();
            } catch (Exception e) {
            }
            if (next == null) {
                return false;
            }
            tokenizer = new StringTokenizer(next);
            return true;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
    }
}



Measured memory_bytes: 32880
#include<bits/stdc++.h>
#include<cxxabi.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define mp make_pair
#define fi first
#define se second
#define All(x) (x).begin(),(x).end()
#define TYPEVS(x) typeid(x).name()
#define TYPEGC(x) abi::__cxa_demangle(typeid(x).name(), 0, 0, 0)
#define Y1 "YES"
#define N1 "NO"
#define ENDL '\n'
#define count2(x) _builtin_popcount(x)
int main(){
	int h1,m1,h2,m2,k;
	cin>>h1>>m1>>h2>>m2>>k;
	m1+=h1*60;
	m2+=h2*60;
	int a=m2-m1;
	if(a>k)
	cout<<a-k;
	else
	cout<<0;
}
	

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <queue>
using namespace std;

int main(int argc, char* argv[]){

	char S[15];
	char T[15];

	scanf("%s", S);
	scanf("%s", T);

	int len_s = (int)strlen(S);
//	printf("%d\n", len_s);

	int check = 0;
	for(int i=0; i<len_s; i++){
		if(S[i] != T[i]){
			check++;
			break;
		}
	}

	if(check == 0){
		printf("Yes\n");
	}else{
		printf("No\n");
	}


	return 0;
}





Measured memory_bytes: 3760
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <string>
#include <math.h>
#include <vector>

using namespace std;
int main(){
    int c[3][3];
    int b[3][3];
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            scanf("%d",&c[i][j]);
        }
    }
    int flag=0;
    b[0][0]=c[0][0]-c[0][1];
    b[0][1]=c[0][1]-c[0][2];
    b[0][2]=c[0][0]-c[0][2];
    b[1][0]=c[1][0]-c[1][1];
    b[1][1]=c[1][1]-c[1][2];
    b[1][2]=c[1][0]-c[1][2];
    b[2][0]=c[2][0]-c[2][1];
    b[2][1]=c[2][1]-c[2][2];
    b[2][2]=c[2][0]-c[2][2];
    if(b[0][0]==b[1][0]&&b[0][0]==b[2][0]&&b[0][1]==b[1][1]&&b[0][1]==b[2][1]&&b[0][2]==b[1][2]&&b[0][2]==b[2][2]) flag=1;
    if(flag==1) printf("Yes\n");
    else printf("No\n");
    return 0;
}

Measured memory_bytes: 256
/*g++ main.cpp -o main.out*/
/*./main.out*/

#include<bits/stdc++.h>
using namespace std;

#define LL long long
#define LD long double
#define Mod 1000000007
#define L_Mod 17100000013

const double eps = 1e-9;
const int INF = 0x3f3f3f3f;
const double PI = 3.1415926535;

#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define ree(a,n) memset(a,n,sizeof(a));

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))

int main()
{
    int x,ans=0;
    cin>>x;
    ans=1000*(x/500)+5*((x-500*(x/500))/5);
    cout<<ans<<endl;
    return 0;
}











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

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
#define LINF 1e18
typedef long long ll;


int main() {
    int N; cin >> N;
    string s; cin >> s;
    deque<char> S;
    REP(i,N){
        S.push_back(s[i]);
    }
    int ans = 0;
    while(1){
        if(S.empty())break;
        while(!S.empty()){
            if(S.front() == 'R') S.pop_front();
            else break;
        }
        if(S.empty())break;

        while(!S.empty()){
            if(S.back()=='W') S.pop_back();
            else break;
        }
        if(S.empty())break;

        ans ++;
        S.pop_front();
        S.pop_back();

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

Measured memory_bytes: 3804
#include<stdio.h>

int main(){
  int a,b;
  scanf("%d%d",&a,&b);
  int x = a+b;
  if(x < a-b){
    x = a-b;
  }
  if(x < a*b){
    x = a*b;
  }
  printf("%d",x);

  return 0;
}

Measured memory_bytes: 128
def solve():
    H, W, K = map(int, input().split())
    cake = ['' for _ in range(H)]
    for i in range(H):
        cake[i] = input()
    
    ans = [[0 for _ in range(W)] for _ in range(H)]
    index = 0
    while '#' not in cake[index]:
        index += 1
    
    not_strawberry = index
    color = 0
    for line in cake[index:]:
        if '#' not in line:
            ans[index] = ans[index-1]
            index += 1
            continue
        color += 1
        count = 0
        for i in range(W):
            if line[i] == '#':
                count += 1
                if 1 < count:
                    color += 1
            ans[index][i] = color
        index += 1
    
    for i in range(not_strawberry):
        ans[i] = ans[not_strawberry]
    
    for i in range(H):
        print(*ans[i])


if __name__ == '__main__':
    solve()

Measured memory_bytes: 7568
import java.io.BufferedInputStream;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in =new Scanner(new BufferedInputStream(System.in));
		while(in.hasNext())
		{
			BigInteger a = in.nextBigInteger(),b = in.nextBigInteger();
			System.out.println(a.divide(b));
		}
		in.close();
	}

}



Measured memory_bytes: 26640
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set <int>
#define sll set <ll>
#define spii set <pii>
#define vs vector <string>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define forn(i, n) for (int i = 0; i < (n); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()


using namespace std;
const ll INFLL = 1e18;
const int MAXN = 1e6+100;
const ll INF = 1e9;
const ll mod1=1e9+7;
const ll mod2=2e9+11;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    #ifdef LOCAL
    freopen("a.in","r",stdin);
    #endif
    int n;
    cin>>n;
    vector <string> ans;
    map <string,int> m;
    for (int i=0;i<n;i++)
    {
        string s;
        cin>>s;
        m[s]++;
    }
    int mx=-1;
    for (auto to:m)
        mx=max(mx,to.se);
    for (auto to:m)
    {
        if (to.se==mx)
            ans.pb(to.fi);
    }
    sort(all(ans));
    for (int i=0;i<ans.size();i++)
        cout<<ans[i]<<'\n';




}

Measured memory_bytes: 25584
fun main(ar: Array<String>?) {
    val i = System.`in`!!.reader(Charsets.US_ASCII).readLines()

    val il = i.flatMap { it.split(" ") }.let { IntArray(it.size) { id -> it[id].toInt() } }
    val m = il[2]
    val b = il[1]
    val a = il[0]
    var min = Int.MAX_VALUE
    for (xi in (0 until m).reversed()) {
        var xxa = 3 + a + b + xi * 3 + 2
        val p1 = -il[xxa] + il[3 + a + il[--xxa] - 1] + il[3 + il[--xxa] - 1]
        if (p1 < min) {
            min = p1
        }
    }
    var ma = min
    for (aai in (3 until 3 + a).reversed()) {
        val ai = il[aai]
        if (ai < ma) {
            ma = ai
        }
    }
    if (ma < min) {
        var mb = min
        for (bbi in (3 + a until 3 + a + b).reversed()) {
            val bi = il[bbi]
            if (bi < mb) {
                mb = bi
            }
        }
        val mr = ma + mb
        if (mr < min) {
            print(mr)
            return
        }
    }
    print(min)
}

Measured memory_bytes: 119932
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

int main() {
  int x, t;
  cin >> x >> t;
  
  cout << max(0, x - t) << endl;


  
  return 0;
}

Measured memory_bytes: 256