akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
const int inf = 1e9;
const ll linf = 1LL << 50;
int n, x;
int a[101];

int main(int argc, char const* argv[])
{
  cin >> n >> x;
  for(int i = 0; i < n; i++)cin >> a[i];
  sort(a, a + n);
  int curr = 0;
  for(int i = 0; i < n; i++){
    curr += a[i];
    if(curr > x){
      cout << i << endl;
      return 0;
    }
  }
  if(curr != x)cout << n - 1 << endl;
  else cout << n << endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
const int N=600005;
const int MOD=1000000007;
int n,m,L,R;
long long fac[N],inv[N];
long long ksm(long long a,long long b)
{
	long long res=1;
	while(b)
	{
		if(b&1) res=res*a%MOD;
		a=a*a%MOD,b>>=1;
	}
	return res;
}
void init(int n=600000)
{
	fac[0]=1;
	for(int i=1;i<=n;i++)
		fac[i]=fac[i-1]*i%MOD;
	inv[n]=ksm(fac[n],MOD-2);
	for(int i=n;i>=1;i--)
		inv[i-1]=inv[i]*i%MOD;
	return;
}
long long C(int n,int m)
{
	if(m>n) return 0;
	else return fac[n]*inv[m]%MOD*inv[n-m]%MOD;
}
long long calc(long long x,int p,int q)
{
	x-=1LL*m*p;
	if(x<0) return 0;
	long long res=0;
	for(int i=0;i<=n-m&&x-1LL*i*q>=0;i++)
		if(i&1) res=(res-C(n-m,i)*C(x-1LL*i*q+n,n)%MOD+MOD)%MOD;
		else res=(res+C(n-m,i)*C(x-1LL*i*q+n,n)%MOD)%MOD;
	res*=C(n,m);
	return res;
}
long long solve(int x)
{
	long long res=0;
	for(int p=1;p<=x;p++)
		res=(res+(calc(x,p,p)-calc(x,p,p-1)+MOD)%MOD)%MOD;
	res=(C(x+n,n)-res+MOD)%MOD;
	return res;
}
int main()
{
	init();
	scanf("%d%d%d%d",&n,&m,&L,&R);
	printf("%lld",(solve(R)-solve(L-1)+MOD)%MOD);
	return 0;
}


Measured memory_bytes: 13176
import java.util.*;
import java.lang.*;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			b[i] = sc.nextInt();
		}
		int[] sa = new int[n];
		for (int i = 0; i < n; i++) {
			sa[i] = a[i] - b[i];
		}
		Arrays.sort(sa);
		int dif = 0;
		long fusoku = 0;
		boolean bre1 = false;
		for (int i = 0; i < n; i++) {
			if (sa[i] >= 0) {
				bre1 = true;
				break;
			}
			dif++;
			fusoku += sa[i];
		}
		if (!bre1) {
			System.out.println(-1);
		} else {
			boolean bre2 = false;
			for (int i = n - 1; i >= 0; i--) {
				if (fusoku >= 0) {
					bre2 = true;
					break;
				}
				fusoku += sa[i];
				dif++;
			}
			if (!bre2) {
				System.out.println(-1);
			} else {
				System.out.println(dif);
			}
		}
	}
}

Measured memory_bytes: 65440
#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
 
using namespace std;
#define rep(i,a,b) for (ll i = a; i < b; i++)
#define rrep(i,a,b) for (ll i = a; i >= b; i--)
#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
 
using namespace std;
#define rep(i,a,b) for (ll i = a; i < b; i++)
#define rrep(i,a,b) for (ll i = a; i >= b; i--)
#define l(s) s.length()
#define sort(v) sort(v.begin(), v.end());
#define scan(v,n) rep(i,0,n) {ll k; cin >> k; v.pb(k);}
#define print(v,n) {rep(i,0,n) cout << v[i] << " "; cout << endl;}
#define printstr(s,n) {rep(i,0,n) cout << s[i]; cout << endl;}
#define rev(a) reverse(a.begin(), a.end());
#define pb push_back
typedef long long ll;
typedef long double lld;
typedef vector<pair<ll,ll>> vpi;
typedef vector<ll> vi;
 
const ll mxN=1e5+1;
const ll N=1e9+7;
 
ll dp[mxN];
 
  int main() {
      int T=1;// cin >> T;
      while(T--){
          ll n,W; cin >> n >> W;
          vi w(n), v(n); 
          rep(i,0,n) cin >> w[i] >> v[i];
          rep(i,0,n) {
               rrep(x,W,0){
                  if(x>=w[i]&&dp[x]<dp[x-w[i]]+v[i]) dp[x]=dp[x-w[i]]+v[i];
              }
          }
          //print(dp,W+1);
          cout << dp[W];
      } 
	 return 0;
}


Measured memory_bytes: 4416
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		new Main();
	}
	Main(){
		Scanner scan = new Scanner(System.in);
		int W = scan.nextInt();
		int H = scan.nextInt();
		int x = scan.nextInt();
		int y = scan.nextInt();
		int r = scan.nextInt();
		scan.close();
		if(!isTouch(W,H,x,y,r))
			System.out.println("Yes");
		else
			System.out.println("No");
	}

	boolean isTouch(int W,int H,int x,int y,int r){
		if(isTouchAbove(W,H,x,y,r) || isTouchBottom(W,H,x,y,r) || isTouchLeft(W,H,x,y,r) || isTouchRight(W,H,x,y,r))
			return true;
		return false;
	}
	private boolean isTouchLeft(int W,int H,int x,int y,int r) {
		// TODO ?????????????????????????????????????????????
		if(x - r < 0)
			return true;
		return false;
	}
	private boolean isTouchAbove(int W,int H,int x,int y,int r) {
		// TODO ?????????????????????????????????????????????
		if(y + r > H)
			return true;
		return false;
	}
	private boolean isTouchRight(int W,int H,int x,int y,int r) {
		// TODO ?????????????????????????????????????????????
		if(x + r > W)
			return true;
		return false;
	}
	private boolean isTouchBottom(int W,int H,int x,int y,int r) {
		// TODO ?????????????????????????????????????????????
		if(y - r < 0)
			return true;
		return false;
	}

}

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

int sm(int x) {
	if (x == 0) return 0;
	return x % 10 + sm(x / 10);
}

int main() {
    
	int n, a, b;
	cin >> n >> a >> b;
	int su = 0;
	for (int i=1; i<=n; i++) {
		if (sm(i) >= a && sm(i) <= b) su += i;
	}
	cout << su << endl;
	
}


Measured memory_bytes: 256
n=int(input())
c=[]
s=[]
f=[]
for i in range(n-1):
    a,b,d=map(int,input().split())
    c.append(a)
    s.append(b)
    f.append(d)

for i in range(n-1):
    count=0
    for j in range(i,n-1):
        if count<=s[j]:
            count=s[j]
        else:
            if (count-s[j])%f[j]!=0:
                count+=f[j]-((count-s[j])%f[j])
        count+=c[j]
    print(count)

print(0)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define MAX 100000
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};

int main(){
    int s;
    cin>>s;
    bool k[1000000]={};
    k[s]=1;
    for(int i=2;;i++){
        if(s%2==0){
            s/=2;
        }else{
            s=3*s+1;
        }
        if(k[s]){
            cout<<i<<endl;
            break;
        }else{
            k[s]=1;
        }
    }

    return 0;
}


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

using namespace std;

typedef long long LL;
const int N = 1005;
int n, m;
LL res, ans;
int f[] = {-1, 1};

struct A{
	LL x, y, z;
	LL val;
	void cal(int i, int j, int k){
		val = i * x + j * y + k * z;
	}
}a[N];

bool cmp(A u, A v){
	return u.val > v.val;
}

int main(){
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++)
		scanf("%lld%lld%lld", &a[i].x, &a[i].y, &a[i].z);
	for(int i = 0; i < 2; i++){
		for(int j = 0; j < 2; j++){
			for(int k = 0; k < 2; k++){
				for(int z = 1; z <= n; z++)
					a[z].cal(f[i], f[j], f[k]);
				sort(a+1, a+n+1, cmp);
				res = 0;
				for(int i = 1; i <= m; i++)
					res += a[i].val;
				ans = max(ans, res);
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 128
using System;
using System.Linq;
 
namespace ConsoleApp1 {
    public class Class1 {
        static void Main(string[] args) {
            int[] nums = Console.ReadLine().Trim().Split(' ').Select(_ => int.Parse(_)).ToArray();
            if(nums[0] > nums[1]){
            	Console.Write("safe");
            }else{
            	Console.Write("unsafe");
            }
        }
    }
}

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

int main()
{
    int N;
    string temp;
    map<string,int> array;
    cin >> N;
    for(int i = 0 ; i < N ; i++ )
    {
        cin >> temp;
        array[temp] = 1;
        
    }
    cout << array.size();
    return 0;
     
}

Measured memory_bytes: 19176
using System;
using System.Linq;
using System.Collections.Generic;

namespace codefes2017c
{
    class Program
    {
        static void Main(string[] args)
        {
            int h = nextInt();
            int w = nextInt();

            string[] m = new string[h];

            var dic = new Dictionary<char, int>();

            for( int i = 0; i < h; i++ ){
                string s = Console.ReadLine();
                foreach( char c in s ){
                    if( !dic.ContainsKey(c) )
                        dic.Add(c, 0);
                    dic[c]++;
                }
            }

            var keys = new List<char>(dic.Keys);

            int cnt = 0;
            if( h % 2 == 1 && w % 2 == 1 ) {
                cnt = 0;
                foreach( char key in keys ) {
                    if( dic[key] % 2 == 1 ) {
                        dic[key] -= 1;
                        cnt++;
                    }
                }
                if( cnt != 1 ){
                    Console.WriteLine("No");
                    Environment.Exit(0);
                }
            }

            cnt = 0;
            for( int i = 0; i <　(h / 2) * (w / 2); i++ ){
                foreach( char key in keys ) {
                    if( dic[key] > 0 && dic[key] / 4 > 0 ) {
                        dic[key] -= 4;
                        cnt++;
                        break;
                    }
                }
            }
            if( cnt != (h / 2) * (w / 2) ) {
                Console.WriteLine("No");
                Environment.Exit(0);
            }

            cnt = 0;
            for( int i = 0; i <　((h % 2) * w) / 2 + ((w % 2) * h) / 2; i++ ) {
                foreach( char key in keys ) {
                    if( dic[key] > 0 && dic[key] % 2 == 0 ) {
                        dic[key] -= 2;
                        cnt++;
                        break;
                    }
                }
            }
            if( cnt != ((h % 2) * w) / 2 + ((w % 2) * h) / 2 ) {
                Console.WriteLine("No");
                Environment.Exit(0);
            }

            Console.WriteLine("Yes");
        }
        static int[] stdin_int = new int[0];
        static int currentPos = 0;
        static int nextInt(){
            if(currentPos == stdin_int.Length){
                stdin_int = Console.ReadLine()
                                   .Split(' ')
                                   .Select(s => int.Parse(s))
                                   .ToArray();
                currentPos = 0;
            }
            return stdin_int[currentPos++];
            
        }
    }
}


Measured memory_bytes: 13408
fun main(args: Array<String>) {
    val n = readInteger()
    val acount = readIntegerList().sorted()
    for (i in 0 until acount.size - 1) {
        if (acount[i] == acount[i + 1]) {
            println("NO")
            return
        }
    }
    println("YES")
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)


Measured memory_bytes: 79452
n,m = map(int, input().split( ))
dic = {}
#衝突
for i in range(m):
    si,ci = map(int, input().split( ))
    if si in dic:
        if ci!=dic[si]:
            print(-1)
            exit()
    else:
        dic[si]=ci
#2桁以上で最上位ゼロか
if n>1 and 1 in dic:
    if dic[1]==0:
        print(-1)
        exit()
#n=1の処理
if n==1:
    if dic:##ここ？
        for si in dic:
            print(dic[si])
            exit()
    print(0)
    exit()

for i in range(10**(n-1),10**n):
    j = str(i)
    flag = True
    for k in range(1,4):
        if k in dic:
            if j[k-1]==dic[k]:
                continue
            else:
                flag = False
                break  
    if flag:
        print(i)
        exit()

ans = 0
#指定あればその通り
#なければ最上位以外0、最上位は1
for i in range(1,n+1):
    ans*=10
    if i in dic:
        ans+=dic[i]
    elif i==1:#n=1,M=0が外れてる
        ans += 1
print(ans)


Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>
#include<bitset>
#include<cassert>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;



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

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(vector<long long int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}

int main()
{
	ll n, d;
	cin >> n >> d;
	vector<ll> x(n), y(n);
	rep(i,n){
		cin >> x[i] >> y[i];
	}
	int ans = 0;
	rep(i, n)
	{
		if(x[i]*x[i]+y[i]*y[i] <= d*d){
			ans += 1;
		}
	}
	cout << ans << endl;

	return 0;
}

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

int main(){
	long long n , d,sum=0;
	cin >> n >> d;
	d=d*d;
	for(int i=0;i<n;i++){
		long long  x, y;
		cin >> x >> y;
		double ans = (x*x) + (y*y);
//		cout << ans << ' ' << d << '\n';
		if(ans<=d){
			sum++;
		}
	}
	cout << sum << '\n';
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000000;
constexpr ll INF= 1e18;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef tuple<int,int,int> TP;

template<typename T>
T Pow(T a,T b) {
    T ret = 1;
    for(int i = 0;i < b;i++) {
        ret *= a;
    }
    return ret;
}
 
ll mod(ll val) {
    ll res = val % MOD;
    if(res < 0) {
        res += MOD;
    }
    return res;
}
 
ll RS(ll N, ll P, ll M){
    if(P==0) return 1;
    if(P < 0) {
        return 0;
    }
    if(P%2==0){
        ll t = RS(N, P/2, M);
        return t*t % M;
    }
    return N * RS(N, P-1, M) % M;
}

ll merge_cnt(vector<ll> &a) {
    int n = a.size();
    if (n <= 1) { return 0; }

    ll cnt = 0;
    vector<ll> b(a.begin(), a.begin()+n/2);
    vector<ll> c(a.begin()+n/2, a.end());

    cnt += merge_cnt(b);
    cnt += merge_cnt(c);

    int ai = 0, bi = 0, ci = 0;
    // merge の処理
    while (ai < n) {
        if ( bi < b.size() && (ci == c.size() || b[bi] <= c[ci]) ) {
            a[ai++] = b[bi++];
        } else {
            cnt += n / 2 - bi;
            a[ai++] = c[ci++];
        }
    }
    return cnt;
}

int main() {
    int N;
    ll K;
    cin >> N >> K;
    vector<ll> vec(N);
    for(int i = 0;i < N;i++) {
        cin >> vec.at(i);
    }
    for(int i = 0;i < N;i++) {
        vec.at(i) -= K;
    }
    vector<ll> Sum(N + 1);
    for(int i = 0;i < N;i++) {
        Sum.at(i + 1) = Sum.at(i) + vec.at(i);
    }
    ll ret = merge_cnt(Sum);
    ll ret2 = 0;
    for(ll i = 0;i <= N;i++) {
        ret2 += i;
    }
    cout << ret2 - ret << endl;
}

Measured memory_bytes: 6528
#include <iostream>
//#include <iomanip>
//#include <string>
#include <vector>
//#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
using vll = vector<ll> ;
using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;

//ll mod = 1000000007 ;
ll INF = 100000000 ;
//long double pie = acos(-1) ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void mysort(vector<long long> &a){sort(a.begin(),a.end()) ;}
//void myrev(vector<long long> &a){reverse(a.begin(),a.end()) ;}

void BFS(vvll &g,vll &cnt,int n,queue<int> &q){
	int d = cnt.at(n) ;
	for(int i=0;i<g.at(n).size();i++){
		if(cnt.at(g.at(n).at(i))>d+1){
			cnt.at(g.at(n).at(i)) = d+1 ;
			q.push(g.at(n).at(i)) ;
		}
	}
	if(q.empty()) return ;
	n = q.front() ; q.pop() ;
	BFS(g,cnt,n,q) ;
}

int main(){
	ll n,u,v ;
	cin >> n >> u >> v ;
	u-- ; v-- ;
	vvll g(n,vll(0)) ;
	for(int i=0;i<n-1;i++){
		ll a,b ;
		cin >> a >> b ;
		a-- ; b-- ;
		g.at(a).push_back(b) ;
		g.at(b).push_back(a) ;
	}
	vll dis_u(n,INF),dis_v(n,INF),dis_k(n,INF) ;
	queue<int> q ;
	dis_u.at(u) = dis_v.at(v) = 0 ;
	BFS(g,dis_u,u,q) ; BFS(g,dis_v,v,q) ;
	ll d = dis_u.at(v) ;
	ll ao,ta,k ;
	if(d&1){
		for(int i=0;i<n;i++){
			if(dis_u.at(i)==d/2&&dis_v.at(i)==d-d/2) ta = i ;
			if(dis_u.at(i)==d-d/2&&dis_v.at(i)==d/2) ao = i ;
		}
		k = ao ;
	}else{
		for(int i=0;i<n;i++){
			if(dis_u.at(i)==d/2-1&&dis_v.at(i)==d/2+1) ta = i ;
			if(dis_u.at(i)==d/2+1&&dis_v.at(i)==d/2-1) ao = i ;
			if(dis_u.at(i)==d/2&&dis_v.at(i)==d/2) k = i ;
		}
	}
	dis_k.at(ta) = 0 ; dis_k.at(k) = -1 ;
	BFS(g,dis_k,ta,q) ;
	ll mx = 0 ;
	for(int i=0;i<n;i++){
		if(dis_k.at(i)==INF) continue ;
		if(mx<dis_k.at(i)) mx = dis_k.at(i) ;
	}
	cout << dis_v.at(ao)+mx+(d%2==0) << endl ;
//	cout << ao << " " << ta << " " << k << " " << dis_u.at(ta) ;
}


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

signed main(){
	string s;
	cin>>s;
	if((s[0]==s[1]&&s[1]==s[2])||(s[1]==s[2]&&s[2]==s[3]))cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}


Measured memory_bytes: 256
process.stdin.resume();
process.stdin.setEncoding('utf8');
 
var lines = [];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
reader.on('line', (line) => {
    // ここで入力を処理する
    lines.push(line);
});
var sub_fn = (ary)=>{
  
}
reader.on('close', () => {
  var x = 1*lines[0].split(' ')[0]
  var y = 1*lines[0].split(' ')[1]
  var cnt = [];
 // console.log(y)
  for(var i=0;i<=x;i++){
      if(cnt.length){break}
      //  console.log(i)
    for(var j=0;j<=(x-i);j++){
      if(cnt.length){break}
      var k = x-j-i
      
      //for(var k=0;k<=(x-j-i);k++){
        //console.log(i)
        if((10000*i + 5000*j + 1000*k) == y && (i+j+k)== x){
           console.log(i +' '+ j +' '+ k)
        cnt.push([i,j,k])
        //  console.log(i +" "+ j +" "+ k)
          break
          
        
       }    
    //  }
    }
  }
  if(cnt.length == 0){
  console.log('-1 -1 -1')
  }else{
  //console.log(cnt[cnt.length-1][0] +" "+ cnt[cnt.length-1][1] +" "+ cnt[cnt.length-1][2])
  }
  
});


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

using namespace std;

int main()
{
    int n;
    cin>>n;
    stack<int> R;
    queue<int> W;
    string s;
    cin>>s;
    int l = s.length();
    for (int i=0; i<l; i++) 
        if (s[i] == 'R') R.push(i);
        else W.push(i);
    int res = 0;
    while(!R.empty() && !W.empty())
    {
        int a = R.top(), b = W.front();
        if (a > b) {
            //cout << a << " " << b << '\n';
            swap(s[a], s[b]); res++;
        }
        else break;
        R.pop(); W.pop();
        
    }
    cout << res << '\n';
    return 0;
}

Measured memory_bytes: 4404
using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        string s = Console.ReadLine();
        string t = Console.ReadLine();
        int sum = 0;
        foreach (var e in s.Zip(t, Tuple.Create))
        {
            if (e.Item1 == e.Item2)
            {
                sum++;
            }
        }
        Console.WriteLine(sum.ToString());
    }
}


Measured memory_bytes: 11348
x_array = []
loop do
  x = gets.chomp.chars.map(&:to_i)
  if x == [0]
    break
  else
    length= x.length
    x_sum = 0
    for i in 0..(length-1)
      x_sum += x[i]
    end
    x_array.push(x_sum)
  end
end
length = x_array.length
for i in 0..(length-1)
  puts x_array[i]
end

Measured memory_bytes: 8680
/*
    When you are not practicing someone else is,
    and the day u meet them u will Lose.

    So, all you need is Practice, Practice and Practice.
*/
#include <bits/stdc++.h>
using namespace std;
                     
#define int             long long
#define ld              long double
#define mp              make_pair
#define ff              first
#define ss              second
#define pb              push_back
#define fo(i,n)         for(i=0;i<n;i++)
#define fo1(i,n)        for(i=1;i<=n;i++)
#define FO(i,a,b)       for(i=a;i<=b;i++)
#define FOR(i,a,b)      for(i=a;i>=b;i--)
#define all(c)          c.begin(),c.end()
#define rall(c)         c.rbegin(),c.rend()
#define si              set<int>
#define vi              vector<int>
#define mii             map<int,int>
#define pii             pair<int,int>
#define vpii            vector<pii>
#define vvi             vector<vi>
#define usi             unordered_set<int>
#define umii            unordered_map<int,int>
#define pqmx            priority_queue<int>
#define pqmn            priority_queue<int,vi,greater<int> >
#define sp(x)           cout<<setprecision(x)<<fixed;
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define in(a,n)         vi a(n);fo(i,n)cin>>a[i];
#define in1(a,n)        vi a(n+1);fo1(i,n)cin>>a[i];
#define w(t)            int t;cin>>t;while(t--)
#define sz(v)           (int)v.size()
#define gcd             __gcd
#define lcm(x,y)        x*(y/gcd(x,y))
#define endl            '\n'
#define PI              3.14159265358979323846
const int inf =         1e18;
const int mod =         1e9+7;
void __p(int x) {cout<<x;}
void __p(int32_t x){cout<<x;}
void __p(float x){cout<<x;}
void __p(double x){cout<<x;}
void __p(ld x) {cout<<x;}
void __p(char x){cout <<'\''<<x<<'\'';}
void __p(const char *x){cout <<'\"' <<x<<'\"';}
void __p(const string &x) {cout<<'\"'<<x<<'\"';}
void __p(bool x) {cout<<(x?"true":"false");}
void _p() {cout << "]\n";}
template<typename T,typename V>     void __p(const pair<T,V> &x) {cout<<'{';__p(x.first);cout<<',';__p(x.second);cout<<'}';}
template<typename T>                void __p(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __p(i); cout << "}";}
template <typename T,typename... V> void _p(T t, V... v) {__p(t);if(sizeof...(v))cout<<", ";_p(v...);}
int po(int x,int p) {int ans=1;x%=mod;while(p>0){if(p&1)ans=(ans*x)%mod;p=p>>1;x=(x*x)%mod;}return ans;}
int inv(int x){return po(x,mod-2)%mod;}
#define dbg(x...) cout<<"["<<#x<<"]=[";_p(x)
/**********************************************************************************/



const int N=1e6+6;
int n,m,k,x,y,z,a,b,c,d,i,j,l,r,f,q;



bool isprime(int n)
{
    if(n==2)return 1;
    if(n%2==0)return 0;
    for(i=3;i*i<=n;i+=2)if(n%i==0)return 0;
    return 1;
}




void sol()
{   
    cin>>n;

    while(1)
    {
        if(isprime(n))break;
        n++;
    }
    
    
    
    cout<<n  <<endl;
}





int32_t main()
{   
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //pre();
    //sp(10);
    // w(t)
    sol();
    return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL);

#define endl '\n'
#define D(x) cout << #x << " = " << (x) << endl;

int inf = 1000 * 1000;

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

  vector<int> v(m);
  for (auto &x : v) cin >> x;
  sort(v.begin(), v.end());

  vector<int> diff(m - 1);
  for (int i = 1; i < m; ++i) {
    diff[i - 1] = v[i] - v[i - 1];
  }
  sort(diff.begin(), diff.end());

  long long ans = 0;
  if (m > n) {
    ans = accumulate(diff.begin(), diff.begin() + m - n, 0);
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<stdio.h>
using namespace std;

int main(){
	int a[4],e,f,sum=0,x=120;
	for(int i=0;i<4;i++){
	cin >> a[i];
	sum=sum+a[i];
	if(a[i]<x)x=a[i];
	}
	sum=sum-x;
	cin >> e;
	cin >> f;
	if(e>f){sum=sum+e;}
	else if(e<f){sum=sum+f;}
	else if(e==f){sum=sum+e;}
	cout << sum << endl;
	return 0;
}

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

int main() {
  int N,R;
  cin >> N >> R;
  
  if(N >= 10) {
    cout << R << endl;
  }
  else if(N < 10) {
    cout << R+100*(10-N) << endl;
  }
}

  

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

int main() {
  set<int> S;
  int n, k;
  cin >> n >> k;
  for(int i = 1; i <= n; ++i) {
    S.insert(i);
  }
  for(int i = 0; i < k; ++i) {
    int d;
    cin >> d;
    for(int j = 0; j < d; ++j) {
      int a;
      cin >> a;
      S.erase(a);
    }
  }
  cout << S.size() << endl;
  return 0;
}

Measured memory_bytes: 3640
void main(){
	int a = _scan();
	(a+a^^2+a^^3).writeln();
}

import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math;

// 1要素のみの入力
T _scan(T= int)(){
	return to!(T)( readln().chomp() );
}

// 1行に同一型の複数入力
T[] _scanln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split()){
		ln ~= elm.to!T();
	}
	return ln;
}


Measured memory_bytes: 2680
#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
int main(){
  int h,w,a,b;cin>>h>>w>>a>>b;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(i<b){
        if(j<a){
         cout<<1;
        }else cout<<0;
      }else{
        if(j<a) cout<<0;
        else cout<<1;
      }
    }
    cout<<endl;
  }
}
      

Measured memory_bytes: 1280
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
using namespace std;

typedef int64_t ll;
const ll INF = 1000000000000000000;
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define vll vector<ll>
#define all(v) v.begin(), v.end()



ll gcd(vll dist) {
	if (dist.size() == 1) return dist[0];

	vll new_dist;
	new_dist.push_back(dist[0]);
	fori(i, 1, dist.size()) {
		ll tmp = dist[i] % dist[0];
		if (tmp != 0) new_dist.push_back(tmp);
	}
	sort(all(new_dist));
	return gcd(new_dist);
}


int main() {
	ll N, X;
	cin >> N >> X;
	vll x(N);
	rep(i, N) cin >> x[i];
	x.push_back(X);
	sort(all(x));

	vll dist(N);
	rep(i, N) dist[i] = x[i + 1] - x[i];
	sort(all(dist));

	cout << gcd(dist) << endl;
}


Measured memory_bytes: 2544
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
#define rep(i, n) for(long long i=0; i<n; i++)
#define reps(i, s, e) for(long long i=s; i<e; i++)
#define repr(i, n) for(long long i=n-1; i>=0; i--)
#define reprs(i, s, e) for(long long i=e-1; i>=s; i--)

int main(){

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

    ll a; cin >> a;
    cout << a + a*a + a*a*a << endl;

    return 0;
}

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

int main() {
    cin.tie(0)->sync_with_stdio(false);

	int n; cin >> n;
	vector<ll> a(n);
	REP(i, n) cin >> a[i];
	sort(a.begin(), a.end());

	vector<ll> s(n + 1, 0);
	REP(i, n) s[i+1] += s[i] + a[i];

	vector<bool> res(n, true);
	REP(i, n - 1)
		if (s[i+1] * 2 < a[i+1])
			res[i] = false;

	int cnt = 0;
	REP(i, n) {
		if (res[i]) cnt++;
		else cnt = 0;
	}
	cout << cnt << '\n';
    return 0;
}


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

const int N=2e3+20,MOD=1e9+7;

int dp[N],n;

int main()
{
	cin>>n;
	dp[0]=1;
	for(int i=3;i<=n;i++)
	{
		for(int j=3;j<=n;j++)
		{
			if(j<=i)
			{
				dp[i]+=dp[i-j];
				dp[i]%=MOD;
			}
		}
	}

	cout<<dp[n];
}

Measured memory_bytes: 3576
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <numeric>
#include <climits>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <utility>
#include <cctype>
#include <iterator>
////////////////////////////////////////////////
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++)
#define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++)
#define REPe(e, mp) for (auto &e : mp)
#define all(x) x.begin(), x.end()
#define MOD 1000000007  // 1e9+7
using namespace std;
using ll = long long int;
using vecint = vector<int>;
using vecll = vector<ll>;
using vec2int = vector<vector<int>>;
using P = pair<int, int>;
////////////////////////////////////////////////
////////////////////////////////////////////////
int main() {
  ////////////////////////////////////////////////
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ////////////////////////////////////////////////
  int n;
  cin >> n;
  vector<vector<int>> bflag(n, vector<int>(20, 0));
  REP(i, n) {
    ll x;
    cin >> x;
    REP(bit, 20) {
      if ((x >> bit) & 1LL) {
        bflag[i][bit] = 1;
      }
    }
  }
  ll ans = 0;
  int l, r;
  l = 0;
  r = 0;
  vecint nb(20, 0);
  while (l < n && r < n + 1) {
    while (l < n && r < n) {
      // check [l, r)
      bool ok = true;
      REP(i, 20) {
        if (nb[i] + bflag[r][i] > 1) {
          ok = false;
          break;
        }
      }
      if (ok) {
        REP(i, 20) nb[i] += bflag[r][i];
        r++;
      } else {
        break;
      }
    }
    ans += r - l;
    REP(i, 20) { nb[i] -= bflag[l][i]; }
    l++;
    // cout << ans << endl;
  }
  cout << ans << endl;
}
//////////////////////////////////////////////


Measured memory_bytes: 23680
#include <iostream>
#include <iomanip>
#include <string>
#include <map>
#include <math.h>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <set>
#include <queue>
#include <sstream>
#include <stack>
#include <deque>
#include <memory.h>
#include <cassert>
#include <ctime>
#include <climits>
#include <list>
#include <time.h>
#include <unordered_map>
#include <bitset>
#include <exception>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned long long ull;
#define pb push_back
#define mp make_pair
#define FILE "file"
#define lc v << 1
#define rc (v << 1) + 1
#define inf 1e+9
#define linf ll(1e+18)
#define dinf 1e+14

typedef long long ll;
#define pb push_back
#define mp make_pair

vector<int> v;

void solve()
{
    int n, m, c;
    cin >> n >> m >> c;
    v.resize(m);
    
    for(int i = 0; i < m; i++)
    {
        cin >> v[i];
    }
    
    int ans = 0;
    for(int i = 0; i < n; i++)
    {
        int sum = 0;
        for(int k = 0; k < m; k++)
        {
            int x;
            cin >> x;
            sum += v[k] * x;
        }
        
        if(sum + c > 0)
        {
            ans++;
        }
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    //freopen("/Users/bekhzodsoliev/Desktop/C++/cp/cp/file.in", "r", stdin);freopen("/Users/bekhzodsoliev/Desktop/C++/cp/cp/file.out", "w", stdout);
    
    int t = 1;
    //cin >> t;
    
    while(t--)
    {
        solve();
    }
    
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		
		long a = scan.nextLong();
		int b = 0;
		String s = scan.next();
		
		b += (s.charAt(0)-48)*100;
		b += (s.charAt(2)-48)*10;
		b += (s.charAt(3)-48);
		
		System.out.println(a*b/100);
		
	}	
	
	//�ŏ�����
	/*
	static int gcd (int a, int b) {
		int temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}
	*/
	
	//����ւ�
	/*
	static int swap (int a, int b) {
		int swap_arr[] = new int[2];
		
		swap[0] = b;
		swap[1] = a;
		
		return swap_arr;
	}
	*/
	
}

Measured memory_bytes: 35824
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <numeric>
#include <algorithm>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <cmath>
#include <math.h>

#define rep(i,m,n) for(int i=(m);i<(n);++i)

using namespace std;

using ll = long long;
using std::swap;

//vector<long long int> v;
vector<long long int> w;



int main() {
	int N,b;
	cin >> N;
	vector<int> v(N, 0);
	rep(i, 1, N) {
		cin >> b;
		++v[b - 1];
	}
	rep(i, 0, N)cout << v[i] << '\n';
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	int ans = 0;
	rep(i,n){
		int l,r;
		cin >> l >> r;
		ans += r-l+1;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long inf = 1LL<<60;

long long a[100010][3];
long long dp[100010][3];

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



    rep(i,n){
        rep(j,3){
            cin >> a[i][j];
        }
    }

    rep(i,n){
        rep(j,3){
            rep(k,3){
                if(j==k) continue;
                dp[i+1][k] = max(dp[i+1][k],dp[i][j]+a[i][k]);
            }
        }
    }

    long long res = 0;
    rep(j,3) res = max(res,dp[n][j]);

    cout << res << endl;
}

Measured memory_bytes: 4992
#include <iostream>
using namespace std;
int a[1000],b[1000],leng=0;
int f() {
	int i,j;
	for(i=1; i<=leng; i++)
		if(b[a[i]]>0)return 1;
	return 0;
}
int main() {
	int i,j,l;
	long long k,n,m;
	cin>>k>>n;
	for(i=1; i<=n; i++)cin>>l,b[l]++;
	m=k;
	while(m>0) {
		a[++leng]=m%10;
		m/=10;
	}
	while(f()) {
		int s1=f();
		a[s1]++;
		k++;
		while(a[s1]>=10)a[s1]=0,s1++,a[s1]++;
		leng=max(leng,s1);
	}
	cout<<k<<endl;
	return 0;
}

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

using namespace std;

const int MAXN = 1e5 + 5;
long long a[MAXN];
vector<int> adj[MAXN];
vector<long long> c[MAXN];
int n;
bool b = 1;

long long dfs(int v, int p = -1){
    if(adj[v].size() == 1){
        return a[v];
    }
    long long sum = 0;
    for(int i = 0; i < adj[v].size(); i++){
        int u = adj[v][i];
        if(u != p){
            c[v].push_back(dfs(u, v));
            if(c[v][c[v].size() - 1] < 0){
                b = 0;
            }
            sum += c[v][c[v].size() - 1];
        }
    }
    if(p == -1){
        if(sum != 2 * a[v]){
            b = 0;
        }
    }
    for(int i = 0; i < c[v].size(); i++){
        if(c[v][i] > a[v]){
            b = 0;
        }
    }
    if(2 * a[v] - sum > a[v]){
        b = 0;
    }
    return 2 * a[v] - sum;
}

int main(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }
    if(n == 2){
        if(a[1] == a[2]){
            cout << "YES";
        }
        else{
            cout << "NO";
        }
        return 0;
    }
    int u, v;
    for(int i = 0; i < n - 1; i++){
        cin >> u >> v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    int d = 1;
    for(int i = 1; i <= n; i++){
        if(adj[i].size() > 1){
            d = i;
        }
    }
    dfs(d);
    if(b){
        cout << "YES"; return 0;
    }
    cout << "NO";
}


Measured memory_bytes: 21888
#include <cstdio>
#include <cstring>
#include <algorithm>
void Unused(...) {}
#ifndef DEBUG
  #define echo(...) Unused(__VA_ARGS__)
#else
  #define echo(...) fprintf(stderr, __VA_ARGS__)
#endif

typedef long long laolin;

const int MaxN = int(1e5) + 7;
const laolin Inf = laolin(5e10) + 10;

int q;
laolin s[MaxN], t[MaxN];

void solve(laolin);

int main()
{
    scanf("%lld %lld %d", s, t, &q);
    for (int i = 1; i <= *s; ++i)
        scanf("%lld", s + i);
    for (int i = 1; i <= *t; ++i)
        scanf("%lld", t + i);
    echo("s: ");
    for (int i = 1; i <= *s; ++i)
        echo("%lld ", s[i]);
    echo("\n");
    echo("t: ");
    for (int i = 1; i <= *t; ++i)
        echo("%lld ", t[i]);
    echo("\n");
    while (q--)
    {
        laolin p;
        scanf("%lld", &p);
        solve(p);
    }
    return 0;
}

void solve(laolin p)
{
    laolin psb = p < s[1] ? -Inf : std::lower_bound(s + 1, s + *s + 1, p)[-1];
    laolin psa = p > s[*s] ? Inf : *std::upper_bound(s + 1, s + *s + 1, p);
    laolin ptb = p < t[1] ? -Inf : std::lower_bound(t + 1, t + *t + 1, p)[-1];
    laolin pta = p > t[*t] ? Inf : *std::upper_bound(t + 1, t + *t + 1, p);
    laolin pl1 = std::max(psa - p, pta - p), pl2 = std::max(p - psb, p - ptb);
    laolin pl3 = psa - ptb + std::min(p - ptb, psa - p), pl4 = pta - psb + std::min(p - psb, pta - p);
    echo("pl: %lld %lld %lld %lld(%lld %lld %lld %lld)\n", pl1, pl2, pl3, pl4, psa, psb, pta, ptb);
    printf("%lld\n", std::min(std::min(pl1, pl2), std::min(pl3, pl4)));
}



Measured memory_bytes: 2816
#include <stdio.h>
#include <stdlib.h>


static int cmpfunc (const void * a, const void * b) {
   return ( *(long*)a - *(long*)b );
}

int main(int argc, char** argv) {
        int n, i = 0;
        long nr_cnt = 0;
        long odd_max = -1;
        long odd_index = -1;
        long* a;
        scanf("%d", &n);
        a = (long *)malloc(sizeof(long) * n);

        for (i = 0; i < n; i++) {
                scanf("%ld", &a[i]);
        }


        qsort(a, n, sizeof(long), cmpfunc);

        while (1) {
                // find max
                odd_max = -1;
                odd_index = -1;
                for (i = n - 1; i >= 0; i--) {
                        if ((a[i] % 2) == 0) {
                                odd_max = a[i];
                                odd_index = i;
                                break;
                        }
                }

                if (odd_max == -1) {
                        break;
                }

                a[odd_index] /= 2;
                if (a[odd_index] == 0) {
                        break;
                }

                //for (i = 0; i < n; i++) {
                //      if (i != odd_index) {
                //              a[i] *= 3;
                //      }
                //}
                nr_cnt++;
        }

        printf("%ld\n", nr_cnt);

        return 0;
}


Measured memory_bytes: 380
import sys

V, E = map(int, sys.stdin.readline().strip().split())

# edges[i][j]:i→jへの距離
edges = [[float("inf")]*V for i in range(V)]
for i in range(E):
   s, t, d = map(int, sys.stdin.readline().strip().split())
   edges[s][t] = d

dp = [[-1] * V for i in range(1<<V)]

# 訪れた集合がs、今いる点がvの時に、v=0に戻る最短経路
def rec(bit, v):
    if dp[bit][v] >= 0:
        return dp[bit][v]

    if bit == (1<<V)-1 and v == 0:
        #全ての頂点を訪れた(bit = 11...11 and v = 0)
        dp[bit][v] = 0
        return 0

    res = float("inf")
    for u in range(V):
        if not (bit>>u & 1):
            #uに訪れていない時(uの箇所が0の時),次はuとすると
            res = min(res,rec(bit|(1<<u), u) + edges[v][u])

    dp[bit][v] = res
    return res

res = rec(0, 0)
print(-1 if res == float("inf") else res)


Measured memory_bytes: 18784
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint mod = 998244353;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
lint power(lint base, lint exponent, lint module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ lint root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class T> T gcd_calc(T a, T b){ if(b){ return gcd_calc(b, a % b); }else{ return a; }}
template<class T> T gcd(T a, T b){ if(a < b) swap(a, b); return gcd_calc(a, b); }
template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<lint> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } lint C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };
template<class itr> bool next_sequence(itr first, itr last, int max_bound){ itr now = last; while(now != first){ now--; (*now)++; if((*now) == max_bound){ (*now) = 0; }else{ return true; } } return false; }
inline int at(int x, int k){ return (x >> k) & 1; }
random_device rnd;

string day[7] =  {"Sunny", "Cloudy", "Rainy"};

int main(){
    int r;
    cin >> r;
    cout << r * r * 3 << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
int main(int argc,char** argv)
{
	int X,Y;
	scanf("%x%x",&X,&Y);
	if(X > Y){
		printf(">\n");
	}
	else if(X < Y){
		printf("<\n");
	}
	else{
		printf("=\n");
	}
	return(0);
}

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

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {
		solution(args);
		if(in!=null){
			in.close();
		}
	}

	public static void solution(String[] args) throws Exception{

		int[] A = new int[3];
		for(int i=0;i<3;i++){
			A[i]=nextInt();
		}
		Arrays.sort(A);

		int ans =A[2]*10+A[1]+A[0];




		System.out.println(ans);

	}
	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


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

int main(){
	int n;
	while(cin>>n,n){
		bool l=false,r=false;
		int ans=0;
		bool bf=false;
		
		for(int i=0;i<n;i++){
			string sa;
			cin>>sa;
			if(sa=="lu"){l=true;}
			else if(sa=="ru")r=true;
			else if(sa=="ld")l=false;
			else if(sa=="rd")r=false;
			
			if(l==r&&r!=bf){
				ans++;
				bf=l;
				}
			
			}
			cout<<ans<<endl;
		}
		return 0;
	}

Measured memory_bytes: 3012
#include"bits/stdc++.h"
using namespace std;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using tp3 = tuple<int, int, int>;
using Mat = vector<vector<ll>>;
constexpr int INF = 1 << 28;
constexpr ll INFL = 1ll << 60;
constexpr int dh[4] = { 0,1,0,-1 };
constexpr int dw[4] = { -1,0,1,0 };
bool isin(const int H, const int W, const int h, const int w) {
    return 0 <= h && h < H && 0 <= w && w < W;
}
template<typename T>
T minch(T& l, T r) {
    return l = min(l, r);
}
template<typename T>
T maxch(T& l, T r) {
    return l = max(l, r);
}
template<typename T>
void output(const T& val) {
    cout << val << endl;
}
template<typename T>
void output(const vector<T>& vec, const bool newline = false) {
    for (const T& val : vec)cout << val << (newline ? '\n' : ' '); cout << endl;
}
template<typename T>
void output(const vector<vector<T>>& mat) {
    for (const auto& row : mat)output(row);
}
// ============ template finished ============

int main()
{
    int N, K;
    cin >> N >> K;
    vector<int> cnt(N, 0);
    rep(i, K) {
        int d;
        cin >> d;
        rep(i, d) {
            int a;
            cin >> a;
            a--;
            cnt[a]++;
        }
    }
    int res = 0;
    rep(i, N)if (cnt[i] == 0)res++;
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>
 
using namespace std;
const int MAX = 100000;

int main(){
    int N,K;
    vector<int> ans[MAX];

    cin >> N;

    while(K * (K + 1) / 2 < N)K++;

    if(K * (K + 1) / 2 != N){
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;
    cout << ++K << endl;

    int n = 1;
    for(int i = 1;i <= K;i++){
        for(int j = i + 1;j <= K;j++){
            ans[i - 1].push_back(n);
            ans[j - 1].push_back(n);
            n++;
        }
    }

    for(int i = 0;i < K;i++){
        cout << ans[i].size();
        for(int j = 0;j < ans[i].size();j++){
            cout << ' ';
            cout << ans[i][j];
        }
        cout << endl;
    }

    return 0;
}

Measured memory_bytes: 4608
#include<iostream>
#include<cctype>
#include<cstdio>
using namespace std;

int main(){
    int i = 0;
    char ch[1200];
    while(++i < 1200){

        scanf("%c", &ch[i]);
        if(ch[i] == '\n'){
            printf("%c", ch[i]);
            break;
        } else if(isalpha(ch[i])){
            if (islower(ch[i])){
                ch[i] = toupper(ch[i]);
            
            }else if(isupper(ch[i])){
                ch[i] = tolower(ch[i]);
            }
        }
         printf("%c", ch[i]);
         
    
    }
 
    return 0;
}


Measured memory_bytes: 3132
#include<bits/stdc++.h>
using namespace std;
int N;
int T[101010];
int M;
int main()
{
    cin >> N;
    int sum = 0;
    for(int i=0; i<N; ++i)
    {
        cin>>T[i];
        sum += T[i];
    }
    cin >> M;
    for(int i=0; i<M; ++i)
    {
        int p, x; cin>>p>>x;
        cout << sum-T[p-1]+x << endl;
    }    
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, char *argv[])
{
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);

	if (a < b && b < c)
	{
		printf("Yes\n");
	}else{
		printf("No\n");
	}


	return 0;
}


Measured memory_bytes: 2104