akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
#define X first
#define Y second
#define PB push_back
#define eps 1e-9
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int i=0; i<(int)(n); ++i)

const int maxn = 1e6+7;

inline int read() {
    int ret=0,c,f=1;
    for(c=getchar(); !(isdigit(c)||c=='-'); c=getchar());
    if(c=='-') f=-1,c=getchar();
    for(; isdigit(c); c=getchar()) ret=ret*10+c-'0';
    if(f<0) ret=-ret;
    return ret;
}

int main() {
	
    ios_base::sync_with_stdio(0);
    cin.tie(0);    
    // #ifndef ONLINE_JUDGE
    // freopen("i.txt", "r", stdin);
    // freopen("o.txt", "w", stdout);
    // #endif

    int a,b;
    cin>>a>>b;
    int ans = a*b;

    int x,y;
    cin>>x>>y;
    cout<<(a-x)*(b-y);
}

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

const int MAXN = 2000 + 5;
const int MOD = 924844033;
int n, k, a[MAXN], fac[MAXN];
long long dp[MAXN][MAXN][2][2];
bool mark[MAXN];

int main() {
    cin >> n >> k;
    fac[0] = 1;
    for(int i = 1; i <= n; i ++)
    	fac[i] = 1LL* fac[i -1]*i% MOD;
    int cnt = 0;
    for( int i = 1; i <= n; i ++){
    	if( !mark[i]){
    		for(int j = i; j <= n; j += k)
    			mark[j] = true, a[++cnt] = j;
		}
	}
    dp[0][0][0][0] = 1;
    a[0] = -1 * INT_MAX;
	for( int i = 1; i <= n;i ++){
        dp[i][0][0][0] = 1;
        for(int j = 1; j <= i; j ++){
            dp[i][j][0][0]=(dp[i-1][j][1][0]+dp[i-1][j][0][0]+(a[i]-a[i-1]==k)*dp[i-1][j-1][0][0])%MOD;
            dp[i][j][0][1]=(a[i+1]-a[i]==k)*(dp[i-1][j-1][1][0]+dp[i-1][j-1][0][0])%MOD;
            dp[i][j][1][0]=(dp[i-1][j][0][1]+dp[i-1][j][1][1]+(a[i]-a[i-1]==k)*dp[i-1][j-1][0][1])%MOD;
            dp[i][j][1][1]=(a[i+1]-a[i]==k)*(dp[i-1][j-1][0][1]+dp[i-1][j-1][1][1])%MOD;
        }
    }
    int ans = 0;
    for(int i = 0; i <= n; i ++){
        int sum=(dp[n][i][0][0]+dp[n][i][0][1]+dp[n][i][1][0]+dp[n][i][1][1])%MOD;
        if(i&1) (ans+=MOD-1LL*sum*fac[n-i]%MOD)%=MOD;
        else (ans+=1LL*sum*fac[n-i]%MOD)%=MOD;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 123776
//Compete against Yourself.
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pb push_back
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

int n, a[N];

void solve(){
   int n, b;
   cin>>n>>b;   
int ans = (n*b) / __gcd(n, b);
cout<<ans;

}

int32_t main(){_
   
   int t = 1;
   //cin >> t;

   while(t--){
     solve();
     cout << endl;
   }
   

   return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;

bool prime(int p){
	if ((p==0)||(p==1)){return false;}
	else if(p==2){return true;}
	else{
		for(int i=2; i*i<=p; i++){
			if(p%i == 0){return false;}
		}
	}
	return true;
}

int main()
{
	int a,d,n,c,ans;

	while(cin >> a >> d >> n){
		if((a==0)&&(d==0)&&(n==0)){return 0;}
		c=0; ans=0;
		for(int i=0; c<n; i++){
			if( prime( (a+(i*d)) ) ){c++; ans=a+(i*d);}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 1156
/*
 * Author:  heyuhhh
 * Created Time:  2019/11/16 20:04:44
 */
#include <bits/stdc++.h>
#define MP make_pair
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define INF 0x3f3f3f3f
#define Local
#ifdef Local
  #define dbg(args...) do { cout << #args << " -> "; err(args); } while (0)
  void err() { std::cout << '\n'; }
  template<typename T, typename...Args>
  void err(T a, Args...args) { std::cout << a << ' '; err(args...); }
#else
  #define dbg(...)
#endif
void pt() {std::cout << '\n'; }
template<typename T, typename...Args>
void pt(T a, Args...args) {std::cout << a << ' '; pt(args...); }
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
//head
const int N = 10;
const double eps = 1e-6;
int n;
struct Point{
    int x, y;   
}p[N];
int a[N];
double dis(Point A, Point B) {
    double tmp = 1.0 * (A.x - B.x) * (A.x - B.x) + 1.0 * (A.y - B.y) * (A.y - B.y);   
    double l = 0, r = tmp, mid;
    for(int i = 1; i <= 500; i++) {
        mid = (l + r) / 2;
        if(mid * mid < tmp) l = mid;
        else r = mid;   
    }
    return r;
}
void run(){
    cin >> n;
    for(int i = 1; i <= n; i++) cin >> p[i].x >> p[i].y;
    for(int i = 1; i <= n; i++) a[i] = i;
    double ans = 0;
    int tot = 0;
    do {
        ++tot;
        for(int i = 2; i <= n; i++) {
            ans += dis(p[a[i]], p[a[i - 1]]);
        }
    } while(next_permutation(a + 1, a + n + 1));
    ans = ans / tot;
    cout << ans;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cout << fixed << setprecision(20);
    run();
	return 0;
}

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

int main(){
  int n,cnt=0;
  cin >> n;
  int a[n+2];
  a[0]=0;
  a[n+1]=0;
  for(int i=1;i<=n;i++) cin >> a[i];
  for(int i=0;i<n+1;i++) cnt += abs(a[i+1]-a[i]);
  for(int i=1;i<n+1;i++){
    int b = cnt;
    b -= abs(a[i+1]-a[i])+abs(a[i]-a[i-1]);
    b += abs(a[i+1]-a[i-1]);
    cout << b << endl;
  }
}


Measured memory_bytes: 1664
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	const inputLines = input.split("\n");
	const line0 = inputLines[0];
	const abcs = 'abcdefghijklmnopqrstuvwxyz';
	if (-1 < abcs.indexOf(line0)) {
		console.log('a');
	} else {
		console.log('A');
	}

	// tmp = input[1].split(" ");
	// //文字列から10進数に変換するときはparseIntを使います
	// var a = parseInt(input[0], 10);
	// var b = parseInt(tmp[0], 10);
	// var c = parseInt(tmp[1], 10);
	// var s = input[2];

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

// node index.js
// 1
// 2 3
// test
// (Ctrl + D)


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

int N;
int sum[1010] = {0};

int main()
{
    scanf("%d",&N);
    for(int i = 2; i <= N; i++)
    {
        int now = i;
        for(int j = 2; j <= 1000; j++)
        {
            while(now % j == 0)
            {
                sum[j]++;
                now /= j;
            }
        }
    }
    long long int ans = 1;
    for(int i = 1; i <= 1000; i++)
    {
        ans *= (long long int)sum[i] + 1;
        ans %= (long long int)1000000007;
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        final int N = Integer.parseInt(sc.next());
        long[] h = new long[N];
        for (int i = 0; i < N; i++) {
            h[i] = Long.parseLong(sc.next());
        }
        String ans = "Yes";
        long pre = -1;
        
        for (int i = 0; i < N; i++) {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        }
        
        out.println(ans);
        
        out.flush();
    }
}

Measured memory_bytes: 48564
using System;

namespace Array
{
    class Finding_Missing_Cards
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var suit = new string[n];
            var rank = new int[n];
            for (int i = 0; i < n; i++)
            {
                var array = Console.ReadLine().Split(' ');
                suit[i] = array[0];
                rank[i] = int.Parse(array[1]);
            }

            Check("S", suit, rank);
            Check("H", suit, rank);
            Check("C", suit, rank);
            Check("D", suit, rank);

        }

        static void Check(string s, string[] suit, int[] rank)
        {
            for (int j = 1; j <= 13; j++)
            {
                bool exist = false;
                for (int i = 0; i < suit.Length; i++)
                    if (suit[i] == s && rank[i] == j) exist = true;
                if (!exist)
                {
                    Console.WriteLine(s + " " + j);
                }
            }
        }
    }
}

Measured memory_bytes: 9212
#include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define sz(v) (int) v.size()
#define pr(v) For(i, 0, sz(v)) {cout<<v[i]<<" ";} cout<<endl;
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(ll i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long
#define int long long
#define mp make_pair
#define F first
#define S second
typedef pair<int, int> pii;
typedef vector<int> vi;
#define MOD 1000000007
#define INF 1000000000000000007LL

const int N = 100005;
 
// it's swapnil07 ;)
 
#ifdef SWAPNIL07
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif


void solve(){
    string s; cin>>s;
    if(s[1]=='B')
        s[1]='R';
    else
        s[1]='B';
    cout<<s;
}


signed main()
{
    fast
    #ifdef SWAPNIL07
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    int t=1;
    while(t--){
        solve();
    }
    return 0;
}





Measured memory_bytes: 3648
import itertools
import math
import fractions
import functools
import copy

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = []
for i in range(m):
    bi, ci = map(int, input().split())
    bc.append([bi,ci])

for i in range(n):
    bc.append([1,a[i]])

bc.sort(reverse=True, key=lambda x: x[1])

count = 0
ans = 0
index = 0
for i in range(len(bc)):
    if count < n:
        ans += bc[i][0] * bc[i][1]
        count += bc[i][0]
        index = i
    else:
        break

if count != n:
    ans -= (count - n)*bc[index][1]

print(ans)


Measured memory_bytes: 120468
#include <stdio.h>

int main()
{
	char i,j,k;
	scanf("%c",&i);
	scanf("%c", &j);
	scanf("%c", &k);
	if (i == 'H') {
		printf("%c\n",k);
	}
	else {
		if (k == 'H') {
			printf("D\n");
		}
		else {
			printf("H\n");
		}
	}
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

const ll MOD = 1e9 + 7;
const ll INF = 1e16;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)

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

void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
//--------------------------------------------------------------------------------//
ll modpow(ll a, ll n, ll mod_) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod_;
        a = a * a % mod_;
        n >>= 1;
    }
    return res;
}

//const ll mod = 998244353;
const ll mod = 1e9 + 7;
const ll MAX_SIZE = 2000005;
array<ll, MAX_SIZE> fac, inv, finv;
ll fac_init() {
    // combination init
    fac[0] = 1;
    for (ll i = 1; i < MAX_SIZE; i++) fac[i] = fac[i - 1] * i % mod;
    finv[0] = modpow(fac[MAX_SIZE - 1], mod - 2, mod);
    repe(i, 1, MAX_SIZE) finv[i] = finv[i - 1] * (MAX_SIZE - i) % mod;
    reverse(all(finv));

    //inv init
    repe(i, 1, MAX_SIZE) inv[i] = modpow(i, mod - 2, mod);
}

ll perm(ll a, ll b) { return fac[a] * finv[a - b] % mod; }

ll comb(ll a, ll b) { return fac[a] * finv[b] % mod * finv[a - b] % mod; }

ll f(ll a, ll b){
    return (a != 1) ? comb(a + b + 2, b + 1) - (a + b + 2) : b * (b + 3) / 2 % mod;
}
int main() {
    init();
    ll r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    fac_init();

    ll ans = (f(r2, c2) - f(r2, c1-1) - f(r1-1, c2) + f(r1-1, c1-1) + 5 * mod) % mod;
    cout << ans << endl;
}

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

int main() {
  int n, x, y;
  cin >> n;
  bool once = false, twice = false;
  while(n--) {
    cin >> x >> y;
    if(x==y) {
    	if(!once) {
        	once = true;
        }
      	else if(!twice) {
        	twice = true;
        }
      	else { 
        	cout << "Yes"; 
      		return 0;
      	}
    }
    else {
    	once = twice = false;
    }
  }
    cout << "No";
	return 0;
}

Measured memory_bytes: 3668
#include <stdio.h>

// void	ft_swap(int *a, int *b, int *c)
// {
// 	int *tmp1;
// 	int *tmp2;
// 	int tmp3;

// 	tmp1 = a;
// 	tmp2 = c;
// 	tmp3 = b;

// 	a = tmp2;
// 	b = tmp1;
// 	c = tmp3;
// }

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

	scanf("%d%d%d",&a,&b,&c);
	// ft_swap(&a,&b,&c);
	printf("%d %d %d", c, a, b);
	return (0);
}

Measured memory_bytes: 128
#include <iostream>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;

int main(){
    int N, M, K, A[35] = {0};
    cin >> N >> M;
    for(int i = 0; i < N; i++){
            cin >> K;
        for(int j = 0; j <K; j++){
            int like = 0;
            cin >> like;
            A[like]++;
        }
    }
    int cnt = 0;
    rep(i, 35) if(A[i] == N){
        cnt++;
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var k = int.Parse(Console.ReadLine());
        var s = Console.ReadLine();

        if(s.Length <= k)
        {
            Console.WriteLine(s);
        }
        else
        {
            var tmp = s.Substring(0, k);
            Console.WriteLine(tmp + "...");
        }
    }
}

Measured memory_bytes: 27316
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect


def zz():
    return list(map(int, input().split()))


def z():
    return int(input())


def S():
    return input()


def C(line):
    return [input() for _ in range(line)]


K = z()
lunlun = [1, 2, 3, 4, 5, 6, 7, 8, 9]
if (K <= 9):
    print(lunlun[K-1])
    exit()
while len(lunlun) < K:
    for lun in lunlun:
        right = int(str(lun)[-1])
        if (right == 0):
            add = [0, 1]
        elif (right == 9):
            add = [8, 9]
        else:
            add = [right-1, right, right+1]
        for ad in add:
            # print(lun*10 + ad)
            lunlun.append(lun * 10 + ad)
        if (len(lunlun) >= K):
            break_flg = True
            break

# print(lunlun)
print(lunlun[K-1])


Measured memory_bytes: 31344
#include <cstdio>
#include <vector>
#include <cstring>
using namespace std;

typedef bool mat_t;

struct matrix{

	vector< vector<mat_t> > val;
	int height, width;

	matrix(){}
	matrix(int height_, int width_):height(height_), width(width_){
		val.assign(height, vector<mat_t>(width, false));
	}

	vector<mat_t>& operator[](const size_t ind){
		return val[ind];
	}
};

matrix get_identity(int size){
	matrix ret(size, size);
	for(int i=0; i<size; i++){
		ret[i][i] = true;
	}
	return ret;
}

matrix operator*(const matrix& lhs, const matrix& rhs){
	matrix ret(lhs.height, rhs.width);

	for(int i=0; i<lhs.height; i++){
		for(int k=0; k<lhs.width; k++){
			for(int j=0; j<rhs.width; j++)if(lhs.val[i][k] && rhs.val[k][j]){
				ret[i][j] = true;
			}
		}
	}

	return ret;
}

matrix pow(const matrix& x, const int k){
	matrix ret = get_identity(x.width), base = x;

	for(int e=k; e; e>>=1){
		if(e&1){
			ret = ret * base;
		}
		base = base * base;
	}


	return ret;
}

const int MAX_N = 50;
const int MAX_M = 50;

int N, M, Z;

pair<int,int> edge[2*MAX_M];
bool after[2*MAX_M], result[2*MAX_M];

bool init(){
	scanf("%d%d%d", &N, &M, &Z);
	for(int i=0; i<M; i++){
		int x, y;
		scanf("%d%d", &x, &y);
		x--; y--;
		edge[2*i + 0] = make_pair(x, y);
		edge[2*i + 1] = make_pair(y, x);
	}
	return N > 0;
}

bool solve(){
	matrix mat(2*M, 2*M);
	for(int i=0; i<2*M; i++){
		for(int j=0; j<2*M; j++)if(i!=j){
			if(edge[i].second == edge[j].first && edge[i].first != edge[j].second){
				mat[i][j] = true;
			}
		}
	}
	mat = pow(mat, Z-1);

	memset(after, false, sizeof(after));
	for(int i=0; i<2*M; i++){
		if(edge[i].first == 0){
			after[i] = true;
		}
	}

	memset(result, false, sizeof(result));
	for(int i=0; i<2*M; i++){
		for(int j=0; j<2*M; j++){
			result[j] |= mat[i][j] && after[i];
		}
	}

	for(int i=0; i<2*M; i++)if(result[i] && edge[i].second == N-1){
		return true;
	}

	return false;
}

int main(){
	for(;init();){
		puts(solve() ? "yes" : "no");
	}

	return 0;
}

Measured memory_bytes: 808
#include <stdio.h>
int main()
 {

	unsigned long long len,i,a,b;
	scanf("%llu%llu",&a,&b);
	char s[1000];
	scanf("%s",s);
	len=strlen(s);
	if(s[a]!='-')
    {
        printf("No\n");      return 0;
    }
    for(i=0;i<len;i++)
    {
        if(s[i]=='-')i++;
        if(!(s[i]>='0'&&s[i]<='9'))
    {
        printf("No\n");      return 0;
    }
    }
    printf("Yes\n");
    return 0;
}


Measured memory_bytes: 1628
#include<iostream>
#include<cctype>
#include<string>
using namespace std;

const string mcxi = "ixcm";
const int ten[] = {0,1,10,100,1000,10000};

int mtoi(string s){
  int res = 0;
  for(int i=0;i<(int)s.size();i++){
    if(isdigit(s[i])){
      int pos=0;
      while(s[i+1] != mcxi[pos])pos++;
      res += (int)(s[i]-'0') * ten[pos+1];
      i++;
    }else{
      int pos=0;
      while(s[i] != mcxi[pos])pos++;
      res += ten[pos+1];
    }
  }
  return res;
}

string itom(int x){
  string res="";
  for(int i=3;i>=0;i--){
    int digit = x%ten[i+2]/ten[i+1];
    if(digit==1){
      res += mcxi[i];
    }else if(digit!=0){
      res += '0'+digit;
      res += mcxi[i];
    }
  }
  return res;
}

int main(){
  int n;
  cin >> n;
  while(n--){
    string a,b;
    cin >> a >> b;
    cout << itom( mtoi(a) + mtoi(b) ) << endl;
  }
}

Measured memory_bytes: 1208
n = gets.chomp.to_i
a = gets.chomp.split(" ").map{|i|i.to_i}
cnum = Array.new(n+1, 0)
a.each do |num|
  cnum[num] += 1
end
 
1.upto(n) do |i|
  puts cnum[i]
end

Measured memory_bytes: 35740
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define pp pop_back
#define in insert
#define ff first
#define ss second
#define  show for(int j=0;j<v.size();j++) cout<<v[j]<<" ";
#define ld long double
#define e endl
#define bc __builtin_popcount
#define MOD 1000000007
ll fast_expo(ll x,ll p)
{if(p==0) return 1;
else if(p%2==0){ ll t=fast_expo(x,p/2)%MOD;return (t*t)%MOD;} else return (x*(fast_expo(x,p-1))%MOD)%MOD;}
int main()
{
     int n,m,x;

    cin>>n>>m>>x;
    int c[n];
    int a[n][m];
    for(int i=0;i<n;i++)
    {
         cin>>c[i];
         for(int j=0;j<m;j++)
         {
              cin>>a[i][j];
         }
    }
    ll ans=INT_MAX;
    for(int i=1; i<(1<<n); i++)
    {
int temp=i;
int j=0;
ll cost=0;
vector<ll> val(m);
while(temp)
{
if (temp&1)
{
for(int k=0;k<m;k++)
{
     val[k]+=a[j][k];
}
cost+=c[j];
}
temp >>= 1;
j++;
}
int cnt=0;
for(int k=0;k<m;k++)
{
     if(val[k]>=x)
     {
          cnt++;
     }
}
if(cnt==m)
ans=min(ans,cost);
//printf(”\n");
   }
   if(ans==INT_MAX)
     cout<<-1;
   else
   cout<<ans<<e;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int a,b,c,f=0,t=0;
	string s[102];
	cin>>a>>b;
	r(i,a){
		cin>>s[i+1];
		s[i+1]="#"+s[i+1]+"#";
	}
	r(i,b+2)s[0]+="#",s[a+1]+="#";
	r(i,a+2)cout<<s[i]<<endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>
#include <new>
#include <typeinfo>
#include <iterator>

typedef long long ll;
typedef unsigned long long ull;
constexpr ll mop = 1000000007;
constexpr ll mop2 = 998244353;

using namespace std;

int main() {
	ll n, k;
	cin >> n >> k;
	vector<ll> a;
	a.resize(n + 2);
	for (ll i = 1; i <= n; i++) {
		cin >> a[i];
	}
	vector<ll> cumSum;
	bool endflag = false;
	for (ll q = 0; q < k; q++) {
		if (endflag) break;
		endflag = true;
		cumSum.clear();
		cumSum.resize(n + 2, 0);
		for (ll i = 1; i <= n; i++) {
			ll l = max(1LL, i - a[i]);
			ll r = min(n + 1, i + a[i] + 1);
			cumSum[l]++;
			cumSum[r]--;
		}
		for (ll i = 1; i <= n; i++) {
			cumSum[i + 1] += cumSum[i];
		}
		for (ll i = 1; i <= n; i++) {
			a[i] = cumSum[i];
			if (a[i] != n) endflag = false;
		}
		
		
	}
	for (ll i = 1; i <= n; i++) {
		if (i - 1) {
			cout << " ";
		}
		cout << a[i];
	}
	cout << endl;

	
}

Measured memory_bytes: 6440
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef int Int;
typedef pair<Int,Int> pii;
typedef pair<Int,double> pid;
typedef pair<double,double> pdd;
typedef pair<Int,pii> pip;
typedef pair<double,Int> pdp;
#define A first
#define B second
#define pb(x) push_back(x)
#define ALL(x) x.begin(),x.end()
#define SZ(x) (x).size()
#define CLR(x) memset(x,0,sizeof x)
#define pdebug() printf("%d\n",__LINE__)
#define Itype(a) typeof(a.begin()) 
#define REP(i,a,b) for(int i = (a);i <= (b);i++)
#define FORO(i,n) REP(i,0,(int)n-1)
#define FORI(i,n) REP(i,1,(int)n)
#define FORIT(i,t) for(Itype(t) i = t.begin();i != t.end();i++)
#define eps 1e-6
#define sqr(x) ((x)*(x))
#define dist(_a,_b) sqrt(sqr(_a.A-_b.A)+sqr(_a.B-_b.B))
#define norm(_a) sqrt(sqr(_a.A)+sqr(_a.B))
template<typename T>void getMin(T &a,T b) { if(a > b) a = b; }
template<typename T>void getMax(T &a,T b) { if(a < b) a = b; }
const int MAX = 1000010;

ll N;
bool prime[MAX+1];
vector<ll> ps;
vector<int> es;

void eratos(int n) {
	for(int i = 0;i <= n;i++) prime[i] = 0;
	for(int i = 3;i <= n;i+=2) prime[i] = 1;
	prime[2] = 1;
	for(int i = 3;i*i <= n;i+=2) {
		if(!prime[i]) continue;
		for(int j = 2*i;j <= n;j+=i)
			prime[j] = 0;
	}
}

ll ans;

void search(ll num, int k) {
    if(k == SZ(ps)) {
        num--;
        if(num == 0) return ;
        //cout << "made " << num << endl;
        if(N / num == N % num) {
            //cout << num << endl;
            ans += num;
        }
    } else {
        ll nxt = num;
        for(int e = 0;e <= es[k];e++) {
            search(nxt, k + 1);
            nxt *= ps[k];
        }
    }
}

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

    cin >> N;

    eratos(sqrt(N) + 1);

    ll tmp = N;
    for(ll p = 2;p * p <= N;p++) {
        if(prime[p]) {
            int e = 0;
            while(tmp % p == 0) {
                tmp /= p;
                e++;
            }
            if(e) {
                ps.pb(p);
                es.pb(e);
            }
           // cout << "p, e = " << p << " " << e << endl;
        }
    }

    if(tmp > 1) {
        ps.pb(tmp); es.pb(1);
    }
    
    search(1, 0);

    cout << ans << endl;
    return 0;
}

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

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

int main(){
    int N;
    cin >> N;
    map<int,int> m;
    for(int i=0;i<N;i++){
        int a;
        cin >> a;
        m[a]++;
    }

    int count=0;
    auto begin = m.begin(), end = m.end();
    for (auto iter = begin; iter != end; iter++) {
        if(iter->first <= iter->second){
            count += iter->second - iter->first;
        }else{
            count += iter->second;
        }
    }

    cout << count;

    return 0;
}

Measured memory_bytes: 4736
N, A, B = map(int, input().rstrip().split())
if A == 0:
    ret = 0
elif A + B == 0:
    ret = 0
else:
    tmp1 = int(N / (A + B)) * A
    tmp2 = 0
    if A > N % (A + B):
        tmp2 = N % (A + B)
    else:
        tmp2 = A
    ret = tmp1 + tmp2
print(ret)


Measured memory_bytes: 3060
from itertools import accumulate
from bisect import bisect_left,bisect_right
n,m,k=map(int,input().split())
a=[0]+list(accumulate(map(int,input().split())))
b=[0]+list(accumulate(map(int,input().split())))
ans=[0]
for i in range(n+1):
    c=bisect_right(b,k-a[i])-1
    if c!=-1:
        ans.append(c+i)
print(max(ans))

Measured memory_bytes: 48620
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define ld long double
#define fi first
#define se second
#define mp make_pair
#define pb push_back
const ll mod = 1e9 + 7;
int main()
{
	SPEED
	ll A;
	cin >> A;

	vector<bool> three(A+1, false);
    vector<bool> five(A+1, false);
    
    for(ll i = 1; i <= A; i++)
    {
        if(i%3==0)
        {
            three[i] = true;
        }
        if(i%5==0)
        {
            five[i] = true;
        }
    }
    
    ll ans = 0;
    
    for(ll i = 1; i <= A; i++)
    {
        if(!three[i] && !five[i])
        {
            ans+=i;
        }
    }
    
    cout << ans;
	return 0;
}

Measured memory_bytes: 3744
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    string s;
    cin>>s;
    cout << s.substr(0,4) << " " << s.substr(4,8) <<"\n";
    return 0;
}

Measured memory_bytes: 256
//Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target ("avx")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
template<class T>
void dmp(T a){
	rep(i,a.size()) cout << a[i] << " ";
	cout << endl;
}
template<class T>
bool chmax(T&a, T b){
	if(a < b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a, T b){
	if(a > b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}
//ios::sync_with_stdio(false);
const ll mod = 998244353;//998244353
template<class T>
void add(T&a,T b){
	a+=b;
	if(a >= mod) a-=mod;
}


int main(){
	string s; cin >> s;
	int a = s[0]-'A';
	if(0 <= a && a < 26) cout<<"A"<<endl;
	else cout <<'a'<<endl;
}


Measured memory_bytes: 3616
x = int(input())
ans = x
flg = False
while not flg:
    li = []
    for i in range(1,(ans)//2+1):
        if ans % i == 0:
            li.append(1)
        else:
            li.append(0)
    if sum(li) == 1:
        flg = True
    else:
        flg = False
        ans += 1
print(ans)

Measured memory_bytes: 3608
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

h, w = na()
li = []
pad = ""
for i in range(w+2):
    pad += "."
li.append(pad)
for i in range(h):
    li.append("." + input() + ".")
li.append(pad)
ans = "Yes"
flag = False
for y in range(1, h+1):
    for x in range(1, w+1):
        if li[y][x] == "#":
            if li[y-1][x] == "#" or li[y+1][x] == "#" or li[y][x-1] == "#" or li[y][x+1] == "#":
                continue
            else:
                ans = "No"
                flag = True
                break
    if flag:
        break
print(ans)

Measured memory_bytes: 3064
#include <stdio.h>

int main(){
    int N, T;
    int min = 1001, counter = 0;
    scanf("%d %d", &N, &T);
    for (int i = 1; i <= N;i++){
        int c, t;
        scanf("%d %d", &c, &t);
        if (t <= T && c < min){
            min = c;
            counter = 1;
        }    
    }
    if(counter == 1)
        printf("%d\n", min);
    else
        printf("TLE\n");
    return 0;
}

Measured memory_bytes: 128
"use strict";
const main = arg => {
    var inputlines = arg.split('\n');
    var lines = inputlines[0].split(' ');

    var N = parseInt(lines.shift());
    var K = parseInt(lines.shift());

    var array = [];

    for(let i = 0; i < K; i++){
        var tmp = inputlines[2+(2*i)].split(' ').map(Number);

        for(let j = 0; j < tmp.length;j++){
            array.push(tmp[j]);
        }
    }

    const notHave = new Set(array);

    var cnt = 0;

    for(let i = 1; i <= N; i++){
        if(!notHave.has(i)){
            cnt++;
        }
    }

    console.log(cnt);

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

Measured memory_bytes: 30244
import java.util.*;


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

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
if(line.length()==2)
        System.out.println(line);
else{
String s[]=line.split("",0);
System.out.println(s[2]+s[1]+s[0]);
}
    }
}

Measured memory_bytes: 25300
#include<bits/stdc++.h>
using namespace std;
typedef vector< long long > vi;
typedef long long ll;
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define endl "\n"
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define fr(n) for(ll i=0;i<n;i++)
#define tr(a) for(auto it=a.begin();it!=a.end();it++)
#define N 10001
#define PI 3.1415926535897932384
#define F first
#define S second
#define elasped_time    1.0 * clock() / CLOCKS_PER_SEC
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair




int main() 
{ 
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output1.txt", "w", stdout); 
#endif
ll n;
cin>>n;
ll a[n];
fr(n) cin>>a[i];
ll dp[n];
dp[0]=0;
dp[1]=abs(a[0]-a[1]);
rep(i,2,n){
    ll x=dp[i-1]+abs(a[i]-a[i-1]);
    ll y=dp[i-2]+abs(a[i]-a[i-2]);
    //cout<<x<<" "<<y<<endl;
    dp[i]=min(x,y);
}
cout<<dp[n-1];

    return 0; 
} 

Measured memory_bytes: 5188
#include <bits/stdc++.h>
using namespace std;
const int N = 105;
pair<int, int> arr[N];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> arr[i].first >> arr[i].second;
    bool flag = false;
    for (int i = 1; i + 2 <= n; i++)
        if (arr[i].first == arr[i].second && arr[i + 1].first == arr[i + 1].second && arr[i + 2].first == arr[i + 2].second)
            flag = true;
    cout << (flag ? "Yes" : "No") << '\n';
    return 0;
}

Measured memory_bytes: 3592
# coding: utf-8

import heapq


def dj(adjm, start):
    n = len(adjm)
    d = [float("inf")] * n
    d[start] = 0
    q = []
    heapq.heappush(q, (0, start))

    while(q):
        td, v = heapq.heappop(q)
        for k in adjm[v].keys():
            nd = td + adjm[v][k]
            if d[k] > nd:
                d[k] = nd
                heapq.heappush(q, (nd, k))
    return d


def main():
    n = int(input())
    # 隣接行列
    adjm = [{} for _ in range(n)]
    for i in range(n):
        vdata = list(map(int, input().split()))
        for j in range(vdata[1]):
            v, c = vdata[j * 2 + 2], vdata[j * 2 + 3]
            adjm[i][v] = c
    ans = dj(adjm, 0)
    for i, d in enumerate(ans):
        print(i, d)


if __name__ == "__main__":
    main()



Measured memory_bytes: 5980
#include <iostream>
#include<algorithm>
#include <set>
#include <utility>
#include <cmath>
#include <string>
#include <cstring>
#include <cctype>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <cstdlib>
#include <iomanip>
#include <ctime>
#include <limits>
#include <istream>
#include <ostream>
#include <complex.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define INF 1e16
#define mod 10000000007
#define mmax(x,y)(x>y?x:y);
#define mmin(x,y)(x<y?x:y);

int main()
{
	int n,d;
	cin>>n>>d;
	int p;
	p=n/(2*d+1);
	if(n%(2*d+1)!=0)
		p++;
	cout<<p<<endl;



	return 0;
}

Measured memory_bytes: 256
#include <iostream>
              
int main() {  
    int x = 0;
    int cnt = 0;
    while(true) {
        std::cin >> x;
        if(x == 0) break;
              
        std::cout << "Case " << ++cnt << ": " << x << std::endl;
    }         
    return 0; 
}

Measured memory_bytes: 1160
#include <cstdio>

typedef long long ll;

ll N;
ll A, B;
ll h[100000];

bool ok(ll t)
{
    ll count = 0;
    for(int i = 0; i < N; i++){
        if(h[i] > B * t){
            count += 1 + (h[i] - B * t - 1) / A;
        }
    }
    return (count <= t);
}

int main()
{
    scanf("%lld %lld %lld", &N, &A, &B);
    for(int i = 0; i < N; i++){
        scanf("%lld", &h[i]);
    }
    ll base = 0;
    ll answer = 0;
    A = A - B;

    ll min = 1, max = 1000000000;
    while(min < max){
        ll mid = (min + max) / 2;
        if(ok(mid)){
            max = mid;
        }else{
            min = mid + 1;
        }
    }
    printf("%lld\n", min);
}


Measured memory_bytes: 896
#!/usr/bin/env python
# coding: utf-8

import sys

def match(s):
    if s[:7] == 'dreamer':
        if len(s) > 7 and s[7] == 'a':
            return 5
        else:
            return 7
    if s[:6] == 'eraser':
        return 6
    if s[:5] == 'dream' or s[:5] == 'erase':
        return 5
    return -1

def main():
    s = raw_input()
    offset = 0
    while offset < len(s):
        n = match(s[offset:])
        if n == -1:
            print 'NO'
            sys.exit()
        offset += n
    print 'YES'

if __name__ == '__main__':
    main()


Measured memory_bytes: 2948
#ifdef OJ_MISC_OFFLINE

#include "prolog.h"

#else
#define LOG
#define PRINT
#define LCERR
#include <iostream>
auto optimize_cpp_stdio = []() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::setvbuf(stdout, nullptr, _IOFBF, BUFSIZ);
    return 0;
}();
#endif

#include <algorithm>
#include <array>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>

namespace {

using namespace std;

class Solution {
public:

private:

};

int solve() {
    Solution solution;
    vector<int> edges(3);
    for (int i = 0; i < 3; ++i) {
        cin >> edges[i];
    }
    sort(edges.begin(), edges.end());
    cout << edges[0] * edges[1] / 2 << '\n';
    return 0;
}

} // anonymous namespace

#ifdef OJ_MISC_OFFLINE

#include "epilog.h"

#else

int main() {
    return solve();
}

#endif


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

const long long modConst = 1000000007;
long long A[200005], suffixSum[200005];

int main()
{
	int N;
	scanf("%d", &N);
	
	for(int i = 1; i <= N; i++)
		scanf("%lld", &A[i]);
		
	suffixSum[N + 1] = 0;
	for(int i = N; i >= 1; i--)
		suffixSum[i] = (suffixSum[i + 1] + A[i]) % modConst;
	
	long long ans = 0;
	for(int i = 1; i <= N; i++)
	{
		ans += (A[i] * suffixSum[i + 1]) % modConst;
		ans %= modConst;
	}
	
	printf("%lld", ans);
}


Measured memory_bytes: 6932
def del_flg(X, person, flg = 0):
    try:
        person = X[0]
        X = X[1:]
    except:
        flg = 1

    return person, X, flg

A = list(input())
B = list(input())
C = list(input())
flg = 0

al = len(A) + len(B) + len(C)
person = 'a'
flg = ''
for i in range(al):
    if person == 'a':
        person, A, flg = del_flg(A, person)
    elif person == 'b':
        person, B, flg = del_flg(B, person)
    else:
        person, C, flg = del_flg(C, person)

    if flg == 1:
        break

print(person.upper())


Measured memory_bytes: 3064
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;

int main() {
	int l[11];
	char c;
	for(; cin >> l[1] >> c; ) {
		rep(i, 9) cin >> l[i + 2] >> c;
		l[0] = 0;
		int v1, v2; cin >> v1 >> c >> v2;
		rep(i, 10) l[i + 1] += l[i];
		double x = l[10] / (double)(v1 + v2) * v1;
		rep(i, 10) if(l[i] <= x && x <= l[i + 1]) {
			cout << i + 1 << endl;
			break;
		}
	}
	return 0;
}

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

using namespace std;

#define INF (int) 1000000000

typedef long long ll;

string a, b;
int mat[4000][4000];

int main(){
    cin >> a >> b;
//    cout << a << " " << b << endl; 
    if(a[0] == b[0]){
        mat[0][0] = 1;
    }
    for(int i = 1; i < a.length(); i++){
        mat[i][0] = mat[i-1][0];
        if(a[i] == b[0]){
            mat[i][0] = 1;
        }
    }
    for(int i = 1; i < b.length(); i++){
        mat[0][i] = mat[0][i-1];
        if(b[i] == a[0]){
            mat[0][i] = 1;
        }
    }
//    cout << "wtf" << endl;
    for(int i = 1; i < a.length(); i++){
        for(int j = 1; j < b.length(); j++){
            if(a[i] == b[j]){
                mat[i][j] = mat[i-1][j-1]+1;
            }
            else{
                mat[i][j] = max( { mat[i-1][j], mat[i][j-1], mat[i-1][j-1] } );
            }
        }
    }
/*    
    cout << "printing: " << endl;
    for(int i = 0; i < a.length(); i++){
        for(int j = 0; j < b.length(); j++){
            cout << mat[i][j] << " ";
        }
        cout << endl;
    }
    
    cout << mat[a.length()-1][b.length()-1] << endl;
*/    
    stack<char> ans;
    int i = a.length()-1, j = b.length()-1;
    while(i > 0 && j > 0){
        if(mat[i][j-1] == mat[i][j]){
            j--;
        }
        else if(mat[i-1][j] == mat[i][j]){
            i--;
        }
        else if(mat[i-1][j-1] == mat[i][j]){
            i--; j--;
        }
        else{
            ans.push(a[i]);
            i--; j--;
        }
    }
    while(i > 0){//j == 0
        if(mat[i][j] > mat[i-1][j]){
            ans.push(a[i]);
        }
        i--;
    }
    while(j > 0){//i == 0
        if(mat[i][j] > mat[i][j-1]){
            ans.push(a[i]);
        }
        j--;
    }
    if(a[0] == b[0]){
        cout << a[0];
    }
    while(!ans.empty()){
        cout << ans.top();
        ans.pop();
    }
}

Measured memory_bytes: 47360
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)






int main() {
	char X,Y;
	cin >>X>>Y ;
	char h = '=';
	if (X > Y) {
			h = '>';
	}
	else if (X < Y) {
		h = '<';
	}
	cout <<h<< endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <numeric>
#include <tuple>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <limits>
#include <unordered_map>
#include <type_traits>
#include <map>

using namespace std;
using str = string;

#define rep(a,l,r) for(int a=(l);a<(r);a++)
#define get cin>>
#define put cout<<

int gcd_euclid(int u, int v) {
  int r;
  while (0 != v) {
    r = u % v; u = v; v = r; /* swap */
  }
  return u;
}

// 最大公約数算出
int calc_gcd(const vector<int> vec){
	int gcd = *min_element(vec.begin(), vec.end());
	for (const int ele: vec){
		gcd = gcd_euclid(gcd,ele);
	}
	return gcd;
}

// 最小公倍数
int calc_lcm(const vector<int> vec) {
	int tmp = 1;
	for (const int ele: vec){
		tmp *= ele;
	}
	int gcd = calc_gcd(vec);
	return tmp/gcd;
}



void run() {
    str n; get n;

    for(auto s : n){
    	if(s == '1') {
    		cout << '9';
    	} else {
    		cout << '1';
    	}
    }
}

int main() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);run();return 0;}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int i,j;
  int n;
  int len[300];
  int sum=0;

  cin>>n;
  rep(i,2*n)
    cin>>len[i];

  sort(len,len+2*n);

  rep(i,2*n){
    sum+=len[i];
    //cout<<sum<<" "<<i<<endl;
    i++;
  }
    cout<<sum<<endl;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
    static Scanner sc = new Scanner(System.in);
    public static void main(String args[]){
        int N=sc.nextInt(),count=0,temp=0;
        long res=(long) Math.pow(3,N);
        for(int i=0;i<N;i++){
            temp=sc.nextInt();
            if(temp%2==0){
                count++;
            }
        }
        res-=(long)Math.pow(2,count);
        System.out.println(res);
    }
}


Measured memory_bytes: 35848
package main
import (
       "fmt"
       "os"
       "bufio"
       "strconv"
)

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	stdin.Scan()
	text := stdin.Text()
	i, _ := strconv.Atoi(text)
	fmt.Println(i*i*i)
}

Measured memory_bytes: 1084
#include <iostream>
#include <string>
#include <cstring>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>
#include <fstream>
#include <unordered_set>

using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007
#define P pair<ll, ll>


int main() {
	ll n;
	bool ok = true;
	cin >> n;
	REP(i, n) {
		ll a;
		cin >> a;
		if (a % 2 == 0) {
			if (a % 3 != 0 and a % 5 != 0)ok = false;
		}
	}
	cout << (ok ? "APPROVED" : "DENIED") << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) noexcept {
  return std::vector<T>(n, std::forward<T>(val));
}

template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) noexcept {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}

int main() {
  i64 N, R;
  cin >> N >> R;
  if(N >= 10) {
    cout << R << endl;
  }
  else {
    cout << R + 100 * (10 - N) << endl;
  }
}


Measured memory_bytes: 764
h,w = map(int, input().split())
a = [input() for i in range(h)]
cnt = [0] * 26
for i in a:
  for j in i:
    cnt[ord(j)-ord("a")] += 1
two,no = 0,0
for i in cnt:
  if i % 2:
    no += 1
  elif i % 4:
    two += 1
if (h % 2) and (w % 2):
  if no <= 1 and two <= h//2 + w//2:
    print("Yes")
  else:
    print("No")
elif (h % 2):
  if no == 0 and two <= w//2:
    print("Yes")
  else:
    print("No")
elif (w % 2):
  if no == 0 and two <= h//2:
    print("Yes")
  else:
    print("No")
else:
  if no == 0 and two == 0:
    print("Yes")
  else:
    print("No")

Measured memory_bytes: 3064
//31
#include<iostream>

using namespace std;

char g[8][9];

void bomb(int y,int x){
  if(0<=y&&y<8&&0<=x&&x<8&&g[y][x]=='1'){
    g[y][x]='0';
    int dy[]={0,1,0,-1};
    int dx[]={1,0,-1,0};
    for(int i=0;i<4;i++){
      for(int j=1;j<=3;j++){
	bomb(y+dy[i]*j,x+dx[i]*j);
      }
    }
  }
}

int main(){
  int n;
  cin>>n;
  for(int i=1;i<=n;i++){
    for(int j=0;j<8;j++){
      cin>>g[j];
    }
    int x,y;
    cin>>x>>y;
    bomb(y-1,x-1);
    cout<<"Data "<<i<<':'<<endl;
    for(int j=0;j<8;j++){
      cout<<g[j]<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 0
echo A,B,C,*I,_=`tr ' 
' ,`"0;s,t=[A,B].map{|a|[-F=1e15,*I.shift(a),F]};I.map{|x|p" {s[s,s\|t[t}".bsearch_index{|y|y>x}-1,2].map{|" "t|[(s-x).abs,(t-x).abs].min+(t-s).abs}.min}.min}"|ruby

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

using namespace std;

/**************************************************************/
#define int          long long
#define mem(a , v)   memset(a , v , sizeof a)
#define all(v)       v.begin() , v.end()
#define ff           first
#define ss           second
#define err(x)       cerr << #x << " is : " << x << endl
#define endl         "\n"



const int MOD   =   1e9 + 7;
const int N     =   1e6 + 20;
const int big   =   1e14;
/***************************************************************/

void solve()
{
    int n , cnt = 0 , x;
    cin >> n;
    for(int i = 1 ; i <= n ;i++)
    {
        cin >> x;
        if((x & 1) and (i & 1))
            cnt++;
    }
    cout << cnt << endl;
    return;
}


int32_t main()
{
    clock_t st = clock();
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
   //cin >> t;
    while(t--)
        solve();
    
    return 0;
}


Measured memory_bytes: 3648