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

#define Sort(ob,n) sort(ob,ob+n)
#define SorT(ob) sort(ob.begin(),ob.end())
#define rev(ob) reverse(ob.begin(),ob.end())
#define pb push_back
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define ll long long
#define fi(start,End,I) for(int i=start; i<=End; i+=I)
#define PII pair<ll,ll>
//#define fr first
//#define se second


int main()
{
    fast;
    ll n,a,b;
    vector <PII> v;
   // cin >> a >> b;
   cin >> n;
    fi(0,n-1,1){
        cin >> a >> b;
        v.pb({b,a});
    }

    SorT(v);
    ll sum=0;

    fi(0,n-1,1){
        sum+=v[i].second;
        if(v[i].first<sum){
            cout << "No\n";
            return 0;
        }
    }

    cout << "Yes\n";








    return 0;
}


Measured memory_bytes: 6512
import sys
import numpy as np


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    A = np.array(list(map(int, input().split())))
    count = np.bincount(A)
    # print(count)
    total = (count * (count - 1)).sum() // 2
    answer = (total - (count - 1))[A]
    print("\n".join(answer.astype(str)))


main()


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


int main() {
  int K, N;
  cin >> K >> N;
  vector<int> vec(N);
  for(int i = 0; i < N; i++){
    cin >> vec.at(i);
  }
  
  set<int> S;
  for(int i = 0; i < N - 1; i++){
    S.insert(vec.at(i+1) - vec.at(i));
  }
  int b;
  b = vec.at(0) + K - vec.at(N-1);
  
  S.insert(b);
  
             
  int a;
  a = *rbegin(S);
        
   cout << K - a;

  return 0;
}

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

string S, ans = "";

signed main()
{
	cin >> S;
	rep(i,S.length())
	{
		if (S[i] == '0')
		{
			ans += '0';
		} else if (S[i] == '1') {
			ans += '1';
		} else {
			if (ans.length() > 0)
			{
				ans = ans.substr(0, ans.length() - 1);
			}
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define all(a) (a).begin(),(a).end()
typedef long long ll;
#define rep1(i,n) for(int i=1;i<=int(n);++i)
#define lb(s,x) (lower_bound(all(s),x)-s.begin())
#define ub(s,x) (upper_bound(all(s),x)-s.begin())
#define uniq(a) a.erase(unique(all(a)),a.end())
#define bit(k) (1LL<<(k))
#define INF int(1e9)

template<class T,class U> ostream& operator<<(ostream& ost, const pair<T,U> &p) { ost << "(" << p.first << ", " << p.second << ")"; return ost; }
#define ostream_container { ost << "{"; for(const auto &t : v) { if (&t != &*v.begin()) ost << ", "; ost << t; } ost << "}"; return ost; }
template<class T> ostream& operator<<(ostream &ost, const vector<T> &v) ostream_container
template<class T> ostream& operator<<(ostream &ost, const set<T> &v) ostream_container
template<class T,class U> ostream& operator<<(ostream &ost, const map<T,U> &v) ostream_container

template<class H> void recursive_debug(string s, H h) {
    cerr << "\033[33m" << s << " = " << h << endl << "\033[m";
}
template<class H,class... T> void recursive_debug(string s, H h, T... t) {
    int comma = s.find(',');
    cerr << "\033[33m" << s.substr(0,comma) << " = " << h << ", ";
    recursive_debug(s.substr(comma+1), t...);
}
#define debug(...) recursive_debug(#__VA_ARGS__, __VA_ARGS__)


int main(void) {
    int n;
    cin >> n;
    int cnt = 0;
    rep(i,n) {
        int a;
        cin >> a;
        if ((i%2==0) && (a%2==1)) cnt++;
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 3548
#include <bits/stdc++.h> 
using namespace std;
#define pb push_back
#define ll long long int
#define vi vector<int>
#define ii pair<int,int>
#define vli vector<ll>
#define graph vector<vector< int > >
#define vpi vector<pair<int ,int> >
#define vpli vector<pair<ll ,ll> >
#define mp make_pair
#define F first
#define S second
#define mod 163577857
#define INF (ll)1e10
#define wh(a) cout<<#a<<"  is  "<<a<<endl;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define INI(a) memset(a,0,sizeof(a))
#define LIMIT 8008

void solve(){
    ll n,k;
    cin>>n>>k;
    ll a[n+1];
    for(int i=1;i<=n;++i) cin>>a[i];
    ll num=0;
    ll mark[n+1];
    ll dis[n+1];
    INI(mark);
    vi path;
    ll nex=1;
    dis[0]=-1;dis[1]=0;
    ll prev=0;
    while(mark[nex]==0){
        mark[nex]=1;
        dis[nex]=dis[prev]+1;
        path.pb(nex);
        prev=nex;
        nex=a[nex];
    }
    ll offset=dis[nex];
    num=dis[prev]-dis[nex]+1;
    // wh(k);
    // wh(offset);
    // wh(num);
    // wh(k%num);
    if(k<offset){
        cout<<path[k];
    }
    else{
        k=k-offset;
        // wh(k);
        // wh(k%num);
        cout<<path[offset+k%num];
    }
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    #endif
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 8972
from collections import defaultdict

N = int(input())
d = defaultdict(list)
cd = set()
D = 100000
used = [0]*(2*D+1)
ans = 0

for _ in range(N):
    x, y = map(int, input().split())
    y += D
    cd.add(x)
    d[x].append(y)
    d[y].append(x)

for x in cd:
    if used[x]:continue
    q = [x]
    used[x] = 1
    cx, sx = 0, 0

    while q:
        a = q.pop()
        if a<=D:
            cx += 1
        sx += 1
        for b in d[a]:
            if used[b]:continue
            used[b] = 1
            q.append(b)
    ans += cx*(sx-cx)

print(ans-N)


Measured memory_bytes: 75096
using System;
using System.Collections.Generic;

namespace ConsoleApp1
{
	class Program
	{
		static void Main(string[] a_asArgs)
		{
			string s = Console.ReadLine();
			int K = int.Parse(Console.ReadLine());

			SortedList<string, int> l_List = new SortedList<string, int>();

			for (int l_iStart = 0; l_iStart < s.Length; l_iStart++)
			{
				for (int l_iLen = 1; l_iLen < s.Length - l_iStart + 1; l_iLen++)
				{
					string substring = s.Substring(l_iStart, l_iLen);
					if (l_List.ContainsKey(substring))
					{
						continue;
					}
					if (l_List.Count >= K && string.Compare(substring, l_List.Keys[K - 1]) > 0)
					{
						goto Do_Continue;
					}
					l_List.Add(substring, 0);
				}
				Do_Continue: ;
			}
			Console.WriteLine(l_List.Keys[K - 1]);
		}
	}
}


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

using namespace std;

typedef long double ld;
typedef long long ll;

#define sz(x) (int)(x).size()
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define f first
#define s second

template<typename T, typename U> bool ckmin(T &a, U b){ return b < a ? a = b, true : false; }
template<typename T, typename U> bool ckmax(T &a, U b){ return b > a ? a = b, true : false; }

int n;
vector<pair<int, int>> v;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n; v.assign(n, {0, 0});
    for(int i = 0; i < n; ++i){
        cin >> v[i].f >> v[i].s;
    }
    for(int i = 2; i < sz(v); ++i){
        if(v[i].f == v[i].s && v[i - 1].f == v[i - 1].s && v[i - 2].f == v[i - 2].s){
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";
    return 0;
}

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

int n,k,h,w;
string s,t;

int main() {
  cin >> h >> w;
  char l;int r;
  rep(i,h)rep(j,w){
    cin >> s;
    if(s=="snuke") l='A'+j,r=i+1;
  }
  cout << l << r << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
// std::numeric_limits<int>::max(), min()
// std::setprecision(X)
// std::islower(), std::isupper(), std::tolower, std::toupper
// std::accumulate(m.begin(), m.end(), 0LL);
// std::sort(begin(),end()) // 0, 1, 2, 3 ,4 (default, less);
// std::priority_queue<int, vector<int>, less<int>> que; // 4, 3, 2, 1 (defualt, less) : 
// if ( std::regex_match(S, std::regex("(dream|dreamer|erase|eraser)*")) ) std::cout << "YES" << std::endl;
 
#define rep(i, n) for(int i = 0; i < (int)(n);    i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<std::vector<int>> vvi;

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

std::vector<std::string> sol( int n ) {
  std::vector<std::string> rtn;
  if ( n == 0 ) {
  }
  else if ( n == 1 ) {
    rtn.push_back( "a" );
  }
  else {
    auto r = sol(n-1);
    for(auto&& s : r) {
      char cmax = 'a';
      for(int j=0; j<sz(s); j++) cmax = std::max(cmax, s[j]);
      for(int j=0; j<=cmax-'a'+1; j++) {
        char n = 'a' + j;
        rtn.push_back( s + n );
      }
    }
  }
  return rtn;
}

int main (void) {
  std::cin.tie(0);  std::ios::sync_with_stdio(false);
  int N; std::cin >> N;
  auto r = sol(N);
  std::sort( all(r) );
  for(auto&& a : r) std::cout << a << std::endl;
  return 0;
}



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

int main() {
  int n;
  cin >> n;
  cout << "ABC" + to_string(n) << endl;
  return 0;
}

Measured memory_bytes: 256
using System;

namespace A___Blackjack
{
    class Program
    {
        static void Main (string[] args)
        {
            var input = Console.ReadLine ().Split (' ');
            var a = int.Parse (input[0]);
            var b = int.Parse (input[1]);
            var c = int.Parse (input[2]);
            if (a + b + c >= 22)
            {
                Console.WriteLine ("bust");
            }
            else
            {
                Console.WriteLine ("win");
            }
        }
    }
}

Measured memory_bytes: 11092
#include <stdio.h>
int main(void){
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    if(a == 5 && b == 5 && c == 7){
        printf("YES");
    }else if(a == 5 && c == 5 && b == 7){
        printf("YES");
    }else if(b == 5 && c == 5 && a == 7){
        printf("YES");
    }else{
        printf("NO");
    }
    
}

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

typedef struct Card {
    char suit;
    int value;
} CARD;

void selection(CARD A[], int N){
    int minj, j;
    for(int i=0; i<N; i++){
        minj = i;
        for(j=i; j<N; j++){
            if(A[j].value < A[minj].value){
                minj = j;
            }
        }
        CARD temp = A[i];
        A[i] = A[minj];
        A[minj] = temp;
    }
}

void bubble(CARD A[], int N){
    for(int i=0; i<N; i++){
        for(int j=N-1; j>i; j--){
            if(A[j].value < A[j-1].value){
                CARD temp = A[j];
                A[j] = A[j-1];
                A[j-1] = temp;
            }
        }
    }
}

void print(CARD A[], int N){
    for(int i=0; i<N; i++){
        if(i>0) cout << " ";
        cout << A[i].suit << A[i].value;
    }
    cout << endl;
}

void isStable(CARD A[], CARD B[], int N){
    for(int i=0; i<N; i++){
        if(A[i].suit != B[i].suit){
            cout << "Not stable" << endl;
            return;
        }
    }
    cout << "Stable" << endl;
}

int main(){
    int N;
    cin >> N;
    CARD C1[N], C2[N];
    for(int i=0; i<N; i++) cin >> C1[i].suit >> C1[i].value;
    for(int i=0; i<N; i++) C2[i] = C1[i];
    
    bubble(C1, N);
    selection(C2, N);
    
    print(C1, N);
    isStable(C1, C1, N);
    
    print(C2, N);
    isStable(C1, C2, N);
}


Measured memory_bytes: 3076
#include<stdio.h>
int main(){
  int N;
  scanf("%d",&N);
  int H[N];
  for(int i=0;i<N;i++){
    scanf("%d",&H[i]);
  }
  for(int i=N-1;i>0;i--){
    if(H[i]<H[i-1]-1){
      printf("No\n");
      return 0;
    }
    if(H[i]==H[i-1]-1)
      H[i-1]--;
  }
  printf("Yes\n");
  return 0;
}

Measured memory_bytes: 512
def main():
    a, b = map(int, input().split())
    if a * b <= 0:
        print('Zero')
    elif a > 0 or (abs(b - a) + 1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')

if __name__ == '__main__':
    main()


Measured memory_bytes: 9168
long long N,a[2000],d[2000][2000],x,i,k,t,s,p,q;main(){
	scanf("%lld%lld",&N,&x);
	for(;~scanf("%lld",a+i);++i)s+=*d[i]=a[i];
	for(;++k<N;s=t<s?t:s)
		for(t=k*x,i=0;i<N;++i)
			t+=d[i][k]=(p=a[(i-k+N)%N])<(q=d[i][k-1])?p:q;
	k=!printf("%lld\n",s);
}


Measured memory_bytes: 31488
def computeGCD(x, y):
    if x > y:
        small = y
    else:
        small = x
    for i in range(1, small + 1):
        if ((x % i == 0) and (y % i == 0)):
            gcd = i

    return gcd
a,b = map(int,input().split())
gcd = computeGCD(a,b)
print((a*b)//gcd)

Measured memory_bytes: 3060
using System;

class C
{
	static void Main()
	{
		var h = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		var n = h[0];

		var s = new int[n + 1];
		for (int i = 0; i < h[1]; i++) s[int.Parse(Console.ReadLine())] = -1;
		s[0] = 1;
		if (s[1] != -1) s[1] = 1;

		for (int i = 2; i <= n; i++)
		{
			if (s[i] == -1) continue;
			if (s[i - 2] != -1) s[i] += s[i - 2];
			if (s[i - 1] != -1) s[i] += s[i - 1];
			s[i] %= 1000000007;
		}
		Console.WriteLine(s[n]);
	}
}


Measured memory_bytes: 11360
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main{

	public static void main(String[] args){
		SC sc=new SC(System.in);
		int n = sc.nextInt();
		Tree[] tree = new Tree[n];
		for(int i = 0; i < n; i++){
			tree[i] = new Tree(i);
		}
		for(int i = 0; i < n; i++){
			String[] tmpArray = sc.nextLine().split(" ");
			int inputID = Integer.parseInt(tmpArray[0]);
			int childNum = Integer.parseInt(tmpArray[1]);
			for(int j = 0; j < childNum ; j++){
				int tmpIndex = Integer.parseInt(tmpArray[j + 2]);
				tree[inputID].addChild(tree[tmpIndex]);
				tree[tmpIndex].parent = inputID;
			}
		}
		for(int i = 0; i < n ;i++){
			if(tree[i].parent == -1){
				tree[i].initDepth(0);
				break;
			}
		}
		for(int i = 0; i < n; i++){
			System.out.print("node " + tree[i].id + ": parent = " + tree[i].parent + ", depth = "
					+ tree[i].depth + ", " + tree[i].type() + ", ");
			tree[i].printChildren();
			System.out.println();
		}
	}
}

class SC {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;
	public SC(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
	}
	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
		return tokenizer.nextToken();
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public double nextDouble() {
		return Double.parseDouble(next());
	}
	public String nextLine() {
		try {
			return reader.readLine();
		} catch (IOException e) {
			throw new UncheckedIOException(e);
		}
	}
}


class Tree {
	int parent = -1;
	int id = -1;
	ArrayList<Tree> children = new ArrayList<Tree>();
	int depth = 0;
	public Tree (int id){
		this.id = id;
	}
	public void addChild(Tree n){
		children.add(n);
	}
	public void printChildren(){
		System.out.print("[");
		for(int i = 0; i < children.size(); i++){
			System.out.print(children.get(i).id);
			if(i != children.size() - 1){
				System.out.print(", ");
			}
		}
		System.out.print("]");
	}
	public String type(){
		if(parent == -1){
			return "root";
		}
		else if(children.size() == 0){
			return "leaf";
		}
		else{
			return "internal node";
		}
	}
	public void initDepth(int depth){
		this.depth = depth;
		for(int i = 0; i < children.size() ; i++){
			children.get(i).initDepth(depth + 1);
		}
	}
}


Measured memory_bytes: 109092
N = int(input())
S = input()
L = len(S)
a1 = "a"
alpha  = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range (0,L):
  for j in range (0,26):
    if S[i] == alpha[j]:
      a1 = a1 + alpha[j+N]
print(a1[1:L+1])
      
      

Measured memory_bytes: 3188
# simple knapsack
n,W=map(int,input().split())
sacklist=[[]for i in range(4)]
w1=0
for _ in range(n):
    w,v=map(int,input().split())
    if _==0:
        w1=w
    sacklist[w-w1].append(v)

for i in range(4):
    sacklist[i].sort(reverse=True)
len1=len(sacklist[0])
len2=len(sacklist[1])
len3=len(sacklist[2])
len4=len(sacklist[3])
sumlist1=[]
sumlist2=[]
sumlist3=[]
sumlist4=[]
for _ in range(len1+1):
    sumlist1.append(sum(sacklist[0][:_]))
for _ in range(len2+1):
    sumlist2.append(sum(sacklist[1][:_]))
for _ in range(len3+1):
    sumlist3.append(sum(sacklist[2][:_]))
for _ in range(len4+1):
    sumlist4.append(sum(sacklist[3][:_]))
l1=len(sumlist1)
l2=len(sumlist2)
l3=len(sumlist3)
l4=len(sumlist4)
answer=0
for i in range(l1):
    for j in range(l2):
        for k in range(l3):
            for m in range(l4):
                if ((w1)*i+(w1+1)*j+(w1+2)*k+(w1+3)*m)<= W:
                    answer=max(answer,sumlist1[i]+sumlist2[j]+sumlist3[k]+sumlist4[m])
print(answer)


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

const int MAX_N = 1 << 20;
int n;
pair<ll, ll> dat[2*MAX_N-1];

void init(int n_) {
  n = 1;
  while(n < n_) n *= 2;
  REP(i, 2*n-1) dat[i] = {0, max((ll)0, i-n+1)};
}

//k??????(0-index)?????????a????¶????
void update(int k, int a) {
  k += n-1;
  dat[k].first += a;
  while(k > 0) {
    k = (k-1)/2;
    if(dat[k*2+1].first != dat[k*2+2].first) {
      dat[k] = max(dat[k*2+1], dat[k*2+2]);
    } else {
      if(dat[k*2+1].second < dat[k*2+2].second) dat[k] = dat[k*2+1];
      else dat[k] = dat[k*2+2];
    }
  }
}

pair<ll, ll> query(int a, int b, int k, int l, int r) {
  if(r <= a || b <= l) return {-INF, INF};

  if(a <= l && r <= b) return dat[k];
  else {
    PII vl = query(a, b, k*2+1, l, (l+r)/2),
        vr = query(a, b, k*2+2, (l+r)/2, r);
    cout << l << " " << r << " " << vl.first << " " << vr.first << endl;
    if(vl.first != vr.first) {
      return max(vl, vr);
    } else {
      //cout << "a" << endl;
      if(vl.second < vr.second) return vl;
      else return vr;
    }
  }
}

signed main(void)
{
  int q;
  cin >> n >> q;

  init(n);
  REP(i, q) {
    int a, v;
    cin >> a >> v;
    update(a-1, v);
    pair<ll, ll> ret = query(0, n, 0, 0, n);
    cout << ret.second+1 << " " << ret.first << endl;
    /*cout << endl;
    REP(i, 2*n-1) {
      cout << i << " " << dat[i].second+1 << " " << dat[i].first << endl;
    }
    cout << endl;*/
  }
/*
  cout << endl;
  REP(i, 3) {
    cout << dat[i].first << " " << dat[i].second << endl;
  }
*/
  return 0;
}

Measured memory_bytes: 35848
package main

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

func main() {
	N := ReadInt()
	c := make([][]int, 10)
	for i := 1; i <= 9; i++ {
		c[i] = make([]int, 10)
	}
	for i := 1; i <= 9; i++ {
		for j := 1; j <= 9; j++ {
			for k := 1; k <= N; k++ {
				if k%10 == j && top(k) == i {
					c[i][j]++
				}
			}
		}
	}
	ans := 0
	for i := 1; i <= 9; i++ {
		for j := 1; j <= 9; j++ {
			ans += c[i][j] * c[j][i]
		}
	}
	fmt.Println(ans)
}

func top(n int) int {
	for n >= 10 {
		n /= 10
	}
	return n
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 1872
//AtCoder 
#include <bits/stdc++.h>
using namespace std;
using lli=int64_t;

int main() {
#if LOCAL&0
  	std::ifstream in("input.txt");
  	std::cin.rdbuf(in.rdbuf());
#endif
    int N,K;
    string S;
    cin>>N>>K;
    cin>>S;
    //cout<<K<<endl;
    S[K-1]=tolower(S[K-1]);
    cout<<S<<endl;
    return 0;
}

Measured memory_bytes: 256
def course(arr,i):
    sum = 0
    for j in range(i+1):
        sum += arr[0][j]
    for j in range(i,len(arr[1])):
        sum += arr[1][j]
    return sum

n = int(input())
A = []

for i in range(2):
    A.append(list(map(int,input().split())))

max = 0

for i in range(n):
    if max < course(A,i):
        max = course(A,i)

print(max)

Measured memory_bytes: 3064
#include <iostream>
#include <math.h>
#include <limits>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <map>
#include <utility>
#include <queue>
using namespace std;
#define rep(i, n) for (int i =0; i < (int)(n); i++)
typedef pair<int, string> P;



int main() {
    int x, n;
    cin >> x >> n;
    vector<int> p(n);
    rep(i, n)cin >> p[i];


    if (n == 0) {
        cout << x << endl;
        return 0;
    }

    int flag = 0;
    int p1 = 100000;
    int p2 = 100000;
    rep(i, 110) {
        rep(j, n) {
            if (x + i == p[j]) {
                flag = 1;
           }
        }
        if (flag == 0) {
            p1 = i;
            break;
        }
        flag = 0;
    }
    flag = 0;
    rep(i, 110) {
        rep(j, n) {
            if (x - i == p[j]) {
                flag = 1;
            }
        }
        if (flag == 0) {
            p2 = i;
            break;
        }
        flag = 0;
    }
    if (p1 == p2) {
        cout << x - p1 << endl;
        return 0;
    }

    if (p1 < p2) {
        cout << x + p1 << endl;
        return 0;
    }
    if (p1 > p2) {
        cout << x - p2 << endl;
        return 0;
    }

}

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

using namespace std;

#define ll long long

int n, m;
ll w[105];
int v[105];
ll sv[100005] = {0};
bool b[100005] = {0};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        cin >> w[i] >> v[i];
    }
    b[0] = 1;
    for (int i = 0; i < n; i++) {
        for (int j = 100000 - v[i]; j >= 0; j--) {
            if (b[j]) {
                if (!sv[j + v[i]]) {
                    sv[j + v[i]] = sv[j] + w[i];
                } else {
                    sv[j + v[i]] = min(sv[j + v[i]], sv[j] + w[i]);
                }
                b[j+v[i]]=1;
            }

        }
    }
    for(int i = 100000; i > 0; i--) {
        if (sv[i] > 0 && sv[i] <=m) {
            cout << i << endl;
            return 0;
        }
    }
}


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

#define fast_io()                    \
    do {                             \
        ios::sync_with_stdio(false); \
        std::cin.tie(0);             \
    } while (0)
#define DBG(__need_dbg)                                              \
    do {                                                             \
        std::cout << "[" << __FUNCTION__ << ":" << __LINE__ << "] "; \
        std::cout << #__need_dbg << " = " << (__need_dbg) << endl;   \
    } while (0)

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> two;

int main() {
    fast_io();

    map<string, int> all;
    int n, max_i{};
    cin >> n;
    while (n--) {
        string tmp;
        cin >> tmp;
        all[tmp]++;
        if (all[tmp] > max_i) {
            max_i = all[tmp];
        }
    }

    for (auto i : all) {
        if (i.second == max_i) {
            cout << i.first << '\n';
        }
    }

    return 0;
}


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

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

	if (a > b) {
		cout << "a > b"<<endl;
	}
	else if (a == b) {
		cout << "a == b"<<endl;
	}
	else {
		cout << "a < b"<<endl;
	}
	
	return 0;
	
}


Measured memory_bytes: 3108
# include <stdio.h>
# include <algorithm>
using namespace std;
typedef long long LL;
const int maxn = 1e5+3;
 
int a[maxn], d[maxn], c[maxn], b[maxn], tmp[maxn];
LL n, m, k, t;
 
void qmod()
{
    while(k)
    {
        if(k&1)
        {
            for(int i=1; i<=n; ++i) tmp[i] = b[c[i]];
            for(int i=1; i<=n; ++i) b[i] = tmp[i];
        }
        k >>= 1;
        for(int i=1; i<=n; ++i) tmp[i] = c[c[i]];
        for(int i=1; i<=n; ++i) c[i] = tmp[i];
    }
}
 
int main()
{
    scanf("%lld",&n);
    for(int i=1; i<=n; ++i)
    {
        scanf("%d",&a[i]);
        d[i] = a[i]-a[i-1];
        tmp[i] = b[i] = c[i] = i;
    }
    scanf("%lld%lld",&m,&k);
    for(int i=1; i<=m; ++i)
    {
        scanf("%d",&t);
        swap(c[t], c[t+1]);
    }
    qmod();
    LL ans = 0;
    for(int i=1; i<=n; ++i)
    {
        ans += (LL)d[b[i]];
        printf("%lld.0\n",ans);
    }
    return 0;
}


Measured memory_bytes: 3328
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define F(i,a,n) for(int i=a; i<n; i++)


int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    int a[m];
    long sum=0;
    F(i,0,m){
        scanf("%d",a+i);
        sum+=a[i];
    }
    if(sum<=n){
        printf("%d\n",n-sum);
    }else printf("-1");
    return 0;
}

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

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


Measured memory_bytes: 256
use proconio::input;
use proconio::marker::Chars;

fn main() {
    input!{
        s: Chars,
    }
    let s = s.iter().rev();
    let mut cnt: Vec<u64> = vec![0; 2020];
    let mut t: usize = 0;
    let mut p = 1;
    // jがnの場合分をカウント
    cnt[0] += 1;
    for c in s {
        t = (c.clone() as usize - 48)  * p + t;
        let i = t % 2019;
        p = p * 10 % 2019;

        cnt[i as usize] += 1;
    }
    let ans: u64 = cnt.iter().map(|e| if e > &1 {e * (e - 1) / 2} else {0}).sum();
    println!("{}", ans);
}


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

int main(){
  int n;
  cin >> n;
  vector<int> data(n);
  for(int i = 0; i < n; i++){
    cin >> data.at(i);
  }
  int answer = 0;
  int count = 0;
  for(int i = 0; i < n; i++){
    if(i == n - 1){
      answer = max(count, answer);
      break;
    }

    if(data.at(i) >= data.at(i + 1)){
      count++;
    }
    else{
      answer = max(count, answer);
      count = 0;
    }
  }
  cout << answer << endl;
}


Measured memory_bytes: 640