akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

int main() {
    vector<vector<int>> ar(3,vector<int>(3));
    rep(i,3) rep(j,3) cin >> ar[i][j];
    bool t = true;
    P p = P(ar[0][1]-ar[0][0],ar[0][2]-ar[0][1]);
    rep(i,2){
        P q = P(ar[i+1][1]-ar[i+1][0],ar[i+1][2]-ar[i+1][1]);
        if (p != q) t = false; 
    }
    if (t) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3604
#include <vector>
#include <cmath>
#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<vector<int> > vec(n+1, vector<int>());

    for(int i = 2; i <= n; i++) {
        int x;
        cin >> x;
        vec[x].push_back(i);
    }

    for(int i = 1; i <= n; i++) {
        cout << vec[i].size() << ' ';
    }

    return 0;
}

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

int main()
{
    int n,i,sum=0;
    char p[100];
    char q[100];
    int x[100]={0};
    cin>>p;
    for(i=0;i<strlen(p);i++)
    {
        if(p[i]=='B')
        {
            if(sum-1>=0)
            {
                sum--;
            }
        }
        else
        {
            q[sum++]=p[i];
        }
    }
    for(i=0;i<sum;i++)
    {
        cout<<q[i];
    }
    cout<<endl;
    return 0;
}

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

#define int long long
#define flash ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) begin(x),end(x)

int mod = 1e9+7;
int inf = 4e18;
const int N = 5e5+5;
		
signed main()
{
    flash
    int tt = 1;
    //cin>>tt;
    while(tt--)
    {
		int n,k;
		cin>>n>>k;
		int arr[n];
		for(int i=0;i<n;++i)
		{
			cin>>arr[i];
		}
		int low=1,high = 1e9,mid,ans = -1;
		auto help = [&](int mid)
		{
			int cuts = 0;
			for(int i=0;i<n;++i)
			{
				cuts+= (arr[i]+mid-1)/mid -1;
			}
			return cuts<=k;
		};
		while(low<=high)
		{
			mid = low+(high-low)/2;
			if(help(mid))
			{
				ans = mid;
				high = mid-1;
			}
			else
			{
				low = mid+1;
			}
		}
		cout<<ans<<"\n";		
    }
    return 0;
}


Measured memory_bytes: 5120
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
using namespace std;
using llong = long long;

llong x, y;
llong ans;

int main() {
    cin >> x >> y;

    while (x <= y) {
        x *= 2;
        ans++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3

from collections import deque

n = int(input())

edges = [[] for _ in range(n)]
for _ in range(n):
    line = list(map(int, input().split()))
    u = line[0] - 1
    if len(line) != 2:
        v_list = line[1:]
        for v in v_list:
            edges[u].append(v - 1)
# print(n, edges)

dist = [-1 for _ in range(n)]
que = deque()


def dfs(que, dist):
    while len(que) > 0:
        v = que.popleft()

        for v_adj in edges[v]:
            if dist[v_adj] == -1:
                dist[v_adj] = dist[v] + 1
                que.append(v_adj)


dist[0] = 0
que.appendleft(0)
dfs(que, dist)

for i in range(n):
    print(f"{i + 1} {dist[i]}")



Measured memory_bytes: 6016
#include <iostream>
#include <algorithm>
#define int long long
using namespace std;
signed main() {
	int a[500], l = 2;
	for (int i = 2;; i++) {
		a[i] = i * (i - 1) / 2;
		if (a[i] > 100000)break;
		l++;
	}
	int n; cin >> n;
	int flag = 0;
	for (int i = 2; i < l; i++) {
		if (a[i] == n) { flag = i; break; }
		else if (a[i] > n)break;
	}
	if (!flag) { cout << "No\n"; return 0; }
	else {
		cout << "Yes\n";
		cout << flag << endl;
		int cnt1 = 0, cnt2 = 0, p1[500];
		for (int i = 0; i < flag; i++) {
			cout << flag - 1;
			for (int j = 0; j < cnt1; j++) {
				cout << ' ' << p1[j] - (flag - i) + 1;
			}
			for (int j = cnt1; j < flag - 1; j++) {
				cout << ' ' << ++cnt2;
			}
			p1[i] = cnt2;
			cnt1++;
			cout << endl;
		}
	}
}

Measured memory_bytes: 1408
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var n = cin.ReadInt;
            double yen = 0;
            for (int i = 0; i < n; i++)
            {
                var rate = 1.0;
                var c = cin.ReadLine.Split(' ');
                if (c[1] == "BTC") rate = 380000;
                yen += double.Parse(c[0]) * rate;
            }
            Console.WriteLine(yen);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
        public double[] ReadDoubleArray(long N) { var ret = new double[N]; for (long i = 0; i < N; ++i) ret[i] = ReadDouble; return ret; }
    }
}




Measured memory_bytes: 11348
MOD = (1e+9 + 7).to_i

def f(n)
  s = 1
  (1..n).each {|i| s = (s * i) % MOD}
  return s
end

def main(argv)
  n = STDIN.gets.chomp.to_i
  STDOUT.puts f(n).to_i
end

if self.to_s == 'main' then
  main(ARGV)
end

Measured memory_bytes: 1788
def getinputdata():

    # 配列初期化
    array_result = []    
    data = input()
    array_result.append(data.split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
s = arr_data[1][0]

maxdata=0
for i in range(1,n):
    
    s1=set(s[:i])
    s2=set(s[i:])
    
    maxdata=max(maxdata,len(s1&s2))
    
print(maxdata)

Measured memory_bytes: 3064
#include <iostream> // cout, endl, cin
#include <cmath> //sqrt pow
#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> // dequef
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower

#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define all(a) (a).begin(), (a).end()
#define mod 1000000007
using ll = long long;
using namespace std;
int main(){
  string s,t,u;
  int a,b;
  cin >> s >> t >> a >> b >> u;
  if(s == u) cout << a - 1 << " " << b << endl;
  else cout << a << " " << b - 1 << endl;
}

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

using namespace std;
using ll = long long;

const int MOD = 1e9 + 7;
#define REP(i, n)  for(int i = 0; i < n; ++i)
#define FOR(i, t, n)  for(ll i = t; i <= (ll)n; ++i)
struct edge {
    int from, to;
    ll cost;
};


class Eratosthenes {
public:
    vector<bool> prime;

    Eratosthenes(ll size) {
        size = max((int) sqrt(size) + 1, 101010);
        prime.resize(size, 1);
        prime[0] = 0;
        prime[1] = 0;
        for (size_t i = 2; i * i <= size; ++i)
            if (prime[i]) {
                for (size_t j = 2; i * j <= size; ++j)prime[i * j] = false;
            }
    }
};


class Combination {
    vector<ll> fac; //n!(mod M)
    vector<ll> ifac; //k!^{M-2} (mod M)
public:
    Combination(ll size) {
        fac.resize(size);
        ifac.resize(size);
        fac[0] = 1;
        ifac[0] = 1;
        for (ll i = 0; i < size; i++) {
            fac[i + 1] = fac[i] * (i + 1) % MOD;
            ifac[i + 1] = ifac[i] * mpow(i + 1, MOD - 2) % MOD;
        }
    }

    ll mpow(ll x, ll n) {
        ll ans = 1;
        while (n != 0) {
            if (n & 1) ans = ans * x % MOD;
            x = x * x % MOD;
            n = n >> 1;
        }
        return ans;
    }

    ll comb(ll a, ll b) {
        if (a == 0 && b == 0)return 1;
        if (a < b || a < 0)return 0;
        ll tmp = ifac[a - b] * ifac[b] % MOD;
        return tmp * fac[a] % MOD;
    }
};


ll GCD(ll a, ll b) {
    if (b == 0)return a;
    return GCD(b, a % b);
}

ll LCM(ll a, ll b) {
    ll gcd = GCD(a, b);
    return a / gcd * b;
}

ll N, M;

int main() {
    cin >> N;
    map<ll, int> n, m;
    REP(i, N) {
        int a;
        cin >> a;
        n[a]++;
    }
    cin >> M;
    REP(i, M) {
        int a;
        cin >> a;
        m[a]++;
    }
    bool ok = true;
    for (auto k:m) if (n[k.first] < k.second)ok = false;
    if (ok)cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 25216
#include <iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
using namespace std;
typedef long long ll;

const ll MOD_CONST = 1000000007;



int main()
{
	int h, w;
	cin >> h >> w;
	vector<string> s(h);
	for (int i = 0; i < h; i++) {
		cin >> s[i];
	}


	vector<vector<int>> cost(h, vector<int>(w,100000));

	cost[0][0] = 0;

	queue<pair<int, int>>	que;
	que.push(make_pair(0, 0));

	vector<vector<int>> d{ {1,0},{0,1},{-1,0},{0,-1} };
	while (!que.empty()) {
		pair<int, int> v = que.front();
		que.pop();

		for (int i = 0; i < 4; i++) {
			int h1 = v.first + d[i][0];
			int w1 = v.second + d[i][1];
			//cout << h1 << " " << w1 << endl;
			if (0 <= h1 && h1 < h  && 0<= w1 && w1 < w && s[h1][w1] == '.') {
				if (cost[h1][w1] > cost[v.first][v.second] + 1) {
					cost[h1][w1] = cost[v.first][v.second] + 1;
					que.push(make_pair(h1, w1));
				}
			}
		}

		//cout << v.first << " " << v.second << endl;
	
	}
	int cnt = 0;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (s[i][j] == '.') {
				cnt++;
			}
		}
	}
	if (cost[h - 1][w - 1] < 100000) {
		cout << cnt - 1 - cost[h - 1][w - 1] << endl;
	}
	else {
		cout << -1 << endl;
	}
	
}  



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);cout<<"\n";};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts> auto make_v(size_t a,Ts... ts){   return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){ for(auto &e:t) fill_v(e,v); }
template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value!=0>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value==0>::type fill_v(U &u,const V... v){ for(auto &e:u) fill_v<T>(e,v...);}
//FUNCTION  


void solve(void)
{ 
  int A,B,C;
  cin>>A>>B>>C;
  cout<<C<<" "<<A<<" "<<B;
  return;
}
  
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long 
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;
#define FORR(x,arr) for(auto& x:arr)
#define ZERO(a) memset(a,0,sizeof(a))





//3111111111111111111111111111111





	void solve(){

		ins(morty);
		string rick;
		FOR(i,0,morty.size()){
			if(morty[i] == 'B'){
				if(rick.size())rick.erase(rick.end()-1);
			}
			else{
				rick+=morty[i];
			}
		}

		out(rick);












	}









































int32_t main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall 
	oneforall

	solve();
	


	return 0;
}

Measured memory_bytes: 256
#include<iostream>
 
int main(){
 
    size_t h, w;
    std::cin >> h >> w;

    if(h == 1 || w == 1){
        std::cout << 1 << std::endl;
    }else if(h * w % 2 == 0){
        std::cout << h * w / 2 << std::endl;
    }else{
        std::cout << (h * w / 2) + 1 << std::endl;
    }
 
    return 0;
}


Measured memory_bytes: 256
require 'pp'
# IS_DEBUG = true
IS_DEBUG = false
def dputs str
	if(IS_DEBUG)
		puts str
	end
end
def dpp str
	if(IS_DEBUG)
		pp str
	end
end

D,N=gets.chomp.split(' ').map{|n| n.to_i}

if(N < 100)
	puts 100**D*N
else
	puts 100**D*101
end


Measured memory_bytes: 4092
input()
A = [int(x) for x in input().split()]

x1 = 0
x2 = 0
x4 = 0
for x in A:
    if x % 4 == 0:
        x4 += 1
    elif x % 2 == 0:
        x2 += 1
    else:
        x1 += 1

if x2 != 0:
    print("Yes" if x4 >= x1 else "No")
else:
    print("Yes" if x4 + 1 >= x1 else "No")

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

int main(){
    int a,b,c,n;
    cin >> n;
    for(int i = 0; i < n; ++i){
        cin >> a >> b >> c ;
        if (a > b) swap(a, b);
        if (b > c) swap(b, c);
        if (a > b) swap(a, b);
        if(a * a + b * b == c * c) cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}

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

int main() {

  map<string, vector<int> > m;
  string s;
  string data_s[101];
  int page;
  while( cin >> s >> page ) {
    m[s].push_back(page);
  }

  for( map<string, vector<int> >::iterator it = m.begin(); it != m.end(); it++) {
    cout << (*it).first << endl;
    sort((*it).second.begin(), (*it).second.end());
    for(int i=0; i<(*it).second.size()-1; i++) {
      cout << (*it).second[i] << " ";
    }
    cout << (*it).second[(*it).second.size()-1] << endl;
  }

}

Measured memory_bytes: 1244
n = []; x = []
for _ in range(3000):
    i, j = map(int, input().split())
    if i == 0 and j == 0:
        break
    else:
        n.append(i)
        x.append(j)

cnt = [0 for _ in range(len(n))]
for i in range(len(n)):
  sequence = [h+1 for h in range(n[i])]
  for j in reversed(sequence):
    for k in reversed(sequence[1:j-1]):
      if j + k >= x[i] or x[i] - (k-1) > j + k:
        continue
      cnt[i] += 1
  print(cnt[i])


Measured memory_bytes: 5604
s = input()
t=s
b=0
def sakana(sak, u):
  a=0
  for j in range(len(u)//2):
    if u[j] != u[(len(u)//2)+j]:
      break
    else:
      a=a+1
  if a==len(u)//2:
    return 0
  else:
    return 1

for i in range(len(t)):
  s=s[:-1]
  if len(s)%2==0 and sakana(i, s)==0:
    break
  else:
    b=b+1
print(len(t)-b-1)



Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ls( s) (s&(-s))
#define ll long long
#define inf 0x3f3f3f3f
const ll N = 200030;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =    1e9+7;

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

int n;
string s;
cin>>n>>s;
int cnt=0;
rep(i,2,s.length())
{
	if(s[i-2]=='A'&&s[i-1]=='B'&&s[i]=='C')
	cnt++;
}
cout<<cnt;



}

Measured memory_bytes: 256
import numpy as np

N, W = map(int, input().split())
INF = -10 ** 12

# 重さW以下の時の価値の最大値
dp = np.zeros((N, W + 1), dtype=np.int64)

for i in range(0, N):
    w, v = map(int, input().split())
    dp[i][:w] = dp[i-1][:w]
    dp[i][w:] = np.maximum(dp[i-1][w:], dp[i-1][:-w] + v)

print(dp[N - 1][W])

Measured memory_bytes: 91936
// {{{ by unolight
#pragma region
#include <bits/stdc++.h>
#include <unistd.h>
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-function"
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x),end(x)
#define RALL(x) rbegin(x),rend(x)
#define REP(i,n) for ( int i=0; i<int(n); i++ )
#define REP1(i,a,b) for ( int i=(a); i<=int(b); i++ )
#define MP make_pair
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef pair<int,int> PII;
typedef vector<int> VI;

namespace { namespace unolight {
// Read Input
template<class T> void _R( T &x ) { cin>>x; }
void _R( int &x ) { scanf("%d",&x); }
void _R( int64_t &x ) { scanf("%" PRId64,&x); }
void _R( double &x ) { scanf("%lf",&x); }
void _R( char &x ) { scanf(" %c",&x); }
void _R( char *x ) { scanf("%s",x); }
void R() {}
template<class T, class... U> void R( T& head, U&... tail ) { _R(head); R(tail...); }
// Write Output
template<class T> void _W( const T &x ) { cout<<x; }
void _W( const int &x ) { printf("%d",x); }
void _W( const int64_t &x ) { printf("%" PRId64,x); }
void _W( const double &x ) { printf("%.16f\n",x); }
void _W( const char &x ) { putchar(x); }
void _W( const char *x ) { printf("%s",x); }
template<class T> void _W( const vector<T> &x ) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W( const T& head, const U&... tail ) { _W(head); putchar(sizeof...(tail)?' ':'\n'); W(tail...); }

#ifdef UNOLIGHT
#include "dump.hpp"
#else
#define dump(...)
#endif

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}
#pragma endregion
// }}}

void main() {
    LL a,b,c,d;
    R(a,b,c,d);
    LL ans=a*c;
    chmax(ans,a*d);
    chmax(ans,b*d);
    chmax(ans,b*c);
    W(ans);
}

}} // {{{ main
int main() { unolight::main(); return 0; }
// }}}


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

int main()
{
	using namespace std;

	int card_num=0;
	int count=0;
	int num=0;
	int S[13] = {};
	int H[13] = {};
	int C[13] = {};
	int D[13] = {};
	char mark;

	cin >> card_num;

	while (count<card_num)
	{
		cin >> mark >> num;
		switch (mark)
		{
		case 'S':
			S[num - 1] = num;
			break;
		case 'H':
			H[num - 1] = num;
			break;
		case 'C':
			C[num - 1] = num;
			break;
		case 'D':
			D[num - 1] = num;
			break;
		}
		count++;
	}
	for (int i = 0; i<13; i++)
		if (S[i] == 0)
			cout << "S " << i + 1 << endl;

	for (int i = 0; i<13; i++)
		if (H[i] == 0)
			cout << "H " << i + 1 << endl;

	for (int i = 0; i<13; i++)
		if (C[i] == 0)
			cout << "C " << i + 1 << endl;

	for (int i = 0; i<13; i++)
		if (D[i] == 0)
			cout << "D " << i + 1 << endl;

	return 0;

}

Measured memory_bytes: 3056
N,M = map(int,input().split())
X = list(map(int,input().split()))
def search():
  if N>=M:
    return 0
  X.sort()
  cost=[X[i+1]-X[i] for i in range(M-1)]
  ans_tmp=X[-1]-X[0]
  cost.sort(reverse=True)
  for i in range(N-1):
    ans_tmp -= cost[i]
  return ans_tmp

print(search())

Measured memory_bytes: 13960
#include "bits/stdc++.h"
using namespace std;
#define long int64_t

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

	int H, W;
	cin >> H >> W;

	string ans = "";
	for( char i = 0; i < H; ++i ) {
		for( char j = 0; j < W; ++j ) {
			string s;
			cin >> s;

			if( s == "snuke" ) {
				ans = 'A' + j;
				ans += to_string( i+1 );
				break;
			}
		}

		if( !ans.empty() ) { break; }
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include<vector>
#include<iostream>
#include<algorithm>
#include<tuple>
#include<string>
#include<bits/stdc++.h>
using namespace std;
int func(int x){
    if((x%100)!=0)return 0;
    return func(x/100)+1;
}
void solve(){
    int D,N;
    cin>>D>>N;
    int cnt=0;
    for(int i=1;;i++){
        if(func(i)==D)cnt++;
        if(cnt==N){cout<<i<<endl;return;}
    
    }


}

int main(){
    solve();
    return 0;
}

Measured memory_bytes: 256
import bisect
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
sa = [0] * (n+1)
for i in range(n):
    sa[i+1] = sa[i] + a[i]
sb = [0] * (m+1)
for i in range(m):
    sb[i+1] = sb[i] + b[i]

ans = 0
for i in range(n+1):
    if sa[i] > k:
        break
    bi = bisect.bisect_right(sb, k-sa[i])-1
    ans = max(ans, i + bi)
print(ans)

Measured memory_bytes: 47568
#include<iostream>
#include<iomanip>
#include<functional>
#include<algorithm>
#include<string>
#include<vector>
#include<utility>
#include<tuple>
#include<map>
#include<set>
#include<queue>
#include<cmath>

using namespace std;
#define LL long long

int N,M,Q,a[55],b[55],c[55],d[55],arr[11],ans=0;

void solve(int dep,int num){
	if(dep==N){
		int tmp=0;
		for(int i=0;i<Q;i++)if(arr[b[i]-1]-arr[a[i]-1]==c[i])tmp+=d[i];
		ans=max(ans,tmp);
		return;
	}
	if(num>M)return;
	arr[dep]=num;
	solve(dep+1,num);
	solve(dep,num+1);
}

int main() {
	cin>>N>>M>>Q;
	for(int i=0;i<Q;i++)cin>>a[i]>>b[i]>>c[i]>>d[i];
	solve(0,1);
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 3636
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols
    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])
    return ret


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_map_as_int(H):
    '''
    #→1,.→0として読み込む
    '''
    ret = []
    for _ in range(H):
        ret.append([1 if s == '#' else 0 for s in read()[:-1]])
        # 内包表記はpypyでは若干遅いことに注意
        # #numpy使うだろうからこれを残しておくけど
    return ret


# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from fractions import gcd


def lcm(a, b):
    # 最小公約数
    g = gcd(a, b)
    return a * b // g


a, b, c = read_ints()
from math import sqrt
# if sqrt(a) + sqrt(b) < sqrt(c):
#     print('Yes')
# else:
#     print('No')


# if (a) + (b) - c < -2 * sqrt(a * b):
#     print('Yes')
# else:
#     print('No')

if a + b < c and a ** 2 + b ** 2 + c ** 2 + 2 * a * b - 2 * b * c - 2 * a * c > 4 * a * b:
    print('Yes')
else:
    print('No')


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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>0;(i)--)
#define rrep(i,n,m) for(int (i)=(n);(i)<(m);(i)++)
#define rrepr(i,n,m) for(int (i)=(n);(i)>(m);(i)--)
#define SORT(s) sort((s).begin(),(s).end())
#define SORTR(s,t) sort((s).begin(),(s).end(),greater<t>())

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;

const int INF = 1000000000;
const ll LINF = 1000000000000000000ll;
const double PI = acos(-1.0);
const double EPS = 1e-10;

const ll MOD = 1000000007ll;
const int MAX=510000;

int N; vll H;
void input(){
    cin>>N;
    rep(i,N){
        ll a; cin>>a; H.emplace_back(a);
    }
    return;
}

void solve(){
    rep(i,N-1){
        ll ma=H[i];
        ll mi=H[i];
        while(H[i]>=H[i+1] && i<N-1){
            mi=H[++i]; 
        }
        if(ma-mi>1ll){
            cout<<"No"<<endl;
            return;
        }
    }
    cout<<"Yes"<<endl;
    return;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

Measured memory_bytes: 1400
// BISMILLAHIR RAHMANIR RAHEEM
// ALLAH IS WATCHING ME
// ALLAH save us from COVID-19.Amin.

//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█▄█
//█─█─█▄─█▄─█─█─█─█


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp> //order_of_key return number of elements less than x, find_by_order return index (pointer use kora lgbe)

using namespace std;
using namespace __gnu_pbds;

#define ull    unsigned long long
#define ll     long long
#define ios    ios::sync_with_stdio(0);cin.tie(0);
#define ses    "\n"
#define all(x) (x).begin(), (x).end()
//#define INF   ((int)2e18)
#define ii pair<ll, ll>

string digit="0123456789";
string small="abcdefghijklmnopqrstuvwxyz";
string capital="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}; // 8-direction.......
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[]= {1,-1,0,0}; // 4-direction...........
int dy4[]= {0,0,1,-1};

const int N=1e6+5;
const ll M=1e18;

typedef tree< ll, null_type, less<ll>, rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<pair<ll, ll>,null_type,less<pair<ll, ll>>,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;

struct Edge
{
    int u, vv;
    bool operator<(Edge const& other)
    {
        return vv > other.vv;
    }
}; // eta joss jinis.krsukal er jnno and sort 1 out of 3 or more er jnno better

/////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////
//main function is here.........
int main()
{
   // ios
  ll x,y;
  cin>>x>>y;
  ll mod = x%y;

  if(x<y){
       cout<<min(x,abs(x-y));
  }
  else{
        cout<<min(mod,abs(mod-y));
  }


}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int N,K; cin>>N>>K;
  vi A(N);
  rep(i,0,N) cin>>A[i];
  map<int,vi> M,B;
  rep(i,0,N){
    M[A[i]].pb(i);
  }
  int cnt=0,memo=0;
  B[0].pb(0);
  while(1){
    int X=M[A[memo]][M[A[memo]].size()-1];
    if(X>memo){
      int Y=disup(M[A[memo]],memo);
      memo=M[A[memo]][Y]+1;
    }
    else{
      cnt++;
      memo=M[A[memo]][0]+1;
    }
    B[cnt].pb(memo);
    if(memo==N) break;
  }
  int Y=(K-1)%(cnt+1);
  int Z=B[Y][B[Y].size()-1];
  vi ans;
  set<int> S;
  rep(i,Z,N){
    if(S.count(A[i])){
      while(1){
        int X=ans[ans.size()-1];
        ans.pop_back();
        S.erase(X);
        if(X==A[i]) break;
      }
    }
    else{
      ans.pb(A[i]);
      S.insert(A[i]);
    }
  }
  rep(i,0,ans.size()) cout<<ans[i]<<" ";
  cout<<endl;
  }


Measured memory_bytes: 57712
/*==============================================*\
ID:          shahidul_brur
 
Name:     Md. Shahidul Islam
Study:      CSE, BRUR
Address:  Rangpur, Bangladesh
 
 mail: shahidul.cse.brur@gmail.com
 FB  : fb.com/shahidul.brur
 Blog: shahidul-brur.blogspot.com(in Bengali),
       shahidul-brur-en.blogspot.com(in English)
\*===============================================*/
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;
 
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define all(a)  a.begin(), a.end()
#define mem(a, b)     memset(a, b, sizeof(a))
#define f0(i,b) for(int i=0;i<(b);i++)
#define f1(i,b) for(int i=1;i<=(b);i++)
#define f2(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,b,a) for(int i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(int i=(a);i!=(b);i+=(c))
 
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};

const double pi = acos(-1.0);
const double eps = 1e-6;
const int mod = (int)1e9+7;
const int maxn = (int)2e5+5;
const int logn = 20;
int a[maxn];
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin>>n;
    f1(i,n)
    {
        cin>>a[i];
        if(i==1 || a[i]>a[i-1])
            a[i]--;
    }
    f1(i,n)
    {
        if(i==1) continue;
        if(a[i]<a[i-1])
            {
                cout << "No\n";
                return 0;
            }
    }
    cout << "Yes";
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using tsii = tuple<string,int,int>;

int main() {
  int n; std::cin >> n;
  std::vector<tsii> v(n);
  for (size_t i = 0; i < n; i++) {
    string s; int a;
    std::cin >> s >> a;
    v[i] = make_tuple(s,-a,i+1);
  }

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

  for (size_t i = 0; i < n; i++) {
    /* code */
    std::cout << get<2>(v[i]) << '\n';
  }

}


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

int main() {
    int A[3][3];
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            cin >> A[i][j];
        }
    }
    int N;
    cin >> N;
    int b[N];
    for(int i=0;i<N;i++){
        cin >> b[i];
    }
    string ans="No";
    bool C[3][3];
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            C[i][j]=false;
            for(int k=0;k<N;k++){
                if(A[i][j]==b[k]){
                    C[i][j]=true;
                }
            }
        }
    }
    for(int i=0;i<3;i++){
        if(C[i][0]and C[i][1] and C[i][2]) ans="Yes";
    }
    for(int i=0;i<3;i++){
        if(C[0][i] and C[1][i] and C[2][i]) ans="Yes";
    }
    if(C[0][0] and C[1][1] and C[2][2]) ans="Yes";
    if(C[0][2] and C[1][1] and C[2][0]) ans="Yes";
    cout << ans <<endl;
}

Measured memory_bytes: 256
n = int(input())
dp = list(i for i in range(n+1))

def f(yen, p):
    c = p
    while yen >= c:
        dp[yen] = min(dp[yen], dp[yen-c] + 1)
        c *= p

for yen in range(6, n+1):
    f(yen, 6)
    f(yen, 9)
print(dp[n])


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

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

	if (n[0] == '9' || n[1] == '9') {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
L = [int(input()) for i in range(5)]
machi = [0]*5

for i in range(5):
    machi[i] = 10 - (L[i] % 10)
    if machi[i] == 10:
        machi[i] = 0

machi = sorted(machi, reverse=True)
print(sum(L)+sum(machi[1:]))


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

template <typename T>
class BinaryTree{
public:
	struct Node{
		T val;
		Node *lch,*rch;
	};
	BinaryTree():root(NULL){}
	
	Node* root;
	Node* insert(T x){ return root = insert(root, x);}
	bool find(T x){ return find(root, x); }
	Node* erase(T x){ return root = erase(root, x); }
	void inorderPrint(){ inorderPrint(root); cout<<endl;}
	void preorderPrint(){ preorderPrint(root); cout<<endl;}

private:
	Node* insert(Node* p,T x){
		if(p == NULL){
			Node* q = new Node;
			q->val = x;
			q->rch = q->lch = NULL;
			return q;
		}else{
			if( x < p->val )p->lch = insert(p->lch, x);
			else p->rch = insert(p->rch, x);
			return p;
		}
	}

	bool find(Node* p,T x){
		if( p == NULL )return false;
		else if( x == p->val )return true;
		else if( x < p->val )return find(p->lch, x);
		else return find(p->rch, x);
	}

	Node* erase(Node* p,T x){
		if( p == NULL )return NULL;
		else if( x < p->val )p->lch = erase(p->lch, x);
		else if( x > p->val )p->rch = erase(p->rch, x);
		else if( p->lch == NULL ){
			Node* q = p->rch;
			delete p;
			return q;
		}else if( p->rch == NULL ){
			Node* q = p->lch;
			delete p;
			return q;
		}else{
			Node* q = p->lch;
			if(q->rch == NULL){
				q->rch = p->rch;
				delete p;
				return q;
			}else{
				while(q->rch->rch != NULL) q = q->rch;
				Node* r = q->rch;
				q->rch = r->lch;
				r->lch = p->lch;
				r->rch = p->rch;
				delete p;
				return r;
			}
		}
		return p;
	}
	void inorderPrint(Node* p){
		if(p == NULL)return;
		inorderPrint(p->lch);
		cout << " " << p->val;
		inorderPrint(p->rch);
	}
	void preorderPrint(Node* p){
		if(p == NULL)return;
		cout << " " << p->val;
		preorderPrint(p->lch);
		preorderPrint(p->rch);
	}
};


int main(void){

	BinaryTree<int> bt;
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		string s;
		cin >> s;
		if(s == "insert"){
			int a;cin >> a;
			bt.insert(a);
		}
		else if(s == "find"){
			int a;cin >> a;
			if(bt.find(a))cout << "yes" << endl;
			else cout << "no" << endl;
		}
		else if(s == "print"){
			bt.inorderPrint();
			bt.preorderPrint();
		}
	}

	return 0;
}

Measured memory_bytes: 13720
import java.util.*;
public class Main{
  public static void main(String[]args){
      Scanner sc = new Scanner(System.in);

      int n =sc.nextInt();
      int[] ldata = new int[n];
      int[] rdata = new int[n];
      int count = 0;

      for (int i = 0;i<n ;i++ ) {
        ldata[i] = sc.nextInt();
        rdata[i] = sc.nextInt();
      }
      for (int j = 0;j<n ;j++ ) {
          int i  = 0;
          for ( i = ldata[j];i<=rdata[j] ;i++ ) {
          count++;
        }
      }
      System.out.println(count);



}
}


Measured memory_bytes: 23344
import java.util.Scanner;

public class Main {

    static int n, a, b, c;
    static int[] L;
    static int ans = Integer.MAX_VALUE;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        L = new int[n];
        for (int i = 0; i < n; i++) L[i] = sc.nextInt();
        int[] op = new int[n];
        dfs(0, op);

        System.out.println(ans);
        sc.close();
    }

    static public void dfs(int idx, int[] op){
        if(idx < n-1){
            for (int i = 0; i < 4; i++) {
                int[] op2 = new int[n];
                for (int j = 0; j < idx; j++) op2[j] = op[j];
                op2[idx] = i;
                dfs(idx+1, op2);
            }
        }else{
            for (int i = 0; i < 4; i++) {
                op[idx] = i;
                int[][] len = new int[3][2]; // {a,b,c}{len, cnt}
                for (int j = 0; j < n; j++) {
                    if(op[j] == 1){
                        len[0][0] += L[j];
                        len[0][1]++;
                    }else if(op[j] == 2){
                        len[1][0] += L[j];
                        len[1][1]++;
                    }else if(op[j] == 3){
                        len[2][0] += L[j];
                        len[2][1]++;
                    }
                }
                if(len[0][1] != 0 && len[1][1] != 0 && len[2][1] != 0){
                    ans = Math.min(ans, Math.abs(a - len[0][0])
                                                      + Math.abs(b - len[1][0])
                                                      + Math.abs(c - len[2][0])
                                                      + 10 *(len[0][1] + len[1][1] + len[2][1] -3));
                }
            }
        }
    }
}


Measured memory_bytes: 32580
///Thu Thaoo

#include <bits/stdc++.h>

#define ll long long
#define I freopen(Task".inp", "r", stdin)
#define O freopen(Task".out", "w", stdout)
#define vt vector <int>
#define rt(O) return O
#define pii pair <int, int>
#define st first
#define nd second
#define rd third
#define th fourth
#define pusf push_front
#define popf pop_front
#define popb pop_back
#define pusb push_back
#define Task "tenbai"
#define MOD 1000000007
#define uns unsigned
#define int ll
#define read_fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define FORU(i, l, n) for (int i=l; i<=n; i++)
#define FORD(i, n, l) for (int i=n; i>=l; i--)
#define reset(x) memset (x, 0, sizeof(x)
#define ignLine cout<<endl

using namespace std;

const int N = 1e5 + 3;

int m[3], d[3];

main()
{
//    I;
//    O;
    cin>>m[1]>>d[1]>>m[2]>>d[2];
    if (d[2] == 1) cout<<1;
    else cout<<0;
//    process();
    rt(0);
}


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

int main() {
    int64_t h, w, n;
    cin >> h >> w >> n;
    vector<int64_t> dxy { 0, 1, -1, -1, 0, 0, -1, 1, 1, 0 };
    map<pair<int64_t, int64_t>, int> m;
    for (int i = 0; i < n; i++) {
        int64_t a, b;
        cin >> a >> b;
        for (int j = 0; j < 9; j++) {
            auto e = make_pair(a+dxy[j], b+dxy[j+1]);
            if ((1 < e.first && e.first < h) && (1 < e.second && e.second < w)) m[e]++;
        }
    }

    vector<int64_t> ans(10);
    for (auto& e : m) ans[e.second]++;
    ans[0] = (h-2) * (w-2) - accumulate(begin(ans)+1, end(ans), 0l);
    for (auto& e : ans) cout << e << endl;
}


Measured memory_bytes: 56448
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    vector<pair<int,int>> a;
    for(int i=0;i<n;i++){
        int val;
        cin>>val;
        a.push_back({val,i+1});
    }
    sort(a.begin(),a.end());
    for(int i=0;i<n;i++){
        cout<<a[i].second<<" ";
    }
    cout<<'\n';
    return 0;
}


Measured memory_bytes: 1780
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <utility>
#include <string>
#include <stack>
#include <regex>
#include <numeric>
#include <queue>
#include <set>
#include <map>

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

int main(int argc, char const *argv[])
{
  string s;
  cin >> s;
  ll i = 0;
  vector<ll> sakai;
  bool flag = true;
  map<ll, pair<ll, ll>> lr;
  ll rcount = 0;
  ll tmp = 0;
  for (ll i = 0; i < s.length(); i++)
  {
    if (s[i] == 'L' && flag)
    {
      sakai.push_back(i);
      lr[i] = {rcount, 1};
      rcount = 0;
      tmp = i;
      flag = false;
    }
    else if (s[i] == 'L' && !flag)
    {
      lr[tmp].second++;
    }
    else if (s[i] == 'R')
    {
      rcount++;
      flag = true;
    }
  }
  vector<ll> res(s.length());
  for (auto a : sakai)
  {
    ll tmp = lr[a].first / 2 + lr[a].first % 2;
    tmp += lr[a].second / 2;
    res[a - 1] = tmp;
    res[a] = lr[a].first + lr[a].second - res[a - 1];
  }
  REP(i, s.length())
  {
    cout << res[i] << " ";
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 4856
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);

		//入力表示
		int A = scanner.nextInt();
		int B = scanner.nextInt();
		int C = scanner.nextInt();
		int D = scanner.nextInt();

		int X = (A + D - 1) / D;
		int Y = (C + B - 1) / B;

		String ans= X >= Y ? "Yes" : "No";
		System.out.println(ans);
	}

}


Measured memory_bytes: 27036
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		Console.WriteLine(N % 2 == 0 ? N / 2 - 1 : N / 2);
	}
	long N;
	public Sol(){
		N = rl();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 11092
odd = ["R", "U", "D"]
even = ["L", "U", "D"]
s_list = list(input())

ans = "Yes"
for i in range(len(s_list)):
  if i % 2 == 0:
    if not s_list[i] in odd:
      ans = "No"
  
  if i % 2 == 1:
    if not s_list[i] in even:
      ans = "No"

print(ans)


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

int main(){
  int n;
  ll min = pow(10, 9), max = 0;
  cin >> n;
  rep(i, n){
    int a;
    cin >> a;
    if(min > a){
      min = a;
    }
    if(max < a){
      max = a;
    }
  }
  cout << max - min << endl;
}

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

int main() {
    int r;
    cin>>r;
    double PI = 3.14159265359;
    cout<<r*2*PI<<endl;
}


Measured memory_bytes: 3788
#include<bits/stdc++.h>
using namespace std;
#define tezi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define loop(i,a,b) for(int i=a;i<b;i++)
#define all(c) c.begin(),c.end()
#define ll long long
#define ull unsigned long long
#define traverse(c,it) for(auto it=c.begin();it!=c.end();it++)
#define lowerb(v,a) lower_bound(v.begin(),v.end(),a)
#define lowerbarr(v,n,a) lower_bound(v,v+n,a)
#define upperb(v,a) upper_bound(v.begin(),v.end(),a)
#define upperbarr(v,n,a) upper_bound(v,v+n,a)
#define maxval(v) max_element(v.begin(),v.end())
#define maxarr(v,n) max_element(v,v+n)
#define minval(v) min_element(v.begin(),v.end())
#define minarr(v,n) min_element(v,v+n)
#define sz(a) (ll)a.size()
#define F first
#define S second
#define PI 3.1415926536
#define mem0(v) memset(v,0,sizeof(v))
#define memf(v) memset(v,false,sizeof(v))
#define memt(v) memset(v,true,sizeof(v))
#define mem(v,a) memset(v,a,sizeof(v))
#define MAX 100000
#define MOD 1000000007
 
                    /**************SIEVE****************/
 
/*{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
   
    memset(prime, true, sizeof(prime)); 
  
    for (long p=2; p*p<=MAX; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (long i=p*p; i<=MAX; i += p) 
                prime[i] = false; 
        } 
    } 
  
  
   
    
   
} */
 
                                        /**************gcd****************/
ll gcd(ll a,ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
}
 
 
 
                                         /**************POWER****************/
long pow(int v,int a)
{
  long prod=1;
  loop(i,0,a)
  prod*=v;
  return prod;
}
 
 
 
                                        /**************MAIn****************/
 
 
 
 
 
 
int main()
{   tezi
  
  //freopen("input.txt","r",stdin);
  //freopen("put.txt","w",stdout);

  
 
  int t=1;
  //cin>>t;
  while(t--)
  {
    string s,b;
    cin>>s>>b;
    
    if(b.find(s)==0)
      cout<<"Yes";
      else cout<<"No";

    
 
   
  }

 
   
 
 }
 
 
 
  
 
 


Measured memory_bytes: 3648