akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.StringTokenizer;

public class Main {
	static class IO 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public IO() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
        int [] readarray(int sz){
            int [] ret = new int[sz];
            for(int i = 0; i<sz; i++)ret[i] = nextInt();
            return ret;
        }
    } 
    public static void main(String[] args){
        IO fs = new IO();
        int n = fs.nextInt();
        System.out.println((n*(n+1))/2);
    }
}


Measured memory_bytes: 25360
using System;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] dlm = " ".ToCharArray();
            string[] data = Console.ReadLine().Split(dlm);

            int a = int.Parse(data[0]);
            int b = int.Parse(data[1]);
            int c = int.Parse(data[2]);

            if (a < b && b < c)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }

        }
    }
}



Measured memory_bytes: 17992
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  unordered_map<string,int> um; 
  string s;
  for(int i=0;i<n;i++)
  {
    cin>>s;
    um[s]++;
  }
  cout<<um.size()<<endl;
}

Measured memory_bytes: 17692
package main

import (
	"fmt"
	"io"
	"os"
)

func run(input io.Reader, output io.Writer) int {
	var s string
	fmt.Scanf("%s\n", &s)
	for i := 1; i < len(s); i++ {
		if s[i-1] != s[i] {
			fmt.Println("Yes")
			return 0
		}
	}

	fmt.Println("No")

	return 0
}

func main() {
	os.Exit(run(os.Stdin, os.Stdout))
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--)
#define chmin(a,b) (a)=min((a),(b));
#define chmax(a,b) (a)=max((a),(b));
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) cerr<<(#v)<<":";for(auto(x):(v)){cerr<<" "<<(x);}cerr<<endl;
#define printVS(vs) cerr<<(#vs)<<":"<<endl;for(auto(s):(vs)){cerr<<(s)<< endl;}
#define printVV(vv) cerr<<(#vv)<<":"<<endl;for(auto(v):(vv)){for(auto(x):(v)){cerr<<" "<<(x);}cerr<<endl;}
#define printP(p) cerr<<(#p)<<(p).first<<" "<<(p).second<<endl;
#define printVP(vp) cerr<<(#vp)<<":"<<endl;for(auto(p):(vp)){cerr<<(p).first<<" "<<(p).second<<endl;}

inline void output(){ cerr << endl; }
template<typename First, typename... Rest>
inline void output(const First& first, const Rest&... rest) {
    cerr << first << " "; output(rest...);
}

using ll = long long;
using Pii = pair<int, int>;
using TUPLE = tuple<int, int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
const int inf = 1ll << 60;
const int mod = 1e9 + 7;
using Graph = vector<vector<int>>;

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

    int n, m;
    cin >> n >> m;
    vector<string> a(n);
    rep(i, n) cin >> a[i];
    vector<string> b(m);
    rep(i, m) cin >> b[i];

    auto check = [&](int i, int j) {
        rep(k, m) {
            rep(l, m) {
                if (a[i + k][j + l] != b[k][l]) {
                    return false;
                }
            }
        }
        return true;
    };

    rep(i, n - m + 1) {
        rep(j, n - m + 1) {
            if (check(i, j)) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}


Measured memory_bytes: 256
N=int(input())
a=input().split()
b=input().split()
for i in range(0,N):
  a[i]=int(a[i])
  b[i]=int(b[i])
a[N]=int(a[N])
answer=sum(a)
for i in range(0,N):
    c=b[i]-a[i]
    if c<0:
        a[i]=-c
        b[i]=0
    else:
        a[i]=0
        b[i]=c
    d=b[i]-a[i+1]
    if d<0:
        a[i+1]=-d
        b[i]=0
    else:
        a[i+1]=0
        b[i]=d
print (answer-sum(a))

Measured memory_bytes: 18624
#include<cstdio>

int main(int argc, char const *argv[])
{
    int H, W;
    while(1){
        scanf("%d %d", &H, &W);

        if(H==0 && W==0) break;

        for(int j=0; j<H; j++){
            for(int i=0; i<W; i++){
                if(j%2 == 0){
                    if(i%2 == 0) printf("#");
                    else printf(".");
                }
                else{
                    if(i%2 == 0) printf(".");
                    else printf("#");
                }
            }
            printf("\n");
        }
        printf("\n");
    }
    
    return 0;
}



Measured memory_bytes: 2596
#include<bits/stdc++.h>
typedef long long ll; 
#define pb push_back
#define mp make_pair
#define mod 998244353
#define vi vector <ll>
using namespace std ; 
ll power(ll x,ll y,ll m)
{            //power(x,y)=x^y  %m;
	ll res=1%m;
	while(y)
	{
	    if(y&1)
	    res=(res*x)%m;
	    x=(x*x)%m;
	    y=(y>>1)%m;
	}
	return res;
}
ll mod_inverse(ll x,ll m)
{
	return power(x,m-2,m);
}
int main ()
{
    ios_base :: sync_with_stdio ( false );
    cin.tie( NULL );
    cout.tie( NULL );

ll n;
cin>>n;
ll a[n];
for(ll i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
reverse(a,a+n);
ll ans=0;
ll cnt=0;
ll prev=a[0];
ans+=a[0];
cnt++;
ll fg=1;
if(cnt>=(n-1))
fg=0;
if(fg)
{
for(ll i=1;i<n;i++)
{
   cnt+=2;
   cnt--;
   if(cnt>(n-i-1))
   {
     if(cnt-1==(n-i-1))
     {
         ans+=a[i];
          break;
     }
    
   }
   else if(cnt==(n-i-1))
   {
      ans+=a[i]*2;  
      break;
   }
   else
   {
     ans+=a[i]*2;  
   }
}

}
cout<<ans<<"\n";
 

 return 0;
}

Measured memory_bytes: 5212
import java.util.Scanner;

public class Main {

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

	    int N=gi();
	    int K=gi();

        System.out.println((int)(K* Math.pow(K-1, N-1)));
//        if (a<=c&&c<=b) {
//        	System.out.print("Yes");
//        }else{
//        	System.out.print("No");
//        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}
}

Measured memory_bytes: 35464
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
//typedef __int64 LL;
typedef vector<int> ivec;
typedef vector<string> svec;

const int MOD=1000000007;

int a[100010];
int main(){
	int s,w;
	cin>>s>>w;	
	
    
	if(w>=s)cout<<"unsafe"<<endl;
	else cout<<"safe"<<endl;
	return 0;
}

Measured memory_bytes: 3636
import java.util.Scanner;

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

		String result = isFulfill(input) ? "AC" : "WA";
		System.out.println(result);
	}

	public static boolean isFulfill(String input) {

		int size = input.length();
		int countC = 0;
		for (int i = 0; i < size; i++) {
			if (i == 0) {
				if (!checkTopCharacter(input)) {
					return false;
				}
			} else if (i == 1 || i == size-1) {
				if (isUpperCase(input, i)) {
					return false;
				}
			} else if (i >=2  && i < size-1	) {
				if (isUpperCase(input, i) && !"C".equals(String.valueOf(input.charAt(i)))) {
					return false;
				}
				if (countC == 1) {
					if (isUpperCase(input, i)) {
						return false;
					}
				}
				if (isUpperCase(input, i) && "C".equals(String.valueOf(input.charAt(i)))) {
					countC++;
					if (countC == 2) {
						return false;
					}
				}
			}
		}
		if (countC == 0) {
			return false;
		}

		return true;
	}

	public static boolean checkTopCharacter(String input) {
		if (!Character.isUpperCase(input.charAt(0))) {
			return false;
		}
		if (!"A".equals(String.valueOf(input.charAt(0)))) {
			return false;
		}
		return true;
	}

	public static boolean isUpperCase(String input, int index) {
		return Character.isUpperCase(input.charAt(index));
	}

}


Measured memory_bytes: 22612
a = input().split()
n = int(a[0])
m = int(a[1])
x = int(a[2])

bo =  []
for i in range(n):
    bo.append([int(j) for j in input().split()])
# bo = [int(i) for i in [j for j in sbo] ]

cost = 999999999999
pat = []
for i in range(2 ** n):
    tp = []
    for j in  range(n):
        if ((i >> j) & 1):
            tp.append(bo[j])
    pat.append(tp)

# print(pat)

for i in pat:
    ef = [0] * (m)
    tcost = 0
    for j in i:
        tcost += j[0]
        for k in range(1,m+1):
            ef[k-1] += j[k]
    flg = True
    for l in range(1,m+1):
        if ef[l-1] < x:
            flg = False
    if flg:
        cost = min(cost,tcost)

if cost == 999999999999:
    print(-1)
else :
    print(cost)



Measured memory_bytes: 9508
process.stdin.resume();
process.stdin.setEncoding('utf8');
 
var lines = [];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
reader.on('line', (line) => {
    // ここで入力を処理する
    lines.push(line);
});
var sub_fn = (ary)=>{
  
}
reader.on('close', () => {
  var x = (lines[1].split(' ')).map((a)=>{return 1*a}).sort(function(a,b){
        if( a > b ) return -1;
        if( a < b ) return 1;
        return 0;
});
  var al = 0;
  var bb = 0;
  for(var i in x){
    if(i%2 == 0){
     // console.log(x[i])
      al += x[i]
    }else{
      bb += x[i]
    }   
  }
  console.log(al - bb)
});

Measured memory_bytes: 11852
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
const int INF = 1001001001;
const ll MOD = 998244353;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

// ll lpow(ll a, ll b){
//   if(b==0) return 1;
//   else if(b%2==0){ll memo = lpow(a,b/2); return memo*memo;}
//   else return lpow(a,b-1) * a;
// }




signed main(){
	int n; cin>>n;
	vector<double> x(n), y(n);
	rep(i,n) cin>>x[i]>>y[i];

	double wa = 0, sum = 0;
	// double m = 1;
	// reps(i,n-1){
	// 	m *= i;
	// }
	// cerr << 'm' SP m << endl;
	rep(i,n){
		rep(j,i){
			wa += pow(x[i]-x[j],2);
			wa += pow(y[i]-y[j],2);
			wa = pow(wa,0.5);
			cerr << wa << endl;
			sum += wa*2/n;
			cerr << sum << endl;
			wa = 0;
		}
	}
	// sum = sum/(m*n);
	cout << sum << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#define _USE_MATH_DEFINES
#include <math.h>
#include <iomanip>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
using namespace std;
#define INT_MAX 2147483647
#define INT_MIN (-2147483647 - 1)
#define INF (int)1e8
#define _INF (int)-1e8
#define INFLL (long long)1e14
#define _INFLL (long long)-1e14
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)
#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)
#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)
#define bitmanip(m,val) static_cast<bitset<(int)m>>(val)
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef pair<int, int> P;

class Dijkstra {
private:
	struct node{
		bool done;
		vi to, cost;
		int id, from;
		ll d;
		bool operator<(const node & another) const {
			return !(d != another.d ? d < another.d : id < another.id);
		}
	};
	vector<node> nodes;
	int n;
	int start;
public:
	vll result;
	//??£??\?????????
	Dijkstra(vector<vector<P>> data, int Start) {
		n = data.size();
		start = Start;
		result.resize(n);
		nodes.resize(n);
		Loop(i, n) {
			nodes[i] = { false, {}, {}, i, -1, INFLL };
			Loop(j, data[i].size()) {
				nodes[i].to.push_back(data[i][j].first);
				nodes[i].cost.push_back(data[i][j].second);
			}
		}
	}
	void mainfunc() {
		priority_queue<node> pq;
		nodes[start].d = 0;
		pq.push(nodes[start]);
		while (pq.size()) {
			node focus = pq.top(); pq.pop();
			if (nodes[focus.id].done) continue;
			Loop(j, focus.to.size()) {
				if (nodes[focus.to[j]].done) continue;
				if (focus.d + focus.cost[j] < nodes[focus.to[j]].d) {
					nodes[focus.to[j]].d = focus.d + focus.cost[j];
					nodes[focus.to[j]].from = focus.id;
					pq.push(nodes[focus.to[j]]);
				}
			}
			nodes[focus.id].done = true;
		}
		Loop(i, n) {
			result[i] = nodes[i].d;
		}
	}
};

int main() {
	int n, m, r; cin >> n >> m >> r;
	vector<vector<P>> data(n);
	Loop(i, m) {
		int s, t, d; cin >> s >> t >> d;
		data[s].push_back({ t,d });
	}
	Dijkstra algo1(data, r);
	algo1.mainfunc();
	Loop(i, algo1.result.size()) {
		if (algo1.result[i] == INFLL) cout << "INF" << endl;
		else cout << algo1.result[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 41512
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 998244353;

template <int mod>
struct modint {
    lint v;
    modint() : v(0) {}
    modint(signed v) : v(v) {}
    modint(lint t) {
        v = t % mod;
        if (v < 0)
            v += mod;
    }

    modint pow(lint k) {
        modint res(1), tmp(v);
        while (k) {
            if (k & 1)
                res *= tmp;
            tmp *= tmp;
            k >>= 1;
        }
        return res;
    }
    static modint add_identity() { return modint(0); }
    static modint mul_identity() { return modint(1); }
    modint inv() { return pow(mod - 2); }

    modint &operator+=(modint a) {
        v += a.v;
        if (v >= mod)
            v -= mod;
        return *this;
    }
    modint &operator-=(modint a) {
        v += mod - a.v;
        if (v >= mod)
            v -= mod;
        return *this;
    }
    modint &operator*=(modint a) {
        v = v * a.v % mod;
        return *this;
    }
    modint &operator/=(modint a) { return (*this) *= a.inv(); }

    modint operator+(modint a) const { return modint(v) += a; };
    modint operator-(modint a) const { return modint(v) -= a; };
    modint operator*(modint a) const { return modint(v) *= a; };
    modint operator/(modint a) const { return modint(v) /= a; };

    modint operator-() const { return v ? modint(mod - v) : modint(v); }

    bool operator==(const modint a) const { return v == a.v; }
    bool operator!=(const modint a) const { return v != a.v; }
    bool operator<(const modint a) const { return v < a.v; }
};
using mint = modint<mod>;
ostream &operator<<(ostream &os, mint m) { return os << m.v; }

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<bitset<300>> a(n);
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            int b;
            cin >> b;
            a[i][j] = b;
        }
    }
    vector<bool> used(n, false);
    int rank = 0;
    for (int i = 0; i < m; ++i) {
        int idx = -1;
        for (int j = 0; j < n; ++j) {
            if (!used[j] && a[j][i] == 1) {
                idx     = j;
                used[j] = true;
                break;
            }
        }
        if (idx == -1)
            continue;
        for (int j = 0; j < n; ++j) {
            if (j != idx && a[j][i] == 1) {
                a[j] ^= a[idx];
            }
        }
        rank++;
    }
    mint ret = mint(2).pow(n + m - rank - 1) * (mint(2).pow(rank) - 1);
    cout << ret << "\n";
    return 0;
}

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

// 解説を読んで
// Pの文字列を線形探索していく
// まったくソートできてない場合は「n - k + 1」となり
// 昇順にソートしている場合は上記数値をカウントダウンする。

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

    vector<int> P(n);
    set<int> S;
    int count;
    int last;
    int answer = n - k + 1;
    bool sorted = false;

    for (int i = 0; i < n; i++) {
        cin >> P[i];

        if (P[i] > last) {
            count++;
        } else {
            count = 1;
        }
        last = P[i];

        if (i >= k) {
            S.erase(P[i - k]);
        }

        if (count >= k) {
            sorted = true;
            answer--;
        } else if (i >= k
        && P[i - k] < *S.begin() 
        && P[i] > *S.rbegin()) {
            answer--;
        }
        S.insert(P[i]);
    }
    if (sorted) answer++;
    cout << answer << endl;
}

Measured memory_bytes: 10368
def f(point):
    k = K
    for i in range(N):
        a = A[i]
        f = F[i]
        if a*f > point:
            k -= a - point//f
        if k < 0:
            return False
    # print(point, k)
    return True

N, K = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)
l = -1
r = 10**18+1
while (r-l) > 1:
    mid = (r+l)//2
    if f(mid):
        r = mid
    else:
        l = mid
print(r)


Measured memory_bytes: 119500
#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 5;

int arr[N];

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	int n, cnt0=0, cnt1=0, cnt2=0; cin>>n;
	for(int i=0;i<n;i++){
		cin>>arr[i];
		if(arr[i] % 4 == 0) cnt0++;
		else if(arr[i] % 2 == 0) cnt1++;
		else cnt2++;
	}
	cnt2-=cnt0+1;
	if(cnt1>0) cnt2++;
	if(cnt2 <= 0) cout<<"Yes\n";
	else cout<<"No\n";
	return 0;
}

Measured memory_bytes: 640
#include <stdio.h>
#define N 200000
int main(void){
  int i=0,minv=0,j=0,n=0,maxv=0, Money[N];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&Money[i]);
  }
  maxv = Money[1]-Money[0];
  minv = Money[0];
  
  for(j = 1; j<=n-1; j++) {
  	if(maxv <Money[j]-minv) maxv = Money[j]-minv;
  	if(Money[j]  < minv) minv = Money[j];
  }
   printf("%d\n",maxv);
   return 0;
}


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

#define taskname ""
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex <ld> cd;
typedef vector <cd> vcd;
typedef vector <int> vi;

template<class T> using v2d = vector <vector <T> >;
template<class T> bool uin(T &a, T b)
{
    return a > b ? (a = b, true) : false;
}
template<class T> bool uax(T &a, T b)
{
    return a < b ? (a = b, true) : false;
}

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

const int maxN = 2e3 + 1;

int n;
int a[maxN];

ll res = 0;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for1(i, n)
    {
        cin >> a[i];
    }
    sort(a + 1, a + n + 1);
    for (int i = n; i > 1; --i)
    {
        int l = 1, r = i - 1;
        while (l < r)
        {
            if (a[l] + a[r] > a[i])
            {
                res = res + r - l;
                --r;
            }
            else
            {
                ++l;
            }
        }
    }
    cout << res;
    return 0;
}


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


// Useful container manipulation / traversal macros
#define fori(i,a,b)    for(int i=a;i<=b;i++)
#define ford(i,a,b)   for(int i=a;i>=b;i--)
#define all(a)        a.begin(), a.end()
#define in(a,b)       ( (b).find(a) != (b).end())
#define tr(c,i)       for(auto i = (c).begin(); i != (c).end(); i++)
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define pb             push_back
#define fill(a,v)      memset(a, v, sizeof a)

typedef long long int lli;
typedef vector<int> vi;
typedef vector<long long int> vlli;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	
	
    if (fopen("input.txt", "r")) {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }

    lli n;
    cin>>n;

    lli a[5];
    fori(i, 0, 4){
        cin>>a[i];
    }

    sort(a, a+5);

    if(a[0] != 1)
        cout<< (n / a[0]) + 5;

    else
    {
        cout<< (n / a[0]) + 4;        
    }
    
}

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

typedef map<string, set<int> > Dict;
Dict dict;
int main(){
  int p;
  string s;
  while(cin >> s >> p){
    dict[s].insert(p);
  }
  for(Dict::iterator it = dict.begin(); it != dict.end(); it++){
    cout << it->first << endl;
    int i = 0;
    for(set<int>::iterator it2 = (*it).second.begin(); it2 != (*it).second.end(); it2++, i++){
      if(i)cout << " ";
      cout << *it2;
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 1228
# ABC149C
import math

def check_prime(num):
    for i in range(2, math.ceil(math.sqrt(num))):
        if num % i == 0:
            return False
    else:
        return True

x = int(input())
while True:
    if check_prime(x):
        print(x)
        break
    x += 1

Measured memory_bytes: 3060
use proconio::input;
 
fn main() {
    input! {
        n: usize,
      	m: usize,
      	mut fruits: [u64;n],
    }

	fruits.sort();
  	let mut sum = 0;
  	for i in 0..m {
  		sum += fruits[i];
  	}
  	
	println!("{}", sum);
}

Measured memory_bytes: 2136
package main

import (
	"fmt"
	"sort"
)

func main() {
	var N int
	fmt.Scan(&N)

	var S string
	var P int
	keys := make([]string, N)
	m := make(map[string]int)
	for i := 0; i < N; i++ {
		fmt.Scan(&S, &P)
		k := S + fmt.Sprintf("%03d", 100-P)
		keys[i] = k
		m[keys[i]] = i + 1
	}
	sort.Strings(keys)

	for _, k := range keys {
		fmt.Println(m[k])
	}
}


Measured memory_bytes: 512
macro_rules! read_line {
    () => {{
        let mut input = String::new();
        std::io::stdin().read_line(&mut input).unwrap();
        input
    }};
}

fn read_parse<T: std::str::FromStr>() -> T {
    read_line!().trim().parse().ok().unwrap()
}

fn main() {
    let n: i32 = read_parse();
    let k: i32 = read_parse();
    let x: i32 = read_parse();
    let y: i32 = read_parse();

    println!("{}", if n <= k { n*x } else { k*x + (n-k)*y })
}

Measured memory_bytes: 4352
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <unordered_map> 
#include <unordered_set>
#include <functional>
#include <bitset>

using namespace std;

typedef pair<long long int, long long int> P;
typedef tuple<int, int, int> T;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

double EPS = 1e-10;

double add(double a, double b){
	if(abs(a + b) < EPS * (abs(a) + abs(b))){
		return 0;
	}
	return a + b;
}

struct Pd{
	double x, y;
	Pd(){}
	Pd(double x, double y) : x(x), y(y){}
	Pd operator + (Pd p){
		return Pd(add(x, p.x), add(y, p.y));
	}
	Pd operator - (Pd p){
		return Pd(add(x, -p.x), add(y, -p.y));
	}
	Pd operator * (double d){
		return Pd(x * d, y * d);
	}
	double dot(Pd p){
		return add(x * p.x, y * p.y);
	}
	double det(Pd p){
		return add(x * p.y, -y * p.x);
	}
};

pair<Pd, double> min_ball(vector<Pd> ps) {
    const int n = ps.size();
 
    //assert(n >= 1); // n < 1 の場合、エラーメッセージを出力して異常終了
    if (n == 1) {
        return {ps[0], 0.0};
    }

    using circle = pair<Pd, double>; // ((x, y), r^2)
 
    auto make_circle_3 = [](Pd a, Pd b, Pd c) -> circle {
        double A = (b - c).dot(b - c), B = (c - a).dot(c - a), C = (a - b).dot(a - b), S = (b - a).det(c - a);
        Pd p = (a * A * (B + C - A) + b * B * (C + A - B) + c * C * (A + B - C)) * (1.0 / (4 * S * S));
        double r2 = (p - a).dot(p - a);
        return {p, r2};
    };
 
    auto make_circle_2 = [](Pd a, Pd b) -> circle {
        Pd c = (a + b) * 0.5;
        double r2 = (a - c).dot(a - c);
        return {c, r2};
    };
 
    auto in_circle = [](Pd a, circle c) -> bool {
        return (a - c.first).dot(a - c.first) <= c.second + EPS;
    };

    circle c = make_circle_2(ps[0], ps[1]);

    for (int i = 2; i < n; ++i) {
        if (!in_circle(ps[i], c)) {
            c = make_circle_2(ps[0], ps[i]);
            for (int j = 1; j < i; ++j) {
                if (!in_circle(ps[j], c)) {
                    c = make_circle_2(ps[i], ps[j]);
                    for (int k = 0; k < j; ++k) {
                        if (!in_circle(ps[k], c)) {
                            c = make_circle_3(ps[i], ps[j], ps[k]);
                        }
                    }
                }
            }
        }
    }
    return c;
}

int main(){
	int N;
	cin >> N;
	vector<Pd> v;
	for(int i = 0; i < N; i++){
		Pd p = Pd();
		cin >> p.x >> p.y;
		v.push_back(p);
	}
	printf("%.15f\n", sqrt(min_ball(v).second));
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
class Main
{
    public static void main(String args[])
    {
	Scanner scan=new Scanner(System.in);
	while(scan.hasNext())
	    {
		int i=0;
		int n=scan.nextInt();
		for(int a=0;a<10;a++)
		    {
			for(int b=0;b<10;b++)
			    {
				for(int c=0;c<10;c++)
				    {
					for(int d=0;d<10;d++)
					    {
						if(n==(a+b+c+d))i++;
					    }
				    }
			    }
		    }
		System.out.println(i);
	    }
    }
}

Measured memory_bytes: 19008
#include  <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define inf 1000000007
//P pa(114,514);   ,vector<P>vec(N,0);
//vector<vector<int>> vec(縦, vector<int>(横));
#define REP(i,N) for(int i=0;i<N;i++)
int gcd(int a, int b) {
    if(a>b){
        swap(a,b);
        }
    while(b%a!=0){
        b%=a;
        swap(a,b);
    }
    return a;
}
//cout << setprecision(123);
//a=atoi(S.c_str());
//S=to_string(a);
int main(){
  ll N,n,a,b;
  cin>>n;
  N=floor(pow(n,0.5));
  
  for(ll i=1;i<N+1;i++){
    if(n%i==0)a=i;
  }
  
  b=n/a;
  cout<<a+b-2<<endl;
}

Measured memory_bytes: 512
import java.util.Scanner;
public class Main {
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (a < b) System.out.println("a < b");
else if (a > b) System.out.println("a > b");
else System.out.println("a == b");
}
}


Measured memory_bytes: 26292
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

int d;
LL g;
int p[12]={0}, c[12]={0};
LL sum[12]={0};
int ans = 100000000;

void f(VI &flag)
{
    if(flag.size() == d)
    {
        LL score = 0;
        int count = 0;
        REP(i, d)
        {
            if(flag[i] == 0)continue;
            score += sum[i];
            count += p[i];
        }
        if(score < g)
        {
            for(int i = d - 1; i >= 0; i--)
            {
                if(flag[i] == 0)
                {
                    double x = g - score;
                    int y = ceil(x / ((i + 1) * 100));
                    p[i];
                    if(y <= p[i] - 1)
                    {
                        count += y;
                        ans = min(ans, count);
                    }
                    break;
                }
            }
        }
        else
        {
            ans = min(ans, count);
        }
    }
    else
    {
        flag.PB(0);
        f(flag);
        flag.pop_back();

        flag.PB(1);
        f(flag);
        flag.pop_back();
    }
}

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin>>d>>g;
    REP(i,d){
        cin>>p[i]>>c[i];
        sum[i] = p[i] * (i + 1) * 100 + c[i];
    }
    VI flag;
    f(flag);
    PUTS(ans);
}

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

using namespace std;
typedef long long ll;
const int MAX = 1000010;
ll mod = 998244353;
vector<ll> gcd_trans(vector<ll> &v){
	int i,j,n = v.size();
	vector<bool> used(n,true);
	for(i=2;i<n;i++){
		if(!used[i]) continue;
		for(j=(n - 1)/i;j>=1;j--){
			used[j*i] = false;
			(v[j] += v[j*i]) %= mod;
		}
	}
	return v;
}

vector<ll> inv_gcd_trans(vector<ll> &v){
	int i,j,n = v.size();
	vector<bool> used(n,true);
	for(i=2;i<n;i++){
		if(!used[i]) continue;
		for(j=1;j*i<MAX;j++){
			used[j*i] = false;
			v[j] -= v[j*i];
			if(v[j]<0) v[j] += mod;
		}
	}
	return v;
}

ll inv[MAX],fact[MAX],fi[MAX];
void inverse(){
	int i;
	inv[1] = 1;
	for(i=2;i<MAX;i++){
		inv[i] = mod - (mod/i)*inv[mod%i]%mod;
	}
	fact[0] = fi[0] = 1;
	for(i=1;i<MAX;i++){
		fact[i] = fact[i-1]*i%mod;
		fi[i] = (fi[i-1]*inv[i])%mod;
	}
}

vector<ll> a(MAX),b(MAX);
ll ans = 0;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int i,n;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> a[i];
		(b[a[i]] += a[i]) %= mod;
	}
	vector<ll> c = gcd_trans(b);
	for(i=1;i<MAX;i++){
		(c[i] *= c[i]) %= mod;
	}
	vector<ll> b = inv_gcd_trans(c);
	for(i=0;i<n;i++){
		(b[a[i]] += (mod - (a[i]*a[i])%mod)) %= mod;
	}
	inverse();
	for(i=1;i<MAX;i++){
		(ans += b[i]*inv[i]%mod) %= mod;
	}
	(ans *= inv[2]) %= mod;
	cout << ans << endl;
}

Measured memory_bytes: 55040
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 1e18;
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main(){
	int n; cin >> n;
	VI a(n); REP(i,n) cin >> a[i];
	sort(ALL(a),greater<ll>());
	ll ans=a[0]; int c=n-2;
	REP(i,n){
		if(c==0)
			break;
		ans+=a[i+1];
		c--;
		if(c==0)
			break;
		ans+=a[i+1];
		c--;
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<ll> vl ;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;

#define rep(i,N) for(int i=0; i < (int)N; i++)
#define all(v) (v).begin(),(v).end()

const int INF = 100000002;

int main(){
	int x,y,z; cin >> x >> y>>z;
	cout << z << " " << x << " " <<  y << endl;
}

Measured memory_bytes: 256
score  = { A: 10, B: 11 , C: 12, D: 13, E: 14, F: 15 }

x, y = gets.split(' ').map(&:to_sym)

if score[x] > score[y]
  puts '>'
elsif score[x] < score[y]
  puts '<'
else
  puts '='
end


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

int abs(int a){
  if(a<0) return -a;
  return a;
}

int main(){
  int n;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  int max=0;
  for(int i=0;i<n-1;i++){
    for(int j=n-1;j>i;j--){
      if(abs(a[i]-a[j])>max) max=abs(a[i]-a[j]);
    }
  }
  cout << max << endl;
  return 0;
}


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

public class Main {

    static InputReader sc = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        solver s = new solver();
        int t = 1;
        while (t > 0) {
            s.solve();
            t--;
        }
        out.close();
    }

    static class InputReader {

        public BufferedReader br;
        public StringTokenizer token;

        public InputReader(InputStream stream) {
            br = new BufferedReader(new InputStreamReader(stream), 32768);
            token = null;
        }

        public String sn() {
            while (token == null || !token.hasMoreTokens()) {
                try {
                    token = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return token.nextToken();
        }

        public int ni() {
            return Integer.parseInt(sn());
        }

        public String snl() throws IOException {
            return br.readLine();
        }

        public long nlo() {
            return Long.parseLong(sn());
        }

        public double nd() {
            return Double.parseDouble(sn());
        }

        public int[] na(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = sc.ni();
            return a;
        }

        public long[] nal(int n) {
            long a[] = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = sc.nlo();
            return a;
        }
    }

    static int inf = 5000013;

    static class solver {
        DecimalFormat df = new DecimalFormat("0.00000000");
        long maxi = Integer.MAX_VALUE;
        int max = 0;
        List<Integer> list[];
        boolean v[];
        int dp[];

        void solve() {
            int n = sc.ni();
            int m = sc.ni();
            list = new ArrayList[n];
            dp = new int[n];
            for (int i = 0; i < n; i++)
                list[i] = new ArrayList<>();
            for (int i = 0; i < m; i++) {
                int u = sc.ni() - 1;
                int v = sc.ni() - 1;
                list[u].add(v);
            }
            v = new boolean[n];
            for (int i = 0; i < n; i++) {
                if (!v[i]) {
                    dfs(i);
                }
            }
            for(int i=0;i<n;i++)
                max=Math.max(max,dp[i]);
            out.println(max);
        }

        void dfs(int s) {
            v[s] = true;
            for (int h : list[s]) {
                if (!v[h])
                    dfs(h);
                dp[s] = Math.max(dp[s], dp[h] + 1);
            }
        }
    }
}


Measured memory_bytes: 55956
#include <iostream>
#include <queue>
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include <map>
#include <stack>
#include <iomanip>
#include <set>
#include <sstream>
#include <cmath>
#include <deque>
#include <list>
#include <bitset>
using namespace  std;
typedef pair<long long , long long> P;
typedef long long int64;
typedef long long lint;
#define REP(i, n) for(long long (i)=0; (i)<(n); ++i)
#define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define FST first
#define SND second
lint N;
map<lint, lint> m;
lint cnt;
lint l;
lint res;
vector<P> A;
void rec(lint i, lint v){
    if(i==l){
        //cout <<"v " << v << endl;
        lint q = (N-v) / v;
        if(q==0) return;
        //cout << q << " " << N/q << " " << N%q <<endl;
        if(N/q == N%q) res+= q;
    }
    else{
        lint x = A[i].second;
        while(x>=0){
            rec(i+1, v * pow(A[i].first, x));
            x--; 
        }
    }
}

vector<P> factoring(lint N){
    vector<P> res;  
    lint n=N;
    for(lint i=2; i*i<=N; i++){
        lint x = 0;
        while(n%i==0){
            x++;
            n /= i;
        }
        if(x) res.push_back(make_pair(i, x));
    }
    if(n>1) res.push_back(make_pair(n, 1));
    return res;
}

signed main(){
    cin>>N;
    A = factoring(N);
    l = A.size();
    rec(0, 1);
    cout << res << endl;
    return 0;
}


lint pow(lint n, lint x){
    lint res = 1;
    while(x){
        if(x%2) res *= n;
        x>>1;
        n *= n;
    }
    return res;
}

void test(lint N){
    lint cnt = 0;
    FOR(i,1, N){
        lint q = N / i;
        lint r = N % i;
        if(q==r){
            cout << i << "*" << q << "=" << i*q << "..." <<  r << endl;
            cnt++;
        }
    }
    cout << cnt << endl;
    return;
}

Measured memory_bytes: 512
const N: usize = 1000;
const C: [[char; 2]; 2] = [['R', 'G'], ['Y', 'B']];

fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let h: usize = sc.read();
    let w: usize = sc.read();
    let d: usize = sc.read();

    let mut big_board = vec![vec!['.'; N * 3]; N * 3];
    for i in 0..(N * 3) {
        for j in 0..(N * 3) {
            let ci = (i / d) % 2;
            let cj = (j / d) % 2;
            big_board[i][j] = C[ci][cj];
        }
    }

    for i in 0..h {
        for j in 0..w {
            let x = (i + j);
            let y = (N + i - j);
            sc.write(big_board[x][y]);
        }
        sc.write("\n");
    }
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> Self {
        Self(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: ToString>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.to_string().as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 37428
#include<stdio.h>
int main()
{
	char t[200001];
	scanf("%s",t);
	int n=0;
	while(t[n]!='\0')
	{
		if(t[n]=='?')
		{
			t[n]='D';
		}
		n++;
	}
	printf("%s",t);
	return 0;
}

Measured memory_bytes: 1916
#include<iostream>
using namespace std;
 
int main(void){
    int a[26]={0};
    char text;
    while(cin >> text){
	if(text >= 'a' && text <= 'z' )
		a[text-'a']++;
	if(text >= 'A' && text <= 'Z' )
		a[text-'A']++;
        }
	for(int i = 0; i<26;i++)
	{
		cout <<(char)(i+'a')<<" : "<<a[i]<<endl;
	}
    return 0;
}

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

int main(){
  char a[10],b[200],c[10];

  scanf("%s %s %s", a, b, c);

  printf("A%cC\n", b[0]);

  return 0;
}


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

int main() {
	int r, b, g,an;
	cin >> r >> b >> g;
	an = 100 * r + 10 * b + g;
	if ((an % 4) == 0)cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 256
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
V = sum(A)
C = 0
for i in A:
    if i >= V / (4 * M):
        C += 1
    if C == M:
        break
if C == M:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define ALL(obj) (obj).begin(),(obj).end()
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef priority_queue<int> p_que;
typedef priority_queue<int, vector<int>, greater<int>()> p_que_rev;
// const int INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    string verdict;
    const string male = "Male";
    const string female = "Female";
    const string vacant = "Vacant";
    int lo = 0;
    int hi = n - 1;
    int mid = (lo + hi) / 2;
    int mode;
    int k = 1;
    bool flag;
    for (int i=0; i<20; ++i){
        if(i == 0){
            cout << lo << endl;
            cin >> verdict;
            if(verdict == male){
                flag = true;
            }
            else if(verdict == female){
                flag = false;
            }
        }
        else if(i == 1){
            cout << hi << endl;
            cin >> verdict;
        }
        else {
            mid = (lo + hi) / 2;
            cout << mid << endl;
            cin >> verdict;
            if(flag){
                if((verdict == male && mid % 2 == 1) || (verdict == female && mid % 2 == 0)){
                    hi = mid - 1;
                }
                else if((verdict == female && mid % 2 == 1) || (verdict == male && mid % 2 == 0)){
                    lo = mid + 1;
                }
            }
            else {
                if((verdict == female && mid % 2 == 1) || (verdict == male && mid % 2 == 0)){
                    hi = mid - 1;
                }
                else if((verdict == male && mid % 2 == 1) || (verdict == female && mid % 2 == 0)){
                    lo = mid + 1;
                }
            }
        }
        if(verdict == vacant){
            break;
        }
    }
    return 0;
}

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

using namespace std;
#define ll long long
#define pb push_back

int main()
{	
	string s1, s2;
	cin >> s1 >> s2;
	sort(s1.begin(), s1.end());
	sort(s2.rbegin(), s2.rend());
	
	int n1 = s1.size();
	int n2 = s2.size();
	if(s1 == s2 && n1 < n2) {
		cout << "Yes\n";
	}
	else if(s1<s2) cout << "Yes\n";
	else cout << "No\n";
	return 0;
}


Measured memory_bytes: 3628
#ifdef MY_LOCAL
#define MY_NAMESPACE(ns) namespace ns {
#define MY_NAMESPACE_    }
#define MY_DEBUG(s)      s
#else
#define MY_NAMESPACE(ns) 
#define MY_NAMESPACE_    
#define MY_DEBUG(s)      
#endif

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define EPS (1e-7)


MY_NAMESPACE(testbed)
int main()
{
	int n;
	cin >> n;
	vector<int> a(n), b(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a[i] >> b[i];
	}
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	int res = 0;
	if (n % 2 == 0)
	{
		res = (b[n / 2] + b[n / 2 - 1]) - (a[n / 2] + a[n / 2 - 1]) + 1;
	}
	else
	{
		res = b[(n - 1) / 2] - a[(n - 1) / 2] + 1;
	}
	cout << res << "\n";
	return 0;
}
MY_NAMESPACE_

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

using namespace std;

int main(){

	int n, l;
	cin >> n >> l;
	string str;
	multiset<string> st;
	while(n--){
		cin >> str;
		st.insert(str);
	}
	for(auto s : st){
		cout << s;
	}
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)  for(int i = 0; i < n; i++)
#define all(cont) cont.begin(), cont.end()
#define unique(a)  sort(all(a)) , (a).erase(unique((a).begin(), (a).end()),(a).end())
#define rall(cont) cont.rbegin(), cont.rend()
#define sz(x) (int)(x).size()
#define fastio          ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PB push_back
#define endl "\n"
#define F first
#define S second
#define mod 1000000007
const int N = 2e5 + 5;
#define PI acos(-1.0)
typedef long long ll;
#define int long long
typedef long double ld;
typedef vector<int> VI;
#define pqll_max priority_queue<ll> // max heap. push(),pop(),top(),size(),empty()
#define pqll_min priority_queue<ll,vector<ll>,greater<ll> >
#define lb(v,val)   lower_bound(v.begin(),v.end(),val) //first equal to or lower than [------------
#define ub(v,val)   upper_bound(v.begin(),v.end(),val) //first greater than ------------)
#define bs(v,x) binary_search(v.begin(),v.end(),x)
inline ll add(ll x, ll y) { x += y; if (x >= mod) x -= mod; return x; }
inline ll sub(ll a, ll b) { if (a < b)swap(a, b); return (((a%mod) - (b%mod) + mod) % mod); }
inline ll mul(ll x, ll y) { return (x%mod * 1ll * y%mod) % mod; }
inline ll pwr(ll a, ll b) { ll x = 1 % mod; while (b) { if (b & 1) x = mul(x, a); a = mul(a, a); b >>= 1; }return x % mod; }
inline ll inv(ll a) { return pwr(a, mod - 2) % mod; }
ll gcd(ll a, ll b) { if (!a)return b % mod; return gcd(b%a, a) % mod; }
#define debug(x) cout << #x << " = " << x << endl;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
	cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
#define in(container) for (auto &it : container) cin>>it;
#define out(container) for (auto it : container) cout << it << " "; cout << endl;
signed main()
{
	fastio;
	int a, b, c;
	cin >> a >> b >> c;
	cout << c << " " << a << " " << b << endl;

}

Measured memory_bytes: 256