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

// using namespace std;

// #define inf 1<<30
// #define llong long long
// #define usd unsigned
// #define pqueue priority_queue
// #define mp make_pair
// #define pb push_back
// #define fn fill_n
// typedef pair<int, int> P;
// typedef struct data{
// 	int now;
// 	int cost;
// }data;
// int nw[9] = {0, 1, 0, -1, -1, 1, 1, -1, 0};
// int nh[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
// int a,b,c,d, A[100], B[100], C[100][100], D[100][100][100];
// string s, t, r;




// int main(){
// 	cin >> a >>b >>c;
// 	cout << min(min(abs(a-b)+abs(b-c), abs(b-c)+abs(c-a)), abs(c-a)+abs(a-b)) << endl;

// 	return 0;
// }

#include <bits/stdc++.h>

using namespace std;

#define inf 1<<30
#define llong long long
#define usd unsigned
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define fn fill_n
typedef pair<int, int> P;
typedef struct data{
	int now;
	int cost;
}data;
int nw[9] = {0, 1, 0, -1, -1, 1, 1, -1, 0};
int nh[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
int a,b,c,d, A[100], B[100], C[100][100], D[100][100][100];
string s, t, r;




int main(){
	cin >> s >> t;
	r = s;
	for(int i = 0; i <= t.size(); i++){
		r += r[0];
		r.erase(r.begin());
		if(r == t){
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
//package src.com.jetman.atcoder;

import java.util.*;

/**
 * @description:
 * @author: Jetman
 * @create: 2020-08-29 14:39
 **/
public class Main {

    Scanner sc = new Scanner(System.in);

    long MOD = 1000000000 + 7;

    long dp[][];

    private void slove() {

        long n = sc.nextLong();

        long ans = 0;
        for (int i = 1; i <= n ; i++) {
            long tmp = n%i == 0 ? 1L:0L;
            ans += (n/i-tmp);
        }

        System.out.println(ans);



    }

    private void build(Map<Integer, List<Integer>> edge, int l, int r) {
        List<Integer> list = edge.getOrDefault(l, new ArrayList<>());
        list.add(r);
        edge.put(l,list);
    }


    public static void main(String[] args) {
        new Main().slove();
    }
}


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

using namespace std ;
typedef long long ll;
typedef string str;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll ;
typedef vector<int> vint;
typedef vector<double> vdou ;
typedef vector<ll> vll;
typedef vector<vint> vvint;
typedef vector<str> vstr;
typedef vector<pii> vpii ;
typedef vector<pll> vpll ;

#define REP(i, n) for (ll (i) = 0; (i) < (ll)(n); i++) 
#define FOR(i, a, b) for(ll (i) = a; (i) < (ll)b; i++)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define CHI 1000000000000000003
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define NP next_permutation
#define SZ(x)  (ll)x.size()
#define SP(x)  setprecision((ll)x)

const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
const double PI = M_PI;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

void yes(){
  cout <<"Yes"<<endl ;
}
void no(){
  cout <<"No"<<endl ;
}
//-----------------------------------------

vll yakusuu(ll n){
    vll ret ;
    for(ll i=1;i*i<=n;i++){
        if(n%i==0){
            ret.push_back(i) ;
            if(i*i!=n){
                ret.push_back(n/i) ;
            }
        }
    }
    sort(ALL(ret)) ;
    return ret ;
}












//-----------------------------------------
int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n ;
  cin >> n ;
  vll bnm = yakusuu(n) ;
  vll ans ;
  REP(i,SZ(bnm)){
    ans.PB(max(log10(bnm[i])+1,log10(n/bnm[i])+1)) ;
  }
  sort(ALL(ans)) ;
  cout << ans[0] <<endl ;
  
  
  
  
  return 0 ;
}



Measured memory_bytes: 384
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())

print(a[K - 1])


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

unsigned long long x;

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

  cin >> x;
  unsigned long long init = 100;
  int c = 0;
  while(init < x) {
    c++;
    init *= 1.01;
  }

  cout << c << endl;
}

Measured memory_bytes: 3636
from collections import deque

N = int(input())
A_deque = deque(int(e) for e in input().split())

section = list()
section.append(A_deque.popleft())
ans = 1
mode = 0

while 1:
    if len(A_deque) == 0:
        break
    elif mode == 0:
        next = A_deque.popleft()
        if section[-1] == next:
            section.append(next)
        elif section[-1] > next:
            section.append(next)
            mode = -1
        elif section[-1] < next:
            section.append(next)
            mode = 1
    elif mode == 1:
        next = A_deque.popleft()
        if section[-1] > next:
            section.clear()
            section.append(next)
            ans += 1
            mode = 0
        else:
            section.append(next)
    elif mode == -1:
        next = A_deque.popleft()
        if section[-1] < next:
            section.clear()
            section.append(next)
            ans += 1
            mode = 0
        else:
            section.append(next)

print(ans)

Measured memory_bytes: 20656
import java.util.Scanner;

public class Main{
	public static void main(String [] args)
	{
		Scanner stdin = new Scanner (System.in);
		int num = stdin.nextInt();
		int result = 0;
		if(num >= 1 && num <= 1000 ){
				result = num*num*num;
		}
		System.out.println(result);
	}
}

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

using namespace std;
using ll = long long;

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> hs(n);
  rep(i, n) cin >> hs[i];
  sort(hs.begin(), hs.end());
  ll ans = 0;
  rep(i, n - k) ans += hs[i];
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4040
// CppPractice.cpp : アプリケーションのエントリ ポイントを定義します。
//

//#include "stdafx.h"
#include <iostream>
#include<algorithm>

using namespace std;

int main()
{
	int W,H,x,y,r;
	cin >> W >> H >> x >> y >> r;

	if (x >= r && y >= r && x <= W - r && y <= H - r) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
    return 0;
}



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

int main() {
  string input;
  int count = 0;
  cin >> input;

  if(input == "RRR") cout << 3 << endl;
  if(input == "RRS") cout << 2 << endl;
  if(input == "RSR") cout << 1 << endl;
  if(input == "RSS") cout << 1 << endl;
  if(input == "SRR") cout << 2 << endl;
  if(input == "SRS") cout << 1 << endl;
  if(input == "SSR") cout << 1 << endl;
  if(input == "SSS") cout << 0 << endl;

}

Measured memory_bytes: 3624
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not a)
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
bool test = 0;
int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
#define MAX (int)1e6 + 5

signed main(void) {
	ll i, j, k, l;
	string s;
	ll sum = 0;
	cin >> s;
	rep(i, 1 << (s.size()-1)) {
		vector<ll> a;
		rep(j, s.size()-1) {
			if ((i >> j) & 1) a.push_back(j);
		}
		a.push_back(s.size()-1);
		sum += stoll(s.substr(0, a[0] + 1));
		rep(j, a.size()-1) {
			sum += stoll(s.substr(a[j] + 1, a[j + 1] - a[j]) );
		}
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Library;
using static Library.Input;

namespace AtCoderTemplate
{
    class ProgramB
    {
        private class Question : IComparable<Question> {
            public long L {get;set;}
            public long R {get;set;}
            public long A {get;set;}
            public long B {get;set;}
            public int CompareTo(Question item) {
                if (item.A != this.A) return this.A.CompareTo(item.A);

                return - this.B.CompareTo(item.B);
            }
        }
        static void Main()
        {
            int n = NextInt;
            var questions = TakeLine(n).Select(l => new Question{L = l[0], R = l[1] + 1}).OrderBy(q => q.L).ThenBy(q => q.R).ToArray();
            
            long maxL = questions.Max(q => q.L), minR = questions.Min(q => q.R);
            foreach (var question in questions)
            {
                question.A = Math.Max(0, question.R - maxL);
                question.B = Math.Max(0, minR - question.L);
            }

            Array.Sort(questions);

            var arrayB = Enumerable.Repeat(questions.First().B, n - 1).ToArray();
            var arrayA = Enumerable.Repeat(questions.Last().A, n - 1).ToArray();
            for (int i = 2; i < n; i++)
            {
                arrayB[i - 1] = Math.Min(arrayB[i - 2], questions[i - 1].B);
            }
            for (int i = n - 2; i > 0; i--)
            {
                arrayA[i - 1] = Math.Min(arrayA[i], questions[i].A);
            }

            System.Console.WriteLine(Math.Max(arrayA.Zip(arrayB, (x, y) => x + y).Max(), questions.Max(q => q.R - q.L) + Math.Max(minR - maxL, 0)));
        }
    }
}

namespace Library
{
    class Input
    {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line => Console.ReadLine();

        public static string[] StrArr => Line.Split(' ');

        public static int NextInt => int.Parse(NextWord());

        public static long NextLong => long.Parse(NextWord());

        public static List<int> IntList => StrArr.Select(int.Parse).ToList();

        public static List<long> LongList => StrArr.Select(long.Parse).ToList();

        public static IEnumerable<long[]> TakeLine(int N)
        {
            return Enumerable.Repeat(0, N).Select(_ => Console.ReadLine().Split(' ').Select(long.Parse).ToArray());
        }

        public static string NextWord()
        {
            while (!enumerator.MoveNext())
            {
                enumerator = StrArr.AsEnumerable().GetEnumerator();
            }
            return enumerator.Current;
        }
    }
}


Measured memory_bytes: 35372
#include<iostream>
#include<algorithm>
#include<bitset>
#include<vector>
using namespace std;
int H, W, K;
char town[51][51];
int ans = 0;
int dp[52][52][4][5][5][1 << 10] = {};
int ac[5][5] = { { 10, 10, 10, 10, 10 },
{ 10, 3, 6, 8, 9 },
{ 10, 2, 5, 7, 10 },
{ 10, 1, 4, 10, 10 },
{ 10, 0, 10, 10, 10 }
};

int solve() {
	dp[1][1][0][1][1][1 << 3] = 1;
	for (int k = 0; k <= K; k++) {
		for (int i = 1; i <= H; i++) {
			for (int j = 1; j <= W; j++) {
				for (int x = 1; x <= 4; x++) {
					for (int y = 1; y <= 4; y++) {
						for (int st = 0; st < (1 << 10); st++) {
							if (dp[i][j][k][x][y][st] <= 0) continue;
							bitset<11> bit(st);
							int b[11] = {};
							for (int q = 0; q < 10; q++) {
								if (bit[q]) b[q] = 1;
							}
							int to = 0;
							int res = dp[i][j][k][x][y][st];
							//east
							if (town[i][j + 1] != '#') {
								to |= b[1];
								to |= b[2] << 1;
								to |= b[3] << 2;
								to |= b[5] << 4;
								to |= b[6] << 5;
								to |= b[8] << 7;
								if (b[ac[x - 1][y]] == 0 && '1' <= town[i][j + 1] && town[i][j + 1] <= '9') res += town[i][j + 1] - '0';
								to |= 1 << ac[x][y];

								dp[i][j + 1][k][x][y][to] = max(dp[i][j + 1][k][x][y][to], res);
							}
							//south
							to = 0;
							res = dp[i][j][k][x][y][st];
							if (town[i + 1][j] != '#') {
								to |= b[1] << 4;
								to |= b[2] << 5;
								to |= b[3] << 6;
								to |= b[5] << 7;
								to |= b[6] << 8;
								to |= b[8] << 9;
								if (b[ac[x][y - 1]] == 0 && '1' <= town[i + 1][j] && town[i + 1][j] <= '9') res += town[i + 1][j] - '0';
								to |= 1 << ac[x][y];

								dp[i + 1][j][k][x][y][to] = max(dp[i + 1][j][k][x][y][to], res);
							}
							if (k < K) {
								//west
								res = dp[i][j][k][x][y][st];
								if (town[i][j - 1] != '#') {
									if (b[ac[x + 1][y]] == 0 && '1' <= town[i][j - 1] && town[i][j - 1] <= '9') res += town[i][j - 1] - '0';
									to = st | (1 << ac[x + 1][y]);
									dp[i][j - 1][k + 1][x + 1][y][to] = max(dp[i][j - 1][k + 1][x + 1][y][to], res);
								}
								//north
								res = dp[i][j][k][x][y][st];
								if (town[i - 1][j] != '#') {
									if (b[ac[x][y + 1]] == 0 && '1' <= town[i - 1][j] && town[i - 1][j] <= '9') res += town[i - 1][j] - '0';
									to = st | (1 << ac[x][y + 1]);
									dp[i - 1][j][k + 1][x][y + 1][to] = max(dp[i - 1][j][k + 1][x][y + 1][to], res);
								}
							}
						}
					}
				}
			}
		}
	}
	for (int k = 0; k <= K; k++) {
		for (int x = 1; x <= 4; x++) {
			for (int y = 1; y <= 4; y++) {
				for (int st = 0; st < (1 << 10); st++) {
					ans = max(ans, dp[H][W][k][x][y][st]);
				}
			}
		}
	}
	return ans - 1;
}

void input() {
	cin >> H >> W >> K;
	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			cin >> town[i][j];
		}
	}
}

int main() {
	input();
	cout << solve() << endl;
	return 0;
}


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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

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

using ll = long long;

using namespace std;

int main() {
  in(int, h, w);
  int H = h + 2, W = w + 2;

  vector<string> s(H);
  s[0] = s[H - 1] = string(W, '#');
  rep(i, h) {
    in(string, row);
    s[i + 1] = '#' + row + '#';
  }

  vector<vector<int>> left(H, vector<int>(W)), right = left, top = left,
                                               bottom = left;
  rep(r, H) {
    for (int c = 1; c < W - 1; ++c) {
      left[r][c] = (s[r][c - 1] == '#') ? 0 : left[r][c - 1] + 1;
      dbg(r, c, left[r][c]);
    }
    for (int c = W - 2; c > 0; --c) {
      right[r][c] = (s[r][c + 1] == '#') ? 0 : right[r][c + 1] + 1;
      dbg(r, c, right[r][c]);
    }
  }
  rep(c, W) {
    for (int r = 1; r < H - 1; ++r) {
      top[r][c] = (s[r - 1][c] == '#') ? 0 : top[r - 1][c] + 1;
      dbg(r, c, top[r][c]);
    }
    for (int r = H - 2; r > 0; --r) {
      dbg(r, c);
      bottom[r][c] = (s[r + 1][c] == '#') ? 0 : bottom[r + 1][c] + 1;
      dbg(r, c, bottom[r][c]);
    }
  }
  int ans = 0;
  rep(r, H) rep(c, W) if (s[r][c] == '.') {
    ans = max(ans, left[r][c] + right[r][c] + top[r][c] + bottom[r][c] + 1);
  }
  out(ans);
}


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

#define select(_1, _2, x, ...) x

#define repn(i, n) for (int i = 0; i < (n); i++)
#define repr(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, ...) select(__VA_ARGS__, repr, repn)(i, __VA_ARGS__)

#define rrepn(i, n) for (int i = (n - 1); i >= 0; i--)
#define rrepr(i, a, b) for (int i = (b - 1); i >= (a); i--)
#define rrep(i, ...) select(__VA_ARGS__, rrepr, rrepn)(i, __VA_ARGS__)

#define all(v) v.begin(), v.end()
#define debug(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;

const int INF = 1e9;
const ll LINF = 1e18;


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

    if (s[0] == s[1] && s[1] == s[2])
        cout << "No" << endl;
    else
        cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>

int N, K;
std::vector<int> V;

int main(){
   std::cin >> N >> K;
   V.resize(N);
   for(int i=0; i<N; ++i)
      std::cin >> V[i];

   int M = std::min(N,K);
   int ans = 0;
   for(int i=0; i<=M; ++i){
      for(int j=0; j<=i; ++j){
	 std::vector<int> tmp;
	 for(int l=0; l<j; ++l)
	    tmp.push_back(V[l]); 
	 for(int r=0; r<i-j; ++r)
	    tmp.push_back(V[N-1-r]); 
	 std::sort(tmp.begin(),tmp.end());
	 int value = 0;
	 int count = 0;
	 for(int k=0; k<i; ++k)
	    value += tmp[k];
	 for(int k=0; k<K-i && k<i; ++k)
	    if(tmp[k]<0) value -= tmp[k];
	 ans = std::max(ans,value);
      }
   }
   std::cout << ans << std::endl;
   return 0;

}


Measured memory_bytes: 256
N, M = [int(element) for element in input().split(" ")]
AList = [int(element) for element in sorted(input().split(" "), key=int)]
AList = AList[::-1]

count = 0
s = sum(AList) / (4 * M)

text = "Yes"

for n in range(M):
    if AList[n] < s:
        text = "No"
        break
    
print(text)

Measured memory_bytes: 3064
// C.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;

typedef long long LL;

int main(int argc, char* argv[]) {
	LL x, k, d;
	cin >> x >> k >> d;
	if (x < 0) x = -x;
	LL r = min(k, x / d);
	x -= r * d;
	k -= r;
	LL ans = k % 2 ? abs(x - d) : x;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
const long INF=1000000000000000;

void bfs(long p,vector<vector<long>> &edge,vector<long> &cost,vector<long> &ans){
    for(int i=0;i<edge.at(p).size();i++){
        if(ans.at(edge.at(p).at(i))== -1){
            ans.at(edge.at(p).at(i))=ans.at(p)+cost.at(edge.at(p).at(i));
            bfs(edge.at(p).at(i),edge,cost,ans);
        }
    }
}


int main() {
    string s,t;
    cin>>s>>t;
    
    long N=s.size();
    
    vector<set<long>> alpc(26,set<long>());
    
    for(int i=0;i<N;i++){
        alpc.at(s.at(i)-'a').insert(i);
        alpc.at(s.at(i)-'a').insert(N+i);
    }
    
    long ans=0,point=-1;
    
    for(int i=0;i<t.size();i++){
        //cout<<point<<endl;
        if(alpc.at(t.at(i)-'a').size()==0){
            cout<<-1<<endl;
            return 0;
        }else{
            auto ite=alpc.at(t.at(i)-'a').upper_bound(point);
            ans+=(*ite)-point;
           // cout<<(*ite)-point<<endl;
            point=(*ite)%N;
        }
        
    }
    
    cout<<ans<<endl;
    
}

Measured memory_bytes: 9856
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <map>
const int MOD = 1e9+7;
typedef long long ll;
using namespace std;


int main(){
	int a, b;
	cin >> a >> b;
	for (int i = 1; i <= 1000; i++){
		int p = i*0.08, q = i*0.1;
		if (p == a && q == b){
			cout << i << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}


Measured memory_bytes: 256
/*** akshaykumar99 ***/
 
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
template<typename T> using id_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update> ;
 
#define f(i,x,n) for(i=x;i<n;i++)
#define fr(i,x,n) for(i=x;i>=n;i--)
#define pu push_back           
#define pp pop_back
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SP(x) fixed<<setprecision(x)
#define IOS() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
const long long MOD = 1e9+7;
const long double PI = acos(-1);
const long long INF = INT_MAX;
const long long LINF = LLONG_MAX;
const long long N = 5e5+1;
 
typedef long long ll;
typedef long double ld;  

void test_case()
{  
    vector<ll> res;
    ll n,i,j;
    cin >> n;
    if(n == 0)
        res.pu(n);
    while(n>0)
    {
        res.pu((n-1)%26);
        n=(n-1)/26;
    }
    reverse(all(res));
    for(auto u : res)
        cout << char(u + 'a');
    cout << '\n';

}
 
int32_t main()
{
    IOS(); 
   
    int tc=1;
    while(tc--)
        test_case();
    return 0;
}

Measured memory_bytes: 3612
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
using namespace std;
int sz[110000];
int p[110000];
int main(){
	int a,b;scanf("%d%d",&a,&b);
	for(int i=0;i<a;i++)sz[i]=1;
	p[0]=1;
	for(int i=0;i<b;i++){
		int s,t;scanf("%d%d",&s,&t);s--;t--;
		if(p[s]){
			p[t]=1;
			if(sz[s]==1)p[s]=0;
		}
		sz[s]--;
		sz[t]++;
	}
	int ret=0;
	for(int i=0;i<a;i++)if(p[i])ret++;
	printf("%d\n",ret);
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define INF 999999999
#define rep(i,n) for(int i=0;i<n;i++)
const int MOD = 1000000007;
ll cnt =1;

int main(){
    int a,b,c;  cin >> a>>b>>c;
    cout << min(min(a+b,a+c),b+c) << endl;
    return 0;
}

Measured memory_bytes: 256
//Written by Zhu Zeqi
//Come on,baby
//Hack,please
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#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<string.h>
#include<stdlib.h>
#include<stdio.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#define MAX 100000000000000000
#define MOD 1000000007
#define PI 3.141592653589793238462
#define INF 1000000000
typedef long long ll;
//orz yht
using namespace std;
int main(){
	//freopen("input.in","r",stdin);
	//freopen("output.out","w",stdout);
	int n,k,sol=0,ans=n,a[5005];
    cin>>n>>k;
    ans=n;
    for(int i=0;i<n;i++)
	cin>>a[i];
    sort(a,a+n);
    for(int i=n-1;i>=0;i--){
        if(sol+a[i]<k){
        	sol+=a[i];
		}
		else
		ans=i;
    }
    cout<<ans;
	//system("pause");
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		//sc.useDelimiter("\n");

		String strBefore = new String(sc.nextLine());
		//String strBefore = new String("fAIR, LATER, OCCASIONALLY CLOUDY.");
		
		ArrayList<String> charBefore = new ArrayList<>();
		ArrayList<String> charAfter = new ArrayList<>();
		
		for(int i = 0; i < strBefore.length(); i++) {
			charBefore.add(strBefore.substring(i, i + 1));
			charAfter.add(charBefore.get(i).toUpperCase());
			if(charBefore.get(i).equals(charAfter.get(i))) {
				charAfter.set(i, charBefore.get(i).toLowerCase());
			}
			System.out.print(charAfter.get(i));
		}
		System.out.println();
	}
}

Measured memory_bytes: 27100
N,M = map(int,input().split())
div =[]
for i in range(2,int(M**(1/2))+2):
    cur = 0
    while M%i==0:
        M = M//i
        cur += 1
    if cur >=1:
        div.append(cur)
if M>1: div.append(1)
div.sort()
mod = 10**9+7
frac = [1]*(N+50)
num = len(frac)
for i in range(len(frac)-1):
    frac[i+1] = frac[i]*(i+1)%mod
finv = [1] * (N+50)
finv[-1] = pow(frac[-1], mod-2, mod)
for i in range(1, num):
  finv[num-1-i] = finv[num-i] * (num-i) % mod
ans = 1
for i in div:
    ans = ans * frac[N+i-1]*finv[N-1]*finv[i]%mod
print(ans)

Measured memory_bytes: 10868
#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, k, x, y, ans, a[1005]; 
int main(){
	scanf("%d%d", &n, &m);
	for(i=1; i<=n; i++){
		scanf("%d", &a[i]);
	}
	sort(a+1, a+n+1);
	for(i=1; i<=m; i++){
		x+=a[i];
	}
	cout << x;
	return 0;
}

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

using namespace std;
typedef long long ll;

int main(){
  ll A, B, N;
  cin >> A >> B >> N;
  
  ll x = min(B-1, N);
  ll ret = (A * x/B) - A * (x / B);
  
  cout << ret << endl;
  return 0;
}

Measured memory_bytes: 3592
#include <iostream>
#include <cmath>
#include <algorithm>
#include <limits>
#include <vector>
#include <bitset>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <time.h>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <cctype>
#include <list>
#include <iterator>
#include <iomanip>

using namespace std;

#define mod 1000000007LL
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(x) ((x)<0?-(x):(x))
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FILL(a,b) memset(a,b,sizeof(a))
#define P1(x) cout<<(x)<<"\n"
#define P2(x,y) cout<<(x)<<" "<<(y)<<"\n"
#define P3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<"\n"
#define P4(x,y,z,k) cout<<(x)<<" "<<(y)<<" "<<(z)<<" "<<(k)<<"\n"
#define pb push_back
#define PII pair<int,int>
#define ll long long
#define VI vector<int> 
#define PLL part<ll,ll>

int main(){
	int n;
	cin>>n;
	cout<<n/3<<"\n";
}

Measured memory_bytes: 256
import itertools
while True:
    n,k=map(int,[input()]+[input()])
    if not n|k:
        break
    a=list()
    b=set()
    for i in range(n):
        a.append(int(input()))
    c=list(itertools.permutations(a,k))
    for i in c:
        s=str()
        for j in i:
            s+=str(j)
        b.add(s)
    print(len(b))

Measured memory_bytes: 8740
#include<iostream>
#include<cmath>
using namespace std;
int a[4];
int main()
{
	int i,j,k,minv=0x7f;
	for(i=1;i<=3;i++)
		cin>>a[i];
		
	for(i=1;i<=3;i++)
		for(j=1;j<=3;j++)
			for(k=1;k<=3;k++)
				if(i!=j && j!=k && k!=i && fabs(a[j]-a[i])+fabs(a[k]-a[j])<minv)
					minv=fabs(a[j]-a[i])+fabs(a[k]-a[j]);
	
	cout<<minv;
	return 0;
 } 

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
int a[15][15];
inline int power(int x){return x*x;}
int main(void)
{
	int i,j,k,n,m,sum1,sum2,ans=0;
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;++i)
	{
		for(j=1;j<=m;++j)scanf("%d",&a[i][j]);
	}
	for(i=1;i<=n;++i)
	{
		for(j=i+1;j<=n;++j)
		{
			sum1=0;
			for(k=1;k<=m;++k)sum1+=power(a[i][k]-a[j][k]);
			sum2=sqrt(sum1);
			if(sum1==sum2*sum2)++ans;
		}
	}
	printf("%d\n",ans);
	return 0;
}


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

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

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

int main() {
    // 前処理
    COMinit();
  
  int n, k0; cin >> n >> k0;
  int k; 
  if (k0 > n-1) {
    k = n-1;
  } else {
    k = k0;
  }
  
  ll ans = 0;
  for (int i = 0; i <= k; i++) {
    ll p = COM(n,i) * COM(n-1, i) % MOD;
    ans = (ans + p) % MOD;
  }
  cout << ans << endl;
}
    

Measured memory_bytes: 12160
K = int(input())
A, B = map(int , input().split(" "))
n = int(A/K)
m = int(B/K)
if K ==1:
  print("OK")
else:
  if n == m and n == A/K:
    print('OK')
  elif n == m:
    print('NG')
  else:
    print('OK')

Measured memory_bytes: 9056
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int a=stdIn.nextInt(),b=stdIn.nextInt(),c=stdIn.nextInt(),d=stdIn.nextInt();
		if(a*b>c*d) System.out.print(a*b);
		else System.out.print(c*d);
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define vi vector<int>
#define forr(i,a,n) for (int i = (a); i < (n); ++i)
#define rforr(i,a,n) for (int i = (a); i > (n); --i)
#define ALL(x) x.begin(),x.end()
#define LEN(X) ((int)(X).size())
#define CASET int _T; cin >> _T; forr(caset,0,_T)
//#define int ll
 
 
int main() {
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    //freopen("input.txt","r",stdin);
    int h, w; cin >> h >> w;
    bool grid[500][500];
    forr(i,0,h) forr(j,0,w) {
        char x; cin >> x;
        grid[i][j] = (x == '.') ? 0 : 1; 
    }

    forr(i,0,h) { 
        forr(j,0,w) {
            if (j==0) cout << '#';
            else if (i%2==0 && j!= w-1) cout << '#';
            else if (grid[i][j]) cout << '#';
            else cout << '.';
        } 
        cout << '\n';
    }
    cout << '\n';

    forr(i,0,h) { 
        forr(j,0,w) {
            if (j==w-1) cout << '#';
            else if (i%2==1 && j!= 0) cout << '#';
            else if (grid[i][j]) cout << '#';
            else cout << '.';
        } 
        cout << '\n';
    }

    return 0; 
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
long long read()
{
	long long x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return (long long)x*f;
}
int n,a,b;
long long s[100007],t[100007];
bool check(long long x)
{
	long long del=1LL*b*x;
	for (int i=1;i<=n;i++) t[i]=s[i]-del;
	long long now=0;
	for (int i=1;i<=n;i++)
		if (t[i]>0) now+=(long long)(t[i]+a-b-1)/(a-b);
	if (now>x) return false;
	return true;
}
int main()
{
	n=read(),a=read(),b=read();
	for (int i=1;i<=n;i++) s[i]=read();
	long long lx=0,rx=1e9;
	while (rx-lx>1)
	{
		long long mid=(lx+rx)/2;
		if (check(mid)) rx=mid; else lx=mid;
	}
	if (check(lx)) printf("%lld\n",lx); else printf("%lld\n",rx);
	return 0;
}


Measured memory_bytes: 1792
#include<iostream>
using namespace std;
typedef long long ll;

int main(){
    ll a, b;
    int n;
    cin >> a >> b >> n;
    ll ans = 1ll<<60;
    for(int i = 1; i <= n; i++){
        if(b%i) continue;
        ll unit = b/i;
        for(int j = 1; j <= n; j++){
            ans = min(ans, abs(j*unit-a));
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3112
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func main() {
	N := nextInt()
	L := make(ints, N)
	for i := 0; i < N; i++ {
		L[i] = nextInt()
	}
	sort.Sort(L)

	c := 0

	for i := 0; i < N-2; i++ {
		for j := i + 1; j < N-1; j++ {
			for k := j + 1; k < N; k++ {
				if L[i]+L[j] > L[k] && L[i] != L[j] && L[j] != L[k] {
					c++
				}
			}
		}
	}

	fmt.Println(c)
}

type ints []int

func (a ints) Len() int           { return len(a) }
func (a ints) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ints) Less(i, j int) bool { return a[i] < a[j] }

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextString())
	return i
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}

func debug(args ...interface{}) {
	fmt.Fprintln(os.Stderr, args)
}


Measured memory_bytes: 1812
#include <iostream>
#include <fstream>
#include <iomanip>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <string>
#include <string.h>
#include <sstream>
#include <ctime>

using namespace std;

#define eps 1e-12
#define pi 3.14159265358979323846
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define bgn begin
#define ll long long
#define ld long double
#define ull unsigned long long
#define ii pair<ll,ll>








const int N = 510;
int n, cnt[N][N], g[N][N], res, p, rw, cl;






bool vld(int rw, int cl)
{
	return (rw >= 0 && rw < n && cl >= 0 && cl < n);
}


bool mdfy(int rw, int cl, int incRw, int incCl)
{
	if(vld(rw + incRw, cl + incCl) && cnt[rw + incRw][cl + incCl] > cnt[rw][cl] + g[rw][cl])
	{
		cnt[rw + incRw][cl + incCl] = cnt[rw][cl] + g[rw][cl];
		return true;
	}
	return false;
}



void mdfyNbr(int rw, int cl)
{
	if(vld(rw, cl))
	{
		if(mdfy(rw, cl, -1, 0))
		{
			mdfyNbr(rw - 1, cl);
		}
		if(mdfy(rw, cl, 1, 0))
		{
			mdfyNbr(rw + 1, cl);
		}
		if(mdfy(rw, cl, 0, -1))
		{
			mdfyNbr(rw, cl - 1);
		}
		if(mdfy(rw, cl, 0, 1))
		{
			mdfyNbr(rw, cl + 1);
		}
	}
	
}







void solve()
{
	cin >> n;
	for(int i = 0; i < n; i++)
	{
		for(int j = 0; j < n; j++)
		{
			cnt[i][j] = min(i, min(n - 1 - i, min(j, n - 1 - j)));
			g[i][j] = 1;
		}
	}
	res = 0;
	for(int i = 1; i <= n*n; i++)
	{
		cin >> p;
		p--;
		rw = p / n;
		cl = p%n;
		res += cnt[rw][cl];
		g[rw][cl] = 0;
		mdfyNbr(rw, cl);
	}
	cout << res << "\n";
}

int main()
{
	std::ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef localProject
	freopen("in.txt","r",stdin);
#endif
	solve();
	return 0;
}

Measured memory_bytes: 28380
def main():
    n, m, l = map(int, input().split())
    A = [list(map(int, input().split())) for _ in range(n)]
    B = [list(map(int, input().split())) for _ in range(m)]
    ans = [[0] * l for _ in range(n)]
    for i in range(n):
        for k in range(l):
            v = 0
            for j in range(m):
                v += A[i][j] * B[j][k]
            ans[i][k] = str(v)
    for a in ans:
        print(' '.join(a))


main()



Measured memory_bytes: 7092
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())
S = list(str(input()))

ans = 0
for i in range(1000):
    nums = list(str(i).zfill(3))
    fir = 0
    cnt = 0
    for num in nums:
        try:
            fir = S[fir:].index(num) + fir + 1
            cnt += 1
        except:
            break
    if cnt == 3:
        # print(str(i).zfill(3))
        ans += 1

print(ans)


Measured memory_bytes: 6536
#include <stdio.h>
#include <math.h>

int main(void)
{	
	int array[128];
	int n, i;

	scanf("%d", &n);
	for (i = 0; i < n; i++)scanf("%d", array + i);
	for (i = n - 1; i >= 0; i--) printf("%d%c", array[i], i ? ' ' : '\n');

	return (0);
}

Measured memory_bytes: 596
import Debug.Trace
import Data.Char

check0 :: String -> Bool
check0 [] = False
check0 (h:_) = h == 'A' 

check1 :: String -> Bool
check1 s = 
    let (_, mm) = splitAt 2 s in
    let (m, _) = splitAt (length mm - 1)  mm in
    let num = length $ filter ('C' ==) m in
    num == 1

check2 :: String -> Bool
check2 s = 
    let (ll, mm) = splitAt 2 s in
    let (m, r) = splitAt (length mm - 1)  mm in
    let (_, l) = splitAt 1 ll in
    and (map isLower l) && and (map isLower r) && and (map (\x -> isLower x || x == 'C') m)

solve :: String -> String
solve s
    |  check0 s && check1 s && check2 s  = "AC"
    | otherwise = "WA"

main :: IO ()
main = do
    s <- getLine
    putStrLn $ solve s

Measured memory_bytes: 380
s = str(input())

if s == 'SUN':
    print(7)
elif s == 'MON':
    print(6)
elif s == 'TUE':
    print(5)
elif s == 'WED':
    print(4)
elif s == 'THU':
    print(3)
elif s == 'FRI':
    print(2)
elif s == 'SAT':
    print(1)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  cin >> H >> W;

  int count = 0;
  vector<string> a(H);
  string sa;
  string e = string(W, '.');

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

    if (sa == e) count++;
    else a.at(i - count) = sa;
  }
  H -= count;

  vector<int> count_list(W, 0);
  int l_counter = 0;
  for (int i = 0; i < W; i++) {
    l_counter = 0;
    for (int j = 0; j < H; j++) {
      if (a.at(j).at(i) == '.') {
        l_counter++;
      }
      if (l_counter == H) count_list.at(i) = 1;
    }
  }

  for (int i = 0; i < H; i++) {
    count = 0;
    for (int j = 0; j < W; j++) {
      if (count_list.at(j) != 0) {
        a.at(i).erase(j - count, 1);
        count++;
      }
    }
  }

  for (int i = 0; i < H; i++) {
    cout << a.at(i) << endl;
  }
}

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

bool comp(int a, int b){
    return a > b;
}

int main(){

    int n, A; cin >> n >> A;
    vector<long long> x(n);
    for(int i = 0; i < n; i++){
        cin >> x[i];
        x[i] -= A;
    }

    sort(x.begin(), x.end(), comp);
    //for(int i = 0; i < n; i++) cout << x[i] << " ";
    vector<vector<long long> > dp(n + 1, vector<long long> (10000, 0));
    dp[0][0] = 1;
    for(int i = 1; i <= n; i++){
        for(int j = 0; j < 10000; j++){
            dp[i][j] += dp[i - 1][j];
            if(j - x[i - 1] >= 0 && j - x[i - 1] < 10000) dp[i][j] += dp[i - 1][j - x[i - 1]];
        }
    }

    /*for(int i = 0; i <= n; i++){
        for(int j = 0; j < 10; j++){
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }*/

    cout << dp[n][0] - 1 << endl;

    return 0;
}


Measured memory_bytes: 4352
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "functional"
#include "ctime"

using namespace std;

//constexpr long long int MOD = 1000000007;
constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


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

	cin >> N;
	vector<vector<int>>v(N, vector<int>(N - 1));
	for (auto &i : v){
		for (auto &j : i) {
			cin >> j;
			j--;
		}
	}
	for (auto &i : v)reverse(i.begin(), i.end());
	queue<int>Q;
	for (int i = 0; i < N; i++) {
		Q.push(i);
	}
	int ed = 0;
	int ans = 0;
	vector<int>used(N);
	while (ed < N) {
		ans++;
		//cout << "turn " << ans << endl;
		//for (auto i : v)cout << i.size() << " ";
		//cout << endl;
		if (Q.empty()) {
			cout << -1 << endl;
			return 0;
		}
		queue<int>P;
		while (!Q.empty()) {
			int cn = Q.front();
			Q.pop();
			if (v[cn].empty())continue;
			if (v[v[cn].back()].back() == cn) {
				if (used[v[cn].back()])continue;
				used[cn] = 1;
				used[v[cn].back()] = 1;
				P.push(cn);
				P.push(v[cn].back());

			}
		}
		while (!P.empty()) {
			int cn = P.front();
			//cout << cn << endl;
			used[cn] = 0;
			P.pop();
			Q.push(cn);
			v[cn].pop_back();
			if (v[cn].empty())ed++;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 4224
Public Class Program
  Shared Sub Main()
    Dim st As String() = Cin.StrArr()
    Dim s As String = st(0)
    Dim t As String = st(1)
    Console.WriteLine(t & s)
  End Sub
End Class

Public Class Cin
  Public Shared Function Str() As String
    Return Console.ReadLine().Trim()
  End Function
  Public Shared Function Int() As Integer
    Return Integer.Parse(Str())
  End Function
  Public Shared Function Lng() As Long
    Return Long.Parse(Str())
  End Function
  Public Shared Function Dbl() As Double
    Return Double.Parse(Str())
  End Function
  Public Shared Function StrArr(Optional separator As String = " ") As String()
    Return Str().Split(separator)
  End Function
  Public Shared Function IntArr(Optional separator As String = " ") As Integer()
    Return Array.ConvertAll(Of String, Integer)(StrArr(separator), AddressOf Integer.Parse)
  End Function
  Public Shared Function LngArr(Optional separator As String = " ") As Long()
    Return Array.ConvertAll(Of String, Long)(StrArr(separator), AddressOf Long.Parse)
  End Function
  Public Shared Function DblArr(Optional separator As String = " ") As Double()
    Return Array.ConvertAll(Of String, Double)(StrArr(separator), AddressOf Double.Parse)
  End Function
End Class

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

int main()
{
  int64_t A, B, C, res = 0;
  cin >> A >> B >> C;
  if (C <= A + B + 1)
  {
    res += C;
  }
  else
  {
    res += A + B + 1;
  }
  res += B;
  cout << res << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
long long MIN(long long a,long long b){
    return a<b?a:b;
}
int main()
{   long long l,r;
    scanf("%lld%lld",&l,&r);
    long long min=2019;
    if(r-l>=2019){
        printf("0");
    }else{
        for(long long i=l;i<r;i++){
            for(long long  j=i+1;j<=r;j++){
                min=MIN((i*j)%2019,min);
            }
        }printf("%lld",min);
    }
    
    return 0;
}


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

using namespace std;

int main() {
    int N, A, B, C, D;
    cin >> N >> A >> B >> C >> D;
    
    B -= A;
    if (B < 0)
        B = -B;
    -- N;

    for (int adds = 0; adds <= N; ++ adds) {
        int subtrs = N - adds;
        
        long long int st1 = 1LL * subtrs * C + B, dr1 = 1LL * subtrs * D + B;
        long long int st2 = 1LL * adds * C, dr2 = 1LL * adds * D;

        if (max(st1, st2) <= min(dr1, dr2)) {
            cout << "YES\n";
            return 0;
        }
    }
    
    cout << "NO\n";
    return 0;
}

Measured memory_bytes: 256
N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]

name_union = set(s) | set(t)
money = {}
for i, n in enumerate(name_union):
  money.setdefault(n, 0)
  money[n] += sum(map(lambda x: 1 if x == n else 0, s))
  money[n] -= sum(map(lambda x: 1 if x == n else 0, t))
#print(money)
#print(money.values())
print(0 if max(money.values()) < 0 else max(money.values()))

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

int main () {
  string n;
  cin >> n;
  for (int i=0; i<n.size(); i++) {
    if (n.at(i) == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

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

typedef pair<int,int> pii;
typedef pair<pii,int> iii;

int N,K,L;
vector<int> G1[200010],G2[200010];
int mem[200010][3] = {0};// *ans 1 2
int ans[200010] = {0};
int sum = 0;
queue<int> Q;
vector<iii> V;

void solve()
{
    for(int i = 1; i < N + 1; i++)
    {
        if(mem[i][1])
        {
            continue;
        }
        Q.push(i);
        while(Q.size())
        {
            int now = Q.front();
            Q.pop();
            if(mem[now][1])
            {
                continue;
            }
            mem[now][1] = i;
            for(int j = 0; j < G1[now].size(); j++)
            {
                Q.push(G1[now][j]);
            }
        }
    }
    for(int i = 1; i < N + 1; i++)
    {
        if(mem[i][2])
        {
            continue;
        }
        Q.push(i);
        while(Q.size())
        {
            int now = Q.front();
            Q.pop();
            if(mem[now][2])
            {
                continue;
            }
            mem[now][2] = i;
            for(int j = 0; j < G2[now].size(); j++)
            {
                Q.push(G2[now][j]);
            }
        }
    }
    for(int i = 1; i < N + 1; i++)
    {
        V.push_back(make_pair(make_pair(mem[i][1],mem[i][2]),i));
    }
    sort(V.begin(),V.end());
    int ad = 0;
    for(int i = 0; i < V.size(); i++)
    {
        sum++;
        mem[V[i].second][0] = ad;
        if(i == V.size() - 1 || V[i].first.first != V[i + 1].first.first || V[i].first.second != V[i + 1].first.second)
        {
            ans[ad] = sum;
            sum = 0;
            ad++;
        }
    }
    for(int i = 1; i < N + 1; i++)
    {
        printf("%d\n",ans[mem[i][0]]);
    }
    return;
}

int main()
{
    scanf("%d%d%d",&N,&K,&L);
    for(int i = 0; i < K; i++)
    {
        int p,q;
        scanf("%d%d",&p,&q);
        G1[p].push_back(q);
        G1[q].push_back(p);
    }
    for(int i = 0; i < L; i++)
    {
        int p,q;
        scanf("%d%d",&p,&q);
        G2[p].push_back(q);
        G2[q].push_back(p);
    }
    solve();
    return 0;
}


Measured memory_bytes: 23284
#include <stdio.h>
int main(){
    int W, H, x, y, r;
    scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
    if(x >= r && y >= r && (W - r) >= x && (H - r) >= y){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 1808
import java.util.Scanner;

class Main
{
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		int[] side = new int[3];
		int n;
		
		n = stdIn.nextInt();
		for (int i = 0; i < n; i++){
			for (int j = 0; j < 3; j++){
				side[j] = stdIn.nextInt();
				side[j] *= side[j];
			}
			if (side[0] == side[1] + side[2]){
				System.out.println("YES");
			}
			else if (side[1] == side[2] + side[0]){
				System.out.println("YES");
			}
			else if (side[2] == side[0] + side[1]){
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
		}
	}
}

Measured memory_bytes: 23396
N = int(input())
h = [0] + list(map(int, input().split()))

dp = [10**100] * (N+2)
dp[1] = 0
for i in range(1, N):
    dp[i+1] = min(dp[i+1], dp[i] + abs(h[i+1] - h[i]))
    if i < N-1:
        dp[i+2] = min(dp[i+2], dp[i] + abs(h[i+2] - h[i]))

print(dp[N])



Measured memory_bytes: 13980
#include <bits/stdc++.h>
#include <vector>
#include <queue>
#include <map>
#include <iostream>
#include <iomanip>
using namespace std;
typedef long long LL;
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)

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

    int a, b;
    vector<bool> IsBFrom0(N,false);
    vector<bool> IsAToN(N,false);
    
    REP(i,M){
        cin >> a >> b;
        if(a==1){
            IsBFrom0[b-1]=true;
        }
        if(b==N){
            IsAToN[a-1]=true;
        }
    }

    REP(i,N){
        if(IsAToN[i]==true && IsBFrom0[i]==true){
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }
    
    cout << "IMPOSSIBLE" << endl;
    return 0;
}

Measured memory_bytes: 3648
#include<iostream>
using namespace std;
typedef long long ll;
int main(){
  ll n,m,cnt=0;
  cin >> n >> m;
  ll x[m],y[m];
  ll ball[n];
  bool red[n];
  fill(ball,ball+n,1);
  fill(red,red+n,false);
  red[0]=true;
  for(int i=0;i<m;i++){
    cin >> x[i]>>y[i];
    x[i]--;
    y[i]--;
    if(red[x[i]]){
      red[y[i]]=true;
    }
    ball[x[i]]--;
    ball[y[i]]++;
    if(ball[x[i]]==0){
      red[x[i]]=false;
    }
  }
  for(int i=0;i<n;i++){
    if(red[i])cnt++;
  }
  cout << cnt << endl;
}


Measured memory_bytes: 2688
h,w = map(int,input().split())
lis = [input() for x in range(h)]
ans_lis = [[0 for x in range(w)] for y in range(h)]

def cnt(y,x):
    if y >= h or x >= w or y < 0 or x < 0:
        return 0
    if lis[y][x] == '#':
        return 1
    return 0

for y in range(h):
    for x in range(w):
        ans = 0
        if lis[y][x] == '.':
            ans += cnt(y+1,x-1)
            ans += cnt(y+1,x)
            ans += cnt(y+1,x+1)
            ans += cnt(y,x-1)
            ans += cnt(y,x+1)
            ans += cnt(y-1,x-1)
            ans += cnt(y-1,x)
            ans += cnt(y-1,x+1)
            ans_lis[y][x] = str(ans)
        else:
            ans_lis[y][x] = '#'
for x in range(h):
    print(''.join(ans_lis[x]))


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

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)

using namespace std;

string s = "CODEFESTIVAL2016";

int main(){
  string t;
  cin >> t;
  int cnt = 0;
  rep(i,(int)t.size()) {
    if( s[i] != t[i] ) ++cnt;
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256