akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
  public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

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

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

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}


void solve(long long A, long long B){
    cout << max(0LL,A-2*B) << endl;
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(A, B);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <deque>
#include <iomanip>
using namespace std;
#define MM 1000000000
#define MOD MM+7
#define pi pair<int32,int32>
#define pl pair<int64,int64>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
template<typename T>
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T>
T lcm(T x,T y){
    return x*y/GCD(x,y);
}
long long Pow(long long base,long long x){
    if (x == 0) return 1;
    if (x%2 == 1) return (base*Pow(base,x-1))%MOD;
    long long y = Pow(base, x/2);
    return y*y%MOD;
}

int main(){
    long long n; cin >> n;
    set<long long> St;
    for(int i = 0; i < n; i++){
        long long N,x;
        cin >> N >> x;
        if (N == 0){
            St.insert(x);
            cout << St.size() << endl;
        } else {
            cout << St.count(x) << endl;
        }
    }
}
  




Measured memory_bytes: 12464
import sys
class BIT():
    def __init__(self,number):
        self.n=number
        self.list=[0]*(number+1)
        
    def add(self,i,x):#ith added x  1indexed
        while i<=self.n:
            self.list[i]+=x
            i+=i&-i
            
    def search(self,i):#1-i sum
        s=0
        while i>0:
            s+=self.list[i]
            i-=i&-i
        return s
    
    def suma(self,i,j):#i,i+1,..j sum
        return self.search(j)-self.search(i-1)
#from collections import defaultdict
S=input()
N = len(S)
L = 26
a = ord('a')
d = [[] for i in range(L)]
for i in range(N):
    s=ord(S[i])-a
    d[s].append(i)
flag=0
for i in range(L):
    if len(d[i])%2==1:
        flag+=1
if flag>1:
    print(-1)
    sys.exit()
Suc=[-1]*N
pairs=[]
for i in range(L):
    T=len(d[i])
    for s in range((T//2)):
        li,ri=d[i][s],d[i][-s-1]
        pairs.append((li,ri))
    if T%2==1:
        Suc[d[i][T//2]]=(N//2)+1
pairs.sort()
for i, (li,ri) in enumerate(pairs):
    Suc[li]=i+1
    Suc[ri]=N-i
Tree=BIT(N+3)
ans=0
for i,m in enumerate(Suc):
    ans+=i-Tree.search(m)
    Tree.add(m,1)
#ans+=Tree.search(N+1)
print(ans)

Measured memory_bytes: 54880
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
//#include <bits/stdc++.h>

#define all(v) v.begin(), v.end()
typedef long long ll;
#define rep(i, z, n) for(ll i = z; i < n; i++)
//const int INF = 1<<29;
//const ll MOD = 1000000007;
using namespace std;

int main(){
    int N, X, T;
    cin >> N >> X >> T;
    cout << ((N + X - 1) / X) * T << endl;
}

Measured memory_bytes: 3616
import java.util.Scanner;

public class Main{

public static void main(String[] args){

		int A1;
  	int A2;
  int A3;
  
  Scanner sc=new Scanner(System.in);
  
  A1=sc.nextInt();
  A2=sc.nextInt();
  A3=sc.nextInt();
  
  if(A1+A2+A3 >= 22)
    System.out.println("bust");
  else
    System.out.println("win");
  		
	}
}


Measured memory_bytes: 20816
fn main() {
    let cin = std::io::stdin();
    let mut sc = Scanner { stdin: cin.lock() };

    let n: usize = sc.read();
    let x: u32 = sc.read();
    let l: Vec<u32> = sc.vec(n);

    let mut bound = 1;
    let mut d = 0;
    for i in 0..n {
        d += l[i];
        if d > x {
            break;
        }
        bound += 1;
    }
    println!("{}", bound);
}

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 token = self
            .stdin
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok().expect("token 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: 4352
#include <bits/stdc++.h>
using namespace std;

// a quote from http://www.igaris.com/math/c.pdf

#define MOD (1000000000+7)

long long C[1001][1001];

long long power( long long x, int n )
{
	if( n == 0 ) {
		return 1;
	}
	if( n % 2 ) {
		return x * power( x, n - 1 ) % MOD;
	}
	else {
		return power( x * x % MOD, n / 2 );
	}
}

long long ifac( long long x )
{
	long long f = 1;
	while( x > 1 ) {
		f *= power( x, MOD - 2 );
		f %= MOD;
		x--;
	}
	return f;
}

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

	// Pascal's triangle for combination
	C[0][0] = 1;
	for( int i = 1; i < 1001; i++ ) {
		for( int j = 0; j <= i; j++ ) {
			if( j == 0 || j == i ) {
				C[i][j] = C[i - 1][0];
			}
			else {
				C[i][j] = ( C[i - 1][j - 1] + C[i - 1][j] ) % MOD;
			}
		}
	}

	if( k > n ) {
		k = n;
	}
	long long ans = 0;
	for( int i = 1; i <= k; i++ ) {
		long long ans1 = 0;
		for( int j = 1; j <= i; j++ ) {
			ans1 += power( -1, i - j ) * C[i][j] * power( j, n ) % MOD;
			ans1 %= MOD;
			if( ans1 < 0 ) {
				ans1 += MOD;
			}
		}
		ans += ans1 * ifac( i );
		ans %= MOD;
	}

	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 10004
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,k;	cin >> n >> k;
  vector<int>	data(n);
  for(int i=0;i<k;i++){
    int d;	cin >> d;
    for(int j=0;j<d;j++){
      int a;	cin >> a;	a--;
      data.at(a)++;
    }
  }
  cout << count(data.begin(),data.end(),0);
}

Measured memory_bytes: 3632
#include<iostream>
#include<set>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>

using namespace std;

inline int read()
{
	int x=0;char ch=getchar();
	while(ch<'0' || '9'<ch)ch=getchar();
	while('0'<=ch && ch<='9')x=x*10+(ch^48),ch=getchar();
	return x;
}

const int N=200009;

long long ans;
int n,a[N],ha[N];
set<int> f,b;
typedef set<int>::iterator it;

int main()
{
	n=read();
	for(int i=1;i<=n;i++)
		a[i]=read(),ha[a[i]]=i;
	it tmp;
	for(int i=1,l,r;i<=n;i++)
	{
		tmp=f.upper_bound(n-ha[i]+1);
		if(tmp!=f.end())l=n-(*tmp)+2;
		else l=1;
		f.insert(n-ha[i]+1);

		tmp=b.upper_bound(ha[i]);
		if(tmp!=b.end())r=(*tmp)-1;
		else r=n;
		b.insert(ha[i]);

		ans+=(long long)(ha[i]-l+1)*(r-ha[i]+1)*i;
	}

	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 20608
#include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <cmath>
#define INF 100000000000000
using namespace std;
typedef long long llong;

//int isalpha(char ch): ch がアルファベットなら true を返す
//int isdigit(char ch): ch が数字なら true を返す
//int islower(char ch): ch が小文字なら true を返す
//int isupper(char ch): ch が大文字なら true を返す
//int tolower(char ch): ch の小文字を返す
//int toupper(char ch): ch の大文字を返す

//string型
//size()	文字数を返す
//insert()	（指定した場所に）文字・文字列を挿入する
//erase()	（指定した場所の）文字・文字列を削除する
//clear()	すべての文字を削除する
//substr()	文字列の（指定した）部分文字列を返す
//replace()	（指定した）部分文字列を新しい文字列に置換する
//文字列の比較は、<=や==などを使え
//replace関数を使い、簡単に文字列を置換
//リバース関数：reverse(str.begin(), str.end());
//map<type, type> dict;で宣言
//グラフ理論用変数
//vector<vector<llong> > graph(N);

//ソート
//降順sort(v.begin(), v.end(), std::greater<Type>());

int main(){
    llong ans=0;
    llong N,K,X,Y;
    cin >> N >> K >> X >> Y;
    if(K>N){
        for(int i=0; i<N; i++){
            ans = ans + X;
        }
        cout << ans << endl;
        exit(0);
    }
    for(int i=0; i<K; i++){
        ans = ans + X;
    }
    for(int i=K; i<N; i++){
        ans = ans + Y;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3156
N, Q = map(int, input().split())
tree = [[] for i in range(N)]

for i in range(N-1):
  a, b = map(int, input().split())
  tree[a-1].extend([b])

nodes = [0]*N
for _ in range(Q):
  p, x = map(int, input().split())
  nodes[p-1]+=x

for i in range(N-1):
  for j in tree[i]:
    nodes[j-1]+=nodes[i]
print(" ".join(list(map(str, nodes))))

Measured memory_bytes: 58924
#include <iostream>
#include <vector>
#include <set>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<string> s(n);
  for(int i=0;i<n;i++) cin >> s[i];

  set<string> st;
  for(int i=0;i<n;i++){
    auto itr = st.find(s[i]);
    if(itr == st.end()){
      st.insert(s[i]);
    }
  }

  cout << st.size() << endl;

}


Measured memory_bytes: 25108
#include<stdio.h>
#define MAX 100000
#define NIL -1

struct Node{ int p, l, r, R, L;};
struct Node T[MAX];

void print(int u){
  
  int i = T[u].p, depth = 0, height, j = T[u].R, sibling = NIL, degree = 0;

  while(i != NIL){
    i = T[i].p;
    depth++;
  }

  height = Height(u, 0);  


  if(T[u].L == NIL && T[u].r != NIL){
    sibling = T[u].r;
  }else if(T[u].L != NIL && T[u].r == NIL){
    sibling = T[u].L;
  }

  if(T[u].l == NIL && T[u].R == NIL){
    degree = 0;
  }else if(T[u].l == NIL || T[u].R == NIL){
    degree = 1;
  }else if(T[u].l != NIL && T[u].R != NIL){
    degree = 2;
  }

  if(depth == 0){
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, root\n", u, T[u].p,  sibling, degree, depth, height);
  } else if(T[u].l == NIL && T[u].R == NIL){
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, leaf\n", u, T[u].p, sibling, degree, depth, height);
  }else{
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, internal node\n", u, T[u].p, sibling, degree, depth, height);  
  }
}



int Height(int a, int count){
  
  int x , y;
  x=y=count;
  if(T[a].l != NIL) x = Height(T[a].l, count+1);
  if(T[a].R != NIL) y = Height(T[a].R, count+1);
  
  if(x < y )x = y; 
  return x;
  
} 

main(){
  int i, j, temp1, temp2, temp3, n;

  scanf("%d", &n);

  for ( i = 0; i < n; i++ ) {
    T[i].p = T[i].l = T[i].r = T[i].L = T[i].R = NIL;
  }
  
  for ( i = 0; i < n; i++ ){
    scanf("%d %d %d", &temp1, &temp2, &temp3);
    T[temp1].l = temp2;
    T[temp3].L = temp2;
    T[temp1].R = temp3;
    T[temp2].r = temp3;
    T[temp2].p = temp1;
    T[temp3].p = temp1;
  }

  for ( i = 0; i < n; i++ ) print(i);
  return 0;
}

Measured memory_bytes: 600
Module Program
  Sub Main
    Dim s=GetInts()(0)
    Dim t=GetInts()(0)
    Dim ans=t*2-s
    Console.WriteLine(ans)
  End Sub
  
  '/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  Function Gets() As String()
    Gets = Console.ReadLine().Split(" "c)
  End Function
  Function GetInts() As Integer()
    Dim s = Gets(), r(UBound(s)) As Integer
    For i As Integer=0 To UBound(s): r(i)=s(i): Next i
    GetInts = r
  End Function
End Module

Measured memory_bytes: 22352
import std.stdio;
import std.algorithm;
import std.string;
import std.functional;
import std.array;
import std.conv;
import std.math;
import std.typecons;
import std.regex;
import std.range;

Tuple!(int,string)[] insort(Tuple!(int,string)[] arr){
    for(int i=1;i<arr.length;i++){
	int j = i;
	while(arr[j][0] > arr[j-1][0]){
	    swap(arr[j],arr[j-1]);
	    j--;
	    if(j==0) break;
	}
    }
    return arr;
}

void main(){

    int n =readln().chomp().to!int;
    while(true){
	Tuple!(int,string)[] list;
	for(int i=0;i<n;i++){
	    auto s = readln().split();
	    list ~= tuple( to!int(s[1])*3 + to!int(s[3]),s[0]);
	}
	list = insort(list);
	foreach(i;list) writeln(i[1],",",i[0]);
	n =readln().chomp().to!int;
	if(n==0)break;
	writeln();
    }

}

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

int main(){
  int a1, a2, a3;
  cin >> a1 >> a2 >> a3;

  cout << (a1+a2+a3 <= 21 ? "win" : "bust") << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
// #include<iostream>
// #include<string>
// #include<vector>
// #include<set>
// #include<map>
// #include<algorithm>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;

#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0)
#define END return EXIT_SUCCESS
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define IN4(P1,P2,P3,P4) cin>>(P1)>>(P2)>>(P3)>>(P4)
#define INS(I,N,V) REP((I),(N))cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N))cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N))cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUT4(P1,P2,P3,P4) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<" "<<(P4)<<endl
#define OUTS(I,N,V) REP((I),(N))cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

cpp_int N,M,i,A,B,sum,ans;
vector<pair<cpp_int,cpp_int>>C;
inline void solve(void){
  IN2(N,M);
  REP(i,N){
    IN2(A,B);
    C.pb(mp(A,B));
  }
  sort(ALL(C));
  for(auto e:C){
    if(e.second+sum<=M){
      ans+=e.first*e.second;
      sum+=e.second;
    }else if(e.second+sum>M&&M-sum<=e.second){
      ans+=(M-sum)*e.first;
      sum+=M-sum;
    }
    if(sum==M)break;
  }
  OUT(ans);
}

int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


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

signed main(){
	int a, b, c, d;
	scanf("%d%d%d%d", &a, &b, &c, &d);
	if(abs(a - c) <= d || (abs(a - b) <= d && abs(b - c) <= d)){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 3704
/*
 * cpp_filepath
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> ostream & operator << (ostream & out, vector<T> const & v) {
  for (auto &&a: v) out << a << " "; out << endl; return out;
}
template <class T> void dump(T &a) { cout << a << endl; }
void solve();
int main() { solve(); return 0; }


void solve() {
  double a, b;
  cin >> a >> b;
  cout << (int)ceil((a+b)/2) << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
	int n, k;
	int num = 1;
	
	cin >> n >> k;
	
	while (n > 0) {
		if (num < k) {
			num *= 2;
		}
		else {
			num += k;
		}
		n--;
	}
	
	cout << num << endl;
	
	return (0);
}

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

#define int long long
#define uint unsigned int
#define pii pair<int, int>
#define fi first
#define se second

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a); i >= (b); --i)
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) FORR(i, n, 0)
#define ALL(a) (a).begin(), (a).end()
#define SZ(a) ((int)(a).size())

#define PF(a) push_front(a)
#define PB(a) push_back(a)
#define EMPF(...) emplace_front(__VA_ARGS__)
#define EMPB(...) emplace_back(__VA_ARGS__)
#define EMP(...) emplace(__VA_ARGS__)
#define MP(a, b) make_pair(a, b)
#define MT(...) make_tuple(__VA_ARGS__)

#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, -1, sizeof(a))

#define PW(n) (1LL << (n))
#define NUM(x) char(x + '0')
#define ALP(x) char(x + 'a')

using namespace std;

template <class T> inline bool CHMIN(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template <class T> inline bool CHMAX(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> void SORT(vector<T> &a) { sort(a.begin(), a.end()); }
template <class T> void SORTR(vector<T> &a) { sort(a.rbegin(), a.rend()); }
template <class T> void UNIQUE(vector<T> &a) { a.erase(unique(a.begin(), a.end()), a.end()); }

template <class S, class T> ostream& operator << (ostream& os, const pair<S, T> v) {
  os << "(" << v.first << ", " << v.second << ")"; return os;
}

const int MOD = 1000000007;
const int INF = 1LL << 30;
const double EPS = 1e-10;

/* ---------------------------------------------------------------------------------------------------- */

int N, M;
int cnt[30];

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> N >> M;
  REP(i, N) {
    int K; cin >> K;
    REP(j, K) {
      int A; cin >> A;
      cnt[A-1]++;
    }
  }
  int ans = 0;
  REP(i, M) {
    ans += (cnt[i] == N);
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

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

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

    vector<int> cnt(n, 0), over(n+1, 0);
    for(int i=0; i<n; i++){
        cnt[a[i]]++;
        over[cnt[a[i]]]++;
    }

    vector<ll> sum(n+1, 0);
    for(int i=1; i<=n; i++){
        sum[i] = sum[i-1] + over[i];
    }

    for(ll K=1; K<=n; K++){
        ll ok = 0, ng = n + 1;
        while(ng - ok > 1){
            int mid = (ok + ng) / 2;
            if(sum[mid] >= K * mid) ok = mid;
            else ng = mid;
        }

        cout << ok << endl;
    }

    return 0;
}

Measured memory_bytes: 6784
import math


def main():
    a, b, x = map(int, input().split())
    # 水平時の高さを求める
    h = x / a ** 2
    rad = 0
    if h >= (b / 2):
        # 高さが半分以上
        # 水のない三角形部分の高さを求める
        u = (a * a * b - x) * 2 / a ** 2
        rad = math.atan(u / a)
    else:
        # 高さが半分以下
        # 水部分の三角形の高さを求める
        u = x / (b * a) * 2
        rad = math.atan(b / u)
    # ラジアンから度数へ変換
    print(math.degrees(rad))


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+10;
int n,a[N];
vector<int> e[N];
ll res[N];
void dfs(int x,int fa){
	res[x]=(e[x].size()>1?2*a[x]:a[x]);
	ll Max=0;
	for (int i=0;i<e[x].size();i++){
		int v=e[x][i];
		if (v==fa) continue;
		dfs(v,x);
		res[x]-=res[v];
		Max=max(Max,res[v]);
	}
	if (res[x]<0) puts("NO"),exit(0);
	if (!fa&&res[x]) puts("NO"),exit(0);
	Max=max(Max,res[x]);
	if (Max>a[x]) puts("NO"),exit(0);
}
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	for (int i=1;i<n;i++){
		int u,v;
		scanf("%d%d",&u,&v);
		e[u].push_back(v);
		e[v].push_back(u);
	}
	dfs(1,0);
	puts("YES");
	return 0;
}

Measured memory_bytes: 15872
# coding: utf-8
l,r = map(int, input().split())

if r < 2019:
    ans = float("inf")
    for i in range(l,r):
        for j in range(i+1,r+1):
            mod = (i*j)%2019
            if mod < ans:
                ans = mod
    print(ans)
elif l%2019==0 or r%2019==0:
    print(0)
elif l//2019 < r//2019:
    print(0)
else:
    ans = float("inf")
    for i in range(l,r):
        for j in range(i+1,r+1):
            mod = (i*j)%2019
            if mod < ans:
                ans = mod
    print(ans)

    


Measured memory_bytes: 3064
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int[] a = new int[n];
        Arrays.setAll(a, i -> scanner.nextInt());
        Arrays.sort(a);
        int alice = 0;
        int bob = 0;
        for (int i = 0; i < n; i++) {
            if (i % 2 == n % 2) {
                bob += a[i];
            } else {
                alice += a[i];
            }
        }
        System.out.println(alice - bob);
    }
}

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

int main() 
{
    double a, b, x;
    cin >> a >> b >> x;
    double rad;

    if (2*x < a*a*b) {
        rad = atan2(b, 2*x/(a*b));
    } else {
        rad = atan2(2*b - 2*x /(a*a), a); 
    }

    double ans = rad * 180 / M_PI;

    printf("%.8f\n", ans);

    return 0;
}


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

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    if(max({a,b,c}) == 7
    && min({a,b,c}) == 5
    && a+b+c-12 == 5) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}


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

template<int N, typename T, T M>
struct factorial_mod
{
	T mod[N + 1];
	T inv_mod[N + 1];

	constexpr factorial_mod() : mod(), inv_mod()
	{
		mod[0] = 1;
		for (int i = 0; i < N; ++i)
		{
			mod[i + 1] = (mod[i] * (i + 1)) % M;
		}
		inv_mod[N] = power(mod[N], M - 2);
		for (int i = N - 1; i >= 0; --i)
		{
			inv_mod[i] = (inv_mod[i + 1] * (i + 1)) % M;
		}
	}

	constexpr T power(T a, T b) const
	{
		T r = 1;
		while (b > 0)
		{
			if ((b & 1) != 0) r = (r * a) % M;
			a = (a * a) % M;
			b >>= 1;
		}
		return r;
	}

	constexpr T comb(T n, T r) const
	{
		if (r < 0 || r > n || n < 0) return 0;
		return (((mod[n] * inv_mod[r]) % M) * inv_mod[n - r]) % M;
	}

	constexpr T H(T n, T r) const
	{
		return comb(n + r - 1, r);
	}
};

constexpr long long MOD = 998244353;
factorial_mod<500000, long long, MOD> fmod;

template<typename T>
constexpr T pow_mod(T a, T b, T m)
{
	T r = 1;
	while (b > 0)
	{
		if ((b & 1) != 0) r = (r * a) % m;
		a = (a * a) % m;
		b >>= 1;
	}
	return r;
}

int main()
{
	long long n, m, k;
	scanf("%lld%lld%lld", &n, &m, &k);

	long long ans = 0;
	for (int i = 0; i <= k; ++i)
	{
		long long nn = n - i;
		long long pos = fmod.comb(n - 1, i);
		long long col = m * pow_mod(m - 1, nn - 1, MOD) % MOD;
		ans = (ans + pos * col) % MOD;
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 9520
#include<iostream>
using namespace std;
int main()
{
        int A,B,C,D,P;
        cin >> A;
        cin >> B;
        cin >> C;
        cin >> D;
        cin >> P;
        int x,y;
        x = A*P;
        if (P<=C) y = B;
        else y = B + (P-C)*D;
        if (x<y) cout <<x <<endl;
        else cout << y <<endl;
        return 0;
}

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

using namespace std;

typedef long long LL;
typedef unsigned long long uLL;
typedef long double ldb;
typedef pair<int,int> pii;

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n;
    cin>>n;
    int p,c;
    cin>>p;
    int ans = 0;
    while(cin>>c)
    {
        if(c == p)
            ++ans, c = 0;
        p = c;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <cstdlib>
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MAX 100005
#define pb push_back
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const double PI  =3.141592653589793238463;
long long MOD = 1000000007;

int stringToInteger(string x){
    int gg=0;
    //stringstream geek(x);
    //geek >> gg;
    return gg;
}

ll powmod(ll a,ll b,ll m)
{
    ll ans=1;
    while(b>0){ if(b%2)
        {ans*=a; ans%=m;}
         b/=2; a=a*a; a=a%m;
        }
        return ans%m;
}
ll gcd(ll a,ll b)
{

    return __gcd(a,b);
}
ll mulmod(ll a,ll b,ll m)
{  ll ans=0;
    a %=m;
    while (b>0)
    {       if(b&1) ans = (ans + a) % m;
        a = (a * 2)%m;
        b /= 2;
    }
    return ans % m;
}

ll pow(ll a, ll b, ll MOD)
{
 ll x=1,y=a;
 while(b > 0)
 	{
 		if(b%2 == 1)
 	{
 		x=(x*y);
 		if(x>MOD) x%=MOD;
 	}
 	y = (y*y);
 	if(y>MOD) y%=MOD;
 	b /= 2;
 	}
 return x;
}
ll modInverse(ll a, ll m)
{
    a = a%m;
    for (int x=1; x<m; x++)
       if ((a*x) % m == 1)
          return x;
}
ll maxDivide(ll a, ll b)
{
  while (a%b == 0)
   a = a/b;
  return a;
}
  set<ll>ans;
void primeFactors(ll n)
{

    while (n % 2 == 0)
    {
       ans.insert(2);
        n = n/2;
    }

    for (ll i = 3; i <= sqrt(n); i = i + 2)
    {
        // While i divides n, print i and divide n
        while (n % i == 0)
        {
            ans.insert(i);
            n = n/i;
        }
    }

    // This condition is to handle the case when n
    // is a prime number greater than 2
    if (n > 2)
        ans.insert(n);
}
ll is(ll no)
{   if(no==1) return 0;
    set<ll>::iterator it;
for(it=ans.begin();it!=ans.end();it++){
  no = maxDivide(no, *it);
  if(no==1) return 1;
//  if()
 // no = maxDivide(no, 3);
 // no = maxDivide(no, 5);
}
//if(no==1) return 1;
//for(it=ans.begin();it!=ans.end();it++){
//if(no==*it) return 1;
//}
  return 0;
}

int comp(string a,string b)
{
    string aa = a.append(b);
    string bb = b.append(a);

    return aa.compare(bb) > 0 ? 1: 0;

}
int main()
{
    int n ,k;
    cin>>n>>k;
    string s;
    cin>>s;
    s[k-1]=(s[k-1]-'A')+'a';
    cout<<s<<endl;
}


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

int main()
{
  int N, sum = 0, ans = 0;
  cin >> N;
  long H[N];

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

  for (int i = 0; i < N; i++)
  {
    if (H[i] >= H[i + 1])
    {
      sum++;
    }
    else
    {
      sum = 0;
    }

    if (ans < sum)
    {
      ans = sum;
    }
  }
  cout << ans << endl;
}


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

void Main() {
  int n;
  string s, t;

  cin >> n;
  cin >> s >> t;

  for (int i = 0; i < n; i++) {
    cout << s[i] << t[i];
  }
  cout << endl;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(X, S, E) for (int(X) = (S); (X) < (E); ++(X))
#define rrep(X, S, E) for (int(X) = (E)-1; (X) >= (S); --(X))
#define itrep(X, Y) for (auto(X) = (Y).begin(); (X) != (Y).end(); (X)++)
#define all(X) (X).begin(), (X).end()
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define print(x) cout << x << endl

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef priority_queue<ll, vl> decendingQueue;              //降順
typedef priority_queue<ll, vl, greater<ll>> ascendingQueue; //昇順
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll INF = 9 * 1e18;

const long long MOD = 1000000007;

void solve(string L) {
  vector<vl> dp(L.size(), vl(2));
  dp[0][0] = 1;
  dp[0][1] = 2;

  rep(i, 1, L.size()) {
    if (L[i] == '0') {
      dp[i][0] = dp[i - 1][0] * 3 % MOD;
      dp[i][1] = dp[i - 1][1];
    } else {
      dp[i][0] = (dp[i - 1][0] * 3 + dp[i - 1][1]) % MOD;
      dp[i][1] = dp[i - 1][1] * 2 % MOD;
    }
  }

  print((dp[L.size() - 1][0] + dp[L.size() - 1][1]) % MOD);
}

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


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

int h[100010];

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

    int count = 0;
    int ans = 0;

    for (int i = 0; i < n - 1; ++i){
        if(h[i + 1] == 0) continue;

        if(h[i + 1] <= h[i]){
            count++;
        }
        else{
            ans = std::max(ans, count);
            count = 0;
        }
    }

    ans = std::max(ans, count);

    cout << ans << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include <algorithm>
#include<string>
#include<cmath>
#include <functional>
using namespace std;

int main(void) {
	int ans1 = 0, ans2 = 0;;
	string S;
	int H[100] = { 0 };

	cin >>S;
	//先頭が0
	for (int i = 0; i < S.length();i++) {
		if (i % 2 == 0 && S[i] == '0')
			ans1++;
		if (i % 2 == 1 && S[i] == '1')
			ans1++;
	}
	//1
	for (int i = 0; i < S.length();i++) {
		if (i % 2 == 0 && S[i] == '1')
			ans2++;
		if (i % 2 == 1 && S[i] == '0')
			ans2++;
	}
	cout << min(ans1,ans2) << endl;
	return 0;
}

Measured memory_bytes: 512
#define DEBUG 0

#include <bits/stdc++.h>
using namespace std;

#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;}
#define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;}

// advanced debugging class
// debug 1,2,'A',"test";
class _Debug {
    public:
        template<typename T>
        _Debug& operator,(T val) {
            cout << val << endl;
            return *this;
        }
};
#define debug _Debug(),
#else
#define printLine(l)
#define printLine2(l,c)
#define printVar(n)
#define printArr(a,l)
#define print2dArr(a,r,c)
#define print2dArr2(a,r,c,l)
#define debug
#endif

// define
#define MAX_VAL 999999999
#define MAX_VAL_2 999999999999999999LL
#define EPS 1e-6
#define mp make_pair
#define pb push_back

// typedef
typedef unsigned int UI;
typedef long long int LLI;
typedef unsigned long long int ULLI;
typedef unsigned short int US;
typedef pair<int,int> pii;
typedef pair<LLI,LLI> plli;
typedef vector<int> vi;
typedef vector<LLI> vlli;
typedef vector<pii> vpii;
typedef vector<plli> vplli;

// ---------- END OF TEMPLATE ----------

int A[100];
int main() {
    int i;
    int N,M;
    scanf("%d %d",&N,&M);
    for (i = 0; i < M; i++) scanf("%d",&A[i]);

    int c = 0;
    for (i = 0; i < M; i++) {
        if (A[i] & 1) c++;
    }
    if (c > 2) printf("Impossible\n");
    else {
        for (i = 1; i < M-1; i++) {
            if (A[i] & 1) {
                if (A[0] & 1) swap(A[M-1],A[i]);
                else swap(A[0],A[i]);
            }
        }
        for (i = 0; i < M; i++) printf("%d ",A[i]);
        if (M == 1) {
            if (N == 1) printf("\n1\n1\n");
            else printf("\n2\n%d 1\n",N-1);
        }
        else {
            printf("\n%d\n",(A[M-1] == 1) ? M-1:M);
            for (i = 0; i < M; i++) {
                if (i == 0) printf("%d ",A[i]+1);
                else if (i == M-1) {
                    if (A[i] > 1) printf("%d ",A[i]-1);
                }
                else printf("%d ",A[i]);
            }
            printf("\n");
        }
    }

    return 0;
}



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

int main() {
	int N, A[1000],count=0,count2=0;
	cin >> N;

	while (count < N) {
		cin >> A[count];
		count++;
	}

	for (int i = 0; i <= N-1; i++) {
		if (A[i] % 2 == 0) {
			if (A[i] % 3 == 0 || A[i] % 5 == 0) {
			}
			else {
				count2++;
			}
		}
	}
	if (count2 > 0) {
		cout << "DENIED" << endl;
	}
	else {
		cout << "APPROVED" << endl;
	}
}

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

#define ll long long 
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ar array
#define MOD 1000000007
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll len; cin >> len;
	string s; cin >> s;
	ll r = 0, w = 0;
	for (auto x: s) {
		if (x == 'R') r++;
		else w++;
	}
	ll ans = 0;
	for (int i = 0; i < r; ++i) {
		ans += (s[i] != 'R');
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 3752
use proconio::input;
use proconio::fastout;

#[fastout]
fn main() {
    input! {
        d: u128,
        t: u128,
        s: u128,
    }

    let yes = d/s < t || (d/s == t && d%s ==0) ;
        
   
    
    println!("{}", if yes { "Yes" } else { "No" });
}


Measured memory_bytes: 2136
function main()
  
  K = parse(Int,readline())
  
  n = 0
  m = 0
  
  for i in 1:K
    
    if i % 2 == 0
      n += 1
    else
      m += 1
    end
    
  end
  
  println(n*m)
  
end

main()

Measured memory_bytes: 111336
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch Transfer | diff Transfer.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address Transfer.cpp && ./a.out

/*
 
 8/6/2019
 
 11:46-
 
 */

int A,B,C;

void solve() {
  cout<<max(0,C-(A-B))<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;
  
  cin>>A>>B>>C;
  solve();
  
  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String readline = br.readLine();

		String[] set = readline.split(" ");

		int W = Integer.parseInt(set[0]);
		int H = Integer.parseInt(set[1]);
		int x = Integer.parseInt(set[2]);
		int y = Integer.parseInt(set[3]);
		int r = Integer.parseInt(set[4]);

		if ((x-r>=0) && (y+r<=H) && (x+r<=W) && (y-r>=0)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

}

Measured memory_bytes: 24284
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */

signed main() {
	int h,n;
	std::cin >> h >> n;
	int sum = 0;
	rep(i,n) {
		int a;
		std::cin >> a;
		sum+=a;
	}
	if(sum>=h) print("Yes");
	else print("No");
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define rep(i,n) for(int i=0; i<(n); ++i)
#define per(i,n) for(int i=n-1;i>=0;++i)
#define rep1(i,n) for(int i=1; i<=n; ++i)
#define per1(i,n) for(int i=n; i>=1; ++i)
#define debug cout << "line : " << __LINE__ << " debug" << endl
#define Dcout(N) cout << setprecision(20) << N << endl
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ) //被り削除
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define INF 1e9
#define MOD 1000000007
typedef long long ll;
//------------------------------------------------------------------------

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

  int a,b; cin >> a >> b;
  rep(i,100000000){
    if(floor(i*0.08)==a && floor(i*0.1)==b){
      cout << i << endl;
      return 0;
    }
  }

  cout << -1 << endl;



  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{

    int A[5],a,b;
    cin>>a>>b;
    int op1 = a+b;
    int op2 = a-b;
    int op3 = a*b;
    A[0]=op1;
    A[1]=op2;
    A[2]=op3;
    sort(A,A+3);
    cout<<A[2]<<endl;
   return 0;
}


Measured memory_bytes: 256
#include<iostream>

int main(){
	int A, B;
	std::cin >> A >> B;

	A = A == 1 ? 100 : A;
	B = B == 1 ? 100 : B;

	auto ans = A == B ? "Draw" : A > B ? "Alice" : "Bob";
	std::cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define forp(i,a,b) for (int i = a; i <b; i++)
#define forn(i,a,b) for (int i = a; i >b; i--)
#define mod 1000000007
#define multiple_testcases_t int t;cin>>t;while(t--){solve();}
#define single_testcase_t solve();
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;


ll fact(ll n)
{
  if(n==0 || n==1)
  return 1;
  else
  return (n*fact(n-1)%mod)%mod;
}

int prime(ll n)
{
  for(int i=2;i<=sqrt(n);i++)
  {
    if(n%i==0)
    {
      return 0;
    }
  }
  return 1;
}

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

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

int check_palin(string s)
{
  string str=s;
  reverse(str.begin(),str.end());
  if(str==s)
  return 1;
  else
  return 0;
}

vector<ll> divisors(ll n)
{
  vector<ll> v;
  for(int i=2;i<=sqrt(n);i++)
  {
    if(n%i==0)
    {
      if(i==n/i)
      v.PB(i);
      else
      v.PB(i),v.PB(n/i);
    }
  }
return v;
}

ll bin_expo(int x,int n)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return bin_expo(x*x,n/2);
    else                             //n is odd
        return x*bin_expo(x*x,(n-1)/2);
}

ll modular_expo(int x,int n,int M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return modular_expo((x*x)%M,n/2,M);
    else                             //n is odd
        return (x*modular_expo((x*x)%M,(n-1)/2,M))%M;
}

ll kadane_algo(int a[],int n)
{
   ll max_so_far=0,max_ending_here=0;
   forp(i,0,n)
   {
     max_ending_here+=a[i];
     if(max_ending_here<0)
     max_ending_here=0;

     if(max_ending_here>max_so_far)
     max_so_far=max_ending_here;
   }

   return max_so_far;
}

// <----- Actual solve() function to print output -----> //
void solve()
{
   ll n,z=0,k,x,d,y;
cin>>x>>k>>d;
x=abs(x);
if(x>0)
{
    //cout<<k*d<<" ";
    n=x%d;
    z=x/d;   // x=z*d+n
if(z>=k)
    cout<<(z-k)*d+n;
else
{
    n=x%d;
    k-=x/d;

    if(k%2==0)
        cout<<n;
    else
        cout<<d-n;
}
}
else
{
   if(k*d<=abs(x))
    cout<<(x+k*d);
else
{
    n=abs(x)/d;
    x=x+n*d;
    k-=n;
    if(k%2==0)
        cout<<abs(x);
    else
        cout<<d-abs(x);
}
}
   //cout<<"\n";      //if t>1 uncomment this
}


// MAIN function --------------------------------------------------------------------------//
int main()
{
    fast_io
    single_testcase_t   //Uncomment this if only single testcase & single answer to print
   //multiple_testcases_t  //Uncomment this if t>1(t is given in question)(multiple testcases)
return 0;
}





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

const int INF = 1000000000;

int main()
{
	while(true){
		int n, m;
		cin >> n >> m;

		if(n==0 && m==0)
			break;

		int C[100][100];
		int T[100][100];
		for(int i=0; i<m; i++){
			for(int j=0; j<m; j++){
				if(i==j){
					C[i][j] = T[i][j] = 0;
				}
				else{
					C[i][j] = T[i][j] = INF;
				}
			}
		}

		for(int i=0; i<n; i++){
			int a, b, c, t;
			cin >> a >> b >> c >> t;

			C[a-1][b-1] = C[b-1][a-1] = c;
			T[a-1][b-1] = T[b-1][a-1] = t;
		}

		int N,p,q,r;
		int dt[100][100];
		int dc[100][100];
		for(int i=0;i<m;i++){
			for(int j=0;j<m;j++){
				dt[i][j]=T[i][j];
			}
		}
		for(int k=0;k<m;k++){
			for(int i=0;i<m;i++){
				for(int j=0;j<m;j++){
					if(dt[i][j]>dt[i][k]+dt[k][j]){
						dt[i][j]=dt[i][k]+dt[k][j];
					}
				}
			}
		} 
		for(int i=0;i<m;i++){
			for(int j=0;j<m;j++){
				dc[i][j]=C[i][j];
			}
		}
		for(int k=0;k<m;k++){
			for(int i=0;i<m;i++){
				for(int j=0;j<m;j++){
					if(dc[i][j]>dc[i][k]+dc[k][j]){
						dc[i][j]=dc[i][k]+dc[k][j];
					}
				}
			}
		} 
		cin >> N;
		for(int I=0;I<N;I++){
			cin >> p >> q >> r;
			cout << (r?dt[p-1][q-1]:dc[p-1][q-1]) << endl;
		}
		
		/*int k,p,q,r;
		cin >> k;
		for(int I=0;I<k;I++){
			int d[m];
			bool u[m];
			cin >> p >> q >> r;
			for(int i=0;i<m;i++){
				d[i] = INF;
				u[i] = false;
			}
			d[p-1]=0;

			while(1){
				int v = -1;
				for(int i=0;i<m;i++){
					if(u[i])continue;
					if(v==-1||d[i]<d[v]){
						v = i;
					}
				}
				if(v==-1)break;
				u[v]=true;

				for(int i=0;i<m;i++){
					if(r){
						if(d[i]>d[v]+T[v][i]){
							d[i]=d[v]+T[v][i];
						}
					}else{
						if(d[i]>d[v]+C[v][i]){
							d[i]=d[v]+C[v][i];
						}
					}
				}
			}
		
			cout << d[q-1] << endl;
		}*/		
	}

	return 0;
}

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

using ll = long long int;

const int MAX_D = (int)(10 + 5);

const ll GOSENCHO = (ll)(5000000000000000);

string s;
ll k;

int ans;

int main(void){
  cin >> s;
  scanf("%lld", &k);

  k -= 1;

  for (int i = 0; i < s.size(); ++i) {
    int cur = (int)(s[i]) - 48;
    if (i == k || cur > 1) {
      ans = cur;
      break;
    }
  }

  printf("%d\n", ans);
  
  return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))

mod = pow(10,9)+7
ok = 1

import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

LCM = lcm_list(A)

import numpy as np
B = np.array(A)
C = LCM//B


print(sum(C)%mod)

Measured memory_bytes: 285512
#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

int main() {
    double a,b,c,s,l,h;
    cin >> a >> b >> c;
    s = a*b*sin(c*M_PI/180)/2;
    l = a+b+sqrt(a*a+b*b-2*a*b*cos(c*M_PI/180));
    h = s*2/a;
    cout << fixed << setprecision(6)<< s << endl << l << endl << h << endl;
    return 0;
}

Measured memory_bytes: 3464
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long double n,ans=0;
	int k;
	cin>>n>>k;
	for(int i=1;i<=n;i++)
	{
		if(i>=k) ans+=1.0;
		else
		{
			int t=i;
			long double cnt=1.0;
			while(t<k)
			{
				cnt*=2.0;
				t*=2;
			}
			ans+=1.0/cnt;
		}
	}
	cout<<fixed<<setprecision(12)<<ans/n<<endl;
	return 0;
}


Measured memory_bytes: 256
"use strict";
function main(input) {
  let s = input[0];

  if((s.indexOf("A")===-1) || (s.indexOf("B")===-1)){
    console.log("No");
  }else{
    console.log("Yes");
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));

Measured memory_bytes: 21064