akhauriyash/Code-Regression huggingface dataset:
// D.cpp
#include <bits/stdc++.h>
typedef double ld;

using namespace std;

const ld Pi = acos(-1.0);

ld a, b, V;

int main()
{
    cin >> a >> b >> V;
    if (V < a * a * b / 2)
    {
        ld ops = (V / (a * b)) * 2;
        printf("%.9lf", atan(b / ops) * 180.0 / Pi);
    }
    else
    {
        ld x = 2.0 * (ld(b) - (ld(V) / ld(a * a)));
        printf("%.9lf", atan(x / a) * 180.0 / Pi);
    }
    return 0;
}

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

int main(){
    int n; cin >> n;
    vector<ll> a(n);
    bool zero_check = false;
    int minuscount = 0;
    ll sum = 0;
    ll minimum_number = 1e10+1;
    rep(i,n){
        cin >> a.at(i);
        sum += abs(a.at(i));
        minimum_number = min(minimum_number,abs(a.at(i)));
        if(a.at(i) < 0) minuscount++;
    }
    if(minuscount%2==0){
        cout << sum << endl;
    }else{
        cout << sum - 2 * minimum_number << endl;
    }
}

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

int main(){
    int N;
    cin >> N;
    vector<ll> A(N+1),B(N);
    rep(i,N+1) cin >> A[i];
    rep(i,N) cin >> B[i];
    ll res = 0;
    rep(i,N){
        if(A[i] - B[i]>=0){
            A[i] -= B[i];
            res += B[i];
            B[i] = 0;
        }else{
            B[i] -= A[i];
            res += A[i];
            A[i] = 0;
        }
        if(B[i]>0){
            if(A[i+1] - B[i]>=0){
                A[i+1] -= B[i];
                res += B[i];
                B[i] = 0;
            }else{
                B[i] -= A[i+1];
                res += A[i+1];
                A[i+1] = 0;
            }      
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 1792
package main

import "fmt"

func pow(a, b int) int {
	if b == 0 {
		return 1
	}
	return a * pow(a, b-1)
}

func main() {
	var D, N int
	fmt.Scan(&D, &N)
	
	if N == 100{
		N++
	}

	fmt.Println(N * pow(100, D))
}


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

#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
#define CININIT cin.tie(0),ios::sync_with_stdio(false)
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

constexpr ll mod = 1e9+7;

int main(){
    ll N;cin>>N;
    vector<ll> A(N);
    rep(i,N) cin>>A[i];

    ll ans=0;
    ll last=1;
    for(int i=0;i<N;i++){
        if(A[i]>last){
            ans += (A[i]-1) / last;
            if(last==1) last++;
        }else if(A[i]==last){
            last++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define ARRAY_LENGTH(array) sizeof(array)/sizeof(*array)
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; }
const int INF = 1000100100;

ll N;
vector<ll> H;
vector<ll> dp;

int main() {
    cin >> N;
    H.resize(N);
    dp.resize(N);

    REP(i, N) {
        cin >> H[i];
    }

    dp[0] = 0;
    for(ll i = 1; i < N; ++i) {
        if(H[i - 1] >= H[i]) {
            dp[i] = dp[i - 1] + 1;
        } else {
            dp[i] = 0;
        }
    }

    ll ans = 0;
    REP(i, N) {
        if(dp[i] > ans) {
            ans = dp[i];
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4796
import numpy as np

a,b,x = map(int, input().split())
max_ = 0
check = 0

if((2*x/a)>a*b):
    check = a*b - (x/a)
    max_ = 2*check/a
    max_ = max_/a
    max_ = np.arctan(max_)*180/(np.arctan(1)*4)
    print(max_)
else:
    check = 2*x/a/b
    max_ = b/check
    max_ = np.arctan(max_)*180/(np.arctan(1)*4)
    print(max_)

Measured memory_bytes: 21492
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iomanip>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<utility>
#include<algorithm>
#include<cctype>
#include<set>
#include<map>
#include<bitset>
#include<stack>
#include<ctime>

using namespace std;

typedef long long ll;
typedef short int si;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<pli> vpli;

#define st first
#define nd second
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REV(a) reverse(a.begin(),a.end())
#define SORT(a) sort(a.begin(),a.end())
#define inf (int)1e9
#define linf (ll)1e18

int n,a,b;

int main() {
		ios::sync_with_stdio(false);
		cin>>n>>a>>b;
		cout<<min(n*a,b)<<endl;


		return 0;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
typedef long long ll;

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

Measured memory_bytes: 256
function Main(input) {
  input=input.split("\n");
  if(input[input.length-1]===''){
    input.pop();
  }
  const N=input[0]-0;
  const X=input[1].split(' ').map(e=>{
    return e-0;
  });
  var sum=0;
  X.forEach(e=>{
    sum+=e;
  });
  var p=Math.round(sum/N);
  sum=0;
  X.forEach(e=>{
    sum+=(e-p)**2;
  });
  console.log(sum);
}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  



  


Measured memory_bytes: 30596
l = input().split()
#print(l.count("your"))
hindo_max = 0
len_max = 0
for word in l:
	if hindo_max < l.count(word):
		hindo_max = l.count(word)
		hindo_word = word
	if len_max < len(word):
		len_max = len(word)
		len_word = word
print(hindo_word, len_word)

Measured memory_bytes: 7432
import collections
S = input()
T = input()
scounter = collections.Counter(S)
tcounter = collections.Counter(T)
scounter_v = dict(scounter).values()
tcounter_v = dict(tcounter).values()
sdist = sorted([i for i in scounter_v])
tdist = sorted([i for i in tcounter_v])
if sdist == tdist:
  print("Yes")
else:
  print("No")


Measured memory_bytes: 41712
#include <iostream>

using namespace std;

int main(){
  int n,m,l,i,j,k;
  cin >> n >> m >> l;
  long long a[n][m],b[m][l],c[n][l];
  for (i=0;i<n;i++) {
    for (j=0;j<m;j++) {
      cin >> a[i][j];
    }
    for (j=0;j<l;j++) {
      c[i][j]=0;
    }
  }
  for (i=0;i<m;i++) {
    for (j=0;j<l;j++) {
      cin >> b[i][j];
      for (k=0;k<n;k++) {
        c[k][j]+=a[k][i] * b[i][j];
      }
    }
  }
  for (i=0;i<n;i++) {
    for (j=0;j<l;j++) {
      cout << c[i][j];
      if (j<l-1) cout << " ";
    }
    cout << endl;
  }
  return 0;
}



Measured memory_bytes: 3308
n = input()
if n[-1] == '2' or n[-1] == '4' or n[-1] == '5' or n[-1] == '7' or n[-1] == '9':
  print('hon')
elif n[-1] == '0' or n[-1] == '1' or n[-1] == '6' or n[-1] == '8':
  print('pon')
else:
  print('bon')

Measured memory_bytes: 61628
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <map>
using namespace std;

typedef long long ll;

#define INF 10e10
#define rep(i,n) for(int i=0; i<n; i++)
#define rep_r(i,n,m) for(int i=m; i<n; i++)
#define MAX 100
#define MOD 1000000007
#define pb push_back

/* add vars here */

vector<string> s;

/* add your algorithm here */

int main() {
  int n;
  cin >> n;
  rep(i,n) {
    string t;
    cin >> t;
    s.pb(t);
  }

  map<char,int> m;

  rep(i,s[0].size()) {
    m[s[0][i]]++;
  }


  for (int i = 1; i < s.size(); ++i) {
    map<char,int> tm;
    for (int j = 0 ; j < s[i].size(); ++j) {
      char t = s[i][j];
      tm[t] += 1;
    }

    for (auto itr = m.begin(); itr != m.end(); ++itr) {
      char v = itr->first;
      int c = itr->second;

      if (tm[v] != c) {
        if (tm[v] == 0) {
          itr->second = 0;
        } else if (tm[v] < c){
          itr->second = tm[v];
        }
      }
    }
  }

  for (int i = 0; i < 26; ++i) {
    int t = 'a' + i;
    for (int i = 0; i < m[t]; ++i) {
      cout << (char)t;
    }
  }

  cout << endl;
}


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

int main()
{
  int n,i,count=1;
  char *s;

  scanf("%d",&n);
  s = calloc(n,sizeof(int));

  scanf("%s", s);

  for(i=1; i<n; i++)
  {
    if(s[i] == s[i-1])
      continue;
    else
      count++;
  }

  printf("%d", count);

  free(s);
  return 0;
}


Measured memory_bytes: 1736
#include <bits/stdc++.h>
#define int long long int
#define endl "\n"
#define loop(i,n) for(int i=0;i<n;i++)
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fileread freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define pb push_back
#define mp make_pair
#define itr iterator
#define fi first
#define se second
#define pii pair<int,int>
#define pci pair<char,int>
#define u_map unordered_map
#define u_set unordered_set
#define u_mmap unordered_multimap
#define u_mset unordered_multiset
# define pi 3.14159265358979323846
using namespace std;

signed main() {
	/*
	----------
	----------
	----------
	----------
	----------
	----------
	----------
	----------
	----------
	----------
	----------
	----------
	----------
	----------
	*/
    
    int n,alice=0,bob=0;
    cin>>n;
    int arr[n];
    loop(i,n) cin>>arr[i];
    sort(arr,arr+n,greater<int>());
    //loop(i,n) cout<<arr[i]<<" ";
    //cout<<endl;
    for(int i=0;i<n;i++){
        if(i%2==0) alice+=arr[i];
        else bob+=arr[i];
    }
    //cout<<alice<<" "<<bob<<"\n";
    cout<<alice-bob;
    
    
    
    
    
    
    
    
    
    
    
    
    
   
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define fst first
#define scd second
int main()
{
	int q, n = 0;
	string s;
	deque<char> u;
	cin >> s >> q;
	for(char i : s)
	{
		u.push_back(i);
	}
	for(int i = 0, t, f; i < q; ++i)
	{
		cin >> t;
		if(t == 1)
		{
			n = !n;
		}
		else
		{
			char c;
			cin >> f >> c;
			--f;
			if(n ^ f)
			{
				u.push_back(c);
			}
			else
			{
				u.push_front(c);
			}
		}
	}
	if(n)
	{
		for(int i = u.size() - 1; i >= 0; --i)
		{
			cout << u[i];
		}
		cout << "\n";
	}
	else
	{
		for(char i : u)
		{
			cout << i;
		}
		cout << "\n";
	}
}

Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AtCoder
{
    class Program
    {
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        static int Gcd(int a, int b)
        {
            return (a < b) ? Gcd(b, a)
                 : (b > 0) ? Gcd(b, a % b)
                           : a;
        }

        static int Solve(int N, int[] A)
        {
            int[] gcd1 = new int[N];
            gcd1[0] = A[0];
            for (int i = 1; i < N; ++i) { gcd1[i] = Gcd(gcd1[i - 1], A[i]); }

            int[] gcd2 = new int[N];
            gcd2[N - 1] = A[N - 1];
            for (int i = N - 2; i >= 0; --i) { gcd2[i] = Gcd(gcd2[i + 1], A[i]); }

            int max = Math.Max(gcd1[N - 2], gcd2[1]);
            for (int i = 1; i <= N - 2; ++i)
            {
                max = Math.Max(Gcd(gcd1[i - 1], gcd2[i + 1]), max);
            }
            return max;
        }

        static void Main(string[] args)
        {
            int N = ReadInt();
            int[] A = ReadInts();
            Console.WriteLine(Solve(N, A));
        }
    }
}


Measured memory_bytes: 25820
#!/usr/bin/env python3
import sys
INF = float("inf")


def yes():
    print("Yes")  # type: str


def no():
    print("No")  # type: str


def solve(K: int, X: int):
    if 500*K >= X:
        yes()
    else:
        no()

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    solve(K, X)


if __name__ == '__main__':
    main()


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

int main()
{

    int N;
    cin >> N;
    vector<int> X(N);
    for (int i = 0; i < N; ++i){
        cin >> X.at(i);
    }
    int ans = 1e9;
    for (int i = 1; i <= 100; ++i){
        int sum = 0;
        for (int j = 0; j < N; ++j){
            sum += pow(X.at(j) - i, 2);
        }
        ans = min(ans, sum);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<string>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int main(){
    char a;
    char b;
    cin>>a>>b;
    if (a>b) cout<<">"<<endl;
        else if (a==b) cout<<"="<<endl;
             else cout<<"<"<<endl;
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
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;
}
int64_t abs(int64_t n) {
  if (n < 0) {
    n = -n;
  }
  return n;
}

int main() {
  string s;
  cin >> s;
  rep(i, s.size()) {
    cout << 'x';
  }
  cout << endl;
}

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

using namespace std;
typedef pair<int,int> pii;
typedef long long int ll;

#define INF 1 << 29
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)



vector<bool> gen_sosuu(vector<bool> sosuu){
  int size = sosuu.size();
  REP(i,size){
    sosuu[i] = true;
  }
  sosuu[0] = false;
  sosuu[1] = false;
  sosuu[2] = true;
  FOR(i,2,sqrt(size)+1){
    if(sosuu[i] == false) continue;
    for(int j = 2; i*j<size;j++){
      sosuu[i*j] =false;
    }
  }
  return sosuu;
}

char s[6] = "aiueo";
char c;

int main(){
  cin >> c;
  REP(i,5){
    if(c==s[i]){
      cout <<"vowel" <<endl;
      return 0;
    }
  }
  cout <<"consonant"<<endl;
}


Measured memory_bytes: 256
/**
 * @author Video Vocabulary
 * @date 2020-06-27 18:00:52
 */
#include <bits/stdc++.h>

using namespace std;

void solve() {
}

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

    long long a;
    cin >> a;
    a += a*a + a*a*a;
    cout << a << endl;
}


Measured memory_bytes: 3648
fun main(args: Array<String>) = p17()

fun p17() {
    data class Rc(val row: Int, val column: Int)

    val k = readLine()!!.toInt()
    val inputs = Array(k) {
        val (r, c) = readLine()!!.split(' ').map { it.toInt() }
        Rc(r, c)
    }

    fun isValid(perm: List<Int>): Boolean {
        val leftToUp = mutableSetOf<Int>()
        val leftToDown = mutableSetOf<Int>()
        perm.forEachIndexed { row, column ->
            if (!leftToUp.add(row + column)) return false
            if (!leftToDown.add((7 - row) + column)) return false
        }
        return true
    }

    permutations((0..7).toList()).forEach { perm ->
        if (inputs.any { perm[it.row] != it.column } || !isValid(perm)) return@forEach
        
        val grid = Array(8) { CharArray(8) { '.' } }
        perm.forEachIndexed { index, i -> grid[index][i] = 'Q' }
        return println(grid.joinToString(System.lineSeparator()) { it.joinToString("") })
    }

    error("なんで？")
}

private fun permutations(src: List<Int>): List<List<Int>> {
    if (src.size == 1) return listOf(src)
    val perms = mutableListOf<List<Int>>()
    val insertElement = src[0]
    permutations(src.drop(1)).forEach { perm ->
        for (i in 0..perm.size) {
            val newPerm = perm.toMutableList()
            newPerm.add(i, insertElement)
            perms.add(newPerm.toList())
        }
    }
    return perms
}



Measured memory_bytes: 45344
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <list>
#include <stack>
#include <math.h>
#include <map>
#include <unordered_map>
#include <set>
using namespace std;

#define ll long long
#define ull unsigned long long

#define	max	1000000007

ll gcd(ll a, ll b) {
	if (a < b)
		swap(a, b);
	while (ll r = a % b)
		a = b, b = r;
	return b;
}

class mod
{
public:
	ll val;

	mod(ll v)
	{
		val = v % max;
	}

	mod()
	{
		val = 0;
	}

	void operator -=(const mod &v)
	{
		val -= v.val;

		if (val < 0)
			val += max;
	}

	void operator +=(const mod &v)
	{
		if (val + v.val >= max)
			val -= max;
		val += v.val;
	}

	void operator +=(ll &v)
	{
		if (val + v >= max)
			val -= max;
		val += v;
	}

	void operator *=(const mod &v)
	{
		val *= v.val;
		val %= max;
	}

	void operator *=(ll &v)
	{
		val *= v;
		val %= max;
	}

	ll modinv(ll a)
	{
		ll b = max, u = 1, v = 0;
		while (b)
		{
			ll t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		u %= max;
		if (u < 0)
			u += max;
		return u;
	}

	void operator /=(const mod &v)
	{
		val *= modinv(v.val);
		val %= max;
	}

	void operator /=(ll &v)
	{
		val *= modinv(v);
		val %= max;
	}
};

struct p
{
	ll a;
	int b;
	int c;
};

int main()
{
	int n;
	cin >> n;
	vector<int> x(n);
	for (int i = 0; i < n; i++)
		cin >> x[i];
	ll min = max;
	ll now = 0;
	for (int i = 1; i <= 100; i++)
	{
		now = 0;
		for (int j = 0; j < n; j++)
			now += (x[j] - i) * (x[j] - i);
		if (now < min)
			min = now;
	}

	printf("%lld", min);

	return 0;
}


Measured memory_bytes: 888
#末端の処理や場合分けに困る
n,k = map(int, input().split( ))
s = input()
c0 = 0
c1 = 0
L0 = []
 
L1 = []
if s[0]=="0":
    L1 = [0]
for i in range(n):
    if s[i]=="0":
        c0+=1
        if c1!=0:
            L1.append(c1)
            c1 = 0
    else:
        c1+=1
        if c0!=0:
            L0.append(c0)
            c0 = 0
if c0:
    L0.append(c0)
if c1:
    L1.append(c1)

L1.append(0)
#print(L0,L1)
ans = sum(L0[:k])+sum(L1[:k+1])
tmp = ans
for i in range(k,min(len(L0),len(L1))):
    tmp -= L0[i-k]
    tmp -= L1[i-k]
    tmp += L0[i]
    tmp += L1[i+1]
    ans = max(ans, tmp)
print(ans)
    

Measured memory_bytes: 44912
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define all(n) n.begin(),n.end()
#define yn(x) cout << (x ? "Yes":"No") << endl;

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


Measured memory_bytes: 2176
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
    	Scanner scanner = new Scanner(System.in);
    	int a = scanner.nextInt();
    	int b = scanner.nextInt();

    	if (a % 2 == 0 || b % 2 == 0) {
    		System.out.println("Even");
		} else {
			System.out.println("Odd");
		}
    }
}

Measured memory_bytes: 21844
fr=[0]*3
ans="Yes"
for i in range(int(input())):
 dest=list(map(int,input().split()))
 if (dest[0]-fr[0])<(dest[1]+dest[2]-fr[1]-fr[2])or(dest[0]-fr[0]+dest[1]+dest[2]-fr[1]-fr[2])%2!=0:
  ans="No"
  break
 fr[0],fr[1],fr[2]=dest[0],dest[1],dest[2]
print(ans)

Measured memory_bytes: 3064
s2 = input()
t = input()
c1=1
c2=0
c3=0

for i in range(len(s2)-len(t)+1):
    if s2[i]==t[0] or s2[i]=='?':
        for j in range(1,len(t)):
            if s2[i+j]==t[j] or s2[i+j]=='?':
                c1+=1
        if c1 == len(t):
            c2=1
            c3=i
        c1=1
if c2==1:
    s=list(s2)
    for i in range(len(t)):
        s[c3+i]=t[i]
    for i in range(len(s2)):
        if s[i]=='?':
            s[i]='a'
    print("".join(s))
else:
    print('UNRESTORABLE')

Measured memory_bytes: 3064
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>
#include <utility>

struct data {
  int val;
  int left;
  int right;
};

int main(){
  int N;
  scanf("%d", &N);
  std::vector<int > A(N), B(N);
  for (int i=0; i<N; i++){
    scanf("%d", &A[i]);
    scanf("%d", &B[i]);
  }
  std::sort(A.begin(), A.end());
  std::sort(B.begin(), B.end(), std::greater<int >());
  long long ans = 0;
  if (N%2==1){
    int min = A[N/2];
    int max = B[N/2];
    ans = max - min + 1;
  } else {
    long long min = (A[N/2-1] + A[N/2]);
    long long max = (B[N/2-1] + B[N/2]);
    ans = max - min + 1;
  }
  std::cout << ans << std::endl;
  return 0;
}

Measured memory_bytes: 4468
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

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

using namespace std;

int main(){
  vector<int> v1={1, 3, 5, 7, 8, 10, 12};
  vector<int> v2={4, 6, 9, 11};
  vector<int> v3={2};
  int x, y; cin >> x >> y;
  if (count(ALL(v1), x)==1 && count(ALL(v1), y)==1) cout << "Yes" << endl;
  else if ((count(ALL(v2), x)==1) && (count(ALL(v2), y)==1)) cout << "Yes" << endl;
  else if ((count(ALL(v3), x)==1) &&(count(ALL(v3), y)==1)) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=1000000007;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
llint solve(llint n,llint K){
	llint i;
	if(K>n){
		llint ans=1;
		while(n--){ans*=2;ans%=mod;}
		return ans;
	}
	//円環上にAマークとBマーク
	//BマークがKこ連続してはいけない
	vector<llint>dp(n+1);//最後のAマーク
	llint gen=1;//くぎりてん
	dp[0]=1;//最後のBマーク
	for(i=1;i<n;i++){
		dp[i]=gen;
		gen*=2;
		if(i-K>=0){gen-=dp[i-K];}
		gen+=mod;gen%=mod;
	}
	llint ans=0;
	for(i=1;i<=K;i++){
		ans+=i*dp[n-i];
		ans%=mod;
	}
	return ans;
}
int main(void){
	int i,n,m;cin>>n>>m;
	string S;cin>>S;
	vector<int>suu;
	char now=S[0];
	int ban=0;
	for(i=0;i<m;i++){
		if(S[i]==now){ban++;}
		else{suu.pub(ban);ban=1;}
		now=S[i];
	}
	suu.pub(ban);
	//for(auto it:suu){cerr<<it<<endl;}
	if(suu.size()==1){
		cout<<solve(n,2)<<endl;
		return 0;
	}
	if(n%2==1){cout<<0<<endl;return 0;}
	int sei=suu[0];
	if(suu[0]%2==0){sei=suu[0]+1;}
	for(i=2;i+1<suu.size();i+=2){
		if(suu[i]%2==1){mineq(sei,suu[i]);}
	}
	sei++;
	//cerr<<sei<<endl;
	cout<<(2*solve(n/2,sei/2))%mod<<endl;
	return 0;
}

Measured memory_bytes: 2180
def main():
    while True:
        m, nmin, nmax = [int(s) for s in input().strip().split(' ')]
        if m == 0:
            break

        plist = sorted((int(input().strip()) for _ in range(m)), reverse=True)
        ni = 0
        gap = 0
        for i in range(nmin-1, nmax):
            ngap = plist[i] - plist[i+1]
            if gap <= ngap:
                gap = ngap
                ni = i
        print(ni+1)

if __name__ == '__main__':
    main()



Measured memory_bytes: 5624
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
using ll = long long;

int main()
{
    int n, m;
    cin >> n >> m;
    int a[m], b[m];
    rep(i,m) cin >> a[i] >> b[i];

    vector<vector<int>> v(n+1); 

    rep(i,m) v[a[i]].push_back(b[i]) ;
    rep(i,m) v[b[i]].push_back(a[i]) ;
    
    rep(i,n+1) sort( v[i].begin(), v[i].end());

    vector<int> dist(n+1,-1);
    queue <int> que;
    
    dist[1] = 0;
    que.push(1);

    while ( ! que.empty() ){
        int vf = que.front();
        que.pop();
        for( int nv : v[vf] ){
            if( dist[nv] != -1 ) continue;
            dist[nv] = vf;
            que.push(nv);
        }
    }
    bool ok = false;
    rep(i,m) if( a[i] == 1 ) ok = true;
    rep(i,m) if( b[i] == 1 ) ok = true;

    if(ok){
        cout << "Yes" << endl;
        for( int i = 2; i <= n; i++ ) cout << dist[i] << endl;
    }
    else{
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 11628
def solve(a, b, c, d, s):
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    ss = s[a:c + 1]
    fs = s[b:d + 1]
    if '##' in ss:
        return False
    if '##' in fs:
        return False
    if c < d:
        return True
    fs2 = s[b - 1:d + 2]
    if '...' in ss and '...' in fs2:
        return True
    return False
 
 
n, a, b, c, d = list(map(int, input().split()))
s = input()
print('Yes' if solve(a, b, c, d, s) else 'No')

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
#define REP(i,N) for(i=0;i<N;i++)
#define INF 1e18
typedef long long ll;
typedef pair<ll, ll> P;
typedef struct{
  int first;
  int second;
  int third;
}T;

//昇順
bool comp_Se(T& l, T& r){
  return l.second < r.second;
}

class cake{
  public:
    ll sum;
    int x,y,z;
    cake(ll sum, int x, int y ,  int z){
      this->sum = sum;
      this->x = x;
      this->y = y;
      this->z = z;
    }
};

bool operator< (const cake &l, const cake &r){
  return l.sum < r.sum;
}

int main(void){
  int i,j,X,Y,Z,K;
  cin >> X >> Y >> Z >> K;
  vector<ll> A(X),B(Y),C(Z);
  vector<P> a(X,P(0,0)),b(Y,P(0,0)),c(Z,P(0,0));
  REP(i,X) cin >> A[i];
  REP(i,Y) cin >> B[i];
  REP(i,Z) cin >> C[i];
  sort(A.begin(),A.end(),greater<ll>());
  sort(B.begin(),B.end(),greater<ll>());
  sort(C.begin(),C.end(),greater<ll>());

  priority_queue<cake> que;
  map<ll,ll> memo;
  ll sum;
  sum = A[0]+B[0]+C[0];
  que.push(cake(sum,0,0,0));
  memo[0] = sum;
  REP(i,K){
    cake ca = que.top();que.pop();
    cout << ca.sum << endl;
    int x=ca.x+1, y=ca.y, z=ca.z;
    if(!memo.count((x*1000+y)*1000+z) && x < X){
      sum = A[x]+B[y]+C[z];
      que.push(cake(sum,x,y,z));
      memo[(x*1000+y)*1000+z] = sum;
    }
    x=ca.x, y=ca.y+1, z=ca.z;
    if(!memo.count((x*1000+y)*1000+z) && y < Y){
      sum = A[x]+B[y]+C[z];
      que.push(cake(sum,x,y,z));
      memo[(x*1000+y)*1000+z] = sum;
    }
    x=ca.x, y=ca.y, z=ca.z+1;
    if(!memo.count((x*1000+y)*1000+z) && z < Z){
      sum = A[x]+B[y]+C[z];
      que.push(cake(sum,x,y,z));
      memo[(x*1000+y)*1000+z] = sum;
    }
  }
  return 0;
}


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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a), 0LL)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
int const inf = 1e9;
ll const INF = 1e18;

inline void ios_(){cin.tie(0); ios::sync_with_stdio(false);}
template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
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;}



signed main(){
    int n, m;
    string s;
    cin >> n >> m >> s;

    reverse(all(s));

    vector<int> ans;
    int p = 0, cnt = m, start = 0, stop = 0;
    while(p < n){
        p++;
        cnt--;
        if(s[p] == '0'){
            stop = p;
        }
        if(cnt == 0){
            if(start < stop){
                ans.push_back(stop - start);
            }else{
                cout << -1 << endl;
                return 0;
            }
            cnt = m - (p - stop);
            start = stop;
        }
    }

    if(start < stop) ans.push_back(stop - start);

    for_each(rall(ans), [](int i){cout << i << " ";});
    cout << endl;

    return 0;
}


Measured memory_bytes: 1144
/*
ID: varunra2
LANG: C++
TASK: code
*/

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

#ifdef DEBUG
#include "lib/debug.h"
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#pragma GCC diagnostic ignored "-Wsign-compare"
//#pragma GCC diagnostic ignored "-Wunused-parameter"
//#pragma GCC diagnostic ignored "-Wunused-variable"
#else
#define debug(...) 42
#endif

#define EPS 1e-9
#define IN(A, B, C) assert(B <= A && A <= C)
#define INF (int)1e9
#define MEM(a, b) memset(a, (b), sizeof(a))
#define MOD 1234567
#define MP make_pair
#define PB push_back
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define x first
#define y second

const double PI = acos(-1.0);
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef map<int, int> MPII;
typedef multiset<int> MSETI;
typedef set<int> SETI;
typedef set<string> SETS;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef vector<string> VS;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define sz(x) (int)(x).size()
typedef pair<int, int> pii;
typedef vector<int> vi;
#pragma GCC diagnostic ignored "-Wsign-compare"
// util functions


int main() {
#ifndef ONLINE_JUDGE
  freopen("code.in", "r", stdin);
  freopen("code.out", "w", stdout);
#endif
  cin.sync_with_stdio(0); cin.tie(0);

	int n;
  cin >> n;
  
  map<string, int> freq;
  
  for(int i = 0; i < n; i++) {
  	string s;
    cin >> s;
    freq[s]++;
  }
  
  cout << "AC x " << freq["AC"] << endl;
  cout << "WA x " << freq["WA"] << endl;
  cout << "TLE x " << freq["TLE"] << endl;
  cout << "RE x " << freq["RE"] << endl;
  


  return 0;
}


Measured memory_bytes: 3656
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<queue>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

typedef long long ll;
const ll INF = 1e17;
const int BIG = 1000000007;



int main() {

	int H, W;
	cin >> H >> W;

	char s[3000][3000];

	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cin >> s[i][j];
		}
	}

	int u[3000][3000] = {};
	int d[3000][3000] = {};
	int l[3000][3000] = {};
	int r[3000][3000] = {};

	for (int j = 0; j < W; j++) {

		u[0][j] = 0;

		for (int i = 1; i < H; i++) {

			if (s[i - 1][j] == '#') { u[i][j] = 0; }
			else { u[i][j]=u[i-1][j]+1; }


		}

	}

	for (int j = 0; j < W; j++) {

		d[H - 1][j] = 0;

		for (int i = H - 2; i >= 0; i--) {

			if (s[i + 1][j] == '#') { d[i][j] = 0; }
			else { d[i][j]=d[i+1][j]+1; }

		}
	}

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

		l[i][0] = 0;

		for (int j = 1; j < W; j++) {

			if (s[i][j - 1] == '#') { l[i][j] = 0; }
			else { l[i][j]=l[i][j-1]+1; }

		}
	}

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

		r[i][W - 1] = 0;

		for (int j = W - 2; j>=0; j--) {

			if (s[i][j + 1] == '#') { r[i][j] = 0; }
			else { r[i][j]=r[i][j+1]+1; }

		}
	}

	int ans = 0;

	int val;

	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (s[i][j] == '.') { val = u[i][j] + d[i][j] + l[i][j] + r[i][j] + 1; }

			
			else { val = 0; }

			

			if (val > ans) { ans = val; }
		}
		
	}

	cout << ans;
	
	system("PAUSE");
}

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

using namespace std;

const int N=2e5+5,OO=0x3f3f3f3f,M=1e9+7;
int t,n,m,k;


int main() {
    int arr[5];
    scanf("%d%d%d",&arr[0],&arr[1],&arr[2]);
    sort(arr,arr+3);
    if(arr[0]==5&&arr[1]==5&&arr[2]==7)
        printf("YES");
    else
        printf("NO");
    return 0;
}


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

int main() {
  string S, T;
  cin >> S >> T;
  vector<int> A, B;
  map<char, int> MA;
  for (int i = 0, cnt = 1; i < S.size(); i++) {
    if (!MA[S.at(i)]) MA[S.at(i)] = cnt++;
    A.push_back(MA[S.at(i)]);
  }
  map<char, int> MA2;
  for (int i = 0, cnt = 1; i < T.size(); i++) {
    if (!MA2[T.at(i)]) MA2[T.at(i)] = cnt++;
    B.push_back(MA2[T.at(i)]);
  }
  cout << ((A == B) ? "Yes" : "No") << "\n";
}

Measured memory_bytes: 2940
N = int(input())

if N <= 111:
    print(111)
elif N <= 222:
    print(222)
elif N<= 333:
    print(333)
elif N <= 444:
    print(444)
elif N <= 555:
    print(555)
elif N <= 666:
    print(666)
elif N <= 777:
    print(777)
elif N <= 888:
    print(888)
elif N <= 999:
    print(999)

Measured memory_bytes: 3060
import java.io.*;

public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        String[] values = reader.readLine().split(" ");
        long first = Integer.valueOf(values[0])*Integer.valueOf(values[1]);
        long second = Integer.valueOf(values[2])*Integer.valueOf(values[3]);

        if (first <= second) {
            System.out.print(second);
        } else {
            System.out.println(first);
        }

//        PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));
//
//
//
//        writer.close();

    }
}


Measured memory_bytes: 22612
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#define FOR(i,k,n)  for(int i = (k);i < (n);++i)
#define REP(i,n)    FOR(i,0,n)

using namespace std;
using vecint = vector<int>;
using ll = int64_t;
using Weight = ll;
Weight INF = 1000000000000000ll;
struct Edge{
  int src, dest; Weight weight;
  bool operator < (const Edge &rhs) const {return weight > rhs.weight;}
};
using Array = vector<Weight>;
using Edges = vector<Edge>;

// BellmanFord (Negative Cycle)
bool bellman_ford(const Edges &es, Array &d, int s, vector<bool>& loop) {
  boost::fill(d, INF); d[s] = 0;
  boost::fill(loop, false);
  bool neg = false;
  REP(i, 2*d.size()) {
    bool updated = false;
    for (Edge e : es) {
      if (d[e.src] < INF && d[e.dest] > d[e.src] + e.weight) {
        d[e.dest] = d[e.src] + e.weight;
        if (i >= d.size() - 1) {
          d[e.dest] = -INF;
          loop[e.dest] = true;
          neg = true;
        }
        updated = true;
      }
    }
    if (!updated) return true;
  }
  return !neg;
}

int main()
{
  int n,m,p;
  cin>>n>>m>>p;
  Edges ve;
  REP(i,m) {
    ll a,b,c;
    cin>>a>>b>>c;
    --a;--b;
    ve.push_back((Edge){a,b,p-c});
  }
  Array d(n);
  vector<bool> loop(d.size(), false);
  bellman_ford(ve, d, 0, loop);
  if (loop[n-1]) {
    cout<<-1<<endl;
  } else {
    ll e=-d[n-1];
    ll z=0;
    cout<<max(z,e)<<endl;
  }
  return 0;
}


Measured memory_bytes: 512
def cmp_dice(a, b):
    for _ in range(4):
        b[0],b[4],b[5],b[1]=b[1],b[0],b[4],b[5]
        for _ in range(4):
            b[1],b[2],b[4],b[3]=b[3],b[1],b[2],b[4]
            for _ in range(4):
                b[0],b[4],b[5],b[1]=b[1],b[0],b[4],b[5]
                if a==b:
                    return True
    return False

dd = []
for _ in range(int(input())):
    dd.append([int(i)-1 for i in input().split()])

for i in range(len(dd)-1):
    for j in range(i+1, len(dd)):
        if cmp_dice(dd[i],dd[j]):
            print('No')
            exit()
print('Yes')


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

int main() {
    int h, w;
    cin >> h >> w;
    vector<vector<int>> field(h,vector<int>(w));
    rep(i,h)rep(j,w) cin >> field[i][j];
    int ct = 0;
    vector<vector<int>> ans;
    rep(i,h) {
        if (!(i&1)) {
            rep(j,w) {
                if (j != w-1) {
                    if (field[i][j]&1) {
                        ct++;
                        ans.push_back({i+1,j+1,i+1,j+2});
                        field[i][j]--;
                        field[i][j+1]++;
                    }
                }
                else {
                    if (field[i][j]&1 && i != h-1) {
                        ct++;
                        ans.push_back({i+1,j+1,i+2,j+1});
                        field[i][j]--;
                        field[i+1][j]++;
                    }
                }
            }
        }
        else {
            rep(j,w) {
                if (j != w-1) {
                    if (field[i][w-1-j]&1) {
                        ct++;
                        ans.push_back({i+1,w-j,i+1,w-1-j});
                        field[i][w-1-j]--;
                        field[i][w-2-j]++;
                    }
                }
                else {
                    if (field[i][w-1-j]&1 && i != h-1) {
                        ct++;
                        ans.push_back({i+1,w-j,i+2,w-j});
                        field[i][w-1-j]--;
                        field[i+1][w-1-j]++;
                    }
                }
            }
        }
    }
    cout << ct << endl;
    rep(i,ct) {
        cout << ans[i][0] << " " << ans[i][1] << " " << ans[i][2] << " " << ans[i][3] << endl;
    }
}

Measured memory_bytes: 11312
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1<<30;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};

int gcd(int a, int b) {return b != 0 ? gcd(b, a % b) : a;}//最大公約数

vector<int> yakusu(int n){//約数の全列挙
    vector<int> ret(0);
    for(int i=1;i*i<=n;i ++){
        if(n%i==0){
            ret.emplace_back(i);
            if(i*i<n) ret.emplace_back(n/i);
        }
    }
    return ret;
}

int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int n;
    cin>>n;
    vector<int> a(n,0);
    rep(i,n) cin>>a.at(i);
    int ans;
    ans =gcd(a[0],a[1]);
    if(n==3) ans =gcd(ans,a[2]);
    vector<int> x =yakusu(ans);
    sort(all(x));
    rep(i,x.size()) cout<<x[i]<<endl;;
}


Measured memory_bytes: 3136
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def _cmb(N, mod):
    N1 = N + 1
    fact = [0] * N1
    inv = [0] * N1
    fact[0] = fact[1] = inv[0] = inv[1] = 1

    for i in range(2, N1):
        fact[i] = fact[i-1] * i % mod
        inv[i] = pow(fact[i], mod-2, mod)

    def cmb(a, b):
        return fact[a] * inv[b] * inv[a-b] % mod
    return cmb

def resolve():
    K = int(input())
    s = input()
    ls = len(s) - 1
    mod = 10**9+7

    cmb = _cmb(ls+K, mod)

    ans = 0
    for i in range(K+1):
        ans += cmb(ls+i, ls) * pow(25, i, mod) * pow(26, K - i, mod)
        ans %= mod
    print(ans)

if __name__ == "__main__":
    resolve()


Measured memory_bytes: 106824
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 110;

int n;
char str[MAXN], arr[MAXN];

int main(){
	scanf("%d", &n);
	scanf("%s", str + 1); scanf("%s", arr +1 );
	for(int i = 1; i <= n; i++) printf("%c%c", str[i], arr[i]); printf("\n");
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N = 1010;
string a;
string b;
int main(){
    cin >> a;
    cin >> b;
    int l = a.length();
    bool fl = true;
    for(int i=0;i<l;i++)  	if(a[i]!=b[i]) fl = false;
	if(fl) cout<<"Yes"<<endl;
	else cout <<"No"<<endl;
	return 0;
}

Measured memory_bytes: 3636
import java.util.Scanner;
import java.util.Stack;

public class Main {

	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)) {
			Stack<String> stack = new Stack<String>();
			String str = sc.nextLine();
			String[] token = str.split(" ");
			for(String t : token) {
				if( t.equals("+") || t.equals("-") || t.equals("*") ) { 
					int first = Integer.parseInt( stack.pop() );
					int second = Integer.parseInt( stack.pop() );
					if(t.equals("+")) {
						stack.push( Integer.toString(first + second) );
					}
					else if( t.equals("-") ) {
						stack.push( Integer.toString(second - first) );
					}
					else {
						stack.push( Integer.toString(first * second) );
					}
					
				}
				else {
					stack.push(t);
				}
			}
			System.out.println( stack.pop() );

		}
	}
}


Measured memory_bytes: 26268
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<bitset>
#include<deque>
#include<functional>
#include<iterator>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(n);i>=1;i--)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;
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;}
ll maxx(ll x,ll y,ll z){return max(max(x,y),z);}
ll minn(ll x,ll y,ll z){return min(min(x,y),z);}
ll gcd(ll x,ll y){if(x%y==0) return y;else return gcd(y,x%y);}
ll lcm(ll x,ll y){return x*(y/gcd(x,y));}
ll digsz(ll x){if(x==0) return 1;else{ll ans=0;while(x){x/=10;ans++;}return ans;}}
ll digsum(ll x){ll sum=0;while(x){sum+=x%10;x/=10;}return sum;}
vector<ll> pw2(62,1);vector<ll> pw10(19,1);


int main(){
    {rep1(i,61) pw2[i]=2*pw2[i-1];}
    {rep1(i,18) pw10[i]=10*pw10[i-1];}
    
    ll K,T; cin>>K>>T;
    vector<ll> A(T,0);
    rep(i,T){
        cin>>A[i];
    }
    sort(all(A));
    ll L=A[sz(A)-1];
    rep(i,sz(A)-1){
        L-=A[i];
    }
    cout<<max(L-1,0ll)<<endl;
}



Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)

vector<bool> D(10,true);

bool dec(int n){
	while(n>0){
		if(!D.at(n%10)) return false;
		n/=10;
	}
	return true;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,k;cin >> n >> k;
	rep(i,k){
		int a;
		cin >> a;
		D.at(a)=false;
	}
	int i=n;
	while(true){
		if(dec(i)){
			cout << i << endl;
			return 0;
		}
		i++;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P std::pair<int,int>
#define PiP std::pair<int,std::pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp std::make_pair
#define prique(T) std::priority_queue<T,vector<T>,greater<T>>
using namespace std;
template<class T> inline void chmax(T& a, T b) { a = std::max(a, b); }
template<class T> inline void chmin(T& a, T b) { a = std::min(a, b); }

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
int get_rand(int MIN, int MAX) {
	std::random_device rnd;
	std::mt19937 mt32(rnd());
	std::uniform_int_distribution<int>engine(MIN, MAX);
	return engine(mt32);
}
/*--------Library Zone!--------*/



signed main() {
	int n; cin >> n;
	if (n == 3) {
		cout << "2 5 63\n";
	}
	else {
		int cnt = 0, sum = 0;
		vector<int>ans;
		for (int i = 2; cnt < n - 1; i++) {
			if (i % 2 == 0 || i % 3 == 0) {
				ans.push_back(i); cnt++; sum += i;
			}
		}
		if (sum % 6 == 1 || sum % 6 == 5) {
			sum -= ans.back(); int i = ans.back() + 1; ans.pop_back();
			for (;; i++) {
				if (i % 2 == 0 || i % 3 == 0) {
					if ((sum + i) % 6 != 1 && (sum + i) % 6 != 5) {
						sum += i; ans.push_back(i); break;
					}
				}
			}
		}
		for (int i = ans.back() + 1;; i++) {
			if (i % 2 == 0 || i % 3 == 0) {
				if ((sum + i) % 6 == 0) {
					ans.push_back(i); break;
				}
			}
		}
		for (int i : ans)cout << i << " "; cout << endl;
	}
}


Measured memory_bytes: 640
A,B,C,X,Y =[int(i) for i in input().split()]

ans = A*X+B*Y
Z=0
while True:
    X=max(X-1,0)
    Y=max(Y-1,0)
    Z=Z+2
    price=A*X+B*Y+C*Z
    #print(X,Y,Z,price)
    if ans > price:
        ans=price
    if X==0 and Y==0:
        break


print(ans)

Measured memory_bytes: 3064