akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;

const int nmax = 2 * 100005;
typedef pair<int, int> P;
map<P, int> MAP;
int N, K, L;

// union - find tree !!!!!!!!!!!!!!!!!!!!!!!!!
vector<int> par[2]; //oya
vector<int> rnk[2]; //ki no hu ka sa
// n要素で初期化
void init(int n){
    FOR(i,0,2){
      par[i].resize(n);rnk[i].resize(n);
      FOR(j, 0, n){par[i][j] = j;rnk[i][j] = 0;}
    }
}
//木の根を求める
int find(int i, int x){
    if(par[i][x] == x) return x;
    else return par[i][x] = find(i, par[i][x]);
}
//xとyの属する集合を併合
void unite(int i, int x, int y){
    x = find(i, x);y = find(i, y);
    if(x == y) return;
    if(rnk[i][x] < rnk[i][y]) par[i][x] = y;
    else{par[i][y] = x;if(rnk[i][x] == rnk[i][y]) rnk[i][x]++;}
    return;
}

int main(){
  cin >> N >> K >> L;
  init(N);
  // 道路で同じ組みかどうか
  FOR(i,0,K){
    int a, b;
    cin >> a >> b;
    a--;b--;
    unite(0,a,b);
  }
  // 鉄道で同じかどうか
  FOR(i,0,L){
    int a, b;
    cin >> a >> b;
    a--;b--;
    unite(1,a,b);
  }
  FOR (i,0,N) MAP[P(find(0,i),find(1,i))]++;
  FOR(i,0,N){
    printf("%d%c", MAP[P(find(0,i),find(1,i))], i == N - 1 ? '\n' : ' ');
  }
  return 0;
}

Measured memory_bytes: 15104
require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

def get_ints
  gets.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

X, N = get_ints

if N == 0
  puts X
else
  P = get_ints
  p_set = Set.new(P)

  result = -1
  turn = 1

  loop do
    diff = turn / 2
    minus = turn % 2 == 0

    test = minus ? X - diff : X + diff
    unless p_set.include?(test)
      result = test
      break
    end

    turn += 1
  end

  puts result
end


Measured memory_bytes: 14364
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ll long long 
#define lli long long int
#define vpl vector < pair < ll,ll > >
#define vll vector < ll >
#define pll pair <ll,ll>
#define mll map< ll,ll >
#define ins insert
#define mkp make_pair
#define reverse(s) reverse(s.begin(), s.end())

#define mem(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define cn(a) cout<<a<<"\n"
#define cp(a) cout<<a
#define cs(a) cout<<a<<" "
#define fr(a,n,i) for(ll i=a; i<n; i++ )
#define frn(a,n,i) for(ll i=a; i>=n; i--)
#define fre(a,n,i) for(ll i=a; i<=n; i++)

using namespace std;
ll mod=1e9 +7;
 bool comp(pll p,pll q)
{
    if(p.first!=q.first)
    return p.first<q.first;
    else
    return p.second>q.second;
}
ll power(ll a,ll n)
{
	ll res=1;
 
	while(n){
		if(n%2)
		res=(res%mod*a%mod)%mod;
		a=(a%mod*a%mod)%mod;
		n/=2;
	}
  return res%mod;
} 
ll kmp(string x,ll m)
{
      
      vector<ll> pi(m,0);
      pi[0]=0;ll ma=0;ll j=0;
      for(ll i=1;i<m;i++)
        {
      while(j>0 && x[i]!=x[j])
        j=pi[j-1];
        if(x[j]==x[i])
        j++;
        pi[i]=j;
        }
        return j;
}

 

    
int32_t main()
{
    fast;
 ll n,l,r; vpl v;

cin>>n;



fr(0,n,i)

{

cin>>l>>r;
if(l>r)
swap(l,r);
v.pb({l,r});


}


sort(v.begin(),v.end(),comp);

ll a[n]={0}, b[n]={0};



ll mi=INT_MAX,ma=0; ll ans=0;

fr(0,n,i)

{

ma=max(ma,v[i].first);

mi=min(mi,v[i].second);
if(mi<ma)
a[i]=0;
else
a[i]=mi-ma+1;

}
l=ma; r=mi;
fr(0,n,i)
ans=max(ans,v[i].second-v[i].first+1);
    
    
  ans+=max(0LL,r-l+1);  


mi=INT_MAX;ma=0;



frn(n-1,0,i)

{

ma=max(ma,v[i].first);

mi=min(mi,v[i].second);
if(mi<ma)
b[i]=0;
else
b[i]=mi-ma+1;

} 

fr(0,n-1,i)

{

ans=max(a[i]+b[i+1],ans);

 }

cp(ans);

 
}


Measured memory_bytes: 3568
#pragma region Template
#include <bits/stdc++.h>
using namespace std;
struct ios_accelerate { ios_accelerate() { ios::sync_with_stdio(false); cin.tie(nullptr); } } CALL;

#define REP(i, n) for(int i = 0; i < n; i++)
#define RNG(i, a, b) for(int i = a; i < b; i++)
#define RBF(i, v) for(auto& i : v)
#define ALL(x) x.begin(), x.end()

using LL = long long;
using UL = unsigned long;
using ULL = unsigned long long;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
template<typename T> using P = pair<T, T>;

const double PI = 3.141592653589793;
const int MOD = 1000000007;
const LL INF64 = static_cast<LL>(1e18) + 2;
const int INF = static_cast<int>(1e9) + 2;

template<typename T> inline void upsort(vector<T>& x) { sort(x.begin(), x.end()); }
template<typename T> inline void downsort(vector<T>& x) { sort(x.begin(), x.end(), greater<T>()); }
template<typename T> inline void col(T x) { cout << x << '\n'; }
template<> inline void col(double x) { cout << fixed << setprecision(12) << x << '\n'; }
#pragma endregion

template<typename T> inline T absdiff(T a, T b) { return (a - b) * (static_cast<T>(a > b) * 2 - 1); }

signed main()
{	
	int n, x, y;
	cin >> n >> x >> y;
	x--; y--;

	V<int> mind(n, 0);
	REP(i, n-1) {
		RNG(j, i+1, n) {
			int d = min(j - i, absdiff(i, x) + 1 + absdiff(y, j));
			d = min(d, absdiff(i, y) + 1 + absdiff(x, j));
			mind[d]++;
		}
	}

	RNG(i, 1, n) {
		col(mind[i]);
	}
	return 0;
}


Measured memory_bytes: 3596
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

namespace AOJ
{
    class Program
    {
        static int[,] table = new int[10, 101];
        static void calc_total(int n, int total, int start, int level)
        {
            for(int i = start; i < 10 - level; i++)
            {
                if (level == 0)
                {
                    table[n, total + i]++;
                }
                else
                {
                    calc_total(n, total + i, i + 1, level - 1);
                }
            }
        }

        static void Main(string[] args)
        {
            for (int i = 1; i < 10; i++)
            {
                calc_total(i, 0, 0, i - 1);
            }
            while (true)
            {
                var d = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                if (d[0] == 0 && d[1] == 0) break;
                Console.WriteLine(table[d[0], d[1]]);
            }
        }
    }
}

Measured memory_bytes: 5944
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;

int main()
{
  int Q; cin >> Q;
  while(Q--) {
    string s; cin >> s;
    int ans = 0;
    int j = 0;
    while(s.length() > 1) {
      int l = 0;
      int r = stoi(s);
      int cnt = l * r;
      FOR(i,0,(int)s.length()-1) {
        l *= 10;
        l += s[i] - '0';
        r %= (int)pow(10, s.length()-i-1);
        cnt = max(cnt, l * r);
      }
      s = to_string(cnt);
      j++;
      ans++;
      if(j == 100000) {
        cout << -1 << '\n';
        break;
      }
    }
    cout << ans << '\n';
  }
  return 0;
}

Measured memory_bytes: 3440
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(int X = 0; X < N; X++)
#define repvin(V,N) for(int i = 0; i < N; i++) {int tmp; cin >> tmp; V.push_back(tmp);}

using namespace std;

int main(){

    int n;
    cin >> n;

    vector<ll> a;

    int tmpmin = INT_MAX;
    int tmpmax = INT_MIN;

    rep(i,n){
        int tmp;
        cin >> tmp;
        a.push_back(tmp - i - 1);
        tmpmin = min(tmpmin, tmp - i - 1);
        tmpmax = max(tmpmax, tmp - i - 1);
    }

    while(tmpmax - tmpmin > 2){

        int onethird = ((tmpmax - tmpmin + 1) + 2) / 3 + tmpmin - 1;
        int twothird = ((tmpmax - tmpmin + 1) * 2 + 2) / 3 + tmpmin - 1;

        ll tmpsum1 = 0;
        ll tmpsum2 = 0;

        rep(i,n){
            tmpsum1 = tmpsum1 + abs(a[i] - onethird);
            tmpsum2 = tmpsum2 + abs(a[i] - twothird);
        }

        if(tmpsum1 < tmpsum2){
            tmpmax = twothird;
        }else{
            tmpmin = onethird;
        }
    }

    ll ans1 = 0;
    ll ans2 = 0;
    ll ans3 = 0;

    rep(i,n){
        ans1 = ans1 + abs(a[i] - tmpmin);
        ans2 = ans2 + abs(a[i] - tmpmax);
        ans3 = ans3 + abs(a[i] - (tmpmin + tmpmax) / 2);
    }

    cout << min(ans1, min(ans2, ans3)) << endl;

    return 0;
}


Measured memory_bytes: 2420
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <cmath>

using namespace std;

#define int long long
#define endl "\n"
#define all(v)  v.begin(),v.end()
#define fir first
#define sec second
#define m_p make_pair
#define rep(i,n)  for(int i=0; i<(int) (n); i++)


const double pai = 3.1415926535897;
const int mod = 1000000007;
const int INF = 2000000015;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];


int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}
int krag(double xx) {
	return INF - (int)(INF - xx);
}
//x未満の要素数を返す二分探索関数
int b_s(vector<int>& vec, int xx) {
	int t = -1;
	int f = vec.size();
	while (f - t > 1) {
		int m = (t + f) / 2;
		if (vec[m] < xx) {
			t = m;
		}
		else {
			f = m;
		}
	}
	return f;
}
template<typename T>
void vecout(vector<T>& vec) { for (T t : vec) cout << t << " "; cout << endl; }
template<typename TT>
void vecin(vector<TT>& vec) { for (TT t : vec) cin >> t; }


// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}
//n個を1個以上のx組のグループに分ける重複組み合わせはcom(n-1,x-1)
//グループが0個でもいいときはnにxを足す
// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	if (xx == 1) {
		return 0;
	}
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}


signed main() {
	int a, b, v, w, t;
	cin >> a >> v >> b >> w >> t;
	if (abs(a - b) <= t * (v - w + 0.0)) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}


Measured memory_bytes: 3584
#include "bits/stdc++.h"
using namespace std; 

int main() {
	int N;
	cin >> N;
	vector<pair<long long, long long>>A(N);
	for (long long n = 0;n<N; ++n) {
		long long m;
		cin >> m;
		A.push_back(make_pair(m,n + 1));
	}

	sort(A.rbegin(),A.rend()); 
	const int MX = 2005;
	vector<vector<long long >> DP(N + 10, vector<long long>(N + 10));
	for (int n = 0;n <= N;++n) {
		for (int m = 0;m <= n;++m) {
			long long fir = A[n].first;
			long long sec = A[n].second;
			//今 m,n-mを見ている
			DP[m + 1][n - m] = max(DP[m + 1][n - m],DP[m][n-m] + (sec- m -1) *fir);
			DP[m][n - m + 1] = max(DP[m][n - m + 1],DP[m][n-m] + (N-(n-m)-sec)*fir);
		}
	}
	long long ans = 0;
	for (int n = 0;n <= N;++n) {
		ans = max(ans ,DP[N-n][n]);
	}
	cout << ans <<endl;
	return 0;
}

Measured memory_bytes: 34924
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9 + 5;

int main()
{
  int n, m;
  cin >> n >> m;
  priority_queue<pair<int, int> > pq;
  for (int i = 0; i < n; i++) {
    int v;
    cin >> v;
    pq.push(make_pair(v, 1));
  }
  for (int i = 0; i < m; i++) {
    int v, c;
    cin >> c >> v;
    pq.push(make_pair(v, c));
  }

  ll ans = 0;
  while(n--) {
    pair<int, int> q = pq.top(); pq.pop();
    ans += q.first;
    q.second--;
    if (q.second > 0) {
      pq.push(q);
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 2420
#require 'prime'
#require 'openssl'
MOD=10**9+7;  cnt=0; sum=0; prev=nil; can=true; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.chomp.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def ar2(s1,s2,de=nil) Array.new(s1){Array.new(s2,de)} end
def ar3(s1,s2,s3,de=nil) Array.new(s1){Array.new(s2){Array.new(s3,de)}} end

def desc(ar) ar.sort!{|x,y| y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+).to_i end
def ceil(a,b) (a.to_f/b).ceil end

def C(a,b) b==0||a==b ? 1 : (b=a-b if a/2<b;(a-b+1..a).inject(:*)/(1..b).inject(:*)) end
def rui(ar) s=[0]; ar.size.times{|i| s<<s[-1]+ar[i]}; s end
def rev_rui(ar) s=[0]; ar.size.times.reverse_each{|i| s<<s[-1]+ar[i]}; s end

def puts_yesno(b) puts(b ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def pu(h) begin; require './../nemi_lib/debug.rb'; puts_val(h); rescue LoadError; end; end
########### ( ˘ω˘ )ｽﾔｧ… ###########
s=gs
t=gs
pu s:s

if s==t[0..-2]
  puts 'Yes'
else
  puts 'No'
end

Measured memory_bytes: 14320
import java.util.Scanner;

public class Main {
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int K=sc.nextInt();
		int ki[]=new int[]{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};
		System.out.println(ki[K-1]);

	}
}


Measured memory_bytes: 22996
#include<stdio.h>
 #include<string.h>
 int main(void)
 {
     char S[10000];
     int N,s,i;

     scanf("%d",&N);
     scanf("%s",S);
     s=strlen(S);

     for(i=0;i<s;i++){
       if((S[i]>='A')&&(S[i]<='Z')){
        S[i]=((S[i]-'A')+N)%26+'A';
          printf("%c",S[i]);
         }
     }
     printf("\n");

     return 0;
 }


Measured memory_bytes: 128
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
#include<tuple>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;




int main(){
    ll n,m,c;
    cin>>n>>m>>c;
    vector<ll> B(m);
    for(auto &I:B){cin>>I;}
    ll cnt=0;
    for(int i=0;i<n;i++){
        ll a=c;
        for(int t=0;t<m;t++){
            ll k;
            cin>>k;
            a+=B[t]*k;
        }
        cnt+=(a>0);
    }
    cout<<cnt<<endl;
    
    
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int n,m,A;
main()
{
	while(cin>>n>>m>>A,n)
	{
		vector<pair<int,int> >G[1001];
		for(int i=0;i<m;i++)
		{
			int h,x,y;cin>>h>>x>>y;G[1001-h].push_back(make_pair(x,y));
		}
		vector<int>a(n+1);
		for(int i=0;i++<n;)a[i]=i;
		for(int i=0;i++<1000;)
		{
			for(int j=0;j<G[i].size();j++)
			{
				swap(a[G[i][j].first],a[G[i][j].second]);
			}
		}
		for(int i=0;i++<n;)if(a[i]==A)cout<<i<<endl;
	}
}


Measured memory_bytes: 3040
#define MYDEBUG
#include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <algorithm>
#include <queue>
#include <set>
#include <cstdio>
#include <unordered_map>

#ifdef MYDEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#else
#define debug(x)
#endif
#define ll long long
#define ull unsigned long long
#define eps 1e-14
using namespace std;

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
	out << "[";
	size_t last = v.size() - 1;
	for (size_t i = 0; i < v.size(); ++i) {
		out << v[i];
		if (i != last)
			out << ",";
	}
	out << "]";
	return out;
}

int main() {
	string s;
	int n;
	cin >> n;
	cin >> s;
	int sum = 0;
	int max = 0;
	for (int i = 0; i < n; ++i) {
		if (s[i] == 'I')
			sum++;
		else
			sum--;
		if (max < sum)
			max = sum;
	}
	cout << max << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000000007;
#define ll long long


int main()
{
	int N;
	string S;
	cin >> N >> S;
	string ans = "";
	int cnt = 0;
	for (int i = 0; i < N; i++) {
		if (S[i] == '(') {
			ans += '(';
			cnt++;
		}
		else {
			if (cnt != 0) {
				ans += ')';
				cnt--;
			}
			else {
				ans = '(' + ans + ')';

			}
		}
	}
	for (int i = 0; i < cnt; i++) {
		ans += ')';
	}
	cout << ans << endl;
}


Measured memory_bytes: 3640
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cstdlib>
#include<algorithm>
using namespace std;

int main()
{
	int k;
	int a,b;
	cin>>k>>a>>b;
	for(int i=a;i<=b;i++)
	{
		if(i%k==0)
		{
			cout<<"OK";
			return 0;
		}
	}
	cout<<"NG";
	return 0;
 } 

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF (1 << 30 - 1)
#define LLINF (1LL << 60)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

signed main() {
    cin >> A >> B;
    cout << A * B << endl;
}

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

using namespace std;

typedef long long int lli;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define forr(i,m,n) for(int i=m;i<n;i++)
#define read(n) int n;cin>>n;
#define testcase int t;cin>>t;while(t--)
#define all(v) v.begin(),v.end()
#define pb push_back
#define endl "\n"
#define print(v) forr(i,0,v.size())cout<<v[i]<<" ";cout<<endl;
#define MOD 998244353


int main() {
    fastio
    read(n); read(k); vector<int> v(n+k), cost(n); int ans=0,tt;
    forr(i,0,n) cin>>v[i];
    forr(i,n,v.size()) v[i]=999999;
    
    cost[n-1]=0;
    cost[n-2] = abs(v[n-2]-v[n-1]);
    for(int current=n-3;current>=0;current--){
        tt=INT_MAX;
        for(int i=1;i<=k;i++){
            tt = min(tt, abs(v[current]-v[current+i])+cost[current+i]);
        }
        cost[current]=tt;
    }
    // print(cost);
    cout<<cost[0]<<endl;
    
    return 0;
}

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

int main(){
  int n,a,count=0;
  cin >> n;
  map<int,int> mp;
  r(i,n){
    cin >> a;
    mp[a]++;
  }
  for(auto it=mp.begin();it!=mp.end();it++){
    if((*it).second%2==1)count++;
  }
  cout << count << endl;
}


Measured memory_bytes: 4992
object Main extends App {
  import scala.io.StdIn._

  object Pasta {
    val pastas: List[Pasta] = List(Tomato, Cream, Basil)
  }
  sealed class Pasta(val toIndex:Int)
  case object Tomato extends Pasta(0)
  case object Cream extends Pasta(1)
  case object Basil extends Pasta(2)
  val mod = 10000

  val Array(n, k) = readLine.trim.split(' ').map(_.toInt)
  val pasta = Array.tabulate(n){_ ⇒ None: Option[Pasta]}.also{arr ⇒
    for (_ ← 0 until k){
      val Array(a, b) = readLine.trim.split(' ').map(_.toInt)
      arr(a - 1) = Some(b match {
        case 1 ⇒ Tomato
        case 2 ⇒ Cream
        case 3 ⇒ Basil
      })
    }
  }.toList
  println(
    calPatternExcept(pasta)
  )
  def calPatternExcept(plan: List[Option[Pasta]], notAllow: Option[Pasta] = None, length: Int = 0)(implicit memo:Array[Array[Option[Int]]] = Array.tabulate(plan.length){_ => Array.tabulate(3){_ => None: Option[Int]}}): Int = {
    if (length > memo.length) 0
    else if (length == memo.length) 1
    else {
      notAllow match {
        case None ⇒ (plan match {
          case Nil ⇒ 1
          case None::None::t ⇒ Pasta.pastas.map(p ⇒ calPatternExcept(None::t, Some(p), length + 1) + calPatternExcept(t, Some(p), length + 2)).sum
          case None::Some(n)::t ⇒ Pasta.pastas.map{
            case `n` ⇒ calPatternExcept(t, Some(n), length + 2)
            case p ⇒ calPatternExcept(Some(n)::t, Some(p), length + 1)
          }.sum
          case Some(a)::None::t ⇒ calPatternExcept(None::t, Some(a), length + 1) + calPatternExcept(t, Some(a), length + 2)
          case Some(a)::Some(b)::t if a == b ⇒ calPatternExcept(t, Some(a), length + 2)
          case Some(a)::Some(b)::t ⇒ calPatternExcept(Some(b)::t, Some(a), length + 1)
          case None::Nil ⇒ 3
          case Some(_)::Nil ⇒ 1
        }).let(_ % mod)
        case Some(n) if memo(length)(n.toIndex).isDefined ⇒ memo(length)(n.toIndex).get
        case Some(n) ⇒ (plan match {
          case Nil ⇒ 1
          case Some(a)::_ if a == n ⇒ 0
          case None::None::t ⇒ Pasta.pastas.filterNot(_ == n).map(p ⇒ calPatternExcept(None::t, Some(p), length + 1) + calPatternExcept(t, Some(p), length + 2)).sum
          case None::Some(a)::t ⇒ Pasta.pastas.filterNot(_ == n).map{
            case `a` ⇒ calPatternExcept(t, Some(a), length + 2)
            case p ⇒ calPatternExcept(Some(a)::t, Some(p), length + 1)
          }.sum
          case Some(a)::None::t ⇒ calPatternExcept(None::t, Some(a), length + 1) + calPatternExcept(t, Some(a), length + 2)
          case Some(a)::Some(b)::t if a == b ⇒ calPatternExcept(t, Some(a), length + 2)
          case Some(a)::Some(b)::t ⇒ calPatternExcept(Some(b)::t, Some(a), length + 1)
          case None:: Nil ⇒ 2
          case Some(_)::Nil ⇒ 1
        }).let(_ % mod).also(i ⇒ memo(length)(n.toIndex) = Some(i))
      }
    }
  }
  implicit class ScopeFunc[T](value: T){
    def let[A](func: T ⇒ A): A = func(value)
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}


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

int main(){
  int n;
  cin >> n;
  long long int a[n+1];
  long long int b[n];
  long long int ans = 0;
  for(int i = 0;i < n+1;i++){
    cin >> a[i];
  }
  for(int i = 0;i < n;i++){
    cin >> b[i];
  }
  for(int i = n-1;i >= 0;i--){
    if(a[i+1] > b[i]){
      ans += b[i];
      continue;
    }else{
      ans += a[i+1];
      b[i] -= a[i+1];
      if(a[i] > b[i]){
        ans += b[i];
        a[i] -= b[i];
        continue;
      }else{
        ans += a[i];
        a[i] = 0;
        continue;
      }
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 1792
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    printf("%.2lf",2*3.14159*n);

    return 0;
}


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

 int main() {
 int N;
 cin >> N;
 vector<int> a(N);
 int sum = 0;

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

 int mini = sum;
 int prefix_sum = 0;
 for (int i = 0; i < N; ++i) {
 
 prefix_sum += a[i];
 mini = min(mini, abs(prefix_sum - (sum - prefix_sum)));
 }

 cout << mini << endl;
 return 0;
 }


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

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define endl "\n"
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

ll d[500100];

int main(){
  string s;
  cin>>s;
  clr(d,-1);
  rep(i,0,s.sz-1){
    if(s[i]=='>'&&s[i+1]=='<'){
      d[i+1] = 0;
    }
  }
  if(s[0]=='<'){
    d[0] = 0;
  }
  if(s[s.sz-1]=='>'){
    d[s.sz] = 0;
  }
  rep(i,0,s.sz){
    if(s[i]=='<'){
      d[i+1]=d[i]+1;
    }
  }
  per(i,0,s.sz){
    if(s[i]=='>'){
      d[i]=max(d[i],d[i+1]+1);
    }
  }
  ll sum = 0;
  rep(i,0,s.sz+1){
    sum += d[i];
  }
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 4740
import java.util.*;
import java.io.PrintWriter;
public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		long mod=1000000007;
		long[] dp=new long[1<<n];
		boolean[][] a=new boolean[n][n];
		for(int i=0; i<n; i++){
			for(int j=0; j<n; j++){
				int tmp=sc.nextInt();
				if(tmp==1){
					a[i][j]=true;
				}
			}
		}
		dp[0]=1;
		for(int i=1; i<1<<n; i++){
			for(int j=0; j<n; j++){
				if(((i>>j & 1)==1) && a[Integer.bitCount(i)-1][n-1-j]){
					dp[i]=(dp[i]+dp[i^(1<<j)])%mod;
				}
			}
		}
		System.out.println(dp[(1<<n)-1]);
	}
}

Measured memory_bytes: 40276
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cassert>
#include <cstdlib>
#include <algorithm>
using namespace std;
 
const int maxn = int(1e5)+5;
 
int sz[maxn], P[maxn];
vector<int> graph[maxn];
 
void dfs(int node, int par)
{
	sz[node] = 1, P[node] = par;
	for(auto it: graph[node])
	{
		if(it != par)
		{
			dfs(it, node);
			sz[node] += sz[it];
		}
	}
}
 
int main(void)
{
	int n, a, b;
	scanf("%d", &n);
 
	for(int i = 1;i < n;i++)
	{
		scanf("%d%d", &a, &b);
		a--, b--;
		graph[a].push_back(b), graph[b].push_back(a);
	}
 
	dfs(0, -1);
 
	int cur = n-1;
	vector<int> path;
	while(cur != -1)
	{
		path.push_back(cur);
		cur = P[cur];
	}
	reverse(path.begin(), path.end());
 
	int patha = 0, pathb = int(path.size())-1, tot = 0, aa = -1, bb = -1;
	while(patha < pathb-1)
	{
		if(tot%2) pathb--, bb--;
		else patha++, aa--;
		tot++;
	}
 
 
	int meet = pathb;
	assert(meet == ceil(int(path.size())/2.0));
 
	aa += n-sz[path[meet]], bb += sz[path[meet]];
	while(true)
	{
		if(tot%2)
		{
			if(bb <= 0)
			{
				printf("Fennec\n");
				exit(0);
			}
			bb--;
		}
		else
		{
			if(aa <= 0)
			{
				printf("Snuke\n");
				exit(0);
			}
			aa--;
		}
		tot++;
	}
}

Measured memory_bytes: 13436
#include<stdio.h>
#include<math.h>
int main(){
	int divisor[10000];
	int temp,i;
	int area[10000];
	
	for(temp=0;scanf("%d",&divisor[temp])!=EOF;temp++){
		for(i=1;i<=(600-divisor[temp])/divisor[temp];i++){
			area[temp]=area[temp]+divisor[temp]*pow(i*divisor[temp],2);
		}
		printf("%d\n",area[temp]);
	}
	return 0;
}

Measured memory_bytes: 604
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
        tree_order_statistics_node_update>
        new_data_set;

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define PSET(x,y) fixed<<setprecision(y)<<x
#define pb push_back
#define pf push_front
#define pii pair<int,int>
#define mp make_pair
#define vi vector<int>
#define vip vector<pair<int,int> >
#define ff first
#define ss second
#define int long long
#define SIZE 200010
#define mod 1000000007
#define BIG 998244353
#define s(t) scanf("%d",&t)
#define p(t) printf("%d\n",t)
#define mii map<int,int>
#define MSET(table,i) memset(table, i, sizeof(table))
#define endl '\n'
#define tc int t;cin>>t;while(t--)
#define pi  3.1415926358
#define print(x) for(auto el: x) cout<<el<<" ";cout<<endl
#define bits(x) __builtin_popcount(x)
#define minimum(a,n) min_element(a,a+n)-a
#define maximum(a,n) max_element(a,a+n)-a
#define pqbig priority_queue<int>
#define pqsmall priority_queue<int,vector<int>,greater<int> >
#define all(v) v.begin(),v.end()
#define sitr set<int>:: iterator
#define mitr map<int,int>:: iterator

#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl


int32_t main()
{
    fast;
    int n,k;cin>>n>>k;
    string s;cin>>s;
    vi v;
    int i=0;
    while(i<n)
    {
        int cnt=1;
        char ch=s[i++];
        while(i<n and s[i]==ch)
            i++,cnt++;
        v.pb(cnt);
    }

    if(v.size()<=(2*k+1))
    {
        cout<<n-1;
        return 0;
    }

    int start=-1,maxi=0,end;
    int sum=0;
    for(int i=0;i<2*k+1;i++)
        sum+=v[i];

    start=0,maxi=sum,end=2*k+1;
    for(int i=2*k+1;i<v.size();i++)
    {
        sum+=v[i];
        sum-=v[i-2*k-1];
        if(sum>maxi)
            maxi=sum,start=i-2*k,end=i+1;
    }

    vi tmp;
    for(int i=0;i<start;i++)
        tmp.pb(v[i]);

    tmp.pb(maxi);
    for(int i=end;i<v.size();i++)
        tmp.pb(v[i]);

    int ans=0;
    for(int i=0;i<tmp.size();i++)
        ans+=tmp[i]-1;

    cout<<ans;

}

Measured memory_bytes: 2628
#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> p(m);
	vector<string> s(m);
	vector<int> ac(m, 0);
	vector<int> wa(m, 0);
	vector<bool> ac_p(n, false);
	vector<int> wa_p(n, 0);
	int ac_cnt=0, wa_cnt=0;
	for (int i=0; i<m; i++){
			cin >> p[i];
			cin >> s[i];
	}
	for (int i=0; i<m; i++) {
		if (s[i] == "AC" && ac_p[p[i]] == false){
			ac_cnt++;
			wa_cnt += wa_p[p[i]];
			ac_p[p[i]] = true;
		} else if (s[i] == "WA" && ac_p[p[i]] == false) {
			wa_p[p[i]]++;
		}
	}
	cout << ac_cnt << " " << wa_cnt << endl;
	return 0;
}

Measured memory_bytes: 4224
#include <bits/stdc++.h>
     
using namespace std;
     
typedef long long ll;
     
double getTime() { 
  return clock() / (double) CLOCKS_PER_SEC;
}
     
void read() {};
     
template<typename T, typename... Args>
void read(T& a, Args&... args) {
  cin >> a;
  read(args...);
}
     
void print() {};
     
template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " \n"[sizeof...(args) == 0];
  print(args...);
}

int main() {
  ll H; read(H);
  ll sum = 0;
  for(ll i = 1LL; i <= H; i <<= 1LL) {
    sum += i;
  }
  print(sum);
}

Measured memory_bytes: 256
package main
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

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

func main(){
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	N, M, K := nextInt(), nextInt(), nextInt()
	A := append([]int{0}, nextInts(N)...)
	B := append([]int{0}, nextInts(M)...)
	for i:=1; i<=N; i++{
		A[i] += A[i-1]
	}
	for i:=1; i<=M; i++{
		B[i] += B[i-1]
	}
	ans := 0
	for i:=0; i<=N; i++{
		rest := K-A[i]
		if rest < 0{
			break
		}
		// golangでupper_boundどうやるんだ？？？？？？・
		/// bidx := max(0, sort.Search(len(B), func(j int)bool{return rest<=B[j]}))
		// bidx := sort.Search(len(B), func(j int)bool{return rest<=B[j]})-1
		// bidx := sort.SearchInts(B, rest)
		// わからんので仕方なく手書き
		left, right := -1, len(B)
		for right - left > 1{
			mid := (left+right)/2
			if rest-B[mid]>=0{
				left = mid
			}else{
				right = mid
			}
		}
		bidx := left
		ans = max(ans, i+bidx)
	}
	fmt.Fprintln(out, ans)
}

func min(a, b int) int {
	if a<b{
		return a
	}
	return b
}

func max(a, b int) int {
	if a<b{
		return b
	}
	return a
}
func next() string {
	sc.Scan()
	return sc.Text()
}

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

func nextInts(n int) []int{
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}


Measured memory_bytes: 10140
#include <iostream>
#include <string>
using namespace std;
int main() {
	string s;
	cin >> s;
	int L = s.length();
	char col = '?';
	int n = -1;
	for(int i = 0; i < L; i++) {
		if(col != s[i]) {
			col = s[i];
			n++;
		}
	}
	cout << n << endl;
	return 0;
}

Measured memory_bytes: 512
from collections import Counter
N = int(input())
A = [int(i) for i in input().split()]

l = []
c = Counter(A)
for k in c.keys():
    if c[k] >= 2:
        l.append(k)
    if c[k] >= 4:
        l.append(k)
l.sort(reverse=True)
if len(l) > 1:
    print(l[0]*l[1])
else:
    print(0)


Measured memory_bytes: 68760
#include <bits/stdc++.h>
using namespace std;
 int main() {
   int l, n, m;
   cin >> n;
   m = 0, l = n;
   for (int i = 0; i < 10; i ++) {
     m += n % 10;
     n /= 10;
   }
   if (l % m == 0) {
     cout << "Yes" << endl;
   }
   else {
     cout << "No" << endl;
   }
 }

Measured memory_bytes: 256
package main

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

var sc *bufio.Scanner
var writer io.Writer

func init() {
	sc = bufio.NewScanner(os.Stdin)
	writer = os.Stdout
	sc.Split(bufio.ScanWords)
}

func main() {
	solve()
}

func solve() {
	k, x := nextInt(), nextInt()
	min := x - (k - 1)
	for i := 0; i < k*2-1; i++ {
		fmt.Fprint(writer, min+i, " ")
	}
}

func nextWord() string {
	sc.Scan()
	str := sc.Text()
	return str
}

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


Measured memory_bytes: 640
#include<stdio.h>
#include<iostream>
#include<string>
#include<math.h>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<time.h>
#include<ctime>
#include<functional>
#define int long long
#define itn int
#define f(n) for(int i=0;i<(n);i++)
using namespace std;
typedef pair<int, int> P;
signed main() {
	int a;
	cin >> a;
	cout << ((a + 1) / 2) * (a / 2) << endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int n,d,x,cho=0;
  cin >>n; cin >>d; cin >> x;
  int a[n],i,j;
  for(i=0;i<n;i++) cin >> a[i];
  for(i=0;i<n;i++){
    if(a[i]==1) cho += d;
    else{
    for(j=1;j<=d;j++){
      if(j%a[i]==1){
        cho++;
      }
    }
  }
  }
  cout << cho+x;
}


Measured memory_bytes: 256
class Node
  attr_reader :id, :left, :right
  attr_accessor :parent
  protected :parent=

  def initialize(id)
    @id = id
  end

  def left=(node)
    @left = node
    node.parent = self
  end

  def right=(node)
    @right = node
    node.parent = self
  end

  def grand_parent
    @parent.nil? ? self : @parent.grand_parent
  end
end

class NodeRepository
  include Enumerable

  def initialize
    @store = {}
  end

  def [](id)
    @store[id] ||= Node.new(id)
  end

  # The order may be random.
  def each(&block)
    Enumerator.new do |y|
      @store.each { |_, v| y << v }
    end.each(&block)
  end
end
repo = NodeRepository.new

n = gets.chomp.to_i
n.times do
  current, left, right = gets.chomp.split(' ').map(&:to_i)
  node = repo[current]
  node.left = repo[left] if left != -1
  node.right = repo[right] if right != -1
end
root = repo.first.grand_parent

class TreeWalker
  def self.enum_node_preorder(node, &block)
    yield node
    enum_node_preorder(node.left, &block) if node.left
    enum_node_preorder(node.right, &block) if node.right
  end
  def self.enum_node_inorder(node, &block)
    enum_node_inorder(node.left, &block) if node.left
    yield node
    enum_node_inorder(node.right, &block) if node.right
  end
  def self.enum_node_postorder(node, &block)
    enum_node_postorder(node.left, &block) if node.left
    enum_node_postorder(node.right, &block) if node.right
    yield node
  end

  def initialize(root)
    @root = root
  end

  def enum_preorder(&block)
    self.class.enum_node_preorder(@root, &block)
  end
  def enum_inorder(&block)
    self.class.enum_node_inorder(@root, &block)
  end
  def enum_postorder(&block)
    self.class.enum_node_postorder(@root, &block)
  end
end
walker = TreeWalker.new(root)

puts "Preorder"
print ' '
puts walker.to_enum(:enum_preorder).map(&:id).join(' ')

puts "Inorder"
print ' '
puts walker.to_enum(:enum_inorder).map(&:id).join(' ')

puts "Postorder"
print ' '
puts walker.to_enum(:enum_postorder).map(&:id).join(' ')



Measured memory_bytes: 8924
#include <iostream>
#include<cstring>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(c<=b&&c>=a){
		cout<<"Yes"<<endl;
	}
	if(c>b||c<a){
		cout<<"No"<<endl;
	}
	return 0; 
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a) for(int i=0;i<a;i++)
using namespace std;
int main(){
    int n;
    cin>>n;
    map<int,int> m;
    rep(i,n){
        int enter;
        cin>>enter;
        m[enter]=0;
    }
    cout<<m.size()<<endl;
    return 0;
}

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

using namespace std;

int main(){
	int x[3];
	int num,hole;
	while(cin >> x[0] >> x[1] >> x[2]){
		if(x[0]+x[1]+x[2] == 0) break;
		sort(x,x+3);
//		cout << x[0];

		cin >> num;
		for(int i=0;i<num;i++){
			cin >> hole;
			if((4 * hole* hole) > (x[0] * x[0] + x[1] * x[1])){
				cout << "OK" << endl;
			}
			else{
				cout << "NA" << endl;
			}
		}
	}
}

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

int main(){
    ll n,m;
    cin>>n>>m;
    ll ans=2019;
    for (ll i = n; i < min(m,n+2020); ++i) {
        for (ll j = i+1; j <=min(m,i+2020) ; ++j) {
            ans=min(ans,i*j%2019);
        }
    }
    cout<<ans;
    return 0;
}

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}






int gcd(int a,int b)
{
 
  int r, tmp;
 
  
 
  /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
 
 
 
  return b;
}







int fac(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}
///////////////////////////
int main() {
  int count;
  vector<int> v(3);
  rep(i,3) cin>>v[i];
  sort(v.begin(),v.end());
  count=v[2]*2-v[0]-v[1];
  if(count%2==0){
    cout<<count/2<<endl;
  }else{
    cout<<count/2+2<<endl;
  }
}
///////////////////////////




Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define REP(i,a) for(int i = 0; i < (a); i++)
using namespace std;

int main(){
	ll n,m;
	cin >> n >> m;
	ll res;
	if(n == 1 && m == 1) res = 1;
	else if(n == 1) res = m - 2;
	else if(m == 1) res = n - 2;
	else res = (n - 2) * (m - 2);
	cout << res << endl;
}

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

bool first(pair<long int, long int> a, pair<long int, long int> b) {
    if (a.first != b.first) return a.first < b.first;
    else return a.second < b.second;
}
int main(){
    int N, K;
    cin >> N >> K;
    vector<pair<long int, long int>> point(N);
    for (int i = 0; i < N; i++) {
        long int x, y;
        cin >> x >> y;
        point[i] = {x, y};
    }
    sort(point.begin(), point.end(), first);
    
    long int ans;
    for (int i = 0; i < N-K+1; i++) {
        long int l = point[i].first;
        long int r;
        vector<long int> y;
        for (int j = i; j < N; j++) {
            y.insert(lower_bound(y.begin(), y.end(), point[j].second), point[j].second);
            if (j-i+1 >= K) {
                r = point[j].first;
                long int u, d;
                for (int k = 0; k < j-i+1-K+1; k++) {
                    d = y[k];
                    u = y[k+K-1];
                    if (ans == 0) ans = (u-d)*(r-l);
                    else ans = min(ans, (u-d)*(r-l));
                }
            }
        }
    }
    printf("%ld", ans);
    
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	ll W,H,x,y;
	scan(W>>H>>x>>y);
	int flag;
	ld ans=(ld)W*H/2;
	if(x*2==W&&y*2==H) flag=1;
	else flag=0;
	cout << setprecision(13)<<ans << " ";
	prin(flag);
	return 0;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task
    {
        static long mod = 1_000_000_000 + 7;

        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            long n = in.nextInt();
            long a = in.nextInt();
            long b = in.nextInt();

            long ans = power(2, n, mod) - 1;
            ans -= C(n, a, mod) % mod;
            ans -= C(n, b, mod) % mod;
            out.print((ans % mod + mod) % mod);
        }

        static long power(long a, long n, long m)
        {
            long ret = 1;
            for (; n > 0; n >>= 1, a = a * a % m)
            {
                if (n % 2 == 1)
                {
                    ret = ret * a % m;
                }
            }
            return ret;
        }

        static long C(long N, long K, long mod)
        {
            long x = 1, y = 1;
            for (int i = 1; i <= K; i++)
            {
                x = x * (N - i + 1) % mod;
                y = y * i % mod;
            }
            return x * power(y, mod - 2, mod) % mod;
        }

    }
}



Measured memory_bytes: 22740
#include "bits/stdc++.h"
using namespace std;

vector<int> g[505];
int l_cnt[505], r_cnt[505];
bool used[505];

int print(bool ok) {
        if (ok) cout << "YES" << endl;
        else cout << "NO" << endl;
        return 0;
}

bool dfs(int v) {
        used[v] = true;
        bool res = l_cnt[v] != r_cnt[v];
        for (auto u : g[v]) if (!used[u]) res |= dfs(u);
        return res;
}

int main() {
        int n, h, a, b, c, d;
        cin >> n >> h;
        for (int i = 0; i < n; i ++) {
                cin >> a >> b >> c >> d;
                int lh = (c == 0 ? a : c + 250);
                int rh = (d == 0 ? b + 250 : d);
                l_cnt[lh] ++;
                r_cnt[rh] ++;
                g[lh].push_back(rh);
                g[rh].push_back(lh);
        }
        for (int i = 0; i < h + 1; i ++) if (r_cnt[i] > l_cnt[i]) return print(0);
        for (int i = 251; i < h + 251; i ++) if (l_cnt[i] > r_cnt[i]) return print(0);
        for (int i = 0; i < 501; i ++) if (!used[i]) if (!g[i].empty()) if (!dfs(i)) return print(0);
        return print(1);
}


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

#define int long long
#define otp(n) cout << n;
#define ct(n) cout << n << endl;
#define cts(n) cout << n << " ";
#define cte cout << endl;
#define ctv(v) rep(i,(v).size()) otp(v[i]) cte
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repo(i,o,n) for(int i=o;i<n;i++)
#define repm(i,n) for(int i=n-1;i>=0;i--)
#define repv(i,v) for(int i=0;i<(v).size();i++)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define vcopy(v1,v2) copy((v1).begin(), (v1).end(), back_inserter((v2)));
#define pb(n) push_back(n);

int n,ans=1;
const int  a=1000000007;

main() {
    cin >> n;
    rep1(i,n) ans = ans*i%a;
    ct(ans)
}


Measured memory_bytes: 256
import std.stdio, std.string, std.conv, std.algorithm, std.numeric;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

immutable inf = 10^^9 + 7;
alias Edge = Tuple!(int, "to", int, "cost");

void main() {
    int n, m, s;
    scan(n, m, s);

    auto adj = new Edge[][](n, 0);

    foreach (i ; 0 .. m) {
        int a, b, c;
        scan(a, b, c);
        adj[a] ~= Edge(b, c);
    }

    auto d = dijkstra(adj, s);

    foreach (i ; 0 .. n) {
        if (d[i] == inf) writeln("INF");
        else writeln(d[i]);
    }
}

int[] dijkstra(Edge[][] adj, int s) {
    alias Node = Tuple!(int, "num", int, "dist");

    auto n = adj.length.to!int;
    auto minhp = new BinaryHeap!(Array!Node, "a.dist > b.dist")();
    auto d = new int[](n);
    d[] = inf;
    minhp.insert(Node(s, 0));

    while (!minhp.empty) {
        auto v = minhp.front;
        minhp.popFront();

        if (d[v.num] <= v.dist) continue;
        d[v.num] = v.dist;

        foreach (e ; adj[v.num]) {
            if (d[v.num] + e.cost < d[e.to]) {
                minhp.insert(Node(e.to, d[v.num] + e.cost));
            }
        }
    }

    return d;
}


void scan(T...)(ref T args) {
    string[] line = readln.split;
    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: 54196
#include <iostream>
#include <vector>

using namespace std;

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

  int n, t;
  cin >> n >> t;

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

  int sum = t;
  for (int i = 1; i < n; i++) {
    int d = max(0, t - ts[i] + ts[i - 1]);
    sum += (t - d);
  }

  cout << sum << endl;
  return 0;
}



Measured memory_bytes: 1024