akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N, M,
    temp = 0,
    max = 0;
    cin >> N;
    vector<string> s(N);

    int i;
    for(i = 0; i < N; i++) {
        cin >> s.at(i);
    }

    cin >> M;
    vector<string> t(M);

    for (i = 0; i < M; i++) {
        cin >> t.at(i);
    }

    int j;
    for (i = 0; i < N; i++) {
        for (j = 0; j < N; j++) {
            if (s.at(i) == s.at(j)) {
                temp++;
            }
        }
        for (j = 0; j < M; j++) {
            if (s.at(i) == t.at(j)) {
                temp--;
            }
        }
        if (temp > max) {
            max = temp;
        }
        temp = 0;
    }
    cout << max << endl;
}


Measured memory_bytes: 256
//Optional FAST

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

//Required Libraries

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

//Required namespaces

using namespace std;
using namespace __gnu_pbds;

//Required defines

#define endl '\n'

#define READ(X) cin>>X;
#define READV(X) long long X; cin>>X;
#define READAR(A,N) long long A[N]; for(long long i=0;i<N;i++) {cin>>A[i];}
#define rz(A,N) A.resize(N);
#define sz(X) (long long)(X.size())
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define FORI(a,b,c) for(long long a=b;a<c;a++)
#define FORD(a,b,c) for(long long a=b;a>c;a--)

//Required typedefs

typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;

//Required Constants

const long long inf=(long long)1e18;
const long long MOD=(long long)(1e9+7);
const long long INIT=(long long)(1e6+1);
const long double PI=3.14159265358979;

// Required random number generators

// mt19937 gen_rand_int(chrono::steady_clock::now().time_since_epoch().count());
// mt19937_64 gen_rand_ll(chrono::steady_clock::now().time_since_epoch().count());

//Required Functions

ll power(ll x,ll y) 
{ 
    if (y == 0) 
        return 1; 
    ll p = power(x, y/2) % MOD; 
    p = (p * p) % MOD; 
  
    return (y%2 == 0)? p : (x * p) % MOD; 
}
ll modInverse(ll a) 
{ 
   return power(a,MOD-2); 
   
}

//Work

int main()
{
    #ifndef ONLINE_JUDGE
    if (fopen("INPUT.txt", "r"))
    {
        freopen ("INPUT.txt" , "r" , stdin);
        //freopen ("OUTPUT.txt" , "w" , stdout);
    }
    #endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    clock_t clk;
    clk = clock();
//-----------------------------------------------------------------------------------------------------------//

    READV(N);
    vector<pll> Z;
    FORI(i,0,N)
    {
        READV(X);
        Z.pb({X,i});
    }
    sort(Z.begin(),Z.end());
    ll ans=0;
    FORI(i,0,N)
    {
        if(i%2!=Z[i].se%2)
        {
            ans++;
        }
    }
    cout<<ans/2<<endl;

//-----------------------------------------------------------------------------------------------------------//


    clk = clock() - clk;
    cerr << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << endl;

    return 0;
}

Measured memory_bytes: 5396
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())
#define endl "\n"

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
void initialize( void );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;
template <typename T, typename K> struct P {
	T a; K b;
};
typedef struct {
	vector <int> to;
	int cost;
} edge;

int main( void ){
	// initialize();
	int N;
	cin >> N;
	vector<ll> vec(N);
	rep(i,0,N) cin >> vec[i];
	int ans = 0;
	sort_desc(vec);
	rep(i,0,N)
		rep(j,i+1,N)
			rep(k,j+1, N)
				ans += ((vec[i] < vec[j] + vec[k]) && (vec[i] != vec[j]) && (vec[j] != vec[k]));
	cout << ans << endl;
}

template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}
void initialize( void ){
	cout << fixed << setprecision( 10 );
}


Measured memory_bytes: 3636
///
// File:  c.go
// Author: ymiyamoto
//
// Created on Thu Dec 27 17:58:21 2018
//
package main

import (
	"fmt"
)

func min(arr ...int) int {
	ret := 1 << 60
	for i := range arr {
		if arr[i] < ret {
			ret = arr[i]
		}
	}
	return ret
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func main() {
	var A, B, C, X, Y int
	fmt.Scan(&A, &B, &C, &X, &Y)

	withoutHalf := X*A + B*Y
	m := min(X, Y)

	withHalfMin := m*2*C + (X-m)*A + (Y-m)*B
	var withHalfMax int
	if X < Y {
		withHalfMax = 2 * C * Y
	} else {
		withHalfMax = 2 * C * X
	}

	fmt.Println(min(withoutHalf, withHalfMin, withHalfMax))
}


Measured memory_bytes: 512
N = int(input())
s = list(input())
cnt_r = 0
cnt_b = 0
for i in range(N):
    if s[i] == "R":
        cnt_r += 1
    elif s[i] == "B":
        cnt_b += 1
if cnt_r > cnt_b:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 2940
<?php

while($line = fgets(STDIN)){
	$minV = floatval($line);
	
	// v = 9.8*t
	// s = 4.9*t^2
	$s = $minV*$minV/19.6;
	
	// s = 5*n - 5;
	$n = ceil($s/5.0) + 1;
	echo $n."\n";
}

Measured memory_bytes: 15044
#include<iostream>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= (int)end; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return 0;}
template<typename T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return 0;}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A, V, B, W, T;
    cin >> A >> V >> B >> W >> T;
    if (A <= B) {
        if ((V - W) * T >= B - A) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    } else {
        if ((V - W) * T >= A - B) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}

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


using namespace std;

int main() {


    string s;
    int n;
    cin >> n >> s;
    for (int i=0;i<s.size();i++) {
        s[i] = s[i] + n;
        if (s[i] > 'Z') s[i] -= 26;
    }
    cout << s;

    

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

int main() {
	string s;
	int k;
	cin >> s >> k;

	char ans;
	int n = s.size();
	for (int i = 0; i < n; i++) {

		// printf("%d %c: k %d\n", i, s[i], k);

		ans = s[i];
		if (s[i] == '1') {
			if (k == i + 1) {
				break;
			}
		} else {
			break;
		}
	}

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


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

int main(){
  int i,j,k;
  cin >> i >> j >> k;
  if (i < j) {
    if (j < k){
      cout << i << " " << j << " " << k << endl;
    } else if (i < k){
      cout << i << " " << k << " " << j << endl;
    } else {
      cout << k << " " << i << " " << j << endl;
    }
  } else {
      if (i < k){
        cout << j << " " << i << " " << k << endl;
      } else if (j < k){
        cout << j << " " << k << " " << i << endl;
      } else {
        cout << k << " " << j << " " << i << endl;
      }
  }
  return 0;
}

Measured memory_bytes: 3096
n,y=map(int,input().split())
y//=1000
f=False
for yu in range(n+1):
  for hi in range(n+1):
    if y<yu*10+hi*5:
      continue
    if y-(yu*10+hi*5)==n-(yu+hi):
      print(yu,hi,n-yu-hi)
      f=True
      break
  if f:
    break
else:
  print("-1 -1 -1")

Measured memory_bytes: 9116
#include <bits/stdc++.h>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

int triple_max(int x, int y, int z){
    int ans = x;
    if (y > x && y > z) ans = y;
    else if (z > x && z > y) ans = z;

    return ans;
}

int main(){
    char a, b;
    cin >> a >> b;
    if (a < b) cout << '<' << endl;
    else if (a == b) cout << '=' << endl;
    else cout << '>' << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"

int main(void) {
	int n;
	cin >> n;
	string str;
	cin >> str;
	map<char, int> m;
	for (int i = 0; i < str.size(); i++) m[str[i]]++;
	char r = 'R', b = 'B';
	(m[r] > m[b]) ? cout << "Yes\n" : cout << "No\n";
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
	int W, H, x, y, r;
	scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
	if( (W>=(x+r)) && (x-r)>=0 ){
		if( (H>=(y+r)) && (y-r)>=0 ){
			printf("Yes\n");
		} else {
			printf("No\n");
		}
	} else {
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 584
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
const long long mod = 1e9+7;
//////////////////////////////////

int main() {
  int n; cin >> n;
  vector<long long> a(n);
  long long sum = 0;
  for(int i=0; i<n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  long long ans = 0;
  for(int i=0; i<n; i++) {
    sum -= a[i];
    ans += ((sum%mod) * a[i])%mod;
    ans %= mod;
  }
  cout << ans << endl;

  return 0;
}

// EOF

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

public class Main {
  private static boolean debug = false;
  private static boolean elapsed = false;

  private static PrintWriter _err = new PrintWriter(System.err);

  private int N;
  private int K;

  private long count;

  private void solve(Scanner sc, PrintWriter out) {
    N = sc.nextInt();
    K = sc.nextInt();

    count = K;
    for (int i = 1; i < N; ++i) {
      count *= K - 1;
    }

    out.println(count);
  }
  private long C(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    for (long i = r; i > 1; --i) {
      res /= i;
    }
    return res;
  }
  private long P(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    return res;
  }
  /*
   * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
   * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
   */
  public static void main(String[] args) {
    long S = System.currentTimeMillis();

    Scanner sc = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    new Main().solve(sc, out);
    out.flush();

    long G = System.currentTimeMillis();
    if (elapsed) {
      _err.println((G - S) + "ms");
    }
    _err.flush();
  }
}

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

ll dp[4000][4000];

int main()
{
    int n;cin>>n;
    vector<int>a(n);
    int m=0;
    for(int i=0;i<n;++i){
        cin>>a[i];
        m ^= a[i];
    }
    for(int i=0;i<n;++i){
        int r=m ^ a[i];
        cout<<r<<" ";
    }
}

Measured memory_bytes: 4044
w,h,n=map(int,input().split())
ax=ay=0

for i in range(n):
    x,y,a=map(int,input().split())
    if(a==1):
        ax=max(ax,x)
    elif(a==2):
        w=min(w,x)
    elif(a==3):
        ay=max(ay,y)
    else:
        h=min(h,y)

print('0'if ax>=w or ay>=h else(w-ax)*(h-ay))
#コピペです。

Measured memory_bytes: 3064
import java.util.*;

class Main {
  public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      while(true) {
        int x = sc.nextInt();
        int y = sc.nextInt();
        if (x == 0 && y == 0) {
          break;
        }
        if (x < y) {
          System.out.println(x + " " + y);
        } else {
          System.out.println(y + " " + x);
        }
      }

      sc.close();
  }
}


Measured memory_bytes: 35556
/**
 *    author:  otera    
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve() {
	int n; cin >> n;
    vector<int> primes;
    int n_ = n;
    for(int i = 2; i * i <= n; ++ i) {
        if(n_ % i == 0) primes.pb(i);
        while(n_ % i == 0) {
            n_ /= i;
        }
    }
    if(n_ != 1) primes.pb(n_);
    int m = (int)primes.size();
    int res = 0;
    for(int bit = 1; bit < (1<<m); ++ bit) {
        int co = __builtin_popcount(bit);
        int tmp = 1;
        rep(i, m) {
            if(bit & (1<<i)) {
                tmp *= primes[i];
            }
        }
        if(co % 2 == 1) {
            res += n / tmp;
        } else {
            res -= n / tmp;
        }
    }
    cout << n - res << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}


Measured memory_bytes: 3168
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x*x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define loop(n) FOR(i,0,n)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {
	int time; cin >> time;
	int h = time / 3600;
	int m = time % 3600/60;
	int s = time % 60;

	cout << h << ":" << m << ":" << s << endl;

	return 0;
}


Measured memory_bytes: 3108
# coding: utf-8

import sys
import math
import collections
import itertools
def input(): return sys.stdin.readline().strip()
def gcd(x, y): return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y): return (x * y) // gcd(x, y)
MOD = 10 **9 + 7

# N = int(input())
# L = [int(x) for x in input().split()]
N, A, B = map(int, input().split())
# A = [int(input()) for _ in range(N)]
# S = input()

print(min(A * N, B))


Measured memory_bytes: 38256
#include<stdio.h>
int main(void){
 int a[100],n,i,j,v;
 scanf("%d",&n);
 for (i=1;i<n+1;i++){
   scanf("%d",&a[i]);
   if(i!=n) printf("%d ",a[i]);
   else printf("%d",a[i]);
 }
 printf("\n");  
 for (j=2;j<=n;j++){
   v=a[j];
   i=j-1;
   while ( i>0 && a[i]>v){
     a[i+1] = a[i];
     i--; 
   }
   a[i+1] = v;
   for ( i=1; i<n+1; i++){
     if(i!=n) printf("%d ",a[i]);
     else printf("%d",a[i]);
   }
   printf("\n");
 }
 return 0;
}

Measured memory_bytes: 604
fun main(args: Array<String>) {
    val t = LongArray(100001)
    var cur = 0

    fun rec(s: String, f: Boolean) {
        if (cur == t.size) {
            return
        }

        if (s.length == 10) {
            t[cur] = s.toLong()
            cur++
            return
        }

        if (f) {
            rec(s + '0', true)
            for (i in 1..9) {
                rec(s + ('0' + i), false)
            }
        } else {
            val x = s.last() - '0'

            for (i in -1..1) {
                if (x + i in 0..9) {
                    rec(s + ('0' + x + i), false)
                }
            }
        }
    }

    rec("", true)

    println(t[readLine()!!.toInt()])
}


Measured memory_bytes: 40392
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  for(int i=0; i<N; i++){
    cin >> S.at(i);
  }
  int M;
  cin >> M;
  vector<string> T(M);
  for(int i=0; i<M; i++){
    cin >> T.at(i);
  }
  int max=0;
  for(int i=0; i<N; i++){
    int sum=1;
    for(int j=i+1; j<N; j++){
      if(S.at(i)==S.at(j)) sum++;
    }
    for(int j=0; j<M; j++){
      if(S.at(i)==T.at(j)) sum--;
    }
    if(sum>max) max = sum;
  }
  cout << max <<endl;
}

Measured memory_bytes: 256
// abc086_b
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(i,v.size())cout<<" "<<v[i];cout<<endl<<endl;
#define show2d(v) rep(i,v.size()){rep(j,v[i].size())cout<<" "<<v[i][j];cout<<endl;}cout<<endl;
using namespace std;
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(int argc, char *argv[])
{
  int a,b,n;
  cin>>a>>b;
  if(b==100) {
    n=a*1000+b;
  } else if(b<100&&b>=10){
    n=a*100+b;
  }else{
    n=a*10+b;
  }
  for(int i=1;i<=1000;++i){
    if (i*i==n) {
      cout<<"Yes"<<endl;
      return 0;
    }
  }
  cout<<"No"<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char [] sArray = s.toCharArray();
		int count = 0;
		for (int i = 1; i < 4; i++) {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		}
		if (count != 1) {
			System.out.println("No");
			return;
		} else {
			for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		}
		System.out.println("No");
	}
}

Measured memory_bytes: 23892
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  vector <double> a(n);
  for(int i=0; i<n; i++){
    cin >> a.at(i);
  }
  
  double count=0;
  for(int i=0; i<n; i++){
    count += 1.0 / a.at(i);
  }
  cout << 1.0 / count << endl;
  
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int NN = N;
    int S = 0;
    while (NN > 0) {
      S += (NN % 10);
      NN /= 10;
    }
    if (N % S == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}

Measured memory_bytes: 21972
#include<bits/stdc++.h>
using namespace std;
struct Union{
  vector<int> par;
  Union(int a){
  par=vector<int>(a,-1);
  }
  int find(int a){
    if(par[a]<0){
      return a;
    }
    else{
      return par[a]=find(par[a]);
    }
  }
  bool same(int a,int b){
    return (find(a)==find(b));
  }
  int size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    int c=find(a),d=find(b);
    if(c==d)
      return;
    if(size(c)<size(d)){
      swap(c,d);
    }
    par[c]+=par[d];
    par[d]=c;
  }
};
int main(){
  int n,m,ans=0;
  cin >> n >> m;
  Union qwerty(n);
  vector<int> x(m),y(m),z(m);
  for(int i=0;i<m;i++){
    cin >> x[i] >> y[i] >> z[i];
    qwerty.unite(x[i]-1,y[i]-1);
  }
  set<int> q;
  for(int i=0;i<n;i++){
    q.insert(qwerty.find(i));
  }
  cout << q.size() << endl;
}


Measured memory_bytes: 6400
# -*- coding: utf-8 -*-
"""
Elementary Number Theory - Least Common Multiple
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_C&lang=jp

"""
import sys
from math import gcd
from functools import reduce

def solve(A):
    return reduce(lambda x, y: x * y // gcd(x, y), A)


def main(args):
    _ = input()
    A = [int(a) for a in input().split()]
    ans = solve(A)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])



Measured memory_bytes: 6356
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

int main() {
	char S[200001], T[200001];
	cin >> S >> T;
	int n = strlen(S);

	char In[26] = {}, Out[26] = {};
	for (int i = 0; i < n; i++) {
		char s = S[i], t = T[i];
		if (In[s - 'a'] == 0) {
			In[s - 'a'] = t;
		}
		else {
			if (In[s - 'a'] != t) {
				cout << "No";
				return 0;
			}
		}

		if (Out[t - 'a'] == 0) {
			Out[t - 'a'] = s;
		}
		else {
			if (Out[t - 'a'] != s) {
				cout << "No";
				return 0;
			}
		}
	}

	cout << "Yes";

	return 0;
}

Measured memory_bytes: 640
#include<iostream>
using namespace std;
void insertion_sort(int array[],int n){
    for(int i = 1;i<n;i++){
       int key = array[i];
       int j = i-1;
       while(j>=0 && array[j] > key){
           array[j+1] = array[j];
           j = j-1;
       }
       array[j+1] = key;
       for(int k =0;k<n;k++){
           
           if(k == n-1){
               cout<<array[k]<<endl;
           }else{
               cout<<array[k]<<" ";
           }
       }
    }
}
int main(){
    int n;
    cin>>n;
    int array[100];
    for(int i =0;i<n;i++){
        cin>>array[i];
        
        if(i == n-1){
            cout<<array[i]<<endl;
        }else{
            cout<<array[i]<<" ";
        }
    }
    insertion_sort(array,n);
}


Measured memory_bytes: 3092
n,m = map(int,input().split())
flag = [False]*n
balls = [1]*n
flag[0]= True
for i in range(m):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    balls[x] -=1
    balls[y] += 1
    if flag[x] == True:
        flag[y] =True
    if flag[x] == True and balls[x] == 0:
        flag[x] = False

cnt = 0
for i in range(n):
    if flag[i] == True and balls[i]>=1:
        cnt += 1
print(cnt)

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

#define forn(i,n) for(int i=0;i<n;i++)
#define sz(x) (int)x.size() 
typedef long long ll;
using namespace std;

int main() {
	string s;
	cin>>s;
	string pat="ACGT";
	int mx=0,cnt=0;
	forn(i,sz(s)){
		if(pat.find(s[i])!=pat.npos) cnt++;
		else cnt=0;
		mx=max(cnt,mx);
	}
	cout<<mx<<endl;
	return 0;
}

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

int main(){
  int n,d;
  scanf("%d %d",&n,&d);
  int p = 2*d + 1;
  if(n % p == 0){
    printf("%d",n/p);
  }else{
    printf("%d",n/p + 1);
  }
  return 0;
}

Measured memory_bytes: 128
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)
function main()
    n=parseInt(readline())
    a=parseMap(split(readline()))
    b=parseMap(split(readline()))
    res=sum(a)
    for i in 1:n
        if a[i]>=b[i]
            a[i]-=b[i]
            b[i]=0
        else
            b[i]=max(b[i]-a[i],0)
            a[i]=0
            a[i+1]=max(a[i+1]-b[i],0)
        end
    end
    println(res-sum(a))
end
main()

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


int main() {
    ll n, k, q;
    cin >> n >> k >> q;
    vector<ll> point(n, k-q);
    ll a = 0;
    rep1(i, q){
        cin >> a;
        point[a-1]++;
    }
    rep1(i,n){
        if (point[i]<1){
            cout << "No" << endl;
        }
        else{
            cout << "Yes" << endl;
        }
    }
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

int main(){
  int cnt=0;
  int n,h;
  cin>>n>>h;
  vector<P> ab(n);
  rep(i,0,n){
    int a,b;
    cin>>a>>b;
    ab[i]=mp(a,b);
  }
  //////////////
  sort(all(ab));
  reverse(all(ab));
  ll amax=ab[0].first;
  ////////////////////////////
  rep(i,0,n){
    swap(ab[i].first,ab[i].second);
  } 
  P mx;
  mx=ab[0];
      int a=mx.second,b=mx.first;
  sort(all(ab));
  reverse(all(ab));
  /////////////////////////////
  int v=0;
  rep(i,0,n){
   if(ab[i]==mx&&v==0){
     
     v++;
     continue;
   }
    if(ab[i].first<amax) break;
    if(ab[i].first<b&&h-b<=0) break;
    cnt++;
    h-=ab[i].first;
    
    if(h<=0) break;//この辺がおかしいかも
   
  }
 
    ////int a=mx.second,b=mx.first;
    while(h>b){
      cnt++;
      h-=a;
    }
  if(h>0) cnt++;
  
  
  
  cout<<cnt<<endl;
}
/*
a(n)の最大値　amax 以下のbを持つ剣は使わない
amax 以外の剣で使うものを投げる
amax の剣のb の値以下になるまでa減らす
b減らして倒す。
*/



Measured memory_bytes: 1024
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int W = sc.nextInt(); 
        int H = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int r = sc.nextInt();
        if(x+r>W || y+r>H || x-r<0 ||y-r<0)
        System.out.println("No");
        else
        System.out.println("Yes");
    }
}


Measured memory_bytes: 26332
#include<iostream>
#include<cstdio>
#include<cstring>
#define ll long long 
using namespace std;
const ll INF = 1e18+10;
const int N = 1e5+10;
ll n, a[N];
ll l, r, mid, ans, sum[N], tmp[N];
ll lim;
 
 
void chkMin(ll &x, ll y){if (x > y) x = y;}
void chkMax(ll &x, ll y){if (x < y) x = y;}
 
ll Msort(ll le, ll ri)//计算中位数大于等于mid的[l, r]对数，具体过程类似逆序对
{
    if (le == ri)
        return 0;
    ll mid = (le+ri)>>1;
    ll ret = 0;
    ret += Msort(le, mid);
    ret += Msort(mid+1, ri);
    ll i = le, j = mid+1, k = le;
    while (i <= mid && j <= ri){
        if (sum[i] <= sum[j]){
            tmp[k++] = sum[i++];
            ret += ri-j+1;
        }
        else
            tmp[k++] = sum[j++];
    }
    while (i <= mid)
        tmp[k++] = sum[i++];
    while (j <= ri)
        tmp[k++] = sum[j++];
    for (ll o = le; o <= ri; o++)
        sum[o] = tmp[o];
    return ret;
}
 
bool Check(ll mid)
{
    sum[0] = 0;
    for (ll i = 1; i <= n; i++){
        sum[i] = sum[i-1];
        if (a[i] >= mid) sum[i]++;
        else sum[i]--;
    }
    if (Msort(0, n) >= lim) return true;
    return false;
}
 
int main()
{
    cin >> n;
    lim = (n*(n-1)/2+n+1)/2;//中位数大于等于median of medians的区间个数下界
    l = INF; r = -INF;
    for (ll i = 1; i <= n; i++){
        cin >> a[i];
        chkMin(l, a[i]);
        chkMax(r, a[i]);
    }
    while (l <= r){
        mid = (l+r)>>1;
        if (Check(mid))
            ans = mid, l = mid+1;
        else
            r = mid-1;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <string>
using namespace std;
int main()
{
  bool alpha[26] = {false};
  string S;
  cin >> S;
  for (int i = 0; i < S.length(); i++) {
    char c = S[i];
    alpha[(int)(c-'a')] = true;
  }
  for (int i = 0; i < 26; i++) {
    if (!alpha[i]) {
      cout << (char)(i+'a') << endl;
      return 0;
    }
  }
  cout << "None" << endl;
  return 0;
}


Measured memory_bytes: 3656
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
int main()
{
    int n;
    int t = 0, ans = 0;
    cin>>n;
    string s;
    cin>>s;
    for(int i = 0; i < n; i++){
        if(s[i] == 'I')t++;
        else if(s[i] == 'D')t--;
        ans = max(ans, t);
    }
    cout<<ans;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(){
  int n,i,x;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    x=i;
    if(x%3==0){
      printf(" %d",x);
    }
    else{
      while(x){
      if(x%10==3){ 
    printf(" %d",i);
        break;
      }
      x=x/10;
      }
    }
  }
    printf("\n");
  return 0;
}


Measured memory_bytes: 2096
#include<iostream>
#include<iomanip>

using namespace std;

int main() {
	int a, b;
	cin >> a >> b;

	int d = a / b;
	int r = a % b;
	double f = double(a) / b;

	cout << d << " " << r << " " << fixed << setprecision(5) << f << endl;

	return 0;
}


Measured memory_bytes: 3284
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>
#include<cmath>
#include<set>
#include<random>
#include<map>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const long long mod = 1000000007;
const long long inf = 11451419198109130;
typedef pair<int, int> P;
typedef pair<P, P> PP;
struct edge {int to, cost;};

signed main() {
	string s, t; cin >> s >> t;
	rep(i, s.size()) {
		string u;
		char v = t[t.size() - 1];
		u.push_back(v);
		t.pop_back();
		u += t;
		if (s == u) {
			puts("Yes");
			return 0;
		}
		t = u;
	}
	puts("No");
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int n){
	par= vector<int>(n, -1);
  }
  int find(int x){
    if(par[x]<0)
      return x;
    else
      return par[x]=find(par[x]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
signed main(){
	char a;
	cin>>a;
	if(a=='A')
		cout<<'T'<<endl;
	if(a=='T')
		cout<<'A'<<endl;
	if(a=='C')
		cout<<'G'<<endl;
	if(a=='G')
		cout<<'C'<<endl;
}

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

typedef long long ll;

int a[100007];
int cnt[100007];

int main(){
  int n;
  int i;
  int max;

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

  max = cnt[0]; // -1
  if((cnt[0] + cnt[1]) > max) max = cnt[0] + cnt[1]; // 0
  for(i = 1;i <= 100000;i++){
    if((cnt[i] + cnt[i - 1] + cnt[i + 1]) > max) max = cnt[i] + cnt[i - 1] + cnt[i + 1];
  }

  printf("%d\n", max);

  return 0;
}


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

bool prime(int x){
  for(int i=2;i<x;i++){
    if(x%i==0) return false;
  }
  return true;
}

int main(){
  int X;
  cin >> X;
  
  while(!prime(X)) X++;
  
  cout << X << endl;
    
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[][] A = new int[n][m];
    int[] b = new int[m];
    int[] ans = new int[n];

    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        A[i][j] = sc.nextInt();

    for (int i = 0; i < m; i++)
      b[i] = sc.nextInt();

    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        ans[i] += A[i][j] * b[j];

    for (int i = 0; i < n; i++)
      System.out.println(ans[i]);
  }
}

Measured memory_bytes: 40588
#include <cstdio>
#include <algorithm>
#include <bitset>
using namespace std;
bitset<500000> bs;
void sieve() {
	bs.set();
	bs[0] = bs[1] = 0;
	for (long long i = 2; i < 500000; ++i) {
		if (bs[i]) {
			for (long long j = i * i; j < 500000; j += i) bs[j] = 0;
		}
	}
}
int main() {
	sieve();
	int X;
	scanf("%d", &X);
	for (int i = X; i < 500000; ++i) {
		if (bs[i]) {
			printf("%d", i);
			return 0;
		}
	}
	return 0;
}

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

int main() {
    string s;   cin >> s;
    int min_num = 1000;
    for (int i = 0; i < s.length() - 2; i++) {
        int x = stoi(s.substr(i, 3));
        min_num = min(min_num, abs(x - 753));
    }
    cout << min_num << endl;
}

Measured memory_bytes: 256
// header

#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#define ABS(a) (((a) >= 0) ? (a) : -(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#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 REP(i, n) for (int i = 0; i < (n); ++i)
#define POW_10_5 100000
#define POW_10_9 1000000000
#define INF (numeric_limits<int>::max()/2)
#define int long long

typedef pair<int, int> Pair;

// header

// code

const int Nlim = POW_10_5;
int N, K, A[Nlim];

int Ans() {
  int cnt[40] = {};
  REP(i, 40) {
    REP(j, N) {
      cnt[i] += (A[j] >> i) & 1;
    }
  }

  int ans = 0;

  int ans2 = 0;
  REP(i, 40) {
    if (((K + 1) >> i) & 1) {
      ans2 += (N - cnt[i]) * (1ll << i);
    } else {
      ans2 += cnt[i] * (1ll << i);
    }
  }

  REP(i, 40) {
    if (((K + 1) >> i) & 1) {
      ans2 = ans2 - ((N - cnt[i]) * (1ll << i)) + (cnt[i] * (1ll << i));
      ans = MAX(ans, ans2);
    }
    ans2 = ans2 - (cnt[i] * (1ll << i)) + (MAX(N - cnt[i], cnt[i]) * (1ll << i));
  }

  return ans;
}

signed main() {
  cin >> N >> K;
  REP(i, N) { cin >> A[i]; }

  auto ans = Ans();

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

// code


Measured memory_bytes: 1024
#include <iostream>
#include <string>

int main()
{
    std::string s;
    std::cin >> s;
    const auto len = s.size();
    int result{};
    for (int i = 0; i < len / 2; i++) {
        if (s[i] != s[len - i - 1]) result++;
    }
    std::cout << result << std::endl;
    return 0;
}


Measured memory_bytes: 256
l = int(input())
n = l.bit_length()
ANS = []
for i in range(1, n):
    ANS.append((i, i + 1, 0))
    ANS.append((i, i + 1, 2**(i - 1)))
for i in reversed(range(1, n)):
    if l - 2**(i - 1) >= 2**(n - 1):
        l -= 2**(i - 1)
        ANS.append((i, n, l))
print(n, len(ANS))
for ans in ANS:
    print(*ans)


Measured memory_bytes: 62172
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define mkp make_pair
#define in insert
#define er erase
#define fd find
#define fr first
#define sc second
typedef long long ll;
typedef long double ld;
const ll INF=0x3f3f3f3f3f3f3f3f;
const ll llinf=(1LL<<62);
const int inf=(1<<30);
const int nmax=1e5+50;
const int mod=1e9+7;
using namespace std;
ll a,b,n;
int main()
{
	//freopen("sol.in","r",stdin);
	//freopen("sol.out","w",stdout);
	//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
	cin>>n>>a>>b;
	if(a%2LL==b%2LL)cout<<(b-a)/2LL<<endl;
	else cout<<(b-a-1LL)/2LL+min(n-b,a-1)+1<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,ans,w;
    while(cin>>w>>a>>b)
    {
       ans=max(a,b)-(w+min(a,b));
       if(ans<0)printf("0\n");
       else cout<<ans<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

C = [0]*10001
for i in A:
    C[i] += 1

tmp = C[0]
for i in range(1, 10001):
    C[i] += tmp
    tmp = C[i]

ans = [0]*N
for i in range(N-1, -1, -1):
    tmp = A[i]
    ix = C[tmp]-1
    ans[ix] = tmp
    C[tmp] -= 1

print(*ans, sep=' ')


Measured memory_bytes: 224376
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>

using namespace std;
typedef long long ll;

int gcd(int x, int y) {
  if (x < y) swap(x, y);
  while (y > 0) {
    int r = x % y;
    x = y;
    y = r;
  }
  return x;
}

/*迷路
const int INF = 50;

typedef pair<int,int> P;
char field[52][52];
int d[51][51];
int r,c;
int sx,sy;
int gx,gy;

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

int bfs(){
    queue<P> que;
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++){
            d[i+1][j+1] = INF;
        }
    }
    que.push(P(sy,sx));
    d[sy][sx]=0;
while(que.size()){
    P p=que.front();
    que.pop();
    if(p.second==gx&&p.first==gy) break;
    for(int i=0;i<4;i++){
        int nx=p.second+dx[i];
        int ny=p.first+dy[i];

        if(1<=nx&&nx<=c&&1<=ny&&ny<=r&&field[ny][nx]!='#'&&d[ny][nx]==INF){
            que.push(P(ny,nx));
            d[ny][nx] = d[p.first][p.second] + 1;
        }
    }
}
return d[gy][gx];
}
*/

int main(){
  int n;
  string s;
  int k;
  cin>>n>>k;
  cin>>s;
  s[k-1] = s[k-1]-'A'+'a';
  cout<<s<<endl;;
  return 0;
}


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

int main(){
  int n,a;
  cin >> n;
  a = n%10;
  
  if(a==3)
    cout << "bon" << endl;
  else if(a==0||a==1||a==6||a==8)
    cout << "pon" << endl;
  else
    cout << "hon" << endl;
}


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

int judge(vector<int> x, vector<int> y){
    rep(i,n){
        if(x.at(i)!=y.at(i)) return 0;
    }
    return 1;
}

int main(){
    cin >> n;
    vector<int> a(n), b(n);
    rep(i,n) cin>>a.at(i);
    rep(i,n) cin>>b.at(i);

    vector<int> s(n);
    rep(i,n) s.at(i) = i+1;
    int a_jg, b_jg, cnt=0;
    int a_num=-1;
    int b_num=-1;
    do {
        a_jg = judge(s, a);
        b_jg = judge(s, b);
        if(a_jg==1) a_num=cnt;
        if(b_jg==1) b_num=cnt;
        cnt+=1;
    } while(next_permutation(s.begin(), s.end()) and (a_num==-1 or b_num==-1));
    // cout << a_num << ' ' << b_num << endl;
    cout << abs(a_num-b_num) << endl;
    return 0;
}

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

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(obj) obj.begin(), obj.end()

const int iINF = 1e9;
const long long llINF = 1e18;
const int MOD = 1e9 + 7;

using namespace std;

template <typename T>
int getFormer(const vector<T> &vec, T x) {
    return upper_bound(vec.begin(), vec.end(), x) - vec.begin() - 1;
}

template <typename T>
int getLatter(const vector<T> &vec, T x) {
    return lower_bound(vec.begin(), vec.end(), x) - vec.begin();
}

int ball[210], dp1[1000010], dp2[1000010];

int main() {
    for(int i = 1; i <= 200; i++) {
        ball[i] = i * (i + 1) * (i + 2) / 6;
    }

    fill_n(dp1, 1000010, iINF);
    fill_n(dp2, 1000010, iINF);
    dp1[0] = 0;
    dp2[0] = 0;

    for (int i = 1; i <= 1000000; i++) {
        for (int j = 1; j <= 200; j++) {
            if (i - ball[j] < 0) continue;
            dp1[i] = min(dp1[i], dp1[i - ball[j]] + 1);
            if (ball[j] & 1) dp2[i] = min(dp2[i], dp2[i - ball[j]] + 1);
        }
    }

    int N;
    while(cin >> N && N) {
        cout << dp1[N] << " " << dp2[N] << endl;
    }
}


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

using namespace std;
typedef long long int ll;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)

int main() {
  char S[128];
  ll K;
  scanf("%s", S);
  scanf("%lld", &K);

  int ones = 0;
  while (S[ones] == '1') {
    ones++;
  }

  if (K <= ones) {
    printf("%c\n", S[0]);
  } else {
    int i = 0;
    while (S[i] == '1') {
      i++;
    }
    printf("%c\n", S[i]);
  }
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <queue>


using namespace std;

int main() {
    int ans =0, A, B, C;
    vector<int> N;

    cin >> A >> B >> C;

    N.push_back(A);
    N.push_back(B);
    N.push_back(C);


    if (A % 2 + B % 2 + C % 2 == 1) {
        ans += 1;
        for (int i = 0; i < 3; i++) {
            if (N[i] % 2 == 0) {
                N[i] += 1;
            }
        }
    }
    else if (A % 2 + B % 2 + C % 2 == 2) {
        ans += 1;
        for (int i = 0; i < 3; i++) {
            if (N[i] % 2 == 1) {
                N[i] += 1;
            }
        }
    }

    sort(N.begin(), N.end());

    ans += (2 * N[2] - N[1] - N[0]) / 2;

    cout << ans;

    return 0;
}

Measured memory_bytes: 256
n=int(input())
p=[list(map(int,input().split()))for i in range(n)]
d=[]
for i in range(n):
  if p[i][2]==0:
    d.append(i)
d.sort(reverse=1)
for i in d:
  del p[i]
if len(p)==1:
  print(p[0][0],p[0][1],p[0][2])
else:
  for i in range(0,101):
    for j in range(0,101):
      k=1
      l=p[0][2]+abs(i-p[0][0])+abs(j-p[0][1])
      for x,y,h in p:
        if h==0:
          continue
        m=h+abs(i-x)+abs(j-y)
        if l!=m:
          k=0
      if k:
        ans=[i,j,l]
  print(ans[0],ans[1],ans[2])


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
//const ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
const ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
ll myctoi(char C) {return C - '0';}
char myitoc(ll N) {return '0' + N;}
#define FINALANS(A) {cout << (A) << '\n'; exit(0);}

int main()
{
  ll H, N;
  cin >> H >> N;
  vector<ll> A(N), B(N);
  for (ll i = 0; i < N; i++)
  {
    cin >> A.at(i) >> B.at(i);
  }

  vector<ll> dp(H + 1, INF);
  dp.at(0) = 0;
  for (ll i = 0; i <= H; i++)
  {
    for (ll j = 0; j < N; j++)
    {
      chmin(dp.at(min(H, i + A.at(j))), dp.at(i) + B.at(j));
    }
  }

  cout << dp.at(H) << endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#include<bits/stdc++.h>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define vvc vector<vector<char> >
#define vvs vector<vector<string> >
#define P 1000000007
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const long long LLINF=1LL<<60;
//set<int>::iterator it;


int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
	
	int n,i,t,j,k;
	string s,str;
	cin>>n;
	vector<pair<string,int> > v;
	string a[n],c[n];
	int b[n];
	rep(i,n){
		cin>>s>>t;
		a[i]=s;
		b[i]=t;
		c[i]=s;
		v.push_back(make_pair(s,t));
	}
	int ans[n]={0};
	sort(c,c+n);
	sort(v.begin(),v.end());
	for(i=0;i<n;i++){
		str=c[i];
//		cout<<c[i]<<endl;
		for(j=n-1;j>=0;j--){
			if(v[j].first==str){
				for(k=0;k<n;k++){
					if(v[j].first==a[k]&&v[j].second==b[k]){
						cout<<k+1<<endl;
						break;
					}
				}
				v[j].first="###";
				
//				cout<<j<<endl;
				break;
			}
		}
	}
//	rep(i,n)cout<<ans[i]<<endl;
	
	
//////////////////////////////////////////////////////
return 0;}











Measured memory_bytes: 256