akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using static Assistant.Input;
using static Assistant.Debug;
using System.Linq;
using Assistant;

namespace ABC163A
{
    class Program
    {
        static void Main(string[] args)
        {
            var R = RInt;

            double ans = Math.PI * 2 * R;
            Console.WriteLine(ans);

        }


    }


}

namespace Assistant
{
    static class Input
    {
        static List<string> line = new List<string>();
        static int index = 0;
        static String RNext()
        {
            if (line.Count <= index) line.AddRange(Console.ReadLine().Split());
            return line[index++];
        }
        public static int RInt => int.Parse(RNext());
        public static long RLong => long.Parse(RNext());
        public static int[] RInts => Console.ReadLine().Split().Select(int.Parse).ToArray();
        public static long[] RLongs => Console.ReadLine().Split().Select(long.Parse).ToArray();
        public static string RString => RNext();
        //以下未テスト
        public static int[] RIntsC(int c) => Enumerable.Repeat(0, c).Select(x => int.Parse(RNext())).ToArray();
        public static long[] RLongsC(int c) => Enumerable.Repeat(0, c).Select(x => long.Parse(RNext())).ToArray();
        public static char[][] RMap(int h) => Enumerable.Repeat(0, h).Select(x => Console.ReadLine().ToCharArray()).ToArray();
    }

    static class Debug
    {
        static public void Draw2D(int[,] map, int mode = 1)
        {
#if DEBUG
            int W = map.GetLength(0);
            int H = map.GetLength(1);

            int[,] map2 = new int[W + 1, H + 1];
            for (int i = 0; i < W + 1; i++)
            {
                for (int j = 0; j < H + 1; j++)
                {
                    if (i == 0 && j == 0) map2[i, j] = 0;
                    else if (i == 0) map2[i, j] = j - 1;
                    else if (j == 0) map2[i, j] = i - 1;
                    else map2[i, j] = map[i - 1, j - 1];
                }
            }

            for (int i = 0; i < W + 1; i++)
            {
                for (int j = 0; j < H + 1; j++)
                {
                    if (mode == 0) Console.Write(map2[i, j] % 10);
                    if (mode == 1) Console.Write(map2[i, j] + " ");
                }
                Console.WriteLine();
            }
            Console.WriteLine();
#endif
        }

        public static void Draw1D(int[] array, int mode = 0)
        {
#if DEBUG
            Console.WriteLine(string.Join(" ", array));
#endif
        }
    }
}


Measured memory_bytes: 27740
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a)
	fmt.Scan(&b)

	currentTap := 1
	tapCount := 0
	for {
		if b == 1 {
			break
		}
		currentTap = currentTap - 1 + a
		tapCount++
		if currentTap >= b {
			break
		}
	}

	fmt.Println(tapCount)

}


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

typedef long long LL;

#define REP(i, n) for(LL i = 0; i < (LL)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
LL mod;

namespace modCalc {
    LL add() {
        return 0;
    }
    template<typename H, typename... T>
    LL add(H h, T... t) {
        return (h + add(t...))%mod;
    }

    template<typename H, typename... T>
    LL sub(H h, T... t) {
        return (h - add(t...) + mod)%mod;
    }

    LL mul() {
        return 1;
    }
    template<typename H, typename... T>
    LL mul(H h, T... t) {
        return (h*mul(t...))%mod;
    }

    LL pow(LL x, LL y) {
        LL res = 1;
        while(y != 0) {
            if(y%2) {
                res = mul(x, res);
                y--;
            }else{
                x = mul(x, x);
                y /= 2;
            }
        }
        return res;
    }

    LL div(LL x, LL y) {
        return mul(x, pow(y, mod - 2));
    }

    LL fact(LL n) {
        LL res = 1;
        FOR(i, 1, n + 1)
            res = mul(res, i);
        return res;
    }
}

using namespace modCalc;

int main() {
    LL N, P;
    cin >> N >> P;
    mod = P;
    vector<LL> v(N);
    string s;
    cin >> s;
    reverse(ALL(s));

    if(10%P == 0) {
        LL res = 0;
        REP(i, N) {
            if((s[i] - '0')%P == 0) {
                res += N - i;
            }
        }
        cout << res << endl;
        return 0;
    }

    REP(i, N) {
        v[i] = mul(modCalc::pow(10, i), s[i] - '0');
    }
    vector<LL> count(P, 0);
    LL sum = 0;
    LL res = 0;
    REP(i, N) {
        sum = add(sum, v[i]);
        if(sum == 0) {
            res += count[sum] + 1;
        }else{
            res += count[sum];
        }
        count[sum]++;
    }
    cout << res << endl;
    return 0;
}



Measured memory_bytes: 2180
#include <iostream>
using namespace std;
int main(void){
    int n,t,a,b;
    long long c=0;
    cin>>n>>t>>b;
    
    for(int i=1;i<n;i++){
        cin>>a;
        if(a-b>=t){
            c+=t;
        }else{
            c+=a-b;
        }
        
        b=a;
    }
    c+=t;
    cout<<c<<endl;
}


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

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

  int n;
  string s, t, u;
  cin >> n >> s >> t;

  for (int i = 0; i < n; i++)
  {
    u += s.at(i);
    u += t.at(i);
  }
  
  cout << u << endl;

  return 0;
}

Measured memory_bytes: 3568
# include<bits/stdc++.h>
using namespace std;
vector<int>mav;
int main(){
int n,a=0;
cin>>n;
for(int i=0 ; i<n; i++){
    cin>>a;
    mav.push_back(a);
    sort(mav.begin(),mav.end());
}
cout<<mav[mav.size()-1]-mav[0];
}


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

int DP1[3005][3005];
int DP2[3005][3005];

int main() {
  int N, T;
  cin>>N>>T;
  int A[N], B[N];
  for(int i=0;i<N;++i) cin>>A[i]>>B[i];
  for(int j=0;j<T;++j){
    if(A[0]<=j) DP1[0][j] = B[0];
  }
  for(int i=1;i<N;++i){
    for(int j=0;j<T;++j){
      if(A[i]>j) DP1[i][j] = DP1[i-1][j];
      else DP1[i][j] = max(DP1[i-1][j], DP1[i-1][j-A[i]]+B[i]);
    }
  }
  for(int j=0;j<T;++j){
    if(A[N-1]<=j) DP2[N-1][j] = B[N-1];
  }
  for(int i=N-2;i>=0;--i){
    for(int j=0;j<T;++j){
      if(A[i]>j) DP2[i][j] = DP2[i+1][j];
      else DP2[i][j] = max(DP2[i+1][j], DP2[i+1][j-A[i]]+B[i]);
    }
  }
  int ans = 0;
  for(int i=0;i<N;++i){
    if(i==0) {
      ans = max(ans, DP2[i+1][T-1]+B[0]);
    }
    else if(i==N-1) {
      ans = max(ans, DP1[N-2][T-1]+B[N-1]);
    }
    else {
      for(int j=0;j<T;++j){
        ans = max(ans, DP1[i-1][j]+DP2[i+1][T-1-j]+B[i]);
      }
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 74040
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
const ll mod = 1000000007;
const ll INF = 9223372036854775807;
#define Sort(a) sort(a.begin(), a.end())
#define Bsort(a) sort(a.begin(), a.end(), greater<ll>())
#define Pi acos(-1)

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << setprecision(15) << fixed;
  char a;
  cin >> a;
  if (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u') cout << "vowel\n";
  else cout << "consonant\n";
}

Measured memory_bytes: 3652
#include<stdio.h>
int main()
{
    double d,a,b;
    int c;
    scanf("%lf",&a);
    c=(int)a;
    if(c%2==0)
    {
        b=a/2;
        d=b/a;
        printf("%.10lf\n",d);
    }
    else if(c%2!=0)
    {
        c=c/2;
        b=c+1;
        d=b/a;
        printf("%.10lf\n",d);
    }
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;

int solve() {
    int n, k; cin >> n >> k;
    vi v(n, 0);
    for (int i = 1; i <= k; ++i) {
        int d; cin >> d;
        int a;
        while (d--) {
            cin >> a;
            v[a - 1]++;
        }
    }

    int cnt = 0;
    for (auto num : v) {
        if (num == 0) 
            cnt++;
    }

    return cnt;
}

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

	cout << solve() << endl;
}


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

int main()
{
	int n;
	while (scanf("%d", &n) != EOF) {
		int i, j, k;
		int q;
		int f[10001];
		memset(f, 0, sizeof(f));
		q = sqrt(n);
		for (i = 1; i <= q; i ++) {
			for (j = 1; j <= q; j ++) {
				for (k = 1; k <= q; k ++) {
					int d = i * i + j * j + k * k + i * j + j * k + i * k;
					if (d <= 10000) {
						f[d] ++;
					}
				}
			}
		}
		for (i = 1; i <= n; i ++) {
			printf("%d\n", f[i]);
		}
		printf("\n");
	}
	return (0);
}


Measured memory_bytes: 2168
#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 <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#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 <codecvt>
#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>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll INF=(1LL<<62);
const ld pi=acosl((ld)-1);
// const ll mod = 1000000007;
const ll mod = 1234567;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"

bool solve(){
  ll a,b,c,d;cin>>a>>b>>c>>d;
  while(!(a<=0 or c<=0)){
    a-=d;
    c-=b;
  }
  cout<<(c<=0 ? "Yes" : "No")<<endl;
  return false;
}

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout<<fixed<<setprecision(30);
  solve();
}


Measured memory_bytes: 3604
class Problem
  attr_accessor :a, :b, :n, :m, :h, :w, :x, :y, :s ,:t, :k, :l

  def initialize
    @x,@n = gets.to_s.split.map{ |v| v.to_i }
    @a = gets.to_s.split.map{ |v| v.to_i }
  end

  def solve
    ans = 9999
    mini = 9999
    0.upto(101) do |i|
      next if a.include? i
      cnt = (i-x).abs
      if cnt < mini
        mini = cnt
        ans = i
      end
    end
    ans
  end

  def show(ans)
    puts ans
  end
end

Problem.new.instance_eval do
  show(solve)
end


Measured memory_bytes: 14376
import sys
def v():
    pt=[5,0,1,2]
    s=list(map(lambda x: '0' if x=='g' else '1', list(sys.stdin.readline().strip())))
    n=len(s)
    p=pt[n%4]
    for _ in range(n//4):p=(p<<4)+5
    ss=list(format(p,'b').zfill(n))
    res=0
    for a,b in zip(s,ss):
        d=int(b)-int(a)
        res = res if d==0 else res+d
    print(res)
if __name__=='__main__':v()


Measured memory_bytes: 4780
#include <iostream>
#include <cmath>

using namespace std;

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

ll n,k,s[20], ans = (ll)1 << 60;
int main(){
	cin >> n >> k;
	REP(i, n) cin >> s[i];
	REP(i,1<<n){
		ll cnt = 0,now = 0,nans = 0;
		bool ok = true;
		REP(j, n) if(i & (1 << j)) cnt++;
		if(cnt >= k){
			REP(j, n){
				if(i & (1 << j)){
					nans += max(now + 1, s[j]) - s[j];
					now = max(now + 1, s[j]);
					REP(k, j) {
						if(s[k] > now) ok = false;
					}
				}
			}
			if(ok) ans = min(ans, nans);
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
   long long n,W;
   cin>>n>>W;
   vector<long long>value;
   vector<long long>weight;
   for(long long i=0;i<n;i++)
   {
       long long v,w;
       cin>>v>>w;
       weight.push_back(v);
       value.push_back(w);
     //  cout<<value[i]<<" "<<weight[i]<<endl;
   }

   vector<vector<long long>>dp(n+1,vector<long long>(W+1,0));

   for(long long i=1;i<=n;i++)
   {
       for(long long j=1;j<=W;j++)
       {
           if(weight[i-1]<=j)
           {
               dp[i][j] = max((value[i-1] + dp[i-1][j-weight[i-1]]),dp[i-1][j]);
           }
           else {
           dp[i][j] = dp[i-1][j];
           }
       }
   }
   cout<<dp[n][W]<<'\n';
}

Measured memory_bytes: 83152
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long n; cin >> n;
    
    vector<long long> a(n);
    
    for(int i=0; i<n; i++){
        cin >> a[i];
        a[i] -= i + 1;
    }
    
    sort(a.begin(), a.end());
    
    long long sum = 0;
    
    for(int i=0; i<n; i++){
        sum += abs(a[i] - a[n/2]);
    }
    
    cout << sum << endl;
    
    return 0;
}

Measured memory_bytes: 1792
def cmb(n,r,mod):
  if r<0 or r>n:
    return 0
  r=min(r,n-r)
  return g1[n]*g2[r]*g2[n-r]%mod

n,m,k=map(int,input().split())
mod=998244353

g1=[1,1]
g2=[1,1]
inverse=[0,1]
 
for i in range(2,n+1):
  g1.append((g1[-1]*i)%mod)
  inverse.append((-inverse[mod%i]*(mod//i))%mod)
  g2.append((g2[-1]*inverse[-1])%mod)

ans=0
for i in range(k+1):
  x=n-i
  ct=pow(m-1,x-1,mod)
  ct*=m
  ct*=cmb(n-1,i,mod)
  ct%=mod
  ans+=ct
  ans%=mod
print(ans)

Measured memory_bytes: 112448
#include<cstdio>
#include<cstdlib>
#include<string>
#include<iostream>
using namespace std;

struct Node{
  int key;
  Node *r, *l, *p;
};

Node *root, *NIL;

void insert(int k){
  Node *x = root,*y = NIL, *z;

  z = (Node *)malloc(sizeof(Node));
  z->key = k;
  z->l = NIL;
  z->r = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key){
      x = x->l;
    }
    else{
      x = x->r;
    }
  }

  z->p = y;
  if(y == NIL){
    root = z;
  }
  else{
    if(z->key < y->key){
      y->l = z;
    }
    else{
      y->r = z;
    }
  }
}

void inorder(Node *u){
  if(u == NIL) return;
  inorder(u->l);
  printf(" %d", u->key);
  inorder(u->r);
}

void preorder(Node *u){
  if(u == NIL) return;    
  printf(" %d", u->key);    
  preorder(u->l);
  preorder(u->r);
}


int main(){
  int n, i, x;
  string com;

  scanf("%d", &n);

  for(i = 0 ; i < n ; i++){
    cin >> com;
    if(com == "insert"){
      scanf("%d", &x);
      insert(x);
    }
    else if(com == "print"){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  return 0;
}


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

int h, w, n;
map<pair<int,int> ,int> mp;
set<pair<int,int> > s[10];

void add(int x,int y) {
	int lx = max(1, x - 2), ly = max(1, y - 2);
	int rx = min(x, h - 2), ry = min(y, w - 2);
	for (x = lx; x <= rx; ++x) {
		for (y = ly; y <= ry; ++y) {
			if (mp[{x, y}]) s[mp[{x, y}]].erase({x, y});
			mp[{x, y}]++;
			s[mp[{x, y}]].insert({x, y});
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cin >> h >> w >> n;
	while (n--) {
		int x, y; cin >> x >> y;
		add(x, y);
	}
	long long sum = 1LL * (h - 2) * (w - 2);
	for (int i = 1; i <= 9; ++i) {
		sum -= (int)s[i].size();
	}
	cout << sum << '\n';
	for (int i = 1; i <= 9; ++i) cout << (int)s[i].size() << '\n';
}

Measured memory_bytes: 98688
while True:
  s = input().rstrip().split(' ')
  H = int(s[0])
  W = int(s[1])
  if H == 0 and W == 0:
    break;
  ansodd = ""
  anseven = ""
  for i in range(W):
    if i % 2 == 0:
      anseven += "#"
      ansodd += "."
    else:
      anseven += "."
      ansodd += "#"
  for j in range(H):
    if j % 2 == 0:
      print(anseven)
    else:
      print(ansodd)
  print("")



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

int main() {
    ll n,a,b;
    cin >> n >> a >> b;
    ll ans = 0;
    ans += n/(a+b)*a;
    if(n%(a+b) >= a){
        ans += a;
    }
    else{
        ans += n%(a+b);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
long get_lucas_num(int i) {
  std::vector<long> luca(i);
  long luca0 = 2;
  long luca1 = 1;
  long luca2 = luca0 + luca1;
  for(int j = 2; j <= i; j++) {
    luca0 = luca1;
    luca1 = luca2;
    luca2 = luca0 + luca2;
  }
  return luca1;
}

int main(void) {
  int a;
  std::cin >> a;
  long out = get_lucas_num(a);

  std::cout << out << std::endl;
  return 0;
}


Measured memory_bytes: 888
#include<iostream>

using namespace std;

int main(void)
{
  string s; cin>>s;
  int j=0;
  
  if((s[0]==s[1])||(s[1]==s[2])||(s[2]==s[3])){
    puts("Bad");
  }else{
    puts("Good");
  }
  
  return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# 整数の入力


def main():
    # a, b
    n = int(input())
    s = []
    for _ in range(n):
        s.append(input())
    print(process(n, s))


def process(n, s):
    s = list(map(lambda s: ''.join(sorted(s)), s))
    hash = {}

    count = 0
    for i in range(0, n):
        if s[i] in hash:
            hash[s[i]] += 1
        else:
            hash[s[i]] = 1
        count += hash[s[i]] - 1
    return count


if __name__ == "__main__":
    main()


Measured memory_bytes: 26640
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
const int mod = 1e9 + 7;
const int  N = 2e5 + 314;
void solve(){
    int n, sum = 0;
    cin>>n;
    vi v(n+1);
    for(int i = 1; i <= n; i++){
        if(i%3==0&&i%5==0)continue;
        else if(i%3==0)continue;
        else if(i%5==0)continue;
        sum+=i;
    }   
    cout<<sum;
}
signed main(){
    speed;
    int t=1;
    //cin>>t;
    while(t--)solve();
}

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

int main() {
  int n;
  cin >> n;
  int chal = 100;
  
  rep(i, n) {
    ll int ans = 0;
    for(int x = 1; x < chal; ++x) {
      for(int y = x; y < chal; ++y) {
        for(int z = y; z < chal; ++z) {
          if(x*x+y*y+z*z+x*y+y*z+z*x == i+1) {
//            cout << x << " " << y << " " << z << endl;
            if(x==y && y==z) ++ans;
            else if(x==y || x==z || y==z) ans += 3;
            else ans += 6;
//            if(i==16) cout << x << " " << y << " " << z << endl;
          }
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 3548
/// Kazuki Hoshino


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define inf 1000000000
#define mod 1000000007
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define rep1(i, a, b) for(int i =a; i >=b; i--)
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define f first
#define ss second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
//#define endl '\n'
typedef tree<
int,
null_type,less<int>,
rb_tree_tag,tree_order_statistics_node_update>
ordered_set;
int n;
string s,key="keyence";
bool chk(int l, int r){
       string temp ="";
       for(int i=0;i<n;i++){
              if(i>=l&&i<=r)continue;
              temp+=s[i];
       }
       return temp==key;
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);

#ifndef ONLINE_JUDGE
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
#endif

cin >> s;
n = s.size();
for(int i=0;i<n;i++){
       for(int j=i;j<n;j++){
              if(chk(i,j)||s==key){
                     cout << "YES" << endl;
                     return 0;
              }
       }
}
cout << "NO" << endl;






return 0;}
///....


Measured memory_bytes: 256
def maxValue(a,b,v):
	for i in range(v,-1,-1):
		for j in range(v//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i

a,b,c,d,e,f = list(map(int, input().split()))

waVa = maxValue(a*100,b*100,f)
suVa = maxValue(c,d,min(f-waVa,waVa*e//100))
maxR = 0

anw = waVa
ans = suVa

while 1:
	waVa = maxValue(a*100,b*100,waVa-1)
	suVa = maxValue(c,d,min(f-waVa,waVa*e//100))
	if waVa == 0:
		break
	if maxR<100*suVa/(suVa+waVa):
		maxR = 100*suVa/(suVa+waVa)
		anw = waVa
		ans = suVa

print(anw+ans,ans)

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {

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

		long number = sc.nextLong();

		long one = number % 10;
		long two = number % 100 - one;
		long three = number % 1000 - two - one;
		long four = number % 10000 - three - two - one;
		long five = number % 100000 - four - three - two - one;
		long six = number % 1000000 - five - four - three - two - one;
		long seven = number % 10000000 - six - five - four - three - two - one;
		long eight = number % 100000000 - seven - six - five - four - three - two - one;
		long nine = number % 1000000000 - eight - seven - six - five - four - three - two - one;
		long ten = number / 10 % 1000000000 - nine - eight - seven - six - five - four - three - two - one;

		long all = one + two / 10 + three / 100 + four / 1000 + five / 10000 + six / 100000 + seven / 1000000
				+ eight / 10000000 + nine / 100000000 + ten / 1000000000;


		sc.close();

		if (all == 0) {
			all += 1;
		}
		
		if (number % all == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

}


Measured memory_bytes: 21584
#include<iostream>
using namespace std;
int main()
{
    long long int n,m;
    cin>>n>>m;
    long long int a[m],b[m];
    for (long long int i = 0; i <m ; ++i) {
        cin>>a[i]>>b[i];
        a[i]--;
        b[i]--;
    }
    long long int r[n];
    for (long long int i = 0; i < n; ++i) {
        r[i]=i;
    }
    long long int s[n];
    for (long long int i = 0; i < n; ++i) {
        s[i]=1;
    }
    long long int ans=n*(n-1)/2;
   long long  int res[m];
    res[m-1]=ans;
    for (long long int i = m-1; i >0; --i) {
        long long int c=a[i];
        long long int d=b[i];
        while(r[c]!=c)
        {
            c=r[c];
        }
        while(r[d]!=d)
        {
            d=r[d];
        }
        if(c!=d) {
            ans-=s[c]*s[d];
            if (s[c] > s[d]) {
                r[d] = c;
                s[c] = s[c] + s[d];
                s[d] = 0;
            } else {
                r[c] = d;
                s[d] = s[d] + s[c];
                s[c] = 0;
            }
        }
        res[i-1]=ans;
    }
    for (long long int i = 0; i < m; ++i) {
        cout<<res[i]<<endl;
    }
}

Measured memory_bytes: 5248
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#include <iomanip>
#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;


int mx6[] = {1,0,-1,1,-1,0};
int my6[] = {1,1,1,0,0,-1};

int main(){
    vector<int> a(5);
    rep(i,5) {
        cin >> a[i];
        if(a[i] == 0){
            cout << i+1 << endl;
            break;
        }
    }
}

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

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

    int ans = 0;
    if (A >= K) {
        ans += K;
    }
    else {
        ans += A;
        K -= A;
        if (B < K) {
            K -= B;
            ans += K * -1;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
import java.util.*;


public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n=Integer.parseInt(line);
        line = sc.nextLine();
        int k=Integer.parseInt(line);
        line = sc.nextLine();
        int q=Integer.parseInt(line);
        line = sc.nextLine();
        int p=Integer.parseInt(line);
        int ans=0;
        for(int i=0;i<n;i++){
            if(i<k)ans+=q;
            else ans+=p;
        }
        System.out.println(ans);
        
    }
}

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

#define MOD (1000000007)

using namespace std;

typedef long long int Int;

Int N;

vector<pair<int,int> > uv[100000+10];
bool used[100000+19];
int color[100000+10];

void dfs(int node,int prev) {

    for(int i = 0;i < uv[node].size();i++) {
        int u = uv[node][i].first;
        if(used[u])
            continue;
        used[u] = true;
        
        if((uv[node][i].second + prev) % 2 == 0) {
            color[u] = 0;
            
            dfs(u,0);
        } else {
            color[u] = 1;
            dfs(u,1);
        }
    }

    return;
}

int main(void) {
    cin>>N;

    for(int i = 1;i < N;i++) {
        int u,v,w;
        cin>>u>>v>>w;
        u--;
        v--;
        uv[u].push_back(make_pair(v,w));
        uv[v].push_back(make_pair(u,w));
    }

    used[0] = true;
    dfs(0,0);

    for(int i = 0;i < N;i++) {
        cout<<color[i]<<endl;
    }

    return 0;
}




Measured memory_bytes: 8448
#include<iostream>
#include<vector>
using namespace std;
int main()
{
	int n;
	cin >> n;
	vector<int> v(n);
	for (int i = 0; i < n; i++)
	{
		cin >> v[i];
	}
	for (int i = 0; i < n-1; i++)
	{
		cout << v[n-i-1]<<" ";
	}
	cout << v[0];
	cout << endl;
}


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


void solve(std::string S, std::string T){

    ll count = 0;
    for (ll i =0;i<S.length();i++){
        if (S[i] != T[i]) {
            count++;
        }
    }
    cout << count << endl;
}

int main(){
    std::string S;
    std::cin >> S;
    std::string T;
    std::cin >> T;
    solve(S, T);
    return 0;
}


Measured memory_bytes: 4120
t1,t2 = map(int,input().split())
a1,a2 = map(int,input().split())
b1,b2 = map(int,input().split())
c1,c2 = b1-a1,b2-a2
d = t1*c1 + t2*c2
if d == 0:
  print('infinity')
elif c1 * c2 > 0:
  print(0)
else:
  if c1 < 0:
    c1 *= -1 
    c2 *= -1
    d  *= -1
  top = c1 * t1
  d = -d
  #print(top,d)
  if d < 0:
    print(0)
  elif top % d != 0:
    print(top//d*2+1)
  else:
    print(top//d*2)

Measured memory_bytes: 3064
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<cmath>
using namespace std;
int n,k,d[12],t,i,j,ff,x,f;
int main(){
	scanf("%d %d",&n,&k);
	memset(d,0,sizeof(d));
	for(i=1;i<=k;i++){
		scanf("%d",&ff);
		d[ff]=1;
	}
	for(j=n;;j++){
		x=j,f=0;
		while(x){
			t=x%10;
			if(d[t]==1){
				f=1;
				break;
			}
			x=x/10;
		}
		if(f==0)	break;
	}
	printf("%d",j);
}

Measured memory_bytes: 256
'''
N枚の皿それぞれにa_i個の寿司があり、等確率で皿を選んだ時その皿の寿司を一つ食べる。
その皿に寿司が無い場合は何も行わない。
すべての皿がなくなるまでの操作回数の期待値を求めよ。

terms:
    1<=N<=300
    1<=a_i<=3

input:
3
1 1 1

output:
    5.5

N<=300: O(N^3)が通る

期待値DP。
同じ寿司の量の皿の数にさえ注目すればいいところが鍵。
※PythonもPyPyも遅くて通らない...
再帰をfor文に書き直せばPyPyで通るはず
'''

from collections import defaultdict,deque
import sys, bisect, math, itertools
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


n = inp()
a = inpl()
'''
dp[i][j][k] : 
残り1個の皿がi枚、残り2個の皿がj枚、残り3個の皿がk枚の状態から
すべての寿司をなくすのに必要な回数の期待値
'''
one, two, three = 0, 0, 0
for i in a:
    if i == 1:
        one += 1
    elif i == 2:
        two += 1
    else:
        three+=1
MAX = max(one, two, three)
dp = [[[0.0] * (n + 1) for i in range(n + 1)] for j in range(n + 1)]

for k in range(three+1):
    for j in range(two+three+1):
        for i in range(one+two+three+1):
            if i + j + k == 0 or i + j + k > n:
                continue
            res = 0.0
            if i != 0:
                res += dp[i - 1][j][k] * i
            if j != 0:
                res += dp[i + 1][j - 1][k] * j
            if k != 0:
                res += dp[i][j + 1][k - 1] * k
            res += n
            res *= 1.0 / (i + j + k)
            dp[i][j][k] = res
print(dp[one][two][three])

# 再帰。こっちの方が簡単だがPyPyでは通らない。
# @lru_cache(maxsize=None)
# def rec(i, j, k):
#     if i == 0 and j == 0 and k == 0:
#         return 0.0
    
#     res = 0.0
#     if i != 0:
#         res += rec(i - 1, j, k) * i
#     if j != 0:
#         res += rec(i + 1, j - 1, k) * j
#     if k != 0:
#         res += rec(i, j + 1, k - 1) * k
#     res += n
#     res *= 1.0 / (i + j + k)
#     return res

# print(rec(one, two, three))


'''
dp遷移は
次に引く皿の寿司 = 次の状態 × 確率 として
zero = dp[i][j][k] * (N-i-j-k)/N
one =  dp[i-1][j][k] * i/N
two =  dp[i+1][j-1][k] * j/N
three= dp[i][j+1][k-1] * k/N
dp[i][j][k]= zero + one + two + three + 1
(最後の1で追加しているイメージ)
となる。しかし両辺にdp[i][j][k]があると更新できない。(自己ループ)
よってこれをdp[i][j][k]について解くと
dp[i][j][k] = (one + two + three + 1)*N/(i+j+k)

dp[i][j][k] = (dp[i-1][j][k]*i + dp[i+1][j-1][k]*j + dp[i][j+1][k-1]*k + N)/(i+j+k)

ただし、それぞれが0の時に例外処理が必要。
'''

Measured memory_bytes: 256264
#include<stdio.h>
int main(){
	int x,y;
	scanf("%d %d",&x,&y);
	if(x==2 && y==2){
		printf("Yes\n");
		return 0;
	}
	switch(x){
	case 1:
		if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	case 2:
		printf("No\n");
		return 0;
	case 3:
		if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	case 4:
		if(y==4 || y==6 || y==9 || y==11)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	case 5:
		if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	case 6:
		if(y==4 || y==6 || y==9 || y==11)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	case 7:
		if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	case 8:
		if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	case 9:
		if(y==4 || y==6 || y==9 || y==11)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	case 10:
		if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	case 11:
		if(y==4 || y==6 || y==9 || y==11)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	case 12:
		if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)
			printf("Yes\n");
		else
			printf("No\n");
		return 0;
	}
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <stack>
#include <math.h>
#include <vector>
#include <string>
#include <algorithm>
#include <map>

#define rep(i,n) for(int i=0; i < n; i++)
using ll =  long long;
using namespace std;

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

    if(s == "ABC") cout << "ARC" << endl;
    else cout << "ABC" << endl;
    return 0;
}

Measured memory_bytes: 3596
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main(){

    input!{
        n: usize,
        p: [usize;n],
        q: [usize;n],
    }

    let mut t:Vec<usize> = (1..n+1).collect();
    let mut a:i64 = 0;
    let mut b:i64 = 0;
    let mut c:i64 = 1;
    while{
        if t == p {
            a = c
        }
        if t == q {
            b = c
        }
        c += 1;
        t.next_permutation()
    } {}
    let ans = (a-b).abs();
    println!("{}", ans);

}

pub trait LexicalPermutation {
    fn next_permutation(&mut self) -> bool;
    fn prev_permutation(&mut self) -> bool;
}

impl<T> LexicalPermutation for [T] where T: Ord {
    fn next_permutation(&mut self) -> bool {
        if self.len() < 2 {return false;}
        let mut i = self.len() - 1;
        while i > 0 && self[i-1] >= self[i] {
            i -= 1;
        }
        if i == 0{
            return false;
        }
        let mut j = self.len() - 1;
        while j >= i && self[j] <= self[i-1]{
            j -= 1;
        }
        self.swap(j, i-1);
        self[i..].reverse();
        true
    }

    fn prev_permutation(&mut self) -> bool {
        if self.len() < 2 {return false;}
        let mut i = self.len() - 1;
        while i > 0 && self[i-1] <= self[i] {
            i -= 1;
        }
        if i == 0 {
            return false;
        }
        self[i..].reverse();
        let mut j = self.len() - 1;
        while j >= i && self[j-1] < self[i-1] {
            j -= 1;
        }
        self.swap(i-1, j);
        true
    }

}






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


int main() {
  int N,K;
  cin>>N>>K;
  int A[110];
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  bool dp[101000]={};
  for(int i=1;i<=K;i++){
    for(int j=0;j<N;j++){
      if(i-A[j]>=0) dp[i]|= !(dp[i-A[j]]);
    }
  }
  if(dp[K]){
    cout<<"First"<<endl;
  }
  else{
    cout<<"Second"<<endl;
  }
  return 0;
}



Measured memory_bytes: 3728
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int N;
ll a[10000 + 10];
ll b[10000 + 10];

int main() {
  ios::sync_with_stdio(false);
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < N; ++i) {
    cin >> b[i];
  }
  ll dab = 0, dba = 0;
  for(int i = 0; i < N; ++i) {
    if (a[i] > b[i]) {
      dab += a[i] - b[i];
    } else dba = b[i] - a[i];
  }


  for(int i = 0; dab > 0 && i < N; ++i) {
    if (a[i] < b[i]) {
      dab -= (b[i] - a[i]) / 2;
    }
  }
  if (dab > 0) {
    cout << "No";
  } else cout << "Yes";
}

Measured memory_bytes: 384
#include <stdio.h>

int main() {
  int N, verdict[4] = {0}; // AC, WA, TLE, RE
  scanf("%d", &N);

  for(int i = 0; i < N; i++) {
    char str[5];
    scanf("%s", str);
    switch(str[0]) {
      case 'A':
        verdict[0]++;
        break;
      case 'W':
        verdict[1]++;
        break;
      case 'T':
        verdict[2]++;
        break;
      case 'R':
        verdict[3]++;
        break;
    }
  }

  printf("AC x %d\n", verdict[0]);
  printf("WA x %d\n", verdict[1]);
  printf("TLE x %d\n", verdict[2]);
  printf("RE x %d\n", verdict[3]);
  return 0;
}

Measured memory_bytes: 1736
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

const int MX = 200020;
int bit[MX];
int sum(int i){
	int res = 0;
	for(i++; i; i -= i & -i) res += bit[i];
	return res;
}
void add(int i, int x){
	for(i++; i < MX; i += i & -i) bit[i] += x;
}

void solve(vi &d, vi &u, const vector<tuple<int,int,int>> &in){
	memset(bit, 0, sizeof(bit));
	int n = in.size(), lower = 0;
	d.resize(n);
	u.resize(n);
	rep(i, n){
		int x, id, y; tie(id, x, y) = in[i];
		d[id] = sum(y);
		u[id] = i - sum(y);
		add(y, 1);
	}
}

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	int n; cin >> n;
	vector<tuple<int,int,int>> in;
	{
		vi ys;
		vector<pi> xy;
		rep(i, n){
			int x, y; cin >> x >> y;
			xy.emplace_back(x, y); ys.pb(y);
		}
		sort(all(ys)); ys.erase(unique(all(ys)), ys.end());
		rep(i, n) in.emplace_back(i, xy[i].first, lower_bound(all(ys), xy[i].second) - ys.begin());
	}
	
	vi lu, ld, ru, rd;
	sort(all(in), []
		(tuple<int,int,int> a, tuple<int,int,int> b){
			return get<1>(a) < get<1>(b);
		});
	solve(ld, lu, in);
	reverse(all(in));
	solve(rd, ru, in);
	
	const int mod = 998244353;
	auto calc = [&](ll x){
		ll res = 1, p = 2;
		for(; x; x /= 2){
			if(x & 1) res = res * p % mod;
			p = p * p % mod;
		}
		return (res + mod - 1) % mod;
	};
	
	//dbg(ld, lu, rd, ru);
	
	ll ans = 0;
	rep(i, n){
		ll l = calc(ld[i]), r = calc(rd[i]);
		ll L = calc(lu[i]), R = calc(ru[i]);
		
		//自分がいる場合
		ans += calc(n - 1) + 1;
		
		//いない
		//2こ
		ans += L * r % mod;
		ans += l * R % mod;
		//3こ
		ans += L * l % mod * r % mod;
		ans += l * r % mod * R % mod;
		ans += r * R % mod * L % mod;
		ans += R * L % mod * l % mod;
		//4こ
		ans += l * r % mod * R % mod * L % mod;
		
		ans %= mod;
	}
	cout << ans % mod << endl;
	return 0;
}

Measured memory_bytes: 8944
#coding=utf-8

_, a, b = map(lambda s:int(s), raw_input().split())
ss = raw_input()

addmission_a = 0
addmission_b = 0

for s in ss:
    if s == 'a':
        if addmission_a + addmission_b < a + b:
            print "Yes"
            addmission_a += 1
        else:
            print "No"

    if s == 'b':
        if addmission_a + addmission_b < a + b and addmission_b < b:
            print "Yes"
            addmission_b += 1
        else:
            print "No"

    if s == 'c':
        print "No"


Measured memory_bytes: 3076
#include <iostream>
#include <algorithm>

using namespace std;
int main(){
	long long i,j,n,k,c = 0 ,d = 0,ans1,ans2;
	cin >> n >> k;
	if(k%2!=0){
		for(i=1;i<=n;i++){
			if(i%k==0){
				c++;
			}
		}
		if(c==1){
			cout << 1 << endl;
		}else{
			cout << c*c*c << endl;
		}
	}else{
		long long m = k/2;
		for(i=1;i<=n;i++){
			if(i%k==0){
				c++;
			}
			if(i%k==m){
				d++;
			}
		}
		if(c==1){
			ans1 = 1;
		}else{
			ans1 = c*c*c;
		}
		if(d==1){
			ans2 = 1;
		}else{
			ans2 = d*d*d;
		}
		cout << ans1 + ans2 << endl;
	}
}
		

Measured memory_bytes: 256
import java.util.ArrayDeque;
import java.util.Scanner;

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

		ArrayDeque<Long> que = new ArrayDeque<>();

		long i;
		for(i = 1; i <= 9; i++)
			que.addFirst(i);

		long cnt = 0;
		long temp = 0;
		long modTen = 0;

		while(cnt < k) {
			cnt++;
			temp = que.pollLast();
			modTen = temp % 10;

			if(modTen != 0)
				que.addFirst(temp * 10 + modTen - 1);

			que.addFirst(temp * 10 + modTen);

			if(modTen != 9)
				que.addFirst(temp * 10 + modTen + 1);
		}

		System.out.println(temp);

	}
}


Measured memory_bytes: 30164
import java.util.Scanner;

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

	int a = scan.nextInt();
	int b = scan.nextInt();
	double x = (a+b)/2.0;

	System.out.println((int)Math.ceil(x));
    }
}
	


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
const ll INF = 1e9+100;
const ll MOD = 1e9+7;
const bool debug = 0;
//-----------------------------------------------//

int main() {
	map<string, int> m;
	
	int N;
	cin >> N;
	REP(i, N) {
		string str;
		cin >> str;
		m[str]++;
	}
	
	cin >> N;
	REP(i, N) {
		string str;
		cin >> str;
		m[str]--;
	}
	
	int ans = 0;
	for (map<string, int>::iterator it = m.begin(); it != m.end(); ++it) {
		chmax(ans, it->se);
	}
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
 int N;
 cin>>N;
 if(N>=64)cout<<64<<endl;
 else if(N<64&&N>=32)
  cout<<32<<endl;
  else if(N<32&&N>=16)
  cout<<16<<endl;
  else if(N<16&&N>=8)
  cout<<8<<endl;
  else if(N<8&&N>=4)
  cout<<4<<endl;
  else if(N<4&&N>=2)
  cout<<2<<endl;
  else if(N<2)
  cout<<1<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define rep(i, n)    for(ll i = 0; i < (n); ++i)
#define repA(i, a, n)  for(ll i = a; i <= (n); ++i)
#define repD(i, a, n)  for(ll i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (ll)(x).size()
#define unique_sort(x) (sort(x.begin(), x.end()), x.resize(distance(x.begin(), unique(x.begin(), x.end()))))
#define fill(a)  memset(a, 0, sizeof (a))
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
const ll mod = 1e9+7;

int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    ll tt=1;
        // cin >> tt;
    while((tt)--){
        ll n; cin >> n;
        string s[n];
        map<string,ll> mp;

        rep(i,n){
            cin >> s[i];
            mp[s[i]]++;
        }
        ll mx = -10000000000;
        trav(i,mp){
            mx = max(mx,i.ss);
        }
        // cout << mx << endl;
        trav(i,mp){
            if(i.ss==mx){
                cout << i.ff <<endl;
            }
        }
    }
}


Measured memory_bytes: 25472
package main

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

var (
	read  = bufio.NewReader(os.Stdin)
	write = bufio.NewWriter(os.Stdout)
)

func main() {
	defer write.Flush()

	var n, r int
	fmt.Fscan(read, &n, &r)

	if n < 10 {
		r = r + 100*(10-n)
	}
	fmt.Fprintln(write, r)
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define FOR(i) for(cin>>i;i>0;i--)
#define elif else if
#define pb push_back
#define ll long long
#define mp make_pair
#define all(x) x.begin(),x.end()
#define re(x) {cout<<x<<endl;return 0;}
//#define x first
//#define y second

using namespace std;
int a;
int main()
{
	cin>>a;
	re((1000-a%1000)%1000)
	return 0;}

Measured memory_bytes: 3648
#include<iostream>
#include<string>
#include <algorithm>
#include <cstdlib>
using namespace std;

int main(){
    int n;
    cin >> n;
    string s1, s2;
    int p1=0, p2=0;
    for(int i=0; i <n ;i++){
        cin >> s1 >> s2;
        if (s1 > s2){
            p1 += 3;
        }else if (s1 < s2){
            p2 += 3;
        }else{
            p1 +=1;
            p2 +=1;
        }
    }
    cout << p1 <<" " <<p2 <<endl;
 


  return 0;
}


Measured memory_bytes: 3152
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
using pll = pair<ll,ll>;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define repr4(i,s,n) for(ll i = (n);i>=(s);i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll,ll>>>;
using mat = vector<vector<ll>>;
using vec = vector<ll>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/
const int mod = 1000000007;



int main(){
int N;
cin>>N;
string s,t;
cin>>s>>t;
rep(i,N){
    if(s.substr(i,N-i)==t.substr(0,N-i)){
        cout<<i+N<<endl;
        return 0;
    }
}
cout<<2*N<<endl;
return 0;
}

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

int main(){
  double x1, y1, x2, y2;
  scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
  double z = sqrt( pow(( x1 - x2), 2) + pow(( y1 - y2 ), 2));
  printf("%f\n", z);

  return 0;
}

Measured memory_bytes: 3256