akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define deb(x) cout << #x << " = "<< x << "\n";

signed main()
{
	//freopen("in.txt", "r",stdin);
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	
	int k; cin >> k;
	queue<int> q;
	for(int i = 1; i <= 9; i++)
		q.push(i);
	set<int> vis;
	while(k--)
	{
		int x = q.front(); q.pop();
		if(k == 0)
		{
			cout << x << "\n";
			break;
		}
		
		if(x % 10 != 0) q.push(x*10 + (x%10) - 1);
		q.push(x*10 + (x%10));
		if(x%10 != 9) q.push(x*10 + (x%10) + 1);
	}
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define LINF 1000000000000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

typedef pair<int, int> P;
typedef pair<long long, long long> LLP;

int main() {

    long long N, A, B;
    cin >> N >> A >> B;

    long long ans = (N / (A + B)) * A;
    ans += min(N % (A + B), A);
    
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
 
int main(void){
    int a,b,C;
    double S,L,h,s_1,s_2,s_3,rad_1,rad_2,henn,c;
 
    scanf("%d %d %d",&a,&b,&C);
 
    rad_1=C*PI/180;
    s_1=sin(rad_1);
    S=(a*b*s_1)/2;
    s_2=cos(rad_1);
    henn=a*a+b*b-2*a*b*s_2;
    c=sqrt(henn);
    L=a+b+c;
    rad_2=(180-C)*PI/180;
    s_3=sin(rad_2);
    h=b*s_3;
 
    printf("%lf %lf %lf\n",S,L,h);
 
    return 0;
}


Measured memory_bytes: 2108
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
	int N;
	cin >> N;
	string S;
	map<string, int> dict;
	int max = -1;
	for(int i=0; i<N; i++) {
		cin >> S;
		if(dict.count(S)==0) {
			dict[S] = 0;
		}
		dict[S]++;
		if(dict[S]>max) {
			max = dict[S];
		}
	}
	vector<string> data;
	for(auto it=dict.begin(); it!=dict.end(); it++) {
		if(it->second == max ) {
			data.push_back(it->first);
		}
	}
	sort(data.begin(), data.end());
	for(int i=0;i<data.size();i++) {
		cout << data[i] << endl;
	}
	return 0;
}


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

int main(){
	int H, W;
	
	while(1){
		cin >> H >> W;
		
		if(H == 0 && W == 0) break;
		for(int i=0; i<H; i++){
		  for(int j=0; j<W; j++){
		    if(i==0 || i==H-1 || j==0 || j==W-1){
		      cout << "#";
		    }else{
		      cout << ".";
		    }
		  }
		  cout << "\n";
		}
		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 1152
#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
using namespace std;

int main(){
    string s;
    cin >> s;
    //cout << s << "\n";
    int cnt = 0;
    for(int i=0;i<3;i++){
        if(s[i] == s[i+1]){
            cnt++;
            //cout << cnt <<"\n";
        }else{
            if(cnt != 2 ){
                cnt = 0;
            }

        }
    }
    //cout << "cnt = " << cnt << "\n";
    if(cnt == 2 || cnt == 3){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }

}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstdio>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;

#define ll long long

#define si(x) scanf("%d", &x)
#define sll(x) scanf("%lld", &x)

#define pi(x) printf("%d", x)

int main()
{
    ll t, n, count = 0, m;
    sll(t);

    for (int i = 1; i < t; i++)
    {
        if (t % i == 0)
        {
            count += (t / i) - 1;
        }
        else
        {
            count += floor(t / (double)i);
        }
    }

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

    return 0;
}

Measured memory_bytes: 3812
use proconio::input;

fn main() {
    input! {
        n: usize,
        k: usize,
        a: [i64; n],
    };
    for i in k..n {
        let ans = a[i - k] < a[i];
        println!("{}", if ans { "Yes" } else { "No" });
    }
}


Measured memory_bytes: 5532
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
  vector <int> p(n);
  for(int i=0;i<n;i++)
    cin>>p.at(i);
  int ans=0;
  for(int i=0;i<n-2;i++){
  if(p.at(i)<p.at(i+1) && p.at(i+1)<p.at(i+2))
        ans++;
    if(p.at(i+1)<p.at(i) && p.at(i+2)<p.at(i+1))
      ans++;
  
  } cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                while(n != 0){ 
                        System.out.println(min(n));
                        n = sc.nextInt();
                }   
                sc.close();
        }   
        static int min(int n){
                int min = Integer.MAX_VALUE;
                for(int c = n/500 ; c >= 0 ; c--){
                        for(int b = (n-c*500)/300 ; b >= 0 ; b--){
                                if((n-c*500-b*300)%200 == 0){ 
                                        int a = (n-c*500-b*300)/200;
                                        int cost = cost(a, b, c); 
                                        if(cost < min){
                                                min = cost;
                                        }   
                                }   
                        }   
                }   
                return min;
        }   
        static int cost(int a, int b, int c){
                return (a%5)*380+(a/5)*5*380*8/10+(b%4)*550+(b/4)*4*550*85/100+(c%3)*850+(c/3)*3*850*88/100;
        }   
}

Measured memory_bytes: 0
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <iostream>
#include <limits.h>
#include <algorithm>

using namespace std;

int main()
{
    int N, A, B;
    cin >> N >> A >> B;
    

    cout << min(N * A, B) << endl;

    return 0;
}

Measured memory_bytes: 256
import math
L=[
("black",00,00,00),
("blue",00,00,255),
("lime",00,255,00),
("aqua",00,255,255),
("red",255,00,00),
("fuchsia",255,00,255),
("yellow",255,255,00),
("white",255,255,255)]
while True:
    c=raw_input()
    if c=="0":break
    Rk,Gk,Bk=int(c[1:3],16),int(c[3:5],16),int(c[5:7],16)
    m=10000
    for cl,r,g,b in L:
        t=math.sqrt(pow(r-Rk,2)+pow(g-Gk,2)+pow(b-Bk,2))
        if t<m:
            m=t
            color=cl
    print color

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

int main() {
	string s;
	cin >> s;
	int appear[3] = {};
	for(int i = 0;i < 3;++i){
		appear[s[i]-'a']++;
	}
	if(appear[0] == 1&&appear[1] == 1&&appear[2] == 1){
		cout << "Yes" << endl;
	}else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define hii cout << "hii" << endl
#define int long long
#define endl '\n'
#define all(s) s.begin(), s.end()
 
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
 
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 0
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE

const int N = 3e5 + 5;
const int MAX = 250000 + 5;
const int M = 5e6 + 5;
const int mod = 998244353;
const int MOD = 998244353;
const int INF = 1e18;
const int LG = 21;


int arr[N];

void solve()
{
	int a, b, c;
	cin >> a >> b >> c;
	int k;
	cin >> k;
	int movs = 0;
	while(b <= a)
	{
		b *= 2;
		movs++;
	}
	while(c <= b)
	{
		c *= 2;
		movs++;
	}
	if(movs <= k)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
}
 
int32_t main() 
{	
	ios_base:: sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	    int t = 1;
	    // cin >> t;
	while(t--)solve();
	return 0;
}

Measured memory_bytes: 3640
import sys
input=sys.stdin.readline

s=input().rstrip()
t=input().rstrip()

ns=len(s)
nt=len(t)

ans=10**4
for i in range(ns-nt+1):
    temp=0
    for j in range(nt):
        if t[j]!=s[i+j]:
            temp+=1
    ans=min(ans,temp)

print(ans)


Measured memory_bytes: 67604
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    val inputs = mutableListOf<Int>()
    var max = 0
    var maxSecond = 0

    for ( i in 0 until n) {
        val a = readLine()!!.toInt()
        inputs.add(a)
    }

    var maxIndex = 0
    for ( i in 0 until n) {
        if(inputs[i] >= max) {
            max = inputs[i]
            maxIndex = i
        }
    }

    var maxIndexSecond = 0
    for ( i in 0 until n) {
        if(inputs[i] >= maxSecond && i != maxIndex) {
            maxSecond = inputs[i]
            maxIndexSecond = i
        }
    }

    for ( i in 0 until n) {
        if(i == maxIndex) {
            println(inputs[maxIndexSecond])
        } else {
            println(inputs[maxIndex])
        }
    }

}

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

int main()
{
    int N;
    string s;
    scanf("%d", &N);
    cin>>s;
    long long red, green, blue, result;
    red = green = blue = 0;
    for(int i = 0; i < s.size(); i++)
    {
        if(s[i] == 'R')
            red++;
        if(s[i] == 'G')
            green++;
        if(s[i] == 'B')
            blue++;
    }
    result = red * green * blue;
    for(int i = 1;  i <=N/2; i++)
    {
        for(int j = 0; 2 * i + j < N; j++)
        {
            if(s[j] != s[i + j] && s[j] != s[2 * i + j] && s[i + j] != s[2 * i + j])
            {
                result--;
            }

        }
    }
    printf("%lld", result);
    return 0;
}



Measured memory_bytes: 3796
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <stack>
#include <queue>

using namespace std;
#define Fill(a, b) memset(a, b, sizeof(a))
#define Debug(x) cout << #x << "=" << (x) << endl;
typedef long long LL;
const LL inf = 1LL << 61;
const LL mod = 1000000007;
#define DEBUG
#ifdef DEBUG
#endif

int main()
{
    std::ios::sync_with_stdio(false);
    string str;
    cin >> str;
    if(str.size()>=4)
    {
    	if(str.substr(0,4)=="YAKI")
    	{
    		puts("Yes");
    		return 0;
    	}
    }
    puts("No");






















    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>
#include <fstream>
#include <functional>
#define endl '\n'
#define ll long long
#define mod 1000000007
#define NCONS 200001
//#define NCONS 100001
//#define NCONS 1001
//#define NCONS 101
#define MCONS 2001
#define LIMIT 1000000000
#define TRUE 1
#define FALSE 0
#define toRadian(degree) ((degree) * (M_PI / 180.))
#define toDegree(radian) ((radian) * (180. / M_PI))
using namespace std;
struct Point{int x; int y;};
struct PPoint{Point x; Point y;};
ll gcd(ll a, ll b) { if(a < b) swap(a, b); if(b <= 0) return a; return gcd(b, a % b); }


int main(void)
{
    cin.tie(NULL); ios_base::sync_with_stdio(false);
    int X, A; cin >> X >> A;
    if(X < A)
        cout << 0;
    else
        cout << 10;
  
    return 0;
}








Measured memory_bytes: 892
if __name__ == '__main__':
    N = input()
    if int(N[-1]) in [2, 4, 5, 7, 9]:
        print("hon")
    elif int(N[-1]) in [0, 1, 6, 8]:
        print("pon")
    elif int(N[-1]) == 3:
        print("bon")

Measured memory_bytes: 9176
#include <iostream>
#include<iomanip>
#include <cmath>
#include <climits>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <queue>
#include <tuple>
#include <map>
#include <list>
#include <string>
#include <numeric>
#include <utility>
#include <cfloat>

using namespace std;

int main(){
    long long A;
    long long B;
    cin >> A >> B;

    long long ans;
    if(A == B){
        cout << A << endl;
        return 0;
    }
    if(A % 2 == 0 && B % 2 == 1){
        if((B - A + 1) / 2 % 2 == 0){
            ans = 0;
        } else {
            ans = 1;
        }
    } else if(A % 2 == 0 && B % 2 == 0){
        if((B - A) / 2 % 2 == 0){
            ans = B;
        } else {
            ans = (B ^ 1);
        }
    } else if(A % 2 == 1 && B % 2 == 1){
        if((B - A) / 2 % 2 == 1){
            ans = A ^ 1;
        } else {
            ans = A;
        }
        
    } else {
        ans = A ^ B;
        if((B - A - 1) / 2 % 2 == 1){
            ans ^= 1;
        } 
    }

    cout << ans << endl;

    return 0;
}

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

int main() {

    int a, b, c;

    scanf("%d %d %d", &a, &b, &c);

    int ischeck = 0;
    if (a == b + c) {
        ischeck = 1;
    }
    if (b == a + c) {
        ischeck = 1;
    }
    if (c == b + a) {
        ischeck = 1;
    }

    printf("%s",(ischeck==1 ? "Yes":"No"));
    return 0;

}


Measured memory_bytes: 128
#include <bits/stdc++.h>
inline int read(){char c = getchar();int x = 0,s = 1;
while(c < '0' || c > '9') {if(c == '-') s = -1;c = getchar();}
while(c >= '0' && c <= '9') {x = x*10 + c -'0';c = getchar();}
return x*s;}
using namespace std;
#define NewNode (TreeNode *)malloc(sizeof(TreeNode))
#define Mem(a,b) memset(a,b,sizeof(a))
#define lowbit(x) (x)&(-x)
const int N = 2e5 + 5;
const long long INFINF = 0x7f7f7f7f7f7f7f;
const int INF = 0x3f3f3f3f;
const double EPS = 1e-7;
const int mod = 1e9+7;
const double II = acos(-1);
const double PP = (II*1.0)/(180.00);
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> piil;
int n,m,arr[N],Max,ans[N];
int Find(int x)
{
    if(x == arr[x]) return x;
    return arr[x] = Find(arr[x]);
}
signed main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    //    freopen("input.txt","r",stdin);
    //    freopen("output.txt","w",stdout);
    cin >> n >> m;
    for(int i = 1;i <= n;i++) arr[i] = i;
    while(m--)
    {
        int a,b;
        cin >> a >> b;
        if(a > b) swap(a,b);
        if(Find(a) != Find(b))
            arr[Find(a)] = arr[Find(b)];
    }
    for(int i = 1;i <= n;i++)
    {
        int x = Find(arr[i]);
        ans[x]++;
        Max = max(Max,ans[x]);
    }
    cout << Max << endl;
}


Measured memory_bytes: 10552
#include <bits/stdc++.h>  // include all standard C++ libraries

using namespace std;

// Loops
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define _rrep(i,n) rrepi(i,n,0)
#define rrepi(i,a,b) for(int i=int(a)-1;i>=int(b);--i)

#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(xi, x) for (auto&& xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)


// typedef
using ll = long long;
template <class T> using vec = vector<T>;
using vi   = vector<int>;
using vvi  = vector<vi>;
using vvvi = vector<vvi>;
using pii  = pair<int, int>;


// Constants
#define INF 1e9

// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase( unique(all(v)), v.end() )
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define MIN(x,y) ((x)>(y))?(y):(x)
#define MAX(x,y) ((x)<(y))?(y):(x)

template<class T> inline bool chmax(T &maxval, const T &newval) { if (maxval<newval) { maxval=newval; return 1; } return 0; }
template<class T> inline bool chmin(T &minval, const T &newval) { if (minval<newval) { minval=newval; return 1; } return 0; }

// Utilities
// Grid world utilities
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
#define inside(H,W,y,x) 0<=(x) && (x)<(W) && 0<=(y) && (y)<(H)

inline int in() {int x; cin >> x; return x;} // read int from cin
inline  ll IN() {ll x; cin >> x; return x;}  // read ll from cin


// Shorter repr for frequently used terms
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second

// Debug
#ifdef LOCAL
  #include "dump.hpp"
  #define debug(x) cerr << #x << ": " << x << '\n'
#else
  #define dump(...)
  #define debug(x)
#endif

// Paste snippets here!!

// 

int main(){
  cin.tie(0); ios::sync_with_stdio(false);    // Magic for faster cin

  int A=in(); int B=in(); int K=in();
  //dump(A,B,K);

  int R=MIN(A,B);

  int k=0;
  rrep(i,R+1,1){
    if(A%i==0 && B%i==0 && ++k==K){
      cout << i << endl; break;
    }
  }
  //dump(k);

  return 0;
}


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

int main(){
    int n,k; cin >> n >> k ;
    vector<int> h(n,0);
    rep(i,n) cin >> h.at(i);
    vector<int> dp(n,0);
    for(int i=1;i<n;i++){
        int x = INF;
        for(int j=max(i-k,0);j<i;j++){
            x = min(x,dp.at(j) + abs(h.at(j) - h.at(i)));
        }
        dp.at(i) = x;
    }
    cout << dp.at(n-1) << endl;
    //rep(i,n) cout << i << " " << dp.at(i) << endl;
}

Measured memory_bytes: 1024
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("Ofast")
//*********************************************DO IT NOW****************************************************************
#include<bits/stdc++.h> 
#include<random>
#define int long long   
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define pi 3.14159265359
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "YES"<<endl
#define no  cout<< "NO"<<endl
#define all(v) (v).begin(),(v).end()
#define s(v)   sort(v,v+n)
#define  mt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define read(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define print(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" "
using namespace std;
//**********************************************DO IT NOW***************************************************************
void fastio()
{  
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
int dp[101][1001],ans1=1e9,dp1[1000001];
int num[10];
int a[1000000];
int prime(int n)
{
 for(int i=2;i*i<=n;i++)
      {
          if(n%i==0)
          return 0;
      }
      return 1;
}
signed main()
{   
    fastio();
    int t=1;
   // cin>>t;
    while(t--)
    {  
       int a,b,c;
       cin>>a>>b>>c;
       int x=0;
       if(a==c && c!=b)
       x++;
       if(a==b && b!=c)
       x++;
       if(b==c && c!=a)
       x++;
       if(x)
       cout<<"Yes";
       else
       cout<<"No";
    }
    
}
// 🍪 🍪 🍪


Measured memory_bytes: 3608
/*
    Created by Tejas Chaudhari
*/

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef double lf;
typedef bool bl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<lf> vd;
typedef vector<bl> vb;
typedef string st;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;

#define INF (LONG_LONG_MAX / 4)
#define SORT(x) sort(x.begin(), x.end())
#define Mod % 1000000007
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define f first
#define s second
#define pb push_back

void re_curse() {
    ll a, b;
    cin>>a>>b;
    vb arr(10000000, true);
    for (ll i = 2; i < 10000000; ++i) {
        for (ll j = i*i; j < 10000000; j += i) {
            arr[j] = false;
        }
    }
    vl primes;
    for (int i = 2; i < 10000000; ++i) {
        if (arr[i]) {
            primes.pb(i);
        }
    }
    ll ans = 0;
    for (auto i : primes) {
        if (!(a % i) && !(b % i)) {
            ++ans;
        }
        while (!(a % i)) {
            a = a/i;
        }
        while (!(b % i)) {
            b= b/i;
        }
        if (a == 1 || b == 1) {
            break;
        }
    }
    if (a == b && a != 1) {
        ++ans;
    }
    ++ans;
    cout<<ans<<endl;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    // cin>>t;
    for (int i = 1; i <= t; ++i) {
        re_curse();
    }
    return 0;
}


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

#define int long long

signed main() {
    string s;
    cin >> s;
    if(s=="abc"||s=="acb"||s=="bac"||s=="bca"||s=="cab"||s=="cba")
        cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>                                                        
                                                                          
int main(void) {                                                          
  int a,b,c;                                                              
  int counter = 0;                                                        
                                                                          
  scanf("%d %d %d",&a,&b,&c);                                             
                                                                          
  for( ;a <= b;a++) {                                                     
    if (c % a == 0) {                                                     
      counter++;                                                          
    }                                                                     
  }                                                                       
                                                                          
  printf("%d\n",counter);                                                   
                                                                          
  return 0;                                                               
}

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

using namespace std;

namespace IntegerMath
{
  int64_t floor_div(int64_t x, int64_t y) {
    return static_cast<int64_t>(
      ::floorl(
        static_cast<long double>(x)
        /
        static_cast<long double>(y)
      )
    );
  }

  int64_t ceil_div(int64_t x, int64_t y) {
    return static_cast<int64_t>(
      ::ceill(
        static_cast<long double>(x)
        /
        static_cast<long double>(y)
      )
    );
  }

  int64_t sqrt(int64_t x) {
    return static_cast<int64_t>(
      ::floorl( ::sqrtl( 
        static_cast<long double>(x)
      ) )
    );
  }

  int64_t log2(int64_t x) {
    return static_cast<int64_t>(
      ::floorl( ::log2l( 
        static_cast<long double>(x)
      ) )
    );
  }    

  int64_t log10(int64_t x) {
    return static_cast<int64_t>(
      ::floorl( ::log10l( 
        static_cast<long double>(x)
      ) )
    );
  }

  int64_t number_of_digits(int64_t x) {
    return static_cast<int64_t>(
      ::ceill( ::log10l( 
        static_cast<long double>(x + 1)
      ) )
    );
  }

  uint64_t gcd(uint64_t a, uint64_t b)
  {
    uint64_t n = std::min(a, b), m = std::max(a, b);
    return (n == 0) ? m : gcd(m % n, n);
  }

  uint64_t lcm(uint64_t a, uint64_t b)
  {
    uint64_t d = gcd(a, b);
    return (a % d == 0) ? (a / d) * b : a * (b / d);
  }
};

vector<bool> build_prime_table(uint64_t N) {
  vector<bool> primes(N + 1, true);
  if (N >= 1) { primes[0] = false; }
  if (N >= 2) { primes[1] = false; }
  for (uint64_t i = 4; i <= N; i += 2) { primes[i] = false; }
  for (uint64_t i = 3; i <= N; i += 2) {
    if (!primes[i]) { continue; }
    for (uint64_t j = i * 2; j <= N; j += i) {
      primes[j] = false;
    }
  }
  return primes;
}

int main()
{
  uint64_t A, B;
  cin >> A >> B;
  
  uint64_t G = IntegerMath::gcd(A, B);
  
  uint64_t M = IntegerMath::sqrt(G) + 1;
  vector<bool> primes = build_prime_table(M);
  
  uint64_t P = G;
  uint64_t c = 1;
  for (uint64_t d = 2; d <= M; ++d) {
    if (primes[d] && (G % d == 0)) {
      while (P % d == 0) { P /= d; }
      ++c;
    }
  }
  if (P > 1) { ++c; }
  cout << c << endl;
  
  return 0;
}

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

int main() {
	int a,b;
	cin>>a;
	cin>>b;
	if(a==b)
	{
	    for(int i=0;i< a;i++)
	    cout<<a;
	}
	if(a<b)
	{
	    for(int i=0;i<b;i++)
	    cout<<a;
	}
	if(b<a)
	{
	    for(int i=0;i<a;i++)
	    cout<<b;
	}
	
	
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String code = sc.next();
		int n = sc.nextInt(),count = 0;
		
		for(int i = 0; i < n; i++){
			String ring = sc.next();
			ring += ring.substring(0, code.length() - 1);
			if(ring.matches(".*" + code + ".*"))count++;
		}
		System.out.println(count);
		
		sc.close();
	}
}

Measured memory_bytes: 17304
s=input()
n=int(input())
for i in range(n):
    l=list(input().split())
    if l[0]=="print":
        print(s[int(l[1]):int(l[2])+1])
    elif l[0]=="reverse":
        s=s[:int(l[1])]+s[int(l[1]):int(l[2])+1][::-1]+s[int(l[2])+1:]
    elif l[0]=="replace":
        s=s[:int(l[1])]+l[3]+s[int(l[2])+1:]


Measured memory_bytes: 5620
#include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
#define PMOD 998244353
#define pb(x) push_back(x)
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9+10;
const ll LINF = 1LL*INF*INF;
const int MAXN = 2e5+10;
const int MAXM = 5e3+10;

priority_queue<int> pq;
vector<vector<int> > graph;
queue<int> que;

int A[MAXN];
char S[MAXN];

int main()
{
    ll n,m,k,a,b,c,x,y,q;
    int sum = 0;
    int cnt = 0;
    int mx = 0;
    ll mn = INF;
    int cur = 0, idx = -1;
    int tc;

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>a>>b>>c;

    if((a&1)&((b&1)&(c&1))){
        mn = min(a*b,min(b*c,c*a));
        cout<<mn<<"\n";
    }
    else cout<<"0\n";


    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

void solve() {
    int N;
    cin >> N;
    VI L(N);
    REP(i, N) cin >> L[i];
    SORT(L);

    int ans = 0;
    REP(i, N) {
        FOR(j, i + 1, N) {
            FOR(k, j + 1, N) {
                if (L[i] == L[j] || L[j] == L[k] || L[k] == L[i]) continue;
                if (L[i] + L[j] <= L[k]) continue;
                ans++;
            }
        }
    }

    cout << ans << endl;
}

int main(void) {
#ifndef ONLINE_JUDGE
    const auto in_stream = freopen("../in.txt", "r", stdin);
    if (in_stream == nullptr) {
        cerr << "ERROR!" << endl;
        return 1;
    }
#endif

    solve();

#ifndef ONLINE_JUDGE
    fclose(in_stream);
#endif
}


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

// Type alias
using ll=long long;
using ld=double;

using pi=pair<int,int>;
using pll=pair<ll,ll>;
using pld=pair<ld,ld>;
using ti3=tuple<int, int, int>;

using vi=vector<int>;
using vll=vector<ll>;
using vld=vector<ld>;
using vpi=vector<pi>;
using vpll=vector<ll>;
using vpld=vector<ld>;
using vti3=vector<ti3>;

// Constants
const double EPS = 1e-9;
const int inf = numeric_limits<int>::max();

// Macro
#define rep(i,n) for(int i=0;i<int(n);++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;--i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define RREP(i,a,b) for(int i=int(b-1);i>=int(a);--i)
#define SHOW(a) cout << #a << " = " << a << endl
#define ARR(a,n) for(int i=0;i<int(n);++i) cout << #a << "[" << i << "]" << " = " << a[i] << endl

#define ALL(a) a.begin(),a.end()

// Funtcions
ll pow(ll base, ll i, ll mod){
  ll a = 1;
  while(i){
    if (i & 1) {
      a *= base;
      a %= mod;
    }
    base *= base;
    base %= mod;
    i >>= 1;
  }
  return a;
}
ll gcd(ll a, ll b){
  while(b){
    ll c = a % b;
    a = b;
    b = c;
  }
  return a;
}
ll lcm(ll a, ll b){
  return a / gcd(a, b) * b;
}


void solve(){
  priority_queue<int> q;
  int n, m;
  cin >> n >> m;
  rep(i, n){
    int t;
    cin >> t;
    q.push(t);
  }

  rep(i, m){
    int t = q.top(); q.pop();
    q.push(t / 2);
  }

  ll res = 0;
  while(!q.empty()){
    res += q.top(); q.pop();
  }

  cout << res << endl;
}

int main(){
// FastIO
//ios_base::sync_with_stdio(false);
cin.tie(NULL);
  solve();
  return 0;
}

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

int main(){
    string s;
    cin>>s;
    int red=0,blue=0;
    for(int i=0;i<s.size();i++){
        if(s[i]=='0') red++;
        else blue++;
    }
    cout<<min(red,blue)*2;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <cmath>
#include <climits>
#include <cstring>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <algorithm>
#include <numeric>

typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Grid
ll sx, sy;
ll gx, gy;
ll dx[4] = {-1, +1, +0, +0};
ll dy[4] = {+0, +0, -1, +1};

void print(){ std::cout << std::endl; }
template <typename Head> void print(Head&& head) { std::cout << head << std::endl; }
template <typename Head, typename... Tail> void print(Head&& head, Tail&&... tail)
{
  std::cout << head << " ";
  print(std::forward<Tail>(tail)...); // or print(tail...);
}
template <typename Iterator> void printVec(Iterator begin, Iterator end)
{
  for (Iterator it = begin; it != end; it++) {
    std::cout << "[" << std::distance(begin, it) << "] " << *it << " ";
    if (std::distance(begin, it) % 20 == 19) { std::cout << std::endl; }
  }
  std::cout << std::endl;
}

int ceil(int a, int b) {
    return (a + b - 1) / b;
}

int round(int a, int b) {
    return (a + b / 2) / b;
}

template <class T> bool amax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}


// Greatest Common Divisor
ll gcd(ll a, ll b)
{
  while (b != 0) {
    a = a % b;
    std::swap(a, b);
  }
  return a;
}

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

template<typename T> T lminimum(const std::vector< T >& v) {return *std::min_element(v.begin(), v.end());}
template<typename T> T lmaximum(const std::vector< T >& v) {return *std::max_element(v.begin(), v.end());}
template<typename T> void lunique(std::vector< T >& v) {v.erase(std::unique(v.begin(), v.end()), v.end());}
template<typename T> void lsort(std::vector< T >& v) {std::sort(v.begin(), v.end());}
template<typename T> void lgreatersort(std::vector< T >& v) {std::sort(v.begin(), v.end(), std::greater<>());}
template<typename T> bool lnext_permutation(std::vector< T >& v) {return std::next_permutation(v.begin(), v.end());}

int main(int argc, char* argv[])
{
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  ll sx, sy, gx, gy;
  std::cin >> sx >> sy >> gx >> gy;

  std::string a, b, c, d;
  for (ll y = sy+1; y <= gy; y++) {
    a += 'U';
  }
  for (ll x = sx+1; x <= gx; x++) {
    a += 'R';
  }

  for (ll y = gy-1; y >= sy; y--) {
    b += 'D';
  }
  for (ll x = gx-1; x >= sx; x--) {
    b += 'L';
  }

  c += 'L';
  for (ll y = sy+1; y <= gy+1; y++) {
    c += 'U';
  }
  for (ll x = sx+0; x <= gx; x++) {
    c += 'R';
  }
  c += 'D';

  d += 'R';
  for (ll y = gy-1; y >= sy-1; y--) {
    d += 'D';
  }
  for (ll x = gx+0; x >= sx; x--) {
    d += 'L';
  }
  d += 'U';

  print(a+b+c+d);
  return 0;
}




Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
bool solve()
{
    int n;
    string str;
    cin >> n >> str;
    if (n != str.size())
        cout<<str.size()<<endl;
    if (n & 1)
        return 0;
    for (int i = 0, j = n / 2; j < n; i++, j++)
    {
        if (str[i] != str[j])
            return 0;
    }
    return 1;
}
int main()
{
    // freopen("input_1.txt", "r", stdin);
    // freopen("output_1.txt", "w", stdout);
    // int test;
    // cin >> test;
    // for (int t = 1; t <= test; t++)
        puts(solve() ? "Yes" : "No");
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>
#include <iomanip>
#define REP(i, n) for(int i = 0; (i) < (n); (i)++)
#define MOD 1000000007
using namespace std;
 
int main(){
  int N;
  cin >> N;
  int v[N];
  REP(i,N){
    cin >> v[i];
  }
  sort(v,v+N);
  long double ans = 0;
  for (int i = 0; i < N-1; i++){
    ans += (long double) v[N-1-i] * pow(0.5,i+1);
  }
  ans += (long double) v[0] * pow(0.5,N-1);
  cout << ans << endl;
}
  

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

int main(){
  
  int N;
  
  cin>>N;
  
  for(int i=1;i<=9;i++){
    for(int j=1;j<=9;j++){
      if(i*j==N){
      	cout<<"Yes"<<endl;
        return 0;
      }
    }
  }
  
  cout<<"No"<<endl;
  
 return 0; 
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif

#define FILE_IO freopen("input.txt","r",stdin)
#define int long long
#define f first
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
#define bp __builtin_popcount
#define debug(x) cerr << #x << " = " << x << endl;

const int MOD = 1e9 + 7;
const int INF = 1e18;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>void print(T t){for(auto &it : t)cout<<it<<" ";}
inline int powerexp(int a, int b, int m = MOD){ int res = 1;while(b){if(b&1)res = res * a % m;a = a * a % m,b >>= 1;}return res % m;}
inline int modinv(int a){ return powerexp(a,MOD-2,MOD);}
inline int lcm(int a, int b){ int g = __gcd(a,b);return a/g*b;}
inline int add(int x, int y){ x += y; if (x >= MOD) x -=  MOD; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % MOD;}
inline int sub(int x, int y){ x -= y; if (x<0) x += MOD; return x ;}

//-------------------< start here >-------------------------// 

void solve(){
   map<int, int> m;
   int n, k;
   cin >> n >> k;
   for(int i = 0; i < n; i++){
	   int a, b;
	   cin >> a >> b;
	   m[a] += b;   
	}
  int idx = 0;
  for(auto it : m){
	  idx += it.s;
	  if (idx >= k) {cout << it.f << endl; break;}
	}
}

//-----------------------------
//comment from here for TOPCODER 
int32_t main(){
   IOS;
   solve();
   //find();
   #ifdef LOCAL_DEFINE
   cerr << "time elapsed " << (double)clock()/CLOCKS_PER_SEC << endl;
   #endif
}


Measured memory_bytes: 4224
import java.util.*;

public class Main {

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

        int N = sc.nextInt();
        int K = sc.nextInt();
        String S = sc.next();

        String newS = "";
        for (int n = 0; n < N; n += 1) {
            if (n == K - 1) {
                newS += S.substring(n, n + 1).toLowerCase();
            } else {
                newS += S.substring(n, n + 1);
            }
        }

        System.out.println(newS);
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define rrep(i,n) for(int (i)=1;i<=(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 1000000007
#define INF 1e18
#define int long long
#define endl "\n"
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



signed main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	
	int a[6], sum = 0;
	rep(i, 6) cin >> a[i], sum += a[i];
	cout << sum - min({a[0], a[1], a[2], a[3]}) - min(a[4], a[5]) << endl;
	return 0;
}


Measured memory_bytes: 3216
N,M,C = map(int, input().split())

lst1 = list(map(int, input().split()))

ans = 0
for i in range(N):
  lst2 = list(map(int, input().split()))
  sum = 0
  for j in range(M):
    sum += lst1[j] * lst2[j]
  if (sum + C > 0):
    ans += 1
print(ans)
    
    


Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;
typedef pair<int,int> P;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

int main()
{
	int n;
	cin>>n;
	vector<int>w(n);
	for(int i = 0; i < n; i++){
		cin>>w[i];
	}
	vector<int> sum(n+1,0);
	for(int i = 0; i < n; i++){
		sum[i+1] = sum[i]+w[i];
	}
	int ans = 100000;
	for(int i = 1; i <= n; i++){
		ans = min(ans,abs(sum[i]-(sum[n]-sum[i])));
	}
	cout<<ans<<endl;

	return 0;
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

typedef long long ll;
typedef long double R;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int main() {
  int n, a, b; cin >> n >> a >> b;
  cout << min(a, b) << " " << max((a+b)-n, 0) << endl;

  return 0;
}

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

namespace c
{
    class Program
    {
        static void Main(string[] args)
        {
            var total = IOUtils.ReadInt();
            var joshis = IOUtils.ReadInts();

            var countDic = joshis.GroupBy(j => j).ToDictionary(g => g.Key, g => g.Count());

            for (int i = 1; i <= total; i++)
            {
                Console.WriteLine(countDic.TryGetValue(i, out int c) ? c : 0);
            }

        }
    }

    static class IOUtils
    {
        public static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }
        public static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }
        public static ulong ReadUlong()
        {
            return ulong.Parse(Console.ReadLine());
        }
        public static int[] ReadInts()
        {
            return Console.ReadLine().Split(' ').Select(v => int.Parse(v)).ToArray();
        }
        public static long[] ReadLongs()
        {
            return Console.ReadLine().Split(' ').Select(v => long.Parse(v)).ToArray();
        }

        public static void WriteNums(params int[] nums)
        {
            Console.WriteLine(string.Join(" ", nums));
        }
    }
}


Measured memory_bytes: 65576
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = iss()
    print('ABC'+S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <queue>
using namespace  std;

const int nIMPOS = -1;
struct StDist
{
  int m_nDist;
  int m_nDmy;

  StDist(int nDist) : m_nDist(nDist), m_nDmy(0)
  { }
};

void fnInput(vector<vector<int>>& rvvnAdjcy, vector<StDist>& rvoDist)
{
  int nxSiz;
  cin >> nxSiz;

  rvvnAdjcy.resize(nxSiz + 1, vector<int>(nxSiz + 1, 0));
  for (int i = 0; i < nxSiz; ++i)
  {
    int nx, nySiz;
    cin >> nx >> nySiz;
    for (int j = 0; j < nySiz; ++j)
    {
      int ny;
      cin >> ny;
      rvvnAdjcy[nx][ny] = 1;
    }
  }
  StDist oDist(nIMPOS);
  rvoDist.resize(nxSiz + 1, oDist);
}

void fnBreadthFirstSearch(const vector<vector<int>>& cnrvvnAdjcy, 
                          queue<int>& rqnBFSrch, vector<StDist>& rvoDist)
{
  while (rqnBFSrch.size())
  {
    int nx = rqnBFSrch.front(); rqnBFSrch.pop();
    for (int ny = 1; ny < cnrvvnAdjcy[nx].size(); ++ny)
    {
      if (!cnrvvnAdjcy[nx][ny])          continue;
      if (rvoDist[ny].m_nDist != nIMPOS) continue; 

      rvoDist[ny].m_nDist = rvoDist[nx].m_nDist + 1;
      rqnBFSrch.push(ny);
    }
  }
}

void fnResult(const vector<StDist>& cnrvoDist)
{
  for (int i = 1; i < cnrvoDist.size(); ++i)
    cout << i <<  " " << cnrvoDist[i].m_nDist << endl;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<vector<int>> vvnAdjcy;
  queue<int> qnBFSrch;
  vector<StDist> voDist;

  fnInput(vvnAdjcy, voDist);

  voDist[1].m_nDist = 0;
  qnBFSrch.push(1);
  fnBreadthFirstSearch(vvnAdjcy, qnBFSrch, voDist);
  fnResult(voDist);

  return 0;
}

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

int main()
{
    int H, W;
    char mas[55][55];
    int cnt[55][55] = {};
    int mx[8] = {1, 1, 1, 0, -1, -1, -1, 0};
    int my[8] = {1, 0, -1, -1, -1, 0, 1, 1};
    cin >> H >> W;
    for(int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            cin >> mas[i][j];
            if(mas[i][j] == '#') {
                for(int k = 0; k < 8; k++) {
                    int ny = i + my[k], nx = j + mx[k];
                    if(ny < 0 || nx < 0 || ny >= H || nx >= W) continue;
                    cnt[ny][nx]++;
                }
            }
        }
    }

    for(int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            if(mas[i][j] == '#') cout << "#";
            else cout << cnt[i][j];
        }
        cout << endl;
    }

    return (0);
}

            

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define eb emplace_back
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 233;
int main()
{
 	ios::sync_with_stdio(false);
	ll a,b,c,k;cin>>a>>b>>c>>k;
	ll ans = 0;
	ans += min(a,k); k -= min(a,k);
	k -= min(b,k);
	ans -= min(c,k); k -= min(c,k);
	cout << ans << endl; 
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
#define rep(i,a,b) for(int i=a;i<(b);++i)
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
typedef long long ll;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

int N,K;
vector<ll> V;

ll check(int l, int r){
    vector<int> tmp;
    for(int i = 0; i <= l; ++i) tmp.push_back(V[i]);
    for(int i = r; i < N; ++i) tmp.push_back(V[i]);
    sort(tmp.begin(),tmp.end());
    int can = K - (l+1 + N-r); // Dequeに戻せる数
    if(can < 0) return 0; // 不適
    ll res = 0;
    REP(i,tmp.size()){
        if(tmp[i] < 0 && can > 0) --can;
        else res += tmp[i];
    }
    return res;
}

int main() {
    cin >> N >> K;
    V.resize(N);
    REP(i,N) cin >> V[i];
    // 右端　左端　全探索　得点最大化
    ll ans = 0;
    for(int l = -1; l < N; ++l){
        for(int r = l+1; r <=N; ++r){
            chmax(ans,check(l,r));
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
n, *a = map(int, open(0).read().split())
stack = []
isOK = 0
for i in range(n):
    if a[i]>0:
        if a[i] in stack: break
        stack.append(a[i])
    else:
        if not stack: break
        if -a[i] != stack.pop(): break
else: isOK = 1
print("OK" if isOK else i+1)


Measured memory_bytes: 5616
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define rep(n, i) Rep(0, n-1, i)
//unique
/*
sort(v.begin(), v.end());
v.erase(unique(v.begin(), v.end()), v.end());
*/
const int MAX  = 200000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const int MOD = 1000000007;

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> P;
typedef std::priority_queue<int> IntPrioQueue; //Z->A
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue; //A->Z

void solve(void){
    ll K;
    cin >> K;
    ll Limit[K];
    rep(K, i) scanf("%lld ", &Limit[i]);
    reverse(Limit, Limit+K);
    ll low = 2, high = 2;
    bool flag = true;
    if (Limit[0] != 2) flag = false;
    rep(K, i) {
        //cout << low << ' ' << high << '\n';
        ll l = Limit[i];
        if (high < l) flag = false;
        low = (low <= l)?l:((low-1)/l+1)*l;
        high = (high / l + 1) * l - 1;
    }
    if (flag and low <= high) cout << low << ' ' << high << '\n';
    else cout << -1 << endl;
}

int main(void){
  solve();
  return 0;
}


Measured memory_bytes: 1024