akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,w;
    cin >> n >> w;
    int a[n][2];
    int sum=0;
    for(int i=0;i<n;i++)
    {
        cin >> a[i][0] >> a[i][1];
        sum+=a[i][1];
    }
    vector<long> kp(sum+1,0);
    int t=0;
    for(int i=0;i<n;i++)
    {
        t+=a[i][1];
        vector<long> temp(sum+1,0);
        for(int j=0;j<sum;j++)
        { 
            if(j+1<a[i][1])
             temp[j+1]=kp[j+1] ;
            else if(j+1>t)
             temp[j+1]=0;
            else
            {
                if(j+1-a[i][1]==0 ||kp[j+1-a[i][1]]>0 )
                temp[j+1]=kp[j+1-a[i][1]]+a[i][0];
                else
                temp[j+1]=kp[j+1];
                if(kp[j+1]!=0)
                 temp[j+1]=min(temp[j+1],kp[j+1]);
                
            }
            // cout << temp[j+1]<<" ";
        }
        // cout << endl;
        kp=temp;
    }
    int i=sum;
    for(;i>=1;i--)
    {
        // cout << kp[i]<<" ";
        if(kp[i]<=w && kp[i]!=0)
            break;
    }
    cout << i;
    return 0;
}

Measured memory_bytes: 4836
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int N;
int A,B,C;

  long long brute_force_search(int cnt, int a, int b, int c, int L[]) {
    long long INF = std::pow(10, 9.0);
    if (cnt==N) {
      //return std::abs(a-A)+std::abs(b-B)+std::abs(c-C)-30;
      
      if ((a>0)&&(b>0)&&(c>0)){
        return std::abs(a-A)+std::abs(b-B)+std::abs(c-C)-30;
      } else {
        return INF;
      }
    }
    vector<long long> ansc(4);
    ansc[0] = brute_force_search(cnt+1, a, b, c, L);
    ansc[1] = brute_force_search(cnt+1, a+L[cnt], b, c, L)+10;
    ansc[2] = brute_force_search(cnt+1, a, b+L[cnt], c, L)+10;
    ansc[3] = brute_force_search(cnt+1, a, b, c+L[cnt], L)+10;
    int min = *std::min_element(ansc.begin(), ansc.end());
    return min;
  }

int main() {
  cin >> N >> A >> B >> C;
  
  int len[N];
  for (int i; i<N;i++){
    cin >> len[i];
  } 
  
  long long ans;
  ans = brute_force_search(0, 0, 0, 0, len);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	vector<char> v;
	int flag=0;
	for(int i=0;i<n;i++){
		char a;
		cin>>a;
		v.push_back(n);
		if(a=='Y'){
			flag=1;
		}
	}
	if(flag) cout<<"Four"<<endl;
	else cout<<"Three"<<endl;
	return 0;
}

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

int c[10][1005];
int main() {
	int h, w, k; cin >> h >>w >> k;
	vector<string>s(h);
	rep(i, h)cin >> s[i];
	int ans = INF;
	rep(div, 1 << (h - 1)) {
		int g = 0;
		vector<int>id(h);
		rep(i, h) {
			id[i] = g;
			if (div >> i & 1)++g;
		}
		++g;
		rep(i, g)rep(j, w)c[i][j] = 0;
		rep(i, h)rep(j, w)c[id[i]][j] += (s[i][j] - '0');
		int num = g - 1;
		vector<int>now(g);
		auto add = [&](int j) {
			rep(i, g)now[i] += c[i][j];
			rep(i, g)if (now[i] > k)return false;
			return true;
		};
		rep(j, w) {
			if (!add(j)) {
				num++;
				now = vector<int>(g);
				if (!add(j)) {
					num = INF;
					break;
				}
			}
		}
		ans = min(ans, num);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
program abc163c
      implicit none
      integer::n
      integer,allocatable,dimension(:)::a,ans
      integer::i

         read *, n
         allocate(a(2:n))
         allocate(ans(n))
         read *, a(2:n)

         ans=0
         do i=2,n
            ans(a(i))=ans(a(i))+1
         end do

         do i=1,n
            print *,ans(i)
         end do

   end program abc163c

Measured memory_bytes: 5660
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using P = pair<int, int>;

int main(){
    int n;
    cin >> n;
    VI x(n);
    rep(i,n) cin >> x[i];

    int min = 10000000;
    rep2(p,1,101){
        int sum = 0;
        rep(i,n){
            sum += (x[i]-p)*(x[i]-p);
        }
        if(sum < min) min = sum;
    }

    cout << min << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long n,a[200005],x[200005],sum[200005],l,r,ans;
int main()
{
    cin>>n;
    cin>>a[0];
    x[0]=a[0];
    sum[0]=a[0];
    for (int i=1;i<n;i++)
    {
        scanf("%lld",&a[i]);
        sum[i]=sum[i-1]+a[i];
        x[i]=x[i-1]^a[i];
        //cout<<a[i]<<' '<<sum[i]<<' '<<x[i]<<endl;
    }
    for (int r=0;r<n;r++)
    {
        while((sum[r]-sum[l-1])!=(x[r]^x[l-1])) l++;
        ans+=r-l+1;
    }
    cout<<ans<<endl;
}

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

using namespace std;

int n, h[100005], dp[100005];

int main(){
	cin >> n;
	for(int i = 1; i <= n; i++){
		cin >> h[i];
	}
	dp[1] = 0;
	dp[2] = abs(h[2] - h[1]);
	for(int i = 3; i <= n; i++){
		dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]) , dp[i - 2] + abs(h[i] - h[i - 2]));
	}
/*	for(int i = 1; i <= n; i++){
		cout << dp[i] << " ";
	}                         */
	cout << dp[n];
}

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

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

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

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

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

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

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

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

fn main(){
    input!{
        a1:i32,
        a2:i32,
        a3:i32
    }

    println!("{}", if a1+a2+a3 > 21 {"bust"} else {"win"} );
}

Measured memory_bytes: 4352
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
#define ch() getchar()
#define pc(x) putchar(x)
template<typename T>inline void read(T&x){
	int f;char c;
	for(f=1,c=ch();c<'0'||c>'9';c=ch())if(c=='-')f=-f;
	for(x=0;c<='9'&&c>='0';c=ch())x=x*10+(c&15);x*=f;
}
template<typename T>inline void write(T x){
	static char q[64];int cnt=0;
	if(!x)pc('0');if(x<0)pc('-'),x=-x;
	while(x)q[cnt++]=x%10+'0',x/=10;
	while(cnt--)pc(q[cnt]);
}
const int maxm=100005;
int vis[maxm],st[maxm];
int main(){
	long long n;int x,m,cx,s=1;read(n),read(x),read(m);
	if(n<=m+1){long long ans=0;for(int i=1;i<=n;++i,x=1ll*x*x%m)ans+=x;write(ans),pc('\n');}
	else{
		for(cx=x,s=1;!vis[cx];++s,cx=1ll*cx*cx%m)st[vis[cx]=s]=cx;long long ans=0;
		for(int i=1,tx=x;i<vis[cx];++i,tx=1ll*tx*tx%m)ans+=tx;n-=vis[cx]-1;
		int len=s-vis[cx];long long tmp=0;for(int i=vis[cx];i<s;++i)tmp+=st[i];
		ans+=(n/len)*tmp;n%=len;for(int i=vis[cx];i<vis[cx]+n;++i)ans+=st[i];
		write(ans),pc('\n');
	}
	return 0;
}


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

int main() {
	int a, min, max;
	long long sum;
	cin >> a;
	cin >> min;
	max = min;
	sum += min;
	for (int i = 0; i < a-1; i++) {
		int b;
		cin >> b;
		if (b < min) {
			min = b;
		}
		else if(b > max) {
			max = b;
		}
		sum += b;
	}
	cout << min << " " << max << " " << sum << endl;
	return 0;
}

Measured memory_bytes: 3088
#include<bits/stdc++.h>
#define int long long

using namespace std;

const int maxn = 200010;
int n, ans;

int read()
{
  int x = 0, w = 1;
  char ch = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * w;
}

inline void write(int x)
{
  static int sta[35];
  int top = 0;
  do {
    sta[top++] = x % 10, x /= 10;
  } while (x);
  while (top) putchar(sta[-- top] + 48);
}

signed main()
{
    n = read();
    ans = (n - 2) * 180;
    write(ans);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <vector>
#include <stack>
#include <cstdio>
#include <string>
#include <bitset>
#include <list>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <functional>
#include <queue>
#include <regex>
#include <cassert>
#include <map>
// #include "bits/stdc++.h"

using namespace std;
//debug

#define rep(i, N, M) for (ll i = N; i < M; ++i)
#define rrep(i, N, M) for (ll i = N; i < M; --i)
#define pb push_back


typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<string> vs;
typedef priority_queue<ll> pqll;
typedef priority_queue<pll, vector<pll>> pqpll;
typedef priority_queue<ll, vll, greater<ll>> pqll_greater;
typedef priority_queue<pll, vector<pll>, greater<pll>> pqpll_greater;


#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define vec(a) vector<a>
#define _CRT_SECURE_NO_WARNINGS

template<class T, class S>
T atbit(T n, S i) {
	return (n >> i) % i;
}

template<class T>
T getbit(T i) {
	return 1LL << i;
}

//#define TRANSFORM(v,w,func) decltype(v) w ; transform((v).begin(),(v).end(),back_inserter(w),func);

using namespace std;


int main() {
	ll A, B;
	cin >> A >> B;
	if (A*B % 2 == 0) {
		cout << "No";
	}
	else {
		cout << "Yes";
	}
}
//ll N;
//cin >> N;
//vll a(N);
//rep(i,0, N) cin >> a[i];

Measured memory_bytes: 256
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")

// -------------------</optimizations>--------------------
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define d long double
#define pii pair<int,int>
#define pb push_back
#define pf push_front
#define cases int tc;cin>>tc;while(tc--)
#define N 100003
#define M 103
#define inf LLONG_MAX
#define SPEED ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//int mod=1e9+7;
//int mod=998244353;

signed main()
{
    SPEED
    
    int a,p;
    cin>>a>>p;
    p+=3*a;
    cout<<p/2;
    
    
    return 0;
}


Measured memory_bytes: 256
using System;

class Program
{
    static void Main()
    {
        var X = int.Parse(Console.ReadLine());

        static int Pow5(int x) => x * x * x * x * x;

        var result = (0, 0);
        for (int i = -118; i <= 119; i++)
        {
            for (int j = -119; j <= 118; j++)
            {
                if (Pow5(i) - Pow5(j) == X)
                {
                    result = (i, j);
                    break;
                }
            }
            if (result != (0, 0))
            {
                break;
            }
        }

        Console.WriteLine($"{result.Item1} {result.Item2}");
    }
}


Measured memory_bytes: 27484
#![allow(unused_imports)]

use std::cmp::{max, min};
use std::collections::*;
use std::io::{stdin, stdout, BufWriter, Write};

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>,
}
impl Scanner {
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn solve() {
    let mut scan = Scanner::default();
    let n: usize = scan.next();
    let mut v = vec![0;n];
    for i in 0..n {
        v[i] = scan.next();
    }
    let v = v;
    let mut res = 0;
    for i in 0..n {
        for j in i+1..n {
            for k in j+1..n {
                if v[i] == v[j] || v[j] == v[k] || v[k] == v[i] {
                    continue
                }
                if v[i]+v[j]>v[k] && v[j]+v[k]>v[i] && v[i]+v[k]>v[j] {
                    res += 1;
                }
            }
        }
    }
    println! ("{}", res);
}

fn main() {
    let mut scan = Scanner::default();
    // let t = scan.next::<u64>();
    let t = 1;
    for _ in 0..t {
        solve();
    }
}


Measured memory_bytes: 2160
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    //nextLineとnextを同時に使ったら死ぬ
    val sc = new Scanner(System.in)
    val n, x = sc.nextInt()
    val ls = Array
      .fill(n)(sc.nextInt())
      .scanLeft(0) { case (acc, l) => l + acc }
      .takeWhile(_ <= x)
      .length
    println(ls)
  }
  def debug(args: Any*): Unit = {
    Console.err.println(args.mkString(" "))
  }
}


Measured memory_bytes: 25680
from collections import deque
N = int(input())
G = {k: [] for k in range(N)}
E = [0]*N
ans = [-1]*N

for _ in range(N-1):
    a, b = map(int, input().split())
    # 無向グラフ
    G[a-1].append(b-1)
    G[b-1].append(a-1)

    E[a-1] += 1
    E[b-1] += 1

C = sorted([int(i) for i in input().split()], reverse=True)
print(sum(C[1:]))


ans[E.index(max(E))] = C[0]
que = deque([(E.index(max(E)), -1)])

idx = 0
while que:
    ci, p = que.popleft()

    for ni in G[ci]:
        if ni != p:
            idx += 1
            ans[ni] = C[idx]
            que.append((ni, ci))

print(*ans)


Measured memory_bytes: 52440
//#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <string>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <vector>
#include <cassert>
#include <fstream>
#include <algorithm>
#include <list>
#include <random>
#include <ctime>
#include <cmath>
#include <random>
#include <bitset>
#include <complex>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
//#define int ll
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef pair<ld, ld> pld;
typedef complex<double> base;

#define mmin(a, b) a = min(a, (b))
#define mmax(a, b) a = max(a, (b))
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define ALL(a) a.begin(),a.end()
#define sqr(x) (x) * (x)
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define cint const int & 
#define SZ(a) ((int)(a.size()))
#define watch(x) cout << (#x) << " = " << x << endl;

const double PI = 2 * acos(0.0);

template<class T>
void show(const vector<T> &a) {
	for (T x : a)
		cout << x << " ";
	cout << endl;
}


signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n, k;
	cin >> n >> k;
	vi a(n);
	fori(i, n)
		cin >> a[i];
	int ans = 0;
	for (int i = 0; i < n; i += k - 1) {
		if (i != n - 1) ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 640
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")



void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod(ll n){return n%=MOD1;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

typedef struct{
    ll aa;
    ll bb;
}frequent;

ll min3(ll a, ll b, ll c){
    return (a<=b && a<=c) ? a : b<=c ? b : c;
}

int main(void){
    // char ;
    ll n;
    scanf("%lld",&n);
    ll dp[n+1];
    dp[0]=0;
    rep(i,1,n+1) dp[i]=i;
    rep(i,1,6+1){
        rep(j,POW(6,i),n+1){
            dp[j] = min3( dp[j] , dp[j-1]+1 , dp[j-POW(6,i)]+1 );
            // dp[j]=min2(dp[j],dp[j-1]+1);
            // dp[j]=min2(dp[j],dp[j-POW(6,i)]+1);
            // if(j==n) printf("%lld  ",dp[j]);
        }
    }
    rep(i,1,5+1){
        rep(j,POW(9,i),n+1){
            dp[j] = min3( dp[j] , dp[j-1]+1 , dp[j-POW(9,i)]+1 );
            // dp[j]=min2(dp[j],dp[j-1]+1);
            // dp[j]=min2(dp[j],dp[j-POW(9,i)]+1);
            // if(j==n) printf("%lld  ",dp[j]);
        }
    }
    printf("%lld\n",dp[n]);
    return 0;
}

Measured memory_bytes: 896
#include<iostream>
#include<vector>
const double PI  = 3.141592653589793238463;
using namespace std;

typedef unsigned long long int ll;
typedef vector <int> x;
const char line = '\n';



int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long double r;
    cin>>r;
    cout<<2*PI*r;
    return 0;
}

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

int main(){
    int N,W; cin>>N>>W;
    int a[N][2];
    rep(i,N)cin>>a[i][0]>>a[i][1];
    int dp[N+1][W+1];
    rep(i,W+1)dp[0][i]=0;
    for(int i=0; i<N; i++){
        rep(j,W+1){
            if(a[i][1]<=j)dp[i+1][j]=max(dp[i][j],dp[i+1][j-a[i][1]]+a[i][0]);
            else dp[i+1][j]=dp[i][j];
        }
    }
    cout<<dp[N][W]<<endl;
    return 0;
}


Measured memory_bytes: 7044
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
 
typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;
 
#define MOD 1000000007

int main(){
	ll n,m,c;
	cin>>n>>m>>c;
	ll ans = 0;
	vector<ll> b;
	rep(i,0,m){
		ll a;
		cin>>a;
		b.pb(a);
	}
	rep(i,0,n){
		ll d = c;
		rep(j,0,m){
			ll a;
			cin>>a;
			d += a*b[j];
		}
		if(d>0)ans++;
	}
	cout << ans << endl;
	return 0;	
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ST first
#define ND second
#define ll long long
#define ld long double
using namespace std;
using namespace __gnu_pbds;

// replace int with pair if multiset needed
typedef tree<int, null_type, greater<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
ordered_set secik;

const int INF = 1e9 + 9;
const int MOD = 1e9 + 7;
const long long LINF = (ll)1e18 + 3;

// secik.insert({x, t++});
// secik.erase(secik.lower_bound({x,-1}));
// *secik.find_by_order(x)).first << "\n";
// secik.order_of_key(x)

//random_device device;
//mt19937 gener(device());
//uniform_int_distribution<int> gen(0,n-1);
//gen(gener); // generate random number

const int nax = 305;
double p[nax][nax][nax], ev[nax][nax][nax];
// ev[a][b][c] - the expected number of operations so far to get to state (a,b,c)
// easier: p-bility of getting to this state at all

int main() {
    int n;
    scanf("%d", &n);
    vector<int> cnt(4);
    for(int i = 0; i < n; ++i) {
        int x;
        scanf("%d", &x);
        ++cnt[x];
    }
    p[cnt[1]][cnt[2]][cnt[3]] = 1;
    for(int c = n; c >= 0; --c) {
        for(int b = n; b >= 0; --b) {
            for(int a = n; a >= 0; --a) {
                if(a == 0 && b == 0 && c == 0) {
                    continue;
                }
                if(a + b + c > n) {
                    continue;
                }

                double p_waste = (double) (n - (a + b + c)) / n;
                double ev_waste = p_waste / (1 - p_waste) + 1;
                ev[a][b][c] += ev_waste * p[a][b][c];

                if(a != 0) {
                    double p_go = (double) a / (a + b + c);
                    p[a-1][b][c] += p[a][b][c] * p_go;
                    ev[a-1][b][c] += ev[a][b][c] * p_go;
                }

                if(b != 0) {
                    double p_go = (double) b / (a + b + c);
                    p[a+1][b-1][c] += p[a][b][c] * p_go;
                    ev[a+1][b-1][c] += ev[a][b][c] * p_go;
                }

                if(c != 0) {
                    double p_go = (double) c / (a + b + c);
                    p[a][b+1][c-1] += p[a][b][c] * p_go;
                    ev[a][b+1][c-1] += ev[a][b][c] * p_go;
                }
            }
        }
    }
    printf("%.10lf\n", ev[0][0][0]);
}

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

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(unused_imports)]
use std::io::Write;

fn main() {
    input!{
      t: f64,
      x: f64,
    }
    println!("{}", t/x)
}



Measured memory_bytes: 4352
#!/usr/bin/perl

sub main() {
  my($A,$B,$C)=split(/ /,<>);
  chomp($C);
  my $ans = prob($A,$B,$C);
  print $ans;
}

sub prob() {
  my($A,$B,$C) = @_;
  for my $i(1..100){
    my $tmp = $B * $i + $C;
    if($tmp%$A == 0){
      return "YES";
    }
  }
  return "NO";
}

&main();

Measured memory_bytes: 640
#include <stdio.h>
#include <string.h>

int isP(char ch[])
{
    int l, i, flag=1, tmp, j, tmp2;
    l=strlen(ch);
    for (i=0; i<l/2; i++) {
        if (ch[i]!=ch[l-i-1]) {
            flag=0; break;
        }
    }
    tmp=(l-1)/2;
    for (i=0; i<tmp; i++) {
        if (ch[i]!=ch[tmp-i-1])
            flag=0; break;
    }
    tmp=(l+3)/2;
    tmp2=l-tmp+1;
    j=0;
    for (i=tmp; i<tmp2/2; i++) {
        if (ch[i]!=ch[l-(j)-1])
            flag=0;j++;
            break;
    }
    return flag;
}

int main()
{
    char ch[100];
    int flag;
    scanf("%s", ch);
    flag=isP(ch);
    if (flag) puts("Yes");
    else puts("No");
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#include <algorithm>
#include <map>
using namespace std;

long long N, X, D;

int main()
{
	scanf ("%lld %lld %lld", &N, &X, &D);
	if (D == 0){
		if (X) printf ("%lld\n", N + 1);
		else puts("1");
		return 0;
	}

	map<long long, map<long long, int> > cnt;
	for (long long i = 0; i <= N; i++){
		long long r = i * X % D;
		long long s = (i * X / D) + i * (i - 1) / 2;
		long long e = (i * X / D) + (N * (N - 1) / 2 - (N - i) * (N - i - 1) / 2);
		cnt[r][s]++; cnt[r][e + 1]--;
	}

	long long ans = 0;
	for (auto &v : cnt){
		int c = 0;
		for (auto &p : v.second) if (p.second){
			if (c == 0) ans -= p.first;
			c += p.second;
			if (c == 0) ans += p.first;
		}
	}
	printf ("%lld\n", ans);

	return 0;
}

// i -> i * (i - 1) / 2 ~ N * (N - 1) / 2 - (N - i) * (N - i - 1) / 2

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

int sum(int x){
  int sum = 0;
  while(x !=0){
    sum += x%10;//一番右の桁の数字を足す
    x /= 10; //一番右の桁を消す
  }
  return sum;
}
    
  
int main() {
  int N;
  cin>>N;
  if(N%sum(N)==0)puts("Yes");
  else puts("No");
  return 0;
}


Measured memory_bytes: 256
const MOD: usize = 1e9 as usize + 7;

fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let x: usize = sc.read();
    let mut s: Vec<usize> = sc.vec(n);
    s.sort();
    s.reverse();

    let mut dp = vec![0; x + 1];
    dp[x] = 1;
    for i in 0..n {
        let mut next = vec![0; x + 1];
        for j in 0..(x + 1) {
            // unused
            next[j] += dp[j] * (n - 1 - i);
            next[j] %= MOD;

            // used
            next[j % s[i]] += dp[j];
            next[j % s[i]] %= MOD;
        }
        dp = next;
    }

    let mut ans = 0;
    for i in 0..s[n - 1] {
        ans += dp[i] * i;
        ans %= MOD;
    }
    println!("{}", ans);
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 8444
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(x) (x).begin(),(x).end()
#define dup(x,y) (((x)+(y)-1)/(y))
#define sz(x) (int)(x).size()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main(){
    string a, b, c;
    cin >> a >> b >> c;
    cout << a[0] << b[1] << c[2] << endl;
    return 0;
}

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

class Program
{
    static void Main() => new Program().Solve();

    public void Solve()
    {
        int l = ReadInt();
        int r = ReadInt();
        int d = ReadInt();
        Console.WriteLine(Enumerable.Range(l, r - l + 1).Count(x => x % d == 0));
    }
}

static class Scanner
{
    static Queue<string> que = new Queue<string>();
    public static string Read() { if (!que.Any()) foreach (var s in Console.ReadLine().Split()) que.Enqueue(s); return que.Dequeue(); }
    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());
    public static decimal ReadDecimal() => decimal.Parse(Read());
    public static IEnumerable<string> Read(long n) { for (long i = 0; i < n; i++) yield return Read(); }
    public static IEnumerable<int> ReadInt(long n) => Read(n).Select(int.Parse);
    public static IEnumerable<long> ReadLong(long n) => Read(n).Select(long.Parse);
    public static IEnumerable<double> ReadDouble(long n) => Read(n).Select(double.Parse);
    public static IEnumerable<decimal> ReadDecimal(long n) => Read(n).Select(decimal.Parse);
}


Measured memory_bytes: 28204
n, q = map(int, input().split())
s = input()
x = [tuple(input().split()) for _ in range(q)]

l = 0
r = n
while r-l > 1:
    m = (l+r)//2
    c = s[m]
    idx = m
    for j in range(q):
        if x[j][0] == c:
            if idx == 0 and x[j][1] == "L":
                l = m
                break
            elif idx == n-1 and x[j][1] == "R":
                r = m
                break
            else:
                if x[j][1] == "L":
                    c = s[idx-1]
                    idx -= 1
                else:
                    c = s[idx+1]
                    idx += 1

        if j == q-1:
            r = m
idx1 = l

l = 0
r = n
while r-l > 1:
    m = (l+r)//2
    c = s[m]
    idx = m
    for j in range(q):
        if x[j][0] == c:
            if idx == 0 and x[j][1] == "L":
                l = m
                break
            elif idx == n-1 and x[j][1] == "R":
                r = m
                break
            else:
                if x[j][1] == "L":
                    c = s[idx-1]
                    idx -= 1
                else:
                    c = s[idx+1]
                    idx += 1

        if j == q-1:
            l = m
idx2 = r
print(n-(idx1+1)-(n-idx2))


Measured memory_bytes: 97868
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};

const long double EPS = 0.0000001;


	static int ret = 0;
	static int N,K;
	static int a[100010];

vector<int> ch[100010];
int add[100010],dist[100010];
void dfs(int v){
	//cout << "v = " << v << endl;
	add[v] = 0;
	dist[v] = 0;
	for(int i = 0 ; i < ch[v].size() ; i ++){
		int u = ch[v][i];
		dfs(u);
		add[v] += add[u];
		dist[v] = max( dist[v], dist[u]+1 );
	}
	if(dist[v] >= K-1 && a[v] != 1){
		add[v] ++;
		dist[v] = -1;
	}
	//cout << v << ":" << add[v] << " " << dist[v] << endl;
}

int main(){
	scanf("%d%d",&N,&K);
	for(int i = 1 ; i <= N ; i ++){
		scanf("%d",&a[i]);
	}
	
	if(a[1] != 1){
		ret ++;
		a[1] = 1;
	}
	for(int i = 2 ; i <= N ; i++){
		ch[a[i]].pb(i);
	}
	
	dfs(1);
	cout << add[1]+ret << endl;
}


Measured memory_bytes: 11648
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <cassert>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
using namespace std;
using ll = long long;
constexpr ll INF = 3000000000000000000;

int main() {
    int H, W, K;
    cin >> H >> W >> K;
    vector<vector<char>> A(H, vector<char>(W, '.'));
    int S_i, S_j;
    REP(i, H) REP(j, W) {
        cin >> A[i][j];
        if (A[i][j] == 'S') {
            S_i = i;
            S_j = j;
        }
    }
    
    vector<vector<int>> dist(H, vector<int>(W, -1));
    dist[S_i][S_j] = 0;
    queue<pair<int, int>> q;
    q.push(pair<int, int>{S_i, S_j});
    int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
    while (!q.empty()) {
        int i = q.front().first;
        int j = q.front().second;
        q.pop();
        REP(k, 4) {
            if (i + dx[k] >= 0 && i + dx[k] < H && j + dy[k] >= 0 && j + dy[k] >= 0) {
                if (A[i + dx[k]][j + dy[k]] != '#' && dist[i + dx[k]][j + dy[k]] == -1) {
                    dist[i + dx[k]][j + dy[k]] = dist[i][j] + 1;
                    q.push(pair<int, int>{i + dx[k], j + dy[k]});
                }
            }
        }
    }
    
    int ans = 1000000000;
    REP(i, H) REP(j, W) {
        if (dist[i][j] <= K && dist[i][j] != -1) {
            ans = min(ans, (min({i, j, H - 1 - i, W - 1 - j}) + K - 1) / K + 1);
        }
    }
    
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 6840
import copy
import itertools

def funcF(p):
    return p

def funcG(p):
    return funcF(p) + p*p

N = int(input())
#L=[]
#for i in range(N):
#    L.append(int(input()))
L = list(int(i) for i in input().split())
L.sort()


S=0
for i in L[:N-1]:
    S += i

if L[N-1] < S:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e7+5;
int n,a[2005];
int main(){
    cin>>n;
    for(int i=1;i<=n;i++)cin>>a[i];

    sort(a+1,a+1+n);

    int ans=0;

    for(int i=1;i<=n-2;i++)
    for(int j=i+1;j<n;j++){
        int p =lower_bound(a+j,a+1+n,a[i]+a[j])-a;
            ans+=p-j-1;
    }
    printf("%d\n",ans);


    return 0;
}



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

using namespace std;
#ifdef ONLINE_JUDGE
#define cerr if(false)cerr
#endif
#define int long long
#define ld1 long double
#define watch(x) cerr << (#x) << " is " << (x) << endl
#define faster ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL),cout<<setprecision(14);
#define cint int t;cin>>t;while(t--)
#define vint vector<int>
#define all(v) (v).begin(), (v).end()
#define pii pair<int,int>
#define pb push_back
#define mm0(X) memset((X), 0, sizeof((X)))
#define mm1(X) memset((X), -1, sizeof((X)))
#define N (int)1e5+7
#define MAXN (int)5004
#define INF (int)1e9
#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)
#define endl '\n'
#define vcc vector<char>

const int mod=1000000007;
int powmod(int a,int b) {int res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}

void solve() {
    int n,m,x;
    cin>>n>>m>>x;
    int c[n];
    int a[n][m];
    for(int i=0;i<n;i++){
        for(int j=0;j<=m;j++){
            if(j==0) cin>>c[i];
            else cin>>a[i][j-1];
        }
    }

    int final=INT64_MAX;
    for(int i=0;i<(1<<n);i++){
        int tmp=i;
        int cost=0;
        int y=1;
        int lvl[m]={};

        for(int j=0;j<31;j++){
            if((tmp>>j)&1){
                cost+=c[j];
                for(int k=0;k<m;k++){
                    lvl[k]+=a[j][k];
                }
            }
        }
        for(int i=0;i<m;i++) if(lvl[i]<x) y=0;
        if(y) final=min(final,cost);
    }
    if(final==INT64_MAX) cout<<-1<<endl;
    else cout<<final<<endl;
}


int32_t main() {
    faster;

#ifndef ONLINE_JUDGE
    READ("inp.txt");
    WRITE("out.txt");
    double beg=clock();
#endif

    int t=1;
//    cin>>t;

    while(t--){
        solve();
    }

#ifndef ONLINE_JUDGE
    double end=clock();
    cout<<endl;
    cerr<<"*** Total time = "<<(end-beg)/CLOCKS_PER_SEC;
#endif
}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  double a[n];
  double sum = 0;
  for(int i = 0; i < n; i++){
    double b;
    cin >> b;
    a[i] = 1 / b;
    sum += a[i];
  }
  cout << 1 / sum << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
	char s[200001] = { '\0' };
	char t[200001] = { '\0' };
	scanf("%s", s);
	scanf("%s", t);
	int i = 0;
	int count = 0;
	while(s[i] != '\0'){
		if(s[i] != t[i]){
			count++;
		}
		i++;
	}
	printf("%d\n", count);
	return 0;
}

Measured memory_bytes: 2120
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>  // assert(x>=10), 部分点問題
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <set>

#define repl(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) (x).begin(), (x).end()
#define SORT(v,n) sort(v,v+n)
#define VSORT(v) sort(all(x))
#define FILL(v, value) (v+(sizeof(v) / sizeof *(v)), value);
#define inf 999999999
#define dbg(x) cout<<#x<<":"<<x<<endl;
#define pb(a) push_back((a))
#define mp(a) make_pair((a))
#define pi 2*acos(0.0)
#define in scanf
#define out printf
#define fi first
#define se second

// --
#define bit(n) (1LL<<(n)) // 左bitシフト
// --

using namespace std;

typedef long long llong;
typedef pair<int, int> pii;
typedef pair<llong, llong> pll;
typedef pair<llong, pll> plp;

const int MOD=1000000007;
const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};  // 右下左上


int main(int argc, char**argv){
  string x;
  cin >> x;
  cin.ignore();

  if (x.size() != 3){
    cout << "No" << endl;
    return 0;
  }

  int na = 0;
  int nb = 0;
  int nc = 0;
  for (int i = 0; i < 3; i++){
    if (x[i] == 'a'){
      na++;
    }else if (x[i] == 'b'){
      nb++;
    }else if (x[i] == 'c'){
      nc++;
    }else{
      cout << "No" << endl;
      return 0;
    }
  }

  if (na == 1 && nb == 1 && nc == 1){
    cout << "Yes" << endl;
    return 0;
  }else{
    cout << "No" << endl;
    return 0;
  }



	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
     
    using namespace std;
     
    const int N = 10005;
     
    int n, t, x, a, h;
     
    int main()
    {
        cin >> n;
        cin >> t >> a;
        int ans, bst = 1e9;
        a = a * 1000;
        t = t * 1000;
        for(int i = 0; i < n; i++)
        {
            cin >> h;
            if(abs(t - h * 6 - a) < bst)
            {
                bst = abs(t - h * 6 - a);
                ans = i + 1;
            }
        }
        cout << ans << endl;
        return 0;
    }

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
        int n, m, k, r;
        cin>>n;
        int a[n][n];
        for(int i=0;i<n;i++)
                for(int j=0;j<n;j++)
                        a[i][j] = 0;
        for(int i=0;i<n;i++){
                cin>>r;
                cin>>m;
                for(int j=0;j<m;j++){
                        cin>>k;
                        a[r-1][k-1] = 1;
                }
        }
        for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                        cout<<a[i][j];
                        if(j<n-1) cout<<" ";
                        else cout<<endl;
                }
        }
        return 0;
}


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

void readV(T...)(ref T t){auto r=readln.splitter;foreach(ref v;t){v=r.front.to!(typeof(v));r.popFront;}}
void readA(T)(size_t n,ref T t){t=new T(n);auto r=readln.splitter;foreach(ref v;t){v=r.front.to!(ElementType!T);r.popFront;}}
void readM(T...)(size_t n,ref T t){foreach(ref v;t)v=new typeof(v)(n);foreach(i;0..n){auto r=readln.splitter;foreach(ref v;t){v[i]=r.front.to!(ElementType!(typeof(v)));r.popFront;}}}
void readS(T)(size_t n,ref T t){t=new T(n);foreach(ref v;t){auto r=readln.splitter;foreach(ref j;v.tupleof){j=r.front.to!(typeof(j));r.popFront;}}}

void main()
{
  int a, b; readV(a, b);
  writeln(a*b%2 == 0 ? "Even" : "Odd");
}


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

using namespace std;

mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
typedef long long ll;
typedef long double ld;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<ll> a(n);
  for (auto &x : a) {
    cin >> x;
    if (x == 0) {
      cout << "0\n";
      return 0;
    }
  }
  ll p = 1;
  for (auto &x : a) {
    if (x > (ll) 1e18 / p) {
      cout << "-1\n";
      return 0;
    }
    p *= x;
  }
  cout << p << "\n";
  return 0;
}


Measured memory_bytes: 3976
def solve(string):
    n = len(string)

    def op(string, ans, forward=True):
        count = 0
        check, sign, base = ("R", 1, 0) if forward else ("L", -1, n - 1)
        for i, a in enumerate(string[::sign]):
            if a == check:
                count += 1
            elif count > 0:
                ans[base + sign * i] += count // 2
                ans[base + sign * (i - 1)] += (count + 1) // 2
                count = 0
        return ans

    ans = op(string, [0] * n, True)
    return " ".join([str(a) for a in op(string, ans, False)])


if __name__ == '__main__':
    print(solve(input()))


Measured memory_bytes: 10484
#include<stdio.h>

int main(void){


int a,b,c,d,e;


scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);


if(b>=d+e&&a>=c+e&&c-e>=0&&d-e>=0)


{printf("Yes\n");}


else{printf("No\n");}


return 0;


}

Measured memory_bytes: 584
#include <stdio.h>

int main(){

int a, b, c, temp;
scanf("%d %d %d", &a, &b, &c);
if(a > b){
	temp = a;
  a = b;
  b = temp;
}
if(b > c){
	temp = b;
  b = c;
  c = temp;
}
if(a > b){
  temp = a;
  a = b;
  b = temp;
}

  printf("%d %d %d\n", a, b, c);

  return 0;
  

}

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

#define LL long long
typedef pair<int, int> pii;

template< typename T > inline void read(T &x)
{
    static char _c;
    static bool _f;

    x = 0;
    _f = 0;
    _c = getchar();

    while(_c < '0' || '9' < _c) {if(_c == '-') _f = true; _c = getchar();}
    while('0' <= _c && _c <= '9') {x = (x << 1) + (x << 3) + (_c & 15); _c = getchar();}
    if(_f) x = -x;
}

template < typename T > inline void Min(T &x, T y) {if(y < x) x = y;}
template < typename T > inline void Max(T &x, T y) {if(x < y) x = y;}


#define lowbit(x) ((x) & -(x))
#define lson l,mid,id<<1
#define rson mid+1,r,id<<1|1
#define ls id<<1
#define rs id<<1|1
#define MID(l,r) ((l)+(((r)-(l))>>1))
#define fi first
#define se second
#define mk make_pair
#define pb push_back

const int INF = 0x3f3f3f3f;
const double pi = (double) acos(-1.0);
const double eps = (double) 1e-8;
//const int MOD = (int) 1e9 + 7;
//const int MOD = (int) 998244353;
int MOD = 998244353;
const int maxn = (int) 1e5 + 20;
const int maxm = (int) 1e6 + 20;

inline int sig(double x) {return x < -eps ? -1 : eps < x;}
LL fp(LL a, LL n, LL mod = MOD)
{
    if(n < 0) a = fp(a, mod - 2, mod), n = -n;
    LL res = 1; for(; n; n >>= 1, a = a * a % mod) if(n & 1) res = res * a % mod; return res;
}

struct Mint
{
    LL x;
    Mint() {x = 0;}
    Mint(int _x): x(_x) {}
    Mint(LL _x): x(_x) {}
    Mint operator - () const{
        return Mint(MOD - x);
    }
    Mint operator + (const Mint &rhs) const{
        LL res = x + rhs.x; if(res >= MOD) res -= MOD; return Mint(res);
    }
    Mint operator - (const Mint &rhs) const{
        LL res = x - rhs.x; if(res < 0) res += MOD; return Mint(res);
    }
    Mint operator * (const Mint &rhs) const{
        return Mint(x * rhs.x % MOD);
    }
    Mint operator / (const Mint &rhs) const{
        return Mint(x * fp(rhs.x, -1) % MOD);
    }
    bool operator == (const Mint &rhs) const{
        return x == rhs.x;
    }
    bool operator != (const Mint &rhs) const{
        return x != rhs.x;
    }
    friend ostream& operator << (ostream &out, const Mint &rhs){
        return out << rhs.x;
    }
    friend istream& operator >> (istream &in, Mint &rhs){
        return in >> rhs.x;
    }
};

void work()
{
    LL n, m;
    cin >>n >>m;

    LL res = n % m;

    cout <<min(res, m - res) <<endl;
}


int main(int argc, char **argv)
{
#ifdef yukihana0416
freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#endif // yukihana0416
//    get_prime();
//    pre();
    int tc = 1;
//    read(tc);
    for(int ca = 1; ca <= tc; ca++)
    {
//        printf("Case #%d: ", ca);
        work();
    }
    return 0;
}


Measured memory_bytes: 256
/**
 * File    : C.cpp
 * Author  : Kazune Takahashi
 * Created : 2018-8-11 21:03:52
 * Powered by Visual Studio Code
 */

#include <iostream>
#include <iomanip>   // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple>
#include <queue>
#include <stack>
#include <map> // if (M.find(key) != M.end()) { }
#include <set>
#include <functional>
#include <random> // auto rd = bind(uniform_int_distribution<int>(0, 9), mt19937(19920725));
#include <chrono> // std::chrono::system_clock::time_point start_time, end_time;
// start = std::chrono::system_clock::now();
// double elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end_time-start_time).count();
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;

#define DEBUG 0 // change 0 -> 1 if we need debug.

typedef long long ll;

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

// const int C = 1e6+10;
// const ll M = 1000000007;

ll N;

int main()
{
  cin >> N;
  bool bit[40];
  fill(bit, bit + 40, false);
  for (auto k = 0; k < 32; k++)
  {
    ll x = (1 << k);
    ll y = 2 * x;
    if (N % y != 0)
    {
      bit[k] = true;
      if (k % 2 == 0)
      {
        N -= x;
      }
      else
      {
        N += x;
      }
    }
    else
    {
      bit[k] = false;
    }
    if (N == 0)
    {
      break;
    }
  }
  int K = 0;
  for (int i = 40 - 1; i >= 0; i--)
  {
    if (bit[i])
    {
      K = i;
      break;
    }
  }
  string S = "";
  for (auto i = 0; i <= K; i++)
  {
    if (bit[i])
    {
      S = "1" + S;
    }
    else
    {
      S = "0" + S;
    }
  }
  cout << S << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
typedef long long ll;


int main()
{
    int n,r;
    scanf("%d %d",&n,&r);

    if(n<10)
    {
        r=r+100*(10-n);
    }
    
    printf("%d\n",r);


    return 0;
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int a, b, c;
    cin >> a >> b >> c;
    if ((a <= c && c <= b) || (a >= c && b <= c)) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}



Measured memory_bytes: 256