akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <cmath>
using namespace std;
typedef long long i64;
typedef long double ld;
typedef pair<i64,i64> P;
#define rep(i,s,e) for(int i = (s);i <= (e);i++)

int n;
int m;

string A[50];

string B[50];

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

    for(int i = 0;i + m - 1 < n;i++)
    {
        for(int j = 0;j + m - 1 < n;j++)
        {
            bool same = true;
            for(int x = i;x < i + m;x++)
            {
                for(int y = j;y < j + m;y++)
                {
                    if(A[x][y] != B[x - i][y - j])
                    {
                        same = false;
                    }
                }
            }

            if(same)
            {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
from collections import Counter
from itertools import accumulate
from bisect import bisect_right


def factor(n):
    res = []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            res.append(i)
            n //= i
    if n > 1:
        return res + [n]
    else:
        return res


num = [i for i in range(1, 65)]
num = list(accumulate(num))

N = int(input())
primes = Counter(factor(N))
ans = 0
for v in primes.values():
    ans += bisect_right(num, v)
print(ans)


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main()
{
  int N;
  cin >> N;
  string s;
  cin >> s;
  int red = 0;
  int blue = 0;
  REP(i, s.length())
  {
    if (s[i] == 'R')
      red++;
    else
      blue++;
  }
  if (red > blue)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
#define acc(v) accumulate(v.begin(), v.end(), 0)
#define cinv(n,v) rep(i,n) cin >> v[i]
using namespace std;
const int INF = 1e9;
typedef long long ll;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
// const lint MOD = 998244353;
int x_pos[4] = {1,0,-1,0}, y_pos[4] = {0,1,0,-1};
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
char upper(char c){
	return c-0x20;
}
char lower(char c){
	return c+0x20;
}

int main(){
	string s; cin >> s;
	ll ans = 0;
	for (int bit = 0; bit < (1<<(s.size()-1)); bit++){
		int before = 0;
		for (int i = 0; i < s.size()-1; i++){
			if (bit & (1<<i)){
				for (int j = before; j <= i; j++){
					ans += ctoi(s[j])*pow(10,i-j);
				}
				before = i+1;
			}
		}
		for (int j = before; j < s.size(); j++){
			ans += ctoi(s[j])*pow(10,s.size()-1-j);
		}
	}
	cout << ans << endl;
}

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

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

//最大公約数
int gcd(int a, int b){
    //a>bになるように入れ替え
    if(a<b){
        int tmp=a;
        a=b;
        b=tmp;
    }

    //ユークリッドの互除法
    if(a%b==0) return b;
    return gcd(b,a%b);
}

int main(void){
    int N;
    scanf("%d",&N);

    //A[0]~A[N-1]に格納する
    int* A;
    NEW(A,N);
    for(int i=0;i<N;i++){
        scanf("%d",&A[i]);
    }

    for(int i=0;i<N-1;i++){
        A[i+1]=gcd(A[i],A[i+1]);
    }
    printf("%d\n",A[N-1]);

    return 0;
}

Measured memory_bytes: 512
'use strict'

const main = (input) => {
    input = input.split('\n')
    const N = parseInt(input[0])
    let As = input[1].split(' ').map(v => parseInt(v))
    

    let count = 0
    while(true){
        if(As.some(v => v % 2 !== 0)) break
        As = As.map(v => v / 2)
        count++
    }
    console.log(count)
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))

Measured memory_bytes: 7624
fun main(args: Array<String>) {
    val array0 = readLine()!!.split(" ").map { s -> s.toInt() }

    val list1974 = mutableListOf(1, 9, 7, 4)
    for (n in array0) {
        when (n) {
            1 -> list1974.remove(1)
            9 -> list1974.remove(9)
            7 -> list1974.remove(7)
            4 -> list1974.remove(4)
        }
    }
    if (list1974.size==0){
        print("YES")
    }else{
        print("NO")

    }

}

Measured memory_bytes: 36028
#include<stdio.h>
int main()
{
	int n;

	scanf("%d",&n);

	for(int i=0;i<=n/4;i++)
		for(int j=0;j<=n/7;j++)
			if(4*i+7*j==n){
				printf("Yes\n");
				return 0;
			}
	printf("No\n");
	return 0;
}

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


int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
//    return *(long long*)a - *(long long*)b;
}
//  qsort(A, b, sizeof(int), compare_int);

//long long  factorial(long long n) {
//    if (n > 0) {
//        return n * factorial(n - 1);
//    } else {
//        return 1;
//    }
//}
long long  factorial(long long n, long long depth) {
    if (n > 1) {
        depth++;
        return factorial(n / 2, depth);
    } else {
        return depth;
    }
}

int min(int a, int b) {
    if (a > b)
        return b;
    else
        return a;
}

int distance(int a, int b) {
  return abs(a-b)*abs(a-b);
}



//int ()
/*
int triangle(int a, int b, int c){
  if(a<b+c){
    if(b<c+a){
      if(c<a+b){
        printf("1\n");
        return 1;
      }
    }
  }
  printf("1\n");
  return 0;
}
*/

int main()
{
//  int  a, b, c, d, e, X, Y ,r;
  unsigned long long a, b, c, d, e, X, Y;
  //  double  c;
// long long  A[200003]={};
  int  A[200003]={};
  int  B[100003]={};
//  int  C[100003][100001]={};
  int  C[100003]={};

  int  flg=0;

//  char s[101][101]={};
  char s[100001]={};
  char t[100001]={};
//  int N, M;
//  int A[1000000001]={};
//  long long  C[101]={};
  int i,j,k;
  long long p=0,q=0;
  int sosuu[46] ={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199};
  int min =100000001;
  int len=0;
  int l=0;
  int cnt=0;
  int num=0;
  int num1=0;
  int num2=0;
  long long  ans=0;
  int ans_ac=0;
  int ans_wa=0;
  int max=0;
  long long sum=0;
  int addr=0;
  int ptn=0;
  int  tmp=0;
  double per=0; 
//  bool on_off[100]={};
  
//  char alp[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};

  //  a=0;
  scanf("%lld%lld", &a, &b);
  if(a>b)  printf("safe\n");
  else  printf("unsafe\n");
  
return 0;
}


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

#define forn(i,n) for(int i=0;i<int(n);i++)
#define forsn(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define dforsn(i,s,n) for(int i=(int)(n-1);i>=int(s);i--)
#define si(a) ((int)(a).size())
#define pb push_back
#define mp make_pair
#define endl '\n'
#define all(a) a.begin(),a.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(0)
#define filein(a) freopen(a,"r",stdin)
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long int tint;

int main() {
	fastio;

	int a,b,c;
	cin >> a >> b >> c;

	int cant=0;
	while(!(a%2)&&!(b%2)&&!(c%2)&&((a!=b)||(a!=c))){
        int na = b/2+c/2,nb=a/2+c/2,nc=a/2+b/2;
        a=na;
        b=nb;
        c=nc;
        cant++;
	}
	if(!(a%2)&&((a==b)&&(a==c)))cout << -1 << endl;
	else cout << cant << endl;


	return 0;
}


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

const long N=1000000;

int main(){
    long ham[550];
    long now=0;
    
    for(int i=0; i<20; ++i){
        for(int j=0; j<13; ++j){
            for(int k=0; k<9; ++k){
                long t=pow(2,i)*pow(3,j)*pow(5,k);
                if(t>N) break;
                ham[now++]=t;
            }
        }
    }
    
    sort(ham, ham+now);
    
    while(1){
        long a, b, ans=0;
        scanf(" %ld", &a);
        if(a==0) break;
        scanf(" %ld", &b);
        
        for(long i=0; i<N; ++i){
            if(ham[i]>=a){
                now=i;
                break;
            }
        }
        
        for(long i=a; i<=b; ++i){
            if(ham[now]==i){
                ++ans;
                ++now;
            }
        }
        
        printf("%ld\n", ans);
    }
    
    return 0;
}

Measured memory_bytes: 3324
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
xu = [input().split() for _ in range(N)]
ans = 0

for i in range(N):
	if xu[i][1] == "JPY":
		ans += int(xu[i][0])
	else:
		ans += float(xu[i][0])*380000

print(ans)

Measured memory_bytes: 5328
n=int(input())
a=[]
for _ in range(n):
    a.append(int(input())-1)

def check():
    loop=0
    next=0
    while True:
        loop+=1
        next=a[next]
        if next==1:
            print(loop)
            return
        if loop>n:
            print(-1)
            return 

    
check()



Measured memory_bytes: 7084
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MAXN 1000010
#define rep(i,n) for (int i = 0; i < (n); ++i)
const ll mod = 1e9+7;

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

bool pairCompare(const P& firstElof, const P& secondElof)
{
    return firstElof.second < secondElof.second;
}

// 素因数分解する 
// たとえば 60 = 2^2 x 3 x 5 だったら {(2, 2), (3, 1), (5, 1)} を返す
vector<pair<ll, ll> > prime_factorize(ll n) {
    vector<pair<ll, ll> > res;
    for (ll p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

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

ll lcm(ll a, ll b) {
    return a*b/gcd(a, b);
}



int main() {
    ll A, B;
    cin >> A >> B;
    ll g = gcd(A, B);
    auto pf = prime_factorize(g);
    cout << pf.size() + 1 << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
int main() {
    char str[200];
    int i, cnt;

    scanf("%s", str);
    for (i = 1, cnt = 0; str[i + 2] != '\0'; i++, cnt++) {
    }
    printf("%c%d%c\n", str[0], cnt + 1, str[cnt + 2]);
    return 0;
}

Measured memory_bytes: 128
n, k, c = map(int, input().split())
s = str(input())
for i in range(n):
	if s[i] == 'o':
		ant = i+1
		antlist = [ant]
		break

for i in range(n):
	if s[n-i-1] == 'o':
		post = n-i
		postlist = [post]
		break

for i in range(k-1):
	ant += c+1
	post -= c+1
	for i in range(n):
		if s[ant+i-1] == 'o':
			ant += i
			antlist.append(ant)
			break
	for i in range(n):
		if s[post-i-1] == 'o':
			post -= i
			postlist.append(post)
			break
postlist.reverse()
#print(antlist)
#print(postlist)
for i in range(k):
	if antlist[i] == postlist[i]:
		print(antlist[i])

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

using namespace std;

int n;
int a[101];
long long d;
void inp()
{
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
}
bool check(int i, int j, int k)
{
    return (i+j <= k || i+k <= j || j+k <= i || i == j || i == k || j == k);
}
void process()
{
    for (int i = 1; i < n-1; i++)
        for (int j = i+1; j < n; j++)
        for (int k = j+1; k <= n; k++)
            if (!check(a[i], a[j], a[k])) d++;
    cout << d;
}
int main()
{
    //freopen("test.inp","r", stdin);
    inp();
    process();
    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	vector<vector<bool>> judge(3, vector<bool>(3,false));
	vector<vector<Int>> A(3, vector<Int>(3));


	for (Int i = 0; i < 3; i++) {
		for (Int j = 0; j < 3; j++) {
			cin >> A[i][j];
		}
	}

	Int N;
	cin >> N;

	Int b;
	for (Int i = 0; i < N; i++) {
		cin >> b;

		Int flag = 0;
		for (Int j = 0; j < 3; j++) {
			for (Int k = 0; k < 3; k++) {
				if (judge[k][j]) {
					continue;
				}
				else {
					if (b==A[k][j]) {
						judge[k][j] = true;
						flag = 1;
						break;
					}
				}
			}
			if (flag) {
				break;
			}
		}
	}

	Int flag2 = 0;//ビンゴかどうか
	if (judge[0][0]&&judge[0][1]&&judge[0][2]) {
		flag2 = 1;
	}
	else if (judge[1][0] && judge[1][1] && judge[1][2]) {
		flag2 = 1;
	}
	else if (judge[2][0] && judge[2][1] && judge[2][2]) {
		flag2 = 1;
	}
	else if (judge[0][0] && judge[1][0] && judge[2][0]) {
		flag2 = 1;
	}
	else if (judge[0][1] && judge[1][1] && judge[2][1]) {
		flag2 = 1;
	}
	else if (judge[0][2] && judge[1][2] && judge[2][2]) {
		flag2 = 1;
	}
	else if (judge[0][0] && judge[1][1] && judge[2][2]) {
		flag2 = 1;
	}
	else if (judge[0][2] && judge[1][1] && judge[2][0]) {
		flag2 = 1;
	}

	if (flag2) cout << "Yes" << "\n";
	else cout << "No" << "\n";
}


Measured memory_bytes: 256
import copy


def move(C, S):
    newC = copy.copy(C)
    for i, s in enumerate(S):
        if s == "L":
            newC[i - 1] += C[i]
        else:
            newC[i + 1] += C[i]
        newC[i] -= C[i]
        # print(C, newC)
    return newC


def main():
    S = input()
    N = len(S)
    C = [0] * N

    odd_cnt, even_cnt = 0, 0
    for i, s in enumerate(S):
        if s == 'R':
            if (i + 1) % 2 == 0:
                even_cnt += 1
            else:
                odd_cnt += 1
        else:
            if (i + 1) % 2 == 0:
                C[i] += even_cnt
                C[i - 1] += odd_cnt
                odd_cnt, even_cnt = 0, 0
            else:
                C[i] += odd_cnt
                C[i - 1] += even_cnt
                odd_cnt, even_cnt = 0, 0
        # print(i, S, odd_cnt, even_cnt, C)

    C = list(reversed(C))
    odd_cnt, even_cnt = 0, 0
    for i, s in enumerate(reversed(S)):
        if s == 'L':
            if (i + 1) % 2 == 0:
                even_cnt += 1
            else:
                odd_cnt += 1
        else:
            if (i + 1) % 2 == 0:
                C[i] += even_cnt
                C[i - 1] += odd_cnt
                odd_cnt, even_cnt = 0, 0
            else:
                C[i] += odd_cnt
                C[i - 1] += even_cnt
                odd_cnt, even_cnt = 0, 0
        # print(i, ''.join(list(reversed(S))), odd_cnt, even_cnt,
        #       list(reversed(C)))

    C = reversed(C)
    print(' '.join([str(c) for c in C]))


if __name__ == "__main__":
    main()

Measured memory_bytes: 83216
#include <bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
//typedef tree <int,null_type,less <int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
// #include <ext/rope>
// using namespace __gnu_cxx;
typedef long long int ll;
typedef long double ld;
#define FAST                 \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);
#define rep(g, i, n) for (ll g = i; g < n; g++)
#define rev(g, n, i) for (ll g = n - 1; g >= i; g--)
#define all(v) v.begin(), v.end()
#define pb push_back
#define mxe(v) *max_element(v.begin(), v.end())
#define mne(v) *min_element(v.begin(), v.end())
#define ve vector
#define lb lower_bound
#define ub upper_bound
#define bb break
#define cc continue
#define rem 1000000007
#define PI 3.141592653589793238462643383279502
ll power(ll x, ll y, ll p)
{
    ll res = 1; // Initialize result
    x = x % p;  // Update x if it is more than or
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}
ll modInverse(ll n, ll p)
{
    return power(n, p - 2, p);
}
struct point
{
    ll x, y;
};
int main()
{
    FAST
    // freopen("input1.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    /*ll tests;
    cin>>tests;
    rep (gg,0,tests)
    {}*/
    ll n;
    cin>>n;
    ve <ll> arr(n,0);
    rep (i,0,n)
    {
        int x,y;
        cin>>x>>y;
        if (x==y)
        {
            arr[i]=1;
        }
    }
    arr.push_back(0);
    int cnt=0;
    bool flag=false;
    rep (i,0,n)
    {
        if (arr[i]==1)
        {
            cnt++;
        }
        else
        {
            cnt=0;
        }
        if (cnt>=3)
        {
            flag=true;
        }
    }
    if (flag)
    {
        cout<<"Yes\n";
    }else
    {
        cout<<"No\n";
    }
}


Measured memory_bytes: 3616
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#define pb push_back
using namespace std;
typedef pair<int,int> pii;

/*最小公倍数と最大公約数*/
typedef long long int ll;
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;//最小
}

int main(){
  ll N,M,L;
  string S,T;
  cin>>N>>M;
  cin>>S>>T;
  

  ll n,m;
  n=N/(gcd(N,M));
  m=M/(gcd(N,M));

  for(ll i=0;i<gcd(N,M);i++){
    if(S[i*n]!=T[i*m]){
      cout<<-1<<endl;
      return 0;
    }
  }
  cout<<lcm(N,M)<<endl;
  return 0;
}


Measured memory_bytes: 512
//Binary_search:二分探索法に依る検索
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vecll = vector<long long>;
#define rep(i, n) for (long long i = 0; i < (long long)(n); n++)


int main()
{
    ll n,m;
    vecll A,B;

    cin >> n;
    A.resize(n);
    for(auto &x : A) cin >> x;

    cin >> m;
    B.resize(m);
    for(auto &y : B) cin >> y;

    cout << (includes(A.begin(),A.end(),B.begin(), B.end()) ? "1" : "0" ) << endl;

    return 0;
}


Measured memory_bytes: 6000
#include<iostream>

using namespace std;

int main()
{
    int n, a[100],i,max,min;

    cin >> n;

    for (i = 0; i < n; i++)
    {
        cin >> a[i];
        if (i == 0) {
            max = a[i];
            min = a[i];
        }

        if (max < a[i])max = a[i];

        if (min > a[i])min = a[i];
    }

    cout << max - min << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/hash_map>
#define N 500005
using namespace std;
using namespace __gnu_cxx;
hash_map<int,int>mp;
int n,ans,a[N];
int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]),mp[a[i]]++;
	sort(a+1,a+n+1);
	for (int i=n;i;i--){
		if (!mp[a[i]]) continue;
		for (int j=1;j<=(1<<30);j*=2){
			if (!mp[a[i]]) break;
			int x=j-a[i];
			if (x<=0) continue;
			if (mp[x]){
				if (x==a[i]){
					ans+=mp[a[i]]/2;
					mp[a[i]]%=2;
				}
				else {
					int t=min(mp[a[i]],mp[x]);
					ans+=t;mp[a[i]]-=t;mp[x]-=t;
				}
			}
			if (j==(1<<30)) break;
		}
	}
	printf("%d\n",ans);
	return 0;
}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int K;
    cin >> K;
    vector<int> 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};
    cout << A[K-1] << endl;


    return 0;
}


Measured memory_bytes: 3656
#include<stdio.h>
#include <string.h>

 
int main(void) {
	
	char a[100],b[100],c[100],ans,x;
	int ax=0,bx=0,cx=0;
	
	scanf("%s", a);
	scanf("%s", b);
	scanf("%s", c);
	
	ans = 't';
	x = 'a';
	
	while(ans=='t'){
		switch(x){
			case 'a':
			    if(a[ax]=='\0') { ans='A'; break;}
			    x = a[ax];
			    ax += 1;
			    break;
			 case 'b':
			    if(b[bx]=='\0') { ans='B'; break;}
			    x = b[bx];
			    bx += 1;
			    break;
			case 'c':
			    if(c[cx]=='\0') { ans='C'; break;}
			    x = c[cx];
			    cx += 1;
			    break;
		}
	}
	
	printf("%c\n", ans);
	
	
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int main(){
  int a,b,k;
  cin>>a>>b>>k;
  FORR(x,1,a+1){
    if(a%x==0 && b%x==0){
      k--;
      // DEBUG(x);
      if(k==0){
        printf("%d\n",x);
        return 0;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 256
d = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
n = int(input())
for _ in range(n):
    d[input()] += 1
print("AC x", d["AC"])
print("WA x", d["WA"])
print("TLE x", d["TLE"])
print("RE x", d["RE"])

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

constexpr int INF = 1e9;

struct edge {
    int from, to, cost;
};

int main() {
    int N, M;
    cin >> N >> M;
    vector<vector<int>> g(N, vector<int>(N, INF));
    vector<edge> es(M);
    for(int i=0; i<M; ++i) {
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        g[a][b] = g[b][a] = c;
        es.push_back((edge){a, b, c});
    }
    for(int k=0; k<N; ++k) {
        for(int i=0; i<N; ++i) {
            for(int j=0; j<N; ++j) {
                g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
            }
        }
    }
    int res = 0;
    for(auto e : es) {
        if(g[e.from][e.to] < e.cost) {
            res++;
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 384
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
# https://atcoder.jp/contests/abc090/tasks/abc090_a

C = []
for i in ra(3):
    print(input()[i], end='')


Measured memory_bytes: 38256
#include<bits/stdc++.h>
using namespace std;
typedef long long int LL;
const int N=101;
int n,w[N],v[N];
LL dp[N][100001];
LL solve(int in,int W){
	if(W<0) return INT_MIN;
	if(in==n) return 0;
	LL& ret=dp[in][W];
	if(ret!=-1) return ret;
	ret=max(v[in]+solve(in+1,W-w[in]),solve(in+1,W));
	return ret;
}
int main(){
	int W;
	cin>>n>>W;
	for(int i=0;i<n;i++)
		scanf("%d%d",w+i,v+i);
	for(int i=0;i<n;i++)
		for(int j=0;j<=W;j++)
			dp[i][j]=-1;
	cout<<solve(0,W);
}

Measured memory_bytes: 78336
import java.io.IOException;
import java.util.Arrays;

public class Main {
	/**
	* @param args
	*/
 
	static class Seat {
		public	int	b = 0;
	}

	static class Grp {
		public	int	s = 0;
		public	int	e = 0;
		public	int	n = 0;
		public	int	b = 0;
		public	int	w = -1;

		public Grp(int i) {
			this.s = i*5;
			this.e = 17*(i%2)+3*(i%3)+19;
			this.n = (i%5==1)?5:2;
		}
	}

	static class Lst {
		public	int[]	d = new int[101];
		public	int		h = 0;
		public	int		t = 0;

		public void add(int e) {
			d[t++] = e;
			this.sort();
		}

		public int get(int i) {
			return d[h+i];
		}

		public int remove(int i) {
			int	rmv = this.d[h];
			this.d[h+i] = 0;
			this.sort();
			this.h++;
			return rmv;
		}

		public int size() {
			return t-h;
		}

		public void sort() {
			Arrays.sort(d, h, t);
		}
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Grp[]	g = new Grp[100];
		Seat	s = new Seat();
		Lst		e = new Lst();
		Lst		w = new Lst();
		int		o = 0;
		
		for (int i = 0; i < g.length || w.size() > 0; i++) {
			int	tm = i*5;
			int	eh = (e.size() > 0)?e.get(0):0;

			if (i < g.length) {
				g[i] = (g[i] == null)?new Grp(i):g[i];
			}

			if (eh/100 <= tm && eh != 0) {
				tm  = eh/100;
				while (e.size() > 0) {
					if (e.get(0)/100 == tm) {
						s.b = s.b&(~g[e.get(0)%100].b);
						e.remove(0);
					} else {
						break;
					}
				}
			}

			while (w.size() > 0) {
				int	k = w.get(0)%100;

				if (g[k].s > tm) break;

				if (isAvailableSeat(s, null, g[k])) {
					// グループの待ち時間を計算
					g[k].w = Math.max(0, tm-g[k].s);

					// グループが食べ終わる時間を追加
					e.add((g[k].s+g[k].w+g[k].e)*100+k);
					w.remove(0);
				} else {
					break;
				}
			}

			if (tm == i*5) {
				if (i < g.length) {
					// 席があるかチェック
					if (isAvailableSeat(s, w, g[i])) {
						// グループが食べ終わる時間を追加
						e.add((g[i].s+g[i].w+g[i].e)*100+i);
					} else {
						// 待っているグループリストへ追加
						w.add(g[i].s*100+i);
					}
				}
			} else {
				i--;
			}
		}
		
		while ((o = parseNum()) != -1) {
			System.out.println(g[o].w);
		}
	}

	private static boolean isAvailableSeat(Seat s, Lst w, Grp g) {
		boolean bSt = false;
		int		bit = (1<<g.n)-1;
		int		len = (w == null)?0:w.size();

		for (int i = 0; i <= 17-g.n && !bSt && len == 0; i++, bit<<=1) {
			if ((s.b&bit) == 0) {
				s.b = s.b|bit;
				g.b = bit;
				g.w = 0;
				bSt = true;
			}
		}
		return bSt;
	}

	private static int parseNum() {
		try {
			int	buf = 0;
			int	num = -1;
			int	mns = 0;
			int	skp = 1;

			// -,0〜9以外は読み飛ばす
			while (true) {
				buf = System.in.read();
				if (buf == '-') {
					num = (num == -1)?0:num;
					mns = 1;
					skp = 0;
				} else if (buf >= '0' && buf <= '9') {
					num = (num == -1)?0:num;
					num = num * 10 + (buf - '0');
					skp = 0;
				} else if (skp == 0 || buf == -1) {
					return (mns == 0)?num:num*(-1);
				}
			}
		} catch (IOException e) {}
		return -1;
	}
}

Measured memory_bytes: 16848
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

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

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        if (a > b) {
            System.out.println(0);
        } else if (a * c <= b) {
            System.out.println(c);
        } else {
            System.out.println(b / a);
        }
    }
}

Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
int f[355];
char c;
int n,nr;
int main()
{
    scanf("%d",&n);
    scanf("\n");
    scanf("%c",&c);
    f[c]++;
    for(int i=2;i<=n;i++)
    {
       scanf(" ");
       scanf("%c",&c);
       f[c]++;
    }
    for(int i='A';i<='Z';i++)
        if(f[i]) nr++;
    if(nr==3) printf("Three\n");
        else printf("Four\n");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <math.h>
#include <algorithm>
#include <deque>

using namespace std;
#define ll long long
#define ve vector
#define umap unordered_map

int main() {
    string s;
    cin >> s;
    deque<char> q;
    for(int i=0;i<s.size();i++) {
        if(s[i]=='B') {
            if(!q.empty()) q.pop_back();
        } else q.push_back(s[i]);
    }
    while(!q.empty()) {
        cout << q.front();
        q.pop_front();
    }
    cout << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <functional>
#include <utility>
#include <queue>
#include <vector>
#include <string>
#include <stack>
#include <ctime>
#include <random>
#include <chrono>
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
typedef long long int ll;
const ll  MOD = 1000000007;
typedef pair<ll,ll> P;
const ll INF = 100100100100100100;

ll N;
ll x[200200];
ll xx[200200];
int main(){
  cin >> N;
  rep(i,N){
    cin >> x[i];
    xx[i] = x[i];
  }
  sort(x,x+N);
  ll a = x[N/2 -1];
  ll b = x[N/2];
  rep(i,N){
    if(xx[i] <= a){
      cout << b << endl;
    }
    else{
      cout << a << endl;
    }
  }
}


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

int main(){
    int N ;
    cin >> N ;
    vector<int> vec(N,0);
    rep(i,N) cin >> vec[i];
    map<int,long long> mp;
    long long ans = 0 ;
    for(int i=1;i<N+1 ;i++){
        int p = vec[i-1];
        if(i - p < 0) mp[i + p] += 1 ;
        else{
            ans += mp[i - p];
            mp[i + p] += 1 ;
        }
    }
    cout << ans << "\n" ;
}

Measured memory_bytes: 17688
import numpy as np
n,k,q=map(int,input().split())
a=[]
ones=np.ones((1,n,))
point=k*ones
de_point=-q*ones
for i in range(q):
    num=int(input())
    de_point[0,num-1]=de_point[0,num-1]+1
point=point+de_point
for i in range(n):
    if point[0,i]>0:
        print("Yes")
    elif point[0,i]<=0:
        print("No")


Measured memory_bytes: 16844
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,a=0,b=0,c=0,d=0;
    cin>>n;
    string s;

    for(i=0;i<n;i++)
    {
        cin>>s;
        if(s=="AC")
        a++;
        else if(s=="TLE")
        b++;
        else if(s=="WA")
        c++;
        else
        d++;
    }
    cout<<"AC x "<<a<<endl;
    cout<<"WA x "<<c<<endl;
    cout<<"TLE x "<<b<<endl;
    cout<<"RE x "<<d<<endl;

}

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

using namespace std;

int main(void)
{
  int year[3] = {200, 195, 195};
  int month[2] = {19, 20};
  int n; cin >> n;

  for(int i = 0; i < n; i ++){
    int y, m, d; cin >> y >> m >> d;
    int sum = 1;
    for(int j = y; j < 1000; j++)
      sum += year[j%3];

    if(y % 3 == 0)
      month[0] = 20;
    else
      month[0] = 19;
    for(int j = 1; j < m; j++)
      sum -= month[j%2];
    
    sum -= d;

    cout << sum << endl;

  }
  return 0;
 
}

Measured memory_bytes: 2956
import Control.Monad                                                                                                       
                                                                                                                           
main :: IO ()                                                                                                              
main = do                                                                                                                  
  [h,w] <- map read . words <$> getLine                                                                                    
  ss <- replicateM h getLine                                                                                               
                                                                                                                           
  putStr $ unlines [map (f ss x) [1..w] | x <- [1..h]]                                                                     
                                                                                                                           
window2d :: [[a]] -> Int -> Int -> [[a]]                                                                                   
window2d xs i j = map (take (3 - (max 0 (2-j))) . drop (j-2)) . take (3 - (max 0 (2-i))) . drop (i-2) $ xs                 
                                                                                                                           
f :: [String] -> Int -> Int -> Char                                                                                        
f xs i j                                                                                                                   
  | (xs!!(i-1))!!(j-1) == '#' = '#'                                                                                        
  | otherwise = head . show . length . filter (=='#') . concat $ window2d xs i j

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

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N, M;
    cin >> N >> M;
    vector<vector<int>> vv(M + 1, vector<int>());
    for (int i = 0; i < N; i++) {
        int a, b;
        cin >> a >> b;
        if (a > M) continue;
        vv[a].push_back(b);
    }
    priority_queue<int> que;
    int gain = 0;
    for (int i = 1; i <= M; i++) {
        if (!vv[i].empty()) {
            for (int b : vv[i]) {
                que.push(b);
            }
        }
        if (que.empty()) continue;
        gain += que.top();
        que.pop();
    }
    cout << gain << endl;
    // M - i　　日目には A_i <= iなバイトしか受けられない. 
    // 受けられるバイトの中で稼ぎが最大なものをとっていけばいい

    return 0;
}

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

int main(void) {
	int n, a;
	cin >> n;

	long long ans[2] = {0};
	long long sum[2] = {0};

	for (int i= 0; i < n; i++) {
		cin >> a;
		sum[0] += a;
		sum[1] += a;

		if (i % 2 == 0) {
			if (sum[0] >= 0) {
				ans[0] += abs(-1 -sum[0]);
				sum[0] = -1;
			}
			if (sum[1] <= 0) {
				ans[1] += abs(+1 - sum[1]);
				sum[1] = +1;
			}
		} else {
			if (sum[0] <= 0) {
				ans[0] += abs(+1 - sum[0]);
				sum[0] = +1;
			}
			if (sum[1] >= 0) {
				ans[1] += abs(-1 -sum[1]);
				sum[1] = -1;
			}
		}
	}
	cout << std::min(ans[0], ans[1]) << endl;
	return 0;
}


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

int n;
long a[100010], b, c, t;

int main(){
	cin >> n;
	for (int i = 0; i < n+1; ++i) cin >> a[i];
	c = 0;
	for (int i = 0; i < n; ++i){
		cin >> b;
		t = min(b, a[i] + a[i+1]);
		c += t;
		a[i+1] -= t - min(b, a[i]);
	}
	cout << c;
}

Measured memory_bytes: 1024
#[allow(unused_macros)]
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 ) * } } ; }
#[allow(unused_macros)]
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 ) * } } ; }
#[allow(unused_macros)]
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! {
        c: [chars;3]
    }

    println!("{}{}{}", c[0][0],c[1][1],c[2][2]);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  while(1) {
    int n; cin >> n;
    if(n == 0) break;
    vector<string> s(n);
    for(int i=0;i<n;++i) {
      cin >> s[i];
    }
    vector<int> ers;
    map<int, bool> sel;
    for(int i=0;i<n;++i) {
      for(int j=0;j<n;++j) {
        if(i == j || sel[i] || (int)(s[i].size()) >= (int)(s[j].size())) continue;
        for(int k=0;k<(int)(s[j].size()) - (int)(s[i].size());++k) {
          if(s[j].substr(k, (int)(s[i].size())) == s[i]) {
            sel[i] = true;
            ers.push_back(i);
            break;
          }
        }
      }
    }
    for(int i=(int)(ers.size())-1;i>=0;--i) {
      s.erase(s.begin() + ers[i]);
    }
    n = (int)(s.size());
    vvi d(n, vi(n));
    for(int i=0;i<n;++i) {
      for(int j=0;j<n;++j) {
        if(i == j) d[i][j] = 0;
        else {
          for(int k=min((int)(s[i].size())-1, (int)(s[j].size()));k>=0;--k) {
            if(s[i].substr((int)(s[i].size())-k, k) == s[j].substr(0, k)) {
              d[i][j] = (int)(s[j].size()) - k;
              break;
            }
          }
        }
      }
    }
    int sz = 1;
    for(int i=0;i<n;++i) {
      sz *= 2;
    }
    vvi dp(n, vi(sz, INF));
    priority_queue<pair<int, P>> pq;
    for(int i=0;i<n;++i) {
      dp[i][1<<i] = (int)(s[i].size());
      pq.push({(int)(s[i].size()), {i, 1<<i}});
    }
    while(!pq.empty()) {
      auto p = pq.top(); pq.pop();
      int l = p.first, idx = p.second.first, bs = p.second.second;
      if(l > dp[idx][bs]) continue;
      for(int i=0;i<n;++i) {
        if(idx == i) continue;
        if((bs | (1<<i)) != bs && dp[i][bs | (1<<i)] > l + d[idx][i]) {
          dp[i][bs | (1<<i)] = l + d[idx][i];
          pq.push({dp[i][bs|(1<<i)], {i, bs|(1<<i)}});
        }
      }
    }
    int ans = INF;
    for(int i=0;i<n;++i) {
      ans = min(ans, dp[i][sz-1]);
    }
    cout << ans << endl;
  }
}



Measured memory_bytes: 3808
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;


namespace StartFinish
{
 
    class Program
    {
        static void Main(string[] args)
        {
            double r = double.Parse(Console.ReadLine());
            Console.WriteLine("{0} {1}", r * r *Math.PI, 2*r*Math.PI);
        }
    }
}

Measured memory_bytes: 9264
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
typedef long long ll;
typedef pair<int,int> P;
#define F first
#define S second
const double PI=acos(-1);
//fixed<<setprecision(11)<<

int main(){
  ll n,a;
  ll cnt=0;
  cin>>n;
  for(int i=1;i<=n;++i){
  cin>>a;
  if(i%2!=0&&a%2!=0) ++cnt;
  }

  cout<<cnt<<endl;
return 0;
}

Measured memory_bytes: 3580
# coding: utf-8

def getList(H, W, A):
    rList = [0] * H
    cList = [0] * W
    for r in range(H):
        for c in range(W):
            if A[r][c] == "#":
                rList[r] += 1
                cList[c] += 1
    return rList, cList

def getTargetList(tList):
    zeroList = []
    for i in range(len(tList)):
        if tList[i] == 0:
            zeroList.append(i)
    return zeroList
    
def delRow(A, tList):
    for r in reversed(tList):
        A.pop(r)
    return A

def delCol(A, tList):
    for c in reversed(tList):
        for r in range(len(A)):
            A[r].pop(c)
    return A

def solve(H, W, A):
    rList, cList = getList(H, W, A)
    A = delRow(A, getTargetList(rList))
    A = delCol(A, getTargetList(cList))
    return A
    
if __name__ == "__main__":
    H, W = map(int, input().split())
    A = []
    for i in range(H):
        tmp = input()
        A.append([])
        for s in tmp:
            A[i].append(s)

    A = solve(H, W, A)
    for i in A:
        for j in i:
            print(j, end="")
        print()


Measured memory_bytes: 4724
namespace Diverta2.A
{

    using System.Collections.Generic;
    using System.Linq;
    using static System.Console;
    public class Program
    {
        public static void Main(string[] args)
        {
            var l = ReadInputsAsInt().ToList();

            WriteLine(Solve(
                l[0],l[1]
                ));
        }

        public static int Solve(int n, int k) => k > 1 ? n - k : 0;

        static IEnumerable<int> ReadInputsAsInt() => ReadLine().Split(' ').Select(x => int.Parse(x));
    }

}

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

using ll=long long;
const ll MOD=1000000007;

int main() {
  string s;
  cin >> s;
  ll N=s.size(),sum=0;
  vector<int> a(N+1,0);
  for(int i=0;i<N;i++){
    if(s[i]=='<'){
      a[i+1]=a[i]+1;
    }
    //cout << a[i] << endl;
  }
  for(int i=N-1;i>=0;i--){
    if(s[i]=='>'){
      a[i]=max(a[i+1]+1,a[i]);
    }
  }
  for(int i=0;i<N+1;i++){
    sum +=a[i];
    //cout << a[i] << endl;
  }
  cout << sum << endl;
}


Measured memory_bytes: 2820
n, k = [int(i) for i in input().split(" ")]
h = [int(i) for i in input().split(" ")]

dp = [float("inf")] * n
dp[0] = 0

for i in range(len(h)):
  for j in range(1, k+1, 1):
    if (i+j) < len(h):
      dp[i+j] = min(dp[i+j], dp[i]+abs(h[i+j] - h[i]))
print(dp[-1])

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

int main(void)
{
	int a, b, c, z;

	cin >> a >> b >> c;
	if (a < b && b < c)
	{
		cout << "Yes" << endl;
	}else
	{
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define OUT(a) cout << (a) << "\n"
#define ll long long
ll MOD = 10e9 + 7;

int main() {
    ll H,W,x,y;
    cin >> W >> H >> x >> y;
    // たて
    double tate = H * min(W-x, x);

    // 横
    double yoko = W * min(H-y, y);

    if ((y == 0 || y == H) || (x == 0 || x == W)) {
        printf("%.16lf %d\n", (max(W,H)/2.0)*min(W,H), 0);
    } else if (tate == yoko) {
        printf("%.16lf %d\n", (max(W,H)/2.0)*min(W,H), 1);
    } else {
        printf("%.16lf %d\n", (max(W,H)/2.0)*min(W,H), 0);
    }
    return 0;
}

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

using ll=long long;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#define REACH cerr<<"reached line "<<__LINE__<<endl
#define DMP(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define ZERO(x) memset(x,0,sizeof(x))

using pi=pair<int,int>;
using vi=vector<int>;
using ld=long double;

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

template<class T>
ostream& operator <<(ostream& os,const vector<T>& v){
	os<<"[";
	REP(i,(int)v.size()){
		if(i)os<<",";
		os<<v[i];
	}
	os<<"]";
	return os;
}

int read(){
	int i;
	scanf("%lld",&i);
	return i;
}

void printSpace(){
	printf(" ");
}

void printEoln(){
	printf("\n");
}

void print(int x,int suc=1){
	printf("%lld",x);
	if(suc==1)
		printEoln();
	if(suc==2)
		printSpace();
}

string readString(){
	static char buf[3341919];
	scanf("%s",buf);
	return string(buf);
}

char* readCharArray(){
	static char buf[3341919];
	static int bufUsed=0;
	char* ret=buf+bufUsed;
	scanf("%s",ret);
	bufUsed+=strlen(ret)+1;
	return ret;
}

template<class T,class U>
void chmax(T& a,U b){
	if(a<b)
		a=b;
}

template<class T,class U>
void chmin(T& a,U b){
	if(a>b)
		a=b;
}

template<class T>
T Sq(const T& t){
	return t*t;
}

const int inf=LLONG_MAX/3;



signed main(){
	int n=read(),m=read(),q=read();
	vector<string> x(n);
	REP(i,n)x[i]=readString();
	vector<vi> sum(n*2-1,vi(m*2-1,0));
	REP(i,n)REP(j,m)
		sum[i*2][j*2]=x[i][j]-'0';
	REP(i,n)REP(j,m){
		if(j+1<m)if(x[i][j]=='1'&&x[i][j+1]=='1')sum[i*2][j*2+1]=-1;
		if(i+1<n)if(x[i][j]=='1'&&x[i+1][j]=='1')sum[i*2+1][j*2]=-1;
	}
	n=n*2-1;
	m=m*2-1;
	REP(i,n)FOR(j,1,m)sum[i][j]+=sum[i][j-1];
	FOR(i,1,n)REP(j,m)sum[i][j]+=sum[i-1][j];
	const auto Get=[&](int x1,int y1,int x2,int y2){
		int res=sum[y2][x2];
		if(x1-1>=0)res-=sum[y2][x1-1];
		if(y1-1>=0)res-=sum[y1-1][x2];
		if(x1-1>=0&&y1-1>=0)res+=sum[y1-1][x1-1];
		return res;
	};
	while(q--){
		int x1=read()-1,y1=read()-1,x2=read()-1,y2=read()-1;
		print(Get(y1*2,x1*2,y2*2,x2*2));
	}
}

Measured memory_bytes: 132992
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	if((s[0]==s[1]&&s[1]==s[2])||(s[1]==s[2]&&s[2]==s[3]))
		cout<<"Yes";
	else
		cout<<"No";
	return 0;
 } 

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<complex>

using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
//using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;
using std::abs;
using std::complex;

#define INF 999999999;
#define MOD 1000000007

using ulli = unsigned long long int;

#define EVEL 1

#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif

using Comp = complex<double>;

Comp p[25];
double SumS = 0.0;

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

    double x, y;
    scanf("%lf,%lf", &x, &y);
    p[0] = Comp(x, y);
    scanf("%lf,%lf", &x, &y);
    p[1] = Comp(x, y);
    Comp a = p[1] - p[0], b;
    while( ~scanf("%lf,%lf", &x, &y) ){
        p[2] = Comp(x, y);
        b = p[2] - p[0];
        double su = (a.real() * b.imag() - a.imag() * b.real())/2;
        dbug(su)
        SumS += abs(su);
        a = b;
    }

    printf("%.6f\n", abs(SumS));

    return 0;
}


Measured memory_bytes: 3228
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)

	arr := make([]float64, n)
	for i := range arr {
		fmt.Scan(&arr[i])
	}
	sort.Float64s(arr)

	for {
		newIng := (arr[0] + arr[1]) / 2
		arr = append(arr, newIng)
		arr[0], arr[1] = 9999, 99999
		sort.Float64s(arr)
		if arr[1] == 9999 {
			break
		}
	}

	fmt.Println(arr[0])
}


Measured memory_bytes: 512