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

using namespace std;

using ll = long long;

const int MX = 807;
const int INF = 1000 * 1000 * 1000 + 7;

string s[MX];

int d[MX][MX];

int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};

int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#ifdef BZ
    freopen("input.txt", "r", stdin);
#endif
    int n, m, k;
    cin >> n >> m >> k;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            d[i][j] = INF;
        }
    }
    int sx = -1, sy = -1;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        for (int j = 0; j < m; j++) {
            if (s[i][j] == 'S') {
                sx = i;
                sy = j;
            }
        }
    }
    d[sx][sy] = 0;
    queue<pair<int, int> > q;
    q.emplace(sx, sy);
    while (!q.empty()) {
        int x = q.front().first;
        int y = q.front().second;
        q.pop();
        for (int dd = 0; dd < 4; dd++) {
            int nx = x + dx[dd], ny = y + dy[dd];
            if (nx >= 0 && nx < n && ny >= 0 && ny < m && d[nx][ny] > d[x][y] + 1 && s[nx][ny] != '#') {
                d[nx][ny] = d[x][y] + 1;
                q.emplace(nx, ny);
            }
        }
    }
    int ans = INF;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (d[i][j] <= k) {
                int cx = min(i, n - 1 - i);
                int cy = min(j, m - 1 - j);
                int x = (min(cx, cy) + k - 1) / k;
                ans = min(ans, x + 1);
            }
        }
    }
    cout << ans << "\n";
}




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

using namespace std;

const int MAX_N = 2e5 + 5;
const long long MOD = 1e9 + 7;

typedef long long ll;

int N, M, K;
ll fact[MAX_N], invf[MAX_N];
ll ans = 0;

ll qexp(ll A, ll B) {
    if (B == 0) return 1;
    ll half = qexp(A, B / 2);
    (half *= half) %= MOD;
    if (B % 2) (half *= A) %= MOD;
    return half;
}

void precompute() {
    fact[0] = invf[0] = 1;
    for (int i = 1; i < MAX_N; i++) {
		fact[i] = fact[i - 1] * i % MOD;
		invf[i] = qexp(fact[i], MOD - 2);
	}
}

ll nCk(int n, int k) {
    if (k < 0 || k > n) return 0;
	return fact[n] * invf[k] % MOD * invf[n - k] % MOD;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    precompute();
    cin >> N >> M >> K;
    for (int i = 1; i <= N; i++) {
        int cur = (i - 1) - (N - i);
        (ans += 1LL * M * M % MOD * i % MOD * cur % MOD) %= MOD;
    }
    for (int i = 1; i <= M; i++) {
        int cur = (i - 1) - (M - i);
        (ans += 1LL * N * N % MOD * i % MOD * cur % MOD) %= MOD;
    }
    cout << (ans * nCk(N * M - 2, K - 2) % MOD);
}



Measured memory_bytes: 3328
#include <boost/multiprecision/cpp_int.hpp>
#include <cmath>
#include <iostream>
#include <vector>

using bint = boost::multiprecision::cpp_int;

bint power(const int& p, const int& q)
{
    bint result = 1;
    for (int i = 0; i < q; i++) {
        result *= p;
    }
    return result;
}

// bitを小さい位から32桁vectorに詰める
std::vector<int> getBits(const bint& num)
{
    std::vector<int> result{};
    for (int i = 0; i < 32; i++) {
        result.emplace_back(boost::multiprecision::bit_test(num, i));
    }
    return result;
}

int main()
{
    int N;
    std::vector<int> xs;
    std::vector<int> ys;
    std::cin >> N;
    for (int i = 0; i < N; i++) {
        int x, y;
        std::cin >> x >> y;
        xs.emplace_back(x);
        ys.emplace_back(y);
    }
    bool is_odd;
    if (std::abs(xs.at(0) + ys.at(0)) % 2 == 1) {
        is_odd = true;
    } else {
        is_odd = false;
    }
    for (int i = 0; i < N; i++) {
        if (is_odd and (xs.at(i) + ys.at(i)) % 2 == 0) {
            std::cout << -1 << std::endl;
            return 0;
        } else if (not is_odd and std::abs(xs.at(i) + ys.at(i)) % 2 == 1) {
            std::cout << -1 << std::endl;
            return 0;
        }
    }
    if (not is_odd) {
        std::cout << 32 << std::endl;
        for (int i = 0; i < 31; i++) {
            std::cout << power(2, i) << " ";
        }
        std::cout << 1 << std::endl;
    } else {
        std::cout << 31 << std::endl;
        for (int i = 0; i < 30; i++) {
            std::cout << power(2, i) << " ";
        }
        std::cout << power(2, 30) << std::endl;
    }

    for (int i = 0; i < N; i++) {
        int x = xs.at(i);
        int y = ys.at(i);
        // 偶数なら左に一つずらす
        if (not is_odd) {
            x--;
        }
        bint sum_x_plus_y = (power(2, 31) - 1 + x + y) / 2;
        bint sum_x_minus_y = (power(2, 31) - 1 + x - y) / 2;
        std::vector<int> x_plus_y_bits = getBits(sum_x_plus_y);
        std::vector<int> x_minus_y_bits = getBits(sum_x_minus_y);
        for (int j = 0; j < 31; j++) {
            if (x_plus_y_bits.at(j) == 0 and x_minus_y_bits.at(j) == 0) {
                std::cout << "L";
            } else if (x_plus_y_bits.at(j) == 0 and x_minus_y_bits.at(j) == 1) {
                std::cout << "D";
            } else if (x_plus_y_bits.at(j) == 1 and x_minus_y_bits.at(j) == 0) {
                std::cout << "U";
            } else if (x_plus_y_bits.at(j) == 1 and x_minus_y_bits.at(j) == 1) {
                std::cout << "R";
            } else {
                std::cout << x_plus_y_bits.at(j) << " " << x_minus_y_bits.at(j) << std::endl;
                std::cerr << "error" << std::endl;
            }
        }
        if (not is_odd) {
            std::cout << "R" << std::endl;
        } else {
            std::cout << std::endl;
        }
    }


    return 0;
}

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

int main(){
  char ch[201],end[2]="-";
  char **moji;
  int i,j,n,m,leng;
  while(1){
    scanf(" %s",ch);
    if(!strcmp(ch,end)) break;
    scanf(" %d",&m);
    leng=strlen(ch);
    moji=malloc(m*sizeof(char *));
    for(i=0;i<m;i++) moji[i]=malloc((leng+1)*sizeof(char));
    for(i=0;i<m;i++){
      scanf(" %d",&n);
      if(i==0){
         for(j=0;j<leng;j++){
           if(j<n) moji[i][j+leng-n]=ch[j];
           else moji[i][j-n]=ch[j];}}
      else{
        for(j=0;j<leng;j++){
           if(j<n) moji[i][j+leng-n]=moji[i-1][j];
           else moji[i][j-n]=moji[i-1][j];}}
      moji[i][leng]='\0';}
    printf("%s\n",moji[m-1]);}
  return 0;}

Measured memory_bytes: 608
#define _CRT_SECURE_NO_WARNINGS

#include<iostream>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<iomanip>
#include<set>
#include<map>
#include<utility>
#include<string>
#include<vector>

using namespace std;

#define LL long long

int n,A[25],q,m;
bool ok[2005]={};

int main() {
	cin>>n;
	for(int i=0;i<n;i++)cin>>A[i];
	cin>>q;
	for(int i=1;i<(1<<20);i++){
		int tmp=0;
		for(int j=0;j<20;j++)if(i&(1<<j))tmp+=A[j];
		if(tmp<=2000)ok[tmp]=true;
	}
	for(int i=0;i<q;i++){
		cin>>m;
		cout<<(ok[m]?"yes":"no")<<endl;
	}
	return 0;
}




Measured memory_bytes: 3116
#define _USE_MATH_DEFIMES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1'000'000'007;
const int INF = 1'000'000'000; //1e9
const int NIL = -1;
const long long LINF = 1'000'000'000'000'000'000; // 1e18
const long double EPS = 1E-10;

template<class T, class S> inline bool chmax(T &a, const S &b){
    if(a < b){
        a = b; return true;
    }
    return false;
}
template<class T, class S> inline bool chmin(T &a, const S &b){
    if(b < a){
        a = b; return true;
    }
    return false;
}








int main(){
    int D; std::cin >> D;
    std::vector<int> c(26);
    for(int i(0); i < 26; ++i) std::cin >> c[i];
    for(int i(0); i < D; ++i) std::cout << 1 << "\n";
    return 0;
}


Measured memory_bytes: 3624
#! /usr/bin/env python3

from fractions import gcd
# from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
import math

N = int(input())
pos = [[int(_) for _ in input().split()] for i in range(N)]

ret = 0
coms = permutations(range(N), N)

ct = 0
for com in coms:
    pt = pos[com[0]]
    for i in com[1:]:
        n = pos[i]
        ret += math.sqrt((pt[0]-n[0])**2 + (pt[1] - n[1])**2)
        pt = n
    ct += 1

print(ret / ct)

Measured memory_bytes: 10348
//#include <bits/stdc++.h>
//
//using namespace std;
//
//int main() {
//    int n,k;
//    while(cin >> n >> k){
//            if(n % k) cout << 1 << endl;
//    else cout << 0 << endl;
////        cout << n / k - n % k << endl;
//    }
//    return 0;
//}

//
//#include <bits/stdc++.h>
//
//using namespace std;
//
//const int maxn = 200000;
//bool vis[maxn];
//int main() {
//    int n;
//    while(cin >> n) {
//        memset(vis,0,sizeof(vis));
//        for(int i = 0; i < 100; i++) {
//            int sum = i * 4;
//            for(int j = 0; j < 100; j++) {
//                sum += j * 7;
//                vis[sum] = 1;
//            }
//        }
//    if(vis[n]) printf("Yes\n");
//    else printf("No\n");
//    }
//    return 0;
//}





#include <bits/stdc++.h>

using namespace std;

const int maxn = 200000;
bool vis[maxn];
long long s[maxn];
long long n;

void Init() {
    s[0] = 1;
    for(int i = 1; i < 64; i++)
        s[i] = s[i - 1] * 2 ;
//    printf("%lld\n",s[62]);
    return ;
}
int main() {
    int n;
    Init();
    while(cin >> n) {
        string ans = "";
        if(n == 0) cout << 0 << endl;
        while(n) {
            int m = n;
            int x = abs(n) % 2;
            char c = x + '0';
//            str += (c);
            ans += c ;
            n /= -2;
            if(m < 0 && abs(m) & 1)
                n++;
        }
        reverse(ans.begin(),ans.end());
        cout << ans << endl;
    }
    return 0;
}








//#include <bits/stdc++.h>
//
//using namespace std;
//
//const int maxn = 200000;
//map<long long,long long>mm;
//int n;
//long long m;
//int main() {
//    while(cin >> n >> m) {
//        long long num,sum = 0,ans = 0;
//        mm.clear();
//        mm[0]++;
//        for(int i = 1; i <= n; i++) {
//            cin >> num;
//            sum += num;
//            sum %= m;
//            ans += mm[sum];
//            mm[sum]++;
////            cout << sum <<"   " << ans << endl;
//        }
//        cout << ans << endl;
//    }
//    return 0;
//}


Measured memory_bytes: 764
#!/usr/bin/env python3
import sys
from itertools import accumulate
INF = float("inf")


def solve(N: int, X: int, L: "List[int]"):
    D = [0]+list(accumulate(L))
    count = 0
    for d in D:
        if d <= X:
            count += 1
    print(count)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, X, L)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
import std.stdio;
import std.algorithm;

void main() {
	int n, m;
	readf(" %s %s", &n, &m);
	auto a = new int[n];
	foreach (ref e;a) {
		readf(" %s", &e);
	}

	int total = a.reduce!"a + b";
	auto populars = a.count!(x => x * m * 4 >= total);

	if (populars >= m) {
		writeln("Yes");
	} else {
		writeln("No");
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
#define mp make_pair
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define ff first
#define ss second
#define INF (ll) (1e9)
#define mod (ll) (1e9 + 7)
#define endl "\n"
#define tt ll testcase; cin>>testcase; while(testcase--)
 
int main(){
	fast;
	ll n, k;
	cin>>n>>k;
	ll a[n];
	for(ll i=0; i<n; i++){
		cin>>a[i];
	}
	bool dp[k+1] = {0};
	dp[0] = 0;
	for(ll i=1; i<=k; i++){
		for(ll j=0; j<n; j++){
			if(i >= a[j]){
				if(!(dp[i-a[j]])){
					dp[i] = 1;
					break;
				}
			}
		}
	}
	if(dp[k]){
		cout<<"First";
	}
	else{
		cout<<"Second";
	}
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <numeric>

using namespace std;
using int_vec = vector<int>;

int check(int_vec& v, int k, int p) {
    int j = 0;
    auto it = v.begin();
    for (int i = 0; i < k; ++i) {
        int s = 0;
        while (s + *it <= p) {
            s += *it++;
            ++j;
            if (it == v.end())
                return v.size();
        }
    }
    return j;
}

int solve(int_vec& v, int k) {
    int n = v.size();
    int begin = 0;
    int end = accumulate(v.begin(), v.end(), 0);

    while (begin < end - 1) {
        int mid = (begin + end) / 2;
        int x = check(v, k, mid);
        if (x < n) {
            begin = mid;
        } else {
            end = mid;
        }
    }
    return end;
}

int main() {
    int n, k;
    cin >> n >> k;

    int_vec v;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        v.push_back(x);
    }

    cout << solve(v, k) << endl;

    return 0;
}

Measured memory_bytes: 3408
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    print(input().replace(",", " "))


main()


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

using namespace std;

typedef long long LL;
const LL MAXN=128;
const LL MAXM=100000+100;
const LL INF=0x3f3f3f3f;
LL dp[MAXM];
LL c[MAXN],v[MAXN];
LL n,w;
LL sum,ans;

int main(){
	memset(dp,INF,sizeof(dp));
	cin>>n>>w;
	for(LL i=1;i<=n;i++){
		cin>>c[i]>>v[i];
		sum+=v[i];
	}
	
	dp[0]=0; 
	for(LL i=1;i<=n;i++){
		for(LL j=sum;j>=v[i];j--){
			dp[j]=min(dp[j],dp[j-v[i]]+c[i]);
			if(dp[j]<=w) ans=max(ans,j);
		}
	} 
	
	cout<<ans<<endl;
	return 0;
}
/*
6 15
6 5
5 6
6 4
6 6
3 5
7 2

3 8
3 30
4 50
5 60
*/

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

int main() {
    long long H; cin >> H;
    long long ans = 0;
    long long t = 1;
    while (H > 0) {
        ans += t;
        t *= 2;
        H /= 2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
n, d = map(int, (input().split()))
lst = [list(map(int, input().split())) for i in range(n)]

ans = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        sum = 0
        for k in range(d):
            sum += (lst[i][k] - lst[j][k]) ** 2
        if int(sum ** 0.5) ** 2 == sum:
            ans += 1

print(ans)


Measured memory_bytes: 3188
#include <iostream>
using namespace std;
int main(){
  string S;
  cin >> S;
  int L = S.length();
  int s = L;
  for(int i = 0; i < L; ++i){
    if(i > 0 && S[i] != S[i-1]){
      s = min(s, max(i,L-i));
    }
  }
  cout << s << endl;
  return 0;
}


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

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Solver2 {
 public:
  int h, w;
  vector<vector<int>> dist;
  Solver2(LL h, LL w) : h(h), w(w), dist(10, vector<int>(10)){};

  void solve() {
    for (int i = 0; i < 10; ++i) {
      for (int j = 0; j < 10; ++j) {
        cin >> dist[i][j];
      }
    }
    for (int k = 0; k < 10; ++k) {
      for (int i = 0; i < 10; ++i) {
        for (int j = 0; j < 10; ++j) {
          dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
        }
      }
    }
    int ans = 0;
    for (int i = 0; i < h; ++i) {
      for (int j = 0; j < w; ++j) {
        int tmp;
        cin >> tmp;
        if (tmp != -1) {
          ans += dist[tmp][1];
        }
      }
    }
    cout << ans << endl;
  }
};
}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(12);
  long long n = 0, w;
  std::cin >> n >> w;

  Problem::Solver2 sol(n, w);
  sol.solve();
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  string s;
  cin>>s;
  if(s[2]==s[3] && s[4]==s[5]) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
				

  return 0;
}


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

#define rep(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (a); i >= (int)(b); i--)
#define all(x) (x).begin(), (x).end()
using i32 = int32_t;
using i64 = int64_t;
using f32 = float;
using f64 = double;
using P = pair<int, int>;

template <class T>
bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    } else {
        return false;
    }
}
template <class T>
bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    } else {
        return false;
    }
}

template <class T>
void dump_vec(const vector<T>& v) {
    auto len = v.size();
    rep(i, 0, len) {
        cout << v[i] << (i == (int)len - 1 ? "\n" : " ");
    }
}

struct FastIO {
    FastIO() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} FASTIO;

//---------------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------------

signed main() {
    int a, b, c;
    cin >> a >> b >> c;
    cout << c << " " << a << " " << b << "\n";
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>
#include <bitset>
#include <set>

using namespace std;
using ll = long long;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

const ll MOD = 1e9 + 7;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
const int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 };
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define fr first
#define sc second



int main() {
	ll a, b, c, k;
	cin >> a >> b >> c >> k;
	if (a >= b&&a >= c) {
		for (int i = 0;i < k;i++)a *= 2;
		cout << a + b + c << endl;
	}
	else if (b >= a&&b >= c) {
		for (int i = 0;i < k;i++)b *= 2;
		cout << a + b + c << endl;
	}
	else  {
		for (int i = 0;i < k;i++)c *= 2;
		cout << a + b + c << endl;
	}
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
const long long mod=1e9+7;
long long matmod(long long val,long long k){
	long long ret=1ll;
	for(;k;k>>=1){
		if(k&1) ret=(val*ret)%mod;
		val=(val*val)%mod;
	}
	return ret;
}
void add(long long &des,long long sor){des+=sor;des%=mod;return ;}
char s[5005];
int n;
long long f[2][5005];
int main(){
	//freopen("keyboard.in","r",stdin);
	//freopen("keyboard.out","w",stdout);
	scanf("%d",&n);
	scanf("%s",s);
	int len=strlen(s);
	if(len>n){puts("0");return 0;}
	long long mul=matmod(2ll,len);
	f[0][0]=1ll;
	long long ans=f[0][len];
	for(int i=1;i<=n;i++){
		f[i&1][0]=(f[(i-1)&1][0]+f[(i-1)&1][1])%mod;
		for(int j=1;j<=i;j++){
			f[i&1][j]=0; 
			add(f[i&1][j],f[(i-1)&1][j-1]*2ll);
			add(f[i&1][j],f[(i-1)&1][j+1]);
		}
		add(ans,f[i&1][len]);
	}
	long long tmp=matmod(mul,mod-2ll);
	long long newans=f[n&1][len]*tmp%mod;
	printf("%lld\n",newans);
	return 0;
}

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

#define MAX 200

int isEmpty();
int isFull();
void Push(int);
int Pop();

int top = 0, s[MAX];

int main()
{
  int y;
  char a[16], b;

  while(scanf("%s", a)!=EOF)
    {
      if(a[0] == '+')
	{
	  y = Pop();
	  y += Pop();
	  Push(y);
	}
      else if(a[0] == '-')
	{
	  y = -1*Pop();
	  y += Pop();
	  Push(y);
	}
      else if(a[0] == '*')
	{
	  y = Pop();
	  y *= Pop();
	  Push(y);
	}
      else if(b=='\n')
	{
	  break;
	}
      else
	{
	  Push(atoi(a));
	}
      
    }

  printf("%d\n", Pop());
      
  return 0;
}

int isEmpty()
{
  return top == 0;
}
int isFull()
{
  return top >= MAX-1;
}
void Push(int x)
{
  if(isFull())
    {
      fprintf(stderr, "OVF\n");
    }
  top++;
  s[top] = x;
}
int Pop()
{
  if(isEmpty())
    {
      fprintf(stderr, "UNF");
    }
  top--;
  return s[top+1];
}

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

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

int gcd(int x, int y){
	if(x % y == 0) return y;
	return gcd(x, x % y);
}
int lcm(int x, int y){
	return x * y / gcd(x, y);
}

int main(){
  int n;
  cin >> n;
  REP(i, n+1){
    if(i % 3 == 0){
      cout << " " << i;
      continue;
    }
    string s = to_string(i);
    rep(j, s.size()){
      if(s[j] == '3'){
        cout << " " << i;
        break;
      }
    }
  }
  cout << endl;
}





Measured memory_bytes: 3244
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MAXN 100005
#define mod 1000000007

int main()
{
    ll x,y;
    cin>>x>>y;
    if(y%2) cout<<"No\n";
    else
    {
        double b = y/2-x;
        double a = 2*x - y/2;
        if(a>=0 && b>=0)    cout<<"Yes\n";
        else    cout<<"No\n";
    }
}

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

int main(){
  int n; cin >> n;
  vector<ll> a(n);
  ll w = 1e18;
  ll tisa=1;
  ll ans;
  bool fl = true;
  double keta = 0;
  double kk = 0;
  rep(i,n){
    cin >> a[i];
    if(a[i]==0){
      fl = false;
      ans = 0;
      break;
    }
    keta = log10(a[i]);
    kk += keta;
    if(kk > 18){
      fl = false;
      ans = -1;
    }
  }
  
  if(fl){
    rep(i,n){
      tisa *= a[i];
      
      if(tisa > w){
        fl = false;
        ans = -1;
        break;
      }
      
    }
  }
  if(fl){ans = tisa;}
  cout << ans << endl;
}


Measured memory_bytes: 4040
def main():
    N = int(input())
    A = list(map(int, input().split()))
    lst = [(i, a) for i, a in enumerate(A)]
    lst.sort(key=lambda x: x[1])
    ans = [x[0] + 1 for x in lst]
    print(*ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 68140
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <bitset>
using namespace std;

template <std::size_t N>
std::string to_string(const std::bitset<N>& bs)
{
  return bs.to_string<char, std::char_traits<char>, std::allocator<char> >();
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	long A, B;
	cin >> A >> B;
	//1 2 4 8 16 32 64 ...
  	//2 ~ 4: 2 3 4 : 010 011 100 → 101:5 偶数スタート　奇数個
  	//3 ~ 5: 3 4 5 : 011 100 101 → 010:2 奇数スタート　奇数個

  	//2 ~ 5: 2 3 4 5: 010 011 100 101 → 000:0 偶数スタート　偶数個
  	//3 ~ 6: 3 4 5 6: 011 100 101 110 → 100:4 奇数スタート　偶数個
	//9 ~ 14 :  9 10 11 12 13 14: 01001 01010 01011 01100 01101 01110 → 00111  奇数スタート　偶数個　→　最初と最後の数字
  	//10 ~ 15: 10 11 12 13 14 15: 01010 01011 01100 01101 01110 01111 → 00001　偶数スタート　偶数個　→　数値関係なく１
    //10 ~ 14: 10 11 12 13 14
  	long ans=0;
  	
  	long num = B - A + 1; //個数
  	if(num % 2 == 0)//偶数個
    {
    	if(A % 2 == 0) //偶数スタート
        {
          	if((num / 2) % 2 == 0) cout << 0 << endl;
          	else cout << 1 << endl;
          	return 0;
        }
      	else		  //奇数スタート
        {
          	//最初と最後の数のxorをとる
          	string start = to_string(std::bitset<64>(A));
          	string end = to_string(std::bitset<64>(B));
		  	//cerr << "S:" << start << endl;
          	//cerr << "E:" << end << endl;
          	for(int i = 63;i >=0;i--)
            {
              if((start[i]=='0' && end[i]=='0') || (start[i]=='1' && end[i]=='1')) continue;
              else
              {
                //cerr << 63 - i << endl;
                ans+=pow(2,63-i);
              }
            }
          	ans -=((B-A-1)/2)%2;
        }
    }
  	else			//奇数個
    {
      long pair_num=B-A;
      if(pair_num == 0)
      {
        ans = A;
      }
      else
      {
        if(A % 2 == 0) //偶数スタート
        {
          //最後残し
          ans = B + (pair_num/2)%2;
        }
        else		  //奇数スタート
        {
          //最初残し
          ans = A - (pair_num/2)%2;
        }
      }
    }
  	cout << ans << endl;
  	return 0;
}


Measured memory_bytes: 384
import java.util.Scanner;
public class Main {
	static Scanner scan=new Scanner(System.in);
	static int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}
	static long lcm (int a, int b) {return a*b/gcd(a,b);}
	static int max(int a,int b) {return a>b?a:b;}
	static int min(int a,int b) {return a<b?a:b;}
	static long factorial(int i) {return i==1?1:i*factorial(i-1);}
	static int lower_bound(int a[],int key) {
		int low=0,high=a.length;
		while(low<high) {
			int mid=((high-low)/2)+low;
			if(a[mid]<=key)low=mid+1;
			else high=mid;
		}
		return high;
		}
	static int upper_bound(int a[],int key) {
		int low=0,high=a.length;
		while(low<high) {
			int mid=((high-low)/2)+low;
			if(a[mid]<key)low=mid+1;
			else high=mid;
		}
		return high;
		}
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2)if(n%i==0){return false;}
		return true;
	}
	static int upper_division(int a,int b) {
		if(a%b==0) {
			return a/b;
		}
		else {
			return a/b+1;
		}
	}
	static long lupper_division(long a,long b) {
		if(a%b==0) {
			return a/b;
		}
		else {
			return a/b+1;
		}
	}
	static long lmax(long a,long b) {return Math.max(a, b);}
	static long lmin(long a,long b) {return Math.min(a, b);}
	static int[] setArray(int a) {
		int b[]=new int[a];
		for(int i=0;i<a;i++) {
			b[i]=scan.nextInt();
		}
		return b;
	}
		public static void main(String[] args) {
			int a=scan.nextInt();
			int b=scan.nextInt();
			for(int i=b-a+1;i<a+b;i++) {
				System.out.print(i+" ");
			}
			System.out.println();
		}
}

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

using namespace std;

#define fastio cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(0)
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> matrix;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(c) c.begin(),c.end()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define endl '\n'
const int MAX = 1e6+1;
const int INF = 0x3f3f3f3f;

int n;

int main(){
	fastio;
	cin>> n;
	for(int i = 9; i>= 1; --i){
		if(n%i == 0){
			n /= i;
			break;
		}
	}
	if(1 <= n && n<= 9) cout<< "Yes\n";
	else cout<< "No\n";

	return 0;
}

Measured memory_bytes: 256
N,K = map(int, input().split())
arr1=[]
arr=[]
for i in range(1, N+1):
  arr1.append(i)

for i in range(K*2):
  A=list(map(int, input().split()))
  if i%2!=0:
    arr = arr+A
print(len(list(set(arr1) - set(arr))))


Measured memory_bytes: 9304
n = input()

i = len(n)

if n[i - 1] == '3':
    print('bon')
elif n[i - 1] == '0' or n[i - 1] == '1' or n[i - 1] == '6' or n[i - 1] == '8':
    print('pon')
else:
    print('hon')

Measured memory_bytes: 9032
n, m, l = [int(i) for i in input().split()]
a = []
b = []
c = [[0] * l for _ in range(n)]
for _ in range(n):
    a.append([int(i) for i in input().split()])
for _ in range(m):
    b.append([int(i) for i in input().split()])
for i in range(n):
    for j in range(l):
        c[i][j] = sum([a[i][k] * b[k][j] for k in range(m)])
for r in c:
    print(*r)



Measured memory_bytes: 6964
inp = raw_input()
q = int(raw_input())
out = ""
for i in range(q):
    text = map(str, raw_input().split())
    if text[0] == "replace":
        inp = inp[0:int(text[1])] + text[3] + inp[int(text[2])+1:len(inp)]
    elif text[0] == "reverse":
        out = inp[0:int(text[1])]
        index = int(text[2])
        for j in range(int(text[2]) - int(text[1]) + 1):
            out += inp[index]
            index -= 1
        out += inp[int(text[2])+1:len(inp)]
        inp = out
    elif text[0] == "print":
        print inp[int(text[1]):int(text[2])+1]
    

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

signed main(){
  string s;cin>>s;
  string t=s;
  reverse(t.begin(),t.end());
  for(char &p:t){
    if(p=='b')p='d';
    else if(p=='d')p='b';
    else if(p=='p')p='q';
    else if(p=='q')p='p';
  }
  if(s==t)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Measured memory_bytes: 512
import re

def solve(s, t):
	if s == t:
		return "IDENTICAL"
	s = s.split("\"")
	t = t.split("\"")
	if len(s) == len(t):
		a = sum(s[i] != t[i] for i in range(0, len(s), 2))
		b = sum(s[i] != t[i] for i in range(1, len(s), 2))
		if a == 0 and b == 1:
			return "CLOSE"
	return "DIFFERENT"

while True:
	s = input()
	if s == ".":
		break
	t = input()
	print(solve(s, t))



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

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

using namespace std;
int hm[43];
int r,n;

int main() {
  while(cin>>r>>n,r){
    REP(i,43) hm[i]=0;
    REP(i,n){
      int xl,xr,h;
      cin>>xl>>xr>>h;
      for(int i=xl+21;i<xr+21;++i) hm[i]=max(hm[i],h);
    }
    double mx=21;
    for(int i=21-r+1;i<21+r;++i) mx=min(mx,min(hm[i-1],hm[i])+r-sqrt(r*r-(i-21)*(i-21)));
    cout<<setprecision(10)<<fixed<<mx<<endl;
  }
  return 0;
}

Measured memory_bytes: 1228
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define inf LLONG_MAX
#define pll pair <ll,ll>
#define min_pq priority_queue <pll> ,vector <pll>, greater <pll> > > 
#define f first
#define s second
const int N=100005;

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

	ll n;
	cin>>n;
	string s[n];
	ll t[n];
	ll suff[n]={0};
	map <string,ll> m;
	for(ll i=0;i<n;i++)
	{
		cin>>s[i]>>t[i];
		suff[i]=t[i];
		m[s[i]]=i;
	}
	for(ll i=n-2;i>=0;i--)
	{
		suff[i]+=suff[i+1];
	}
	string x;
	cin>>x;
	ll y=m[x];
	if(y==n-1)
		cout<<0<<'\n';
	else
	{
		cout<<suff[y+1]<<'\n';
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {ll N,K,S;
  cin >>N>>K;
  S=N-K;
  if(K==1){cout<<0<<endl;}
  else {cout<<S<<endl;}
    
}



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

#define pb push_back
#define all(v) v.begin(), v.end()
#define sz(v) int(v.size())
#define pii pair<int, int>
#define mp make_pair
#define f first
#define ll long long
#define ld long double
#define s second
#define vec vector<int>

using namespace std;

const int N = (int) 5e3 + 10;
const int M = (int) 2018 * 2018;
const int K = (int) 15;
const int INF = (int) 1e9 + 7;
const int mod = (int) 998244353;
const ld EPS = (ld) 1e-9;
const ll LINF = (ll) 1e18;

int n;
string s;
string dp[N];

int main() {
	#ifdef sony
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	srand(time(0));
	cin >> n >> s;
	n += n;
	string str = "";
	vector<string> v;
	for (int i = 0, b = 0; i < n; i++) {
		if (s[i] == 'a') b++;
		else b--;
		str += s[i];
		if (!b) {
			//cout << str << " ~~~~~~~\n";
			vec id[2];
			for (int j = 0; j < sz(str); j++) {
				if (str[j] == 'a') { 
					id[0].pb(j);
				} else { 
					id[1].pb(j);
				}
			}
			string cur = "";
			if (id[0][0] < id[1][0]) {
				int cur_id = -1;
				for (int j = 0; j < sz(id[0]); j++) {
					if (id[0][j] > cur_id) {
						cur += "ab";
						cur_id = id[1][j];
					}
				}
			} else {
				set<int> st;
				for (int j = sz(id[0]) - 1; j >= 0; j--) {
					st.insert(id[0][j]);
					st.insert(id[1][j]);
					string tmp = "";
					for (auto it : st) tmp += str[it];
					cur = max(cur, tmp);
				}
			}
			v.pb(cur);
			str = "";
		}
	}
	for (auto it : v) {
		//cout << it << "\n";
	}
	for (int i = sz(v) - 1; i >= 0; i--) {
		dp[i] = max(dp[i + 1], v[i] + dp[i + 1]);
	}
	cout << dp[0];
	return 0;	
}

Measured memory_bytes: 10624
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;

int main(){
    int A,B;
    cin >> A >> B;
    int sum=0;
    int out=1;
    while(out<B){
        out--;
        out += A;
        sum++;
    }
    cout << sum << endl;
    return 0;
}


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

const int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dd[] = {1, 2, 4, 8, 16, 32, 64, 128};
const char color[] = {'o', '\0', 'x'};


class Point
{
public:
  int x, y, dir, v;
  Point(int xx, int yy, int dd, int vv)
    :x(xx), y(yy), dir(dd), v(vv) {}
};

class Mami
{
public:
  bool operator() (const Point& lhs, const Point& rhs) const
  {
    if (lhs.v == rhs.v) {
      if (lhs.y == rhs.y)
	return lhs.x < rhs.x;
      return lhs.y < rhs.y;
    }
    return lhs.v > rhs.v;
  }
};

class Charlotte
{
public:
  bool operator() (const Point& lhs, const Point& rhs) const
  {
    if (lhs.v == rhs.v) {
      if (lhs.y == rhs.y)
	return lhs.x > rhs.x;
      return lhs.y > rhs.y;
    }
    return lhs.v > rhs.v;
  }
};

int main()
{
  vector<string> board;
  board.push_back("##########");
  for (int i = 0; i < 8; ++i) {
    string s;
    cin >> s;
    s = "#" + s + "#";
    board.push_back(s);
  }
  board.push_back("##########");
  
  int player = -1;
  bool mamitta = false;
  for ( ; ; ) {
    vector<Point> c;
    for (int y = 1; y <= 8; ++y) {
      for (int x = 1; x <= 8; ++x) {
	if (board[y][x] == '.') {
	  int dir = 0, flip = 0;
	  for (int k = 0; k < 8; ++k) {
	    int cnt = 0;
	    int xx = x + dx[k];
	    int yy = y + dy[k];
	    if (board[yy][xx] == color[-player+1]) {
	      while (board[yy][xx] == color[-player+1]) {
		++cnt;
		xx += dx[k];
		yy += dy[k];
	      }
	      if (board[yy][xx] == color[player+1]) {
		flip += cnt;
		dir |= dd[k];
	      }
	    }
	  }
	  
	  if (dir != 0)
	    c.push_back(Point(x, y, dir, flip));
	}
      }
    }

    if (c.empty()) {
      if (mamitta)
	break;
      mamitta = true;
      player = -player;
      continue;
    }

    mamitta = false;
    if (player == -1)
      sort(c.begin(), c.end(), Mami());
    else
      sort(c.begin(), c.end(), Charlotte());

    board[c[0].y][c[0].x] = color[player+1];
    for (int k = 0; k < 8; ++k) {
      if (c[0].dir & dd[k]) {
	int xx = c[0].x + dx[k];
	int yy = c[0].y + dy[k];
	while (board[yy][xx] != color[player+1]) {
	  board[yy][xx] = color[player+1];
	  xx += dx[k];
	  yy += dy[k];
	}
      }
    }
    player = -player;
  }

  board.erase(board.begin());
  board.erase(board.end()-1);
  for (int i = 0; i < 8; ++i) {
    board[i].erase(board[i].begin());
    board[i].erase(board[i].end()-1);
    cout << board[i] << endl;
  }

  return 0;
}

Measured memory_bytes: 0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
public class MainClass
{
	public const long Giri = 1000000007;
 
	public static void Main(string[] args)
	{
		var p = Input().ToInt();
		Console.WriteLine((p[0]+p[1])%24);
	}
	
 
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(' '); }
	public static int Clamp(int val, int max, int min = 0) { return Math.Min(max, Math.Max(min, val)); }
}
 
public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt();
		return r;
	 }
}

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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
    int n, m;
    cin >> n >> m;
    if (n == m) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>
#define eol '\n'
using namespace std;

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

  int n, v, mi = INT_MAX, max_df = INT_MIN;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> v;
    max_df = max(max_df, v - mi);
    mi = min(mi, v);
  }
  
  cout << max_df << eol;
  
  return 0;
}

Measured memory_bytes: 3216
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int i,n,a[8]={0,1,2,4,8,16,32,64};
    cin>>n;
    for(i=7;i>=1;i--)
	{
        if(n>=a[i])
		{
            cout<<a[i]<<endl;
            return 0;
        }
    }
 } 

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


int main() {
	long long int A, B, C, D, E;
	cin >> A >> B;
	long long int A2 = A, B2 = B;
	int ans = 1;
	int check = 0, check2 = 0, tmpA[10000000] = { 0 }, tmpB[10000000] = { 0 }, tmpA2[10000000] = { 0 }, tmpB2[10000000] = { 0 };
	if (A < B) {
		C = B;
	}
	else {
		C = A;
	}
	if (A >= 10000 || B >= 10000) {
		D = sqrt(C + 1);
		E = sqrt(C);
		for (int i = 2; i <= D; i++) {
			while (A % i == 0) {
				check = 1;
				A /= i;
				tmpA[i]++;
				tmpA2[i] = pow(i, tmpA[i]);
			}
			while (B % i == 0) {
				check2 = 1;
				B /= i;
				tmpB[i]++;
				tmpB2[i] = pow(i, tmpB[i]);
			}
			if (check == 1 && check2 == 1) ans++;
			check = 0;
			check2 = 0;
		}

		int s = 1, t = 1;
		for (int i = 2; i <= D; i++) {
			if (tmpA2[i] != 0) {
				s *= tmpA2[i];
			}
			if (tmpB2[i] != 0) {
				t *= tmpB2[i];
			}
		}
		if (A2 / s >= E && B2 / t >= E && A2 / s == B2 / t) {
			ans++;
		}
	}
	else {
		for (int i = 2; i <= C / 2; i++) {
			while (A % i == 0) {
				check = 1;
				A /= i;
			}
			while (B % i == 0) {
				check2 = 1;
				B /= i;
			}
			if (check == 1 && check2 == 1) ans++;
			check = 0;
			check2 = 0;
		}
	}
	
		
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 156672
#include <stdio.h>

int main(){
    int h,n;
    scanf("%d %d",&h,&n);
    int sum = 0;
    for(int i = 0; i<n; i++){
        int num;
        scanf("%d",&num);
        sum+=num;
    }
    if(sum>=h){
        printf("Yes");
    }
    else{
        printf("No");
    }
}

Measured memory_bytes: 128
n = int(input())

def dfs(s):
    if int(s) > n:
        return 0
    if all(s.count(c) > 0 for c in '753'):
        ret = 1
    else:
        ret = 0
    for c in '753':
        ret += dfs(s+c)
    return ret

print(dfs("0"))

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

//TO_STRING
template <typename A, typename B>
string to_string(pair<A, B> p);
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
 
string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(char ch){
  string s;
  s += ch;
  return s;
}

string to_string(const char* s) {
  return to_string((string) s);
}
 
string to_string(bool b) {
  return (b ? "true" : "false");
}
 
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
 
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
 
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + 
    to_string(get<2>(p)) + ")";
}
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + 
    to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

//DEBUG 
void debug_out() { cerr << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL //compile with -DLOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;

typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<pi> vpi;
typedef vector<char> vch;
typedef vector<string> vstr;
typedef vector<vi> vvi;
typedef vector<vpi> vvpi;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<vb> vvb;
typedef vector<vvi> vvvi;
typedef vector<vch> vvch;
typedef vector<vstr> vvstr;

#define all(x) x.begin(), x.end()
#define pb push_back
#define pf push_front
#define fi first
#define se second  
#define sz(x) ((ll)x.size())

void solve() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int one = (c + b - 1) / b, two = (a + d - 1) / d;
  cout << (one <= two ? "Yes" : "No");
}

int main() {
  ios::sync_with_stdio(false);  
  cin.tie(0);cout.tie(0); 
  
  int t = 1;
  for (int tc = 1; tc <= t; tc++) {
  	solve();
  }
}

Measured memory_bytes: 3616
package main

import (
        "fmt"
)

func solution(n int, a []int) []int {
        var memo [200001]int
        first, second := 0, 0
        for i := 0; i < n; i++ {
                memo[a[i]]++
                first = max(first, a[i])
        }

        for i := first - 1; i >= 0; i-- {
                if memo[i] > 0 {
                        second = i
                        break
                }
        }

        out := make([]int, 0, n)
        for i := 0; i < n; i++ {
                switch {
                case a[i] == first && memo[first] > 1:
                        out = append(out, first)
                case a[i] == first && memo[first] == 1:
                        out = append(out, second)
                default:
                        out = append(out, first)
                }
        }
        return out
}

func max(x, y int) int {
        if x > y {
                return x
        }
        return y
}

func main() {
        var n int
        fmt.Scan(&n)
        a := make([]int, 0, n)
        for i := 0; i < n; i++ {
                t := 0
                fmt.Scan(&t)
                a = append(a, t)
        }
        for _, v := range solution(n, a) {
                fmt.Println(v)
        }
}

Measured memory_bytes: 9856
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			int result = s.length;
			for (int i = 1; i < s.length / 2; i++) {
				result = s.length - i * 2;
				if (check(s, result)) {
					break;
				}
			}
			System.out.println(result);
		}
	}

	/**
	 * @param s 入力文字列
	 * @param n 文字数
	 * @return sの最初のn文字が偶文字列かどうか
	 */
	private static boolean check(char[] s, int n) {
		int half = n / 2;
		for (int i = 0; i < half; i++) {
			if (s[i] != s[half + i]) {
				return false;
			}
		}
		return true;
	}
}


Measured memory_bytes: 21972
N = int(input())
CSF = [list(map(int,input().split())) for i in range(N-1)]
CSF.append([0,0,1])
ans=[0]*N #
for i in range(N-1):
    for j in range(i,N-1):
        if j == i:
            ans[i]+=CSF[j][0]+CSF[j][1]
        else:
            if ans[i]<=CSF[j][1]:
                ans[i]=CSF[j][0]+CSF[j][1]
            elif (ans[i]-CSF[j][1])%CSF[j][2]==0:
                ans[i]+=CSF[j][0]
            else:
                ans[i]+=(CSF[j][2]-(ans[i]-CSF[j][1])%CSF[j][2])+CSF[j][0] 
for i in range(N):
    print(ans[i])

Measured memory_bytes: 3188