akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define pb push_back
#define pll pair<ll, ll> 
#define vl vector<ll> 
#define vvl vector< vector<ll> > 
#define vlp vector< pair<ll, ll> >
#define vllp vector<pair<pll, ll> > 
#define mll map<ll, ll> 
#define rep(i,a)  for(ll i=0; i< a; i++)
#define rep1(i,a)   for(ll i = 1; i< a; i++)
#define foi(i, a, b)    for(ll i = a; i<b ; i++)
#define fod(i, a, b)    for(ll i = a; i>=b ; i--)
#define mp make_pair
#define all(v)  (v).begin(), (v).end()
#define fst first
#define sec second
#define ff first.first
#define fs first.second
#define max3(a, b, c)   max(max(a, b), c)
#define min3(a, b, c)   min(min(a, b), c)
#define MAX 1000001
#define MOD 1000000007
// #define MOD 998244353
#define endl "\n"
#define INF (ll)1e18
#define s(v) (ll)v.size()
#define e(v) v.empty()
#define bscount(x) __builtin_popcountll(x)
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
// using namespace __gnu_pbds;

ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll lcm(ll a, ll b){return a*b/gcd(a, b);}
ll fexp(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%MOD; b/=2;a=a*a%MOD;}return ans;}
ll inverse(ll a, ll p){return fexp(a, p-2);} 
void ingraph(vvl& graph, ll m){ll x, y;rep(i, m){cin>>x>>y;x--, y--;graph[x].pb(y);graph[y].pb(x);}}
ll modify(ll n){ll res = n;res%=MOD;res+=MOD;res%=MOD;return res;}

int main(){
    // #ifndef ONLINE_JUDGE
    //     freopen("../input.txt", "r", stdin);
    //     freopen("../output.txt", "w", stdout);
    // #endif
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll t;
    // cin>>t;
    t = 1;
    while(t--){
        ll a, v, b, w, t;
        cin>>a>>v>>b>>w>>t;
        ll del = abs(a - b);
        if(v < w)   {cout<<"NO";return 0;}
        if((v - w)*t >= del)    cout<<"YES";
        else cout<<"NO";
    }
}

Measured memory_bytes: 3656
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a;
        int max = 0;
        int[] nums = new int[100000];
        for(int i=0;i<n;i++){
            a = sc.nextInt();
            nums[a]++;
        }
        for(int i=1;i<100000-1;i++){
            max = Math.max(max,nums[i-1]+nums[i]+nums[i+1]);
        }
        System.out.println(max);
    }
}

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

const int INF = (1e+9) * 2;

int main() {
	int n, r[200001] = {0};
	cin >> n;
	for(int i = 0; i < n; ++i)
		scanf("%d", &r[i]);
	
	int ans = -INF, min_r = r[0];
	for(int i = 1; i < n; ++i){
		ans = max(ans, r[i] - min_r);
		min_r = min(min_r, r[i]);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2028
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	vector<string>in(3);
	rep(i,3)cin>>in[i];
	int q=0;
	vi co(3);
	while(co[q]!=in[q].size()){
		int c=in[q][co[q]]-'a';
		co[q]++;
		q=c;
	}
	cout<<(char)('A'+q)<<endl;
}






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

using namespace std;

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

  string s, t; cin >> s >> t;
  int n = s.length();
  int m = t.length();
  int dp[n+1][m+1];
  for(int i = 0; i<=n; ++i) {
    for(int j = 0; j<=m; ++j) {
      dp[i][j] = 0;
    }
  }
  for(int i = 0; i<n; ++i) {
    for(int j = 0; j<m; ++j) {
      if(s[i] == t[j]) {
        dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j]+1);
      }
      dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j]);
      dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j+1]);
    }
  }

  // Reconstruct answer
  int ci = n, cj = m;
  string ret = "";
  while(ci > 0 && cj > 0) {
    if(dp[ci][cj] == dp[ci-1][cj-1]+1 && s[ci-1] == t[cj-1]) {
      ret = s[ci-1] + ret;
      ci--;
      cj--;
    }
    else if(dp[ci][cj] == dp[ci-1][cj]) {
      ci--;
    }
    else {
      cj--;
    }
  }
  assert(ret.length() == dp[n][m]);
  cout << ret << endl;
}


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

const int ac = 1e6 + 6;
int A[ac];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	for (int i = 0; i < n + 1; i++) cin >> A[i];
	long long s = 0;
	for (int i = 0; i < n; i++)
	{
		int x; cin >> x;
		s += min(x, A[i]); x -= min(x, A[i]);
		s += min(x, A[i + 1]); A[i + 1] -= min(x, A[i + 1]);
	}
	cout << s << '\n';
}


Measured memory_bytes: 640
#include <iostream>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

int main()
{
	string s;
	getline(cin, s);

	istringstream is(s);
	vector<int> st;
	while (is >> s)
	{
		size_t t = st.size();
		switch (s[0]) 
		{
		case '+': st[t - 2] += st[t - 1]; st.erase(st.end() - 1); break;
		case '-': st[t - 2] -= st[t - 1]; st.erase(st.end() - 1); break;
		case '*': st[t - 2] *= st[t - 1]; st.erase(st.end() - 1); break;
		default: st.push_back(stoi(s));
		}
	}

	cout << st[0] << endl;

	return 0;
}

Measured memory_bytes: 3152
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>

#define _GLIBCXX_DEBUG
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;

int main(int argc, const char * argv[]) {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    int64_t n;
    cin >> n;
    vi a(n);
    for(int i=0; i<n; i++){
        cin >> a.at(i);
    }
    double tmp = 0;
    for(int i=0; i<n; i++){
        tmp += 1.0/a.at(i);
    }
    cout << fixed << setprecision(6);
    cout << 1/tmp << endl;
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

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();}

//typedef
//------------------------------------------
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstring;
typedef pair<int, int> pint;
typedef pair<pint, int> ppint;
typedef pair<int, pint> pintp;
typedef unsigned int uint;
typedef long long llint;
typedef unsigned long long int ullint;

//container util
//------------------------------------------
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
#define EXIST(v,i) (find((v).begin(), (v).end(), i) != (v).end())
#define ERASE(v,i) (v).erase(remove((v).begin(),(v).end(),i),(v).end())
#define me (*this)

//repetition
//------------------------------------------
#define rep(i,s) for(int i=0; i<(int)(s); i++)

//constant
//--------------------------------------------
const int INF = 100000000;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLEAR(a) memset((a), 0 ,sizeof(a))

//debug
#define debug(x)  cerr << #x << " = " << (x) << endl

int main() {
	while(1) {
		static int n, m, p;
		cin >> n >> m >> p;
		if(!n && !m && !p)
			break;
		float rate = 1.0 - (float)p / 100;
		vint data;
		rep(i,n) {
			static int t;
			cin >> t;
			data.pb(t);
		}
		int sum = accumulate(all(data), 0) * 100;
		int pay = data.at(m - 1) != 0 ? sum * rate / data.at(m - 1): 0;
		cout << pay << endl;
	}
	return 0;
}

Measured memory_bytes: 0
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array;


void main() {
    string vo = "aiueo";
    char a;
    scan(a);
    writeln(vo.canFind(a) ? "vowel" : "consonant");
}



void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}


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

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

typedef long long ll;

const int INF = 1 << 30;
const ll LLINF = 1LL << 62;

int mod = 1000000007;

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string S; cin >> S;
    int ans = S.length();
    while(true){
        ans -= 2;
        string temp = ""; rep(i, ans) temp += S[i];
        int mid = ans/2;
        bool ok = true;
        for(int i = 0; i < mid; i++){
            if(temp[i] != temp[i+mid]) ok = false;
        }
        if(ok){
            cout << ans << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 256
using System;

class Class01
{
    public static void Main(string[] args)
    {
        int[] a = new int[10];
        int b = 0;

        for (int i = 0; i < 10; i++)
        {
            a[i] = int.Parse(Console.ReadLine());
        }

        for (int i = 0; i < 9; i++)
        {
            for (int j = 0; j < 9; j++)
                if (a[j] < a[j+1])
                {
                    b = a[j];
                    a[j] = a[j+1];
                    a[j+1] = b;
                }
        }

        for (int i = 0; i < 3; i++)
        {
            Console.WriteLine(a[i]);
        }
    }
}

Measured memory_bytes: 9204
#include<stdio.h>
#include<stdlib.h>
long long a[200000]={0};
int cmp(const void *a,const void *b)
{
	return *(long long *)b-*(long long *)a;
} 
int main()
{
	long long k,n,i=0,s=0;
	scanf("%lld %lld",&n,&k);
	for(i=0;i<n;i++)
		scanf("%lld",&a[i]);
	qsort(a,n,sizeof(long long),cmp);
	for(i=k;i<n;i++)
	{
		s=s+a[i];
	}
	printf("%lld",s);
}

Measured memory_bytes: 3324
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
static const int INF = 1 << 20;

int main(){
	int V, E;
	cin >> V >> E;
	vector<vector<int> > adj(V, vector<int>(V, INF));
	for(int i = 0; i < E; i++){
		int s, t, d;
		cin >> s >> t >> d;
		adj[s][t] = min(adj[s][t], d);
	}
	vector<vector<int> > memo(1 << V, vector<int>(V, INF));
	int res = INF;
	for(int i = 1; i < (1 << V); i++){
		for(int j = 0; j < V; j++){
			if(i == 1){
				if(j == 0) memo[i][j] = 0;
				continue;
			}
			if(!(i & (1 << j))) continue;
			for(int k = 0; k < V; k++){
				if(k == j) continue;
				if(!(i & (1 << k))) continue;
				memo[i][j] = min(memo[i][j], memo[i - (1 << j)][k] + adj[k][j]);
			}
			if(i == (1 << V) - 1){
				if(adj[j][0] == INF) continue;
				res = min(res, memo[i][j] + adj[j][0]);
			}
		}
	}
	cout << (res == INF ? -1 : res) << endl;
	return 0;
}



Measured memory_bytes: 6220
#include<stdio.h>
int main(void){
    int a, c;
    char b;
    while (1)
    {
        scanf("%d %c %d", &a, &b, &c);
        if (b == '?')
        {
            break;
        }
        else if (b == '+')
        {
            printf("%d\n", a + c);
        }
        else if (b == '-')
        {
            printf("%d\n", a - c);
        }
        else if (b == '*')
        {
            printf("%d\n", a * c);
        }
        else if (b == '/')
        {
            printf("%d\n", a / c);
        }
    }
    return 0;
}


Measured memory_bytes: 2096
using namespace std;

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <limits>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <numeric>
typedef long long ll;
typedef pair<int,int> p;

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

int main()
{
  // input & declare
  int n,a;
  cin >> n >> a;

  if (n % 500 <= a) {
    std::cout << "Yes" << '\n';
  }else{
    std::cout << "No" << '\n';
  }
}


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

int main(){
  string a,b,c;
  int s,d;
  cin >> a>>b>>s>>d>>c;
  if(a==c)cout <<s-1<<" "<<d;
  else if(b==c)cout<<s<<" "<<d-1;
  else{
    cout <<s<<" "<<d;
  }
}


Measured memory_bytes: 256
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 10000000
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wt = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, initialBufSize), maxBufSize)
	defer wt.Flush()

	n := nextInt()

	ans := 0
	for i := 1; i <= n; i++ {
		if i%3 != 0 && i%5 != 0 {
			ans += i
		}
	}

	puts(ans)
}


Measured memory_bytes: 1768
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations, accumulate
from operator import add, mul, sub, itemgetter, attrgetter


import sys
# sys.setrecursionlimit(10**6)
# readline = sys.stdin.buffer.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(readline())


def read_int_n():
    return list(map(int, readline().split()))


def read_float():
    return float(readline())


def read_float_n():
    return list(map(float, readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        error_print(e - s, 'sec')
        return ret

    return wrap


def ref(L):
    L = int(L, base=2)
    ans = 0
    for a in range(L+1):
        for b in range(L+1):
            if (a + b <= L) and (a ^ b == a + b):
                # print(a, b, a^ b, a+b)
                ans += 1
    return ans



@mt
def slv(L):
    M = 10**9 + 7
    ans = 1
    m = 0
    for b in map(int, L):
        m *= 3
        if b == 1:
            m += ans
            ans *= 2

        ans %= M
        m %= M
    ans += m
    ans %= M
    return ans


def main():
    L = read_str()
    print(slv(L))


if __name__ == '__main__':
    main()


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

const int N = 110;

char str[N];

int main() {
	
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	
	cin >> str;
	int len = strlen(str);
	for (int i = 1; i < len; i++) if (str[i - 1] == 'A' && str[i] == 'C') {
		cout << "Yes\n";
		return 0;
	}
	cout << "No\n";
	
	return 0;
}


Measured memory_bytes: 3560
use std::io::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    token.parse().ok().unwrap()
}

fn main() {
    let s = input::<String>().chars().collect::<Vec<char>>();

    let ans = if s[0] == 'A'
        && s[2..s.len() - 1].iter().filter(|&&c| c == 'C').count() == 1
        && s[1..]
            .iter()
            .filter(|&&c| c != 'C' && c.is_uppercase())
            .count()
            == 0
    {
        "AC"
    } else {
        "WA"
    };
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
#define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i))
#define all(x) x.begin(),x.end()


int main()
{
	string s, t; cin >> s >> t;
	int ans = 0;
	rep(i, 0, 2)if (s[i] == t[i])++ans;
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
unordered_map <int,vector<int>> mp;
bool vis[200001];
vector <int> v;
int cnt = 0;
void dfs(int x)
{
    vis[x] = 1;
    cnt++;
    for(auto i = mp[x].begin();i!=mp[x].end();i++)
    {
        if(!vis[*i])
        {
            dfs(*i);
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL),cout.tie(NULL);
    int t,n;
    t = 1;
    for(int i=0;i<t;i++)
    {
        int n,k;
        cin>>n>>k;
        for(int i=0;i<k;i++)
        {
            int a,b;
            cin>>a>>b;
            mp[a].push_back(b);
            mp[b].push_back(a);
        }
        for(int i=1;i<=n;i++)
        {
            cnt = 0;
            if(!vis[i])
            {
                dfs(i);
            }
            v.push_back(cnt);
        }
        sort(v.begin(),v.end());
       cout<<v[v.size()-1]<<endl;
    }
    return 0;
}

Measured memory_bytes: 35244
// We only fail when we stop trying
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()

vector<int> v = {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};

int main()
{
  int k;
  cin >> k;
  cout << v[--k] << endl;
  return 0;
}


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

int N;

int main() {
    cin >> N;

    bool f = false;
    for (int i = 0; i <= N/4; i++) {
        for (int j = 0; j <= N/7; j++) {
            if (4*i + 7*j == N) {
                f = true;
                break;
            }
        }
    }

    if (f) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
const p=998244353;
type ary =array[1..100010] of int64;
     
var n,ijk,ans,D1,l,now,last:int64;
    D:ary;
    img:boolean;
    
function pawarmd(a,b:int64):int64;
 var store,ij:int64;
begin
 store:=1;
 for ij := 1 to b do store := store * a mod p;
 pawarmd:=store;
end;
    
procedure sort(p,q :integer; var a :ary);
  var i, j, k ,w:integer;
      
begin i := p; j := q; k:=a[(p+q) div 2];
  repeat
    while a[i] < k do inc(i);
    while k < a[j] do dec(j);
    if i <= j then begin
      w := a[i]; a[i] := a[j]; a[j] := w;
      inc(i);dec(j);
    end
  until i > j;
  if p < j then sort(p,j,a);
  if i < q then sort(i,q,a)
end;   
       
begin
 read(n);
 ans:=1;
 img:=false;
 read(D1);
 l:=1;
 now:=0;
 last:=1;
 
 if D1<>0 then img:=true
 else
  begin
   for ijk := 1 to n-1 do read(D[ijk]);
   sort(1,n-1,D);
   for ijk := 1 to n-1 do
    if D[ijk]=l then inc(now)
    else 
     if D[ijk]-l >=2 then
      begin
       img:=true;
       break;
      end
     else
      begin
       ans:=ans*pawarmd(last,now) mod p;
      
       inc(l);
       last := now;
       now:=1;
      end;
  end;
  
  if not(img) then ans:=ans*pawarmd(last,now) mod p;
 
if img then write(0) else write(ans);
end.

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

typedef long double ld;

const ld EPS = 1e-9;
const ld INF = 1e10;
const ld PI = M_PI;

struct Point{
  ld x, y;
  Point(ld x, ld y):x(x), y(y){}
  Point(){}
};

Point operator+(const Point &a, const Point &b){
  return Point(a.x + b.x, a.y + b.y);
}
Point operator-(const Point &a, const Point &b){
  return Point(a.x - b.x, a.y - b.y);
}
Point operator*(const Point &a, const ld b){
  return Point(a.x * b, a.y * b);
}
Point operator*(const Point &a, const Point &b){
  return Point(a.x*b.x-a.y*b.y, a.x*b.y+a.y*b.x);
}
Point operator/(const Point &a, const ld b){
  return Point(a.x / b, a.y / b);
}

ld dot(const Point &a, const Point &b){
  return a.x*b.x + a.y*b.y;
}

ld norm(const Point &a){
  return dot(a, a);
}

struct Line:vector<Point>{
  Line(Point a = Point(0, 0), Point b = Point(0, 0)){
    this->push_back(a);
    this->push_back(b);
  }
};

Point projection(const Line &l, const Point &p){
  ld t = dot(p-l[0], l[1]-l[0]) / norm(l[0] - l[1]);
  return l[0] + (l[1] - l[0]) * t;
}

Point reflection(const Line &l ,const Point &p){
  return p + (projection(l, p) - p) * 2;
}

int main(){  
  Point p0, p1;
  cin >> p0.x >> p0.y >> p1.x >> p1.y;  
  Line base(p0, p1);
  
  int q;
  cin >> q;
  
  Point p2;
  while(q--){
    cin >> p2.x >> p2.y;
    
    Point ans = reflection(base, p2);
    printf("%.10Lf %.10Lf\n", ans.x, ans.y);
  }
  
  return 0;
}

Measured memory_bytes: 1256
#include <iostream>
#include <list>
#include <set>
#include <vector>
#include <stdio.h>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)

int main()
{
    int n, m;
    int ans = 0;
    cin >> n >> m;
    vector<int> s(n + 1, 0);

    rep(i, m)
    {
        int left, right;
        cin >> left >> right;
        left--;
        s[left]++;
        s[right]--;
    }

    rep(i, n)
    {
        s[i + 1] += s[i];
    }
    rep(i, n)
    {
        if (s[i] == m)
            ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
#define _LIBCPP_DEBUG 0
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1e9 + 7;

int main() {

    int N; cin>>N;
    int sum=0;
    set<ll> A;
    for (int i = 0; i < N; ++i) {
        ll a; cin>>a;
        if(!A.count(a)) {
            A.insert(a);
            sum++;
        }else {
            A.erase(a);
            sum--;
        }
    }

    cout<<sum<<endl;
    

    return 0;
}

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


int main() {

	int N;
	int mochi[110];
	cin >> N;
	for (int i = 0; i < N; i++)cin >> mochi[i];

	set<int> values;
	for (int i = 0; i < N; i++) {
		values.insert(mochi[i]);
	}

	cout << values.size();

}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int min = sc.nextInt();
        int max = sc.nextInt();
        m--;
        while (m-- > 0) {
            min = Math.max(min, sc.nextInt());
            max = Math.min(max, sc.nextInt());
        }
        
        if (min > max) {
            System.out.println(0);
            return;
        }
        System.out.println(max - min + 1);
    }
}


Measured memory_bytes: 63728
#include "bits/stdc++.h"
#define int long long
#define range(i, a, b) for(auto i = a; i < b; i++)
#define rep(i, a) range(i, 0, a)
#define all(a) (a).begin(),(a).end()
using namespace std;
const int MOD = 1e9 + 7, INF = 1e8;
using vi = vector <int>;
using vvi = vector <vi>;

signed main(){
	int n;
	cin >> n;
	int c[n - 1], s[n - 1], f[n - 1];
	rep(i, n - 1)cin >> c[i] >> s[i] >> f[i];

	rep(i, n){
		if(i == n - 1){
			cout << 0 << endl;
			break;
		}
		int ans = s[i];
		range(j, i, n - 1){
			if(!(s[j] <= ans))
				ans += s[j] - ans;
			if(ans % f[j] != 0)
				ans += f[j] - (ans % f[j]);
			ans += c[j];
		}
		cout << ans << endl;
	}
}


Measured memory_bytes: 256
k,a,b=map(int,input().split())
ans=1
i=0
while i<k:
  if i==k-1:
    ans=ans+1
    i=i+1
  elif ans<a:
    ans=a
    i=i+a-1
  else:
    if b-a>=2:
      temp=(k-i)//2
      ans=ans+(b-a)*temp
      i=i+2*temp
    else:
      ans=ans+k-i
      i=k
print(ans)


Measured memory_bytes: 3060
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(n)]
ab.sort()
ans = 0
nokori = m
for i in range(n):
	if nokori >= ab[i][1]:
		ans += ab[i][0]*ab[i][1]
		nokori -= ab[i][1]
		if nokori == 0:
			break
	else:
		ans += ab[i][0]*nokori
		break
print(ans)
	

Measured memory_bytes: 27760
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val (n, a, b) = (0 until 3).map { sc.nextInt() }
    println(answer133a(n, a, b))
}

fun answer133a(n: Int, a: Int, b: Int): Int {
    return Math.min(n * a, b)
}

Measured memory_bytes: 31396
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-3;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
int h[1 << 17]; int n,k;
ll dp[1 << 17];
int main() {
	cin >> n; cin >> k;
	rep1(i, n)cin >> h[i];
	dp[1] = 0;
	Rep1(i, 2, n) {
		dp[i] = INF;
		Rep(j, max(1, i - k),i) {
			dp[i] = min(dp[i], dp[j] + abs(h[j] - h[i]));
		}
	}
	cout << dp[n] << endl;
	//stop
	return 0;
}

Measured memory_bytes: 1408
package main

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

func main() {
	defer writer.Flush()

	N, K, S := ReadInt(), ReadInt(), ReadInt()
	e := int(1e9)
	if S == e {
		e = 1
	}

	for i := 0; i < K; i++ {
		Printf("%d ", S)
	}
	for i := K; i < N; i++ {
		Printf("%d ", e)
	}
	Println()
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}

var writer = bufio.NewWriter(os.Stdout)

func Printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }
func Println(a ...interface{})               { fmt.Fprintln(writer, a...) }


Measured memory_bytes: 2700
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
using namespace std;
typedef long long ll;

string S, T;

int main(){
  cin >> S >> T;
  T.pop_back();
  if (S == T) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3512
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  string s;
  cin >> s;
  int n = s.size();
  rep(i,n)if(s[i]=='?')s[i]='D';
  cout << s << endl;
  
  return 0;
}


Measured memory_bytes: 3780
from collections import defaultdict
from itertools import permutations

n, c = map(int, input().split())
d = [list(map(int, input().split())) for _ in range(c)]
cmat = [list(map(int, input().split())) for _ in range(n)]

dcnt = [defaultdict(int) for _ in range(3)]
for i, ci in enumerate(cmat):
    for j, cij in enumerate(ci):
        mod = (i + j) % 3
        dcnt[mod][cij - 1] += 1

ans = 10 ** 9
for color in permutations(range(c), 3):
    tmp = 0
    for ci, cnt in zip(color, dcnt):
        tmp += sum(d[k][ci] * cnt[k] for k in cnt)
    ans = min(ans, tmp)
print(ans)


Measured memory_bytes: 71768
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))


ans = 0
for i in range(N):
    if i == 0:
        palce = T - H[i] * 0.006
        ans = i+1
    else:
        palce_2 = T - H[i] * 0.006
        if (palce-A)**2 > (palce_2-A)**2:
            palce = T - H[i] * 0.006
            ans = i+1

print(ans)


Measured memory_bytes: 3060
#include <cstddef>
#include <cstdint>
#include <vector>

namespace null_null {

using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
using u32 = std::uint_fast32_t;
using u64 = std::uint_fast64_t;
using usize = std::size_t;

constexpr usize operator"" _z(unsigned long long x) noexcept {
  return static_cast<usize>(x);
}

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

template <typename T, typename V>
typename std::enable_if<std::is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }
template <typename T, typename V>
typename std ::enable_if<std::is_class<T>::value != 0>::type
fill_v(T &t, const V &v) {
  for (auto &e : t) fill_v(e, v);
}

template <typename T, typename V>
inline void chmin(T &a, V b) {
  if (a > b) a = b;
}
template <typename T, typename V>
inline void chmax(T &a, V b) {
  if (a < b) a = b;
}

} // namespace null_null

#include <algorithm>
#include <iostream>
#include <utility>

namespace null_null {

void main_() {
  usize N, D;
  std::cin >> N >> D;
  auto v = make_v<i32>(N, D);
  for (usize i = 0; i < N; i++) {
    for (usize j = 0; j < D; j++) {
      std::cin >> v[i][j];
    }
  }

  i32 cnt = 0;
  for (usize i = 0; i < N; i++) {
    for (usize j = i + 1; j < N; j++) {
      i32 sum = 0;
      for (usize t = 0; t < D; t++) {
        sum += (v[i][t] - v[j][t]) * (v[i][t] - v[j][t]);
      }

      bool flag = false;
      for (i32 i = 0; i * i <= sum; i++) {
        if (i * i == sum) {
          flag = true;
          break;
        }
      }

      if (flag) cnt++;
    }
  }

  std::cout << cnt << std::endl;
}

} // namespace null_null

int main() {
  null_null::main_();
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) std::cout<<arg<<"\n"
#define prin2(arg1,arg2) std::cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using std::cin;
typedef long long ll;
typedef std::pair<int,int> pi;
typedef std::vector<int> vi;
const int INF=1e+9;
const ll INFLL=1e+17;
int A,B;
void solve(){
  int res=(A+B)%24;
  prin(res);
}
int main(){
  cin>>A>>B;
  solve();
  return 0;
}


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

using namespace std;

typedef long long ll;

int main() {
    int n;
    cin >> n;
    vector<int> a(n, 0), b(n, 0);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >> b[i];
    }

    int ans = 0;
    for (int i = 0; i < n; ++i) {
        int cnt = 0;
        for (int j = 0; j <= i; ++j) {
            cnt += a[j];
        }
        for (int j = i; j < n; ++j) {
            cnt += b[j];
        }
        ans = max(ans, cnt);
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
use utf8;
use warnings;
use strict;
use feature qw/say/;

chomp(my $n = <>);
my @a;
for my $i (1..$n) {
    chomp(my $ai = <>);
    push(@a, $ai);
}
my @sorted_a = sort {$b <=> $a} @a;
my $a_max = $sorted_a[0];
my $a_second_max = $sorted_a[1];
for my $ai (@a){
    if ($ai == $a_max) {
        say $a_second_max;
    } else {
        say $a_max;
    }
}

Measured memory_bytes: 44668
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); i++)
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())
#define sort_g(v) sort(all(v), greater<int>())
#define dump(x) cerr << #x << ' ' << '=' << ' ' << x << endl

int main() {
	int N, M, T;
    cin >> N >> M;
    int sum = 0;
    rep(i, M) {
        cin >> T;
        sum += T;
    }

    cout << (N - sum >= 0 ? N - sum : -1) << endl;
}

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

using namespace std;


#define uniq(x)  x.erase(unique(x.begin(),x.end()), x.end()) //Unique value find from vector
#define upper(arr,n,fixed) upper_bound(arr,arr+n,fixed)-arr  //Upper value search  >
#define lower(arr,n,fixed) lower_bound(arr,arr+n,fixed)-arr  //Lower value search  >=
#define FOR(i,a,n) for(int i=a; i<(int)n; i++)
#define FORI(i,a,n) for(int i=a; i>=(int)n; i--)
#define pii pair<int,int>
#define vpii vector<pii>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz(a) int((a).size())
#define fastIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define endl "\n"
#define all(a) a.begin(), a.end()
#define MEMSET(p,i) memset(p,i,sizeof(p))

typedef long long LL;
typedef unsigned long long ULL;

int n;

double memo[301][301][301];
double solve(int a, int b, int c)
{

	auto &dpm = memo[a][b][c];

	if(dpm != -1.0L)
		return dpm;

	if((a | b | c) == 0)
		return dpm = 0.0L;


	double q2 = (double)n/(a+b+c);
	
	double sum = 0.0L;
	
	if(a){
		sum += (solve(a-1,b,c) + q2)*a/(a+b+c);
	}
	if(b){
		sum += (solve(a+1,b-1,c) + q2)*b/(a+b+c);
	}
	if(c){
		sum += (solve(a,b+1,c-1) + q2)*c/(a+b+c);
	}

	dpm = sum;
	

	return dpm;
}

int main(void)
{
	fastIO();
	cin >> n;
	int a = 0, b = 0, c = 0;
	FOR(i,0,n){
		int x;
		cin >> x;
		if(x == 1)
			a++;
		else if(x == 2)
			b++;
		else
			c++;
	}
	
	FOR(i,0,301)
		FOR(j,0,301)
			FOR(k,0,301)
				memo[i][j][k] = -1.0L;

	cout << fixed << setprecision(14) << solve(a,b,c) << endl;

}

// 53.74201499247028

Measured memory_bytes: 213376
#define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	vector<int> h(10);

	for (int i = 0; i < h.size(); i++)
	{
		cin >> h.at(i);
	}

	sort(h.begin(), h.end());
	reverse(h.begin(), h.end());

	for (int i = 0; i < 3; i++)
	{
		cout << h.at(i) << endl;
	}

}


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

bool chk(string s)
{
    int l = s.size();

    for(int i = 0, j = l - 1; i < j; i++, j--){
        if(s[i] != s[j]) return 0;
    }

    return 1;
}

int main()
{
    string s;

    cin >> s;

    int l = s.size();

    if(!chk(s)){
        cout << "No" << endl;
        return 0;
    }

    string ch = s.substr(0, l / 2);

    if(!chk(ch)){
        cout << "No" << endl;
        return 0;
    }

    string ss = s.substr(((l + 3) / 2) - 1, (l - (l + 3) / 2) + 1);

    if(!chk(ss)){
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>

using namespace std;

int main() {
	int a[5], ans;
	for (int i = 0; i < 3; i++)
		scanf("%d", &a[i]);
	sort(a, a + 3);
	ans = (10 * a[2]) + a[1] + a[0];
	printf("%d\n", ans);
	return 0;
}

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

// @@ !! LIM()

int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll N, M; cin >> N >> M;
  vector<ll> H(N);
  for (ll i = 0; i < N; i++) cin >> H.at(i);
  vector<bool> good(N, true);
  for (ll i = 0; i < M; i++) {
    ll a, b; cin >> a >> b; a--; b--;
    if (H.at(a) <= H.at(b)) good.at(a) = false;
    if (H.at(a) >= H.at(b)) good.at(b) = false;
  }
  ll cnt = 0;
  for (ll i = 0; i < N; i++) {
    if (good.at(i)) cnt++;
  }
  cout << cnt << endl;

  return 0;
}



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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll s, w;
  cin >> s >> w;

  cout << (s <= w ? "unsafe" : "safe") << "\n";
}

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

int main(){
  int N,K; cin >> N >> K;
  
  int x;
  int sum;
  for(int i=0; i<N; i++){
    cin >> x;
    sum+=(2*min(x,abs(K-x)));
  }
  cout << sum << endl;
}

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

string w[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };

int main()
{
	int m, d;
	while (cin >> m >> d, m)
	{
		int y = 2004;
		if (m < 3)
		{
			y--;
			m += 12;
		}

		int z = (y + y/4 - y/100 + y/400 + (13*m+8)/5 + d) % 7;
		cout << w[z] << endl;
	}
}

Measured memory_bytes: 0
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toInt()}
    val b = readLine()!!.split(" ").map { it.toInt()}
    val c = readLine()!!.split(" ").map { it.toInt()}
    var s = 0
    for (i in 0 until n){
        s  += b[a[i] - 1]
        if (i != n-1 && a[i+1] == a[i] + 1)s += c[a[i] - 1]
    }
    println(s)
}

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

int main() {
    int n, p; cin >> n >> p;
    string s; cin >> s;

    if (p == 2 || p == 5) {
        long long ans = 0;
        for (int right = 0; right < n; right++) {
            if ((s[right]-'0')%p == 0) {
                ans += right+1;
            }
        }
        cout << ans << endl;
        return 0;
    }

    vector<int> d(n+1);
    int base = 1;
    for (int i = n-1; 0 <= i; i--) {
        int a = (s[i]-'0')* base % p;
        d[i] = (d[i+1]+a) % p;
        base *= 10; base %= p; // オーバーフロー対策
    }
    vector<int> cnt(p);
    long long ans = 0;
    for (int i = n; 0 <= i; i--) {
        ans += cnt[d[i]];
        cnt[d[i]]++;
    }
    cout << ans << endl;
    return 0;
}

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

int main()
{
    int a,b;
    cin>>a>>b;
    int c=a/b;
    int d=a%b;
    double e=double(a)/double(b);
    cout<<c<<" "<<d<<" "<<fixed<<e<<endl;
    
    return 0;
}

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

#define ll long long int
#define pb push_back
#define endl "\n"
ll input;
int main() {
    int t=1;
    // cin>>t;
    while(t--)
    {
        for(int i=0;i<5;i++)
        {
            cin>>input;
            if(input==0)
            {
                cout<<i+1<<endl;
                break;
            }
        }
        
    }
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define ios ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int mod=1000000007;
int main(){
	ios;
	int n,i,j,k,s=0,x;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=n;j++)
		{
			x=__gcd(i,j);
			for(k=1;k<=n;k++)
			s+=__gcd(x,k);
		}
	}
	cout<<s;
	return 0;
}

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

int main() {
    double w, h, x, y, ans;
    cin >> w >> h >> x >> y;
	int num = (x == w / 2 && y == h / 2) ? 1 : 0;
	ans = w * h / 2.0;
	printf("%.10f %d\n", ans, num);
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
#include <map>
#include <set>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <list>
#include <utility>
#include <memory>
#include <cstring>
#include <fstream>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <ios> 
#include <bits/stdc++.h> 
using namespace std;
int n;
int v[29][200004]; 
int ans=0;
int main(){
   	cin>>n;
   	for (int i=0;i<n;i++){
  		int x;scanf ("%d",&x);
   		for (int j=0;j<29;j++)
   			v[j][i]=x%(1<<(j+1));
   	}
   	for (int i=0;i<29;i++) sort(v[i],v[i]+n);
	for (int i=0;i<n;i++){
    	int x;scanf ("%d",&x);
    	for (int j=0;j<29;j++){
    		int t=x%(1<<(j+1));
    		int xzy=lower_bound(v[j],v[j]+n,(1<<j)-t)-v[j];
    		int ctc=upper_bound(v[j],v[j]+n,(1<<(j+1))-t-1)-v[j]; 
    		int hhy=lower_bound(v[j],v[j]+n,(1<<j)*3-t)-v[j]; 
    		if ((ctc-xzy+n-hhy)%2) ans^=(1<<j);
    	}
    }
    cout<<ans;
}

Measured memory_bytes: 22912
#include <cstdio>
#include <algorithm>
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
using namespace std;

typedef long long ll;


int main(void) {
  int v;
  scanf("%d", &v);
  printf("ABC%d\n", v);
  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;

int main() {
    int64 d,n;
    cin >> d >> n;
    if (n == 100) n++;
    for (int i=0; i<d; i++) n *= 100;
    cout << n << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
static class P
{
    static void Main()
    {
        HashSet<char> set = new HashSet<char>();
        string s = Console.ReadLine();
        for (int i = 0; i < s.Length; i++)
        {
            set.Add(s[i]);
        }
        Console.WriteLine(set.Count == 2 ? "Yes" : "No");
    }
}


Measured memory_bytes: 13280
ary=[list(map(int,input().split()))for p in range(3)]
for i in range(int(input())):
  data=int(input())
  for j in range(3):
    for k in range(3):
      if ary[j][k]==data:
          ary[j][k]=0
ans="No"
for i in range(3):
  if ary[i][0]==ary[i][1]==ary[i][2]==0 or ary[0][i]==ary[1][i]==ary[2][i]==0:
      ans="Yes"
if ary[0][0]==ary[1][1]==ary[2][2]==0 or ary[2][0]==ary[1][1]==ary[0][2]==0:
    ans="Yes"
print(ans)


Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <map>
using namespace std;
#define ms(a, x) memset(a, x, sizeof(a))
#define fore(i, a, n) for (long long i = a; i < n; i++)
#define ford(i, a, n) for (long long i = n - 1; i >= a; i--)
#define si(a) scanf("%d", &a)
#define sl(a) scanf("%lld", &a)
#define sii(a, b) scanf("%d%d", &a, &b)
#define siii(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sll(a, b) scanf("%lld%lld", &a, &b)
#define slll(a, b, c) scanf("%lld%lld%lld", &a, &b, &c)
#define debug(a) cout << a << endl
#define pr(a) printf("%d ", a)
#define endl '\n'
#define pi acos(-1.0)
#define tr t[root]
#define lson t[root << 1]
#define rson t[root << 1 | 1]
#define IO ios::sync_with_stdio(false), cin.tie(0)
#define ull unsigned long long
#define py puts("Yes")
#define pn puts("No")
#define pY puts("YES")
#define pN puts("NO")
#define re(i, a, b) for (int i = a; i <= b; ++i)
#define de(i, a, b) for (int i = a; i >= b; --i)
const double eps = 1e-8;
inline int sgn(const double &x) { return x < -eps ? -1 : x > eps; }
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const ll mode = 192600817;
template <class T>
inline void cmin(T &a, T b) { ((a > b) && (a = b)); }
template <class T>
inline void cmax(T &a, T b) { ((a < b) && (a = b)); }
ll gcd(ll a,ll b)
{
    return b==0?a:gcd(b,a%b);
}
int main()
{
  ll a, b, n;
  cin >> a >> b >> n;
  if(b==1)
  {
    cout<<0<<endl;return 0;
  }
  if (n < b)
  {
    cout << floor((double)(a * n) / b) << endl;
  }
  else
  {
    cout << ll(a - 1) -a/b<< endl;
  }

  return 0;
}


Measured memory_bytes: 3912
/*                         _
                        _ooOoo_
                       o8888888o
                       88" . "88
                       (| -_- |)
                       O\  =  /O
                    ____/`---'\____
                  .'  \\|     |//  `.
                 /  \\|||  :  |||//  \
                /  _||||| -:- |||||_  \
                |   | \\\  -  /'| |   |
                | \_|  `\`---'//  |_/ |
                \  .-\__ `-. -'__/-.  /
              ___`. .'  /--.--\  `. .'___
           ."" '<  `.___\_<|>_/___.' _> \"".
          | | :  `- \`. ;`. _/; .'/ /  .' ; |
          \  \ `-.   \_\_`. _.'_/_/  -' _.' /
===========`-.`___`-.__\ \___  /__.-'_.'_.-'================

                  Please give me AC.
*/

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>

using namespace std;

using int64 = long long;
using uint64 = unsigned long long;
using vi = vector<int>;
using vl = vector<int64>;
using pii = pair<int, int>;
using pll = pair<int64, int64>;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define print(x) cout << (x) << '\n'
#define print2(x, y) cout << (x) << ' ' << (y) << '\n'
#define print3(x, y, z) cout << (x) << ' ' << (y) << ' ' << (z) << '\n'
#define printn(v) rep(i, (v).size() - 1) cout << (v)[i] << ' '; cout << (v)[n - 1] << '\n';
#define debug(x) cerr << #x << ": " << (x) << '\n'
#define debug2(x, y) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v) for (size_t _ = 0; _ < v.size(); ++_){cerr << #v << "[" << _ << "] : " << v[_] << '\n';}
// constant
const int INF = (1<<30) - 1;
const int64 INF64 = (1LL<<62) - 1;

// End of template.


int main(){
    cout << fixed << setprecision(15);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    int h[100100];
    cin >> n;
    rep(i, n) cin >> h[i];

    int temp = 0;
    int i = 0;
    while (i < n) {
        int ans = 0;
        int j = i;
        for (; j < n - 1; ++j) {
            if (h[j] >= h[j + 1])
                ans += 1;
            else
                break;
        }
        i = j + 1;
        if (temp < ans) temp = ans;
    }

    print(temp);

    return 0;
}



Measured memory_bytes: 640