akhauriyash/Code-Regression huggingface dataset:
import argparse
import sys
inf = sys.maxsize
import heapq

def dijkstra_heap(edge_list, node):    
    distance_list = n_node * [inf]
    distance_list[node] = 0
    heap = []
    heapq.heappush(heap, (0, 0))

    while(heap):
        temp_dist, from_node = heapq.heappop(heap)
        if distance_list[from_node] < temp_dist:
            continue
        
        for to_node, cost in edge_list[from_node].items():
            if distance_list[to_node] > distance_list[from_node] + cost:
                distance_list[to_node] = distance_list[from_node] + cost
                heapq.heappush(heap, (distance_list[to_node], to_node))
    
    return distance_list


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument('--input', type=str)
    args = parser.parse_args()
    edge_input = []
    if args.input:
        f = open(args.input, 'r')
        n_node = int(f.readline())                
        for _ in range(n_node):            
            edge_input.append(tuple(map(int, f.readline().split()))[2:])
        f.close()
    else:
        n_node = int(input())
        for i in range(n_node):            
            edge_input.append(tuple(map(int, input().split()))[2:])
    
    edge_list = [None] * n_node
    for i in range(n_node):
        edge_list[i] = {}
        for j in range(0, len(edge_input[i]), 2):
            edge_list[i][edge_input[i][j]] = edge_input[i][j+1]

    distance_list = dijkstra_heap(edge_list, 0)

    # # bellman_ford(edge_list, 0)
    # distance_list = dijkstra(edge_list, 0)
    for i, ditance in enumerate(distance_list):
        print(i, distance_list[i])


Measured memory_bytes: 7716
import heapq
N = int(input())
a = list(map(int, input().split()))

max_result = -1000000

big_a = a[:N]
big_sum = [sum(big_a)]
heapq.heapify(big_a)
for i in range(N):
  heapq.heappush(big_a, a[N+i])
  p = heapq.heappop(big_a)
  big_sum.append(big_sum[-1] + a[N+i] - p)

small_a = [-i for i in a[-N:]]
small_sum = [sum(small_a)]
heapq.heapify(small_a)
for i in range(N):
  heapq.heappush(small_a, -a[-N-i-1])
  p = heapq.heappop(small_a)
  small_sum.append(small_sum[-1] - a[-N-i-1] - p)

max_result = -float('inf')

for m,s in zip(big_sum, small_sum[::-1]):
  max_result = max(m + s, max_result)

print(max_result)



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

int main(){
  int num, current = 1, count = 0;
  cin >> num;
  vector<int> buttons(num);
  for(int i = 0; i < num;i++)
	cin >> buttons.at(i);
  for(int i = 0; i < num;i++){
    if(current == 2)
      break;
   current = buttons.at(current - 1);
   count++;
  }
  if(current == 2)
    cout << count << endl;
  else
    cout << "-1" <<endl;
}

Measured memory_bytes: 640
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>


using namespace std;


int main() {
    int N, A, B;
    cin >> N >> A >> B;
    int total = 0;
    for (size_t i = 1; i <= N; i++) {
        int sum = i / 10000 + (i % 10000 / 1000 ) + (i % 1000 / 100) + (i % 100 / 10) + (i % 10);
        if (sum >= A && sum <= B) {
            total += i;
        }
    }
    std::cout << total << '\n';
    return 0;
}

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

typedef unsigned long long ll;
ll s;

#define MAX (1000000000000000002LL)

ll fizzNum(ll x){
  ll sum = x/3 + x/5 - x/15;
  return sum;
}
ll fbNum(ll x){
  return x/15;
}
ll bNum(ll x){
  return x/5 - x/15;
}
ll fNum(ll x){
  return x/3 - x/15;
}


ll Numnum(ll x){
  if(x==0) return 0;
  if(x==1) return 1;
  ll rk = 0;
  rk += fbNum(x) * 8LL;
  rk += bNum(x) * 4LL;
  rk += fNum(x) * 4LL;
  if( rk > MAX ) return MAX+1;
    
  ll kt = 1;
  ll k = 1;
  while( kt < x ){
    kt*=10;
    ll ks = min(kt-1,x);
    ll rt = fizzNum(ks) - fizzNum(kt/10-1);
    if( (ks-kt/10+1-rt)*k > MAX ) return MAX+1;
    rk += (ks-kt/10+1-rt)*k;
    if( rk > MAX ) return MAX+1;
    k++;
  }
  return rk;
}

string itos(ll a){
  stringstream s;
  s << a;
  string ret;
  s >> ret;
  return ret;
}

int main(){
  while(cin >> s){
  ll st = 1, ed = MAX-2;
  while( st <= ed ){
    ll h = (st+ed)/2;
    ll a = Numnum(h-1), b = Numnum(h);
    if( a < s && s <= b ){
      //  cout << h << " ( " << a << ", " << b << " ] " << endl;
      string res = "";
      for(ll x=h;x<h+50;x++){
	if( x % 15 == 0 ) res +="FizzBuzz";
	else if( x % 5 == 0 ) res += "Buzz";
	else if( x % 3 == 0 ) res += "Fizz";
	else res += itos(x);
      }
      s-=a+1;
      for(int i=s;i<s+20;i++){
	cout << res[i];
      }
      cout << endl;
      break;

    } else if( s <= a ) {
      ed = h-1;
    } else {
      st = h + 1;
    }
  }
  }
}

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

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

    vector<unsigned int> A(n);
    for(int i = 0; i < n; i++) {
        cin >> A[i];
    }

    unsigned long long int sum = 0;
    for(int i = 0; i < n - 1; i++) {
        if(A[i] >= A[i + 1]) {
            sum += A[i] - A[i + 1];
            A[i + 1] = A[i];
        }
    }

    cout << sum << endl;
}

Measured memory_bytes: 3984
#include <iostream>
using namespace std;
 //Compiler version g++ 6.3.0

 int main()
 {
 	int i,j;
 	char g[100][100];
cin>>i>>j;
for(int m=0;m<i;m++)
for(int n=0;n<j;n++)
{
	cin>>g[m][n];
}
int v=j+2;
int h=v;
while(v)
{cout<<"#";
v--;}
cout<<"\n";
for(int m=0;m<i;m++)
for(int n=0;n<j;n++)
{
	if(n==0)
	cout<<"#";
	cout<<g[m][n];
	if(n==j-1)
	{
		cout<<"#"<<"\n";
	}
}
while(h)
{
	cout<<"#";
	h--;
}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <set>

using namespace std;

int main()
{
    int m;

    cin >> m;
    while (m--) {
        string inp;
        set<string> memo;
        int ans = 1;

        cin >> inp;

        memo.insert(inp);
        
        for (int i = 0; i < inp.size(); i++) {
            string a = inp.substr(0, i);
            string b = inp.substr(i);
            string a_r = a;
            string b_r = b;

            reverse(a_r.begin(), a_r.end());
            reverse(b_r.begin(), b_r.end());

            if (memo.find(a + b_r) == memo.end()) {
                ans++;
                memo.insert(a + b_r);
            }
            if (memo.find(a_r + b) == memo.end()) {
                ans++;
                memo.insert(a_r + b);
            }
            if (memo.find(a_r + b_r) == memo.end()) {
                ans++;
                memo.insert(a_r + b_r);
            }

            if (memo.find(b + a) == memo.end()) {
                ans++;
                memo.insert(b + a);
            }
            if (memo.find(b_r + a) == memo.end()) {
                ans++;
                memo.insert(b_r + a);
            }
            if (memo.find(b + a_r) == memo.end()) {
                ans++;
                memo.insert(b + a_r);
            }
            if (memo.find(b_r + a_r) == memo.end()) {
                ans++;
                memo.insert(b_r + a_r);
            }
        }
        cout << ans << endl;
    }

    return 0;
}

Measured memory_bytes: 1300
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using uint = unsigned int;
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd);
#endif

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    int a1 = a * 100, a2 = 0;
    double density = 0;
    for(int i = 0; i <= 30; i++){
        for(int j = 0; j <= 30; j++){
            int water = 100 * ((i * a) + (j * b));
            if(!water){ continue; }
            int smax = min(f - water, e * ((i * a) + (j * b)));
            int sugar = 0;
            for(int k = 0; k <= 3000; k++){
                if(c * k <= smax){
                    sugar = max(sugar, c * k + (smax - c * k) / d * d);
                }
            }
            // double cand = 1.0 * sugar / water;
            double cand = 100.0 * sugar / (water + sugar);
            if(cand > density){
                density = cand;
                a1 = water + sugar;
                a2 = sugar;
            }
        }
    }
    cout << a1 << ' ' << a2 << '\n';
    return 0;
}


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

int main()
{
	int a,b,c,d,n,ans;
	
	while(cin>>n){
		ans=0;
		for(a=0;a<10;a++){
			for(b=0;b<10;b++){
				for(c=0;c<10;c++){
					for(d=0;d<10;d++){
						if(a+b+c+d==n) ans++;
					}
				}
			}
		}
	cout<<ans<<endl;
	}
}

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

void bubble(int *a,int n){
	int x,flag=1;
	int cnt=0;
	while(flag!=0){
		flag=0;
		for(int i=n-1;i>0;i--){
			if(a[i]<a[i-1]){
				x=a[i];
				a[i]=a[i-1];
				a[i-1]=x;
				flag=1;
				cnt++;
			}
		}
	}
	//出力
	for(int i=0;i<n;i++){
			printf("%d",a[i]);
			if(i!=n-1){
				printf(" ");
		}else{
			printf("\n");
		}
		
	}printf("%d\n",cnt);
}

int main(void){
	
	int n;
	int* a=(int*)malloc(sizeof(int)*n);
	
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	
	bubble(a,n);
	
}


Measured memory_bytes: 2100
#include <bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define ALL(x) (x).begin(),(x).end()
using namespace std;

//素因数分解
vector<pair<ll,int>> factorize(ll n){
    vector<pair<ll,int>>res;
    for(ll i=2;i*i<=n;i++){
        if(n%i)continue;
        res.emplace_back(i,0);
        while (n%i == 0)
        {
        n /= i;
        res.back().second++;
        }
        
    }
    if(n != 1) res.emplace_back(n,1);
    return res;
}

void trace(int A[],int N){
    REP(i,N){
        if(i>0)printf(" ");
        printf("%d",A[i]);
    }
    printf("\n");
}


int main(){
    int A,B,C;
    cin >> A >> B >> C;
    if(C>=A && C<=B)puts("Yes");
    else puts("No");
}


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

int main() {
    int A, B;
    cin >> A >> B;
    int ans = 0;
    for (int i = A; i <= B; i++) {
        string s = to_string(i);
        int n = s.size();
        for (int j = 0; j < (n + 1) / 2; j++) {
            if (s[j] != s[n - 1 - j]) break;
            if (j == (n + 1) / 2 - 1) ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3688
import java.util.Scanner;

public class Main {
  static Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {
    int N = sc.nextInt();
    int min = Integer.MAX_VALUE;
    for (int i = 1; i < N; i++) {
      int s = count(i) + count(N - i);
      min = Math.min(min, s);
    }
    System.out.println(min);
  }

  static int count(int v) {
    int ret = 0;
    while (v > 0) {
      ret += v % 10;
      v /= 10;
    }
    return ret;
  }

}


Measured memory_bytes: 21844
///Astalavista Code........~CodeSlayer007
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define Br cout<<endl
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define int long long
#define double long double
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define PT(x) cout << (x) << endl
#define PTT(x) cout << (#x) << " is " << (x) << endl
#define SPD_emergency ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
int M = 1e9 + 7;
const int N = 1e6 + 10;
const int IM = 1e16;
const int PI =3.14159265;
void PV(vi v) { for (int i = 0 ; i < v.size() ; i++) cout << v[i] << " "; cout << endl;}
void PA(int v[], int n, int x = 0) { for (int i = x ; i < n + x; i++)cout << v[i] << " " ; cout << endl;}
void IN(int a[], int n, int x = 0) {for (int i = x; i < n + x; i++)cin >> a[i];}
inline void PTN(int n = 1, int a = 0, int b = 0, int c = 0) { if (n--)cout << a << " "; if (n--)cout << b << " "; if (n--)cout << c << " "; cout << endl; }
inline void op() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
// <-------------------------------------------------------------------------------------------------------------------------------------------------------------------------> Ignore This--> memset substr pop_back  insert tuple first second push_back string continue make_pair break deque stack queue sort reverse accumulate  count lower_bound upper_bound next_permutation copy_n __builtin_popcount make_tuple
// <========================================================================================================================================================================


signed  main() {
    SPD_emergency
    
    int i, j, x, y, u, l;
    int tt = 1;
    // int t; cin >> t; while (t--)
    {   i = j = x = y = u = l = 0;
        string s[] = {"hon", "pon", "bon"};
        int a[30] = {0};
        a[0] = a[1] = a[6] = a[8] = 1;
        a[3] = 2;
        cin >> x;
        x = x % 10;
        cout << s[a[x]] << endl;







        /**/
    }


    return 0;
}

Measured memory_bytes: 3660
from queue import Queue

def bfs(AB,N):
    S = [None for _ in range(N+1)]
    #S[i]:部屋iにつけるべきサイン
    AB_N = [set() for _ in range(N+1)]
    for ab in AB:
        a,b = ab[0],ab[1]
        AB_N[a].add((a,b))

    q = Queue()
    q.put(1)

    while not q.empty():
        p = q.get()
        for ab in AB_N[p]:
            a,b = ab[0],ab[1]
            if a == p:
                if  S[b] == None:
                    q.put(b)
                    S[b] = p

    can = True
    for i in range(2,N+1):
        if S[i] == None:
            can = False

    if can:
        return S[2:]
    else:
        return -1

def main():
    N,M = map(int,input().split())
    AB = [tuple(map(int,input().split())) for _ in range(M)]

    AB_ = set(AB)
    for i in range(M):
        AB_.add((AB[i][1],AB[i][0]))
    AB = AB_

    ans = bfs(AB,N)
    if ans == -1:
        print("No")
    else:
        print("Yes")
        for i in range(len(ans)):
            print(ans[i])

if __name__ == "__main__":
    main()


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

const int N = 100005;

int n;
int a[N];
int dp[N];

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i) {
		scanf("%d", a + i);
		dp[i] = 1e9 + 123;
	}
	dp[1] = 0;
	for (int i = 2; i <= n; ++i) {
		if (i > 1) {
			dp[i] = min(dp[i], dp[i - 1] + abs(a[i] - a[i - 1]));
		}
		if (i > 2) {
			dp[i] = min(dp[i], dp[i - 2] + abs(a[i] - a[i - 2]));
		}
	}
	printf("%lld\n", dp[n]);
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;

template<class T> vector<pair<T, int>> runLengthEncoding(vector<T> v) {
    int n = v.size();
    assert(n > 0);

    vector<pair<T, int>> encoded;
    encoded.emplace_back(v[0], 1);
    for(int i=1; i<n; i++) {
        auto& prev = encoded.back();
        if(prev.first == v[i])  prev.second++;
        else  encoded.emplace_back(v[i], 1);
    }
    return encoded;
}

int main() {
  vector<char> S(3);
  for(auto& e : S) cin >> e;
  auto encoded = runLengthEncoding(S);

  lint ans = 0;
  for(auto [c, x] : encoded) {
    if(c == 'R') ans = max(ans, (lint)x);
  }
  cout << ans << endl;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 29;
const ll INF64 = 1ll << 45;
const int mod = 1000000007;
//const int mod = 998244353;


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

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};


int main()
{
  int n;
  cin >> n;
  vector<P> inc, dec;
  int total = 0;
  rep(i, n) {
    string s;
    cin >> s;
    int now = 0;
    int min = 0;
    for(auto c : s) {
      if(c == '(') ++now;
      else --now;
      chmin(min, now);
    }
    if(now > 0) inc.emplace_back(min, now);
    else dec.emplace_back(min-now, -now);
    total += now;
  }
  if(total != 0) {
    cout << "No" << endl;
    return 0;
  }
  sort(inc.rbegin(), inc.rend());
  int now = 0;
  for(auto v : inc) {
    if(now + v.first < 0) {
      cout << "No" << endl;
      return 0;
    }
    now += v.second;
  }
  sort(dec.rbegin(), dec.rend());
  now = 0;
  for(auto v : dec) {
    if(now + v.first < 0) {
      cout << "No" << endl;
      return 0;
    }
    now += v.second;
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 11216
#include <iostream>
#include <queue>
#include <cstring>
using namespace std;

typedef pair<int, int> P;
typedef pair<int, P> S;
const int INF = 10000;
const int MAX = 100;
const int dx[] = {0, -1, 0, 1};
const int dy[] = {-1, 0, 1, 0};
int m,n,sx,sy;
int step[MAX + 2][MAX + 2];
char field[MAX + 2][MAX + 2];

int main()
{
    while(cin >> n >> m && m) {
        memset(step, -1, sizeof(step));
        memset(field, '.', sizeof(field));
        
        for(int i = 1; i <= m; i++) {
            for(int j = 1; j <= n; j++) {
                cin >> field[i][j];
                if(field[i][j] == '&') {
                    sx = j;
                    sy = i;
                }
            }
        }

        priority_queue<S, vector<S>, greater<S> > que;
        que.push(S(0, P(sx, sy)));
        while(!que.empty()) {
            S s = que.top(); que.pop();
            int x = s.second.first, y = s.second.second, z = s.first;
            if(step[y][x] >= 0) continue;
            step[y][x] = z;

            for(int i = 0; i < 4; i++) {
                int nx = x + dx[i], ny = y + dy[i], nz = z;
                if(field[ny][nx] == '#' && field[y][x] != '#') nz++;
                if(nx >= 0 && nx <= n + 1 && ny >= 0 && ny <= m + 1) {
                    que.push(S(nz, P(nx, ny)));
                }
            }
        }

        int res = INF;
        for(int i = 0; i <= m + 1; i++)
            for(int j = 0; j <= n + 1; j++)
                if(i == 0 || i == m + 1 || j == 0 || j == n + 1) 
                    res = min(res, step[i][j]);

        cout << res << endl;
    }
}

Measured memory_bytes: 1088
N, M = map(int, input().split())

d = {1:-1, 2:-1, 3:-1}

flag = True
for i in range(M):
    s, c = map(int, input().split())

    if N > 1 and s == 1 and c == 0:
        flag = False

    if d[s] == -1:
        d[s] = c

    elif d[s] == c:
        pass

    else:
        flag = False

for i in range(1, N+1):
    if d[i] == -1:

        if N == 1:
            d[i] = 0

        if N > 1 and i == 1:
            d[i] = 1

        else:
            d[i] = 0

ans = 0
for i in range(1, N+1):
    ans += int(d[i]) * 10 ** (N-i)

print(ans) if flag else print(-1)

Measured memory_bytes: 3064
#include <stdio.h>

int main(){
    int n, i, j, k, max = 0, sum = 0;
    int List[n];

    scanf("%d", &n);
    for (i = 0; i < n; i++){
        scanf("%d", &List[i]);
    }

    for (j = 0; j < n; j++){
        if (List[j] > max){
            max = List[j];
        }
    }

    for (k = 0; k < n; k++){
        sum = sum + List[k];
    }

    printf("%d", sum - max / 2);

    return 0;

}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, M;
	cin >> N >> M;

	int x = 100 * (N - M) + 1900 * M;
	int res = x * pow(2, M);
	cout << res << endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>

using namespace std;

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

#define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; i++)
#define FORD(i, b, a) for (int i = (b), _a = (a); i >= _a; i--)
#define REP(i, n) for (int i = 0, _n = (n); i < _n; i++)
#define FORE(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); i++)
#define fi   first
#define se   second
#define MASK(i) (1LL << (i))
#define BIT(x, i) (((x) >> (i)) & 1)

const int N = 1e5 + 5;
const ll oo = 1e18;
ll a[N], dp[N], n;

int main(int argc, char const *argv[])
{
	scanf("%d", &n);
	FOR(i, 1, n) scanf("%d", &a[i]);
	FOR(i, 2, n) dp[i] = oo;
	FOR(i, 1, n) {
		dp[i + 1] = min(dp[i + 1], dp[i] + abs(a[i + 1] - a[i]));
		dp[i + 2] = min(dp[i + 2], dp[i] + abs(a[i + 2] - a[i]));
	}
	printf("%I64d\n", dp[n]);
	return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long a,b,c; cin >> a >> b >>c;
  long long large = max(a,max(b,c));
  if(large % 2 == 0)
	cout << 0 << endl;
  else
   	cout << min(a * b,min(b * c,c*a)) << endl;
}

Measured memory_bytes: 3592
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <set>
#include <sstream>
#include <string>
#include <queue>
#include <vector>
using namespace std;

#define rep(i,n) for(int i=0; i<(n); ++i)
#define rrep(i,n) for(int i=1; i<=(n); ++i)
#define drep(i,n) for(int i=(n)-1; i>=0; --i)
#define foreach(it, v) for(typeof(v.begin()) it=v.begin(); it!=v.end(); ++it)
#define pb push_back
#define sz(x) (int)(x).size()
#define fi first
#define se second

typedef unsigned int uint;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef set<int> si;

//MOD//
const ll MOD = 1000000007;
struct big;
big ex(big a, ll tms);
typedef struct big{
  ll val;
  big():val(0){}
  big(ll val):val((val%MOD+MOD)%MOD){}
  big& operator += (const big& obj){ (val+=obj.val)%=MOD; return *this;}
  big& operator -= (const big& obj){ (val+=MOD-obj.val)%=MOD; return *this;}
  big& operator *= (const big& obj){ (val*=obj.val)%=MOD; return *this;}
  big& operator /= (const big& obj){ (val*=ex(obj,MOD-2).val)%=MOD; return *this;}
  big operator + (const big& obj)const{ return big(*this) += obj;}
  big operator - (const big& obj)const{ return big(*this) -= obj;}
  big operator * (const big& obj)const{ return big(*this) *= obj;}
  big operator / (const big& obj)const{ return big(*this) /= obj;}
  bool operator < (const big& obj)const{ return val < obj.val;}
  bool operator == (const big& obj)const{ return val == obj.val;}
} big;
istream& operator >> (istream& i, big& obj){ i>>obj.val; return i;}
ostream& operator << (ostream& o, const big& obj){ o<<obj.val; return o;}
big ex(big obj, ll tms){
  if(!tms) return 1;
  big ret = ex(obj, tms/2);
  ret *= ret;
  return (tms&1) ? ret*obj : ret;
}
//MOD//

ll pow(ll n, int m){
  if(!m) return 1;
  ll ret = pow(n, m/2);
  ret *= ret;
  return (m&1) ? ret*n : ret;
}

template <class F, class T>
void convert(const F &f, T &t){
  stringstream ss;
  ss << f;
  ss >> t;
}

int  N, M;
vi chi[100005];
int par[100005];

int pc[100005];

int A, B;

int main(){
  scanf("%d%d",&N,&M);
  rep(i,N-1+M) {
    scanf("%d%d",&A,&B);
    chi[A].pb(B);
    par[B] = -1;
    pc[B]++;
  }
  si nexts;
  rrep(i,N) if (par[i]==0) {nexts.insert(i);break;}
  while (nexts.size() > 0) {
    si nows = si(nexts);
    nexts.clear();
    for(si::iterator it = nows.begin(); it != nows.end(); ++it) {
      for(vi::iterator it2 = chi[(*it)].begin(); it2 != chi[(*it)].end(); ++it2) {
        if (--pc[(*it2)] == 0) {
          par[(*it2)] = (*it);
          nexts.insert((*it2));
        }
      }
    }
  }
  rrep(i, N) cout << par[i] << endl;
  return 0;
}


Measured memory_bytes: 13688
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

var sc = NewScanner(os.Stdin, 1000000)

func main() {
	T := sc.readInt()
	X := sc.readInt()
	res := float64(T) / float64(X)
	fmt.Println(res)
}

type Scanner struct {
	*bufio.Scanner
}

func (scn *Scanner) readInt() int {
	scn.Scanner.Scan()
	i, _ := strconv.Atoi(scn.Scanner.Text())
	return i
}

func NewScanner(r io.Reader, bufSize int) *Scanner {
	buf := make([]byte, bufSize)
	scn := bufio.NewScanner(r)
	scn.Buffer(buf, bufSize)
	scn.Split(bufio.ScanWords)
	return &Scanner{scn}
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func sliceMin(s []int) int {
	result := math.MaxInt64
	for _, v := range s {
		if v < result {
			result = v
		}
	}
	return result
}

func sliceMax(s []int) int {
	result := math.MinInt64
	for _, v := range s {
		if v > result {
			result = v
		}
	}
	return result
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}


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


int main() {
    int a,b,c;
    cin >> a >> b >> c;

    if((a+b+c)%2==max(a,max(b,c))%2)
        cout<<(3*max(a,max(b,c))-(a+b+c))/2<<endl;
    else
        cout<<(3*(max(a,max(b,c))+1)-(a+b+c))/2<<endl;

}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
  int n, q, i, j, cnt=0;
  int s[10001], t[500];

  scanf("%d", &n);
  for(i=0; i<n; i++)
    {
      scanf("%d", &s[i]);
    }
  scanf("%d", &q);
  for(i=0; i<q; i++)
    {
      scanf("%d", &t[i]);
    }

  for(i=0; i<q; i++)
    {
      j=0;
      s[n] = t[i];
      while(s[j] != t[i])
	{
	  j++;
	}
      if(j == n)
	{
	  //intf("%d not found\n", t[i]);
	}
      else
	{
	  cnt++;
	}
    }

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

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

#define INF 1LL << 60
#define pb push_back
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPR(i, b, e) for (int i = (b); i <= (e); i++)
#define DEBUG(x) cout << #x << ": " << (x) << endl
#define DEBUGA(a) cout << #a << ": "; for (const auto& v: (a)) cout << v << endl

int main() {
    int a[5], m = 10, sum = 0;
    REP(i, 5) {
        cin >> a[i];
        int tmp = a[i] % 10;
        if (tmp > 0 && m > tmp) m = tmp;
        sum += ceil((double)a[i] / 10) * 10;
    }
    cout << sum - 10 + m << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
int mod = 998244353;
// int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b; if (a >= mod) a -= mod; }


void solve();

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  int T;
  T = 1;
  while (T--) solve();
}

void solve() {
  ll k, a, b;
  cin >> k >> a >> b;

  ll ans = 1 + k;
  if (b - a - 2 < 1) {
    cout << ans << endl;
    return;
  }

  ll have = 1;
  have = a;
  k -= a - 1;

  chmax(ans, have + (-a + b) * (k / 2) + (k % 2));
  cout << ans << endl;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = (ll)1e9;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


int main()
{
	int r;
	cin >> r;

	println(r * r);
}


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

int main() {
	// your code goes here
	int n;
	cin>>n;
	map<string,int> m;
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		string h;
		cin>>h;
		sort(h.begin(),h.end());
		if(m.count(h))
		{
			m[h]++;
			ans+=m[h];
		}
		else
		{
			m[h]=0;
		}
		
	}
	cout<<ans<<endl;
	return 0;
}

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

int main() {
  int A,B,C,D; cin >>A >>B >>C >>D;
  int ans=max(A*B,C*D);
  cout <<ans <<endl;
  return 0;
}


Measured memory_bytes: 256
s;main(c){double*q=&s,b;for(;~scanf("%s%c",&s,&c);c&2&&printf("%f\n",*q))sscanf(&s,"%lf",q+1)-1?b=*q--,*q=s&1?s%8-7?*q+=s%8-5?b:-b:*q/b:*q*b:*++q;}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++) 
#define ll long long
#define ld long double
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)  
#define outdeb(fir, sec, thr) cout << fir << ":" << sec << ":" << thr << endl
#define DEV_VAL (1000000000 + 7)

int main()
{
  string s, t;
  cin >> s >> t;
  int ans = 0;

  rep(i, s.length())
  {
    if(s[i] != t[i]) ans++;
  }

  cout << ans << endl;


  return 0;
}

Measured memory_bytes: 3912
// Justice will be served
// شهید حاج قاسم سلیمانی

#include<bits/stdc++.h>
using namespace std ;

int main() {
  int a , b ;
  cin >> a >> b ;
  if ((a + b) % 2)
    cout << "IMPOSSIBLE" ;
  else
    cout << (a + b) / 2 ;
}

Measured memory_bytes: 256
import java.math.BigInteger;
import java.util.*;


public class Main {
	
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int n = sc.nextInt();
			if(n < 1000){
				System.out.println("ABC");
			}
			else{
				System.out.println("ABD");
			}
		}
	}
	
	private long calc(long n, long m, long l){
		long sum = 1;
		for(long i = n; i > m; i--){
			sum *= i;
		}
		for(long i = 2; i <= l; i++){
			sum /= i;
		}
		return sum;
	}

	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

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

}


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

int main() {
    string S;
    cin >> S;
    for (int i=0; i<S.size()-1; i+=2) {
        if (S.at(i)=='L' || S.at(i+1)=='R') {
            cout << "No";
            return 0;
        }
    }
    if (S.size()%2!=0 && S.at(S.size()-1)=='L'){
        cout << "No";
        return 0;
    }
    cout << "Yes";
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <bitset>

using namespace std;

bitset <4444444> B;

int main() {
    int n;
    scanf("%d", &n);
    B[0] = 1;
    int sm = 0;
    for(int i = 1; i <= n; i++) {
        int a;
        scanf("%d", &a);
        B |= (B << a);
        sm += a;
    }
    for(int i = (sm + 1) / 2; ; i++) if(B[i]) {
        printf("%d\n", i);
        return 0;
    }
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
#include <numeric>
using namespace std;
//#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define l1 list[index]
#define l2 list[index - 1]
#define l3 list[index + 1]
#define iif(i,j) ((i<0 && j<0) || (i>0 && j>0)) ? true : false 
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
const double PI = 3.14159265359;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };



signed main() {
	int n, k;
	vector<ll>x;
	vector<ll>mai, pu;
	vector<ll>mai2, pu2;


	cin >> n >> k;

	mai.push_back(0);

	for (int i = 0; i < n; i++) {
		ll num;
		cin >> num;
		x.push_back(num);
		if (num < 0) {
			mai.push_back(abs(num));
		}
		else {
			pu.push_back(num);
		}
	}

	ll sa = 0, minn = INF;

	if (pu.size() < k) {
		sa = abs((int)pu.size() - k);
	}
	
	sort(mai.begin(), mai.end());

	//for (int i = (sa==0 ? k - 1: pu.size() - 1), j = 0; i >= 0; i--, j++ ) {
	for (int i = (sa == 0 ? k - 1 : pu.size() - 1), j = 0; i >= 0 && j + sa < mai.size(); i--, j++) {
		ll num = pu[i];
		ll num2 = mai[j + sa] * 2;
		minn = min(minn, num + num2);
		//cout << "i->" << i << " num->" << num << " num2->" << num2 << endl;
	}

	mai.erase(mai.begin());
	pu.insert(pu.begin(), 0);

	ll sa2 = 0;

	if (mai.size() < k) {
		sa2 = abs((int)mai.size() - k);
	}

	//for (int i = (sa2 == 0 ? k - 1 : mai.size() - 1), j = 0; i >= 0; i--, j++) {
	for (int i = (sa2 == 0 ? k - 1 : mai.size() - 1), j = 0; i >= 0 && j + sa2 < pu.size(); i--, j++) {
		ll num = mai[i];
		ll num2 = pu[j + sa2] * 2;
		minn = min(minn, num + num2);
		//cout << "i->" << i << " num->" << num << " num2->" << num2 << endl;
	}


	cout << minn << endl;


	return 0;
}

Measured memory_bytes: 2800
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();
		String ans = "";
		for(int x = 0; x <= N; x++) {
			for(int y = 0; y <= N; y++) {
				int z = N - x - y;
				if(z < 0) {
					break;
				}
				int sum = 10000 * x + 5000 * y + 1000 * z;
				if(sum == Y) {
					ans = x + " " + y + " " + z;
				}
			}
		}
		if(ans == "") {
			System.out.println("-1 -1 -1");
		}else {
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 39348
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rrep(i,a,b) for(int i=(int)(a);i>=(int)(b);--i)
#define fore(i,a) for(auto &i:a)
#define all(a) (a).begin(),(a).end()
using namespace std; void _main(); int main(){ cin.tie(0); ios::sync_with_stdio(false); _main(); }
using ll = long long; constexpr int inf = INT_MAX / 2; constexpr ll infl = 1LL << 60;
template<class T>void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T>void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T>void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T>void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
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; }
template<class T>T gcd(T a, T b){ if (b==0){ return a; }else{ return gcd(b, a%b); }}
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }

void _main() {
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i, 0, N) cin >> A[i];

  vector<int> L(N), R(N);
  L[0]  = 0;
  R[N-1]= 0;
  rep(i, 0, N-1)  L[i+1] = gcd(L[i], A[i]);
  rrep(i, N-1, 1) R[i-1] = gcd(R[i], A[i]);

  int ans = 1;
  rep(i, 0, N) chmax(ans, gcd(L[i], R[i]));
  cout << ans << endl;
}

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

#define int long long
#define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)x.size())
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;
}

/*
 */

using vi = vector<int>;
using vvi = vector<vi>;
using P = pair<int, int>;

int dp[105][2][5];

signed main() {
  string s;
  int K;
  cin >> s >> K;
  int n = sz(s);

  dp[0][0][0] = 1;
  rep(i, 0, n) rep(j, 0, 2) rep(k, 0, 5) {
    int d = j ? 9 : s[i] - '0';
    rep(x, 0, d + 1) {
      if (x != 0 and k == 4)
        continue;
      dp[i + 1][j || x < d][k + (x != 0)] += dp[i][j][k];
    }
  }

  int ans = dp[n][0][K] + dp[n][1][K];
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define sh cin.tie(0); cin.sync_with_stdio(0); cout.tie(0);
#define FILE freopen("test.in", "r", stdin);
#define vprint(v) for (int ii = 0; ii < v.size(); ii++){cout << v[ii] << " ";}
#define debugv(v) if (v.size() != 0) {cout << "[ "; for (int __ = 0; __ < (int)(v.size()) - 1; __++){cout << v[__] << ", ";} cout << v[(int)(v.size()) - 1] << " ]" << endl;} else {cout << "[]" << endl;}
#define debug cout << "-----------------------------------------------" << endl;
#define print1(a) cout << "{ " << a << " }" << endl;
#define print2(a, b) cout << "{ " << a << ", " << b << " }" << endl;
#define print3(a, b, c) cout << "{ " << a << ", " << b << ", " << c << " }" << endl;
#define print4(a, b, c, d) cout << "{ " << a << ", " << b << ", " << c << ", " << d << " }" << endl;
using namespace std;
//#define int long long
const int INF = 1e9 + 228;
const int MAXN = 1e5 + 228;

signed main()
{
#ifdef LOCAL
    FILE;
#endif
    sh;
	string s;
	cin >> s;
	for (auto to : s) {
		cout << 'x';
	}    
	cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long 
#define MX 100001
using namespace std;
ll h[MX];
bool good[MX];

int main(){
	// freopen("Input.txt","r",stdin); freopen("Output.txt","w",stdout);
	memset(good,1,sizeof(good));
	int n,m,tmp1,tmp2,s=0;cin>>n>>m;
	for(int i=0;i<n;i++) cin>>h[i+1];
	while(m--){
		cin>>tmp1>>tmp2;
        if(h[tmp1]>h[tmp2]){
        	good[tmp2]=0;
        }else if(h[tmp1]<h[tmp2]){
        	good[tmp1]=0;
        } else {
        	good[tmp1]=0;good[tmp2]=0;
        }
	}
	for(int i=1;i<=n;++i){
		s+=good[i];
	}
	cout<<s<<"\n";
}

Measured memory_bytes: 4508
#include <bits/stdc++.h>
#define RI register int
typedef long long LL;


using namespace std;

int main() {

  int n; cin >> n;
  int m; cin >> m;
  int ans = 0;
  for (RI i = 1, x; i <= n; ++i)
    cin >> x, ans += (x >= m);
  cout << ans;

  return 0;
}

// created by Daniel yuan


Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))
b = sorted(a, reverse=True)
dp = [[0]*(n+1) for _ in range(n+1)]
ans = 0
def f(s,e):
  return abs(e-s)*a[s]
for i in range(n):
  d = a.index(b[i])
  for l in range(0,i+1):
    r = i-l
    dp[l+1][r] = max(dp[l+1][r], dp[l][r]+f(d,l))
    dp[l][r+1] = max(dp[l][r+1], dp[l][r]+f(d,n-r-1))
  a[d] = 0
for i in range(n+1):
  ans = max(ans, dp[i][n-i])
print(ans)

Measured memory_bytes: 106152
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

int main(){
    int n;
    int point_a = 0;
    int point_b = 0;
    char char_a[100];
    char char_b[100];
    string str_a, str_b;
    scanf("%d", &n);
    for(int i = 0; i < n; i++){
        scanf("%s", char_a);
        scanf("%s", char_b);

        str_a = char_a;
        str_b = char_b;
        if( str_a < str_b){
            point_b = point_b + 3;

        }
        else if(str_a > str_b){
            point_a = point_a + 3;
        }
        else{
            point_a++;
            point_b++;
        }
    }
    printf("%d %d\n", point_a, point_b);

    return 0;
}


Measured memory_bytes: 3336
use proconio::{fastout, input};

#[fastout]
fn main() {
    let a: String;
    let b: String;
    input! {a: String, b: String};

    if a.len() > b.len() {
        println!("GREATER")
    } else if a.len() < b.len() {
        println!("LESS")
    } else {
        let mut t = true;

        for i in 0..a.len() {
            if &a[i..i + 1] > &b[i..i + 1] {
                println!("GREATER");
                t = false;
                break;
            } else if &a[i..i + 1] < &b[i..i + 1] {
                println!("LESS");
                t = false;
                break;
            }
        }

        if t {
            println!("EQUAL");
        }
    }
}


Measured memory_bytes: 2184
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
int main() {
    i64 N, M;
    cin >> N >> M;
    cout << min(N, M / 2) + max<i64>(0, (M - 2 * N) / 4) << endl;
    return 0;
}

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

int main() {
	int g;
	while (cin >> g, g) {
		int MAX = 10000;
		for (int i = 0;i <= g / 200;i++) {
			for (int j = 0;j <= g / 300;j++) {
				for (int k = 0;k <= g / 500;k++) {
					int h = i * 380 + (j * 550) + (k * 850);
					if (i >= 5) {
						int p = i / 5;
						h -= 380 * (p * 5)*0.2;
					}
					if (j >= 4) {
						int q = j / 4;
						h -= 550 * (q * 4)*0.15;
					}
					if (k >= 3) {
						int r = k / 3;
						h -= 850 * (r * 3)*0.12;
					}
					int a = 200 * i + (300 * j) + (500 * k);
					if (a == g) {
						if (MAX > h) {
							MAX = h;
						}
					}
				}
			}
		}
		cout << MAX << endl;
	}
	return 0;
}

Measured memory_bytes: 3088
#include <bits/stdc++.h>
#define lli long long int
#define ll long long
using namespace std;
int main()
 {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    lli n,d,cnt=0,p;
    cin>>n>>d;
    while(n--)
    {
        lli x,y;
        cin>>x>>y;
        p=(x*x)+(y*y);
        if(sqrt(p)<=d)
        cnt++;
    }
    cout<<cnt<<"\n";
 }

Measured memory_bytes: 3692
import java.util.*;

public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		List<Integer> list = new ArrayList<Integer>();
		int n = sc.nextInt();
		for (int i = 0;i < n;i++) {
			list.add(sc.nextInt());
		}
		Collections.sort(list);

		System.out.println(list.get(n / 2) - list.get(n / 2 - 1));
	}
}

Measured memory_bytes: 60940
#![allow(unused_imports)]
#![allow(dead_code)]
use datastructure::*;
use grapth::*;
use input_scanner::*;
use math::*;
use string_algorithm::*;
use util::*;

use std::cmp;
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, LinkedList, VecDeque};

fn main() {
    let mut scan = Scanner::new();
    let n: usize = scan.next();
    let mut a: Vec<i64> = scan.next_vec(n);
    a.sort();
    a.reverse();

    let mut ans: i64 = 2 * a[0..(n+1)/2].iter().fold(0i64, |sum, x| sum + x);
    if n % 2 == 1{
        ans -= a[n/2];
    }
    ans -= a[0];

    println!("{}", ans);
}

mod datastructure {}
mod grapth {}
mod math {}
mod string_algorithm {}
mod util {}
mod input_scanner {
    pub struct Scanner {
        bytes: Vec<u8>,
        begin: usize,
        end: usize,
    }

    impl Scanner {
        pub fn new() -> Self {
            use std::io::Read;
            let mut buffer: Vec<u8> = Vec::new();
            std::io::stdin().read_to_end(&mut buffer).unwrap();
            let end = (0..buffer.len())
                .find(|i| buffer[*i].is_ascii_whitespace())
                .unwrap_or(buffer.len());
            Scanner {
                bytes: buffer,
                begin: 0,
                end: end,
            }
        }
        pub fn next<T: std::str::FromStr>(&mut self) -> T {
            let s: &str =
                unsafe { std::str::from_utf8_unchecked(&self.bytes[self.begin..self.end]) };
            let ret: T = s.parse::<T>().ok().expect("Parse error.");
            self.skip();
            ret
        }
        pub fn next_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
            (0..n).map(|_| self.next()).collect()
        }
        pub fn next_word(&mut self) -> Vec<u8> {
            let r = Vec::from(&self.bytes[self.begin..self.end]);
            self.skip();
            r
        }
        fn skip(&mut self) {
            self.begin = (self.end..self.bytes.len())
                .find(|i| !self.bytes[*i].is_ascii_whitespace())
                .unwrap_or(self.bytes.len());
            self.end = (self.begin..self.bytes.len())
                .find(|i| self.bytes[*i].is_ascii_whitespace())
                .unwrap_or(self.bytes.len());
        }
    }
}


Measured memory_bytes: 6412