akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acosl(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memset(x,-1,sizeof(x))
#define MEM(x) memset(x,0,sizeof(x))
#define EPS 1e-4
#define arg ARG
#define cpdd const pdd
#define rank Rank
#define MAXN 205
//#define N 262144
#define ULL unsigned long long
#define ll long long
int cnt[100005];
int main(){
    int n;
    scanf("%d",&n);
    int tot=0;
    int a[200005];
    for(int i = 0;i<n;i++){
        scanf("%d",&a[i]);
        tot^=a[i];
    }
    for(int i = 0;i<n;i++){
        printf("%d ",tot^a[i]);
    }
    printf("\n");

}

Measured memory_bytes: 4548
S=list(input())
sw = 0
if S[0] != "A":
    print("WA")
    sw = 1
elif S[2:-1].count("C") != 1:
    print("WA")
    sw = 1
else:
    A = set(S) - set(["A","C"])
    for i in A:
        if i.isupper():
            print("WA")
            sw = 1
            break
if not sw:
    print("AC")


Measured memory_bytes: 3060
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var R = Sarray()[0];
            if (R < 1200)
                WriteLine("ABC");
            else if (R < 2800)
                WriteLine("ARC");
            else
                WriteLine("AGC");
        }

        static long Mod = (long)1e9 + 7;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

Measured memory_bytes: 27876
#include<bits/stdc++.h>
using namespace std;
typedef long long int uli;
const int mx=1e5+10;
uli h[mx];
vector<pair<int,uli> >g[mx];
void dfs(int u,int pu){
  for(auto e:g[u])if(e.first!=pu){
    h[e.first]=h[u]+e.second;
    dfs(e.first,u);
  }
}
int main(){
  int n;
  scanf("%d",&n);
  for(int i=0;i<n-1;i++){
    int u,v;
    uli c;
    scanf("%d %d %lld",&u,&v,&c);
    g[--u].push_back({--v,c});
    g[v].push_back({u,c});
  }
  int q,k;
  scanf("%d %d",&q,&k);
  --k;
  dfs(k,k);
  while(q--){
    int u,v;
    scanf("%d %d",&u,&v);
    --u,--v;
    printf("%lld\n",h[u]+h[v]);
  }
  return 0;
}


Measured memory_bytes: 14336
#include<algorithm>
#include <iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<string>
using namespace std;
int main(){
    
    int n;
    cin>>n;
    
    int f[9];
    for(int i=0;i<9;i++){
        f[i]=0;
    }
    
    
    for(int i=0;i<9;i++){
        int x=pow(10,i+1);
        int y=pow(10,i);
        f[i]=(n%x)/y;
    }
    int sum=0;
    for(int i=0;i<9;i++){
        sum+=f[i];
    }
    
    if(n%sum==0){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    
    return 0;
}








Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main()
{
	char alphabet[26] = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };
	int n_alphabet[26] = { 0 };
	string s;

	while (true) {
		getline(cin, s);
		if (s.empty())break;
		for (int i = 0; i < s.size(); i++) {
			for (int j = 0; j < 26; j++) {
				if (s[i] == alphabet[j] || tolower(s[i]) == alphabet[j]) {
					n_alphabet[alphabet[j] - 'a'] += 1;
					break;
				}
			}
		}
	}

	//output
	for (int i = 0; i < 26; i++) {
		cout << alphabet[i] << " : " << n_alphabet[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 1184
import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static int a = sc.nextInt();
    static int b = sc.nextInt();
    static int c = sc.nextInt();
    public static void main(String[] args) {
        int count = 0;
        for (int i = a; i <= b; i++){
            if (c % i == 0)
                count++;
        }
        System.out.println(count);
    }
}



Measured memory_bytes: 26412
q = list()
for _ in range(int(input())):
  x,l = map(int, input().split())
  q.append((x-l,x+l))
q.sort(key=lambda x:x[1])
cur = -10**10
cnt = 0
for s,t in q:
  if cur <= s:
    cnt += 1
    cur = t
print(cnt)
  

Measured memory_bytes: 18272
//
//  main.cpp
//  ABC158A
#include <iostream>
#include<string>
using namespace std;
int main(int argc, const char * argv[]) {
    string S;
    cin>>S;
    char TMP=S.at(0);
    if (S.at(1)!=TMP||S.at(2)!=TMP) {
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}


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

int main() {
    int n;
    while (cin >> n, n) {
        int pm, pe, pj;
        while (n--) {
            cin >> pm >> pe >> pj;
            if (pm == 100 || pe == 100 || pj == 100 ||
                (pm + pe) >= 180 || (pm + pe + pj) >= 240) {
                cout << "A";
            }
            else if (pm + pe + pj >= 210 ||
                     (pm + pe + pj >= 150 && (pm >= 80 || pe >= 80))) {
                cout << "B";
            }
            else {
                cout << "C";
            }
            cout << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 1156
#![allow(non_snake_case)]

#[allow(unused_macros)]
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, 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!{
        N: u32,
        a: [u32; N],
    }
    let mut a = a;
    let mut alice = 0;
    let mut bob = 0;
    a.sort();
    while !a.is_empty() {
        alice += a.pop().unwrap_or(0);
        bob += a.pop().unwrap_or(0);
    }
    println!("{}", alice - bob);
}


Measured memory_bytes: 4352
#include"stdio.h"
int main()
{
    int i,j,k;
    int a[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    scanf("%d",&i);
    printf("%d",a[i-1]);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")

    /*
    ||||||||||||||||||||||||||||||||||||||||||||||||
       |      |||         |      ||||    ||||  |   |
      | |     |   |      | |     |   |  |      |   |
     |   |    |    |    |   |    |   |  |      |   |
    |||||||   |    |   |||||||   |||     |||   |||||
    |     |   |   |    |     |   | |        |  |   |
    |     |   |||      |     |   |  ||  ||||   |   |
    ||||||||||||||||||||||||||||||||||||||||||||||||

    */
    using namespace std;
    //#include "testlib.h"
    #define ff first
    #define ss second
    #define mp make_pair
    #define all(v) v.begin(),v.end()
    #define int long long
    #define ll long long
    #define M 1000000007
    #define inputarr(a,n) for(int i=0;i<n;++i) cin>>a[i]
    #define GCD(m,n) __gcd(m,n)
    #define LCM(m,n) m*(n/GCD(m,n))
    #define mii  map<ll ,ll >
    #define msi  map<string,ll >
    #define mis  map<ll int, string>
    #define rep(a,b)    for(ll i=a;i<b;i++)
    #define rep0(n)    for(ll i=0;i<n;i++)
    #define repi(i,a,b) for(ll i=a;i<b;i++)
    #define pb push_back
    #define vi vector<ll>
    #define mp make_pair
    #define vs vector<string>
    #define ppb pop_back
    #define endl '\n'
    #define asdf ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    #define r0 return 0;
    #define FORD(i, a, b) for (int i = (int) (a); i >= (int) (b); --i)
    #define FORE(it, c) for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
    #define inputoutput freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
    #define input freopen("input.txt", "r", stdin);
    #define Set(a, s) 4(a, s, sizeof (a))
    #define FOR repi
    #define pii pair<int,int>
    #define REVERSE(v) reverse(ALL(v))
    #define display(x) trav(a,x) cout<<a<<" ";cout<<endl
    #define debug cerr<<"bhau"<<endl
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        std::cerr << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
    ll max(ll a, ll b) { return (a > b)? a : b;}
    int min(int a, int b) { return (a < b)? a : b;}
    void amax(int &a,int b){a=max(a,b)%M; }
    void amin(int &a,int b){ a=min(a,b)%M;}
    void inc(int &a,int b){a=(a+b)%M;}
    void dec(int &a,int b){a=(a-b+M)%M;}


    
     int solve()
     {  
        int n;cin>>n;
        int ans=n*(n-1)/2;
        cout<<ans;

        r0   
     }
    signed main()
    {   
        asdf
        
        int t=1;
        //cin>>t;
        while(t--)
        {
            solve();
        }     
        
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ft(i,l,r) for(register int i=l;i<=r;i++)
#define fd(i,r,l) for(register int i=r;i>=l;i--)
using namespace std;
int n,m,a[2333],s,ans;
int main()
{
    cin>>n>>m;
    ft(i,1,n)
    {
    	scanf("%d",&a[i]);
    	s+=a[i];
	}
	ft(i,1,n)
	  if(a[i]*4*m>=s) ans++;
	if(ans>=m) cout<<"Yes";
	else cout<<"No";
    return 0;
}

Measured memory_bytes: 256
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N,W = map(int,readline().split())
WV = [list(map(int,readline().split())) for _ in range(N)]

dp = np.zeros(W+1,np.int64)
for w,v in WV:
  np.maximum(dp[w:],dp[:-w].copy() +v,out=dp[w:])
print(dp.max())

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

int main(){
    int q;
    cin >> q;
    vector<int> a;
    for(int i=0; i<q; i++){
        int x;
        cin >> x;
        if(x == 2){
            a.pop_back();
        }else{
            int y;
            cin >> y;
            if(x == 0){
                a.push_back(y);
            }else{
                cout << a[y] << endl;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3908
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
dp=[0]*(n+1)
for i in range(m):
    dp[n-a[i]]=-1
if dp[1]==0:
    dp[1]=1
else:
    dp[1]=0
if n>1:
    if dp[2]==0:
        dp[2]=dp[1]+1
    else:
        dp[2]=0
if n>=3:
    for i in range(3,n+1):
        if dp[i]==0:
            dp[i]=dp[i-1]+dp[i-2]
        else:
            dp[i]=0
print(dp[n]%1000000007)

Measured memory_bytes: 460020
using System;

class Program{
    public static void Main(){
        var n=int.Parse(Console.ReadLine());
        var s=Console.ReadLine().Split(' ');
        var S=new int[n];
        for(var i=0; i<n; i++){
            S[i]=int.Parse(s[i]);
        }
        Console.ReadLine();
        s=Console.ReadLine().Split(' ');

        var cnt=0;
        foreach(var c in s){
            var t=int.Parse(c);
            foreach(var a in S){
                if(a==t){
                    cnt++;
                    break;
                }
            }
        }

        Console.WriteLine(cnt);
    }
}

Measured memory_bytes: 9736
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        String[] line = bufferedReader.readLine().split(" ");
        BigInteger A = new BigInteger(line[0]);
        String[] s = line[1].split("\\.");
        BigInteger B;
        if (s[0].equals("0")) {
            if (s[1].startsWith("0")) {
                B = new BigInteger(s[1].substring(1));
            } else {
                B = new BigInteger(s[1]);
            }
        } else {
            B = new BigInteger(s[0] + s[1]);
        }
        BigInteger lim = new BigInteger("100");
        BigInteger res = A.multiply(B);
        if (res.compareTo(lim) < 0) {
            System.out.println("0");
        } else {
            String r = res.toString();
            System.out.println(r.substring(0, r.length() - 2));
        }
    }
}


Measured memory_bytes: 37600
#include <iostream>

using namespace std;

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

    else
        cout << "consonant";

    return 0;
}


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

#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

typedef pair<int, int> pint;

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front

#define MOD (1000 * 1000 * 1000 + 7)

signed main() {
    ll N, K;
    cin >> N >> K;

    if (K == 0) {
        cout << N * N << endl;
        return 0;
    }

    ll sum = 0;

    REPS(b, N) {
        if (b <= K) continue;

        ll add = 0LL;
        ll mod = (N+1) % b;
        add += (N+1) / b * (b - K);
        sum += max(0LL, mod - K);

        sum += add;
        // cout << b << ", " << add << endl;
    }

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();

		String[] ana = new String[3];
		ana = line.split(" ");
		int jal[] = new int[3];
		int t = 0;
		for (int i = 0; i < ana.length; i++)
			jal[i] = Integer.parseInt(ana[i]);
		t=jal[0]*100+jal[1]*10+jal[2];
		if(t%4==0)
			System.out.println("YES");
		else
			System.out.println("NO");
	}
}

Measured memory_bytes: 21332
#include <bits/stdc++.h>
#define ll    long long int
#define ld    long double
#define pb    push_back
#define mp    make_pair
#define Maxn  1000007
#define ff    first
#define se    second
using namespace std;
 
int main(){
    ll n,i,cnt=0;
    cin>>n;
    ll a[n],b[n];
    for(i=0;i<n;i++){
        cin>>a[i];
        b[i]=a[i];
    }
    sort(b,b+n);
    for(i=0;i<n;i++){
        if(a[i]!=b[i]){
            cnt++;
        }
    }
    if(cnt<=2){
        cout<<"YES";
    }
    else{
        cout<<"NO";
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iomanip>
#include <vector>
#include <cstdio>
#include <float.h>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <stack>
#include <functional>
 
using namespace std;
 
#define endl '\n'
#define MOD 1000000007
#define INF 1ll<<30
#define MAX 100010
#define eps 1e-11
#define bit_max 1ll<<32
#define _USE_MATH_DEFINES

long double dp[4000][4000];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  //  freopen("input.txt","r",stdin);
 //   freopen("output.txt","w",stdout);
    int a,b,c;
    cin>>a>>b>>c;
    cout<<min(b/a,c);
}

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextInt();
        }
        int ans = 0;
        int now = 1;
        for(int i = 0; i < n; i++){
            if(a[i] == now){
                now++;
            }else{
                ans++;
            }
        }
        if(ans == n){
            System.out.println(-1);
        }else{
            System.out.println(ans);
        }
    }
}



Measured memory_bytes: 64888
#include <bits/stdc++.h>
using namespace std;
#define M_PI 3.14159265358979323846
#define MOD 1000000007
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int, int> ipair;
typedef pair<ll, ll> llpair;

template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }

#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
    
/*
    Author: Koushik Sahu
    Created: 18 Sep 2020 09:49:07
*/

int x;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    cin>>x;
    cout<<(!x)<<"\n";
    return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using Edge = pair<int, ll>;
using Graph = vector<vector<int>>;
using WeightedGraph = vector<vector<Edge>>;
const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

const int CASES = 3;

ll N, K;
vector<ll> a, b, c;

bool check(ll mb){
    ll an = a.size();
    ll bn = b.size();
    ll cn = c.size();
    ll total = 0LL;
    if(mb <= 0){
        for (int i = 0; i < an; ++i) {
            ll tmp = mb / a[i];
            ll idx = lower_bound(b.begin(), b.end(), tmp) - b.begin();
            total += idx;
        }
    }
    else{
        for (ll i = 0; i < an; ++i) {
            ll tmp = (mb+a[i]-1LL) / a[i];
            ll idx = lower_bound(a.begin(), a.end(), tmp) - a.begin();
            idx = max(0LL, idx -1LL - i);
            total += idx;
        }
        ll SUM = bn * (bn-1)/2LL;
        for (ll i = 0; i < bn; ++i) {
            ll tmp = (mb-b[i]-1LL) / b[i];
            int idx = upper_bound(b.begin(), b.end(), tmp) - b.begin();
            if(idx < i) SUM -= idx;
            else SUM -= i;
        }
        total += SUM;
        total += an * bn;
        total += cn * (cn-1LL) / 2LL + cn * an + cn * bn;
    }
    //cout << mb << " " << total << endl;
    if(total < K){
        return false;
    }
    return true;
}


void solve() {
    cin >> N >> K;
    a.clear();
    b.clear();
    c.clear();

    for(int i = 0; i < N; ++i){
        ll tmp; cin >> tmp;
        if(tmp > 0LL) a.push_back(tmp);
        else if(tmp == 0LL) c.push_back(tmp);
        else b.push_back(tmp);
    }

    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    ll lb = -INF64, ub = INF64;
    while(ub - lb > 1LL){
        ll mb = (lb + ub) / 2LL;
        if(check(mb)){
            ub = mb;
        }else{
            lb = mb;
        }
    }
    cout << lb << endl;
}

int main() {
#ifdef MYLOCAL
    vector<string> filenames {"input1.txt", "input2.txt", "input3.txt", "input4.txt", "input5.txt"};
    cout << "------------\n";
    for(int i = 0; i < CASES; ++i){
        ifstream in(filenames[i]);
        cin.rdbuf(in.rdbuf());
        solve();
        cout << "------------\n";
    }
#else

    solve();

#endif
    return 0;
}


Measured memory_bytes: 2548
#include <bits/stdc++.h>
#define fast_read ios::sync_with_stdio(0);cin.tie(0);
#define ll long long
using namespace std;
ll f(ll n) {
    ll ret = 0;
    while (n != 0) {
        ret += n % 10;
        n /= 10;
    }
    return ret;
}
int main()
{
    fast_read;
    ll n;
    cin>>n;
    if (n % f(n) == 0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
            if(b >= 1 && b <=100 && a>=1 &&a<=100){
                System.out.println((a*b) + " " + 2*(a+b));
            } else{
                System.out.println("The integer a,b should be from 1 to 100.");
            }
    }
}


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

using namespace std;
using ll = long long int;

int main(void) {
    constexpr ll MOD = 1e9 + 7;
    cout << fixed << setprecision(16);

    priority_queue<ll> p;
    priority_queue<ll,vector<ll>,greater<>> q;
    ll ps = 0, qs = 0;

    ll Q;
    cin >> Q;

    ll s = 0;
    while(Q--) {
        ll t;
        cin >> t;
        if(t == 1) {
            ll a, b;
            cin >> a >> b;
            s += b;

            if(p.size() > 0 && p.top() <= a)
                q.push(a), qs+=a;
            else
                p.push(a), ps+=a;

            while(p.size() > q.size()) {
                auto t = p.top(); p.pop();
                ps -= t;
                q.push(t);
                qs += t;
            }
            while(p.size() < q.size()) {
                auto t = q.top(); q.pop();
                qs -= t;
                p.push(t);
                ps += t;
            }
            // p.size >= q.size
        } else {
            auto x = p.top();
            auto y = ((ll)p.size()*x-ps) + (qs - (ll)q.size()*x) + s;
            cout << x << ' ' << y << endl;
        }
    }
}


Measured memory_bytes: 3828
from collections import deque

N = int(input())
if N == 1:
  print('a')
  exit()

h = deque(['a'])

while h:
  s = h.pop()
  if len(s) == N:
    print(s)
  else:
    a = set([])
    for i in s:
      a.add(i)
    for i in range(len(a),-1,-1):
      h.append(s+chr(ord('a')+i))

Measured memory_bytes: 75712
import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n, x;
        n = sc.nextInt();
        x = sc.nextInt();

        ArrayList<Integer> l_list = new ArrayList<Integer>();
        for(int i=0; i<n; i++)
        {
            l_list.add(sc.nextInt());
        }

        ArrayList<Integer> jump = new ArrayList<Integer>();
        jump.add(0);
        for(int i = 1; i<n+1; i++)
        {  
            jump.add(jump.get(i-1)+l_list.get(i-1));
        }

        int count = 0;
        for(int i = 0; i<n+1; i++)
        {
            if(jump.get(i)<=x){
                count++;
            }
            else{
                break;
            }
            
        }
        System.out.println(count); 
    }
}

Measured memory_bytes: 23764
import java.io.*;
import java.util.*;


public class Main {
    public static void main (String[]args)throws IOException {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int a[] = new int[n];
        int totalVotes=0;
        for (int i=0;i<n;i++){
            int helper=scanner.nextInt();
            a[i]=helper;
            totalVotes+=helper;
        }
        int numItems=0;
        for (int i=0;i<n;i++){
            float helper=((float)totalVotes*(float)(1/(4*(float)m)));
            if (a[i]>=helper){
                numItems++;
            }
        }
        System.out.println(numItems>=m? "Yes":"No");
    }
}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
using namespace std;
typedef long long ll;
typedef pair<int, int> P; 
const int inf = 1<<21;
const ll INF = 1LL << 60;
const ll mod = 1e9+7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

// DAME: 
ll power(ll x, ll n, ll M){
    ll res = 1;
    if(n>0){
        res = power(x, n/2, M);
        if(n%2==0) res = (res*res)%M;
        else res = (((res*res)%M)*x)%M;
    }
    return res;
}

const ll MAX = 4000000;
ll fac[MAX], finv[MAX], inv[MAX];
void cominit(){
    fac[0] = fac[1] = 1LL;
    finv[0] = finv[1] = 1LL;
    inv[1] = 1LL;

    for(int i=2; i<MAX; i++){
        fac[i] = fac[i-1]*i%mod;
        inv[i] = mod - inv[mod%i]*(mod/i)%mod;
        finv[i] = finv[i-1]*inv[i]%mod;
    }
}

ll com(ll n, ll k){
    if (n<k) return 0LL;
    if (n<0 or k<0) return 0LL;
    return fac[n] * (finv[k]*finv[n-k]%mod)%mod;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cominit();
    ll k;
    string s;
    cin >> k;
    cin >> s;
    ll n = s.size();
    ll ans = 0;

    for(ll i=n; i<=n+k; i++){
        ll aa = power(26LL, n+k-i, mod)*power(25LL, i-n, mod)%mod;
        aa = aa*com(i-1, n-1)%mod;
        ans = (ans + aa)%mod;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 97980
import math

def myinput_int():
    return list(map(int, input().split()))
def myinput_int_special():
    text = '99 '+input() #インデックスが1から始まるように。99はダミー。
    return list(map(int, text.split()))

N, = myinput_int()
a = myinput_int_special()
answer=[-99]*(N+1)

for i in range(N,0,-1):
    goukei=0
    for j in range(2,math.floor(N/i)+1):
        goukei += answer[i*j]
    answer[i] = (goukei+a[i])%2

output=""
count=0
for i in range(1,N+1):
    if answer[i]==1:
        output+=' '+str(i)
        count+=1

output=output[1:] #先頭のスペースを除去。
print(count)
if output!="":
    print(output)


Measured memory_bytes: 9140
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	ans := 0
	for i := a; i <= b; i++ {
		arr := intToArray(i)
		if arr[0] == arr[4] && arr[1] == arr[3] {
			ans++
		}
	}
	fmt.Println(ans)
}

func intToArray(num int) []int {
	arr := make([]int, 5)
	for i := 0; i < 5; i++ {
		arr[i] = num%10
		num /= 10
	}
	return arr
}


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

void fastscan(int &number)
{
	bool negative = false;
	register int c;

	number = 0;
	c = getchar();
	if (c=='-')
	{
		negative = true;
		c = getchar();
	}

	for (; (c>47 && c<58); c=getchar())
		number = number *10 + c - 48;

	if (negative)
		number *= -1;
}

int main(){
    int n,m;
    fastscan(n);fastscan(m);
    if(n<=1){
        n = 0;
    }else{
        n = (n * (n-1))/2;
    }
    if(m<=1){
        m = 0;
    }else{
        m = (m * (m-1))/2;
    }
    cout << n+m << "\n";
    return 0;
}

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

int main(){

        int N;
        int i,j;

        cin >> N;

        for(i=0;i<=14;i++){
                for(j=0;j<=25;j++){
                        if((7*i+4*j)==N){
                                cout << "Yes";
                                return 0;
                        }
                }
        }

        cout << "No";


        return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>

using namespace std;

#define debug(x) cout << #x << "==" << x << endl;
#define INF INT_MAX
typedef long long ll;


int main() {
  ios::sync_with_stdio(false);

  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;

  // 上からいく
  int x = sx, y = sy;
  while( y < ty  ) {
    cout << "U";
    y++;
  }
  while( x < tx  ) {
    cout << "R";
    x++;
  }

  // 下から戻る
  while( sy < y  ) {
    cout << "D";
    y--;
  }
  while( sx < x  ) {
    cout << "L";
    x--;
  }


  // 一個左に
  cout << "L";
  x--;

  // 上から ( tx, ty+1 ) まで
  while( y < ty+1  ) {
    cout << "U";
    y++;
  }
  while( x < tx  ) {
    cout << "R";
    x++;
  }


  // 一個下に
  cout << "D";
  y--;

  // 一個右に
  cout << "R";
  x++;

  // 下から ( sx, sy-1 ) まで
  while( sy-1 < y  ) {
    cout << "D";
    y--;
  }
  while( sx < x  ) {
    cout << "L";
    x--;
  }

  // 一個上に
  cout << "U";

  return 0;
}


Measured memory_bytes: 384
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Threading.Tasks;

namespace Structured_Programming
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            //Console.Write(" ");
            for (int i = 3; i <= n; ++i)
            {
                if (i % 3 == 0 || is_3(i))
                {
                    Console.Write(" {0}", i);
                }
            }
            Console.WriteLine();
        }
        static bool is_3(int n)
        {
            String str = n.ToString();
            if (str.IndexOf("3") >= 0) return true;
            else return false;
        }
    }
}


Measured memory_bytes: 9964
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		char[] s = sc.next().toCharArray();
		int Q = sc.nextInt();
		TreeSet<Integer>[] t = new TreeSet[26];
		for(int i = 0; i < 26; i++)
			t[i] = new TreeSet<Integer>();
		for(int i = 0; i < N; i++)
			t[s[i]-'a'].add(i);
		for(int i = 0; i < Q; i++){
			if(sc.nextInt() == 1) {
				int q = sc.nextInt()-1;
				char c = sc.next().charAt(0);
				t[s[q]-'a'].remove(q);
				t[c-'a'].add(q);
				s[q] = c;
			}
			else {
				int ans = 0;			
				int l =  sc.nextInt()-1, r = sc.nextInt()-1;
				for(char j = 0; j < 26; j++)
						if(t[j].ceiling(l) != null && t[j].ceiling(l) <= r)
							ans++;
				System.out.println(ans);
			}
		}

	}

}

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

int main(){
  int N,T,c,t;
  cin >> N >> T;
  int minc=1001;
  int minn=N;
  for (int i=0;i<N;i++){
    cin >> c >> t;
    if (t<=T and c<minc){
      minc=c;
      minn=i;
    }
  }
  if (minn==N){
    cout << "TLE" << endl;
  }
  else{
    cout << minc << endl;
  }
}


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

red = [list(map(int, input().split(' '))) for _ in range(N)]
blue = [list(map(int, input().split(' '))) for _ in range(N)]

red.sort(key=lambda x: x[1], reverse=True)
blue.sort(key=lambda x: x[0])

ans = 0

for b in blue:
    for r in red:
        if r[1] < b[1] and r[0] < b[0]:
            ans += 1
            red.remove(r)
            break
print(ans)

Measured memory_bytes: 3064
/*
    Author: Nguyen Tan Bao
    Status:
    Idea:
*/

#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, int> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

const ll MODBASE = 1000000007LL;
const int MAXN = 5010;
const int MAXM = 210;
const int MAXK = 16;
const int MAXQ = 200010;

int n, m, a[MAXN], b[MAXN][MAXM], Max[MAXM], nxt[MAXN][MAXM];
ll ini[MAXN], t[MAXN*8], lazy[MAXN*8];

void build(int k, int l, int r) {
    if (l > r) return;
    if (l == r) {
        t[k] = ini[l];
        return;
    }
    int m = (l + r) >> 1;
    build(k*2, l, m);
    build(k*2+1, m+1, r);
    t[k] = max(t[k*2], t[k*2+1]);
}

void lazyUpdate(int k, int l, int r) {
    if (l > r) return;
    if (lazy[k] == 0) return;
    t[k] += lazy[k];
    if (l < r) {
        lazy[k*2] += lazy[k];
        lazy[k*2+1] += lazy[k];
    }
    lazy[k] = 0;
}

ll get(int k, int l, int r, int u, int v) {
    lazyUpdate(k, l, r);
    if (l > r || r < u || v < l) return -1e18;
    if (u <= l && r <= v) return t[k];
    int m = (l + r) >> 1;
    return max(get(k*2, l, m, u, v), get(k*2+1, m+1, r, u, v));
}

void update(int k, int l, int r, int u, int v, int val) {
    lazyUpdate(k, l, r);
    if (l > r || r < u || v < l) return;
    if (u <= l && r <= v) {
        lazy[k] += val;
        lazyUpdate(k, l, r);
        return;
    }
    int m = (l + r) >> 1;
    update(k*2, l, m, u, v, val);
    update(k*2+1, m+1, r, u, v, val);
    t[k] = max(t[k*2], t[k*2+1]);
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> n >> m;
    FOR(i,2,n) cin >> a[i];
    FOR(i,1,n) FOR(j,1,m) cin >> b[i][j];

    ll sub = 0;
    FOR(i,1,n) {
        if (i > 1) sub += a[i];
        FOR(j,1,m) {
            Max[j] = max(Max[j], b[i][j]);
            ini[i] += Max[j];
        }
        ini[i] -= sub;
    }
    build(1,1,n);
    FORE(i,n,1) {
        FOR(j,1,m) {
            nxt[i][j] = i+1;
            while (nxt[i][j] <= n && b[nxt[i][j]][j] < b[i][j]) nxt[i][j] = nxt[nxt[i][j]][j];
        }
    }

    ll res = 0;
    sub = 0;
    FOR(i,1,n) {
        if (i > 1) sub += a[i];
        res = max(res, get(1,1,n,i,n) + sub);
        FOR(j,1,m) {
            update(1,1,n,i,nxt[i][j]-1,-b[i][j]);
            int I = i+1;
            while (I <= n && b[I][j] < b[i][j]) {
                update(1,1,n,I,nxt[I][j]-1,b[I][j]);
                I = nxt[I][j];
            }
        }
    }
    cout << res;
    return 0;
}


Measured memory_bytes: 12172
#include <stdio.h>

int main() {
	int a, b, k, n;

	scanf("%d%d%d", &a, &b, &k);
	if (k >= b - a + 1) {
		for (n = a; n <= b; n++)
			printf("%d\n", n);
		return 0;
	}
	for (n = a; n < a + k; n++)
		printf("%d\n", n);
	if (n < b - k + 1)
		n = b - k + 1;
	for ( ; n <= b; n++)
		printf("%d\n", n);
	return 0;
}


Measured memory_bytes: 128
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	static final PrintStream out = System.out;
	static final Scanner sc = new Scanner(System.in);
	static final long Mod = 1000_000_007L;

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
		System.exit(0);
	}

	void solve() {
		int X = nextInt();

		int res = 0;

		int N = X/100;
		String S = String.valueOf(X);
		int Slen = S.length();
		if(Slen >= 3) {
			S = S.substring(Slen-2,Slen);
			Slen = S.length();
		}else {
			out.println(res);
			return;
		}
		int LastTwo = Integer.parseInt(S);

		if(N * 5 >= LastTwo) {
			res = 1;
		}
		out.println(res);

	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)a[i] = nextInt();
		return a;
	}
	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)a[i] = nextLong();
		return a;
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String next() {
		return sc.next();
	}

	long gcd(long m,long n) {
		if (m<n) return gcd(n,m);
		if (n==0)return m;
		return gcd(n,m%n);
	}
}

Measured memory_bytes: 23764
/**
*    created: 12.05.2020 08:48:37
**/

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int inf =1000000000;

int main() {
    int a[3];
    rep(i,3) cin>>a[i];
    sort(a, a+3);
    int x = a[0] + a[2] - a[1]; //上の操作後の値
    if((a[2]-x)%2)
        x = (a[2] - x) / 2 + 2;
    else
        x = (a[2] - x) / 2;
    int ans =  a[2] - a[1] + x;
    cout << ans << endl;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    b.append([i, a[i]])
b = sorted(b, key=lambda x: x[1])
c = []
for k, v in b:
    c.append(k+1)
print(' '.join(map(str, c)))

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

const ll INF = 1LL << 62;
const double PI = acos(-1);
const double eps = 1e-10;

int main() {
  ll n, x, y;
  cin >> n;
  vector<P> red, blue;
  vector<bool> is_pair_red(n, false), is_pair_blue(n, false);
  rep(i, n) {
    cin >> x >> y;
    red.emplace_back(y, x);
  }
  rep(i, n) {
    cin >> x >> y;
    blue.emplace_back(x, y);
  }
  sort(red.rbegin(), red.rend());
  sort(blue.begin(), blue.end());

  ll ans = 0;
  rep(i, n) {
    rep(j, n) {
      if (is_pair_red[j] || is_pair_blue[i]) continue;
      int bx = blue[i].first, by = blue[i].second;
      int rx = red[j].second, ry = red[j].first;
      if (rx < bx && ry < by) {
        is_pair_red[j] = true;
        is_pair_blue[i] = true;
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


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

bool isPrime(int x){
        if (x==2) return true;
        if (x<2 || x%2==0) return false;
        int i=3;
        while(i<=sqrt(x)){
            if (x % i==0) return false;
            i=i+2;
        }
        return true;
}

int main(void){
    // Here your code !
    int n, x, ct=0;
    cin >> n;
    for (int i=0; i<n; i++){
        cin >> x;
        if (isPrime(x)) ct++;
    }
    cout << ct << endl;
    
    return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  ll n, m, x;
  cin >> n >> m >> x;
  vi a(m);
  rep(i,m){
    cin >> a[i];
  }
  ll ans = MOD;
  ll count1=0;
  ll count2 = 0;
  for (ll i = x + 1; i < n; i++){
    rep(j,m){
      if(i==a[j]){
        count1++;
      }
    }
  }
  chmin(ans, count1);
  for (ll i = x - 1; i > 0;i--){
    rep(j,m){
      if(i==a[j]){
        count2++;
      }
    }
  }
  chmin(ans, count2);
  print(ans);
}


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

using namespace std;

int main() {
	int n;
	cin >> n;
	map<int, int> m;
	for (int i = 0; i < n; i++) {
		int k; cin >> k;
		m[k] = i+1;
	}
	int pos = 1;
	while (pos < n + 1) {
		cout << m[pos] << " ";
		pos++;
	}
	return 0;
}

Measured memory_bytes: 5504
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
vector<int> v[100010];
int n,x,ans,d[100010];
void dfs(int x){
	d[x]=v[x].size();
	vector<int> t;
	for(int i=0;i<v[x].size();i++){
	    dfs(v[x][i]);
	    t.push_back(d[v[x][i]]);
	}sort(t.begin(),t.end());
	for(int i=0;i<t.size();i++){
		int u=t[i]+t.size()-i;
		d[x]=max(d[x],u);
	}
}
int main(){
	while(~scanf("%d",&n)){
		memset(d,0,sizeof(d));
        memset(v,0,sizeof(v));
        for(int i=2;i<=n;i++){
        	scanf("%d",&x);
			v[x].push_back(i); 
        }dfs(1);
        printf("%d\n",d[1]);
	}return 0;
} 

Measured memory_bytes: 13952
using System;
using System.Linq;

namespace _0523
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                int n = int.Parse(Console.ReadLine());
                if (n == 0) break;
                int[] taro = new int[n];
                for (int i = 0; i < n; i++)
                {
                    int x = int.Parse(Console.ReadLine());
                    taro[i] = x;
                }
                int[] hanako = new int[n]; int count = 0;
                for (int i = 1; i <= n * 2; i++)
                {
                    if (!taro.Contains(i))
                    {
                        hanako[count] = i; count++;
                    }
                }
                Array.Sort(taro); Array.Sort(hanako);
                var t = taro.ToList(); var h = hanako.ToList();
                bool nexttaro = true; int ba = -1;
                while (Math.Min(t.Count(),h.Count()) > 0)
                {
                    if (nexttaro)
                    {
                        bool flag = true;
                        for (int pointer = 0; pointer < t.Count();)
                        {
                            if (t[pointer] > ba)
                            {
                                ba = t[pointer]; t.RemoveAt(pointer);
                                flag = false; break;
                            }
                            pointer++;
                        }
                        if (flag) ba = -1;
                    }
                    else
                    {
                        bool flag = true;
                        for (int pointer = 0; pointer < h.Count();)
                        {
                            if (h[pointer] > ba)
                            {
                                ba = h[pointer]; h.RemoveAt(pointer);
                                flag = false; break;
                            }
                            pointer++;
                        }
                        if (flag) ba = -1;
                    }
                    nexttaro = !nexttaro;
                }
                Console.WriteLine(h.Count());
                Console.WriteLine(t.Count());
            }
        }
    }
}


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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define oset tree<int , null_type, less_equal<int> , rb_tree_tag, tree_order_statistics_node_update>
#define MAX 1000000007

using namespace std;
using namespace __gnu_pbds;


int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  map<map<long long int,long long int>,long long int> myMap;
  long long int n,i;
  cin>>n;
  while(n--){
    string s;
    cin>>s;
    map<long long int,long long int> temp;
    for(i=0;i<10;i++){
      temp[s[i]-'a']++;
    }
    myMap[temp]++;
  }
  long long int ans = 0;
  for(auto it = myMap.begin();it!=myMap.end();it++){
    long long int t = it->second;
    ans += (t*(t-1))/2;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 62336
#include<bits/stdc++.h>
#include <time.h>
using namespace std;
#include <math.h>
#define ll long long 
// to increase precision
// std::cout<<std::fixed;
// 	std::cout<<std::setprecision(6)<<z;
//clock_t tStart = clock();
//printf("Time taken: %.9fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
#define max1 200001


int main(){	
	
	int x;
	cin>>x;
	for(int i=-200;i<=200;i++){
		int ansf=0;
		for(int j=-200;j<i;j++){
			long long int a=(long long)pow(i,5);
			long long int b=(long long)pow(j,5);
			if(a-b==x){
				cout<<i<<" "<<j<<endl;
				ansf=1;
				break;
			}
		}
		if(ansf)
			break;
	}
	
}

Measured memory_bytes: 4080
#include<iostream>
#include<string>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(a>b && b>c){
		cout<<b+c<<endl;
	}
	
	else if(b>a && a>c){
		cout<<a+c<<endl;
	}
	else if(b>c && c>a){
		cout<<a+c<<endl;
	}
	else if(a>c && c>b){
		cout<<b+c<<endl;
	}
	else if(c>a && a>b){
		cout<<a+b<<endl;
	}
	else if(c>b && b>a){
		cout<<a+b<<endl;
	}
	else if(a==b && b==c){
		cout<<a+b<<endl;
	}
	else if(a==c && c==b){
		cout<<a+b<<endl;
	}
}

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

char a[1010][1010];
int h, w;
queue<pair<int, int> > v, v2;

bool inner(int x, int y) { return (x >= 0 && y >= 0 && x < h && y < w); }
int main(void) {
    cin >> h >> w;
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            cin >> a[i][j];
            if (a[i][j] == '#') {
                v.push(make_pair(i, j));
            }
        }
    }
    int i;
    int u[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
    for (i = 0; i < 10005; ++i) {
        int size = v.size();
        for (int j = 0; j < size; ++j) {
            pair<int, int> e = v.front();
            v.pop();
            int x = e.first;
            int y = e.second;
            for (int k = 0; k < 4; ++k) {
                int xn = x + u[k][0];
                int yn = y + u[k][1];
                if (inner(xn, yn) && a[xn][yn] == '.') {
                    v.push(make_pair(xn, yn));
                    a[xn][yn] = '#';
                }
            }
        }
        if (v.size() == 0) {
            break;
        }
    }
    cout << i << endl;

    return 0;
}


Measured memory_bytes: 9360
def kouyakusu(a, b)
  loop do
    rem = b % a
    return a if rem == 0
    a, b = rem, a
  end
end

def kobaisu(a, b)
  (a * b) / kouyakusu(a, b)
end

while str = gets
  a, b = str.split(' ').map(&:to_i).sort
  puts "#{kouyakusu(a, b)} #{kobaisu(a, b)}"
end

Measured memory_bytes: 8560
import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner scn = new Scanner(System.in);
    if((1 & scn.nextInt() & scn.nextInt()) == 1){
      System.out.println("Odd");
    } else {
      System.out.println("Even");
    }
  }
}

Measured memory_bytes: 20948
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
const long long MOD=1e09+7;



#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define vi vector<int>


int main(){
  
  int n;
  cin>>n;
  
  vi data(n);
  rep(i,n){
    int tmp;
    cin>>tmp;
    data.at(i)=tmp;
  }
  
  sort(data.begin(),data.end());
  

  cout<<data.at(n/2)-data.at(n/2-1)<<endl;
  
  

  
  
  
      
 

  
}

Measured memory_bytes: 640