akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define bug1( x ) {cerr << (#x) <<"="<< x << endl;}
#define bug2( x , y ) {cerr << (#x) <<"="<< (x) << "    " << (#y) << "="<< (y) << endl;}
#define bug3( x , y , z ) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << endl;}
#define bug4( x , y , z , w) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << endl;}
#define bug5( x , y , z , w ,p) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << "    " << (#p) <<"="<< p << endl;}
#define bug6( x , y , z , w ,p , q) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << "    " << (#p) <<"="<< p << "    " << (#q) <<"="<< q << endl;}
#define bugn( x , n ) {cerr << (#x) <<":";for(int i=0;i<n;i++)cerr << x[i] <<"  "; cerr << endl;}
#define bugnm( x , n , m ) {cerr << (#x)<<endl;for(int i=0;i<n;i++){cerr << "Row #" << i<< ":";for(int j=0;j<m;j++)cerr << x[i][j] << "   ";cerr << endl;}}
typedef long long ll;
typedef long double ld;
using namespace std;


const int maxn = 1e5+10;
vector<pair<int,int>>g[maxn];
vector<int>clr(maxn);
int n;
void dfs(int u,int p,int c){
	clr[u]=c;
	for(auto [v,w]:g[u]){
		if( v != p ){
			dfs(v,u,c ^ (w&1) );
		}
	}
}
int32_t main(){
	IOS
	cin>>n;
	for(int i=1;i<n;i++){
		int u,v,w;cin>>u>>v>>w;
		g[u].push_back({v,w});
		g[v].push_back({u,w});
	}
	dfs(1,0,0);
	for(int i=1;i<=n;i++){
		cout<<clr[i]<<" ";
	}
}
/*
 * long long or int?
 * index out of bound? 
 * Tested on own test case?corner?
 * Make more general solution.
 * Read Read Read Read ....
 */


Measured memory_bytes: 12768
#include <bits/stdc++.h>
using namespace std;
int N;
int main() {
    cin >> N;
    if(N <= 111) {
        cout << 111 << endl;
    }else if(N <= 222) {
        cout << 222 << endl;
    }else if(N <= 333) {
        cout << 333 << endl;
    }else if(N <= 444) {
        cout << 444 << endl;
    }else if(N <= 555) {
        cout << 555 << endl;
    }else if(N <= 666) {
        cout << 666 << endl;
    }else if(N <= 777) {
        cout << 777 << endl;
    }else if(N <= 888) {
        cout << 888 << endl;
    }else {
        cout << 999 << endl;
    }
}

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

v = list(map(int,input().split()))
c = list(map(int,input().split()))
l =[]
l_max = 0

for i in range(n):
    l.append(v[i]-c[i])
#print(sorted(l,reverse = True))

for i in l:
    if l_max < l_max+i:
        l_max += i

print(l_max)

Measured memory_bytes: 9112
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
    sc.Scan()
    i, e := strconv.Atoi(sc.Text())
    if e != nil {
        panic(e)
    }
    return i
}

func main() {
    sc.Split(bufio.ScanWords)
	n := nextInt()
	var a,b []int
	a = make([]int, n + 1)
	b = make([]int, n + 1 - 1)

    score := 0
    for i := 1; i <= n - 1; i++ {
        b[i] = nextInt()
        a[i + 1] = b[i]
        if a[i] > b[i] || i == 1 {
            a[i] = b[i]
        }
        score += a[i]
    }
    score += a[n]

    fmt.Println(score)
}

Measured memory_bytes: 640
D, G = map(int,input().split())
PC = [0]+[list(map(int,input().split())) for _ in range(D)]

def dfs(d, g):
  if(d == 0):
    return 1e9

  x = min(g//(100*d), PC[d][0])
  point = x*100*d

  if(x == PC[d][0]):
    point += PC[d][1]
  
  if(point < g):
    x += dfs(d-1, g-point)
  
  return min(x, dfs(d-1, g))
print(dfs(D, G))

Measured memory_bytes: 3064
s = input()
n = len(s) + 1
t = [0]*n
for i in range(n-1):
  if s[i] == '<':
    t[i+1] = t[i] + 1
for i in range(n-2,-1,-1):
  if s[i] == '>':
    t[i] = max(t[i],t[i+1]+1)
print(sum(t))

Measured memory_bytes: 46448
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())


from collections import Counter
def prime_factorize(n):
    d = Counter()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d[m] += 1
        m += 1
    if n > 1:
        d[n] += 1
    return d

soinsu = prime_factorize(n)

sankaku = [1]*20

from bisect import bisect_right

for i in range(1,20):
    sankaku[i] = sankaku[i-1]+(i+1)

ans=0
for k,v in soinsu.items():
    index = bisect_right(sankaku,v)
    ans += index

print(ans)



Measured memory_bytes: 9492
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

// --------------------------------------
string N;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> N;
  ll l = N.size();

  int k = 0;
  ll ans = 0;
  for(ll i=l-1; i>=0; i--) {
    ll n = N[i] - '0';
    ll nn = (i == 0 ? 0 : N[i - 1] - '0');
    if(n + k > 5 || (n + k == 5 && nn >= 5)) {
      ans += 10 - (n + k);
      k = 1;
    } else {
      ans += n + k;
      k = 0;
    }
  }
  if(k == 1) ans += 1;

  cout << ans << endl;
}


Measured memory_bytes: 1948
import java.util.*;

public class Main {

	public static void main(
			String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Integer[] aList = new Integer[n];
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			aList[i] = a;
		}
		Arrays.sort(aList, Collections.reverseOrder());
		
		int alice = 0;
		int bob = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				alice += aList[i];
			} else {
				bob += aList[i];
			}
		}
		System.out.println(alice - bob);
	}
}


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

typedef long long int int64;

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

void run(void){
  int a[]={2,3,13,23,43,53,73,83,103,113,163,173,193,223,233,263,283,293,313,353,373,383,433,443,463,503,523,563,593,613,643,653,673,683,733,743,773,823,853,863,883,953,983,1013,1033,1063,1093,1103,1123,1153,1163,1193,1213,1223,1283};
  int n;
  scanf("%d",&n);
  int i;
  for(i=0;i<n;i++) printf("%d ",a[i]);
  printf("\n");
  return;
}

int main(void){
  run();
  return 0;
}


Measured memory_bytes: 128
n = gets.chomp.to_i
arr = gets.chomp.split.map{ |item| item.to_i}
result = 0
hash = Hash.new(0)
arr.each do |b|
  hash[b] += 1
end
hash.each do |k,v|
  result += (v - k) if (k < v)
  result += v if (k > v)
end
puts result


Measured memory_bytes: 15492
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define override_rep(i, l, r, mes, ...) mes
#define rep1(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = l; i < r; i++)
#define rep(...) override_rep(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)
using P = pair<int, int>;
template<typename T, typename U>
istream& operator>>(istream& in, pair<T, U>& p) {
    in >> p.first >> p.second;
    return in;
}

signed main(signed argc, char* argv[]) {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    const int MOD = 1e9 + 7;
    string s;
    cin >> s;
    if (s.size() == 26) {
        if (s == "zyxwvutsrqponmlkjihgfedcba")
            cout << -1 << endl;
        else {
            string _s = s;
            next_permutation(s.begin(), s.end());
            rep(i, s.size()) {
                cout << s[i];
                if (s[i] != _s[i]) {
                    break;
                }
            }
            cout << endl;
        }
    }
    else {
        string _s = s;
        sort(s.begin(), s.end());
        if (count(s.begin(), s.end(), 'a') == 0)
            cout << _s << 'a' << endl;
        else {
            rep(i, s.size() - 1) {
                if (char(s[i] + 1) != s[i + 1]) {
                    cout << _s << char(s[i] + 1) << endl;
                    return 0;
                }
            }
            cout << _s << char(s[s.size() - 1] + 1) << endl;
        }
    }
}


Measured memory_bytes: 256
import glob
import os

bn = os.path.basename(__file__).split('.')[0]
dn = os.path.dirname(__file__).split('/')

# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = dn[len(dn)-2] + '\\' + dn[len(dn)-1] + '\\' + bn

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):

        N, X, T = map(int, self.input_data().split())
        if N % X == 0:
            result = T * int(N/X)
        else:
            result = T * (int(N/X) + 1)

        print(str(result))

solver = Solver(REL_PATH)
solver.exec_resolve()


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

long double deg2rad(long double degree)
{
  return degree * M_PI / 180.0;
}

int main()
{
  int a, b, h, m;
  cin >> a >> b >> h >> m;

  long double ans;

  long double rl = m * 6;
  long double sl = (h * 60 + m) / 2.0;
  long double d = abs(sl-rl);



  long double num = 180 <= d ? 360 - d : d;

  long double s = deg2rad(num);

  /* 余弦定理 */
  ans = b * b + a * a - 2 * b * a * cos(s);
  /* 平方根 */
  ans = sqrt(ans);

  cout << fixed << setprecision(30) << ans << endl;

  return 0;
}

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

int main() {
  long long int n,a,b;
  cin >> n >> a >> b;
  
  if((a-b) % 2 == 0) {
    cout << (b-a) / 2 << endl;
  }
  else if(a < n - b + 1) {
    cout << a + (b-a-1)/2 << endl;
  }
  else {
    cout << (n-b+1) + (b-a-1)/2 << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    string ans = "";
    for(int i=0; i<s.size(); i++){
        if(s[i]=='0'){
            ans += "0";
        }else if(s[i]=='1'){
            ans += "1";
        }else{
            if(ans.size()>=1){
                ans.erase(ans.size()-1, 1);
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int expr();
int term();
int fact();
int number();

char s[200] = {};
int idx = 0;

int main(){

  int dSetNum = 0;
  int i = 0;

  scanf("%d", &dSetNum);
  int answer[dSetNum + 1];
  int answerNum = 0;

  for(i = 0; i < dSetNum; i++){
    idx = 0;
    scanf("%s", &s);
    printf("%d\n", expr());
    // answer[answerNum] = expr();
  }

  for(i = 0; i < answerNum; i++){
    printf("%d\n", answer[i]);
  }
  return 0;
}

int expr(){
  int res = term();
  while(s[idx] == '+' || s[idx] == '-'){
    char op = s[idx++];
    int tmp = term();
    if(op == '+')res += tmp;
    else res -= tmp;
  }

  return res;
}

int term(){
  int res = fact();
   while(s[idx] == '*' || s[idx] == '/'){
    char op = s[idx++];
     int tmp = fact();
     if(op == '*') res *= tmp;
     else res /= tmp;
   }
   return res;
}

int fact(){
  int res;
  if(s[idx] == '('){
    idx++; res = expr();
    //assert( s[idx] == ')' );
    idx++;
  }
  else{
    res = number();
  }
  return res;
}

int number(){
  int res = 0;
  while('0' <= s[idx] && s[idx] <= '9'){
    res = res * 10 + s[idx] - '0';
    idx++;
  }
  return res;
}

Measured memory_bytes: 596
mod io{
    use std::io::*;
    pub fn read<T: ::std::str::FromStr>()->T{
        let stdin=stdin();
        let ret=stdin.lock().bytes().map(|c|c.unwrap()as char)
        .skip_while(|c|c.is_whitespace())
        .take_while(|c|!c.is_whitespace())
        .collect::<String>().parse().ok().unwrap();
        ret
    }
}
use io::read;
fn main(){
    println!("{}",read::<u32>()+read::<u32>()/2)
}


Measured memory_bytes: 4476
//In The Name Of The God

#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define F first
#define S second
#define X first.first
#define Y first .second
#define A second.first
#define B second.second
#define mp make_pair
#define pb push_back
#define pf push_front
#define P push
#define pob pop_back
#define pof pop_front
#define PO pop
#define rep(i,j,k) for(int i = j ; i <= k ; ++ i)
#define rrep(i,j,k) for(int i = j ; i>=k ; --i)
#define FR(i,j,k) for(int i = j ; i < k ; ++ i )
#define rFR(i,j,k) for(int i = j ; i > k ; -- i )
#define lb(x) x&-x
#define p2(x) (1LL<<x)
#define SZ size()
#define LB lower_bound
#define UB upper_bound
#define IT iterator
#define RIT reverse_iterator
#define E end()
#define BE begin()
#define RE rend()
#define RBE rbegin()
#define UN unsigned

typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll ;
typedef pair<int,pii> pip;
typedef pair<pii,int> ppi;
typedef pair<pii,pii> ppp;
typedef pair<int,pll> pipl;
typedef pair<pll,int> ppli ;
typedef pair<pll,pll> plpl ;
typedef pair<ll,pii> lpip;
typedef pair<pii,ll> lppi;
typedef pair<pii,pii> lppp;
typedef pair<ll,pll> lpipl;
typedef pair<pll,ll> lppli ;
typedef pair<pll,pll> lplpl ;
typedef vector<int> vi ;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef set<int> sti;
typedef set<ll> stl;
typedef set<pii > stpi;
typedef set<pll> stpl;
typedef vi::IT vit;
typedef vl::IT vlt;
typedef vpi::IT vpit;
typedef vpl::IT vplt;
typedef sti::IT stit;
typedef stl::IT stlt;
typedef stpi::IT stpit;
typedef stpl::IT stplt;
typedef vpi::RIT rvpit;
typedef vpl::RIT rvplt;
typedef sti::RIT rstit;
typedef stl::RIT rstlt;
typedef stpi::RIT rstpit;
typedef stpl::RIT rstplt;

const int MAXN = 500000;
const int SUPERN = 5000000;
const int MAXS = 325;
const int SUPERS = 1000;
const int MD = 1e9+7;
//......Structures.......

//......Variables........
ll n,re,x;
string s1,s2;
//......Funcs............
ll sum(ll a,ll b)
{
    return (a+b)%MD;
}
ll mu(ll a,ll b)
{
    return (a*b)%MD;
}
ll mn(ll a,ll b)
{
    return(a-b+MD)%MD;
}
//......Code.............
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin>>n;
    cin>>s1>>s2;
    FR(i,0,s1.SZ)
    {
        if(s1[i]==s2[i])
        {
            if(i==0)
            {
                re=3;
            }
            else
            {
                if(x)
                {
                    re=mu(re,2);
                }
            }
            x=1;
        }
        else
        {
            if(i==0)re=6;
            else
            {
                if(x)
                {
                    re=mu(re,2);
                }
                else
                {
                    re=mu(re,3);
                }
            }
            x=0;
            i++;
        }
    }
    cout<<re;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
namespace aizu
{
    class OnlineJudge
    {
        public static void Main()
        {
            string input = Console.ReadLine();
            string[] modify = new string[3];
            modify[0] = input.Replace("apple", "peach");
            modify[1] = input.Replace("peach", "apple");
            for(int i=0;i < input.Length;++i){
                if(input[i] != modify[0][i]){
                    modify[2] += modify[0][i].ToString();
                }
                else if(input[i] != modify[1][i]){
                    modify[2] += modify[1][i].ToString();
                }
                else{
                    modify[2] += input[i].ToString();
                }
            }
            Console.WriteLine(modify[2]);
        }
    }
}

Measured memory_bytes: 5448
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        static long Mod = (long)1e9 + 7;
        static long[] primes = new long[1001];
        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var N = Sarray()[0];
            var Ai = Sarray();
            var xi = new long[N];
            var sumOdd = 0L;
            for (var i = 0; i < N; i += 2)
                sumOdd += Ai[i];
            var sumEven = 0L;
            for (var i = 1; i < N; i += 2)
                sumEven += Ai[i];
            xi[0] = (sumOdd - sumEven) / 2;
            for (var i = N - 1; 0 < i; --i)
                xi[i] = Ai[i] - xi[(i + 1) % N];
            WriteLine(string.Join(" ", xi.Select(x => x * 2).ToArray()));
            //Out.Flush();
        }

    }
}


Measured memory_bytes: 33248
#include <bits//stdc++.h>
#define rep(i,k) for(int i=0;i<k;i++)
#define int long long
using namespace std;
signed main(void){
    int n,m,a,b,c,ans;
    cin>>n>>m;
    if(n>9||m>9)
     ans=-1;
    else
     ans=n*m;
    cout<<ans<<endl;
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  set<int> ans;
  int a, b, k; cin >> a >> b >> k;
  for(int i = 0; i < k; i++){
    if(a + i <= b) ans.insert(a + i);
    if(b - i >= a) ans.insert(b - i);
  }
  for(int v : ans) cout << v << endl;
  return 0;
}

Measured memory_bytes: 256
import numpy as np

N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
A = np.array([np.array(list(map(int, input().split()))) for _ in range(N)])

cnt = 0
for a in A:
    if np.sum(a*B) + C > 0: cnt += 1

print(cnt)


Measured memory_bytes: 12500
scores = []
shash = {}

while true
  id, score = gets.chomp.split(",").map{|s| s.to_i}
  break if id == 0 && score == 0

  scores[id] = score
  shash[score] = true
end

srank = shash.keys.sort{|a, b| b <=> a}
rhash = {}
(0...srank.length).each{|i| rhash[srank[i]] = i + 1}

while (line = gets)
  id = line.chomp.to_i

  puts rhash[scores[id]]
end

Measured memory_bytes: 6100
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
m = 10**19
# 地点の番号(=1)
idx = 0
for i in range(n):
    # 平均気温
    d = t - h[i]*0.006
    # A度に最も近い地点
    if abs(a-d) < m:
        m = abs(a-d)
        idx = i+1
print(idx)


Measured memory_bytes: 9116
#include <stdio.h>

int main()
{
	long long int s,k;
	long long int i,t;
	
	scanf("%lld",&t);
	
	k = 1;
	s = 0;
	
	for(;t != 1;t /= 2)
	{
		s += k;
		k *= 2;
	}
	
	s += k;
			
	printf("%lld\n",s);
		
	return 0;
}

Measured memory_bytes: 128
// Optimise
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

// #define MULTI_TEST
#ifdef LOCAL
#include "/home/shahraaz/bin/debug.h"
#else
#define db(...)
#define pc(...)
#endif

#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
auto TimeStart = chrono::steady_clock::now();
auto seed = TimeStart.time_since_epoch().count();
std::mt19937 rng(seed);
using ll = long long;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using Random = std::uniform_int_distribution<T>;

const int NAX = 2e5 + 5, MOD = 1000000007;

class Solution
{
private:
public:
    Solution() {}
    ~Solution() {}
    void solveCase()
    {
        vector<int> v(3);
        for (auto &x : v)
            cin >> x;
        cout << v[2] << ' ' << v[0] << ' ' << v[1] << '\n';
    }
};

int32_t main()
{
#ifndef LOCAL
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif
    int t = 1;
#ifdef MULTI_TEST
    cin >> t;
#endif
    Solution mySolver;
    for (int i = 1; i <= t; ++i)
    {
        mySolver.solveCase();
#ifdef TIME
        cerr << "Case #" << i << ": Time " << chrono::duration<double>(chrono::steady_clock::now() - TimeStart).count() << " s.\n";
        TimeStart = chrono::steady_clock::now();
#endif
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <mylib.h>
using namespace std;
//cin.sync_with_stdio(false);

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define FOR_EQ(i,a,b) for(int i = (a); i <= (b); ++i)
#define FOR_RE(i,a,b) for(int i = (a); i > (b); --i)
#define rep(i,n) FOR(i,0,n)
#define rep_eq(i,n) FOR_EQ(i,0,n)
#define rep_re(i,n) FOR_RE(i,n,0)
//1個上から時計周り
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
//上右下左
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
static const int NIL = -1;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> Vector;
typedef vector<Vector>	DVector;
int n;

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    string s;
    cin >> s;
    bool alp[26];
    rep(i, 26)  alp[i] = false;
    
    rep(i, s.size()){
        if(!alp[s[i] - 'a']){
            alp[s[i] - 'a'] = true;
        }else{
            cout << "no" << endl;
            return 0;
        }
    }
    cout << "yes" << endl;
}

Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
idx_dic = {}
XY = []
for i in range(N):
    x, y = mapint()
    x, y = x-1, y-1
    idx_dic[i] = y
    XY.append((x, y))
XY.sort()

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

uf = UnionFind(N)
from heapq import heappush, heappop
Q = []
for i in range(N):
    x, y = XY[i]
    mini = None
    while Q:
        v = heappop(Q)
        if v>y:
            heappush(Q, v)
            break
        uf.union(v, y)
        if mini is None:
            mini = v
    if mini is None:
        heappush(Q, y)
    else:
        heappush(Q, mini)
for i in range(N):
    print(uf.size(idx_dic[i]))


Measured memory_bytes: 126252
#include <iostream>
#include <cstdio>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    int n, q, key;
    int count = 0;
    vector<int> S;
    cin >> n;
    S.resize(n);
    for (int i = 0; i < n; ++i)
    {
        cin >> S[i];
    }
    scanf("%d", &q);
    for (int i = 0; i < q; ++i)
    {
        cin >> key;
        if (*lower_bound(S.begin(), S.end(), key) == key)
        {
            ++count;
        }
    }
    printf("%d\n", count);
}



Measured memory_bytes: 3224
import java.util.*;

//Swap Number
public class Main {
	public static void main(String args[])
	{
		String[] str = new String[2];
		int[][] output = new int[3000][2];
		Scanner sc = new Scanner(System.in);
		str = sc.nextLine().split(" ");
		int i = 0;
		while(Integer.parseInt(str[0]) != 0 || Integer.parseInt(str[1]) != 0 )
		{
			output[i][0] = Integer.parseInt(str[0]);
			output[i][1] = Integer.parseInt(str[1]);
			str = sc.nextLine().split(" ");
			i++;
		}
		int n = 0;
		for(n = 0;n<i;n++)
		{
			int temp = 0;
			if(output[n][0] > output[n][1])
			{
				temp = output[n][0];
				output[n][0] = output[n][1];
				output[n][1] = temp;
			}
			System.out.println(output[n][0] + " " + output[n][1]);
		}
		sc.close();
	}
}


Measured memory_bytes: 35776
#include<iostream>
#include<string>
using namespace std;
class stack {
public:
	int a[100], top;
	stack() {
		top = 0;
	}
	void push(int x) {
		a[++top] = x;
		return;
	}
	int pop() {
		return a[top--];
	}
};
int main() {
	stack Z;
	string s;
	int a, b;
	while (cin >> s) {
		if (s == "+") {
			a = Z.pop();
			b = Z.pop();
			Z.push(a + b);
		}
		else if (s == "-") {
			a = Z.pop();
			b = Z.pop();
			Z.push(b - a);
		}
		else if (s == "*") {
			a = Z.pop();
			b = Z.pop();
			Z.push(a*b);
		}
		else if (s == "/") {
			a = Z.pop();
			b = Z.pop();
			Z.push(b / a);
		}
		else {
			Z.push(stoi(s));
		}
	}
	cout << Z.pop() << endl;
	return 0;
}

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};


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

  ll n;
  cin >> n;
  string s;
  cin >> s;

  ll dp[n][n];
  REP(i, n){
    REP(j, n)
      dp[i][j] = 0;
  }

  ll ans = 0;
  for(ll i = n-1; i >= 0; i--){
    if(i == n-1){
      REP(j, n){
        if(s[i]==s[j])
          dp[i][j] = min(abs(i-j), 1LL);
        else
          dp[i][j] = 0;
        ans = max(ans, dp[i][j]);
      }
      continue;
    }

    REP(j, n-1){
      if(s[i]==s[j])
        dp[i][j] = min(abs(i-j), dp[i+1][j+1]+1);
      else
        dp[i][j] = 0;
      ans = max(ans, dp[i][j]);
    }

    if(s[i]==s[n-1])
      dp[i][n-1] = min(abs(i-n+1), 1LL);
    else
      dp[i][n-1] = 0;
    ans = max(ans, dp[i][n-1]);
  }


  cout << ans << endl;

}


Measured memory_bytes: 195584
#include <stdio.h>
int b, r, g, c, s, t;
int main() {
	while(~scanf("%d%d%d%d%d%d", &b, &r, &g, &c, &s, &t)) {
		if(!t) break;
		printf("%d\n", b*95 + r*63 + g*7 + c*2 + s*3 - t*3 + 100);
	}
	return 0;
}

Measured memory_bytes: 2548
#pragma region RegionDefs
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include "boost/multi_array.hpp"
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define reps(i,j,n) for(int i=(j),i##_len=(n);i<i##_len;++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define all(x) begin(x),end(x)
using namespace std;
template<class T=int> using P  = pair<T, T>;
template<class T=int> using V  = vector<T>;
template<class T=int> using PQ = priority_queue<T>;
template<class T=int> using PQG = priority_queue<T, V<T>, greater<T>>;
typedef long long ll;
const int INF = 1e9;
const ll MOD = 1000000007LL;
void in() {}
template<class Head, class... Tail>
void in(Head&& head, Tail&&... tail)
{
    cin >> head;
    in(move(tail)...);
}
#define IN(...) ll __VA_ARGS__; in(__VA_ARGS__)
//時間が厳しいとき使う
#define INI(...) int __VA_ARGS__; in(__VA_ARGS__)
#define INS(T, ...) T __VA_ARGS__; in(__VA_ARGS__)
#define VIN(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem
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 (a>b) {a=b; return 1;} return 0;}
#define y0 y__0
#define y1 y__1
#define j0 j__0
#define j1 j__1
#pragma endregion RegionDefs

void solve()
{
    IN(n, k);
    vector<ll> h(n);
    rep(i, n)
    {
        cin >> h[i];
    }
    sort(all(h), greater<ll>());
    ll s = 0;
    rep(i, n)
    {
        if (k > 0)
        {
            --k;
            continue;
        }
        s += h[i];
    }
    cout << s << endl;
}

int main()
{
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(numeric_limits<double>::max_digits10);

    solve();

    return 0;
}

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

using namespace std;
using ll = long long;
#define int ll
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define PB push_back

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')';
  return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
  out<<'[';
  REP(i, a.size()) {out<<a[i];if(i!=a.size()-1)out<<',';}
  out<<']';
  return out;
}

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

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

  VI v(3);
  REP(i, 3) cin >> v[i];
  sort(ALL(v));

  int a = v[2] - v[0], b = v[2] - v[1];
  if(a%2 == b%2) {
    cout << (a+b)/2 << endl;
  } else {
    cout << (a+b)/2 + 2 << endl;
  }

  return 0;
}


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

using namespace std;
using ll = long long;

int main() {
  ll n, m;
  scanf("%lld %lld", &n, &m);
  if (n == 1 && m == 1) {
    printf("1\n");
  } else if (n == 1 || m == 1) {
    printf("%lld\n", n * m - 2);
  } else {
    printf("%lld\n", n * m - (2*n + 2*m - 4));
  }
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int H, W, i, j;
	while(1)
	{
		scanf("%d %d", &H, &W);
		if(H==0||W==0)
		{
			break;
		}
		for(i=0; i<H; i++)
		{
			for(j=1; j<=W; j++)
			{
				if((i+2)%2==0)
				{
					if((j+1)%2==0)
					{
						printf("#");
					}
					else if((j+1)%2==1)
					{
						printf(".");
					}
				}
				else if((i+2)%2==1)
				{
					if((j+1)%2==0)
					{
						printf(".");
					}
					else if((j+1)%2==1)
					{
						printf("#");
					}
				}
			}
			printf("\n");
		}
		printf("\n");
	}
	
	return 0;
}


Measured memory_bytes: 2596
import copy
n = int(input())
r_L = list(map(int,input().split()))
l_L = copy.deepcopy(r_L)
l_L.reverse()


r_ans,l_ans = 0,0
r_ans_L,l_ans_L = [],[]

for val in range(n-1):
    if r_L[val] >= r_L[val+1]:
        r_ans += 1
    else:
        r_ans_L.append(r_ans)
        r_ans = 0
    



l_ans_L.append(l_ans)
r_ans_L.append(r_ans)

print(max(max(l_ans_L),max(r_ans_L)))


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

namespace AtCoder
{
	public class Program
	{
		// ABC103-C
		static void Main(string[] args)
		{
			int N = int.Parse(Console.ReadLine());
			long sum = 0;
			foreach (var s in Console.ReadLine().Split()) {
				sum += long.Parse(s) - 1;
			}
			Console.WriteLine(sum);
		}
	}
}


Measured memory_bytes: 11164
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>

#define _GLIBCXX_DEBAC
using namespace std;


int main() {
	int n;
	cin >> n;
	string s;
	cin >> s;
	bool a = true;
	for (int i = 0; i < (n / 2); i++) {
		if (s[i] != s[n / 2 + i]) {
			a = false;
			break;
		}
	}
	if (n % 2 != 0) { a = false; }
	if (a) { cout << "Yes"; }
	else {
		cout << "No";
	}
		return 0;
}









Measured memory_bytes: 256
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;
 
std::map<LL, LL> decomposit_prime(LL n)
{
	LL d = 2;
	std::map<LL, LL>res;
	while (d*d <= n)
	{
		if (n%d == 0)
		{
			++res[d];
			n /= d;
		}
		else ++d;
	}
	++res[n];
	return res;
}
 
int main()
{
	LL N;
	in >> N;
 
	std::map<LL, LL>primes;
	for (LL i = 1; i <= N; ++i)
	{
		auto res = decomposit_prime(i);
		for (auto j : res) primes[j.first] += j.second;
	}
 
	std::map<LL, LL>cnt;
	for (auto i : primes)
	{
		if (i.second >= 74) ++cnt[74];
		if (i.second >= 24) ++cnt[24];
		if (i.second >= 14) ++cnt[14];
		if (i.second >= 4) ++cnt[4];
		if (i.second >= 2) ++cnt[2];
	}
 
	LL ans = 0;
	ans += cnt[74];
	ans += cnt[24] * (cnt[2] - 1);
	ans += cnt[14] * (cnt[4] - 1);
	ans += (cnt[4] * (cnt[4] - 1)) / 2 * (cnt[2] - cnt[4]);
	ans += (cnt[4] * (cnt[4] - 1)) / 2 * (cnt[4] - 2);
 
	out << ans << std::endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,cnt[30];
string s;
long long ans=1,mod=(long long)1e9+7;
int main(){
    cin>>n;cin.ignore();
    s.resize(100001);
    scanf("%s",&s[1]);
    for(int i=1;i<=n;i++)
        cnt[s[i]-'a']++;
    for(int i=0;i<26;i++)
        ans=ans*(cnt[i]+1)%mod;
    cout<<ans-1<<endl;
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(n); i++)
int gcd(int a, int b){
    if (a<b) swap(a, b);
  	int c = a%b;
  	while (b>0){
      if (a%b == 0) return b;
      c = a%b;
      a = b;
      b = c;
    }
}
int main(){
    int a, b; cin >> a >> b;
    cout << gcd(a, b) << endl;
}


Measured memory_bytes: 3088
def printf(i):
  print(i,flush=True)
n=int(input())
printf(0)
ls=input()
if ls=='Vacant':
  exit()
l=0
r=n
while True:
  m=(l+r)//2
  printf(m)
  ch=input()
  if ch=='Vacant':
    exit()
  if ls==ch:
    if (m-l)%2:
      r=m
    else:
      l=m
  else:
    if (m-l)%2:
      l=m
      ls=ch
    else:
      r=m

Measured memory_bytes: 3660
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
 
int main() {
    int N, D;
    cin >> N >> D;

    int width, min;
    width = 2 * D + 1;
    min = N / width;
    if(N % width != 0){
        min += 1;
    }

    cout << min << endl;
    return 0;
}

Measured memory_bytes: 256
// ABC134E
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <utility>

using namespace std;

#define ll long long

bool cmp(const ll a, const ll b)
{
    return a > b;
}

void solve()
{
    char C;
    cin >> C;
    cout << ((char)(C + 1)) << endl;

    return;
}

int main()
{
    solve();
    return 0;
}


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

using namespace std;

#define ll long long
#define F first
#define S second
#define ii pair < int , int >


int main()
{
    string s;
    cin>>s;
    int n=s.size();
    for(int i=0;i<n;i++)
        cout<<'x';
}


Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    double r;
    cin >> r;
    cout << fixed << setprecision(5) << 2 * r * M_PI << "\n";
}


Measured memory_bytes: 3768
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define  all(x) (x).begin(),(x).end()
typedef long long ll;

int main(){
    int n, w;
    cin >> n >> w;
    vector<int> a(n), b(n);
    rep(i,n) cin >> a[i] >> b[i];
    vector<vector<int>> dp(n+1, vector<int>(w+1));
    for(int i = 0; i < n; i++){
        for(int j = 0; j <= w; j++){
            dp[i+1][j] = max(dp[i][j], dp[i+1][j]);
            if (j+b[i] <= w){
                dp[i+1][j+b[i]] = max(dp[i][j+b[i]], dp[i][j]+a[i]);
            }
        }
    }
    cout << dp[n][w] << endl;
}


Measured memory_bytes: 6824
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;



class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }
    

    Scanner cin;

    void calc()
    {
        cin = new Scanner();
        string S = cin.next();
        int ans = 0;
        foreach (var c in S)
        {
            ans += c - '0';
        }
        Console.WriteLine(ans);
    }




}



class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

Measured memory_bytes: 11092
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            list.add(Integer.parseInt(sc.next()));
        }
        for (int i = list.size() - 1; i > 0; i--) {
            if (list.get(i) - list.get(i - 1) < -1) {
                System.out.println("No");
                return;
            } else if (list.get(i) - list.get(i - 1) < 0) {
                list.set(i - 1, list.get(i - 1) - 1);
            }
        }
        System.out.println("Yes");
        sc.close();
    }
}

Measured memory_bytes: 47132
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
typedef pair<int,int> pa;
#define x first
#define y second
vector<pa> e;
int main(){
	int h,w,n;
	cin>>h>>w>>n;
	int i,x,y,ans=h;
	while(n--){
		scanf("%d%d",&x,&y);
		if(x>=y)e.pb({x,y});
	}
	sort(e.begin(),e.end());
	x=1,y=1;
	for(auto c:e){
		if(c.x-x>c.y-y){ans=c.x-1;break;}
		else if(c.x-x==c.y-y)x=c.x,y=c.y-1;
	}
	cout<<ans<<endl;
}

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

// Loops
#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 _rrep(i, n) rrepi(i, n, 0)
#define rrepi(i, a, b) for (int i = int(a) - 1; i >= int(b); --i)

#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(xi, x) for (auto &&xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)

// typedef
template <class T> using vec = vector<T>;
using ll = long long;
using vi = vec<ll>;
using vvi = vec<vi>;
using vvvi = vec<vvi>;
using pii = pair<ll, ll>;

// Constants

// Shorter repr for frequently used terms
#define pb push_back
#define mp make_pair

// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase(unique(all(v)), v.end())
#define perm(c)                                                                \
  sort(all(c));                                                                \
  for (bool c##p = 1; c##p; c##p = next_permutation(all(c)))

template <class T> pair<T, size_t> max(vector<T> &x) {
  auto it = max_element(all(x));
  return mp(*it, it - x.begin());
}
template <class T> pair<T, size_t> min(vector<T> &x) {
  auto it = min_element(all(x));
  return mp(*it, it - x.begin());
}

template <class T> inline bool chmax(T &maxval, const T &newval) {
  if (maxval < newval) {
    maxval = newval;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &minval, const T &newval) {
  if (minval > newval) {
    minval = newval;
    return 1;
  }
  return 0;
}

// Utilities
// Grid world utilities
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
#define inside(H, W, y, x) 0 <= (x) && (x) < (W) && 0 <= (y) && (y) < (H)

// Debug
#ifdef LOCAL
#include "dump.hpp"
#define debug(x) cerr << #x << ": " << x << '\n'
#else
#define dump(...)
#define debug(x)
#endif

// Paste snippets here!!

//

void solve(long long N, std::vector<std::string> S) {
  unordered_map<string, int> hist;
  rep(i,N){
    hist[S[i]]++;
  }
  vector<pair<int,string>> a; a.reserve(hist.size());
  for(auto kv : hist){
    a.emplace_back(-kv.second, kv.first);
  }
  sort(all(a));
  int m = a[0].first;
  int i=0;
  while(a[i].first==m){
    cout << a[i++].second << endl;
  }
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false); // Magic for faster cin
  cout.precision(12);
  long long N;
  std::cin >> N;
  std::vector<std::string> S(N);
  for (int i = 0; i < N; i++) {
    std::cin >> S[i];
  }
  solve(N, std::move(S));
  return 0;
}


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

const int N = 200010;
const int moder = 1e9 + 7;
inline int lowbit(int n){return n & -n;}
typedef std::pair <int, int> pii;

int inv[N], a[N], cnt[N];
pii c[N], suf[N];
std::vector <int> vec[N];

void addmod(int &a, int b){
    a += b;
    a -= a >= moder ? moder : 0;
}

void submod(int &a, int b){
    a -= b;
    a += a < 0 ? moder : 0;
}

void multmod(int &a, int b, int c){
    a = (a + 1ll * b * c) % moder;
}

int powermod(int a, int exp){
    int ret = 1;
    for ( ; exp > 0; exp >>= 1){
        if (exp & 1) ret = 1ll * ret * a % moder;
        a = 1ll * a * a % moder;
    }
    return ret;
}

void addmod(pii &a, pii b){
    if (a.second > b.second){
        a = b;
    }
    else if (a.second == b.second){
        addmod(a.first, b.first);
    }
}

void add(int sit, pii value){
    for ( ; sit < N; sit += lowbit(sit)){
        addmod(c[sit], value);
    }
}

pii query(int sit){
    pii ret = {0, INT_MAX};
    for ( ; sit; sit -= lowbit(sit)){
        addmod(ret, c[sit]);
    }
    return ret;
}

int c1[N];

void add1(int sit, int value){
    for ( ; sit < N; sit += lowbit(sit)){
        c1[sit] += value;
    }
}

int query1(int sit){
    int ret = 0;
    for ( ; sit; sit -= lowbit(sit)){
        ret += c1[sit];
    }
    return ret;
}

int main(){
    inv[0] = 0, inv[1] = 1;
    for (int i = 2; i < N; ++ i){
        inv[i] = (moder - 1ll * (moder / i) * inv[moder % i] % moder) % moder;
    }
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++ i){
        scanf("%d", &a[i]);
        ++ cnt[a[i]];
        vec[a[i]].push_back(i);
    }
    for (int i = n - 1; i >= 1; -- i){
        cnt[i] += cnt[i + 1];
    }
    int total = 1;
    for (int i = 1; i <= n; ++ i){
        cnt[i] -= n - i;
        if (cnt[i] <= 0){
            puts("0");
            return 0;
        }
        total = 1ll * total * cnt[i] % moder;
    }
    suf[n + 1] = {1, 0};
    for (int i = n; i >= 1; -- i){
        suf[i] = suf[i + 1];
        if (cnt[i] == 1){
            ++ suf[i].second;
        }
        else{
            suf[i].first = 1ll * suf[i].first * (cnt[i] - 1) % moder * inv[cnt[i]] % moder;
        }
    }
    for (int i = 1; i < N; ++ i){
        c[i] = {0, INT_MAX};
    }
    int ans = 0;
    for (int i = 1; i <= n; ++ i){
        for (auto u : vec[i]){
            int num = query1(n) - query1(u), sum = 0;
            multmod(sum, num, total);
            pii p1 = query(u - 1), p2 = query(n);
            addmod(p1, p1);
            p2.first = p2.first ? moder - p2.first : 0;
            addmod(p1, p2);
            if (p1.second == suf[i + 1].second){
                multmod(sum, 1ll * p1.first * powermod(suf[i + 1].first, moder- 2) % moder * inv[2] % moder, total);
            }
            addmod(ans, sum);
        }
        for (auto u : vec[i]){
            add1(u, 1);
            add(u, suf[i + 1]);
        }
        multmod(ans, 1ll * vec[i].size() * (vec[i].size() - 1) % moder * inv[4] % moder, total);
    }
    printf("%d\n", ans);
    return 0;
}

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

#define EB emplace_back
#define int long long
#define F first
#define S second
#define N 100005
#define ALL(x) x.begin(),x.end()
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)


using namespace std;


int32_t main()
{
    IOS;

    int tt=1;
    //cin>>tt;
    while(tt--)
    {
        int a,b,t; cin>>a>>b>>t;
        int sum = 0;
        int cnt = 1;
        for (int i = 0; i <= t; i++)
		{
			if(i >= cnt * a)
				{
			//		cout<<i<<endl;
					sum += b;
					cnt++;
				}
		}
		cout<<sum;


		
		cout<<endl;
    }
    return 0;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int x,sol=INT_MAX;
void solve(vector<vector<int> > &v, int n, int m, vector<int> &ans, int amt){
	if (n==0){
		for (int i=0;i<m;i++)
			if(ans[i]<x)
				return;
		sol=min(sol,amt);
		return;
	}
	solve(v,n-1,m,ans,amt);
	for (int i=1;i<=m;i++)
		ans[i-1]+=v[n-1][i];
	amt+=v[n-1][0];
	solve(v,n-1,m,ans,amt);
	for (int i=1;i<=m;i++)
		ans[i-1]-=v[n-1][i];
	amt-=v[n-1][0];
}
int main(){
	int n,m,amt=0;
	cin>>n>>m>>x;
	vector<int> v1, ans(m,0);
	vector< vector<int> > v(n,v1);
	for (int i=0;i<n;i++)
		for (int j=0;j<=m;j++){
			int val;
			cin>>val;
			v[i].push_back(val);
		}
	solve(v,n,m,ans,amt);
	if (sol==INT_MAX)
		cout<<-1;
	else
		cout<<sol;
}

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

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

using namespace std;

int main(){
  int a,b;
  cin>>a>>b;
  
  if((a%2==0) || (b%2==0)){
    cout<<"No";
  }else{
    cout<<"Yes";
  }
  return 0;
}

Measured memory_bytes: 256
num=int(input())
rem=[]
while(num):
    if num%26>0:
        rem.append(num%26)
    else:
        rem.append(26)
        num-=1
        
    num=num//26
    if num >=1 and num <=26:
        print(chr(96+num),end="")
        break
  
for i in range(len(rem)-1,-1,-1):
  print(chr(96+rem[i]),end="")

Measured memory_bytes: 9188