akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
struct P
{
    //string r;
    int x,y,z;

    bool operator<(const P &a)const{
       // if(y!=a.y)
       // return y>a.y;
       return x>a.x;
//        return z>a.z;
    }
};

vector<int> v;

int a,b,c,i,k,d,n,m,e[1111111];//dy[15]={0,1,0,-1,-1,1,-1,1},dx[15]={1,0,-1,0,1,1,-1,-1};
long long l[125555];
int o[3][115][112];
int dx[10]={0,1,0,-1},dy[10]={1,0,-1,0},dz[10]={0,0,0,0,1,-1};

long long x,y,z[115555],mod=1000000007;
P u[222222];
long long j[115552];

stack<int> s;
queue<P> q;
bool qw[3333];
//deque<int> de;
//'1'==49;
//'A'==65;
//'a'==97;
//unordered_
map<int,int > p;
string r,r1,r2,r3,r4,r5;
//char r[333][333];

bool as(P a,P b)
{

    return a.y<b.y;
}
//queue<P> q;



int main()
{
    scanf("%d",&a);
    for(int t=1;t<=a;t++)
        scanf("%lld",&z[t]);
    x=2;
    y=2;
    for(int t=a;t>=1;t--)
    {
        if(x>y)
        {
            puts("-1");
            return 0;
        }
        x=(x+z[t]-1)/z[t]*z[t];
        y=y/z[t]*z[t]+z[t]-1;

    }
    if(x>y)
    {
        puts("-1");
        return 0;
    }
printf("%lld %lld",x,y);
}


Measured memory_bytes: 4352
//inlclude前用define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
//#include<deque>
#include<iomanip>
#include<set>
#include<tuple>
#include<map>
#include<limits>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long long int ll;

//define
#define INF 1e9 
#define NUM 1000000007
#define all(x) begin(x), end(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int main() { 
    int n;
    cin>>n;
    
    VI a(n),b(n);

    rep(i,n){
        cin>>a[i];
        b[i]=a[i];
    }

    sort(all(b));
    for(int i=0;i<n;i++){
        if(a[i]==b[n-1]){
            cout<<b[n-2]<<endl;
        }else{
            cout<<b[n-1]<<endl;
        }
    }



  

  
  

}



Measured memory_bytes: 3200
#include<stdio.h>
int main(){
	int h,m,s;
	scanf("%d",&s);
	if(s<60)
	{
		printf("0:0:%d\n",s);
	}
	else if(s<3600)
	{
		m=s/60;
		s=s%60;
		printf("0:%d:%d\n",m,s);
	}
	else if(s>=3600)
	{
		m=s/60;
		s=s%60;
		h=m/60;
		m=m%60;
		printf("%d:%d:%d\n",h,m,s);
	}
	
	
}

Measured memory_bytes: 2696
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,k=map(int,input().split())
A=list(map(int,input().split()))
B=[0]*(n+1)
for i in range(n):
    B[i+1]=B[i]+A[i]
for i in range(n-k+1):
    ans=max(ans,B[i+k]-B[i])
print((ans+k)/2)
# print(B)

Measured memory_bytes: 78320
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

/**
 * 解説通りに作成したソースコード
 */
public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt(), m = scanner.nextInt();
			long[] result = new long[m];
			result[m - 1] = n * (long) (n - 1) / 2;
			int[] a = new int[m], b = new int[m];
			IntStream.range(0, m).forEach(i -> {
				a[i] = scanner.nextInt() - 1;
				b[i] = scanner.nextInt() - 1;
			});
			UnionFindTree uft = new UnionFindTree(n);
			IntStream.range(1, m).map(i -> m - i).forEach(i -> {
				if (uft.same(a[i], b[i])) {
					result[i - 1] = result[i];
				} else {
					result[i - 1] = result[i] - uft.count(a[i]) * uft.count(b[i]);
					uft.union(a[i], b[i]);
				}
			});
			Arrays.stream(result).forEach(System.out::println);
		}
	}

	/**
	 * Union Find Treeの実装<br/>
	 * https://atcoder.jp/contests/abc040/submissions/4708654 を参考に作成
	 */
	private static class UnionFindTree {
		int[] parent;
		int[] count;

		UnionFindTree(int size) {
			parent = new int[size];
			IntStream.range(0, size).forEach(i -> parent[i] = i);
			count = new int[size];
			Arrays.fill(count, 1);
		}

		int find(int x) {
			if (parent[x] == x) {
				return x;
			} else {
				int v = find(parent[x]);
				parent[x] = v;
				return v;
			}
		}

		/**
		 * @param x
		 * @param y
		 * @return xとyがつながっているかどうか
		 */
		boolean same(int x, int y) {
			return find(x) == find(y);
		}

		/**
		 * xとyを結合する
		 * 
		 * @param x
		 * @param y
		 */
		void union(int x, int y) {
			int rootX = find(x);
			int rootY = find(y);
			if (rootX == rootY) {
				return;
			}
			parent[rootX] = rootY;
			parent[x] = rootY;
			count[rootY] += count[rootX];
		}

		/**
		 * @param x
		 * @return xと結ぶ都市の数
		 */
		public int count(int x) {
			return count[find(x)];
		}
	}
}


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

int main() {
	int N, K;
    cin >> N >> K;
  	int sum = 1;
      
  for (int i = 0; i < N; i++) {
    if(sum * 2 < sum + K){
      sum *= 2;
    }
    else{
      sum += K;
    }
  }
    cout << sum << endl;
}

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

int main() {
  int N;
  cin >> N;
  set<int> data;
  for(int i = 1; i <= 9; i++) {
    for(int j = i; j <= 9; j++) {
      data.insert(i * j);
    }
  }
  if(data.count(N)) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

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

std::vector<size_t> gaps = {1};

template <typename T>
size_t insertion_sort(T a[], size_t n, size_t gap = 1){
  size_t count = 0;
  for(size_t i = gap; i < n; i++){
    T v = a[i];
    int j = i - gap;
    while(j >= 0 && a[j] > v){
      a[j+gap] = a[j];
      j -= gap;
      count++;
    }
    a[j+gap] = v;
  }
  return count;
}

void make_gap_table(size_t n){
  size_t h = 4;
  while(h < n){
    gaps.push_back(h);
    h = 3*h + 1;
  }
}

template <typename T>
void shell_sort(T a[], size_t n){
  make_gap_table(n);
  size_t count = 0;
  for(auto it = gaps.rbegin(); it != gaps.rend(); it++){
    count += insertion_sort(a,n,*it);
  }

  std::cout << gaps.size() << '\n';

  for(auto it = gaps.rbegin(); it != std::prev(gaps.rend()); it++){
    std::cout << *it << ' ';
  }
  std::cout << *(std::prev(gaps.rend())) << '\n';

  std::cout << count << '\n';
}

int main(){
  size_t n;
  size_t buf;
  std::vector<size_t> a;
  std::cin >> n;
  for(size_t i = 0; i < n; i++){
    std::cin >> buf;
    a.push_back(buf);
  }

  shell_sort(a.data(),a.size());
  for(auto &v : a){
    std::cout << v << '\n';
  }
}

Measured memory_bytes: 11208
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        s: String,
    }
    let s_ = s.to_string();
    let ans = match &*s {
        "SUN" => 7,
        "MON" => 6,
        "TUE" => 5,
        "WED" => 4,
        "THU" => 3,
        "FRI" => 2,
        "SAT" => 1,
        _ => panic!()
    };
    println!("{}", ans);
}


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

class Program
{
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
		int[] intArray = Console.ReadLine().Split(' ').Select(i => int.Parse(i) - 1).ToArray();
		int[] vs = new int[N];
		for(int i = 0; i < intArray.Length; i++)
			vs[intArray[i]]++;
		for (int i = 0; i < N; i++)
			Console.WriteLine(vs[i]);
	}
}


//string s = Console.ReadLine();
//int[] intArray = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
//int H = intArray[0];
//int W = intArray[1];
//int N = int.Parse(Console.ReadLine());
//List<int> A = new List<int>(Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray());
//Boolean ok = false;

//Console.WriteLine(ans);
//Console.WriteLine("Yes");
//Console.WriteLine("No");
//Console.ReadKey();
//Console.WriteLine(cnt);

//string[] strArray = Console.ReadLine().Split(' ').ToArray();
//string S = strArray[0];
//string T = strArray[1];


Measured memory_bytes: 43836
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
const ll INF = 1e15;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
int main(){
    int n,a[100005],b;
    cin >> n;
    rep(i,n){
        cin >> b;
        --b;
        a[i] = b;
    }
    int now = 0,cnt = 0;
    bool out = false;
    while(now != 1){
        now = a[now];
        if (now == 0 || cnt >= n){
            out = 1;
            break;
        }
        cnt++;
    }
    if (out) PRINT(-1);
    else PRINT(cnt);
}

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

using namespace std;

#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define FOR(i,m,n) for(int i=(m) ; i<(n) ; i++)
#define FORR(i,m,n) for(int i=(m) ; i>=(n) ; i--)

#define All(x) (x).begin(),(x).end()

typedef long long ll;
typedef unsigned long long ull;

const int INF = 1e9;

int main(){
   int n;cin >> n;
   vector<int> a(n);
   rep(i,n){
      cin >> a[i];
   }
   sort(All(a));
   int minus = 0;
   int minNum = n-1;
   for(int i=0;i<n;i++){
      if(a[i] == 0){
         minNum = 0;
         break;
      }else if(a[i]>0){
         minNum = i;
         break;
      }
      minus++;
   }
   ll ans = 0;
   if(minus%2 == 0){
      rep(i,n){
         ans+= abs(a[i]);
      }
      cout << ans << endl;
   }else{
      for(int i=0;i<n;i++){
         ans+= abs(a[i]);
      }
      cout << ans - min(abs(a[minNum]),abs(a[minNum-1]))*2 << endl;
   }
   return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define modulo 1000000007
#define fast_io ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
using namespace std;
int main(){
	fast_io;
	ll n,sum=0,ans=0;
	cin>>n;
	ll a[n];
	for (int i = 0; i < n; ++i){
		cin>>a[i];
		sum+=a[i];
	}
	for (int i = 0; i < n; ++i){
		ans+=((sum-a[i])*a[i]);
	}
	cout<<ans/2<<"\n";
	return 0;
}

Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        s: chars
    }
    let mut ans = 0;
	for i in 2..n {
    	if s[i - 2] == 'A' &&  s[i - 1] == 'B' && s[i] == 'C' {
        	ans += 1;
        }
    }
    println!("{}", ans);
}

Measured memory_bytes: 4352
///              B I S M I L L A H I R  R A H M A N I R  R A H I M

#include<bits/stdc++.h>
using namespace std;
typedef bool                   boo;
typedef int                    li;
typedef long                   il;
typedef unsigned long          ul;
typedef long long int          ll;
typedef unsigned long long     ull;
typedef double                 dd;
typedef string                 str;
#define vli                    vector<li>
#define vll                    vector<ll>
#define sli                    set<li>
#define sll                    set<ll>
#define pli                    pair<li, li>
#define pll                    pair<ll, ll>
#define vpi                    vector<pair<li, li>>
#define vpl                    vector<pair<ll, ll>>
#define mpl                    map<ll, ll>
#define wt                     ll t; cin>>t; while(t--)
#define input(a,n)             for(int i=0;i<n;i++) cin>>a[i];
#define lp(a, i, b)            for(ll i=a; i<b; i++)
#define rlp(a, i, b)           for(ll i=a; i>=b; i--)
#define sz(x)                  x.size()
#define len(z)                 z.begin(), z.end()
#define ci(x)                  cin>>x;
#define co(x)                  cout<<x nl
#define mem(z, l)              memset(z, l, sizeof(z))
#define MP                     make_pair
#define pb                     push_back
#define F                      first
#define S                      second
#define nl                     <<endl
#define nll                    cout<<endl
#define sp                     <<" "<<
#define sl                     <<" "
#define cy                     cout<<"YES"<<nl
#define cn                     cout<<"NO"<<nl
#define rn                     return
#define good_bye               return 0
#define PI                     3.1415926536
#define gcd(a,b)               __gcd(a,b)
#define lcm(a,b)               (a*(b/gcd(a,b)))
#define faster                 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define input_txt()            freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
const double eps=              1e-9;
const int inf=                 2000000000;
const ll infLL=                9000000000000000000;
//ll Pow(ll P, ll Q)           { ll R=1; for(ll I=1; I<=Q; I++) R*=P; rn R; }
//void dfs(ll K)               { vis[K]=true; for(auto J: v[K]) { if(!vis[J]) dfs(J); } }
//void seive(ll MX)            { S.pb(2); for(ll I=3; i<=MX; i+=2) { if(!vis[I]) { S.pb(I); for(ll J=I*I; j<=MX; J+=(2*I)) vis[J]=false; } } }
//bool isPrime(ll n)           { if(n%2==0) rn false; for(ll i=3; i*i<=n; i+=2) { if(n%i==0) rn false; } rn true; }
//----------------------------------------LET'S BEGIN-----------------------------------------------------------------------
const int mX = 1e6+123;
ll n, m, k, x, l=0;
map<ll,ll>mp;

void case_i()
{
    ci(n>>m);
    lp(0, i, n)
    {
        cin>>k;
        while(k--)
        {
            cin>>x; mp[x]++;
            if(mp[x]==n) l++;
        }
    }
    co(l);
}

int main()
{
    faster;
//    input_txt();
//    wt
      case_i();
    good_bye;
}
///           _5_4_8_8_1_9_                ///



Measured memory_bytes: 3664
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <deque>
#include <algorithm>

typedef long long ll;
typedef unsigned long long ull;
#define mod 1000000007
#define rep(i, n) for(int i = 0; i < n; ++i)

using namespace std;

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

	int n;
	int* a;
	cin >> n;
	a = new int[n];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	vector<int> t;
	t.push_back(n - 1);
	for (int i = n - 2; i >= 0; i--) {
		if (a[i] >= a[t[t.size() - 1]]) {
			t.push_back(i);
			continue;
		}
      
		for (int j = 0; j < t.size(); j++) {
			if (a[i] < a[t[j]]) {
				t[j] = i;
				break;
			}
		}
	}

	cout << t.size() << "\n";
 }


Measured memory_bytes: 1276
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

D, N = get_ints

base = 100 ** D
if N == 100
  puts base * 101
else
  puts base * N
end


Measured memory_bytes: 14504
def main():
    s = input()
    if s=='SUN':
        print(7)
    elif s=='MON':
        print(6)
    elif s=='TUE':
        print(5)
    elif s=='WED':
        print(4)
    elif s=='THU':
        print(3)
    elif s=='FRI':
        print(2)
    else:
        print(1)

main()


Measured memory_bytes: 8964
# ABC 091
def getInt(): return int(input())
def db(x): 
    global debug
    if debug: print(x)
debug = False
N = getInt()
S = []
for i in range(N): S.append(input())
M = getInt()
T = []
for i in range(M): T.append(input())
db((N,M))
db((S,T))
dic = {}
for w in S: 
    if w in dic: dic[w] += 1
    else: dic[w] = 1
for w in T: 
    if w in dic: dic[w] -= 1
    else: dic[w] = -1
db(dic)
db(dic.values())
db(list(dic.values()))

print(max(0,max(list(dic.values()))))

Measured memory_bytes: 3064
#include<stdio.h>

int main(){
  int n;
  int i, j, k;
  int b, f, r, v;
  int arr[4][3][10];

  // array initialization
  for(i = 0; i < 4; i++){
    for(j = 0; j < 3; j++){
      for(k = 0; k < 10; k++){
	arr[i][j][k] = 0;
      }
    }
  }

  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d %d %d %d", &b, &f, &r, &v);
    arr[b - 1][f - 1][r - 1] += v;
  }

  for(i = 0; i < 4; i++){
    for(j = 0; j < 3; j++){
      for(k = 0; k < 10; k++){
	printf(" %d", arr[i][j][k]);
      }
      printf("\n");
    }
    if(i != 3){
      printf("####################\n");
    }
  }

  return 0;
}



Measured memory_bytes: 2104
s = input()
n = len(s)-1
ans = 0
for i in range(2**n):
    tmp = s[0]
    for j in range(n):
        if i>>j&1:
            ans += int(tmp)
            tmp = s[j+1]
        else:
            tmp += s[j+1]
    ans += int(tmp)
print(ans)

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

int main(){
	int A,B,C,K;
	cin>>A>>B>>C;
	cin>>K;
	for(int i=0;i<K;i++){
		if(A>=B&&A>=C){
			A*=2;
		}
		else if(B>A&&B>=C){
			B*=2;
		}
		else{
			C*=2;
		}
	}
	cout<<A+B+C<<endl;
	return 0;
}


Measured memory_bytes: 256
//
// Noszály Áron 9a Debreceni Fazekas Mihály Gimnázium
//
#include<bits/stdc++.h>
#include<cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;

#define all(s) (s).begin(),(s).end()
#define pb push_back
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define INF std::numeric_limits<int>::max()
#define MINF std::numeric_limits<int>::min()
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define mp make_pair
#define xx first
#define yy second
#define sz(x) (int)(x).size()

#ifndef ONLINE_JUDGE
#  define LOG(x) (cerr << #x << " = " << (x) << endl)
#else
#  define LOG(x) ((void)0)
#endif

const long double PI = acos(-1);

int d1[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
int d2[8][2]={{1,0},{0,1},{0,-1},{-1,0},{1,1},{-1,1},{1,-1},{-1,-1}};

int main()
{
	IO;
	vector<char> v;
	string t;cin>>t;
	for(auto i:t)
	{
		if(i=='0')
		{
			v.pb('0');
		}else if(i=='1')
		{
			v.pb('1');
		}else {
			if(v.size()>0)
			{
				v.pop_back();
			}
		}
	}
	for(auto i:v)
	{
		cout<<i;
	}
	cout<<"\n";
	return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
using namespace std;
int main()
{
    char a[20];
    scanf("%s",a);
    int i=1;
    for(;a[i]!=0;i++)
        if(a[i]==a[i-1])
    {printf("Bad\n");return 0;}
    printf("Good\n");
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main() {
  string A,B,C;
  cin >> A >> B >> C;
  vector<int>a(A.size()+1);
  for (int i = 0; i < A.size()+1; i++) {
    if (i == A.size()){
      a.at(i) = 4;
    }
    else {
      if (A.at(i) == 'a'){
        a.at(i) = 1;
      }
      else if (A.at(i) == 'b'){
        a.at(i) = 2;
      }
      else if (A.at(i) == 'c'){
        a.at(i) = 3;
      }
    }
  }
  vector<int>b(B.size()+1);
  for (int i = 0; i < B.size()+1; i++) {
    if (i == B.size()){
      b.at(i) = 5;
    }
    else {
      if (B.at(i) == 'a'){
        b.at(i) = 1;
      }
      else if (B.at(i) == 'b'){
        b.at(i) = 2;
      }
      else if (B.at(i) == 'c'){
        b.at(i) = 3;
      }
    }
  }
  vector<int>c(C.size()+1);
  for (int i = 0; i < C.size()+1; i++) {
    if (i == C.size()){
      c.at(i) = 6;
    }
    else {
      if (C.at(i) == 'a'){
        c.at(i) = 1;
      }
      else if (C.at(i) == 'b'){
        c.at(i) = 2;
      }
      else if (C.at(i) == 'c'){
        c.at(i) = 3;
      }
    }
  }
  int D = 1;
  int E = 0;
  int F = 0;
  int G = 0;
  for (int i = 0; i < A.size()+B.size()+C.size()+2; i++) {
    if (D == 1){
      D = a.at(E);
      E++;
    }
    else if (D == 2){
      D = b.at(F);
      F++;
    }
    else if (D == 3){
      D = c.at(G);
      G++;
    }
    if (D == 4){
      cout << 'A' << endl;
      return 0;
    }
    else if (D == 5){
      cout << 'B' << endl;
      return 0;
    }
    if (D == 6){
      cout << 'C' << endl;
      return 0;
    }
  }
}
      
   
  

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define D(x) cout << #x << "=" << x << endl
#define De(...)
using namespace std; 

int _; 
 
inline int gcd(int a,int b)
{
    while(b^=a^=b^=a%=b);
    return a;
}

int k;
long long ans;

int main()
{
	//for(scanf("%d",&_);_;_--)
	scanf("%d",&k);
	for(int i=1;i <= k;i++)
		for(int j=1;j <= k;j++)
			for(int h=1;h <= k;h++)
				ans += gcd(gcd(i,j),h);
	printf("%d\n",ans);
	return 0;
}


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

int main(){
  bool ans=true;
  int c[3][3]; 
  for(int i=1;i<=3;i++){
    for(int j=1;j<=3;j++){
      cin>>c[i][j];
    }
  }
  for(int i=1;i<=2;i++){
    for(int j=1;j<=2;j++){
    if(c[i][j+1]-c[i][j] != c[i+1][j+1]-c[i+1][j]){
      ans=false;
      }
    if(c[i+1][j]-c[i][j] != c[i+1][j+1]-c[i][j+1]){
      ans=false;
      }
    }
   }
  if(ans)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
    return 0;
}

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

namespace atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var aList = new List<int>();
            var bList = new List<int>();
            for (var i = 0; i < n; i++)
            {
                var ab = Console.ReadLine().Split(' ').Select(num => int.Parse(num)).ToArray();
                aList.Add(ab[0]);
                bList.Add(ab[1]);
            }
            var isEven = n % 2 == 0;
            var aMedian = GetMedian(isEven, aList);
            var bMedian = GetMedian(isEven, bList);

            Console.WriteLine(bMedian - aMedian + 1);

            double GetMedian(bool isEven, List<int> list)
            {
                var orderdArray = list.OrderBy(e => e).ToArray();
                if (isEven)
                {
                    var harfIndex = (orderdArray.Length - 1) / 2;
                    return (orderdArray[harfIndex] + orderdArray[harfIndex + 1]);
                }
                else
                {
                    return orderdArray[orderdArray.Length / 2];
                }
            }
        }
    }
}

Measured memory_bytes: 46160
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int b = sc.nextInt();
      int c = sc.nextInt();
      int d = sc.nextInt();
      int sum = Math.min(a,b) + Math.min(c,d);
      System.out.println(sum);
      sc.close();
    }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#include <string>
#include <iostream>
using namespace std;
int main(){
    int n, a = 10, wa = 0, b = 0, c = 0, tasu = 0;
    cin >> n;
    while(n > a){
        b =  n % a;
        if(a != 10){ tasu = (b - c)/(a/10); }
        if(a == 10){ tasu = b; }
        wa = wa + tasu;
        a = a*10;
        c = b;
//        cout<<a<<" "<<b<<" "<<wa<<endl;
    }
    a = a/10;
    b = n /a;
    wa = wa + b;
//    cout<<b<<endl;
//    cout<<wa<<endl;
    if( n % wa == 0 ){cout<<"Yes"<<endl;}
    else{cout<<"No"<<endl;}
                
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;

int main() { 
    char c;
    cin >> c;
    if (c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o') {
        cout << "vowel" << endl;
    } else {
        cout << "consonant" << endl;
    }
}




Measured memory_bytes: 3628
/*
A Reward for a Carpenter(https://onlinejudge.u-aizu.ac.jp/problems/0117)
*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cmath>
#include <complex>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cassert>
#include <iomanip>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(v) push_back(v)
#define uniq(v) (v).erase(unique(all(v)),(v).end())
#define bitcnt(x) __builtin_popcount(x)
#define fst first
#define snd second
#define Pqaz(T) priority_queue<T,vector<T>,greater<T>>
#define Pqza(T) priority_queue<T>
#define put(x) cout << x;
#define putsp(x) cout << x << ' ';
#define putln(x) cout << x << endl;
#define ENJYU std::ios::sync_with_stdio(false);std::cin.tie(0);

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef complex<double> comp;
typedef vector <int> vec;
typedef vector <ll> vecll;
typedef vector <double> vecd;
typedef vector <vec> mat;
typedef vector <vecll> matll;
typedef vector <vecll> matd;

//vector の中身を出力
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

const int MAX = 32;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const int MOD = 1000000007;

int wf[MAX][MAX];

void solve(void){
	int N, M, s, g, V, P;
	char cc;
	cin >> N >> M;

	rep(N, i) rep(N, j) wf[i][j] = (i == j ? 0 : INF);


	rep(M, i)
	{
		char cc;
		int a, b, c, d;
		cin >> a >> cc >> b >> cc >> c >> cc >> d;

		//cout << a << b << c << d << endl;

		a--, b--;
		wf[a][b] = c;
		wf[b][a] = d;
	}

	rep(N, k) rep(N, i) rep(N, j) wf[i][j] = min(wf[i][j], wf[i][k] + wf[k][j]);

	cin >> s >> cc >> g >> cc >> V >> cc >> P;
	s--, g--;

	/*
	rep(N, i) rep(N, j)
	{
		cout << wf[i][j] << ' ';
		if (j == N-1) cout << endl;
	}
	*/

	cout << V - P - wf[s][g] - wf[g][s] << endl;

}

int main(void){
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}



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

def main():
    K = int(input())
    S = input()
    N = len(S)
    M = N+K
    # print(N,K,M)
    p = 10**9+7
    a = [None] * (M+1)
    inva = [None] * (M+1)
    a[0] = 1
    
    for i in range(1, M+1):
        a[i] = i * a[i-1] % p
    
    inva[M] = pow(a[M],p-2,p)
    for i in range(M):
        inva[M-i-1] = inva[M-i] * (M-i) % p

    ans = 0
    for i in range(K+1):
        tmp = a[N+K-i-1]*inva[N-1]%p
        tmp = tmp*inva[K-i]%p
        tmp *= pow(25,K-i,p)
        tmp %= p
        tmp *= pow(26,i,p)
        tmp %= p
        ans = ans + tmp
        ans %= p
    print(ans)

if __name__ == "__main__":
    main()

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

#define ARC(i, a, b) for(int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)

template<typename T> T ant(const T &a, const T &b){ return a > b ? a : b; }
template<typename T> T ont(const T &a, const T &b){ return a < b ? a : b; }
template<typename T> T rng(const T &a, const T &b){ return a > b ? a - b : b - a; }
template<typename T> T &anth(T &a, const T &b){ return a = ant(a, b); }
template<typename T> T &onth(T &a, const T &b){ return a = ont(a, b); }

template<typename T> T make_v(T val){ return val; }
template<typename... Ts> auto make_v(size_t n, Ts... ts){ return std::vector<decltype(make_v(ts...))>(n, make_v(ts...)); }

int main(){
	int n;
	while(scanf("%d", &n), n){
	int a[12345], av = 0, cnt = 0;
	RC(i, n){
		scanf("%d", a + i);
		av += a[i];
	}
	av /= n;
	RC(i, n) cnt += a[i] <= av;
	printf("%d\n", cnt);
	}
}



Measured memory_bytes: 3244
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
using namespace std;

int main(){
    int n;
    cin >> n;
    int sx[200001] = {0};
    int x[200001] = {0};

    for(int i=0; i < n; i++){
        int temp = 0;
        cin >> temp;
        sx[i] = temp;
        x[i] = temp;
    }

    sort(sx, sx+n);

    float med = ((sx[n/2 - 1] + sx[n/2]) / 2);

    for(int i=0; i < n; i++){
        if(med < x[i]) cout << sx[n/2 - 1] << endl;
        else cout << sx[n/2] << endl;
    }

    return 0;
}


Measured memory_bytes: 3712
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AtCoder
{
    class Program
    {
        private const int MODULO = 1000000007;
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        static long Solve(int n, int m, long[] X, long[] Y)
        {
            long x = 0;
            long y = 0;
            for (int i = 0, k = -n + 1; i < n; ++i, k += 2)
            {
                x += X[i] * k;
                x = (x % MODULO + MODULO) % MODULO;
            }
            for (int i = 0, k = -m + 1; i < m; ++i, k += 2)
            {
                y += Y[i] * k;
                y = (y % MODULO + MODULO) % MODULO;
            }
            return (x * y) % MODULO;
        }
        static void Main(string[] args)
        {
            int[] values = ReadInts();
            long[] X = ReadLongs();
            long[] Y = ReadLongs();
            Console.WriteLine(Solve(values[0], values[1], X, Y));
        }
    }
}


Measured memory_bytes: 31324
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF         1e9
#define INFLL       1e18
#define EPS         1e-9
#define REP(i,n)    for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(ll i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP(n)     cout << fixed << setprecision(n)
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

class union_find {
private:
	vector<ll> par, sz, rank;
public:
	union_find(ll n) : par(n), sz(n), rank(n)
	{
		REP(i, n) {
			par[i] = i;
			sz[i] = 1;
			rank[i] = 0;
		}
	}
	ll find(ll x)
	{
		return par[x] == x ? x : par[x] = find(par[x]);
	}
	void unite(ll x, ll y)
	{
		x = find(x);
		y = find(y);
		if (x != y) {
			if (rank[x] < rank[y]) {
				par[x] = y;
				sz[y] += sz[x];
			} else {
				par[y] = x;
				sz[x] += sz[y];
				if (rank[x] == rank[y]) {
					rank[x]++;
				}
			}
		}
	}
	bool same(ll x, ll y)
	{
		return find(x) == find(y);
	}
	ll size(ll n)
	{
		return sz[find(n)];
	}
};
struct edge { ll from, to, cost; };
signed main()
{
	ll v = in(), e = in();
	vector<edge>es(e);
	REP(i, e) {
		ll s = in(), t = in(), w = in();
		es[i] = { s,t,w };
	}
	sort(ALL(es), [](const edge&e1, const edge&e2) {return e1.cost < e2.cost; });
	union_find uf(v);
	ll ans = 0;
	REP(i, e) {
		if (!uf.same(es[i].from, es[i].to)) {
			uf.unite(es[i].from, es[i].to);
			ans += es[i].cost;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 5552
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

//const MAX:usize = 100006;
//const INF:u64 = u64::max_value();

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

fn main() {
    let a:i32 = read();
    let b:i32 = read();
    let c:i32 = read();

    println!("{}", max(0, c-(a-b)));
    
}

Measured memory_bytes: 4352
#https://atcoder.jp/contests/abc155/tasks/abc155_c
import collections
n=int(input())
s=[]
for i in range(n):
    s.append(input())
c = collections.Counter(s)#出現回数順に並び替える
count=max(c.values())#最大出現回数をcountで保持
l=[]
for key, value in c.items():
    if value==count:
        l.append(key)
l.sort()
for x in l:
    print(x)

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define collect(arr, size) rep(i,size) cin >> arr[i];
#define int long long

signed main(){
    int N, K;
    cin >> N >> K;
    
    vector<int> enemies(N);
    collect(enemies, N);
    
    sort(all(enemies));
    int attacks = 0;
    rep(i,N-K) attacks += enemies[i];
    
    cout << attacks << endl;
}

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

void swap(int a, int b){
    if(a < b){
        cout << a << " " << b << endl;
    }else{
        cout << b << " " << a << endl;
    }
}

int main(){
    int x, y;
    while(1){
        cin >> x >> y;
        if(x == 0 && y==0) break;
        swap(x, y);
    }
    return 0;
}


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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = INT_MAX / 2;

int main() {
  int N, K, S; cin >> N >> K >> S;

  rep(i, K) {
    if (i) cout << " ";
    cout << S;
  }
  rep(i, N - K) {
    if (K || i) cout << " ";
    cout << (S == (int)1e9 ? 123456789 : (int)1e9);
  }
  cout << endl;
}


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

int main(){
  int K;
  int A,B,C;
  cin >> A >> B >> C;
  cin >> K;
  int ans = 0;
  
  for(int i = 0;i <= K;i++){
    int a,b,c;
  
    a = A;
    
    
    int cur = 0;
    
    for(int m = 0;m < i;m++){
      a *= 2;
    }
    
    for(int j = 0;j <= K-i;j++){
      
      b = B;
      c = C;
      
      for(int k = 0;k < j;k++){
        b *= 2;
      }
      
      for(int l = 0;l < K-i-j;l++){
        c *= 2;
      }
      
      cur = a + b + c;
      if(ans < cur){
        ans = cur;
      }
      
    }
    
   
  }
  
  cout << ans << endl;
}

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

const int INF = 1e9;

int n;
int parent[500000];
int rnk[500000];
int find(int x) {
  if (parent[x] == x) return x;
  return parent[x] = find(parent[x]);
}
void unite(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) return;

  if (rnk[x] < rnk[y]) {
    parent[x] = y;
  } else {
    parent[y] = x;
    if (rnk[x] == rnk[y]) rnk[x]++;
  }
}
bool same(int x, int y) {
  return find(x) == find(y);
}

int main() {
  int m;
  cin>>n>>m;
  for (int i=0; i<n; i++) parent[i] = i, rnk[i] = 0;
  for (int i=0; i<m; i++) {
    int x, y, z;
    cin>>x>>y>>z;
    --x; --y;
    unite(x, y);
  }
  set<int> s;
  for (int i=0; i<n; i++) {
    s.insert(find(parent[i]));
  }
  cout<<s.size()<<endl;
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define int long long
#define ull unsigned long long
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) for(int i=(b); i<((int)(a)); i++)
#define rep3(i,b,a) for(int i=(b); i>=((int)(a)); i--)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define sz(a) ((int)a.size())
#define pow2(x) (1ll<<(x))
#define ceiling(a,b) (((a)+(b)-1)/(b))
#define print0(a) cout << (a) << ' '
#define print1(a) cout << (a) << '\n'
#define print2(a,b) cout << (a) << ' ',print1(b)
#define print3(a,b,c) cout << (a) << ' ',print2(b,c)
#define print4(a,b,c,d) cout << (a) << ' ',print3(b,c,d)
#ifdef i_am_noob
#define debug(a) print2(#a,a)
#else
#define debug(a)
#endif
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
using namespace __gnu_pbds;

const int Mod=1000000007,Mod2=998244353;
const int MOD=Mod;

inline int add(int a, int b){return (a+b>=MOD?a+b-MOD:a+b);}
inline int sub(int a, int b){return (a+MOD-b>=MOD?a-b:a+MOD-b);}
int Pow(int a, int b){
	if(!b) return 1;
	int tmp=Pow(a*a%MOD,b>>1);
	return (b&1?tmp*a%MOD:tmp);
}
inline int inverse(int n){return Pow(n,MOD-2);}

const int maxn=100005;
//i_am_noob
int n;
vector<int> vec;
string str;

signed main(){
	ios_base::sync_with_stdio(0),cin.tie(0);
    cin >> n;
    while(n>0){
        vec.pb(n%26);
        n/=26;
    }
    rep(sz(vec)-1) if(vec[i]<=0){
        vec[i]+=26;
        vec[i+1]--;
    }
    reverse(all(vec));
    for(auto i: vec) if(i!=0) cout << char('a'+i-1);
    cout << "\n";
	return 0;
}


Measured memory_bytes: 3556
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<queue>
#include<set>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) std::cout<<arg<<"\n"
#define prin2(arg1,arg2) std::cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) std::memset(arg,n,sizeof(arg))
#define mp(a,b) std::make_pair(a,b)
#define FI first
#define SE second
using std::cin;
typedef long long ll;
typedef std::pair<int,int> pi;
typedef std::pair<int,pi> pipi;
typedef std::vector<int> vi;
typedef std::string str;
typedef std::multiset<int> msi;
const int INF=1e+9;
const ll INFLL=1e+17;
const ll MOD=1e+9+7;
int N,Q;
int S[200010],T[200010],X[200010];
int D[200010];
int main(){
  cin>>N>>Q;
  rep(i,N) cin>>S[i]>>T[i]>>X[i];
  rep(i,Q) cin>>D[i];
  pipi p[600010];
  int j=0;
  rep(i,N){
    p[j]=mp(S[i]-X[i],mp(0,X[i]));j++;
    p[j]=mp(T[i]-X[i],mp(-1,X[i]));j++;
  }
  rep(i,Q){
    p[j]=mp(D[i],mp(1,0));j++;
  }
  std::sort(p,p+j);
  msi s;
  rep(i,j){
    int fi=p[i].FI,se=p[i].SE.FI,sese=p[i].SE.SE;
    if(se==0) s.insert(sese);
    else if(se==-1) s.erase(sese);
    else{
      if(!s.empty()){
	prin(*s.begin());
      }
      else{
	prin(-1);
      }
    }
  }
  return 0;
}


Measured memory_bytes: 20736
#include <inttypes.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
    intmax_t N, K, A[(int)2e5 + 1];
    intmax_t ans = 1, visited[(int)2e5 + 1] = {}, loop = 0;

    scanf("%jd%jd", &N, &K);
    for (size_t i = 1; i <= N; i++) {
        scanf("%jd", &A[i]);
    }

    for (size_t i = 1; i <= K; i++) {
        ans = A[ans];
        if (visited[ans]) {
            loop = i;
            break;
        } else {
            visited[ans] = i;
        }
    }

    if (loop != 0) {
        K -= visited[ans];
        K %= (loop - visited[ans]);
        for (size_t i = 0; i < K; i++) {
            ans = A[ans];
        }
    }

    printf("%jd\n", ans);

    return 0;
}


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

int main(){
    int sx,sy,tx,ty;cin>>sx>>sy>>tx>>ty;
    for(int i=0;i<ty-sy;i++){
        cout<<'U';
    }for(int j=0;j<tx-sx;j++){
        cout<<'R';
    }for(int i=ty;i>sy;i--){
        cout<<'D';
    }for(int j=tx;j>sx;j--){
        cout<<'L';
    }
    cout<<'L';
    for(int i=0;i<ty-sy+1;i++){
        cout<<'U';
    }for(int j=0;j<tx-sx+1;j++){
        cout<<'R';
    }cout<<'D';
    cout<<'R';
    for(int i=ty;i>sy-1;i--){
        cout<<'D';
    }for(int j=tx+1;j>sx;j--){
        cout<<'L';
    }cout<<'U';
    
}

Measured memory_bytes: 256
import sys

n = int(input())
a = list(map(int, input().split()))

a = sorted(a)

num = a[0]

for i in range(1, len(a)):
  num *= a[i]
  if(num == 0):
    print(0)
    sys.exit()
  if(num > 10 ** 18):
    print(-1)
    sys.exit()

print(num) 


Measured memory_bytes: 21636
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <random>
#include <chrono>

using namespace std;
using namespace __gnu_pbds;

#define endl '\n'

typedef long long ll;
typedef pair<int, int> pii;
//typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	
	char c;
	cin >> c;
	
	c++;
	
	cout << c << endl;
	
	return 0;
}


Measured memory_bytes: 764
#include <iostream>
using namespace std;
#include<bits/stdc++.h>
int main() {
	// your code goes here
	string s;
	cin>>s;
	int ans=0;
	for(char c:s)
	{
	    if(c=='+')
	    ans++;
	    else
	    ans--;
	}
	cout<<ans;
	return 0;
}


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

int n, c;
vector<vector<pair<int, int>>> stc;

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

int main() {
    cin >> n >> c;
    stc.resize(c);
    for (int i = 0; i < n; i++) {
        int s, t, c;
        cin >> s >> t >> c;
        c--;
        stc[c].push_back({s, t});
    }
    vector<pair<int, int>> task;
    for (int i = 0; i < c; i++) {
        if (stc[i].empty()) continue;
        sort(stc[i].begin(), stc[i].end());
        task.push_back(stc[i][0]);
        for (int j = 1; j < stc[i].size(); j++) {
            if (stc[i][j].first == stc[i][j - 1].second) {
                task.back().second = stc[i][j].second;
            } else {
                task.push_back((stc[i][j]));
            }
        }
    }
    vector<int> event(1e+5 + 2, 0);
    for (auto e : task) {
        event[e.first]++;
        event[e.second + 1]--;
    }
    int ans = 0;
    int need = 0;
    for (int i = 0; i < event.size(); i++) {
        need += event[i];
        chmax(ans, need);
    }
    cout << ans << endl;
}

Measured memory_bytes: 2676