akhauriyash/Code-Regression huggingface dataset:
/*
  The Island Was Silent before.
  .....
  And One day again it became Silent.
*/
#include<bits/stdc++.h>
using namespace std;
 
#define endl '\n'
#define ll  long long
#define modd(a,b) ((a+2*b)%b)
#define debug(a) cout << #a << ": " << (a) << "\n"
#define ioso ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define rtt cerr << "Time: " << clock()*1.0 / CLOCKS_PER_SEC << endl;
#define ffe freopen("input.txt","r",stdin), freopen("output.txt","w",stdout);
 
int main() {
  #ifndef ONLINE_JUDGE
  //ioso ffe
  #endif
  ll x, y; cin >> x >> y; 
  for(int i=0;i<=x;i++) {
    for(int j=0;j<=x;j++) {
      if(i+j == x) {
        if((j*2 + i*4 == y) or (j*4 + i*2==y)) {
          cout << "Yes\n"; return 0;
        }
      }
    }
  }
  cout << "No\n";
}

Measured memory_bytes: 3632
#in
n = input()
st = input()
hai = []
hai = st.split()
hai_l = [int(s) for s in hai]

ap_fg = 0

#配列を順に、偶奇を見る→割り切れるかで処理
for i in range(len(hai_l)) :

  #配列がの偶奇判定
	if (hai_l[i] % 2) == 0:
      #偶数
		if (hai_l[i] % 3) == 0 or (hai_l[i] % 5) == 0:
			ap_fg = ap_fg + 0
		else:
			print('DENIED')
			break
		
	#奇数
	else:
		ap_fg = ap_fg + 0
	    
	if ap_fg == 0 and i == len(hai_l)-1:
		print('APPROVED')
		
	



Measured memory_bytes: 38256
#include <bits/stdc++.h>
#include<algorithm>
 using namespace std;
 int main(){
     int x,a;
     cin>>x>>a;
     if(x<=9&&x>=0&&a<=9&&a>=0){
     if(x<a){
         std::cout << "0" << std::endl;
     }else{
         std::cout << "10" << std::endl;
     }
     }
 }

Measured memory_bytes: 3600
def main():
    N, K = map(int, input().split())
    mi, ma = 0, 0
    for i in range(K - 1):
        mi += i
        ma += N - i
    r = 0
    for i in range(K - 1, N + 1):
        mi += i
        ma += N - i
        r += ma - mi + 1

    return r % (10 ** 9 + 7)

print(main())


Measured memory_bytes: 9208
#include <cstdio>
#include <string.h>
using namespace std;
 
int main (void)
{
    int i, h, x, n, j;
    char a[201], b[201];
 
    while (scanf("%s", a) != EOF && a[0] != '-'){
        scanf("%d", &h);
        for (i=0; i<h; i++){
            x=0;
            scanf("%d", &n);
            for (j=n; a[j] != '\0'; j++)
                b[x++] = a[j];
            for (j=0; j<n; j++)
                b[x++] = a[j];
 
            strcpy (a, b);
            a[x] = '\0';
        }
        printf("%s\n", a);
    }
 
    return 0;
}

Measured memory_bytes: 1020
s = list(input())
alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for x in s:
    if x in alpha:
        alpha.remove(x)
print(alpha[0] if len(alpha)>0 else "None")

Measured memory_bytes: 3956
S=input()
N=len(S)
mod=[0 for i in range(2019)]
s=0
ten=1
for i in range(N-1,-1,-1): 
  s+=int(S[i])*ten
  mod2=s%2019
  mod[mod2]+=1
  ten=(ten*10)%2019
ans=0
for i in range(2019):
  k=mod[i]
  if i==0:
    if k>=2:
      ans+=k*(k-1)//2+k
    else:
      ans+=k
  else:
    if k>=2:
      ans+=k*(k-1)//2
print(ans) 

Measured memory_bytes: 9336
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int k,n,a,b,c,d,max_dis=0;
    cin>>k>>n;
    int i,x[n];
    for(i=0;i<n;i++)
    {
        cin>>x[i];
    }
    sort(x,x+n);
    max_dis=x[n-1]-x[0];
    int min_dis=k;
    for(i=1;i<n;i++)
    {
        int dis=(k-x[i])+x[i-1];
        if(dis<min_dis) min_dis=dis;
    }
    a=min(max_dis,min_dis);
    cout<<a<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <stdio.h>
#include <set>
#include <iomanip>
#include <sstream>
using namespace std;
int main(void){
    int n, r;
    cin>>n>>r;
    int ans=r;
    if(n>=10) {cout<<r<<endl;}
    else{
        r-= -100*(10-n);
        cout<<r<<endl;
    }
}


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

int main(){
  int x;
  int cnt1,cnt2;
  cin >> x;
  while(x >= 500){
    cnt1++;
    x-=500;
  }
  while(x >= 5){
    cnt2++;
    x-=5;
  }
  cout << cnt1 * 1000 + cnt2 * 5 << endl;
  return 0;
}

Measured memory_bytes: 256
package main

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

func generated_alib_swap(a int, b int) (int, int) {
    return b, a
}
func (u generated_alib_UnionFind) Size(x int) int {
    return -u.par[u.Find(x)]
}
func (u generated_alib_UnionFind) Union(x, y int) {
    xr := u.Find(x)
    yr := u.Find(y)
    if xr == yr {
        return
    }
    if u.Size(yr) < u.Size(xr) {
        yr, xr = generated_alib_swap(yr, xr)
    }
    u.par[yr] += u.par[xr]
    u.par[xr] = yr
}
func (u generated_alib_UnionFind) Find(x int) int {
    if u.par[x] < 0 {
        return x
    }
    u.par[x] = u.Find(u.par[x])
    return u.par[x]
}
func generated_alib_NewUnionFind(N int) *generated_alib_UnionFind {
    u := new(generated_alib_UnionFind)
    u.par = make([]int, N)
    for i := range u.par {
        u.par[i] = -1
    }
    return u
}

type generated_alib_UnionFind struct{ par []int }

func main() {
    r := bufio.NewReader(os.Stdin)
    w := bufio.NewWriter(os.Stdout)
    defer w.Flush()
    var n, m int
    fmt.Fscan(r, &n, &m)
    uf := generated_alib_NewUnionFind(n)
    for i := 0; i < m; i++ {
        var a, b int
        fmt.Fscan(r, &a, &b)
        a--
        b--
        uf.Union(a, b)
    }
    ans := 0
    for i := 0; i < n; i++ {
        if ans < uf.Size(i) {
            ans = uf.Size(i)
        }
    }
    fmt.Fprintln(w, ans)
}
/* this code was generated by the code below
package main

import (
   "bufio"
   "fmt"
   "os"

  alib "a/lib"
)

func main() {
   r := bufio.NewReader(os.Stdin)
   w := bufio.NewWriter(os.Stdout)
   defer w.Flush()

   var n, m int
   fmt.Fscan(r, &n, &m)
   uf := alib.NewUnionFind(n)

   for i := 0; i < m; i++ {
       var a, b int
       fmt.Fscan(r, &a, &b)
       a--
       b--

       uf.Union(a, b)
   }

   ans := 0
   for i := 0; i < n; i++ {
       if ans < uf.Size(i) {
           ans = uf.Size(i)
       }
   }

   fmt.Fprintln(w, ans)
}

*/

Measured memory_bytes: 6324
#include<bits/stdc++.h>
#define vi vector<int>
#include <algorithm>
#include <iterator>

using namespace std;

int main()
{

  int x,y,z;
   scanf("%d %d %d", &x, &y, &z);

   int tempx = x;
   int tempy = y;
   int tempz = z;

   x = y;
   y = tempx;

   int f = z;
   z = x;
   x = f;

   cout<< x << " "<< y<< " "<< z;
   return 0;


}


Measured memory_bytes: 256
/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

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

//-----------------------ここから-----------


int main(void){
	int n;
	cin >> n;
	vector<string> s(n);
	ll counter[5] = {0};
	for(int i = 0; i < n; i++){
		cin >> s[i];
		if(s[i][0] == 'M')counter[0]++;
		if(s[i][0] == 'A')counter[1]++;
		if(s[i][0] == 'R')counter[2]++;
		if(s[i][0] == 'C')counter[3]++;
		if(s[i][0] == 'H')counter[4]++;
	}

	ll ans = 0;
	ans += counter[0] * counter[1] * counter[2];
	ans += counter[0] * counter[1] * counter[3];
	ans += counter[0] * counter[1] * counter[4];
	ans += counter[0] * counter[2] * counter[3];
	ans += counter[0] * counter[2] * counter[4];
	ans += counter[0] * counter[3] * counter[4];
	ans += counter[1] * counter[2] * counter[3];
	ans += counter[1] * counter[2] * counter[4];
	ans += counter[1] * counter[3] * counter[4];
	ans += counter[2] * counter[3] * counter[4];

	cout << ans << endl;
}


Measured memory_bytes: 6144
#include <map>
#include <set>
#include <ctime>
#include <queue>
#include <stack>
#include <cmath>
#include <vector>
#include <bitset>
#include <cstdio>
#include <cctype>
#include <string>
#include <cstring>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std ;
#define rep(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define per(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define clr(a) memset(a, 0, sizeof(a))
#define ass(a, sum) memset(a, sum, sizeof(a))
#define lowbit(x) (x & -x)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define enter cout << endl
#define siz(x) ((int)x.size())
typedef long long ll ;
typedef unsigned long long ull ;
typedef vector <int> vi ;
typedef pair <int, int> pii ;
typedef map <int, int> mii ;
typedef map <string, int> msi ;
const int N = 3333 ;
const int INF = 0x3f3f3f3f ;
const int iinf = 1 << 30 ;
const ll linf = 2e18 ;
const int MOD = 1000000007 ;
void print(int x) { cout << x << endl ; exit(0) ; }
void PRINT(string x) { cout << x << endl ; exit(0) ; }
void douout(double x){ printf("%lf\n", x + 0.0000000001) ; }

string s ;
ll dp[N][N] ;
int n ;

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

/*
写代码时请注意：
	1.ll？数组大小，边界？数据范围？
	2.精度？
	3.特判？
	4.至少做一些
思考提醒：
	1.最大值最小->二分？
	2.可以贪心么？不行dp可以么
	3.可以优化么
	4.维护区间用什么数据结构？
	5.统计方案是用dp？模了么？
*/


Measured memory_bytes: 78464
#pragma once

#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;
string S;
long long int N, A, B ,X;
long long int myMax,myMin;
long long int result=0;




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

	if (A>=B) {
		cout << "delicious" << endl;
	}
	else if (A + X >= B) {
		cout << "safe" << endl;
	}
	else{
		cout << "dangerous" << endl;
	}
	
	

	return 0;
}




Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>

using namespace std;

const int INF = (1<<30) - 1;

bool is_left(char c){
    string l = "qwertasdfgzxcvb";
    for(char v: l)
        if(c == v)
            return true;
    
    return false;
}

int main(){
    //ios::sync_with_stdio(false);
    //cin.tie(0);
    string s;
    
    while(cin>>s, s!="#"){
        int cnt = 0;
        for(int i=0; i<s.length()-1; i++){
            cnt += is_left(s[i])^is_left(s[i+1]);
        }
        cout << cnt << endl;
    }
    return 0;
}

Measured memory_bytes: 1192
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>

using namespace std;


int main()
{
  int h, w;
  cin >> h >> w;

  vector<string> s(h);

  for(int i = 0; i < h; i++){
    cin >> s[i];
  }
  vector<vector<int>> cnt(h, vector<int>(w));

  for(int i = 0; i < h; i++){
    vector<int> done(w);
    for(int j = 0; j < w; j++){
      if(s[i][j] == '#')  continue;
      if(done[j]) continue;
      int l = 0;
      while(j+l < w){
        if(s[i][j+l] == '#')  break;
        l++;
      }
      for(int k = 0; k < l; k++){
        cnt[i][j+k] += l;
        done[j+k] = 1;
      }
    }
  }

  for(int j = 0; j < w; j++){
    vector<int> done(h);
    for(int i = 0; i < h; i++){
      if(s[i][j] == '#')  continue;
      if(done[i]) continue;
      int l = 0;
      while(i+l < h){
        if(s[i+l][j] == '#')  break;
        l++;
      }
      for(int k = 0; k < l; k++){
        cnt[i+k][j] += l;
        done[i+k] = 1;
      }
    }
  }

  int ans = 0;
  for(int i = 0; i < h; i++){
    for(int j = 0; j < w; j++){
      ans = max(ans, cnt[i][j]-1);
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 20096
import sys
sys.setrecursionlimit(int(1e6))

n=int(input())
l=[[0,0,0]]
for _ in range(n):
    l.append(list(map(int,input().split())))

memo=[[-1,-1,-1] for _ in range(n+1)]
memo[0][0]=0
memo[0][1]=0
memo[0][2]=0
def dp(i,j):
    if memo[i][j]!=-1:
        return memo[i][j]
    else:
        memo[i][j]=max(dp(i-1,(j+1)%3)+l[i][j],dp(i-1,(j+2)%3)+l[i][j])
        return memo[i][j]
s1=dp(n,0)
s2=dp(n,1)
s3=dp(n,2)
print(max(s1,s2,s3))

Measured memory_bytes: 123840
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define db double
#define ld long double
#define IOS  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#pragma GCC optimize(2)
#define ull unsigned long long
#define maxn 110
ll lcm(ll a,ll b){return a*b/__gcd(a,b);}
void dfs(){}
int a[maxn];
signed main()
{
    IOS
    int n,m;
    ll sum=0;
    cin>>n>>m;
    for (int i = 0; i <n ; ++i) {
        cin>>a[i];
        sum+=a[i];
    }
    int cnt=0;
    for (int j = 0; j <n ; ++j) {
        if(a[j]*4*m>=sum)cnt++;
    }
    if(cnt>=m)cout<<"Yes";
    else cout<<"No";
    return 0 ;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<=n;i++)
using namespace std;
int main(){
    int A,B,C,X,ans=0;
    cin>>A>>B>>C>>X;
    REP(i,A)REP(y,B)REP(j,C)if((i*500)+(y*100)+(j*50)==X)ans++;
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
	int a,b,d,r;
	double f,p,m;
	cin>>a>>b;
	p=a;
	m=b;
	d=a/b;
	r=a%b;
	f=p/m;
	cout<<d<<" "<<r<<" ";
	printf("%6f",f);
	cout<<endl;
	return 0;
}



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

int main() {
  int n,k;
  cin>>n>>k;
  string st;
  cin>>st;
  
  if(st.at(k-1)=='A'){
    st.at(k-1)='a';
  }else if(st.at(k-1)=='B'){
    st.at(k-1)='b';
  }else{
    st.at(k-1)='c';
  }
  cout<<st<<endl;
  
                           
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
	int A, B, C;

	cin >> A >> B >> C;

	if (A == B)
		cout << C << endl;
	else if (A == C)
		cout << B << endl;
	else
	{
		cout << A << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int keta(int x,int y){
    int i,result;
    result=x+y;
    for(i=1;result/10>=1;i++){
        result/=10;
    }
    return i;
}
int main(void){
    int a,b;
    while(scanf("%d %d",&a,&b)!=EOF){
        printf("%d\n",keta(a,b));
    }
    
    return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0; i<(n); i++)
const long long INF = numeric_limits<long long>::max();
int main()
{
    int n,m,ans=0;
    cin >>n>>m;
    vector<int> h(n+1),ma(n+1);

    rep(i,n){
        cin>>h[i+1];
        ma[i+1]=0;
    }
    rep(i,m){
        int a,b;
        cin>>a>>b;
        ma[a]=max(ma[a],h[b]);
        ma[b]=max(ma[b],h[a]);
    }
    rep(i,n){
        if(h[i+1]>ma[i+1]) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4024
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s1 = sc.next().toUpperCase();
		String s2 = sc.next().toUpperCase();
		String s3 = sc.next().toUpperCase();
		System.out.println(s1.charAt(0)+""+s2.charAt(0)+s3.charAt(0));
	}
}

Measured memory_bytes: 21844
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
#mod = 10 ** 9 + 7 
mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N = INT()
xy = [LIST() for _ in range(N)]
xy.sort(key = lambda x:(x[0], x[1]))

delta = defaultdict(int)
if N == 1:
	print(1)
else:
	for x, y in combinations(xy, 2):
		delta[(y[0]-x[0], y[1]-x[1])] += 1

	print(N - max(delta.values()))

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

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	int p[21];
	int res = 0;
	for (int i = 1; i <= n; i++)
		cin>>p[i];
	int a[21];
	for (int i = 1; i <= n; i++) {
		cin>>a[i];
		res += a[i];
	}
	int c[21];
	for (int i = 1; i <= n; i++)
		cin>>c[i];
	for (int i = 1; i < n; i++)
		if (p[i + 1] - p[i] == 1) res += c[p[i]];
	cout<<res;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
//#include "h.h"
using namespace std;

#define MOD 1000000007

#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define pm(first, second) pb(mp(first, second))
#define SPACE " "
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

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

ll calc(string str){
	ll ans = 0;
	ll tmp = 0;
	for(int i = 0; i < str.size(); i ++){
		if(str[i] == '+'){
			ans += tmp;
			tmp = 0;
		}
		else{
			tmp *= 10;
			tmp += str[i] - '0';
		}
	}
	return ans + tmp;
}
int main(){

	string S;
	cin >> S;
	ll bit = 0;
	ll ans = 0;
	while(true){
		string eq;
		for(int i = 0; i < S.size(); i ++){
			eq.pb(S[i]);
			if(bit & (1<<i)){
				eq.pb('+');
			}
		}
		ans += calc(eq);
		bit ++;
		if(bit >= pow(2, S.size() - 1))break;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

typedef unsigned long long ull;

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

    vector<ull> X(N);
    vector<ull> X2(N);
    for(int i=0;i<N;i++){
        cin >> X[i];
        X2[i] = X[i];
    }
    sort(X.begin(), X.end());

    ull m1 = X[N/2-1];
    ull m2 = X[N/2];

    for(int i=0;i<N;i++){
        if(X2[i] < m2){
            cout << m2 << endl;
        }
        else{
            cout << m1 << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 5376
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
constexpr ll mod = 1e9 + 7;
#define endl '\n'
 
int main() {
  ios::sync_with_stdio(0); cin.tie(0);
 
  ll D,T,S;
  cin >> D >> T >> S;
  if (double(D)/S <= T) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  

}


Measured memory_bytes: 3652
#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>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1LL << 60;

//---main---------------------------------------------
int main(){
    //main
    int N;
    cin >> N;
    int ans = 0,ai;
    rep(i,N){
        cin >> ai;
        if( i%2==0 && ai%2==1) ans++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using ii=pair<ll,ll>;
using vi=vector<ll>;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF (ll)1e18
#define all(x) (x).begin(),(x).end()
#define print(a); for(auto x:a)cout<<x<<" "; cout<<"\n";
#define mset(a); memset(a,0,sizeof(a));

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
    ll a,b,c;cin>>a>>b>>c;
    cout<<max(0ll,c-(a-b))<<"\n";
}


Measured memory_bytes: 256
#include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>

using namespace std;

typedef long long ll;
// constexpr ll MOD = 998244353;
constexpr ll MOD = 1000000007;

// struct UnionFind {
//     vector<int> par;
    
//     UnionFind(int N): par(N) {
//         for (int i=0;i<N;i++) par[i] = i;
//     }

//     int root(int x) {
//         if (par[x] == x) return x;
//         else return par[x] = root(par[x]);
//     }

//     void unite(int x, int y) {
//         int rx = root(x);
//         int ry = root(y);
//         if (rx == ry) return;
//         par[rx] = ry;
//     }

//     bool same(int x, int y) {
//         int rx = root(x);
//         int ry = root(y);
//         return rx == ry;
//     }
// };

int main(void) {
    ll A, B, K;
    cin >> A >> B >> K;
    if (A < K) {
        K -= A;
        A = 0;
        B = max(B-K,0LL);
    } else {
        A -= K;
    }
    cout << A << " " << B << endl;

    return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<n;i++)
#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long ll;
const int mod= 1e+9+7;

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


    for(int tmp=0;tmp<(1<<3);tmp++){
         int con=S[0]-'0';
         vector<char>c(3);
        bitset<3>a(tmp);
        for(int i=0;i<3;i++){
            if(a.test(i)){
                con-=S[i+1]-'0';
                c[i]='-';
            }
            else {
                con+=S[i+1]-'0';
                c[i]='+';
            }
        }
        if(con==7){
            cout<<S[0]<<c[0]<<S[1]<<c[1]<<S[2]<<c[2]<<S[3]<<"=7"<<endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<ll> VLL;
typedef vector<PLL> VP;
const static int INF = 1000000000;
const static int MOD = 1000000007;
const int dx[4]={1, 0, -1, 0};
const int dy[4]={0, 1, 0, -1};
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; }
#define rep(i,n) for (ll i=0; i<(ll)(n); i++)
#define repd(i,n) for (ll i=n-1; i>=0; i--)
#define rept(i,m,n) for(ll i=m; i<n; i++)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define PF push_front
#define PB push_back
#define SORT(V) sort((V).begin(), (V).end())
#define RVERSE(V) reverse((V).begin(), (V).end())
#define paired make_pair
#define PRINT(V) for(auto v : (V)) cout << v << " "
//charを整数に
int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; }
// 累積和 for (int i = 0; i < N; ++i) s[i+1] = s[i] + a[i]; 
void cum_sum(int N,vector<double> a, vector<double> &s){ for(int i=0; i<N; i++){ s[i+1]=s[i]+a[i];}}
//ユークリッドの控除法
ll gcd(ll a,ll b){
    if(b == 0) return a;
    return gcd(b,a%b);
}
//最小公倍数
ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b; // Be careful not to overflow
}
//素数判定
bool is_prime(long long n) {
    if (n <= 1) return false;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p == 0) return false;
    }
    return true;
}
int getdigit(ll num){
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}
//空白文字も入力 getline(cin, S);
//桁数指定 setprecision

int main()
{
    ios::sync_with_stdio(0); 
    cin.tie(0); 
    cout.tie(0);
    int N;
    cin >> N;
    VLL h(N);
    rep(i,N){
        cin >> h[i];
    }
    VLL ans(N, INF);
    ans[0]=0;
    rept(i,1,N){
        chmin(ans[i],ans[i-1]+abs(h[i]-h[i-1]));
        if(i>1){
            chmin(ans[i],ans[i-2]+abs(h[i]-h[i-2]));
        }
    }
    cout << ans[N-1] << endl;
}

Measured memory_bytes: 1792
//AC
#include<bits/stdc++.h>
using namespace std;
// #include "../../Template.cpp"

void solve() {
    string s, t; cin >> s >> t;
    int l1 = s.size();
    int l2 = t.size();
    vector<vector<int>> dp(l1+1, vector<int>(l2+1, 0));
    for(int i = 1; i <= l1; i ++) {
        for(int j = 1; j <= l2; j ++) {
            dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
            if(s[i-1] == t[j-1]) {
                dp[i][j] = max(dp[i][j], dp[i-1][j-1]+1);
            }
        }
    } 
    string ans = "";
    int currx = l1, curry = l2;
    while(currx>0 && curry>0) {
        if(s[currx-1] == t[curry-1]) {
            ans += s[currx-1];
            currx --;
            curry --;
        }
        else if(dp[currx-1][curry] > dp[currx][curry-1]) {
            currx --;
        }
        else {
            curry --;
        }
    }
    reverse(ans.begin(), ans.end());
    cout << ans << endl;
}

int32_t main() {
    solve();
    return 0;
}

Measured memory_bytes: 35584
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(){
  int N; cin >> N;
  vector<ll> A(N);
  for(int i = 0;i < N;i++)cin >> A[i];

  sort(A.begin(),A.end());
  reverse(A.begin(),A.end());

  ll l[2] = {0};
  int lcnt = 0;

  for(int i = 0;i < N-1;i++){
    if(A[i] == A[i+1]){
      l[lcnt] = A[i];
      lcnt++;
      i++;
    }

    if(lcnt == 2)break;
  }

  cout << l[0] * l[1] << endl;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i, n) for(ll i=1;i<=(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define INF 1000000000

void solve_zenkoku1_b() {
	ll N;
	string A, B, C;

	cin >> N >> A >> B >> C;

	ll ans = 0;
	ll cnt = 0;
	rep(i, N) {
		cnt = 0;
		if (A[i] == B[i]) {
			cnt++;
		}
		if (B[i] == C[i]) {
			cnt++;
		}
		if (C[i] == A[i]) {
			cnt++;
		}

		if (cnt == 0) ans += 2;
		else if (cnt == 1) ans += 1;
	}

	cout << ans << "\n";
}

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

	solve_zenkoku1_b();

	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int a = sc.nextInt();
		int count = 0;

		while(h > 0) {
			h -= a;
			count++;
		}
		System.out.println(count);
	}

}

Measured memory_bytes: 21844
/* You are being watched. */


//~ while (clock() <= 69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")

#include <bits/stdc++.h>

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

using namespace std;

//~ #include <ext/pb_ds/assoc_container.hpp>
//~ #include <ext/pb_ds/tree_policy.hpp>
//~ using namespace __gnu_pbds;
//~ template <typename T>
//~ using ordered_set =
  //~ tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(x) (x).begin(), (x).end()
#define show(x) cerr << __LINE__ << " says: " << #x << " = " << (x) << "\n"
#define FastIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
//using li = __int128;
//using uli = unsigned __int128;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

double getTime() {
  return clock() / (double) CLOCKS_PER_SEC;
}

void read() {};

template<typename T, typename... Args>
void read(T& a, Args&... args) {
  cin >> a;
  read(args...);
}

void print() {};

template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " \n"[sizeof...(args) == 0];
  print(args...);
}

void solve() {
  ll a, b, c; cin >> a >> b >> c;
  ll k; cin >> k;
  ll ans = min(a, k);
  k -= min(a, k);
  k -= min(b, k);
  ans -= min(c, k);
  print(ans);
}

int main() {
  int t; t = 1;
  while(t--) solve();
}


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

int main(){
	string w,t;
	int count=0;

	cin>>w;
	while(1){
		cin>>t;
		if(t == "END_OF_TEXT") break;
		for (int i = 0; i < t.length(); i++){
    	if (isupper(t[i])){
      	t[i] = tolower(t[i]);
      }
    }
    if (t == w) count++;
	}
	cout << count << endl;
	
	return 0;
}

Measured memory_bytes: 3184
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <ctime>
////
//#include <random>//
/////////

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

////定数
const int INF = (int)1e9 + 10;
const LL MOD = (LL)1e9 + 7;
const LL LINF = (LL)4e18 + 20;
const LD PI = acos(-1.0);
const double EPS = 1e-9; 
/////////
using namespace::std;
void chmax(LL& a, LL b) {
	a = max(a, b);
}
void chmin(LL& a, LL b) {
	a = min(a, b);
}
//////////////

void solve() {
	int N;
	cin >> N;
	vector<int> A(N);
	vector<int> B(N);
	vector<int> C(N);
	for (int i = 0; i < N; ++i) {
		cin >> A[i];
	}sort(A.begin(), A.end());
	for (int i = 0; i < N; ++i) {
		cin >> B[i];
	}sort(B.begin(), B.end());
	for (int i = 0; i < N; ++i) {
		cin >> C[i];
	}sort(C.begin(), C.end());
	/////

	vector<LL > BB(N, 0);
	vector<int>:: iterator itr;
	for (int i = 0; i < N; ++i) {
		int index = upper_bound(C.begin(), C.end(), B[i]) - C.begin();
		BB[i] = N - index;
	}

	for (int i = N - 1; i> 0; --i) {
		BB[i - 1] += BB[i];
	}
	
	LL ans = 0;
	for (int i = 0; i < N; ++i) {
		int index = upper_bound(B.begin(), B.end(), A[i]) - B.begin();
		if (index < N) {
			ans += BB[index];
		}
	}
	cout << ans << endl;
}

signed main(void) {
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}


Measured memory_bytes: 2176
nt =gets.split.map { |e|e.to_i  }
array =gets.split.map { |e|e.to_i }
x = 1
answer =[0]
while x < nt[0]
 if array[x]-array[x-1] >=  nt[1]   then
  answer.push(nt[1])
  else answer.push(array[x]-array[x-1])

 end
x = x +1
end
puts (answer.inject(:+)+ nt[1] )


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

namespace ProgramingStydying
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split().Select(long.Parse).ToArray();
            var flag = 0;
            var ans = 0;

            while (flag == 0)
            {
                for (int i = 0; i < n; i++)
                {
                    if (a[i] % 2 != 0)
                    {
                        flag = 1;
                        break;
                    }
                    else
                    {
                        a[i] /= 2;
                    }
                }
                if (flag == 0)
                {
                    ans++;
                }
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 28392
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const double PI=3.14159265358979323846;
int main(){
    ll N,M; cin>>N>>M;
    ll ans=0;
    vector<ll>A(M,0);
    for(ll i=0;i<M;i++){
        cin>>A[i];
        ans+=A[i];
    }
    if(ans<=N){
        cout<<N-ans;
    }
    else{
        cout<<-1;
    }
    return 0;
}

Measured memory_bytes: 3708
N = int(input())
As = list(map(int, input().split()))
now = As[0]
shape = 0
ans = 1
for i in As:
    if shape == 0:
        if i  > now:
            shape = 1
            now = i
        elif i < now:
            shape = 2
            now = i
    elif shape == 1:
        if i < now:
            shape = 0
            now = i
            ans += 1
        else:
            now = i
    else:
        if i > now:
            shape = 0
            now = i
            ans += 1
        else:
            now = i
print(ans)

Measured memory_bytes: 14252
import java.util.Scanner;

/**
 * https://abc046.contest.atcoder.jp/tasks/arc062_b
 */
public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();
		
		int p = 0;
		int g = 0;
		int count = 0;
		for(int i=0; i<s.length; i++){
			switch(s[i]){
			case 'p':
				if(p<g){
					p++;
				}else{
					g++;
					count--;
				}
				break;
			case 'g':
				if(p<g){
					p++;
					count++;
				}else{
					g++;
				}
			}
		}
		
		System.out.println(count);

	}

}

Measured memory_bytes: 26712
'use strict'

function main(s) {

  s = s.split('\n')[0].split(' ').map(n => Number(n));
  const N = s[0];
  const K = s[1];

  let num = K;

  for (let i = 0; i < N - 1; i++) {
    num = num * (K - 1);
  }

  console.log(num);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long x[200020], y[200020];
vector<long long> vec, vec1;
int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
        vec.emplace_back(x[i] - y[i]);
        vec1.emplace_back(x[i] + y[i]);
    }
    sort(vec.begin(), vec.end());
    sort(vec1.begin(), vec1.end());
    long long l = abs(vec[vec.size() - 1] - vec[0]);
    long long r = abs(vec1[vec1.size() - 1] - vec1[0]);
    cout << max(l, r) << endl;
}


Measured memory_bytes: 9676
#include <bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int x, y;
	cin>>x>>y;
	if(2*x<=y && y<=4*x && y%2==0){
		cout<<"Yes";
	}
	else cout<<"No";
}

Measured memory_bytes: 3652
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int MOD = 1e9+7, MAX = 1e9, larg = 1e5, INF = -1e9;
long long A,B,C,D,E,F,G,H,I,J,K,L,N,M,O,P,Q,R,S,T,U,V,W,X,Y,Z;
long long max_value = INF, max_index = -1;
long long min_value = MAX, min_index = -1;
long long sum = 0;

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

int main() {
    cin >> N;
    vector<Pa> vec;
    rep(i, N){
        cin >> A;
        vec.push_back(make_pair(A, i+1));
    }
    sort(vec.begin(), vec.end());
    rep(i, N){
        cout << vec[i].second << " ";
    }
}


Measured memory_bytes: 1780
# coding: utf-8
# Your code here!
N=int(input())
X=list(map(int,input().split()))

XX=sorted(X)

for item in X:
    if item<=XX[len(XX)//2-1]:
        print(XX[len(XX)//2])
    else:
        print(XX[len(XX)//2-1])

Measured memory_bytes: 26772
import itertools
def main():
    a=list(map(int,input().split()))
    for i in a:
        if i%2==0:
            print(0)
            return
    ans = float("inf")
    for x in itertools.combinations(a, 2):
        d = 1
        for y in x:
            d *= y
        ans = min(ans, d)
    print(ans)
    
if __name__ == "__main__":
    main()

Measured memory_bytes: 9192
import java.text.ParseException;
import java.util.Scanner;

public class Main {

	public static void main(String[] arges) throws ParseException {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(line);
		int s = v % 60;

		int h = v / 3600;
		int m =( v - h * 3600) / 60;
		System.out.println(h + ":" + m + ":" + s);
	}
}

Measured memory_bytes: 26036
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
typedef long long ll;
int main()
{
    int a,b;
    cin >> a >> b;
    cout << max(a-b,max(a+b,a*b))<<endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Abc
{
    class QuestionJ
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 文字列の入力
            string str_S = Console.ReadLine();

            var num_Length = str_S.Length;

            var num_End = (num_Length - 1) / 2;
            var num_Start = (num_Length + 3) / 2;

            var str_New01 = str_S.Substring(0, num_End);

            var str_New02 = str_S.Substring(num_Start - 1);


            if (str_New01 == str_New02) Console.WriteLine("Yes");
            else Console.WriteLine("No");

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define pb push_back
#define sz(x) (int)(x).size()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;


int main() {
  int n, m;
  cin >> n >> m;
 
  vi v(m), diff(m-1);
  rep(i, m){
    cin >> v[i];
  }
  sort(rng(v));
  srep(i, 1, m){
    diff[i-1] = abs(v[i]-v[i-1]);
  }
  sort(rng(diff));
  ll ans=0;
  srep(i, 0, m-n){
    ans += diff[i];
  }
  cout << ans << endl;
  return 0;
  
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int a,b,c;
    cin >> a >>b >> c;
    swap(a, b);
    swap(a, c);
    cout << a << " " << b << " " << c << endl;
}


Measured memory_bytes: 256
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
 
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
 
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
 
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define f(i, n) for(int i = 0; i < n; ++i)
#define pb push_back
#define eb emplace_back
#define m_p make_pair
#define T int t = 0; cin >> t; while(t--)
#define pr(a) for(int i = 0; i < (int)a.size(); ++i)cout << a[i] << " ";cout << endl;
#define b_e(a) a.begin(), a.end()
typedef long long ll;
typedef long double lld;
const ll mod = 1e9 + 7;
const ll mx = 2e6 + 1;
const ll inf = 1e9;
const int sz = 27;
ll dp[mx][sz];
ll fact[mx];
void initialize(){
    fact[0] = fact[1] = 1LL;
    for(ll i = 2; i < mx; ++i)fact[i] = fact[i - 1] * i % mod;
}
ll power(ll x, ll y){
    ll res = 1;
    x %= mod;
    while(y > 0){
        if(y & 1LL)res = res * x % mod;
        y >>= 1LL;
        x = x * x % mod;
    }
    return res;
}
ll inverse(ll x){
    return power(x, mod - 2);
}
ll ncr(ll n, ll r){
    return fact[n] * inverse(fact[r] * fact[n - r] % mod) % mod;
}
char cha(int x){
    return (char)(x + 97);
}
void input(){
    IOS;
    initialize();
    ll k;cin >> k;
    string s;
    cin >> s;
    int len = (int)s.size();
    ll n = k + len;
    ll ans = 0;
    for(ll m = 0; m < len; ++m){
        ans = (ans + ncr(n, m) * power(25LL, n - m) % mod ) % mod;
    }
    cout << ((power(26, n) - ans) % mod + mod) % mod << endl;;
}
int main(){
    input();
    return 0;
} 
/*
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
*/

Measured memory_bytes: 19828
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = input()
    ans = 1000
    for i in range(len(S) - 2):
        s = int(S[i:i + 3])
        ans = min(ans, (abs(s - 753)))
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9188
#include <bits/stdc++.h>
 using namespace  std;
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
const long double pi=3.1415926535897932384626433832;
const long long mod=1e9+7;
//long long primeset[5000000]={};
typedef complex<double> cd;
typedef long long ll;
//#define For(i,0,n) for(long long i = 0 ; i<n ;i++) 
cd fast_exp(cd a, long long b)
{
	if (b == 0)
		return 1;
	
	cd res = fast_exp(a, b / 2);
		
	res = res * res;
	
	if (b % 2 == 1)
		res = res * a;
	
	return res;
}

long long fastexpon(long long a,long long b,long long mod)
{
	if(b==0)
		return 1;
	
	long long res=fastexpon(a,b/2,mod);
	
	res=(res*res)%mod;
	if(b%2==1)
		res= (res * a)%mod;

	return res;
}
int a[25][25]={};
int n;
int dp[2100000];
int full_partner; 
int numberOfways(int state)
{
	//cout<<"state = "<<state<<" full_partner ="<<full_partner<<'\n';
	if(dp[state]>=0)
		return dp[state];
	if(state == full_partner)
		{
			dp[state]=1;
			return 1;
		}	
	int marriedmen=0;
	for(int i=1 ; i<=state ;i=i*2)
	{
		if((state & i) >0)
			marriedmen++;
	}
	int cur=1;
	int ways=0;
	//cout<<"marriedmen = "<<marriedmen<<'\n';

	for(int i=0 ;i<n ;i++)
	{

		if(i!=0)
			cur=cur*2;
		
		if(a[marriedmen][i] == 1 && (state&cur) == 0   )
		{
			//cout<<"i = "<<i<<"  cur = "<<cur<<"  a[][]=  "<<a[marriedmen][i]<<"   "<<(state&cur)<<'\n';
			//cout<<"heyyyyy";
			ways= (  ways+numberOfways( (state|cur) )   )%mod ;
		}


	}
	dp[state]=ways;
	return dp[state];

}
int main()
{
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n;
	
	full_partner = (1<<n)-1;
	for(int i=0 ;i<n ;i++)
	{
		for(int j=0 ; j<n ;j++)
		{
			cin>>a[i][j];
		}
	}
	for(int i=0 ;i<2100000 ;i++)
	{
		dp[i]=-1;
	}	
	cout<<numberOfways(0)<<'\n';
	//for(int i=0 ;i<20 ;i++)
		//cout<<"dp "<<i<<" =  "<<dp[i]<<'\n';
	//cout<<'\n'<<"time elapsed: "<<clock()*1000.0 / CLOCKS_PER_SEC<<" ms"<<'\n';
	return 0;
}

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

int main(void)
{
	int A, B, C, D;
	cin >> A >> B >> C >> D;

	vector<int> table(200, 0);
	table[A]++;
	table[B]--;
	table[C]++;
	table[D]--;

	int ret = 0;
	int sum = 0;
	for(int i=0; i<200; i++)
	{
		sum += table[i];
		if(sum > 1)
			ret++;
	}

	cout << ret << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

template<class T> ostream& operator<<(ostream &os, vector<T> V) {
 os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
	return os << "(" << P.first << "," << P.second << ")";}

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


#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define I insert 
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define vi vector<int>
#define pii pair<int, int>
#define vpii vector< pii >


// int mod=1e9+7;
// inline int mul(int a,int b){return (a*1ll*b)%mod;}
// inline int add(int a,int b){a+=b;if(a>=mod)a-=mod;return a;}
// inline int sub(int a,int b){a-=b;if(a<0)a+=mod;return a;}
// inline int power(int a,int b){int rt=1;while(b>0){if(b&1)rt=mul(rt,a);a=mul(a,a);b>>=1;}return rt;}
// inline int inv(int a){return power(a,mod-2);}
// inline void modadd(int &a,int &b){a+=b;if(a>=mod)a-=mod;} 

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout<<setprecision(25);
	ll n;cin>>n;
	set<ll> S;
	int i,j,k;
	int a;
	vll v;
	for(i=0;i<n;i++){
		cin>>a;
		if(S.find(a)!=S.end()){
			S.erase(a);
			v.pb(a);
		}
		else{
			S.I(a);
		}

	}	
	if(v.size()<2)cout<<0;
	else{
		sort(v.begin(), v.end(), greater<ll>());
		cout<<v[0]*v[1];
	}
}


Measured memory_bytes: 4992
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <set>
#include <assert.h>
#include <sstream>
#include <string>
//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater <>())
#define rn return
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
using namespace std;
using ll = long long;
typedef std::pair<ll,ll> P;
//#include <boost/multiprecision/cpp_int.hpp>
//using bint = boost::multiprecision::cpp_int;


int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    rep(i,n){
        if (a[i] %2==0){
            if(a[i]%5 != 0 && a[i]%3 !=0){
                cout << "DENIED";
                rn 0;
            }
        }
    }
    cout << "APPROVED";
}



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

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

	ll x;cin >> x;
	ll k;cin >> k;
	ll d;cin >> d;

	ll absx = x;
	if(absx < 0){
		absx *= -1;
	}

	if(absx/d > k){
		cout << (absx - k*d) << endl;
	}else{
		ll tk = k - (absx/d);
		ll ans;
		if(tk%2==0){
			ans = absx%d;
		}else{
			ans = absx%d - d;
		}
		if(ans < 0){
			ans *= -1;
		}
		cout << ans << endl;
	}
	return 0;
}

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

Measured memory_bytes: 580