akhauriyash/Code-Regression huggingface dataset:
//#include "IntMod.h"
//typedef IntMod<1000000007> MInt;

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <set>
#include <map>

using namespace std;
#define REP(i,a,n) for(int i = a; i < n; ++i)
#define REPM(i,n,a) for(int i = n - 1; i >= a; --i)
#define EPS 0.0001
#define INF 0x3FFFFFFF
typedef long long LL;
typedef unsigned long long ULL;

LL N, x;
LL a[100001];
int main() {
	LL eat = 0;
	cin >> N >> x;
	REP(i, 0, N) {
		cin >> a[i];
	}
	if (a[0] > x) {
		eat += a[0] - x;
		a[0] = x;
	}
	REP(i, 1, N) {
		if (a[i] + a[i - 1] > x) {
			eat += a[i] + a[i - 1] - x;
			a[i] = x - a[i - 1];
		}
	}
	cout << eat << endl;
	return 0;
}

Measured memory_bytes: 1024
#!/usr/bin/env python
from math import log2, ceil

def main():
    N, K = map(int, input().split())

    ans = 0
    for i in range(1, N+1):
        n = ceil(log2(K) - log2(i))
        if n > 0:
            ans += 0.5 ** n
        else:
            ans += 1

    return ans / N

if __name__ == '__main__':
    print(main())

Measured memory_bytes: 3188
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b, c, d = MAP()

if abs(a-c) <= d:
	print("Yes")
elif max(abs(a-b), abs(b-c)) <= d:
	print("Yes")
else:
	print("No")


Measured memory_bytes: 5396
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
#include <functional>
#include <cctype>

using namespace std;

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


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

	string st;
	vector<string> bubble(N), select(N);
	int min;
	bool stab = true;

	REP(i, N) {
		cin >> st;
		bubble[i] = st;
		select[i] = st;
	}

	// バブル
	for(int i = N - 1; i >= 0; --i) {
		for(int j = 0; j < i; ++j) {
			if(bubble[j][1] > bubble[j + 1][1])
				swap(bubble[j], bubble[j + 1]);
		}
	}

	// 選択
	REP(i, N) {
		min = i;
		for(int j = i + 1; j < N; ++j) {
			if(select[j][1] < select[min][1]) min = j;
		}
		swap(select[i], select[min]);
	}

	REP(i, N) {
		cout << bubble[i];
		(i != N - 1)?
			cout << ' ' : cout << endl;
	}
	// バブルソートは安定
	cout << "Stable" << endl;

	REP(i, N) {
		cout << select[i];
		(i != N - 1)?
			cout << ' ' : cout << endl;
	}
	REP(i, N) {
		if(bubble[i][0] != select[i][0]) {
			stab = false;
			break;
		}
	}
	if(stab)
		cout << "Stable" << endl;
	else
		cout << "Not stable" << endl;

	return 0;
}

Measured memory_bytes: 1212
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define pb            push_back
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)

const int INF = 1e9;

// code
// ------------------------------------------------
int main() {

  vector<string> s(3);
  vector<queue<char>> d(3);
  char ans[] = {'A' ,'B','C'};
  
  rep(i,3) cin >> s[i];

  rep(i,3)
  {
    rep(j,sz(s[i])) d[i].push(s[i][j]);
  }

  int turn = 0;

  while(1)
  {
    if(sz(d[turn]) == 0)
    {
      break;
    }

    char c = d[turn].front();
    d[turn].pop();

    switch(c)
    {
      case 'a':
        turn = 0;
        break;
      case 'b':
        turn = 1;
        break;
      case 'c':
        turn = 2;
        break;
      default:
        break;
    }

  }

  cout << ans[turn] << endl;

  
  return 0;
}

// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace easy_Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] NR = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            int internalRate = NR[1];
            if(NR[0]<10){
                internalRate += 100*(10-NR[0]);
            }
            Console.WriteLine(internalRate);
        }
            // long[] NK = Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            // long N = NK[0];
            // long K = NK[1];
            // long K = long.Parse(Console.ReadLine());
            // int[] abc = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            // string S = Console.ReadLine();
            // int x = int.Parse(Console.ReadLine());
            // int b = int.Parse(Console.ReadLine());
            // int N = int.Parse(Console.ReadLine());
            // float N = float.Parse(Console.ReadLine());
            // string c = Console.ReadLine();
            // string B = Console.ReadLine();
            // string[] s = Console.ReadLine().Split();
            // var s = (new string[] { Console.ReadLine(), Console.ReadLine(), Console.ReadLine() }).Select(float.Parse);
            // float[] a = Array.ConvertAll(Console.ReadLine().Split(),float.Parse);
            // var X = Console.ReadLine();
            // int[,] abcd = new int[NMQ[2],4];
            // int[] A = new int[NMQ[0]];
            // int[] A_num = new int[NMQ[0]];
            // long[] s=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            // var hs=new Dictionary<long,long>();
            // for(int i=0;i<s[0];i++){
            //     long[] q=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            //     if(hs.ContainsKey(q[0])){hs[q[0]]+=q[1];}
            //     else{hs.Add(q[0],q[1]);}
            // }
        
        // //最小公倍数
        // static long Lcm(long a, long b)
        // {
        //     return a/Gcd(a,b)*b;
        // }

        // //最大公約数
        // static long Gcd(long m, long n)
        // {
        //     if(n==0)return m;
        //     return Gcd(n,m%n);
        // }
    }
}


Measured memory_bytes: 27528
nm = gets.chomp.split
n = nm[0].to_i
m = nm[1].to_i

s = Array.new
c = Array.new
m.times do
    input = gets.chomp.split
    s << input[0].to_i
    c << input[1].to_i
end

if m == 0
    case n
    when 1
        puts 0
    when 2
        puts 10
    when 3
        puts 100
    end
else
    number = -1
    (0..999).each do |num|
        if num.to_s.length != n
            next
        else
            m.times do |i|
                if num.to_s[s[i]-1] != c[i].to_s
                    break
                elsif i == m-1
                    number = num
                end
            end
        end
        
        if number != -1
            break
        end
    end
    puts number
end

Measured memory_bytes: 3836
D[13][3]={{1,0,0},{0,1,0},{0,0,1},{1,1,0},{1,0,1},{0,1,1},{1,-1,0},{1,0,-1},{0,1,-1},{1,1,1},{-1,1,1},{1,-1,1},{1,1,-1}};
M[9][9][9],q[2];main(n,m,p,I,x,y,z,j,c,d,J){for(;scanf("%d%d%d",&n,&m,&p),n;){
	for(memset(M,I=0,sizeof(M)),c=1;I++<p;c*=-1){
		for(scanf("%d%d",&x,&y),z=1;;z++)if(!M[x][y][z]){M[x][y][z]=c;break;}
		for(d=0;d<13;d++){
			for(j=0;j<2;j++)for(q[j]=0;;q[j]+=2*j-1)if(M[x+D[d][0]*q[j]][y+D[d][1]*q[j]][z+D[d][2]*q[j]]!=c)break;
			if(q[1]-q[0]-1>=m){printf(c==1?"Black %d\n":"White %d\n",I);goto next;}
		}
	}
	puts("Draw");
next:
	for(;I++<p;)scanf("%d%d",&x,&y);
}exit(0);}

Measured memory_bytes: 612
#include<math.h>
#include<time.h>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
int main()
{
	double r,pie=3.14159265358979323;
	scanf("%lf",&r);
	printf("%.6f %.6f\n",r*r*pie,2*r*pie);
	return 0;
}


Measured memory_bytes: 2120
#include <bits/stdc++.h>
#define ls (rt << 1)
#define rs (rt << 1 | 1) 
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef pair<int, int> pii;
const int maxn = 2e4 + 10;
const int maxm = maxn << 2; //线段树*4
int n, tot, no, top, e, cnt;
int a[maxn], b[maxn], C[maxn], match[maxn], pos[maxn][2];
pii c[maxn];
int id[maxm][2];
vector<int> ed[maxm << 1]; //2-sat*2
int dfn[maxm << 1], low[maxm << 1], sta[maxm << 1], belong[maxm << 1];
void build(int rt, int l, int r)
{
	id[rt][0] = ++no; id[rt][1] = ++no;
	ed[id[rt][0]].clear(); ed[id[rt][1]].clear();
	if(l == r) 
	{
		match[l] = rt;
		return;
	}
	int mid = l + r >> 1;
	build(ls, l, mid); ed[id[rt][0]].push_back(id[ls][0]); ed[id[ls][1]].push_back(id[rt][1]);
	build(rs, mid + 1, r); ed[id[rt][0]].push_back(id[rs][0]); ed[id[rs][1]].push_back(id[rt][1]);
}
inline void cmin(int& u, int& v)
{
	u = u > v ? v : u;
}
void tarjan(int u)
{
	dfn[u] = low[u] = ++e;
	sta[++top] = u;
	for(int i = 0; i < ed[u].size(); ++i)
	{
		int v = ed[u][i];
		if(!dfn[v])
			tarjan(v), cmin(low[u], low[v]);
		else if(!belong[v])
			cmin(low[u], dfn[v]);
	}
	if(low[u] == dfn[u])
		for(++cnt; sta[top + 1] ^ u; --top)
			belong[sta[top]] = cnt;
}
bool solve()
{
	for(int i = 1; i <= (no << 1); ++i)
		if(!dfn[i])
			tarjan(i);
	for(int i = 1; i <= no; ++i)
		if(belong[(i << 1) - 1] == belong[i << 1])
			return 0;
	return 1;
}
void update(int rt, int l, int r, int a, int b, int x)
{
	if(a > b) return;
	if(a <= l && r <= b)
	{
		ed[id[x][1]].push_back(id[rt][0]);
		ed[id[rt][1]].push_back(id[x][0]);
		return;
	}
	int mid = l + r >> 1;
	if(a <= mid) update(ls, l, mid, a, b, x);
	if(b > mid) update(rs, mid + 1, r, a, b, x);
}
bool check(int d)
{
	top = e = cnt = no = 0;
	memset(dfn, 0, sizeof dfn);
	memset(low, 0, sizeof low);
	memset(belong, 0, sizeof belong);
	memset(sta, 0, sizeof sta);
	build(1, 1, tot);
	for(int i = 1; i <= n; ++i)
	{
		int l = match[pos[i][0]], r = match[pos[i][1]];
		ed[id[l][0]].push_back(id[r][1]);
		ed[id[l][1]].push_back(id[r][0]);
		ed[id[r][0]].push_back(id[l][1]);
		ed[id[r][1]].push_back(id[l][0]);
	}
	for(int i = 1; i <= tot; ++i)
	{
		int l = lower_bound(C + 1, C + tot + 1, C[i] - d + 1) - C;
		int r = upper_bound(C + 1, C + tot + 1, C[i] + d - 1) - C - 1;
		update(1, 1, tot, l, i - 1, match[i]);
		update(1, 1, tot, i + 1, r, match[i]);
	}
	return solve(); 
}		
int main()
{
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i)	
	{
		scanf("%d%d", &a[i], &b[i]);
		if(a[i] > b[i]) swap(a[i], b[i]);
		++tot; c[tot] = mp(a[i], tot);
		++tot; c[tot] = mp(b[i], tot);
	}
	sort(c + 1, c + tot + 1);
	for(int i = 1; i <= tot; ++i)
	{
		pos[(c[i].second + 1) >> 1][(c[i].second + 1) & 1] = i;
		C[i] = c[i].first;
	}
	int l = 0, r = C[tot] - C[1];
	while(l <= r)
	{
		int mid = l + r >> 1;
		if(check(mid))
			l = mid + 1;
		else
			r = mid - 1;
	}	
	printf("%d\n", r);
	return 0;
}
	
		

Measured memory_bytes: 25984
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	static int[] S ;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();

		long N = Long.parseLong(W);

		long ans = 0;

		ans=N*(N+1)/2 -N;
		System.out.println(ans);

	}
}


Measured memory_bytes: 21204
#include <cstdint>

template <std::uint_fast64_t Modulus> class modint {
	using u64 = std::uint_fast64_t;

public:
	u64 a;

	constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
	constexpr u64 &value() noexcept { return a; }
	constexpr const u64 &value() const noexcept { return a; }
	constexpr modint operator+(const modint rhs) const noexcept {
		return modint(*this) += rhs;
	}
	constexpr modint operator-(const modint rhs) const noexcept {
		return modint(*this) -= rhs;
	}
	constexpr modint operator*(const modint rhs) const noexcept {
		return modint(*this) *= rhs;
	}
	constexpr modint operator/(const modint rhs) const noexcept {
		return modint(*this) /= rhs;
	}
	constexpr modint &operator+=(const modint rhs) noexcept {
		a += rhs.a;
		if (a >= Modulus) {
			a -= Modulus;
		}
		return *this;
	}
	constexpr modint &operator-=(const modint rhs) noexcept {
		if (a < rhs.a) {
			a += Modulus;
		}
		a -= rhs.a;
		return *this;
	}
	constexpr modint &operator*=(const modint rhs) noexcept {
		a = a * rhs.a % Modulus;
		return *this;
	}
	constexpr modint &operator/=(modint rhs) noexcept {
		u64 exp = Modulus - 2;
		while (exp) {
			if (exp % 2) {
				*this *= rhs;
			}
			rhs *= rhs;
			exp /= 2;
		}
		return *this;
	}
};

#include <utility>

template <class T, class U> constexpr T power(T x, U exp) {
	T ret = static_cast<T>(1);
	while (exp) {
		if (exp % static_cast<U>(2) == static_cast<U>(1))
			ret *= x;
		exp /= static_cast<U>(2);
		x *= x;
	}
	return ::std::move(ret);
}

#include <iostream>
#include <vector>

int main() {
	using mint = modint<1000000007>;

	int b, w;
	std::cin >> b >> w;
	int n = b + w;

	std::vector<mint> fact(n);
	fact[0] = 1;
	for (int i = 1; i < n; ++i) {
		fact[i] = fact[i - 1] * i;
	}
	const auto comb = [&fact](int n, int r) {
		return fact[n] / fact[r] / fact[n - r];
	};

	mint p = 0, q = 0;

	for (int i = 1; i <= n; ++i) {
		std::cout << ((mint(1) - p + q) / 2).value() << std::endl;

		if (i >= b) {
			p += comb(i - 1, b - 1) / power(mint(2), i);
		}
		if (i >= w) {
			q += comb(i - 1, w - 1) / power(mint(2), i);
		}
	}

	return 0;
}


Measured memory_bytes: 3712
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())

template <class T>
void cout_vec(const vector<T> &vec){
  for(auto itr:vec) cout<<itr<<' ';
  cout<<'\n';
}

typedef pair<ll,ll> P;
const ll mod=1e9+7;

ll mult(ll n,ll m){//n^m%modを求める
    if(m==0) return 1;
    if(m==1){
        return n%mod;
    }else if(m%2==0){//オーバーフロー防止のためにn^(m/2)*n^(m/2)を考える
        ll t=mult(n,m/2);
        return (t*t)%mod;
    }else{//奇数の時はn^(m-1)*nを考える
        ll t=mult(n,m-1);
        return (t*n)%mod;
    }
}

template <class T>
T comb_mod(T n,T k){
    T ans=1;
    T r=min(k,n-k);
    FOR(i,n-r+1,n+1){
        ans*=(i%mod);
        ans%=mod;
    }
    FOR(i,1,r+1){
        ans*=mult(i,mod-2);
        ans%=mod;
    }
    return ans;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,k;
    cin>>n>>k;
    FOR(i,1,k+1){
      if(n-k+1<i){
        cout<<0<<endl;
        continue;
      }
      ll ans=comb_mod(n-k+1,i)*comb_mod(k-1,i-1);
      ans%=mod;
      cout<<ans<<endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<string>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll INFF=0x3f3f3f3f3f3f3f3f;

int a[100010];
int n;
ll solve()
{
    ll ans=0;
    ll t=a[0];
    for(int i=1;i<n;i++)
    {
        if(t<0)
        {
            t+=a[i];
            if(t<=0)
            {
                ans+=1-t;
                t=1;
            }
            continue;
        }
            t+=a[i];
            if(t>=0)
            {
                ans+=t+1;
                t=-1;
            }
    }
    return ans;
}

int main()
{
    scanf("%d",&n);
        for(int i=0;i<n;i++)
        {
            scanf("%d",&a[i]);
        }
        ll sum=0,t=a[0];
        if(t==0)
        {
            a[0]=1;
            ll sum1=solve();
            a[0]=-1;
            ll sum2=solve();
            sum=min(sum1,sum2)+1;
        }
        else
        {
            ll sum0=solve();
            a[0]=1;
            ll sum1=solve()+abs(1-t);
            a[0]=-1;
            ll sum2=solve()+abs(-1-t);
            sum=min(sum0,min(sum1,sum2));
        }
        printf("%lld\n",sum);
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=0x61=97 '0'=0x30=48
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef string str;
typedef pair<int,int> pairii;
typedef vector<ll> veci;
const double pi=3.1415926535;
const ll  mod=2000000014;
//桁数指定　cout << fixed << setprecision(2)
int main() {
  int n;ll s=0;ll ans=0;
  cin>>n;
  veci v(n);
  rep(i,n){cin>>v[i];v[i]%=mod;s+=v[i]; s%=mod;}s%=mod;
  ans=(s*s)%mod;
  rep(j,n){ans+=mod*mod-(ll)v[j]*v[j];ans%=mod;}ans%=mod;
  cout<<(ans/2)%(mod/2)<<endl;
}


Measured memory_bytes: 4816
#include <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<long long, long long> pllll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector< pair<int, int> > vii;
typedef vector< pair<long long, long long> > vllll;
typedef map<int, int> mii;
typedef map<long long, long long> mllll;
typedef queue<int> qi;
typedef queue< pair<int, int> > qp;
#define mp make_pair
#define pi 3.14159265358979323846
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
#define gt(T) greater<T>()
#define sum(v) accumulate(v.begin(), v.end(), 0ll)
#define uni(v) do{ \
  sort(v.begin(), v.end()); \
  decltype(v)::iterator result = unique(v.begin(), v.end()); \
  v.erase(result, v.end()); \
}while(0)
#define fi(init, n) for(int i = init; i < n; ++i)
#define fj(init, n) for(int j = init; j < n; ++j)
#define fk(init, n) for(int k = init; k < n; ++k)
#define zero(x) memset(x, 0, sizeof(x))
#define negative(x) memset(x, ~0, sizeof(x))
#define bitsum(x) __builtin_popcount(x)
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = { 0, 1, 0, -1 };
const int dj[] = { 1, 0, -1, 0 };

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a / gcd(a, b) * b;
}
template<typename T>
int finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) return 1;
	else return 0;
}
ll frac(ll n){
	if (n == 0) return 1;
	return (n * frac(n - 1)) % MOD;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main(int argc, char** argv) {
#ifdef HIRO
  string quiz(argv[1]);
  string id(argv[2]);
  string filename("input/" + quiz + "/" + id + ".txt");
  ifstream fin(filename);
  if (fin.peek() == ifstream::traits_type::eof()) {
    cout << "No input.";
    return 0;
  }
  ifstream cin(filename);
  std::cin.rdbuf(cin.rdbuf());
#endif
  ll ans = 0;
  ll sx, sy, tx, ty, x, y;
  cin >> sx >> sy >> tx >> ty;
  x = tx - sx;
  y = ty - sy;
  fi(0, x)
    cout << "R";
  fi(0, y)
    cout << "U";
  fi(0, x)
    cout << "L";
  fi(0, y)
    cout << "D";
  cout << "L";
  cout << "U";
  fi(0, y)
    cout << "U";
  cout << "R";
  fi(0, x)
    cout << "R";
  cout << "D";
  cout << "R";
  cout << "D";
  fi(0, y)
    cout << "D";
  fi(0, x)
    cout << "L";
  cout << "L";
  cout << "U\n";

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



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

int n;
int q;
map<int, int> cnt;

int main() {
  while (1) {
    cnt.clear();
    scanf("%d%d", &n, &q);
    if (n == 0 && q == 0) return 0;

    for (int i=0; i<n; i++) {
      int m;
      scanf("%d", &m);
      for (int j=0; j<m; j++) {
        int date;
        scanf("%d", &date);
        cnt[date]++;
      }
    }

    int maxn = 0;
    int ans = 0;
    for (auto itr=cnt.begin(); itr!=cnt.end(); itr++) {
      if (maxn < itr->second) {
        maxn = itr->second;
        ans = itr->first;
      }
    }

    if (maxn < q) puts("0");
    else printf("%d\n", ans);
  }
}

Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
template<class T = int> using V  = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T> void assign(V<T>& v, int n, const T& a = T()) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


struct LinearFunction { double a, b; };

struct Monoid {
  using T = LinearFunction;
  static T op(const T& lhs, const T& rhs) { return {lhs.a * rhs.a, lhs.a * rhs.b + lhs.b}; }
  static constexpr T e() { return {1, 0}; }
};

template<class Monoid> struct SegmentTree {
  using T = typename Monoid::T;
  struct node {
    lint l, r;
    T val = Monoid::e();
    unique_ptr<node> cl = nullptr, cr = nullptr;
  };

  lint n;
  unique_ptr<node> root;

  SegmentTree(lint n) : n(n), root(new node {0, n}) {}

  T get(lint l, lint r) {
    auto get = [&](auto get, const auto& v) -> T {
      if (l <= v->l and v->r <= r) return v->val;
      T resl = Monoid::e(), resr = Monoid::e();
      int m = v->l + v->r >> 1;
      if (l < m) {
        if (v->cl == nullptr) v->cl.reset(new node {v->l, m});
        resl = get(get, v->cl);
      }
      if (m < r) {
        if (v->cr == nullptr) v->cr.reset(new node {m, v->r});
        resr = get(get, v->cr);
      }
      return Monoid::op(resl, resr);
    };
    return get(get, root);
  }

  void set(lint i, const T& a) {
    auto set = [&](auto set, const auto& v) -> void {
      if (v->r - v->l == 1) {
        v->val = a;
        return;
      }
      int m = v->l + v->r >> 1;
      if (i < m) {
        if (v->cl == nullptr) v->cl.reset(new node {v->l, m});
        set(set, v->cl);
        v->val = Monoid::op(v->cl->val, v->cr != nullptr ? v->cr->val : Monoid::e());
      } else {
        if (v->cr == nullptr) v->cr.reset(new node {m, v->r});
        set(set, v->cr);
        v->val = Monoid::op(v->cl != nullptr ? v->cl->val : Monoid::e(), v->cr->val);
      }
    };
    set(set, root);
  }
};

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  struct RMQ {
    using T = int;
    static T op(const T& lhs, const T& rhs) { return lhs < rhs ? lhs : rhs; }
    static constexpr T e() { return numeric_limits<T>::max(); };
  };
  int n, q; cin >> n >> q;
  SegmentTree<RMQ> st(n);
  for (int iq = 0; iq < q; ++iq) {
    int c, x, y; cin >> c >> x >> y;
    if (!c) st.set(x, y);
    else cout << st.get(x, y + 1) << '\n';
  }
}


Measured memory_bytes: 10732
N, M = map(int, input().split())
ab = [list(map(int, input().split()))
      for _ in range(N)]
ab = sorted(ab, key=lambda a: a[0])
total = 0
m = 0
# print(ab)
for i in range(N):
    a, b = ab[i]
    if b + m >= M:
        total = total + (M - m) * a
        break
    else:
        total += b * a
        m += b
print(total)


Measured memory_bytes: 29796
#include <iostream>
#include <cstdio>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef int ll;
inline char gc(){
	static char buf[1<<14],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<14,stdin),p1==p2)?EOF:*p1++;
}
inline ll read(ll &x){
	x=0;bool f=1;char c=gc();
	for(;!isdigit(c);c=gc()){if(c=='-')f^=1;if(c==-1)return-1;}
	for(;isdigit(c);c=gc())x=(x<<1)+(x<<3)+(c^48);x=f?x:-x;
	return 1;
}
#define pc putchar
inline void wr(ll x){
	if(x<0)pc('-'),x=-x;
	if(x>9)wr(x/10);pc(x%10|48);
}
const ll N=1e5+10;
ll n,fa[N];
map<ll,ll>vis[N];
queue<pair<ll,ll> >Q;
set<ll>s[N];
inline ll fid(ll x){return fa[x]==x?x:fa[x]=fid(fa[x]);}
int main(){
	read(n);
	for (ll i=1,x,y;i<=2*n-2;++i){
		read(x),read(y);
		++vis[x][y],++vis[y][x];
		if (vis[x][y]==2) Q.push(make_pair(x,y));
		s[x].insert(y);
		s[y].insert(x);
	}
	for (ll i=1;i<=n;++i) fa[i]=i;
	while (!Q.empty()){
		pair<ll,ll>A=Q.front();Q.pop();
		ll x=fid(A.first),y=fid(A.second);
		if (x==y) continue;
		s[x].erase(y),s[y].erase(x);
		if (s[x].size()>s[y].size()) swap(x,y);
		for (set<ll>::iterator it=s[x].begin();it!=s[x].end();++it){
			ll i=*it;
			s[i].erase(x);
			s[i].insert(y),s[y].insert(i);
			++vis[y][i],++vis[i][y];
			if (vis[y][i]==2) Q.push(make_pair(y,i));
		}
		s[x].clear();
		fa[x]=y;
	}
	for (ll i=1;i<=n;++i) if (fid(i)!=fid(1)) return puts("NO"),0;
	puts("YES");
	return 0;
}

Measured memory_bytes: 48768
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<numeric>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
using namespace std;

int main(){
    int N;cin>>N;
    vector<vector<int>> v(5);
    for(int i=2;i<=55555;i++){
        bool prime=true;
        int m=sqrt(i)/1;
        int k=2;
        while(k<=m){
            if(i%k==0){
                prime=false;
                break;
            }
            k++;
        }
        if(prime)v[i%5].push_back(i);
    }
    for(int i=0;i<N;i++){
        cout<<v[1][i]<<" ";
    }
    return 0;

}

Measured memory_bytes: 256
#![allow(non_snake_case)]

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    let n : isize = buf.trim().parse().unwrap();

    for i in 1..n + 1 {
        let mut x = i;
        if x % 3 == 0 {
            print!(" {}", i);
            continue;
        }
        while 0 < x {
            if x % 10 == 3 {
                print!(" {}", i);
                break;
            }
            x /= 10;
        }
    }
    println!();
}



Measured memory_bytes: 5036
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll mod = 1e9+7LL;

int main() {
    int N, X, T; cin >> N >> X >> T;
    int ans = N / X * T;
    if(N%X!=0) ans+=T;
    cout << ans << endl;
}

Measured memory_bytes: 3624
string=input()
n=int(input())
for i in range(n):
    order=list(input().split())
    start=int(order[1])
    end=int(order[2])
    if order[0]=="print":
        print(string[start:end+1])
    elif order[0]=="replace":
        string=string[:start]+order[3]+string[end+1:]
    elif order[0]=="reverse":
        if start!=0:
            string=string[:start]+string[end:start-1:-1]+string[end+1:]
        else:
            string=string[:end+1][::-1]+string[end+1:]


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<string> vs;
typedef pair<int, int> P;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

void YN(bool flg){if(flg) cout << "YES" << endl; else cout << "NO" << endl;}
void Yn(bool flg){if(flg) cout << "Yes" << endl; else cout << "No" << endl;}
void yn(bool flg){if(flg) cout << "yes" << endl; else cout << "no" << endl;}

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

int main()
{   
    int n;
    string s;
    cin >> n >> s;
    int a = 0, b = 0;
    rep(i, n) if(s[i] == 'R') a++;
    int ans = max(a, b);
    rep(i, n) {
        if(s[i] == 'R') a--;
        else b++;
        int now = max(a, b);
        ans = min(ans, now);
    }
    cout << ans << endl;

    return 0;
}


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

int main()
{
    long long A, B, K;
    cin >> A >> B >> K;
    long long diff = A - K;
    A -= K;
    if (diff < 0)
    {
        A = 0;
        diff *= -1;
        B -= diff;
        if (B < 0)
            B = 0;
    }
    cout << A << " " << B << endl;
    return 0;
}


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

// macros
#define pb emplace_back
#define mk make_pair
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for(int i=((int)(n)-1);i>=0;i--)
#define irep(itr, st) for(auto itr = (st).begin(); itr != (st).end(); ++itr)
#define irrep(itr, st) for(auto itr = (st).rbegin(); itr != (st).rend(); ++itr)
#define whole(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bit(n) (1LL<<(n))
#define F first
#define S second
// functions
template <typename T> void unique(T& c){c.erase(std::unique(c.begin(), c.end()), c.end());}
template <class T>bool chmax(T &a, const T &b){if(a < b){a = b; return 1;} return 0;}
template <class T>bool chmin(T &a, const T &b){if(a > b){a = b; return 1;} return 0;}
template <typename T> istream &operator>>(istream &is, vector<T> &vec){for(auto &v: vec)is >> v; return is;}
template <typename T> ostream &operator<<(ostream &os, const vector<T>& vec){for(int i = 0; i < vec.size(); i++){ os << vec[i]; if(i + 1 != vec.size())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const set<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const unordered_set<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const multiset<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const unordered_multiset<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p){os << "(" << p.first << ", " << p.second << ")"; return os;}
template <typename T1, typename T2> ostream &operator<<(ostream &os, const map<T1, T2> &mp){for(auto itr = mp.begin(); itr != mp.end(); ++itr){ os << "(" << itr->first << ", " << itr->second << ")"; auto titr = itr; if(++titr != mp.end())os << " "; } return os;}
template <typename T1, typename T2> ostream &operator<<(ostream &os, const unordered_map<T1, T2> &mp){for(auto itr = mp.begin(); itr != mp.end(); ++itr){ os << "(" << itr->first << ", " << itr->second << ")"; auto titr = itr; if(++titr != mp.end())os << " "; } return os;}
//  types
using ll = long long int;
using P = pair<int, int>;
// constants
const int inf = 1e9;
const ll linf = 1LL << 60;
const double EPS = 1e-10;
const int mod = 1000000007;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};
// io
struct fast_io{
  fast_io(){ios_base::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(20);}
} fast_io_;


int main(int argc, char const* argv[])
{
  string s; cin >> s;
  cout << s.substr(0, 3) << endl;
  return 0;
}


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

int main(){
    int a,b;
    cin>>a>>b;
    cout<<(a+b)%24<<endl;
    return 0;
}

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

#define REP(i, start, count) for(int i=(start); i<(int)(count); ++i)
#define rep(i, count) REP(i, 0, count)
#define ALLOF(c) (c).begin(), (c).end()

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> veci;
typedef vector<long long> vecll;
typedef vector<unsigned long long> vecull;

int main(void) {

    int N, M, X;
    cin >> N >> M >> X;

    veci c(N);
    vector<veci> a(N, veci(M));
    rep(i, N) {
        cin >> c[i];
        rep(k, M) {
            cin >> a[i][k];
        }
    }

    int ans = -1;
    for (unsigned bits = 0; bits < (1 << N); bits++) {

        int cost = 0;
        veci aa(M, 0);

        for (unsigned i = 0; i < N; ++i) {
            if (((1 << i) & bits) != 0) {
                cost += c[i];
                for(int k = 0; k < M; ++k) {
                    aa[k] += a[i][k];
                }
            }
        }

        bool flag = true;
        for (int i = 0; i < M; ++i) {
            if (aa[i] < X) {
                flag = false;
                break;
            }
        }

        if (flag) {
            if (ans == -1) ans = cost;
            else ans = min(ans, cost);
        }

    }

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

Measured memory_bytes: 3628
//daddy's back in town, back to rolling the damn hash yoooo babeeeeees//
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define clock (clock() * 1000.0 / CLOCKS_PER_SEC)
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define x first
#define y second
#define pi pair <int, int>
#define vi vector <int>
#define L nod<<1
#define R ((nod<<1)|1)
#define int ll
const ll mod = 998244353;
int n, k, e[100010], deg[100010], up[100010];
vector<pi> g[100010];

int dfs(int p, int nod){
	int cur=0;
	k=max(k, deg[nod]);
	for(pi i : g[nod]){
		if(i.x!=p){
			cur++;
			if(cur==up[nod]) cur++;
			up[i.x]=cur;
			e[i.y]=cur;
			dfs(nod, i.x);
		}
	}
}

int32_t main(){
	ios_base :: sync_with_stdio(0); cin.tie(); cout.tie();
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	cin>>n;
	for(int i=1, x, y; i<n; i++){
		cin>>x>>y;
		g[x].pb({y, i});
		g[y].pb({x, y});
		deg[x]++, deg[y]++;
	}
	dfs(0, 1);
	cout<<k<<"\n";
	for(int i=1; i<n; i++) cout<<e[i]<<" ";
}


Measured memory_bytes: 10496
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=[0]*(k+1)
for i in range(k+1):
    if d[i]==0:
        for j in a:
            if i+j>k:
                break
            else:
                d[i+j]=1
print("First" if d[k]!=0 else"Second")

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

    int a[2234568];
    int n;
    int main(){
        cin>>n;
        for(int i = 1; i <= n; i++){
            cin>>a[i];
        }
        int cnt=0;
        for(int i = 1; i < n; i++){
                if(a[i]==i)
                {

            swap(a[i],a[i+1]);
            cnt++;
                }
        }
        if(a[n] == n) cnt++;
        cout<<cnt;
    }


Measured memory_bytes: 640
#include<iostream>
#include<map>
#include<set>
#include<vector>
#include<cmath>
#include<cstring>
#define loop(i,r,l) for(int (i)=(r);(i)<(l);(i)++)
#define rep(i,n) loop(i,0,n)
#define INF 1000000007
using namespace std;

int main(){
       int n,val=0,d;
       cin>>n;
       rep(i,n){
           cin>>d;
           if(d%2==1)val++;
       }
       if(val%2==1)cout<<"NO"<<endl;
       else cout<<"YES"<<endl;
}

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

#define N 100000
#define NIL -1

int n, m;
vector<int> G[N];
int color[N];

queue<int> Q;

void bfs(int x, int c){
    if(color[x] != NIL) return;
    Q.push(x);
    color[x] = c;

    while(!Q.empty()){
        int u = Q.front(); Q.pop();
        for(int i = 0; i < G[u].size(); i++){
                int v = G[u][i];
                if(color[v] == NIL)
                Q.push(v);
                color[v] = c;
        }
    }
}

void assignColor(){
    for(int i = 0; i < n; i++) color[i] = NIL;
    int id = 1;
    for(int i = 0; i < n; i++) bfs(i,id++);
}


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

    rep(i,m){
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    assignColor();

    int q;
    cin >> q;
    rep(i,q){
        int x, y;
        cin >> x >> y;
        if(color[x] == color[y]) cout << "yes" << endl;
        else cout << "no" << endl;
    }

    return 0;

}


Measured memory_bytes: 8916
using System;
using System.Linq;

class Program {
  static void Main() {
    var arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
    int a = arr[0];
    int b = arr[1];
    string[] s = { "Positive", "Zero", "Negative" };
    int t = 0;
    if (0 < a && 0 < b) t = 0;
    else if (a <= 0 && 0 <= b) t = 1;
    else if (((b - a + 1) % 2) == 1) t = 2;
    Console.WriteLine(s[t]);
  }
}

Measured memory_bytes: 13396
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#define rep(i,n) for (int i=0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main(){
    int n, ans=0;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    rep(i, n){
        if((i+1)%2 == 1 && a[i]%2 == 1) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <iomanip>
#include <utility>
#include <cstdlib>

#define MOD 1000000007

using namespace std;
typedef  long long ll;

int main(){
    int n,count=0;
    cin>>n;
    vector<int>p(n);
    vector<int>q(n);
    for(int i=0;i<n;i++){
        cin>>p.at(i);
        q.at(i)=p.at(i);
    }
    sort(q.begin(),q.end());
    for(int i=0;i<n;i++){
        if(p.at(i)!=q.at(i)) count++;
    }
    if(count==2||count==0){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
    
    
    
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<ctime>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#include<numeric>
#include<queue>
#include<deque>
#include<cfloat>
#include<functional>
#include<tuple>
#include<math.h>
#include<bitset>
#include<stack>
#include<set>
#include<random>
#include<stdlib.h>
#define rip(i,n) for(int i=0;i<n;i++)
#define Rip(i,n) for(int i=1;i<=n;i++)
#define RIP(i,a,b) for(int i=a;i<b;i++)
#define all(V) V.begin(),V.end()
#define sec  setprecision;
#define _CRT_SECURE_NO_WARNINGS
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops");
constexpr double eps = 1e-9;
constexpr double pi = 3.141592653589793238462643383279;
using namespace std;
using ll = long long;
using ld = long double;
using Pa = pair<int, int>;
ll mod = 1000000007;
ll MOD = 998244353;
ll gcd(ll a, ll b)
{
	if (a % b == 0)	return(b);
	else return(gcd(b, a % b));
}
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
ll pow(ll x, ll n) {
	x %= mod;
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return (pow((x * x) % mod, n / 2) % mod);
	else
		return (x * pow(x, n - 1)) % mod;
}
bool prime(int n) {
	int i = 2;
	if (n == 2)return true;
	else if(n <= 1)return false;
	if (n % i == 0)return false;
	i = 3;
	while (i <= sqrt(n)) {
		if (n % i == 0)return false;
		i += 2;
	}
	return true;
}
ll nextprime(ll sosuu, vector<bool>a) {
	sosuu++;
	while (a[sosuu] == false)sosuu++;
	return sosuu;
}
vector<bool> primes(ll n) {
	vector<bool>a(n, true);
	ll sosuu = 2;
	ll j = 2;
	while (sosuu * j < n)a[sosuu * j] = false, j++;
	while (sosuu < sqrt(n)+3) {
		j = 2;
		sosuu = nextprime(sosuu, a);
		while (sosuu * j < n)a[sosuu * j] = false, j++;
	}
	return a;
}
const int MAX = 510000;
ll fac[MAX], finv[MAX], inv[MAX];
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;
	}
}
ll 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;
}
vector<ll>primess(ll n) {
	vector<ll>a;
	while (n % 2 == 0)n /= 2, a.push_back(2);
	ll sosuu = 3;
	while (n != 1) {
		if (n % sosuu == 0)n / sosuu, a.push_back(sosuu);
		else sosuu += 2;
	}
	return a;
}
signed main() {
	int n; cin >> n;
	if (n >= 30)cout << "Yes" << endl;
	else cout << "No" << endl;
}


Measured memory_bytes: 3596
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <map>
#include <sstream>
#include <algorithm>
using namespace std;

int main(){
	int n;
	while(cin >> n && n){
		string l;
		getline(cin,l);
		map<string,int> W;
		vector< pair<int,string> > S;
		for(int i = 0 ; i < n ; i++){
			getline(cin,l);
			if( l[l.size()-1] == '\r' ){
				l = l.substr(0,l.size()-1);
			}
			
			stringstream ss(l);
			while(ss >> l){
				W[l]--;
			}
		}
		for( map<string,int> :: iterator it = W.begin() ; it != W.end() ; it++){
			S.push_back(make_pair(it->second,it->first));
		}
		char b;
		cin >> b;
		sort(S.begin(),S.end());
		int k = 0;
		for(int i = 0 ; i < S.size() ; i++){
			if( S[i].second[0] == b && k < 5){
				cout << (k++?" ":"") << S[i].second;
			}
		}
		if( !k ) cout << "NA" << endl;
		else cout << endl;
	}
	
}

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

const long double PI = 3.1415926535887;

long double R(int a) {
	return (long double)a * a;
}

long double D(pair<int, int> a) {
	return sqrt(R(a.first) + R(a.second));
}

long double K(int a, int b) {
	if(a == 0 && b == 0) return 0.00;
	long double x = a;
	x /= D({a, b});
	x = acos(x);
	x *= 180.00 / PI;
	if(b >= 0) return x;
	return 360.00 - x;
}

long double K(pair<int, int> a) {
	return K(a.first, a.second);
}

pair<int, int> J(pair<int, int> a, pair<int, int> b) {
	a.first += b.first;
	a.second += b.second;
	return a;
}

pair<int, int> S(pair<int, int> a, pair<int, int> b) {
	a.first -= b.first;
	a.second -= b.second;
	return a;
}

pair<int, int> M(pair<int, int> a, pair<int, int> b) {
	if(D(a) > D(b)) return a;
	return b;
}

const int N = 102;
int n;
pair<int, int> r[N], fp;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n;
	for(int i = 1; i <= n; ++i) {
		cin >> r[i].first >> r[i].second;
	}
	sort(r + 1, r + n + 1, [](pair<int, int> a, pair<int, int> b) { return K(a) < K(b); } );
	for(int i = 1; i <= n; ++i) {
		r[i] = J(r[i - 1], r[i]);
	}
	for(int i = 1; i <= n; ++i) {
		for(int j = 1; j <= n; ++j) {
			if(i <= j) {
				fp = M(fp, S(r[j], r[i - 1]));
			} else {
				fp = M(fp, J(S(r[n], r[i - 1]), r[j]));
			}
		}
	}
	cout << setprecision(20) << D(fp) << endl;
	return 0;
}


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

/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y) {
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
int main() {
	int a, b;
	cin >> a >> b;
	if (b * 2 >= a) {
		cout << 0;
	}
	else {
		cout << a - (b * 2);
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg puts("It's Just Begining.Wait For The End!!!!!\n")
#define CHECK(x) cout << (#x) << " is " << (x) <<"\n";
#define endl printf("\n")
typedef pair<ll,ll> pii;
#define pb push_back
#define ms(a,b) memset(a, b, sizeof(a))
#define in(x) scanf("%lld",&x)
#define out(x) printf("%lld",x)
#define X first
#define Y second
#define sps printf(" ")
#define dou(x) cout<<fixed<<setprecision(6)<<x
int main()
{
    ll i,j,k,l,n,m;
    ll tot=0;
    in(n);in(m);
    ll arr[n];
    for(i=0;i<n;i++)
    {
        in(arr[i]);
        tot+=arr[i];
    }
    sort(arr,arr+n,greater<ll>());
    double limit=((double)tot/(double)(4*m));
    if((double)arr[m-1]<limit)puts("No");
    else puts("Yes");
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
using namespace std;

#define ABS(a) (((a) >= 0) ? (a) : -(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define RFOR(i, a, b) for (int i = a; i > b; --i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define int long long

typedef long long ll;
typedef pair<int, int> Pair;

// const int kMaxN;

int N;
int D[10];
string ans;

string Search(int i, vector<int> d1, vector<int> d2) {
  if (i == 10) { return "YES"; }

  if (d1.empty() || d1.back() < D[i]) {
    d1.push_back(D[i]);
    if (Search(i+1, d1, d2) == "YES") { return "YES"; }
    d1.pop_back();
  }
  if (d2.empty() || d2.back() < D[i]) {
    d2.push_back(D[i]);
    if (Search(i+1, d1, d2) == "YES") { return "YES"; }
  }

  return "NO";
}

signed main() {
  cin >> N;

  while (N-- > 0) {
    REP(i, 10) { cin >> D[i]; }
    vector<int> d1, d2;
    ans = Search(0, d1, d2);
    cout << ans << endl;
  }

  return 0;
}



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

using namespace std;

int main() {

    int x;
    cin >> x;

    if (x == 7 or x == 5 or x == 3) {
        cout << "YES" << "\n";
    } else {
        cout << "NO" << "\n";
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll d = 0;
  cin >> d;
  vector<ll> c(26);
  //ll min = 0;
  //min = pow(10,18);
  //ll mini = 0;
  for(int i = 0;i < 26;i++){
    cin >> c[i];
    //if(min > c[i])min = c[i],mini = i;
  }
  vector<vector<ll>> s(d,vector<ll>(26));
  /*vector<ll> last(26);
  for(int i = 0;i < 26;i++)last[i] = -1;
  for(int i = 0;i < d;i++){
    ll now = 0;
    ll nowi = 0;
    for(int j = 0;j < 26;j++){
      cin >> s[i][j];
      s[i][j] += c[j] * (i - last[j]) * (d - i);
      if(now < s[i][j]){
        now = s[i][j];
        nowi = j;
      }
    }
    last[nowi] = i;
    cout << nowi + 1 << endl;
  }*/
  ll score = 0;
  for(int i = 0;i < d;i++)for(int j = 0;j < 26;j++)cin >> s[i][j];
  vector<ll> res(365);
  
  for(int i = 0;i < 26;i++){
    for(int j = 0;j < 26;j++){
      //for(int k = 0;k < 26;k++){
        
        vector<ll> last(26);
        for(int l = 0;l < 26;l++)last[l] = -1;
        vector<ll> now(365);
        last[i] = 0,now[0] = i;
        last[j] = 1,now[1] = j;
        //last[k] = 2,now[2] = k;
        for(int l = 2;l < d;l++){
          ll max = 0;
          ll maxi = 0;
          for(int m = 0;m < 26;m++){
            s[i][j] += c[j] * (i - last[j]) * (d - i);
            if(max < s[i][j]){
              max = s[i][j];
              maxi = m;
            }
          }
          last[maxi] = l;
          now[l] = maxi;
        }
        
        vector<ll> lastm(26);
  		for(int l = 0;l < 26;l++)lastm[l] = -1;
  		ll nowres = 0;
  		for(int l = 0;l < d;l++){
    		/*ll nowin = 0;
    		cin >> nowin;
    		nowin--;*/
    		last[now[l]] = l;
    		nowres += s[l][now[l]];
    		for(int m = 0;m < 26;m++){
      			nowres -= c[m] * (l - last[m]);
    		}
    		//cout << res << endl;
 		 }
        
        if(nowres > score){
          for(int l = 0;l < 365;l++)res[l] = now[l];
        }

      //}
    }
  }
  for(auto i:res)cout << i + 1 << endl;
  //for(int i = 0;i < 365;i++)cout << mini + 1 << endl;
}

Measured memory_bytes: 3720