akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define dd double
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define mp make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pll pair<ll,ll>
#define fo(i,n) for(int i=0;i<n;i++)
#define fo1(i,n) for(int i=1;i<=n;i++)
ll mod=1000000007;
ll n,k,t,m,q,flag=0;
ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(a) -- no. of elements strictly less than a
// s.find_by_order(i) -- itertor to ith element (0 indexed)
ll min(ll a,ll b){if(a>b)return b;else return a;}
ll max(ll a,ll b){if(a>b)return a;else return b;}
ll gcd(ll a , ll b){ if(b > a) return gcd(b , a) ; if(b == 0) return a ; return gcd(b , a%b) ;}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    #ifdef NOOBxCODER
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #else 
    #define NOOBxCODER 0
    #endif
    //cin>>t;
    t=1;
    while(t--){
        string s;
        cin>>s;
        ll ans=0;
        fo(i,s.size()){
            if(s[i]=='?')s[i]='D';
            if(s[i]=='D'){
                ans++;
                if(i>0)if(s[i-1]=='P')ans++;
            }

        }
        cout<<s;




        
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
    return 0;
}


Measured memory_bytes: 3900
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(ll i = n;i >= 0;--i)
#define FOR(i,m,n) for(ll i = m, i##_len=(n);i <i##_len; ++i)
#define all(x) (x).begin(),(x).end()
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; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;
 
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(void)
{
    ll h;
    ll n;
    cin >> h >> n;
    vector<ll> a(n);
    REP(i,n){
        cin >> a[i];
    }

    ll sum = 0;
    REP(i, n)
    {
        sum += a[i];
    }

    if(sum >= h){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int x,n; cin >> x >> n;
  set<int> st;
  REP(i,n){
    int p; cin >> p;
    st.insert(p);
  }

  REP(sub,200){
    int low = x-sub;
    int high = x+sub;
    if(st.count(low)==0){
      cout << low << endl;
      break;
    }
    if(st.count(high)==0){
      cout << high << endl;
      break;
    }
  }

  return 0;
}


Measured memory_bytes: 3660
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

int main(void)
{
    int N;
    cin >> N;

    int left = N / 1.08;
    int right = left + 1;
    if (N == (int)(left*1.08))
        cout << left << endl;
    else if (N == (int)(right*1.08))
        cout << right << endl;
    else
        cout << ":(" << endl;

    return 0;
}


Measured memory_bytes: 256
a = []
try :
    while True:
         a.append(int(input()))
except EOFError:
    pass

counts = [0] * 101
# counts[n] nの個数と数える

for n in a:
    counts[n] += 1

for n in range(len(a)):
    if counts[n] == max(counts):
        print(n)


Measured memory_bytes: 5596
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7;

ll a[N], b[N], cum[N], cum2[N];

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    for(int i = 1; i <= n; i++) cin >> a[i];
    for(int i = 1; i <= m; i++) cin >> b[i];
    for(int i = 1; i <= n; i++){
        cum[i] = cum[i - 1] + a[i];
    }
    for(int i = 1; i <= m; i++){
        cum2[i] = cum2[i - 1] + b[i];
    }
    int ans = 0;
    for(int i = 1; i <= n; i++){
        if(cum[i] > k) break;
        ll kam = k - cum[i];
        int idx = upper_bound(cum2 + 1, cum2 + m + 1, kam) - cum2;
        ans = max(ans, i - 1 + idx);
    }
    for(int i = 1; i <= m; i++){
        if(cum2[i] > k) break;
        ll kam = k - cum2[i];
        int idx = upper_bound(cum + 1, cum + n + 1, kam) - cum;
        ans = max(ans, i - 1 + idx);
    }
    cout << ans;




    return 0;
}



Measured memory_bytes: 9864
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iterator>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
	int N, K;
	cin >> N >> K;
	int ret = 1;
	for (int i = 0; i < N; i++) {
		if (ret < K) {
			ret *= 2;
		}
		else {
			ret += K;
		}
	}
	cout << ret;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>//２つの整数 a と b を読み込んで、以下の値を計算するプログラム
#include<math.h>

int main(void){
 
	double r;
     
	scanf("%lf",&r);
	printf("%f %f",(r*r*3.141592653589),(2*r*3.141592653589));
	return 0;
}

Measured memory_bytes: 648
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

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

using namespace std;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}
template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

#include <utility>
#include <functional>
template<typename T, typename E>
void compress_insert(vector<T> &inserter, pair<vector<T> &, vector<E> &> pr) {
    for (T &val : pr.first) {
        inserter.push_back(val);
    }
}
template<typename T, typename Head, typename... Args>
void compress_insert(vector<T> &inserter, Head head, Args... args) {
    compress_insert(inserter, head);
    compress_insert(inserter, args...);
}
template<typename T, typename E>
void compress_update(vector<T> &inserter, pair<vector<T> &, vector<E> &> pr) {
    for (unsigned int i = 0; i < pr.first.size(); i++) {
        pr.second[i] = static_cast<int>(lower_bound(inserter.begin(), inserter.end(), pr.first[i]) - inserter.begin());
    }
}
template<typename T, typename Head, typename... Args>
void compress_update(vector<T> &inserter, Head head, Args... args) {
    compress_update(inserter, head);
    compress_update(inserter, args...);
}
template<typename T, typename... Args>
size_t compress(vector<T> &inserter, Args... args) {
    compress_insert(inserter, args...);
    sort(inserter.begin(), inserter.end());
    inserter.erase(unique(inserter.begin(), inserter.end()), inserter.end());
    compress_update(inserter, args...);
    return inserter.size();
}
template<typename T, typename E>
auto refer(vector<T> &a, vector<E> &b) {
    return make_pair(ref(a), ref(b));
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> x1(n), x2(n), y1(n), y2(n);
    vector<ll> res1, res2;

    REP(i, 0, n) {
        cin >> x1[i] >> y1[i] >> x2[i] >> y2[i];
    }
    compress(res1, refer(x1, x1), refer(x2, x2));
    compress(res2, refer(y1, y1), refer(y2, y2));

    int W = res1.size(), H = res2.size();
    auto imos = make_v(H + 1, W + 1, 0LL);
    REP(i, 0, n) {
        imos[y1[i]][x1[i]]++;
        imos[y2[i]][x1[i]]--;
        imos[y1[i]][x2[i]]--;
        imos[y2[i]][x2[i]]++;
    }
    REP(i, 0, H + 1) {
        REP(j, 0, W) {
            imos[i][j + 1] += imos[i][j];
        }
    }
    REP(j, 0, W + 1) {
        REP(i, 0, H) {
            imos[i + 1][j] += imos[i][j];
        }
    }

    ll ans = 0;
    REP(i, 0, H - 1) {
        REP(j, 0, W - 1) {
            if (imos[i][j] > 0) {
                ans += ll(res2[i + 1] - res2[i]) * (res1[j + 1] - res1[j]);
            }
        }
    }
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 128296
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>

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

using namespace std;
//        tmp = stoi(S.substr(i,3));
int main(){
    string O,E;

    cin >> O >> E;

    for(int i = 0; i < O.size();i++)
    {
        cout << O[i];
        if(i > E.size() - 1)break;
        cout << E[i];
    }

    cout << endl;

    return 0;
}



Measured memory_bytes: 256
//Created by Kira

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

#define IOS cin.sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define pii pair<int,int> 
#define pb push_back
#define vi vector<int> 
using ll = long long;

const int mod = 1e9 + 7;

ll pwr(ll a, ll b);
    



int main(){
   IOS

   int p, q, r;cin>>p>>q>>r;

   cout<<(min(p + q, min(q + r, r + p)))<<"\n";





    







}

ll pwr(ll a, ll b){
   a %= mod;	//Remove mod if not required
   ll res = 1;
   while(b > 0){
    if(b&1)
        res = res * a % mod;
        a = a * a % mod;
    b >>= 1;
    }

    return res;
}



Measured memory_bytes: 256
'use strict'
 
function Main(input) {
  const takahashi = Number(input.split(' ')[0]);
  const chuhashi = Number(input.split(' ')[1]);
  const syohashi = Number(input.split(' ')[2]);
  const K = input.split(' ')[3];
  const Ka = Number(K.slice(-1));
 
  const answer = chuhashi - takahashi;
  
  if(Ka % 2 === 0 && answer !== 0) {
    console.log(answer * -1);
  } else {
    console.log(answer);
  }
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());

Measured memory_bytes: 9420
#include<stdio.h>

int main(){
	
	int N,H[25],i,ryokan=1,j,count;
	
	scanf("%d",&N);
	
	for(i=1;i<=N;i++){
		scanf("%d",&H[i]);
	}
	
	for(i=2;i<=N;i++){
		count=0;
		for(j=1;j<=i-1;j++){
			if(H[j]<=H[i]){
			count++;
			
			}
		}
		if(count==i-1){
			ryokan++;
		}
		
	}
	
	
	printf("\n%d\n\n",ryokan);
	
	
	return 0;
}

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

using ll = long long;

template<typename T>
T gcd(T a, T b)
{
	if (a < b)	return gcd(b, a);
	T r;
	while ((r = a % b))
	{
		a = b;
		b = r;
	}
	return b;
}

template<typename T>
T lcm(T a, T b)
{
	return a * b / gcd(a, b);
}

template<typename T>
T ext_gcd(T a, T b, T& x, T& y)
{
	x = 1;
	y = 0;
	T x0 = 0, y0 = 1;
	while (b != 0)
	{
		T q = a / b;
		a -= q * b;
		swap(a, b);
		x -= q * x0;
		swap(x, x0);
		y -= q * y0;
		swap(y, y0);
	}
	return a;
}

template<typename T>
T inv_mod(T a, T mod)
{
	T t1, t2;
	ext_gcd(a, mod, t1, t2);
	t1 %= mod;
	if (t1 < 0)		t1 += mod;
	return t1;
}

template<typename T>
T combination_large(T n, T k, T mod)
{
	if (n < k || n < 0 || k < 0)	return 0;
	vector<T> inv(n + 1, 1), fact(n + 1, 1), fact_inv(n + 1, 1);
	for (T i = 2; i <= n; ++i)
	{
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		fact[i] = (fact[i - 1] * i) % mod;
		fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
	}
	return fact[n] * (fact_inv[k] * fact_inv[n - k] % mod) % mod;
}

template<typename T>
T combination(T n, T k, T mod = 1)
{
	vector<vector<T>> table(n + 1, vector<T>(k + 1, 1));
	for (T i = 1; i <= n; ++i)
	{
		table[i][0] = 1;
		for (T j = 1; j <= n; ++j)
		{
			table[i][j] = (table[i - 1][j - 1] + table[i - 1][j]) % mod;
		}
	}
}


int main(int, char**)
{
	int N, M;
	scanf("%d",&N);
	scanf("%d",&M);
	std::vector<pair<int, int>> p(M);
	for(int i = 0 ; i < M ; i++){
		int a, b;
		scanf("%d",&a);
		scanf("%d",&b);
		p[i] = make_pair(a, b);
	}

	sort(p.begin(), p.end(), [](const pair<int, int>& l, const pair<int, int>& r) { return l.second < r.second; });
	int x = 0;
	int count = 0;
	for (const auto& e : p)
	{
		if (e.first <= x)	continue;
		x = e.second - 1;
		++count;
	}
	cout << count << endl;

	return 0;
}


Measured memory_bytes: 1024
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
      	Set<Integer> set = new HashSet<Integer>();
        Integer h[] = new Integer[n];
        for (int i=0; i<n; i++) {
            h[i] = sc.nextInt();
          	set.add(i+1);
        }
      int a = 0;
      int b = 0;
      int ah = 0;
      int bh = 0;
      	for (int l=0; l<m; l++){
          a = sc.nextInt();
          ah = h[a-1];
          b = sc.nextInt();
          bh = h[b-1];
          
        if(ah == bh){
          set.remove(a);
          set.remove(b);
        }else if(bh > ah){
          set.remove(a);
        }else{
          set.remove(b);
        }
     }
            System.out.println(set.size());
    }
}

Measured memory_bytes: 69412
using System;
class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);

            if (a%2 == 0 || b%2 == 0)
            {
                Console.WriteLine("Even");
            }
            else
            {
                Console.WriteLine("Odd");
            }
        }
    }

Measured memory_bytes: 11092
// This amazing code is by Eric Sunli Chen.
#include<bits/stdc++.h>
using namespace std;
template<typename T> bool get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'&&t!=EOF; t=getchar());
	if(t=='-')neg=true,t=getchar();if(t==EOF)return false;
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;return true;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) (get1(a)&&get1(b))
#define get3(a,b,c) (get1(a)&&get2(b,c))
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

const int mod=1e9+7;

int n,k,comb[233][233],tot,tot2,ma[111],mb[111];
char s[111];

int c[111],ans,use[111];
void dfs(int mx,int cnt,int sum,int coef)
{
	if(cnt+sum-1>n)return;
	if(cnt>tot)return;
	if(mx==0)
	{
		if(cnt==0)
		{
			ans++;if(ans>=mod)ans-=mod;
			return;
		}
		if(cnt-c[1]>tot2)return;
		
		bool ok=1;int cur=0;
		memset(use,0,sizeof(use));
		for(int i=(n+3)>>1;i>0;i--)
		{
			for(int j=1;j<=c[i];j++)
			{
				cur++;
				use[ma[cur]]=1;
				use[mb[cur]]=i-1;
			}
		}
		cur=0;
		for(int i=k;i>=1&&ok;i--)
		{
			cur++;
			if(cur<use[i])ok=0;
			else cur-=use[i];
		}
		if(ok)
		{
			int have=n-cnt-sum+1,need=sum+cnt+1+(cnt-c[1])*2;
			ans=(ans+1ll*coef*comb[have+need-1][need-1])%mod;
		}
		return;
	}
	for(c[mx]=0;c[mx]<=n;c[mx]++)dfs(mx-1,cnt+c[mx],sum+c[mx]*(mx==1?1:mx+mx-3),coef*1ll*comb[cnt+c[mx]][cnt]%mod);
}

int main()
{
	for(int i=0;i<233;i++)
	{
		comb[i][0]=1;
		for(int j=1;j<=i;j++)
		{
			comb[i][j]=comb[i-1][j]+comb[i-1][j-1];
			if(comb[i][j]>=mod)comb[i][j]-=mod;
		}
	}
	get2(n,k);
	scanf("%s",s+1);
	for(int i=1;i<=k;i++)if(s[i]=='r')
	{
		int j=i;
		for(;j<=k;j++)if(s[j]=='b'&&!use[j])break;
		tot++;tot2+=(j<=k);
		ma[tot]=i;mb[tot]=j;
		use[j]=1;
	}
	dfs((n+3)/2,0,0,1);
	printendl(ans);
	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int n,x,y,z;
vector<string> vx,vy,vz;
void dfs(int v,string now,vector<string> &a){
	if (!v) return a.push_back(now);
	now+='.';
	for (int i=1;i<=v;i++) now[now.size()-1]=i-1,dfs(v-i,now,a);
}
typedef long long ll;
const int N=1e5+10,p=1e9+7;
int inc(int x,int y){x+=y;return x>=p?x-p:x;}
int mul(int x,int y){return (ll)x*y%p;}
int go[N][10],fail[N],top=1;
bool last[N];
void trie(string s){
	int p=1;
	for (int i=0;i<s.size();i++){
		int w=s[i];
		if (!go[p][w]) go[p][w]=++top;
		p=go[p][w];
	}
	last[p]=1;
}
queue<int> Q;
void getfail(){
	for (int i=0;i<10;i++)
		if (go[1][i]) fail[go[1][i]]=1,Q.push(go[1][i]);
			else go[1][i]=1;
	while (!Q.empty()){
		int v=Q.front();Q.pop();
		for (int i=0;i<10;i++)
		if (go[v][i]){
			fail[go[v][i]]=go[fail[v]][i];
			Q.push(go[v][i]);
		}
		else go[v][i]=go[fail[v]][i];
	}
}
int dp[50][N],mi[50];
int main()
{
	cin>>n>>x>>y>>z;
	dfs(x,string(),vx);
	dfs(y,string(),vy);
	dfs(z,string(),vz);
	for (int i=0;i<vx.size();i++)
	for (int j=0;j<vy.size();j++)
	for (int k=0;k<vz.size();k++)
		trie(vx[i]+vy[j]+vz[k]);
	getfail();
	mi[0]=1;
	for (int i=1;i<=n;i++) mi[i]=mul(mi[i-1],10);
	int ans=0;
	dp[0][1]=1;
	for (int i=0;i<n;i++)
	for (int v=1;v<=top;v++)
	for (int w=0;w<10;w++){
		int p=go[v][w];
		if (last[p]) ans=inc(ans,mul(dp[i][v],mi[n-i-1]));
		else dp[i+1][p]=inc(dp[i+1][p],dp[i][v]);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 19328
#include<bits/stdc++.h>
using namespace std;
int positions[200005];

int main(){
    int n;
    cin>>n;
    int test;
    for(int i=0;i<n;i++){
        cin>>test;
        positions[test]=i+1;
    }
    int actualsum=1;
    int maxsum=1;
    for(int i=1;i<n;i++){
        if(positions[(i+1)]>positions[i]){
            actualsum++;
            if(actualsum>maxsum){
                maxsum=actualsum;
            }
        }
        else{
            actualsum=1;
        }
    }
    cout<<n-maxsum;
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
# define ll int64_t
# define str string
# define rep(i,n) for(ll i=0;i<n;i++)
# define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007
# define PI 3.141592653589793
# define vec vector
#define dump(x) cerr<<#x<<"="<<x<<endl
using namespace std;



#define INF 2000000000
#define MAX_V 10



bool compare_by_b(pair<string,ll> a,pair<string,ll> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

bool my_compare(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

ll modpow(ll a,ll n,ll mod1) {
    ll res=1;
    while(n>0){
        if(n&1) res=res*a%mod1;
        a = a*a%mod1;
        n >>= 1;
    }
    return res;
}

ll factorial(ll n){
    ll x=1;
    rrep(i,n) (x*=i)%=mod;
    return x;
}

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

ll lcm(ll a,ll b){
   return a/gcd(a,b)*b;
}
const ll MAX = 5100000;
const ll MOD = 1000000007;
 
ll fac[MAX], finv[MAX], inv[MAX];
 
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

using graph = vector<vector<ll>>;
pair<pair<ll,ll>,ll> p[100010];

bool isUru(ll Y){
    if(Y%400==0){ return true;}
    else if(Y%100==0){ return false;}
    else if(Y%4==0){ return true;}
    else{ return false; }
}



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n,sum=0;
    cin>>n;
    vec<ll> s(n);
    rep(i,n) cin>>s[i];
    rep(i,n-1){
        if(s[i]==s[i+1]) {
            s[i+1]=INF;
            sum++;
        }
    }
    cout<<sum<<endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define FORE(x,c) for(auto &&x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define INSEG(l,x,r) ((l)<=(x)&&(x)<(r))
#define dump(...)
#define pb push_back
#define _ 0
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v))os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template <class T> void PSUM(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(0); ios::sync_with_stdio(0);
        cout << setprecision(15) << fixed;
        // #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    int A, B, C;
    cin >> A >> B >> C;
    cout << min(B / A, C) << endl;
    return (0^_^0);
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <queue>

#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i, s, n) for(int i=s; i<n; i++)
#define dup(x,y) (((x)+(y)-1)/(y)) // dup * y >= x なる最小のdup.
using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;


vector<ll> p_num;
vector<ll> b_num;
vector<ll> s_num;

ll patty(ll n, ll k) {
  if(n==0) return 1; // レベル0バーガーは pattyのみ
  if(k<=1) {
    return 0; // 端はBread
  } else if(k<= 1 + s_num[n-1]){
    return patty(n-1, k-1) + 0;
  } else if(k== 2 + s_num[n-1]) {
    return p_num[n-1] + 1;
  } else if(k<= 2 + s_num[n-1]*2) {
    return patty(n-1, k-2-s_num[n-1]) + p_num[n-1] + 1;
  } else { //if(k==s_num[n]) {
    return p_num[n];
  }
}

int main() {
  int N;
  ll K;
  cin >> N >> K;

  p_num.resize(N+1); // p_num[i].. レベルiバーガーのPの数
  b_num.resize(N+1); // Bの数
  s_num.resize(N+1);
  p_num[0] = 1;
  b_num[0] = 0;
  s_num[0] = 1;
  
  rep2(i, 1, N+1) {
    p_num[i] = 1 + p_num[i-1]*2;
    b_num[i] = 2 + b_num[i-1]*2;
    s_num[i] = p_num[i] + b_num[i];
  }
  //rep(i, K+1) cout << patty(N, i) << endl;


  cout << patty(N, K) << endl;
  
  return 0;
}


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

using namespace std;

int k;

int main(){
  cin >> k;
  cin.ignore();

  long long sum = 0ll;
  for (int a = 1; a <= k; a++){
    for (int b = 1; b <= k; b++){
      for (int c = 1; c <= k; c++){
        sum += std::gcd(a, std::gcd(b, c));
      }
    }
  }

  cout << sum << endl;
  return 0;
}


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

const long long MAX = 200000;

int main(){
    long long n, A[MAX], d[MAX];
    cin >> n;
    
    for(long long i = 0; i <= n; i++){
        d[i] = 0;
    }

    rep(i,n){
        cin >> A[i];
        d[A[i]]++;
    }

    long long ans = 0;
    for(long long i = 1; i <= n; i++){
        if(d[i] > 1){
            ans += d[i] * (d[i] - 1) / 2;
        }
    }

    rep(i,n){
        long long current_d = d[A[i]] - 1;
        if(current_d >= 1){
            cout << ans - d[A[i]] + 1 << endl;
        }else{
            cout << ans << endl;
        }
    }
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 10000000000000000



int main(){
	
	int N;
	cin>>N;
	
	vector<long long> L(N),R(N);
	
	for(int i=0;i<N;i++){
		cin>>L[i]>>R[i];
		L[i]*=2;
		R[i]*=-2;
	}
	
	sort(L.begin(),L.end(),greater<long long>());
	sort(R.begin(),R.end(),greater<long long>());
	
	long long ans = 0;
	long long now = 0;
	for(int i=0;i<N;i++){
		now += L[i];
		ans = max(ans,now);
		now += R[i];
		ans = max(ans,now);
	}
	
	now = 0;
	
	for(int i=0;i<N;i++){
		now += R[i];
		ans = max(ans,now);
		now += L[i];
		ans = max(ans,now);
	}
	
	cout<<ans<<endl;


	return 0;
}

Measured memory_bytes: 1792
n=int(input())
import bisect
import itertools
l=len(str(n))
ans=[]
num=[]
x=['3', '5', '7']
for k in range(3,l+1):
    m=list(itertools.product(x, repeat=k))
    num.extend(m)
for i in range(len(num)):
    y=num[i]
    if '3' in y and '5' in y and '7' in y:
        number=''
        for j in range(len(y)):
            number+=y[j]
        ans.append(int(number))
ans.sort()
print(bisect.bisect_right(ans, n))

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

using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
int __stoi(string s){ return atoi(s.c_str()); }
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}
template<class T> void chmax(T& a, T b){ if(a<b){a=b;} }
template<class T> void chmin(T& a, T b){ if(a>b){a=b;} }
const ll MOD = 1e9+7;
#define pii pair<int,int>
#define pll pair<ll,ll>

int main(){
    int N; cin>>N;
    vector<int> b(N);
    REP(i,N){ cin>>b[i]; }
    
    bool ok = true;    
    REPR(i,N-1){
        if(b[i]>i+1){
            ok = false;
            break;
        }
    }
    if(ok){
        stack<int> stk;
        REP(count,N){
            for(int i=b.size()-1;i>=0;--i){
                if(b[i]==i+1){
                    stk.push(b[i]);
                    b.erase( b.begin()+i );
                    break;
                }
            }
        }
        while(!stk.empty()){
            cout << stk.top() << "\n";
            stk.pop();
        }
        
    }else{
        cout << "-1\n";
    }
}


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

int main() {
    int N;
    string S;
    cin >> N >> S;

    if (S.length() % 2 == 0) {
        string head = S.substr(0, N/2);
        string tail = S.substr(N/2, N/2);
        if (head == tail) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    } else {
        cout << "No" << endl;
    }
}


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

namespace PANASONIC2020
{
    class D
    {
        static int N;
        static void Main(string[] args)
        {
            N = int.Parse(Console.ReadLine());
            DFS("", 'a');
        }

        static void DFS(string S, char mx)
        {
            if (S.Length == N)
            {
                Console.WriteLine(S);
            }
            else
            {
                for (char c = 'a'; c <= mx; c++)
                {
                    DFS(S + c, ((c == mx) ? (char)(mx + 1) : mx));
                }
            }
        }
    }
}


Measured memory_bytes: 16452
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<int,int> P;
#define fi first
#define se second
#define all(v) (v).begin(),v.end()
set<string> c;
const ll mod=1000000007;
const ll mod2=998244353;
const ll inf=100000000000000000;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
ll dp[200][200000];
int main(){
    int n,k;
    cin>>n>>k;
    vector<ll> a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<=n;i++)dp[i][0]=1;
    for(int i=0;i<n;i++){
        for(int j=1;j<=k;j++){
            if(j-1-a[i]>=0){
                dp[i+1][j]=(dp[i+1][j-1]+dp[i][j]-dp[i][j-1-a[i]]+mod)%mod;
            }
            else dp[i+1][j]=(dp[i+1][j-1]+dp[i][j])%mod;
        }
    }
    cout<<dp[n][k]<<endl;
}


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

using ll = long long;
using P = pair<ll, ll>;

const ll MOD = 1e9+7;
// const ll MOD = 998244353;
const ll INF = 1ll<<60;

#define FOR(i,a,b) for (ll i=(a);i<(ll)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

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

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

template<class T>
bool chmax(T &a, initializer_list<T> l)
{
	return chmax(a, *max_element(l.begin(), l.end()));
}

template<class T>
bool chmin(T &a, initializer_list<T> l)
{
	return chmin(a, *min_element(l.begin(), l.end));
}

ll N, W;
ll w0;
vector<vector<ll>> cnt(4, vector<ll>());

template<typename T>
ll solve(ll w, ll v, T vec)
{
	if (vec == cnt.end())
	{
		if (w <= W) return v;
		else return 0;
	}

	ll i = distance(cnt.begin(), vec);
	ll res{0};
	for (ll k = 0; k <= vec->size(); ++k)
	{
		ll tmp = solve(w+(w0+i)*k, v+accumulate(vec->begin(),
												next(vec->begin(), k),
												0ll), next(vec));
		chmax(res, tmp);
	}

	return res;
}
	

int main(int argc, char **argv)
{
	cin >> N >> W;
	ll tmp;
	cin >> w0 >> tmp;
	cnt[0].push_back(tmp);
	REP(i, N-1)
	{
		ll w, v; cin >> w >> v;
		cnt[w-w0].push_back(v);
	}

	for (auto &ev : cnt)
		sort(ALL(ev), greater<ll>());

	std::cout << solve(0, 0, cnt.begin()) << std::endl;
}


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


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 * @throws NumberFormatException 
	 */
	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
//		int limit = 1000000000;
//		
//		boolean[] written = new boolean[limit];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		
		int [] input = new int[n];
		for(int i = 0; i < n; i++){
			input[i] = Integer.parseInt(br.readLine());
		}
		
		Arrays.sort(input);
		
		boolean written = true;
		
		int write = 1;
		int erase = 0;
		
		for(int i = 1; i < n; i++){
			if(input[i - 1] == input[i]){
				written = !written;
			}
			
			else {
				written = true;
			}
			
			if(written == true){
				write++;
			}
			else {
				erase++;
			}
		}
		
		System.out.println(write - erase);
	}

}


Measured memory_bytes: 32772
#include<iostream>
#include<vector>
int main(){
  std::string n;
  std::cin>>n;
  std::vector<int> a(std::size(n));
  for(int i=0;i<size(n);++i)a[i]=n[i]-'0';
  int mod9 = 0;
  for(auto ai:a){
    mod9 += ai;
    mod9 %= 9;
  }
  std::cout<<(mod9==0?"Yes":"No")<<std::endl;
}

Measured memory_bytes: 4428
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String t = scanner.nextLine();
        int count = 0;
        for (int i = 0; i <= s.length() - 1; i++) {
            char c = s.charAt(i);
            char d = t.charAt(i);
            if(c != d) {
                count++;
            }
        }
        System.out.println(count);
    }
}

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

int main(){
    int n;cin >> n;
    double ans;
    if(n%2 == 0){
        ans = 0.50000000;
    }
    else{
        ans = (double)(n/2+1)/(n);
    }
    printf("%.9f\n",ans);
    return 0;
}

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

int main() {
  string s, t;
  cin >> s >> t;
  int n = (int)s.size();
  int m = (int)t.size();

  vector< vector<int> > pos(26);
  for (int i = 0; i < n; ++i) pos[s[i] - 'a'].push_back(i);
  for (int i = 0; i < n; ++i) pos[s[i] - 'a'].push_back(i + n);

  int p = 0;
  long long ans = 0;
  for (int i = 0; i < m; ++i) {
    int cur = t[i] - 'a';
    if (pos[cur].size() == 0) {
      cout << -1 << endl;
      return 0;
    }

    p = *lower_bound(pos[cur].begin(), pos[cur].end(), p) + 1;
    if (p >= n) {
      p -= n;
      ans += n;
    }
  }
  ans += p;
  cout << ans << endl;
  return 0;
}



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

using i64 = int64_t;

#define rep(i, x, y) for (i64 i = i64(x), i##_max_for_repmacro = i64(y); i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;

template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

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

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

void solve() {
    //const i64 mod = 1'000'000'007;
    i64 N,A,B;
    cin >> N >> A >> B;

    cout << min(A,B) << " " << (A+B<=N?0:max(i64(0),A+B-N)) << endl;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define ll long long
int main(){
  int N,Q;
  cin>>N>>Q;
  string S;
  cin>>S;
  int X[100010]={0};
  rep(i,N){
    if(i) if(S[i-1]=='A'&&S[i]=='C'){
      X[i]++;
    }
    X[i]+=X[i-1];
  }
  int L[100010],R[100010];
  rep(i,Q){
    cin>>L[i]>>R[i];
    cout<<X[R[i]-1]-X[L[i]-1]<<endl;
  }
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;

/*
int judge(long long ans_a,long long ans_t,int a,int t){
	//long long www = w_gcd(ans_a,ans_t);
	long long aa = ans_a / www;
	long long at = ans_t / www;
	if(aa*t > at*a) return 1;
	else return 2;
}
*/
int main(void)
{
	int n; cin>>n;
	long long t[n],a[n]; for(int i = 0; i < n; i++) cin>>t[i]>>a[i];
	long long ans_t = t[0], ans_a = a[0];
	for(int i = 1;i < n; i++){
		//if(judge(ans_a,ans_t,a[i],t[i]) == 1){}
		if(a[i-1]*t[i] > t[i-1]*a[i]){
			while(ans_a % a[i] != 0)ans_a++;
			ans_t = ans_a/a[i];
			ans_t = ans_t*t[i];
		}
		else{
			while(ans_t % t[i] != 0) ans_t++;
			ans_a = ans_t/t[i];
			ans_a = ans_a*a[i];
		}
		//cout<<"ans_t = "<<ans_t<<", ans_a = "<<ans_a<<endl;
	}
	cout<<ans_t+ans_a<<endl;
	return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include<math.h>
#include <algorithm>
using namespace std;

int main(){

	int T,H,S,seconds,seconds3;

	while(true){
		scanf("%d %d %d",&T,&H,&S);
		if(T == -1 && H == -1 && S == -1)break;
		seconds = 7200 - (3600*T + 60*H + S);
		seconds3 = 3*seconds;
		printf("%02d:%02d:%02d\n",seconds/3600,(seconds%3600)/60,(seconds%3600)%60);
		printf("%02d:%02d:%02d\n",seconds3/3600,(seconds3%3600)/60,(seconds3%3600)%60);
	}

    return 0;
}



Measured memory_bytes: 2680
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF (1<<30)
#define LINF (1LL<<60)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
typedef unsigned long long int ull;
typedef long long lint;
 
int main(void){
  lint N,A[5];
  cin >> N;
  rep(i,5) cin >> A[i];
  lint x=*min_element(A,A+5);
  lint ans=4+ceil((double)N/x);
  cout << ans << endl;
}

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

using namespace std;

typedef pair<int, int> II;
typedef vector<II> VII;
typedef vector<int> VI;
typedef vector<VI> VVI;

typedef long long int LL;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(), a.end()
#define SET(a, b) memset(a, b, sizeof(a))
#define si(n) scanf("%d", &n)
#define dout(n) printf("%d\n", n)
#define sll(n) scanf("%lld", &n)
#define lldout(n) printf("%lld\n", n)

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
  const char *comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
#else
#define trace(...)
#endif

#define fast_io                     \
  ios_base::sync_with_stdio(false); \
  cin.tie(NULL)

#define endl '\n'

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


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class Main implements Runnable {
	public static void main(String[] args) {
		new Thread(null, new Main(), "", Runtime.getRuntime().maxMemory()).start();
		// new Main().run();
	}

	final long MODULO = (long) (1e9 + 7);

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String S = sc.next();
		long[][] f = new long[n + 1][n + 1];
		f[0][0] = 1;
		for (int i = 1; i <= n; ++i) {
			for (int curLen = 0; curLen <= n; ++curLen) {
				if (curLen + 1 <= n) {
					f[i][curLen + 1] += 2 * f[i - 1][curLen];
					f[i][curLen + 1] %= MODULO;
				}
				if (curLen > 0) {
					f[i][curLen - 1] += f[i - 1][curLen];
					f[i][curLen - 1] %= MODULO;
				} else {
					f[i][curLen] += f[i - 1][curLen];
					f[i][curLen] %= MODULO;
				}
			}
		}
		long ans = f[n][S.length()] * inv(pow(2, S.length())) % MODULO;
		System.out.println(ans);
	}

	long pow(long a, long n) {
		long ret = 1;
		for (; n > 0; n >>= 1, a = (a * a) % MODULO) {
			if (n % 2 == 1) {
				ret = (ret * a) % MODULO;
			}
		}
		return ret;
	}

	long inv(long a) {
		// a * u + mod * v = x
		// a * p + mod * q = y
		long u = 1, v = 0, p = 0, q = 1, x = a, y = MODULO;
		while (x > 1) {
			u -= x / y * p;
			v -= x / y * q;
			x -= x / y * y;
			long d = u;
			u = p;
			p = d;
			d = v;
			v = q;
			q = d;
			d = x;
			x = y;
			y = d;
		}
		if (u < 0) {
			u += MODULO;
		}
		return u;
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}

Measured memory_bytes: 244908
from sys import stdin, stdout # only need for big input

max_honest = 0
testomonies = []
state = []

def dfs(person):
    global max_honest
    if person >= len(state):
        correctState = True
        for p in range(len(state)):
            if state[p] == 1:
                for t in testomonies[p]:
                    x, y = t
                    if state[x] != y:
                        correctState = False
                        break
        if correctState:
            sum = 0
            for s in state:
                sum += s
            max_honest = max(max_honest, sum)
        return

    state[person] = 0
    dfs(person + 1)

    state[person] = 1 
    dfs(person + 1)
    

def solve():
    global state
    n = int(input())
    for _ in range(n):
        a = int(input())
        t = []
        for _ in range(a):
            x, y = [int(inp) for inp in input().split()]
            t.append((x - 1,y))
        testomonies.append(t)
    # print(testomonies)
    state = [-1] * n
    dfs(0)
    print(max_honest)


def main():
    solve()


if __name__ == "__main__":
    main()

Measured memory_bytes: 71480
//----------------------------templates
    #pragma GCC optimize ("Ofast")
    #pragma GCC target ("tune=native")
    #pragma GCC target ("avx")
    //----------------------------
    #include <bits/stdc++.h>
    using namespace std;

    typedef long long ll;
    typedef unsigned long long ull;
    #define int ll

    #define FOR(i,j,n) for (int i=(int)(j);i<(n);i++)
    #define REP(i,n) for (int i=0;i<(int)(n);i++)
    #define REPS(i,n) for (int i=1;i<=(int)(n);i++)
    #define REPN(i,n) for (int i=(int)(n)-1;i>=0;i--)
    #define REPNS(i,n) for (int i=(int)(n);i>0;i--)

    #define I(n) scanf("%lld", &(n))
    #define LL(n) scanf("%lld", &(n))
    #define pb(n) push_back((n))
    #define mp(i,j) make_pair((i),(j))
    #define eb(i,j) emplace_back((i),(j))
    #define y0 y3487465
    #define y1 y8687969
    #define j0 j1347829
    #define j1 j234892
    #define uniq(v) v.erase( unique(v.begin(), v.end()), v.end() )

    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())

    typedef vector<int> vi;
    typedef pair<int,int> pi;
    typedef vector<pi> vpi;
    typedef vector<vi> vvi;
    typedef vector<vpi> vvpi;
    typedef vector<vvi> vvvi;

    const int mod = 1000000007;

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

int n,m;
vpi edges;
vvpi neigh;
int a,b;
vector< bitset<50> > pathmask;

bitset<50> findpath(int u, int v){
    bitset<50> ans = 0;
    deque<int> q;
    vi parent(n, -1);

    parent[u] = -114514;
    q.pb(u);
    while(!q.empty()){
        auto p = q.back();
        q.pop_back();
        for( auto ch: neigh[p] ){
            auto ind = ch.first;
            if (parent[ind] != -1) continue;
            parent[ind] = p;
            q.push_back(ind);
        }
    }
    while( v != u ){
        int tempv = v;
        for(auto ch: neigh[v]){
            if (ch.first == parent[v]){
                ans[ch.second] = true;
                v = ch.first;
                break;
            }
        }
        assert( tempv != v );
    }
    return ans;
}

signed main(){
    I(n);
    neigh.resize(n);
    REP(i,n-1){
        I(a); I(b);
        a--; b--;
        edges.eb(a,b);
        neigh[a].eb(b,i);
        neigh[b].eb(a,i);
    }
    I(m);
    REP(i,m){
        I(a); I(b);
        a--; b--;
        pathmask.pb( findpath(a,b) );
    }

    int ans = 0;
    FOR(bit,1, 1LL << m){
        bitset<50> temp;
        REP(i, m) if( (bit >> i) & 1) temp |= pathmask[i];
        ans += (1LL << (n-1-temp.count())) * (__builtin_popcount(bit) % 2 == 1 ? 1 : -1);
    }
    cerr << ans << endl;
    cout << (1LL << (n-1)) - ans << endl;
}

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

using namespace std;

class DisjointSet {
    public:
        vector<int> rank, p, size;

        DisjointSet() {}
        DisjointSet(int n) {
            rank.resize(n, 0);
            p.resize(n, 0);
            size.resize(n, 0);
            for (int i = 0; i < n; ++i) init(i);
        }

        void init(int x) {
            p[x] = x;
            rank[x] = 0;
            size[x] = 1;
        }

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

        void makeSet(int x, int y) {
            if (isSame(x, y)) return;
            link(root(x), root(y));
        }

        void link(int x, int y) {
            if (rank[x] > rank[y]) {
                p[y] = x;
                size[x] += size[y];
            } else {
                p[x] = y;
                size[y] += size[x];
                if (rank[x] == rank[y]) {
                    rank[y]++;
                }
            }
        }

        int root(int x) {
            if (x != p[x]) {
                p[x] = root(p[x]);
            }
            return p[x];
        }

        int getSize(int x) {
            return size[root(x)];
        }
};

int main() {
    int n, q;
    cin >> n >> q;
    DisjointSet dj = DisjointSet(n);
    for (int i = 0; i < q; ++i) {
        int c, x, y;
        cin >> c >> x >> y;
        if (c) {
            cout << (dj.isSame(x, y) ? 1 : 0) << endl;
        } else {
            dj.makeSet(x, y);
        }
    }

    return 0;
}


Measured memory_bytes: 3248
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    long A = sc.nextLong();
    long B = sc.nextLong();
    System.out.println(lcm(A, B));
  }
  static long lcm(long A, long B){
    return A*B/gcd(A,B);
  }
  
  static long gcd(long A, long B){
    if(A < B){
      return gcd(B, A);
    }
    if(B == 0){
      return A;
    }
    return gcd(B, A%B);
  }
}

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

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);++i)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);--i)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
//constexpr long long MOD = (ll) 1e9 + 7;
constexpr long long MOD = 998244353LL;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve(){
	string s,t;
	cin>>s>>t;
	ll n=s.size();
	REP(i,n){
		string s2=s.substr(i,n-i)+s.substr(0,i);
		if(s2==t){
			cout<<"Yes"<<en;
			return;
		}
	}
	cout<<"No"<<en;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    solve();
    //ll t;cin>>t;REP(i,t) solve();

    return 0;
}

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

int main(){
  int n, m, A[100][100], b[100];
  for (int i = 0; i < 100 ; i++){
    for (int j = 0; j < 100 ; j++){
      A[i][j] = 0;
    }
    b[i] = 0;
  }

  cin >> n >> m;
  for (int i = 0; i < n ; i++){
    for (int j = 0; j < m ; j++){
      cin >> A[i][j];
    }
  }
  for (int i = 0; i < m ; i++){ cin >> b[i]; }

  int sum=0;
  for (int i = 0; i < n ; i++){
    for (int j = 0; j < m ; j++){
      sum += A[i][j] * b[j];
    }
    cout << sum << endl;
    sum = 0;
  }
  return 0;
}


Measured memory_bytes: 3136