akhauriyash/Code-Regression huggingface dataset:
#include<math.h>
#include<limits.h>
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<sstream>
#include<list>
#include<queue>
#include<algorithm>
#include<functional>
#include<map>
#include<set>
#include<utility>
#include<initializer_list>
#include<tuple>
#include<regex>
using namespace std;
#define ull unsigned long long
#define ll long long
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define rep1n(i, n) for(int i=1;i<=(int)(n);i++)
#define all(t) t.begin(), t.end()
#define rall(t) t.rbegin(), t.rend()
#define mat(type, row, col, init) vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout<<(cond? "Yes":"No")<<endl;
#define YES(cond) cout<<(cond? "YES":"NO")<<endl;
int main() {
	ll n, k;
	cin >> n >> k;

	vector<pair<int, int>>a(n);
	rep(i, n)cin >> a[i].first >> a[i].second;
	sort(all(a));
	ll sum = 0;
	ll i = 0;
	while (sum < k) {
		sum += a[i].second;
		i++;
	}
	i--;
	cout << a[i].first << endl;

	return 0;
}





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

int d[50][50];
int dx[]{ 1,-1,0,0 }, dy[]{ 0,0,1,-1 };
int main() {
	int w, h;
	while (scanf("%d%d", &w, &h), w) {
		vector<pair<P, P>>wall;
		rep(i, 2 * h - 1) {
			if (i & 1) {
				rep(j, w) {
					int d; scanf("%d", &d);
					if (d) {
						wall.push_back({ {i / 2 ,j},{i / 2 + 1,j} });
						wall.push_back({ { i / 2 + 1,j },{ i / 2 ,j } });
					}
				}
			}
			else {
				rep(j, w - 1) {
					int d; scanf("%d", &d);
					if (d) {
						wall.push_back({ {i / 2,j},{i / 2,j + 1} });
						wall.push_back({ { i / 2,j + 1 },{ i / 2,j } });
					}
				}
			}
		}
		sort(wall.begin(), wall.end());
		queue<P>que;
		memset(d, 0x3f, sizeof(d));
		que.push(P(0, 0));
		d[0][0] = 1;
		while (!que.empty()) {
			P p = que.front(); que.pop();
			if (p.first == h - 1 && p.second == w - 1)break;
			rep(i, 4) {
				int nx = p.first + dx[i], ny = p.second + dy[i];
				if (0 <= nx&&nx < h && 0 <= ny&&ny < w&&d[nx][ny] == INF && !binary_search(wall.begin(), wall.end(), make_pair(p, P(nx, ny)))) {
					que.push(P(nx, ny));
					d[nx][ny] = d[p.first][p.second] + 1;
				}
			}
		}
		printf(d[h - 1][w - 1] == INF ? "0\n" : "%d\n", d[h - 1][w - 1]);
	}
}

Measured memory_bytes: 3312
sx,sy,tx,ty = map(int,input().split())
S = []
S += "U"*(ty - sy),
S += "R"*(tx - sx),
S += "D"*(ty - sy),
S += "L"*(tx - sx + 1),
S += "U"*(ty - sy + 1),
S += "R"*(tx - sx + 1),
S += "D",
S += "R",
S += "D"*(ty - sy + 1),
S += "L"*(tx - sx + 1),
S += "U"
print(*S, sep = "")

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

using ll = long long;
#define ALL(c) (c).begin(), (c).end()
const int MOD = 1000000007;

int main() {
    string s;
    cin >> s;
    for (int i = s.size() / 2 - 1; i > 0; i--) {
        if (s.substr(0,i) == s.substr(i,i)) {
            cout << i * 2 << endl;
            return 0;
        }
    }
}


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

#define foreach(i, v) for(__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i)
#define BETWEEN(a, x, b) (a<=x&&x<b)

using namespace std;
typedef long long ll;

ll a[200005];
set<int> st;

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

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

    if(i>0&&a[i]>a[i-1]+1){
      cout<<-1<<endl;
      return 0;
    }
  }

  if(a[0]>0){
    cout<<-1<<endl;
    return 0;
  }

  ll ans=0;
  ll d=0;

  for(int i=n-1;i>0;i--){
    if(a[i]==0)continue;

    d--;
    st.insert(a[i]-d);
    if(*st.begin() + d == 0){
      st.erase(st.begin());
    }

    ans += st.size();
  }

  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 8576
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

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

  string s;
  cin >> s;

  int N = s.size();
  int pLeft = 0;
  int score = 0;
  for (int i = 0; i < N; i++) {
    if (s[i] == 'g') {
      if (pLeft > 0) {
        score++;
        pLeft--;
      }
      else {
        pLeft++;
      }
    }
    else { // s[i] == 'p'
      if (pLeft > 0) {
        pLeft--;
      }
      else {
        pLeft++;
        score--;
      }
    }
  }

  cout << score << endl;
  return 0;
}


Measured memory_bytes: 512
n,m,k = gets.split.map(&:to_i)

(n+1).times do |i|
    if n - 2 * i == 0
        if n * m / 2 == 0 
            puts "Yes"
            exit
        else
            next
        end
    end
    
    j = (k - i * m) / (n - 2 * i)
    if 0 <= j && j <= m && i * (m - j) + (n - i) * j == k
        puts "Yes"
        exit
    end
end

puts "No"

Measured memory_bytes: 1788
#include<iostream>
#include<algorithm>
using namespace std;
long long test[1001], uiop[1001], dp[1001][1001];
int main() {
	long long n, a, b, c, ans = 100000000000; cin >> n >> a;
	for (int h = 1; h <= n; h++) {
		cin >> b; test[h] = b;
	}
	for (int h = 1; h <= a; h++) {
		cin >> c; uiop[h] = c;
	}
	for (int h = 1; h < 1001; h++) {
		for (int i = 0; i < 1001; i++) {
			dp[h][i] = 100000000001;
		}
	}
	for (int h = 1; h <= n; h++) {
		for (int i = 1; i <= a; i++) {
			if (h <= i) {
				if (h == 1) {
					for (int j = 1; j <= i; j++) {
						dp[h][i] = min(dp[h][i], dp[h - 1][j]);
					}
				}
				else {
					for (int j = 1; j < i; j++) {
						dp[h][i] = min(dp[h][i], dp[h - 1][j]);
					}
				}
				dp[h][i] += test[h] * uiop[i];
			}
		}
	}
	for (int h = 1; h <= a; h++) {
		ans = min(ans, dp[n][h]);
	}
	cout << ans << endl;
	cin >> n;
}


Measured memory_bytes: 10948
ans = 0
first_b = 0
last_a = 0
same = 0

N = int(input())

for i in range(N):
    s = input()
    ans += s.count("AB")
    if s[0] == "B":
        first_b += 1
    if s[-1] == "A":
        last_a += 1
    if s[0] == "B" and s[-1] == "A":
        same +=1

ans += min(first_b, last_a)
if same > 0 and first_b ==  last_a and first_b == same:
    ans -=1
print(ans)

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

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

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

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

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

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

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

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

fn main() {
    input! {
        n: i32,
        d: [i32; n]
    }

    let mut ans = 0;
    for i in 0..n {
        for j in i + 1..n {
            ans += d[i as usize] * d[j as usize];
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int x,y;
    for(int i=0;i<s.size();i++)
    {
        if(s[i]=='A')
        {
            x=i;
            break;
        }
    }
    for(int j=s.size()-1;j>=0;j--)
    {
        if(s[j]=='Z')
        {
            y=j;
            break;
        }
    }
    cout<< (y-x) +1<<endl;
}


Measured memory_bytes: 3752
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define llu unsigned long long 
#define ll long long 
int read() { llu  x; if (scanf("%llu", &x) == -1)exit(0); return x; }
#define vi vector<int>
#define vb vector<bool>
#define LOCAL_JUDGE
void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef LOCAL_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int main() {
    //c_p_c();
    int n = read();
    string s, t;
    cin >> s; cin >> t;
    if (t.length() != (s.length()+1)) cout << "No" << endl;
    else {
        if (t.substr(0, s.length()) != s) cout << "No" << endl;
        else cout << "Yes" << endl;
    }
    return 0;
}



Measured memory_bytes: 3704
#include<iostream>
#include<algorithm>
#include<climits>
#include<cstring>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define scan(arg) cin>>arg
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
using namespace std;
typedef long long ll;
int n;
int p[100010];
int main(){
  scan(n);
  rep(i,n){
    scan(p[i]);
  }
  bool f[100010];
  memset(f,0,sizeof(f));
  rep(i,n){
    if(i+1==p[i]){
      f[i]=true;
    }
  }
  int j=0,res=0;
  while(j<n){
    if(f[j]){
      if(f[j+1]){
	res++;
	j+=2;
      }
      else{
	res++;
	j++;
      }
    }
    else{
      j++;
    }
  }
  prin(res);

  
  return 0;
}


Measured memory_bytes: 768
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         SORT(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define Yes()           printf("Yes\n")
#define No()            printf("No\n")
#define YES()           printf("YES\n")
#define NO()            printf("NO\n")
#define ceil(x, y)      ((x + y - 1) / (y))
#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'; }

using namespace std;
using ll = long long;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7

void solve() {
  string s; cin >> s;

  if (s.size() % 2 == 1) {
    No();
    return;
  }

  for (int i = 1; i < s.size(); i += 2) {
    if (s[i - 1] == 'h' && s[i] == 'i') {
    } else {
      No();
      return;
    }
  }
  Yes();
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 760
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>

#include <stdio.h>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, k, n) for (int i = (k); i < (n); i++)
#define rrep(i, k, n) for (int i = (k); i >= (n); i++)
#define pb push_back
#define vec vector
#define ref(a) &(a)

const int mod = 1e9 + 7;

typedef long long ll;

using namespace std;

int n;

void solve() {
  cout << "ABC" << n << endl;
  return;
}

int main() {
  cin >> n;
  solve();
  return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
//long long mo = 1e9 + 7;

int main(){
    int x = 0, M=0;
    int N;
    string S;
    cin >> N >> S;
    rep(i,N){
        (S[i] == 'I')? x++:x--;
        M = max(M,x);
    }
    cout << M << endl;
}



Measured memory_bytes: 256
/*
      Ashraful Islam Paran
      27-August-2020
      10:08:47
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f(n) for (int i = 0; i < n; i++)
#define fo(i, x, n) for (int i = x; i < n; i++)
#define fb(i, x, n) for (int i = n - 1; i <= 0; i--)
#define w(t) int t; cin >> t; while (t--)



typedef unsigned long long ull;
typedef vector<long long> vi;
#define ull unsigned long long
#define msi map<string, long long>
#define mii map<long long, long long>
const int MX = 2e5 + 5;
const int INF = 1e18;
#define pb push_back
#define endl "\n"
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define all(x) x.begin(), x.end()
#define ff first
#define ss second


int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    // online submission
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    int a,b,c;
    cin>>a>>b>>c;
    //cout<<a<<b<<c;
    int x=0,y=0;
    if(a==5)
    {
        x++;
    }
    if(a==7)
    {
        y++;
    }
    if(b==5)
    {
        x++;
    }
    if(b==7)
    {
        y++;
    }
    if(c==5)
    {
        x++;
    }
    if(c==7)
    {
        y++;
    }
    //cout<<x<<y;
    //cout<<a<<b<<c;
    if (x==2&&y==1)
    {
        yes;
    }
    else
    {
        no;
    }
    
    
    
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
    return 0;
}

Measured memory_bytes: 3804
let l:[Int] = readLine()!.split(separator:" ").map{Int($0)!}
let x = abs(l[0]), k = l[1], d = l[2]
let m = x % d, n = x / d
print(k<n ? x-d*k : ((k-n)%2 == 0 ? m : d-m))

Measured memory_bytes: 8260
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
using namespace std;
 
int main() {
    string a,b;
    cin >> a >> b;
    if(a[0] == b[2] && a[1] == b[1] && a[2] == b[0]) cout << "YES";
    else cout << "NO";

    cout << endl;
};

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const ll INF=1e18;
const int MOD=1e9+7;
const double pi=acos(-1);

int main(){
  int n,k;
  cin >> n >> k;
  vector<ll>a(n);
  rep(i,n) cin >> a[i];
  ll ans=INF;
  
  for(int bit=0;bit<(1<<(n-1));bit++){
    vector<bool>tower(n-1);
    int cnt=0;
    rep(i,n-1){
      if(bit&(1<<i)){
        cnt++;
        tower[i]=true;
      }
      else tower[i]=false;
    }
    if(cnt<k-1)continue;
    ll sum=0;
    ll nowmax=a[0];
    rep(i,n-1){
      if(!tower[i]) nowmax=max(a[i+1],nowmax);
      else{
        sum+=max(0ll,nowmax-a[i+1]+1);
        nowmax=max(nowmax+1,a[i+1]);
      }
    }
    ans=min(ans,sum);    
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
from itertools import accumulate as acc
from bisect import bisect_right

N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A_acc = [0] + list(acc(A))
B_acc = [0] + list(acc(B))

max_num = 0
for i in range(min(K+1, N+1)):
    # Aからi冊読む
    count_a = i
    time = A_acc[i]
    
    # Bから読めるだけ読む
    count_b = bisect_right(B_acc, K-time)-1
    time += B_acc[count_b]
    
    # print(time, count_a, count_b)
    count = count_a + count_b
    if time <= K:
        max_num = max(max_num, count)

print(max_num)

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

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  for (int i = 0; i < M; ++i) {
    cin >> B.at(i);
  }
  vector<vector<int>> A;
  for (int i = 0; i < N; ++i) {
    vector<int> v(M);
    for (int j = 0; j < M; ++j) {
      cin >> v.at(j);
    }
    A.push_back(v);
  }
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    int sum = 0;
    for (int j = 0; j < M; ++j) {
      sum += A.at(i).at(j) * B.at(j);
    }
    sum += C;
    if (sum > 0) {
      ++ans;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
    
using namespace std;
    
int main(){
 int a,b;
 long double f;
 cin >> a;
 cin >> b;
 f=(a+0.0)/b;
 cout << a/b << " " << a%b << " ";
 cout << std::fixed;
 cout << std::setprecision(6)<< f << endl;
 return 0;
}



Measured memory_bytes: 3276
using System;
using System.Linq;
public class Hello
{

    public static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        int K = int.Parse(Console.ReadLine());
        string[] s = Console.ReadLine().Split(' ');
        int[] xy = Array.ConvertAll<string, int>(s, delegate (string value) { return int.Parse(value); });

        int ans = 0;

        for (int i = 0; i < N; i++) {
            if (xy[i] > K - xy[i])
            {
                ans = ans + (K - xy[i]) * 2;
            }
            else ans = ans + xy[i] * 2;
        }
        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 13140
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		long h = scan.nextLong();
		int n = scan.nextInt();
		int[] a = new int[n];
		int total = 0;

		for(int i=0;i<n;i++) {

			a[i] = scan.nextInt();
			total += a[i];
		}

		System.out.println(total >= h?"Yes":"No");

		scan.close();


	}

}


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

using ll = long long;
using P = pair<ll, ll>;

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  ll N, M;
  cin >> N >> M;
  vector<P> v;
  ll a, b;
  for (int i = 0; i < N; i++) {
    cin >> a >> b;
    v.push_back(P(a, b));
  }

  sort(v.begin(), v.end());
  ll ans = 0;
  for (int i = 0; i < v.size(); i++) {
    if (M - v[i].second > 0) {
      ans += v[i].first * v[i].second;
      M -= v[i].second;
    } else {
      ans += v[i].first * M;
      break;
    }
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 2420
#define taskname "test"

#include <bits/stdc++.h>

using namespace std;

#define sz(x) (int)x.size()
#define fi first
#define se second

typedef long long lli;
typedef pair<int, int> pii;

const int maxn = 5e5 + 5;
const int K = 710;

int n, Q;
int a[maxn];
pair<pii, int> query[maxn];

int cnt[maxn], ans[maxn];

template <typename T>
void Read(T& x)
{
    bool Neg = false;
    char c;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        if (c == '-') Neg = !Neg;
    x = c - '0';
    for (c = getchar(); c >= '0' && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
    if (Neg && x > 0) x = -x;
}

template <typename T>
void WriteU(T x)
{
    if (x > 9)
        WriteU(x / 10);
    putchar(x % 10 + '0');
}

void read_input()
{
    //cin >> n >> Q;
    Read(n); Read(Q);
    for(int i = 1; i <= n; ++i)
        //cin >> a[i];
        Read(a[i]);
    for(int i = 1; i <= Q; ++i)
    {
        int l, r;
        //cin >> l >> r;
        Read(l); Read(r);
        query[i] = make_pair(pii(l, r), i);
    }
}

bool cmp(const pair<pii, int>&x, const pair<pii, int>&y)
{
    if(x.fi.fi / K == y.fi.fi / K)
        return x.fi.se < y.fi.se;
    return x.fi.fi < y.fi.fi;
}

inline void update(const int&l, const int&r, int&cur)
{
    static int curl = 1, curr = 0;
    while(curr < r)
    {
        ++curr;
        ++cnt[a[curr]];
        if(cnt[a[curr]] == 1) ++cur;
    }
    while(curr > r)
    {
        --cnt[a[curr]];
        if(cnt[a[curr]] == 0) --cur;
        --curr;
    }
    while(curl < l)
    {
        --cnt[a[curl]];
        if(cnt[a[curl]] == 0) --cur;
        ++curl;
    }
    while(curl > l)
    {
        --curl;
        ++cnt[a[curl]];
        if(cnt[a[curl]] == 1) ++cur;
    }
}

void solve()
{
    sort(query + 1, query + Q + 1, cmp);
    fill(begin(cnt), end(cnt), 0);
    int cur = 0;
    for(int i = 1; i <= Q; ++i)
    {
        int l = query[i].fi.fi, r = query[i].fi.se;
        int id = query[i].se;
        update(l, r, cur);
        ans[id] = cur;
    }
    for(int i = 1; i <= Q; ++i)
    {
        WriteU(ans[i]);
        putchar('\n');
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    read_input();
    solve();
}


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

using namespace std;

#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(int i=st; i<ed; i++)
#define repn(i, st, ed) for(int i=st; i<=ed; i++)


typedef long long ll;
typedef unsigned long long int llt;

const int N = 1e5 + 10;

vector<int> g[N];
bool viss[N];
int vis[N];

void dfs(int curr, int par)
{
  for(auto x: g[curr])
    if(x != par)
      dfs(x, curr);
}

void dfs1(int curr, int par)
{
  viss[curr] = 1;
  for(auto x: g[curr])
    if(!viss[x])
      dfs1(x, curr);
}

void dfs2(int curr, int par, int num)
{
  vis[curr] = num;
  for(auto x: g[curr])
    if(vis[x] == 0)
      dfs2(x, curr, num);
}

ll fxor(ll n)
{
  if(n < 0) return 0;
  if(n % 4 == 3) return 0;
  else if(n % 4 == 0) return n;
  else if(n % 4 == 1) return n^(n-1);
  else if(n%4 == 2) return n^(n-1)^(n-2);
}

llt ppow(llt x, llt y)
{
  llt res = 1;
  while(y > 0){
    if(y&1)
      res = (res * x)%M;
    y = y >> 1;
    x = (x * x)%M;
  }
  return res;
}

llt factdp[N];
llt fact(llt x)
{
  if(x == 0) return 1;
  if(x == 1) return 1;
  if(factdp[x] != -1) return factdp[x];
  return factdp[x] = (x*fact(x-1))%M;
}

string ans ="";
void convert10tob(llt N, int b)
{
     if (N == 0)
        return;
     int x = N % b;
     N /= b;
     if (x < 0)
        N += 1;
     convert10tob(N, b);
     ans += to_string(x);
     return;
}

llt convertstrtob(string a, int b)
{
  llt aa = 0;
  llt mul = 1;
  for(int i=a.length()-1; i>=0; i--)
  {
    int curr = a[i] - '0';
    aa += (curr * mul);
    mul *= b;
  }
  return aa;
}


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


Measured memory_bytes: 2560
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) > (b) ? (b) : (a))
#define abs(x) ((x) > 0 ? (x) : -(x))
#define MOD 1000000007 //10^9 + 7
#define endl printf("\n")
typedef long long ll;
#define MAX_N (1 << 17)

int
main(int argc, const char *argv[])
{
  int h, w;
  int c[10][10];
  
  scanf("%d %d", &h, &w);
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      scanf("%d", &c[i][j]);
    }
  }

  int d[10];
  for (int i = 0; i < 10; i++) d[i] = INT_MAX;
  d[1] = 0;
  while (true) {
    bool update = false;
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < 10; j++) {
	if (d[j] != INT_MAX && d[i] > d[j] + c[i][j]) {
	  d[i] = d[j] + c[i][j];
	  update = true;
	}
      }
    }
    if (!update) break;
  }

  int ans = 0, a;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      scanf("%d", &a);
      if (a != -1) ans += d[a];
    }
  }

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

  return 0;
}


Measured memory_bytes: 128
Q = int(input())

sl = 10**5 + 1

s = [i % 2 for i in range(sl)]
s[0] = s[1] = 0
s[2] = 1

for i in range(2, sl):
  if s[i] == 0: continue
  for j in range(2 * i, sl, i):
    s[j] = 0

dp = [0] * sl
for i in range(3, sl):
  dp[i] = dp[i-1] + (s[i] and s[(i+1)//2])

for i in range(Q):
  l, r = map(int, input().split())
  print(dp[r] - dp[l-1])

Measured memory_bytes: 7208
#pragma warning(disable:4996)

#include<iostream>
#include<algorithm>
//#include<unordered_map>
#include<fstream>
#include<iomanip>
#include<string>
#include<cmath>
#include<cstring>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<stack>
#include<sstream>
#include<cstdio>
#include<ctime>
#include<cstdlib>
#define INF 0x3f3f3f3f
#define inf 0x7FFFFFFF
#define MOD 2147493647
#define moD 1000000003
#define pii pair<int,int>
#define eps 1e-7
#define equals(a,b) (fabs(a-b)<eps)
#define bug puts("bug")
#define re  register
#define fi first
#define se second
const int maxn = 1e3 + 5;
const double Inf = 10000.0;
const double PI = acos(-1.0);
typedef  long long ll;
using namespace std;

int main() {
	int n;
	scanf("%d", &n);
	double x = ceil(1.0 * n / 1000);
	printf("%d", (int)x * 1000 - n);
}

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

using namespace std;

int w, d, n;
int m[64][64];
int M[64][64];

int main() {
  while (cin >> w >> d >> n) {
    for (int x = 1; x <= w; ++x) {
      for (int y = 1; y <= d; ++y) {
	m[x][y] = -1000;
	M[x][y] = 1000;
      }
    }
    for (int i = 0; i < n; ++i) {
      int xx, yy, zz;
      cin >> xx >> yy >> zz;
      for (int x = 1; x <= w; ++x) {
	for (int y = 1; y <= d; ++y) {
	  m[x][y] = max(m[x][y], zz - abs(x-xx) - abs(y-yy));
	  M[x][y] = min(M[x][y], zz + abs(x-xx) + abs(y-yy));
	}
      }
    }
    int cnt = 0;
    bool fail = false;
    for (int x = 1; x <= w; ++x) {
      for (int y = 1; y <= d; ++y) {
	// cout << m[x][y] << "/" << M[x][y] << " ";
	if (m[x][y] > M[x][y])
	  fail = true;
	else
	  cnt += m[x][y];
      }
      // cout << endl;
    }
    if (fail)
      cout << "No" << endl;
    else
      cout << cnt << endl;
  }
}



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

using namespace std;

int main(){
	string search;
	int n;
	string in;
	cin >> search;
	cin >> n;
	int ans = 0;
	for(int i = 0; i < n; i++){
		cin >> in;
		in += in;
		if(in.find(search) != string::npos){
			ans++;
			// cout << "Yeah" << endl;
		}
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3124
#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
const int maxn = 55;
int n;
ll k;
struct array{
    int a, b;
    bool friend operator <(array pa, array pb){
        return pa.a < pb.a;
    }
}Arr[100005];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> k;
    for(int i = 0; i < n; i++){
        cin >> Arr[i].a >> Arr[i].b;
    }
    sort(Arr, Arr+n);
    int cnt = -1;
    while(k>0){
        k = k-Arr[++cnt].b;
    }
    cout << Arr[cnt].a << endl;
    return 0;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <ctype.h>
#include <math.h>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
double PI = 3.1415926535897932;
long mod = 1000000007;

const long INF = 1e9 + 1;

const long x = 5000000000000000;
//5*10^15

int main() {
  string s;
  long k;
  cin >> s >> k;

  if(s[0] != '1') cout << s[0] << endl;
  else {
    int num = 0;
    for(int i = 0; i < s.size(); i++) {
      if(s[i] != '1') {
        num = i; break;
      }
    }
    if(num >= k) cout << 1 << endl;
    else cout << s[num] << endl;
  }
}

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

int main()
{
	int n;
	cin>>n;
	int h[n], dp[n];
	for(int i=0; i<n; i++) cin>>h[i];
	dp[0]=0;
	dp[1]=fabs(h[1]-h[0]);
	for(int i=2; i<n; i++) dp[i]=min(  dp[i-1]+fabs(h[i]-h[i-1]), dp[i-2]+fabs(h[i]-h[i-2]) );
	cout<<dp[n-1]<<endl;
} 

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

#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define lfs <<fixed<<setprecision(10)<<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = n; i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = n - 1; i >= (ll)(m); i--)
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
void chmin(T &a,T b){if(a>b)a=b;}
template<typename T>
void chmax(T &a,T b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>v,ll n){cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
template<typename T>
void emp(map<T,ll>&m, T x){m.emplace(x,0).first->second++;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};

template<ll mod>
struct RollingHash{
  vector<ll> hash,p;
  ll base;
  RollingHash(string s, ll b){
    ll n = (ll)s.size();
    base = b;
    hash.assign(n+1,0);
    p.assign(n+1,1);
    for(ll i=0;i<n;i++){
      hash[i+1]=(hash[i]*base+s[i])%mod;
      p[i+1]=(p[i]*base)%mod;
    }
  }
  ll get(ll l, ll r){
    ll ret=hash[r+1]-(hash[l]*p[r-l+1])%mod;
    if(ret<0)ret+=mod;
    return ret;
  }
};

int main(){
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  ll res=0,res1=INF,res2=-INF,buf=0;
  bool judge = true;
  //const ll tmp_mod=608396398;
  //const ll tmp_mod=979418779;
  const ll tmp_mod=775791517;
  using RH = RollingHash<tmp_mod>;
  ll base=0;while(base<100000)base=(rand()*rand()*998244353)%tmp_mod;
  ll n;cin>>n;
  string s;cin>>s;
  RH rh(s,base);
  /*auto v=vec(n,n,0LL);
  rep(i,0,n)rep(j,0,n){
    if(i+j<n)v[i][j]=rh.get(i,i+j);
  }*/
  rep(i,0,n-1)rep(j,i+1,n){
    if(s[i]!=s[j])continue;
    ll l=i,r=j;
    while(r-l>=2){
      ll mid=(l+r)/2;
      if(j+mid-i>=n||rh.get(i,mid)!=rh.get(j,j+mid-i)){
        r=mid;
      }
      else l=mid;
    }
    chmax(res,l-i+1);
  }
  cout<<res<<endl;
  return 0;
}

Measured memory_bytes: 512
<?php
// Your code here!
$n = fgets(STDIN);

$a = explode(" ",fgets(STDIN));

$cnt = 0;

$flg = true;
while(true){
    
   for($i=0; $i<$n; ++$i ){
       if($a[$i]%2 == 0){
           $a[$i] /= 2;
       }else{
           $flg = false;
       }
   }
   if($flg){
       $cnt++;
   }else{
       break;
   }   
}

echo $cnt;
?>

Measured memory_bytes: 3828
i = list(map(int, input().split()))

for j in range(len(i)):
    for k in range(0, len(i) - (j+1)):
        if(i[k] > i[k+1]):
            temp = i[k]
            i[k] = i[k+1]
            i[k+1] = temp
print(i[0],i[1],i[2]) 



Measured memory_bytes: 5592
#include <iostream>

using namespace std;


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

    int max = 0;
    int min = 10000;

    for(int i = 0, t; i < n && cin >> t; ++i) {
        if(t > max)
            max = t;
        if(t < min)
            min = t;
    }

    cout << max - min << endl;

    return 0;
}

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

#define     str             string
#define     PB              push_back
#define     FOR(i,a,n)      for(int i=a;i<=n;i++)
#define     FORA(i,a,n)     for(int i=a;i<n;i++)
#define     srt(a)          sort(a.begin(),a.end())
#define     rev(a)          reverse(a.begin(),a.end())

#define     c1(a)           cin>>a
#define     c2(a,b)         cin>>a>>b
#define     c3(a,b,c)       cin>>a>>b>>c
#define     c4(a,b,c,d)     cin>>a>>b>>c>>d

#define     p(a)            cout<<a<<endl


#define     sci1(a)         scanf("%d",&a)
#define     sci2(a,b)       scanf("%d %d",&a,&b)
#define     sci3(a,b,c)     scanf("%d %d %d",&a,&b,&c)
#define     sci4(a,b,c,d)   scanf("%d %d %d %d",&a,&b,&c,&d)

#define     pri1(a)         printf("%d\n",a)
#define     pri2(a,b)       printf("%d %d\n",a,b)
#define     pri3(a,b,c)     printf("%d %d %d\n",a,b,c)
#define     pri4(a,b,c,d)   printf("%d %d %d %d\n",a,b,c,d)

#define     fast            ios_base::sync_with_stdio(false);cin.tie(NULL)

#define     intahn          int a,b,c,d,e,f,g,h,n

#define     pi              acos(-1)

typedef     long long int   ll;
typedef     vector<ll>      vi;
typedef     vector<str>     vs;
typedef     pair<ll,ll>     paii;
typedef     pair<ll,str>    pais;

vi x;

int main(){
    int a,b;
    cin>>a>>b;
    x.PB(a+b);
    x.PB(a-b);
    x.PB(a*b);

    cout<<*max_element(x.begin(),x.end());
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//#pragma comment(linker, "/STACK:102400000,102400000")
typedef long long ll;
typedef pair<int,int> P;
#define ls(x) (x<<1)
#define rs(x) (x<<1|1)
#define lowbit(x) (x&-x)
const ll INF=0x3f3f3f3f;
const double EPS=1e-6;
const int N=2e5+10;
const ll mod=1e9+7;
inline ll read()
{  ll f=1,x=0;char ch=getchar();
   for(;ch>'9'||ch<'0';ch=getchar())if(ch=='-') f=-1;
   for(;ch<='9'&&ch>='0';ch=getchar()) x=x*10+ch-'0';
   return x*f;
}
ll n,k;
double a[N];
bool check(double mid)
{  ll cnt=0;
   for(ll i=1;i<=n;i++)
   {  if(a[i]<=mid)continue;
      cnt=cnt+ceil((a[i]/mid));
      cnt--;
      if(cnt>k)return 0;
   }
   if(cnt>k)return 0;
   else return 1;
}
int main()
{  cin>>n>>k;
   for(int i=1;i<=n;i++)cin>>a[i];
   double l=0.0001,r=1e9+5,ans;
   while(r-l>=EPS)
   {  double mid=(l+r)/2;
      if(check(mid))
      {  ans=mid;
         r=mid-0.00000001;
      }
      else
      {  l=mid+0.00000001;
      }
   }
   printf("%.0f\n",max(1.0,ceil(ans-0.000001)));
}

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

int main() {
  int N, A=0, cnt=1;
  cin >> N;
  vector<int> P(N);
  rep(i, N) cin >> P.at(i);
  int min=P.at(0);
  for(int i=1; i<N; i++){
    if(min<P.at(i)){
      continue;
    }
    else{
      min=P.at(i);
      cnt++;
    }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 1024
#![allow(unused_imports)]
use petgraph::unionfind::UnionFind;
use proconio::*;
use std::cmp::*;
use std::io::*;
use std::fs;

fn calc(n:i64, k:i64) -> (i64) {
    k * (n+n-k+1) / 2 - k * (k-1) / 2 + 1
}

#[fastout]
fn main() {
    input! {
      n:i64,
      k:i64,
    }
    let m = 1000000007 as i64;
    let mut ans: i64 = 0;
    for i in k..(n+2) {
        ans += calc(n, i) % m;
        ans %= m;
    }
    println!("{}", ans);
}

macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
}


Measured memory_bytes: 2200
import java.util.Scanner;
class Main {
	public static void main(String[] args) {
		char kigou;
		Scanner kbd = new Scanner(System.in);
		int a = kbd.nextInt();
		int b = kbd.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: 26208
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n,k int
	fmt.Scan(&n,&k)
	sticks := make([]int, n)
  
	for i := range sticks {
		fmt.Scan(&sticks[i])
	}
	
	sort.Sort(sort.Reverse(sort.IntSlice(sticks)))

	sum := 0
	for i := 0; i < k; i++ {
		sum += sticks[i]
	}
	fmt.Println(sum)
}

Measured memory_bytes: 512
#include<stdio.h>
int main(){
	int A,B,C,D,P,X,Y;
	scanf("%d%d%d%d%d",&A,&B,&C,&D,&P);
	X=A*P;
	Y=B;
	if(C<P){
		Y+=D*(P-C);
	}
	if(X<Y){
		printf("%d\n",X);
	}
	else{
		printf("%d\n",Y);
	}
	return 0;
}

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

int getNum(char c){return c - '0';}


int main(){
	string s;
	cin >> s;
	
	int length = s.size() - 2;
	int minDif = 1000;
	for(int i=0; i<length; i++){
		int num = getNum(s[i]) * 100 + getNum(s[i+1]) * 10 + getNum(s[i+2]);
		int dif = abs(753 - num);
		minDif = min(minDif, dif);
	}
	cout << minDif << endl;
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	vector<int> s[301];
	int t[101] = {};
	int ans[101] = {};
	int n; scanf("%d", &n);

	for (int i = 0; i < n * (n - 1) / 2; ++i) {
		int a, b, c, d; scanf("%d%d%d%d", &a, &b, &c, &d);
		if (c > d)
			t[a] += 3;
		else if (d > c)
			t[b] += 3;
		else
			t[a] += 1, t[b] += 1;
	}

	for (int i = n; i >= 0; --i) s[t[i]].push_back(i);

	int r = 1;

	for (int i = 300; i >= 0; --i) {
		int cnt = 0;
		while (s[i].size()) {
			ans[s[i].back()] = r;
			s[i].pop_back();
			cnt++;
		}
		r += cnt;
	}

	for (int i = 1; i <= n; ++i) printf("%d\n", ans[i]);
}

Measured memory_bytes: 1060
// kyopro.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
#define rep(N) for(int i=0;i<N;i++)
#define rep2(N1,N2) for(int i=0;i<N1;i++)for(int j=0;j<N2;j++)
#define rep3(N1,N2,N3)for(int i=0;i<N1;i++)for(int j=0;j<N2;j++)for(int k=0;k<N3;k++)
#define For(i,N) for(int i=0;i<N;i++)

void yn(bool b) {
	if (b)printf("yes\n");
	else printf("no\n");
}

void Yn(bool b) {
	if (b)printf("Yes\n");
	else printf("No\n");
}

void YN(bool b) {
	if (b)printf("YES\n");
	else printf("NO\n");
}

int main(){
	long long int N;
	cin >> N;
	vector<long long int>A(N);
	vector<long long int>B(N,0);
	vector<int>C(N, 0);
	rep(N) {
		cin >> A[i];
		B[A[i] - 1]++;
		C[A[i] - 1]++;
	}

	long long int c = 0;
	rep(N) {
		c = c + B[i] *( B[i] - 1)/2;
	}
	rep(N) {
		cout << c - B[A[i] - 1] + 1<<endl;
	}
}

Measured memory_bytes: 6528
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define REP(i,a,b) for(int i=int(a);i<(int)b;++i)


using namespace std;
using ll = long long;

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int main(void)
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    ll x,n=100,i=0;
    cin >> x;
    while(n < x)
    {
        n *=1.01;
        i++;
    }
    cout << i << endl;
    
   

    return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
#include <unordered_map>

#include <cassert>

using namespace std;

const int inf = (int)1e9 + 7;

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

    int a, b, c;

    cin >> a >> b >> c;

    cout << (a ^ b ^ c) << endl;

    return 0;
}


Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}



public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		FastScanner fs = new FastScanner();
		int N = fs.nextInt();
		int M = fs.nextInt();

		int x = ((N*(N-1))/2) + ((M*(M-1))/2);

		System.out.println(x);
	}

}


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

#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//以降 cin の入力元が 'input.txt' になる
//std::ifstream in("input.txt");
//std::cin.rdbuf(in.rdbuf());


signed main()
{
    gearup;
    string s; cin >> s;
    int r = 0;
    rep(i,3)if(s[i] == 'R')r++;
    if(r == 3)out(3);
    else if(r == 1)out(1);
    else if(r == 0)out(0);
    else{
        if(s == "RRS" || s == "SRR")out(2);
        else out(1);
    }
}

Measured memory_bytes: 3628
#include <stdio.h>

int main(void)
{

	int ze, n;
	
	ze = 0;
	
	while (1){
		scanf("%d", &n);
		if (n == 0){
			break;
		}
		printf("Case %d: %d\n", ze + 1, n);
		ze++;
	}
	return (0);
}

Measured memory_bytes: 600
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<tuple>


#define MOD 1000000007
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back

using namespace std;

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

int main(){
    string S;
    cin>>S;
    int R_last=0;
    int L_last=0;
    int R_num=0,L_num=0;
    bool prev=true;
    int ans[100001]={};

    rep(i,0,S.size()){
        if(prev || S[i]=='L'){
            if(S[i]=='R'){
                R_last=i;
                R_num++;
                prev=true;
            }
            else{
                L_num++;
                prev=false;
            }
        }
        else{
            ans[R_last]+=((R_num+1)/2);
            ans[R_last+1]+=((R_num)/2);
            ans[R_last]+=((L_num)/2);
            ans[R_last+1]+=((L_num+1)/2);
            R_last=i;
            R_num=1;
            L_num=0;
            prev=true;
        }
    }
    ans[R_last]+=((R_num+1)/2);
    ans[R_last+1]+=((R_num)/2);
    ans[R_last]+=((L_num)/2);
    ans[R_last+1]+=((L_num+1)/2);

    rep(i,0,S.size()){
        cout<<ans[i]<<" ";
    }
    return 0;
}

Measured memory_bytes: 1024
#include <cstdio>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <set>

#define rep(i,N) for(int (i)=0;(i)<(N);(i)++)
#define MOD 1000000007

using ll = long long;

using namespace std;

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

ll factorial_mod(ll a, ll p) {
	if (!a)return 1;
	else return a * factorial_mod(a - 1, p) % p;
}

ll sum_digit(ll N) {
	int ans = 0;
	for (; N != 0;) {
		ans += N % 10;
		N /= 10;
	}
	return ans;
}

ll gcd(ll a,ll b) {
	if (!b)return a;
	return gcd(b, a%b);
}

ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

int N;

int main(){
	scanf("%d", &N);
	printf("%d", N / 2 * (N - N / 2));
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;

namespace ARC062_D
{
    class Program
    {
        static int ans;
        static void Main(string[] args)
        {
            var S = ReadLine();
            var N = S.Length;

            for (int i = 0; i < N; i++)
            {
                if (i % 2 == 0)
                {
                    if (S[i] == 'p') ans--;
                }
                else
                {
                    if (S[i] == 'g') ans++;
                }
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 3032
package main

import (
  "fmt"
)

func main() {
  var m1, m2, d1, d2 int
  fmt.Scanf("%d %d", &m1, &d1)
  fmt.Scanf("%d %d", &m2, &d2)
  
  ans := 1
  if m1 == m2 {
    ans = 0
  }
  fmt.Printf("%d\n", ans)
}

Measured memory_bytes: 1836
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

int main(){
    int N, K;
    cin >> N >> K;
    vector<int> A(N);
    for(int i = 0; i < N; i++)cin >> A[i];

    vector<int> count(N);
    for(int i = 0; i < N; i++)count[i]=0;

    for(int i = 0; i < N; i++){
        count[A[i] - 1]++;
    }

    sort(count.begin(), count.end(), greater<int>());

    int ans = 0;
    for(int i = K; i < N; i++){
        if(count[i] == 0)break;
        ans += count[i];
    }

    cout << ans << endl;

}

Measured memory_bytes: 1792
#include <stdio.h>

int main(void){
    int n, i, j;
    scanf("%d", &n);
    for(i=1; i<=9; i++){
        for(j=1; j<=9; j++){
            if(i*j == n){
                printf("Yes\n");
                return 0;
            }
        }
    }
    printf("No\n");
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<string>
#include<cmath>
#include<cstdio>
#include<set>
#include<map>
#include<iomanip>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repn(i, n) for(int i = 1; i <= n; i++) 
#define lint long long
#define all(x) (x).begin(), (x).end()

struct train{
    int place, flag, num;
    train(int p, int f, int n):place(p),flag(f),num(n) {}
    bool operator<(const train& y) const{
        if(place == y.place) return flag < y.flag;
        else return place < y.place;
    }
};

int main(){
    int n,m,q; cin>>n>>m>>q;
    vector<train> T;
    rep(i,m){
        int l,r; cin>>l>>r;
        T.push_back(train(l-1, 0, i));
        T.push_back(train(r-1, 1, i));
    }
    sort(all(T));

    bool seen[m]; int c = 0;
    int a[n][n];

    rep(i, n){
        fill(seen, seen+m, false);
        c = 0;
        for(int j = i; j < n; j++){
            if (j > i) a[i][j] = a[i][j-1];
            else a[i][j] = 0;
            while (T[c].place <= j){
                if (T[c].place < j){ c++; continue; }
                
                train tr = T[c];
                if (tr.flag == 0) seen[tr.num] = true;
                else if (seen[tr.num]) a[i][j]++;
                c++;

                if (c == T.size()) break;
            }
        }
    }

    rep(i, q){
        int p,q; cin>>p>>q;
        cout<<a[p-1][q-1]<<endl;
    }
}

Measured memory_bytes: 8432