akhauriyash/Code-Regression huggingface dataset:
/* Author rumoisen */
/* created 2018/11/17 */

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define REV(c) reverse((c).begin(),(c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

void no() { cout << "No" << endl;exit(0);}
void yes() { cout << "Yes" << endl;exit(0);}
void No() { cout << "NO" << endl;exit(0);}
void Yes() { cout << "YES" << endl;exit(0);}

typedef long long ll;
typedef long long int llt;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++ ){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    int alice = 0, bob = 0;
    for(int i = 0; i < n; i++)
    {
        if(i%2==0){
            alice += a[i];
        }
        if(i%2==1){
            bob += a[i];
        }
    }
    cout << alice - bob << endl;
    return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

type pair struct {
	prf, rnk int
}

var sc = bufio.NewScanner(os.Stdin)

const inf = 1 << 60

func ri() (n int) {
	sc.Scan()
	for _, v := range sc.Bytes() {
		n = n*10 + int(v-48)
	}
	return
}

func main() {
	sc.Split(bufio.ScanWords)
	n, m := ri(), ri()

	ys := make([]int, m)
	ps := make([][]int, n)
	mp := make(map[int]pair)
	for i := 0; i < m; i++ {
		p, y := ri(), ri()
		ys[i] = y
		ps[p-1] = append(ps[p-1], y)
		mp[y] = pair{prf: p}
	}

	for _, prefecture := range ps {
		sort.Ints(prefecture)
		for i, p := range prefecture {
			tmpPrf := mp[p].prf
			mp[p] = pair{prf: tmpPrf, rnk: i + 1}
		}
	}

	for _, year := range ys {
		fmt.Printf("%06d%06d\n", mp[year].prf, mp[year].rnk)
	}
}


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

using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;

template <class T>
using max_heap = priority_queue<T>;
template <class T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;

template <class T, class U>
void chmax(T &a, U b) {
    if (a < b) a = b;
}
template <class T, class U>
void chmin(T &a, U b) {
    if (b < a) a = b;
}

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cerr << #x << ": " << x << endl;
#define int ll

const ll mod = 1e9 + 7;
const ll inf = (1LL << 50);

const string YES = "Yes";
const string NO = "No";
void solve(std::vector<std::vector<long long>> A, long long N, std::vector<long long> b) {

    bool bo[3][3];
    rep(i, 3) rep(j, 3) bo[i][j] = false;

    for (auto e : b) {
        rep(i, 3) rep(j, 3) if (A[i][j] == e) bo[i][j] = true;
    }

    rep(i, 3) {
        bool ok = true;
        rep(j, 3) ok &= bo[i][j];
        if (ok) {
            cout << YES << endl;
            return;
        }
    }

    rep(i, 3) {
        bool ok = true;
        rep(j, 3) ok &= bo[j][i];
        if (ok) {
            cout << YES << endl;
            return;
        }
    }

    if (bo[0][0] and bo[1][1] and bo[2][2]) {
        cout << YES << endl;
        return;
    }

    if (bo[2][0] and bo[1][1] and bo[0][2]) {
        cout << YES << endl;
        return;
    }

    cout << NO << endl;
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    std::vector<std::vector<long long>> A(3, std::vector<long long>(3));
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            scanf("%lld", &A[i][j]);
        }
    }
    long long N;
    scanf("%lld", &N);
    std::vector<long long> b(N);
    for (int i = 0; i < N; i++) {
        scanf("%lld", &b[i]);
    }
    solve(std::move(A), N, std::move(b));
    return 0;
}


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


typedef long long ll;
typedef vector <int> vi;
typedef pair< int ,int > pii;
typedef istringstream iss;
typedef ostringstream oss;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz size()
#define ln length()
#define rep(i,n) for(int i=0;i<n;i++)
#define fu(i,a,n) for(int i=a;i<=n;i++)
#define fd(i,n,a) for(int i=n;i>=a;i--)
#define all(a)  a.begin(),a.end() 
#define ESP (1e-9)

const int md = 100100 ;
int vis[1005] ;  
int main () {
	 /*vis[1] = 1 ; 
	 
	  for ( int i = 2 ; i <= 1000 ; ++i ){
	  	  for ( int j = i * i ; j <= 1000 ; j *= i ){
	  	  	   vis[j] = 1 ; 
		  }
	  }
	  
	  int x ; 
	  cin >> x ;
	  for ( int i = x ; i >= 1 ; --i ){
	  	  if ( vis[i] == 1 ) {
	  	  	  cout << i ;
	  	  	  break; 
			}
	  }
	  */
	  int a ,b , c,d ; 
	  cin >> a >> b >> c >> d ;
	  if ( abs(c - a)  <= d ||  ( abs( b - a ) <= d && abs( c - b) <= d ) )   puts("Yes"); else  puts("No") ; 
	  /*if ( x <= 3 ){
	  	  puts("1") ; 
	  }
	  else {
	  	  for ( int i = x ; i >= 4 ; --i){
	  	       int prm = 0 ;
	  	       int tmp = i  ;
			   for ( int j = 2 ; j * j <= tmp ; ++j){
			   	  if ( tmp % j == 0 ){
			   	      while ( tmp % j == 0 ) tmp /= j ; 
					++prm ; 	
				  }
			   	  // while ( i % j == 0 )  prm = 0 ;
			   }	
			   if ( tmp > 1 )  prm++; 
			   if ( prm == 1 ) {
			   	   cout << i ;
			   	   return 0; 
			   } 
		  }
	  } */
}

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

int main(){
    int a, b;
    cin >> a >> b;
    int a_, b_, ans = -1;
    rep(i, 1001){
        a_ = (i+1)*0.08;
        b_ = (i+1)*0.10;
        if((int)a_ == a && (int)b_ == b){
            ans = (i+1);
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define ll long long 
#define mod 1000000007
ll power(ll a, ll b){
    ll x = 1, y = a;
    while(b > 0){
        if(b&1ll)
            x = (x * y) % mod;
        y = (y * y) % mod;
        b >>= 1;
    }
    return x % mod;
}
int main(){
    ll ans = 0, a, n, j, k, i;
    ll dp[555555] = {0};
    scanf("%lld%lld",&n,&k);
    for(i = k; i > 0; i--){
        a = power(k / i, n);
        a %= mod;
        for(j = 2 * i;j <= k; j += i){
            a+= (mod - dp[j]);
            a %= mod;
        }
        ans += a * i;
        ans %= mod;
        dp[i] = a;
    }
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 6072
#include<bits/stdc++.h>
#include<stdio.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define pb                  push_back
#define arr                 vector<ll>
#define mem(x,val)          memset(x,val,sizeof(x))
#define vp                 vector<pair<ll,ll>>
#define matrix              vector<vector<ll> >
#define digit(x)            floor(log10(x))+1
#define debug(x)            cerr << #x << " is " << x << endl;
#define all(a)              a.begin(),a.end()
#define fixed               setprecision(15)
// ll dx[]={-1,1,0,0},dy[]={0,0,-1,1}; 4 Sides
//ll dx[]={-1,1,-1,1,0,0,-1,1} , dy[]={-1,1,0,0,-1,1,1,-1};    8 Sides
using namespace std;
arr read(ll n){
     arr a;
    for (ll i=0;i<n;i++){
        ll x;
        cin>>x;
        a.pb(x);
      }
     return a;
 }
 int main(){
    ll n,x,k;
    cin>>n>>x>>k;
    ll c = n/x;
    if (n%x){
        c++;
    }
    cout<<k*c<<endl;
    return 0;
    }


Measured memory_bytes: 3524
fun main(args: Array<String>) = yorukatsu10d()

fun yorukatsu10d() {
    val (n, k) = readLine()!!.split(' ').map { it.toLong() }

    if (k == 0L) return println(n * n)

    var answer = 0L

    for (b in k + 1..n) {
        answer += (n / b) * (b - k) + if (n % b != 0L) Math.max(n % b - k + 1, 0) else 0
    }


    println(answer)
}


Measured memory_bytes: 38176
s=input()
n=len(s)-1
cut =[-1]+ [i for i in range(len(s)-1) if s[i:i+2]=="><" ] + [n]
div = [s[cut[i]+1:cut[i+1]+1] for i in range(len(cut)-1)]
ans=0
for d in div:
    sr = d.count("<")
    sl = d.count(">")
    smax=max(sr,sl)
    smin=min(sr,sl)
    ans+=smax*(smax+1)//2 + smin*(smin-1)//2
print(ans)

Measured memory_bytes: 58312
n, d = map(int, input().split())
points = [list(map(int, input().split())) for i in range(n)]

result = 0

for i in range(n):
    for j in range(i+1, n):
        sum = 0
        for k in range(d):
            sum += (points[i][k] - points[j][k]) ** 2
        dist = sum ** 0.5
        if dist.is_integer():
            result += 1
print(result)

Measured memory_bytes: 3064
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;

#define MAX_N 246913

bool table[MAX_N];
vector<int> prime;

void init() {
    memset(table, 1, sizeof(table));
    table[0] = table[1] = false;
    for (int i = 2; i < MAX_N; i++) {
        if (table[i]) {
            prime.push_back(i);
            for (int j = i + i; j < MAX_N; j += i) {
                table[j] = false;
            }
        }
    }
}

int main() {
    int n;
    init();
    while (cin >> n, n != 0) {
        cout << upper_bound(prime.begin(), prime.end(), n+n) 
                    - upper_bound(prime.begin(), prime.end(), n) << endl;
    }
    return 0;
}

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

int main() {
  int N;
  string color;
  bool four=false;
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>color;
    if(color=="Y"){
      four=true;
    }
  }
  if(four==true){
    cout<<"Four"<<endl;
  }
  else{
    cout<<"Three"<<endl;
  }
}


Measured memory_bytes: 256
S = input()

a = int(S[0])*10+int(S[1])
b = int(S[2])*10+int(S[3])

if a <= 12 and 0 < a:
    if b <= 12 and 0 < b:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if b <= 12 and 0 < b:
        print("YYMM")
    else:
        print("NA")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define sz(v) (v).size()
#define debug(x) cerr << #x << "_=_" << x << "\n";
#define sum(n) ((n)*((n)+1)>>1)
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<pair<int, int>, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;

const int MAXN = 1e3+5, MOD = 1e9+7;
ll dp[MAXN][MAXN];
string mat[MAXN];

int n, m;

ll f(int i, int j){
    if(i==n-1 && j==m-1) return 1LL;
    if(i>=n || j>=m || mat[i][j] == '#') return 0;
    if(~dp[i][j]) return dp[i][j];
    return dp[i][j] = (f(i+1, j)%MOD + f(i, j+1)%MOD)%MOD;
}

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



    cin >> n >> m;
    for (int i=0; i<n; i++)
        cin >> mat[i];

    memset(dp, -1, sizeof dp);

    cout << f(0, 0) << "\n";

    for (int i=0; i<n; i++){
        for (int j=0; j<m; j++){
            debug(dp[i][j])
        }
    }



    return 0;
}

/*
1
9 3
111100000
 */

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

int main()
{
	int b1 = 0, b2  = 0, b3 = 0;
	cin >> b1 >> b2 >> b3;
	if (b1 == 1)
	{
		if (b2 == 0)
		{
			cout << "Close" << endl;
		}
		if (b2 == 1)
		{
			cout << "Open" << endl;
		}
	}
	else if (b3 == 1)
	{
		cout << "Open" << endl;
	}
	else
	{
		cout << "Close" << endl;
	}
}

Measured memory_bytes: 1156
#include <iostream>
#include <utility>
#include <vector>
#include <climits>
using namespace std;

static const int MAX_N = 100;

void dijkstra(vector<vector<pair<int, int> > > way)
{
    int d[way.size()];
    bool on[way.size()];
    for (int i = 0; i < way.size(); i++) {
        d[i] = INT_MAX;
        on[i] = false;
    }
    d[0] = 0;
    while (1) {
//        cout << "d:";
//        for (int i = 0; i < way.size(); i++) {
//            cout << " " << d[i];
//        }
//        cout << endl;
        int u, minv = INT_MAX;
        for (int i = 0; i < way.size(); i++) {
            if (minv > d[i] && !on[i]) {
                minv = d[i];
                u = i;
            }
        }
        if (minv == INT_MAX) break;
        on[u] = true;
        for (auto itr = way.at(u).begin(); itr != way.at(u).end(); ++itr) {
            if (!on[itr->first]) {
                d[itr->first] = min(d[itr->first], d[u] + itr->second);
            }
        }
    }
    for (int i = 0; i < way.size(); i++) {
        cout << i << " " << d[i] << endl;
    }
}

int main()
{
    int n;
    cin >> n;
    vector<vector<pair<int, int> > > way(n);
    int k, c, u, v;
    for (int i = 0; i < n; i++) {
        cin >> u >> k;
        for (int j = 0; j < k; j++) {
            cin >> v >> c;
            way.at(u).push_back(make_pair(v, c));
        }
    }
    dijkstra(way);
    return 0;
}

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

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

  int ans=0;
  while(true){
    bool exist_odd =  false;
    for(int i=0;i<n;i++){
      if(a[i]%2) exist_odd = true;
    }
    if(exist_odd) break;

    for(int i=0;i<n;i++) a[i] /= 2;

    ans++;
  }

  cout <<ans <<endl;
}


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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("game.out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);

    string s, t;
    cin >> s >> t;
    int a, b;
    cin >> a >> b;
    string x;
    cin >> x;
    if (s == x)
        --a;
    else if (t == x)
        --b;
    cout << a << " " << b;

    return 0;
}


Measured memory_bytes: 256
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
using namespace std;
using llong = long long;
#define BUGO(x) cerr << #x << " = " << (x) << '\n';
#define BUGOARR(a) {cerr << #a << ": "; for (auto i: a) cerr << i << ' '; cerr << '\n';}
#ifndef MANSON
#define BUGO(x)
#define BUGOARR(x)
#endif
ostream& operator<<(ostream& out, const pair<auto, auto>& p) {
    return out << "{" << p.first << ", " << p.second << "}";
}
class Mem
{
    static int minFree;
    int a;
public:
    Mem()
        : a(minFree++)
    {}
    Mem(int a_)
        : a(a_)
    {}
    operator int() { return a; }
};
int Mem::minFree = 3;

int sz;
stringstream output;
Mem A(0), B(1), ans(2);
Mem one, zero;

inline void Less(Mem& a, Mem& b, Mem& c) {
    ++sz;
    output << "< " << a << ' ' << b << ' ' << c << '\n';
}
inline void Sum(Mem& a, Mem& b, Mem& c) {
    ++sz;
    output << "+ " << a << ' ' << b << ' ' << c << '\n';
}
vector<Mem> GetBinary(Mem a)
{
    Mem aPlusOne;
    Sum(a, one, aPlusOne);
    Mem b;
    vector<Mem> bin(30);
    Mem pw;
    Mem sumBPw;
    Mem curDigit;
    for (int i = 29; i >= 0; --i)
    {
        Sum(zero, one, pw);
        for (int j = 0; j < i; ++j) Sum(pw, pw, pw);
        Sum(pw, b, sumBPw);
        Less(sumBPw, aPlusOne, curDigit);
        for (int j = 0; j < i; ++j) Sum(curDigit, curDigit, curDigit);
        Less(zero, curDigit, bin[i]);
        Sum(b, curDigit, b);
    }
    return bin;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    Mem p, q;
    Less(one, A, p);
    Less(one, B, q);
    Sum(p, q, p);
    Less(zero, p, one);

    vector<Mem> a = GetBinary(A);
    vector<Mem> b = GetBinary(B);
    Mem x, y, z;
    for (int i = 0; i < 30; ++i)
        for (int j = 0; j < 30; ++j)
        {
            Less(zero, a[i], x);
            Less(zero, b[j], y);
            Sum(x, y, z);
            Less(one, z, z);
            for (int k = 0; k < i + j; ++k)
                Sum(z, z, z);
            Sum(ans, z, ans);
        }
    cout << sz << '\n' << output.str();
}


Measured memory_bytes: 3956
import java.util.*;
public class Main {
  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    Map<Character, Integer> map = new HashMap<>();
    for (int i = 0; i < 4; i++) {
      char c = S.charAt(i);
      int count = map.getOrDefault(c, 0);
      map.put(c, ++count) ;
    }
    if (map.size() != 2) {
      System.out.println("No");
      return;
    }
    for (Map.Entry<Character, Integer> entry : map.entrySet()) {
      if (entry.getValue() != 2) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }  
}

Measured memory_bytes: 22612
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

map<P, int> dp;

void dfs1(int prev, int v, const Graph& G) {
	int res = 1;
	for (auto to : G[v]) if (to != prev) {
		dfs1(v, to, G);
		res = max(res, dp[P(v, to)] + 1);
	}
	dp[P(prev, v)] = res;
}

void dfs2(int prev, int v, const Graph& G) {
	int ma1 = 1, ma2 = 1;
	for (auto to : G[v]) {
		int now = dp[P(v, to)] + 1;
		if (now >= ma1) {
			ma2 = ma1;
			ma1 = now;
		}
		else if (now >= ma2) {
			ma2 = now;
		}
	}
	for (auto to : G[v]) if (to != prev) {
		dp[P(to, v)] = dp[P(v, to)] + 1 == ma1 ? ma2 : ma1;
		dfs2(v, to, G);
	}
}

int main()
{
	cin.sync_with_stdio(false);
	int N;
	cin >> N;
	Graph G(N);
	for (int i = 0, u, v; i < N - 1; i++) {
		cin >> u >> v; u--; v--;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	dfs1(-1, 0, G);
	dfs2(-1, 0, G);
	vector<int> res(N);
	for (int i = 0; i < N; i++) {
		for (auto to : G[i]) {
			res[i] = N * 2 - 2 - max(dp[P(i, to)], dp[P(to, i)] - 1);
		}
	}
	for (int i = 0; i < N; i++) {
		cout << res[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 36720
#include<bits/stdc++.h>
using namespace std;
int main(){
    int i;
    string s;
    cin>>s;
    for(i=0;i<s.length();i++){
        if(s[i]==','){
           cout<<' ';
        }
        else{
            cout<<s[i];
        }
    }
    return 0;
}


Measured memory_bytes: 3568
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <chrono>
#include <random>
#include <tuple>
#include <utility>
#include <fstream>
#include <complex>

const long INF = (1l << 30);
const long LINF = (1l << 60);

long n;
long a[200005];
long ans;
bool found = false;

int main(){
    scanf("%ld", &n);
    for(int i = 0; i < n; i++){
        scanf("%ld", &a[i]);
    }
    long vis = 1;
    for(int i = 0; i < n; i++){
        if(a[i] != vis){
            ans++;
        }else{
            vis++;
        }
    }
    if(vis == 1){
        printf("-1\n");
    }else{
        printf("%ld\n", ans);
    }
}


Measured memory_bytes: 1792
function Main(input) {
  input = input.split("\n");
  const N = input[0];

  var S1 = 0;
  var S2 = 0;
  
  // parseInt and get sum.
  const W = input[1].split(" ").map(v => {
    var tmp = parseInt(v);
    S2 += tmp;
    return tmp;
  });
  	
  var min = 100;
  for(var t = 0; t < N ; t++){
    S1 += W[t];
    S2 -= W[t];
    var abs = Math.abs(S1-S2) 
    min = min > abs ? abs : min; 
  }
  
  //出力
  console.log(min);
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7500
//“ In order to be irreplaceable, one must always be different”
#include<bits/stdc++.h>
using namespace std;
#define ll long long
# define pi 3.14159265359
# define str string
# define vll vector<ll>
# define vstr vector<str>
# define vchar vector<char>
//assign() assignes new value
//emplace(position,x) inserting
//erase(position) to remove an element
//swap() for swapping
//reverse(position,position) for reversing
# define pb push_back
# define popb pop_back
# define pf push_front
# define popf pop_front
# define sll set<ll>
# define schar set<char>
//find()
//erase(x) removes element x
//erase(position,position)
# define qll queue<ll>
# define qstr queue<str>
//front(),back()
# define stll stack<ll>
# define ststr stack<str>
//top()
# define dll deque<ll>
//at()
# define mll map<ll,ll>
#define mchar map<char, ll>
# define mstr map<str,ll>
# define mss map<str,str>
# define mci map<char,ll>
ll gcd(ll a, ll b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b);  
      
} 
ll lcm(ll a, ll b)  
{  
    return (a*b)/gcd(a, b);  
}



int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll k,x;
    cin>>k>>x;
    if(k*500<x){
        cout<<"No"<<endl;
    }
    else{
        cout<<"Yes"<<endl;
    }
    return 0;
}
   

		
	
	
	
	
	
	
	
	
	
	
	

Measured memory_bytes: 256
n = int(raw_input())
a = []
for i in range(n):
    a.append(map(int, raw_input().split()))
def prim(a):
    color = ['white' for i in range(n)]
    d = [10**9 for i in range(n)]
    p = [-1 for i in range(n)]
    d[0] = 0
    while True:
        mincost = 10**9
        for i in range(n):
            if color[i] != 'black' and d[i] < mincost:
                mincost = d[i]
                u = i
        if mincost == 10**9:
            break
        color[u] = 'black'
        for v in range(n):
            if color[v] != 'black' and a[u][v] != -1:
                if a[u][v] < d[v]:
                    d[v] = a[u][v]
                    p[v] = u
                    color[v] = 'gray'
    print sum(d)
prim(a)

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

using namespace std;

typedef pair<int, int> request_t;
vector<request_t> requests;

bool cmp(const request_t &a, const request_t &b)
{
    return a.second < b.second;
}

int main()
{
    int N, M;
    cin >> N >> M;
    for (int i = 0; i < M; i++)
    {
        int a, b;
        cin >> a >> b;
        requests.emplace_back(a, b);
    }
    sort(requests.begin(), requests.end(), cmp);
    int prev = -1;
    int count = 0;
    for (auto r : requests)
    {
        if (prev >= r.first)
            continue;

        prev = r.second - 1;
        count++;
    }
    cout << count << endl;
}


Measured memory_bytes: 1400
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};


int main() {

	int k,n;
	cin>>n>>k;

	cout<<n-k+1<<endl;
	return 0;

}


Measured memory_bytes: 256
from collections import *
from itertools import *

N = int(input())

A = map(int, input().split())
SA = SB = 0
ABI = sorted(((b:=max(N-i, i-1)*a, SA:=SA+a, SB:=SB+b) and (a, b, i) for i, a in enumerate(A, 1)), reverse=True)

prev = {0:0}
prev_max = 0
for k, (a, b, i) in enumerate(ABI):
  curr = defaultdict(int)
  curr_max = 0
  for l, p in prev.items():
    r = k-l
    if p + SB - max(l,r)*SA < prev_max:
      continue
    curr[l] = max(curr[l], p+abs(N-i-r)*a)
    curr[l+1] = p+abs(i-l-1)*a
    curr_max = max(curr_max, curr[l], curr[l+1])
  SA -= a
  SB -= b
  prev = curr
  prev_max = curr_max

print(curr_max)


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

int digit(unsigned long n, int p){
    int counter = 0;
    while (n >= 1){
        n /= p;
        counter++;
    }
    return counter;
}

int power(int x, int y){
    int a = 1;
    for(int i = 0; i < y; i++){
        a *= x;
    }
    return a;
}

vector<int> binaryreverse(unsigned long n){
    unsigned long d = digit(n, 2);
    vector<int> binary(100);
    for (int i = 0; i < d; i++){
        if (n % 2 == 1){
            binary.at(i) = 1;
            n = (n - 1) /2;
        }
        else n /= 2;
    }
    return binary;
}

int main(){
    
    unsigned long N;
    cin >> N;
    int t = digit(N, 10);

    vector<int> Nvec(t);
    unsigned long n = N;
    for (int i = 0; i < t; i++){
        int a = n % 10;
        Nvec.at(t - i - 1) = a;
        n = (n - a) / 10;
    }
    
    vector<int> condition(100);
    unsigned long SUM = 0;
    
    for (int i = 0; i < power(2, t - 1); i++){
        condition = binaryreverse(i);
        unsigned long Sum = 0;
        unsigned long sum = 0;
        for (int j = 0; j < t; j++){
            sum += Nvec.at(j);
            if (j == t - 1){
                Sum += sum;
            }
            else if (condition.at(j) == 1){
                Sum += sum;
                sum = 0;
            }
            else {
                sum *= 10;
            }
        }
        SUM += Sum;
    }
    
    cout << SUM << endl;
}

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

using namespace std;
using ll = long long;

//cout << std::fixed << std::setprecision(15) << y << endl;

int main() {
    int n = 0;
    cin >> n;
    string x;
    for(int i = 0;i < n;i++){
        x += i + 1 + '0';
    }
    string sp;
    string sq;
    for(int i = 0;i < n;i++){
        int tmpP = 0;
        cin >> tmpP;
        sp += tmpP + '0';
    }
    for(int i = 0;i < n;i++){
        int tmpQ = 0;
        cin >> tmpQ;
        sq += tmpQ + '0';
    }
    int p,q = 0;
    p = stoi(sp);
    q = stoi(sq);
    int a = 0;
    int b = 0;
    int cnt = 0;
    do{
        int tmp = 0;
        tmp = stoi(x);
        if(tmp == p){
            a = cnt;
        }
        if(tmp == q){
            b = cnt;
        }
        cnt ++;
    }while(next_permutation(x.begin(),x.end()));
    cout << abs(a - b) << endl;

    return 0;
}

Measured memory_bytes: 3624
n=int(input())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ans=0
bef=-1
for i in range(n):
  ans+=b[a[i]-1]
  if bef==a[i]-1:
    ans+=c[a[i]-2]
  bef=a[i]
  
print(ans)

Measured memory_bytes: 38384
#include <bits/stdc++.h>
#define Rep(i,j,n) for(int i=j; i<n; i++)
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100//000000000
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<int, int>
#define PP pair<P,P>
#define T tuple<int,int,int> 
using namespace std;

int main(){
    int n; cin >> n;
    string s; cin >> s;
    int ans=0;
    rep(i,n-1){
        int tmp=0;
        rep(a,26){
            bool ok=false;
            rep(j,i+1){
                if(s[j]=='a'+a){
                    ok=true;
                    break;
                }
            }
            bool ok2=false;
            Rep(j,i+1,n){
                if(s[j]=='a'+a){
                    ok2=true;
                    break;
                }
            }
            if(ok && ok2) tmp++;
        }
        ans=max(ans,tmp);
    }

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

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

using namespace std;

using ll = long long;

constexpr char newl = '\n';

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

    int x;
    cin >> x;

    int l = 360 / __gcd(360, x) * x;
    cout << l / x << newl;

    return 0;
}

Measured memory_bytes: 3620
from collections import defaultdict
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)

N,M = map(int, input().split())
S = list(input())
T = list(input())

L = lcm(N, M)

X = defaultdict(str)

for p,s in enumerate(S):
    X[p * L // N] = s

flag = True
for q,t in enumerate(T):
    if X[q * L // M] and X[q * L // M] != t:
        flag = False
    else:
        X[q * L // M] = t

if flag:
    print(L)
else:
    print(-1)

Measured memory_bytes: 18644
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //軒数
		
		int m = stdIn.nextInt(); //買う本数
		
		
		Map <Long, Long> map = new TreeMap<>();
		
		for(int i = 0; i < n; i++) {
			long a = stdIn.nextLong(); //値段
			long b = stdIn.nextLong(); //本数
			
			if(!map.containsKey(a)) {
				map.put(a, b);
			}else {
				map.put(a, map.get(a)+b);
			}
			
		}
		
		long ans = 0;
		
		for(long s: map.keySet()) {
			
			if(m <= map.get(s)) {
				ans += s * m;
				break;
			}else {
				ans += s * map.get(s);
				m -= map.get(s);
			}
			
			
			
		}
		
		System.out.println(ans);
		
	}

}


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

string k;

int d;

#define MOD 1000000007

long long memo[10010][100][2];

long long dp(int i, int num, int giri){
  if(i == k.size()){
    if(num == 0){
      return 1;
    }else{
      return 0;
    }
  }

  if(memo[i][num][giri] != -1) return memo[i][num][giri];

  int fin = '9';
  if(giri == 1){
    fin = k[i];
  }

  long long ans = 0;
  for(int j = '0';j <= fin;j++){
    int tmp = 0;
    if(giri == 1 && j == fin){
      tmp = 1;
    }
    ans += dp(i+1, (num+(j-'0'))%d, tmp);

    ans %= MOD;
  }

  return memo[i][num][giri] = ans;
}

int main(){
  cin >> k >> d;

  memset(memo, -1, sizeof(memo));

  cout << (MOD + dp(0, 0, 1) - 1) % MOD << endl;

  return 0;
}

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

void riffleShuffle( vector<int>& a, int n, int c )
{
    vector<int> x, y;
    for( int i = a.size() - 1; i >= a.size() / 2; i-- )
        x.push_back(a[i]);
    for( int i = a.size() / 2 - 1; i >= 0; i-- )
        y.push_back(a[i]);
    
    a.clear();

    while( x.size() || y.size() )
    {
        for( int i = 0; x.size() && i < c; i++ )
        {
            a.push_back(x[x.size()-1]);
            x.pop_back();
        }
        for( int i = 0; y.size() && i < c; i++ )
        {
            a.push_back(y[y.size()-1]);
            y.pop_back();
        }
    }
}

int main()
{
    int n, r, c;

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

        for( int i = 0; i < r; i++ )
        {
            cin >> c;
            riffleShuffle( a, n, c );
        }
        cout << a[a.size()-1] << endl;
        a.clear();
    }

    return 0;
}


Measured memory_bytes: 3064
//⣿⣿⣿⣿⣿⣿⠟⠋⠁⣀⣤⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣿⣿
//⣿⣿⣿⣿⠋⠁⠀⠀⠺⠿⢿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠻⣿
//⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣤⣤⣤⠀⠀⠀⠀⠀⣤⣦⣄⠀⠀
//⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⠏⣿⣿⣿⣿⣿⣁⠀⠀⠀⠛⠙⠛⠋⠀⠀
//⡿⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⣰⣿⣿⣿⣿⡄⠘⣿⣿⣿⣿⣷⠄⠀⠀⠀⠀⠀⠀⠀⠀
//⡇⠀⠀⠀⠀⠀⠀⠀⠸⠇⣼⣿⣿⣿⣿⣿⣷⣄⠘⢿⣿⣿⣿⣅⠀⠀⠀⠀⠀⠀⠀⠀
//⠁⠀⠀⠀⣴⣿⠀⣐⣣⣸⣿⣿⣿⣿⣿⠟⠛⠛⠀⠌⠻⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⣶⣮⣽⣰⣿⡿⢿⣿⣿⣿⣿⣿⡀⢿⣤⠄⢠⣄⢹⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⣿⣿⣿⣿⣿⡘⣿⣿⣿⣿⣿⣿⠿⣶⣶⣾⣿⣿⡆⢻⣿⣿⠃⢠⠖⠛⣛⣷⠀
//⠀⠀⢸⣿⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣿⣮⣝⡻⠿⠿⢃⣄⣭⡟⢀⡎⣰⡶⣪⣿⠀
//⠀⠀⠘⣿⣿⣿⠟⣛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⡿⢁⣾⣿⢿⣿⣿⠏⠀
//⠀⠀⠀⣻⣿⡟⠘⠿⠿⠎⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣵⣿⣿⠧⣷⠟⠁⠀⠀
//⡇⠀⠀⢹⣿⡧⠀⡀⠀⣀⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⢰⣿⠀⠀⠀⠀
//⡇⠀⠀⠀⢻⢰⣿⣶⣿⡿⠿⢂⣿⣿⣿⣿⣿⣿⣿⢿⣻⣿⣿⣿⡏⠀⠀⠁⠀⠀⠀⠀
//⣷⠀⠀⠀⠀⠈⠿⠟⣁⣴⣾⣿⣿⠿⠿⣛⣋⣥⣶⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⣿⡀ 
//
//⣿⠛⣷⠀⠀⢸⣟⡛⠀⠀⣿⠛⣷⠀⠀⢸⣟⡛⠀⠀⣴⢟⣛⡀⠀⠀⣸⢿⣇⠀ 
//⣿⠉⠉⠀⠀⢸⣯⣥⠀⠀⣿⠉⠉⠀⠀⢸⣯⣥⠀⠀⢿⣮⣽⡇⠀⢠⡿⠶⣿⡄ 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define DEBUG false
#define debugf if (DEBUG) printf
#define MAXN 1000010
#define MAXM 900009
#define MAXLOGN 20
#define ALFA 256
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3f
#define EPS 1e-9
#define PI 3.141592653589793238462643383279502884
#define FOR(x,n) for(int x=0; (x)<int(n); (x)++)
#define FOR1(x,n) for(int x=1; (x)<=int(n); (x)++)
#define REP(x,n) for(int x=int(n)-1; (x)>=0; (x)--)
#define REP1(x,n) for(int x=(n); (x)>0; (x)--)
#define pb push_back
#define pf push_front
#define pr printf
#define sc(x) scanf(" %d", &x)
#define sc2(x, y) sc(x);sc(y)
#define sc3(x, y, z) sc2(x, y);sc(z)
#define scll(x) scanf(" %lld", &x)
#define sc2ll(x, y) scll(x);scll(y)
#define sc3ll(x, y, z) sc2ll(x, y);scll(z)
#define ff first
#define ss second
#define mp make_pair
#define sz(x) int(x.size())
#define all(x) x.begin(), x.end()
#define mset(x,y) memset(&x, (y), sizeof(x))
#define LOWBIT(A) (A & -A)
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef unsigned int uint;
typedef vector <int> vi;
typedef pair <int, int> ii;
typedef pair <ll, ll> pll;
typedef pair < pll, ll > plll;
template <class T>
	using ord_set = tree<T, null_type, less<T>, rb_tree_tag,
	tree_order_statistics_node_update>;


ll Add(ll a, ll b){
    a%=MOD;
    b%=MOD;
    return (a + b)%MOD;
}

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

int main(){
    int n;
    sc(n);
    int freq[61];mset(freq, 0);
    FOR(i, n){
        ll aux;
        scll(aux);
        FOR(j, 61){
            freq[j] = freq[j] + (((1LL << j) & aux) > 0);
        }
    }
    ll resp = 0;
    FOR(i, 61){
        int naoTem = n - freq[i];
        resp = Add(resp, Mult(Mult(naoTem, freq[i]), 1LL<<i) );
    }
    pr("%lld\n", resp);
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
#include <wchar.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;


/*
ある点を始点とする最長経路はいつ訪れても変わらない
O(n)
ちなみにpriority_queueのdijkstraだとTLE
*/

ll n,m,dp[100010]={},ans=0;
vector<ll> v[100010];

ll f(int p){
	if(v[p].size()==0)return 0;
	if(dp[p]!=0)return dp[p];
	ll longest=0;
	for(int q : v[p]){
		longest = max(longest, f(q)+1);
	}
	return dp[p]=longest;
}

int main(void){
	cin>>n>>m;
	rep(i,m){
		ll x,y;
		cin>>x>>y;
		v[x-1].push_back(y-1);
	}
	rep(i,n){
		ans=max(ans,f(i));
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 8576
#include <bits/stdc++.h>
#define rep(i, l, r) for(int i = (l); i <= (r); i++)
#define per(i, r, l) for(int i = (r); i >= (l); i--)
#define mem(a, b) memset(a, b, sizeof a)
#define mid ((l + r) >> 1)
#define lch l, mid, o << 1
#define rch mid + 1, r, o << 1 | 1 

using namespace std;
const int N = (1 << 18) + 5, MI = 1e6, P = 1e9 + 7;
typedef long long ll;
int read() {
	static streambuf* in = cin.rdbuf();
	#define gc (p1 == p2 && (p2 = (p1 = buf) + in -> sgetn(buf, MI), p1 == p2) ? -1 : *p1++)
	static char buf[MI], *p1, *p2;
	int c = gc, r = 0;
	while(c < 48) c = gc;
	while(c > 47) r = (r << 3) + (r << 1) + (c & 15), c = gc;
	return r;
}
void wrt(int x) {
	static streambuf* out = cout.rdbuf();
	#define pc out -> sputc
	static char ch[11]; int sz = 0;
	if(!x) pc(48);
	else {
		while(x) ch[++sz] = x % 10, x /= 10;
		while(sz) pc(ch[sz--] + 48);
	} pc(10);
}
int h, l, p[N], bfn[N];
ll ans, w[N], sum[N];
void dfs(int l, int r, int o) {
	if(l == r) return bfn[l] = o, void();
	dfs(lch), dfs(rch);
}
void upd(int o, ll v) {
	for(; o; o >>= 1) sum[o] = (sum[o]+(v = v*o%P)) % P;
}
void calc(int o, ll v) {
	for(; o > 1; o >>= 1)
		ans = (ans + sum[o^1] * (o >> 1) % P * (v = v * o % P)) % P;
}
void slv(int l, int r, int o) {
	if(l == r) return w[l] = o, void();
	slv(lch), slv(rch);
	rep(i, l, mid) upd(bfn[p[i]], w[i] = w[i] * o % P);
	rep(i, mid + 1, r) calc(bfn[p[i]], w[i]), w[i] = w[i] * o % P;
	rep(i, l, mid) upd(bfn[p[i]], P - w[i]);
}
int main() {
	#ifdef local
		freopen("in.txt", "r", stdin);
	#endif
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	h = read(), l = 1 << (h - 1);
	rep(i, 1, l) p[i] = read(); 
	dfs(1, l, 1), slv(1, l, 1);
	return !(cout << ans);
}

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

#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (ll i = m; i < (n); i++)

using ll = long long;
using pii = pair<int, int>;
using Vi = vector<int>;



  
int main() {
  char a,b;
  cin >> a>>b;
  if(a=='H'&&b=='H'||a=='D'&&b=='D') cout << 'H' << endl;
  else cout << 'D' << endl;
    
}
      

Measured memory_bytes: 3580
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


using i64 = ::std::int_fast64_t;
using u64 = ::std::uint_fast64_t;
using i32 = ::std::int_fast32_t;
using u32 = ::std::uint_fast32_t;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 N;
  std::cin >> N;
  std::vector<i64> L;
  tools::read(L, N);

  i64 answer = 0;
  for (i64 i = 0; i < N - 2; ++i) {
    for (i64 j = i + 1; j < N - 1; ++j) {
      for (i64 k = j + 1; k < N; ++k) {
        if (L[i] != L[j] && L[j] != L[k] && L[k] != L[i] && L[i] + L[j] > L[k] && L[j] + L[k] > L[i] && L[k] + L[i] > L[j]) {
          ++answer;
        }
      }
    }
  }

  std::cout << answer << std::endl;
  return 0;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
typedef  long long int ll;
typedef  long double ld;
#define sync ios_base::sync_with_stdio(false); cin.tie(NULL) 
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define mod 1000000007
#define F first
#define S second 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
//recursions\
#pragma comment(linker, "/stack:200000000")
//loops\
#pragma GCC optimize("unroll-loops")
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,greater_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>//s.order_of_key(val) *s.find_by_order(ind)
using namespace std;
int main()
{
	sync;
	ll n;
	cin>>n;
	ll arr[n];
	input(arr,n);
	sort(arr,arr+n);
	ll ans=0;
	for(ll i=0;i<n;i++)
	{
		for(ll j=i+1;j<n;j++)
		{
			ll low=j+1,high=n-1,ind1=-1,ind2=-1;
			while(low<=high)
			{
				ll mid=(low+high)/2;
				if(arr[mid]<arr[i]+arr[j])
				low=mid+1,ind1=mid;
				else
				high=mid-1;
			}
			low=j+1,high=n-1;
			while(low<=high)
			{
				ll mid=(low+high)/2;
				if(arr[mid]>arr[j]-arr[i])
				ind2=mid,high=mid-1;
				else
				low=mid+1;
			}
			
			if(ind1==-1||ind2==-1)
			continue;
			ans+=(ind1-ind2+1);
		}
	}
	cout<<ans;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int main(void)
{
    int n,k,h,i=0,sum=0;
    float a;
    scanf("%d %d",&n,&k);
    while(i<n)
    {
        scanf("%d",&h);
        if(h>=k) sum++;
        i++;
    }
    printf("%d",sum);
    return 0;
}





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

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

    int count = 0;
    int num = 1;

    while (num) {
        cin >> num;
        if (num) {
            count++;
            cout << "Case " << count << ": " << num << '\n';
        }
    }
    return 0;
}


Measured memory_bytes: 3132
import sys
input=sys.stdin.readline

def main():
    m=int(input())
    DC=[list(map(int,input().split())) for _ in range(m)]
    s=0
    digit=0
    for d,c in DC:
        digit+=c
        s+=d*c
    ans=digit-1
    m=s%9
    if m==0:
        m=9
    ans+=(s-m)//9
    print(ans)
    
if __name__=='__main__':
    main()

Measured memory_bytes: 73052
#include<bits/stdc++.h>
using namespace std;
 
#define ll          long long int
#define ld          long double
#define pb          push_back
#define mp          make_pair
#define ff          first
#define se          second
#define endl        '\n'
#define fd(n)       fixed<<setprecision(n)
#define MAX         100000000000000000
#define MAXN        100000
#define mod         998244353  
 
 
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,sum=0,i;
    cin>>n;
    for(i=1;i<=n;i++){
        if(i%3!=0 && i%5!=0){
            sum+=i;
        }
    }
    cout<<sum;
}

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

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

    int n;
    cin >> n;

    cout << (n/111 + (n%111!=0)) * 111 << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define ARR_LIMIT 50
#define STUDENT_LIMIT 1000
#define SCORE_LIMIT 100

typedef struct {
	int studentCount;
	short* score;

	double average;
	double deviation;
} Class;

short InputClass(Class* class);
void GetAverage(Class* class);
void GetDeviation(Class* class);
void FreeClass(Class* class);

int main(void) {
	Class classes[ARR_LIMIT];
	int idx;
	int size;

	for (size = 0; size < ARR_LIMIT; size++) {
		Class class;
		int res = InputClass(&class);
		if (res == 1) {
			break;
		} else
		if (res == -1) {
			size--;
			continue;
		}
		classes[size] = class;
	}

	for (idx = 0; idx < size; idx++) {
		GetAverage(&classes[idx]);
	}

	for (idx = 0; idx < size; idx++) {
		GetDeviation(&classes[idx]);
	}

	for (idx = 0; idx < size; idx++) {
		printf("%lf\n", classes[idx].deviation);
	}

	for (idx = 0; idx < size; idx++) {
		FreeClass(&classes[idx]);
	}

	return 0;
}

short InputClass(Class* class) {
	int idx;
	int studentCount;
	short* score;

	scanf("%d", &studentCount);
	if (studentCount < 0 || STUDENT_LIMIT > 1000) {
		return -1;
	}
	if (studentCount == 0) {
		return 1;
	}

	score = (short*)malloc(sizeof(short) * studentCount);
	for (idx = 0; idx < studentCount; idx++) {
		int tmp;
		scanf("%d", &tmp);
		if (tmp < 0 || SCORE_LIMIT > 100) {
			return -1;
		}
		*(score + idx) = tmp;
	}

	class->studentCount = studentCount;
	class->score = score;

	return 0;
}

void GetAverage(Class* class) {
	int idx;
	int sc = class->studentCount;
	double sum = 0;

	for (idx = 0; idx < sc; idx++) {
		sum += *(class->score + idx);
	}

	class->average = sum / sc;
}

void GetDeviation(Class* class) {
	int idx;
	int sc = class->studentCount;
	double sum = 0;

	for (idx = 0; idx < sc; idx++) {
		int score = *(class->score + idx);
		double avg = class->average;
		double sub = score - avg;
		sum += sub * sub;
	}

	class->deviation = sqrt(sum / sc);
}

void FreeClass(Class* class) {
	free(class->score);
}


Measured memory_bytes: 2052
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <random>
#include <chrono>

#define _ << " " <<
#define all(v) v.begin(), v.end()
#define sp(n) fixed << setprecision(n)
#define ff first
#define ss second

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const ll mod = 1e9 + 7;
const double eps = DBL_EPSILON;

int dp[101000];

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	for (int& i : a) cin >> i;
	for (int i = 1; i < n; i++) {
		dp[i] = dp[i - 1] + abs(a[i] - a[i - 1]);
		for (int j = 2; j <= k && i - j >= 0; j++) {
			dp[i] = min(dp[i], dp[i - j] + abs(a[i] - a[i - j]));
		}
	}
	cout << dp[n - 1] << endl;
	return 0;
}

Measured memory_bytes: 1024
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val a = (0 until 2).map { (0 until n).map { sc.next().toInt() } }
    println(problem087c(n, a))
}

fun problem087c(n: Int, a: List<List<Int>>): Int {
    val dp = ((0 until 2).map { (0 until n).map { 0 }.toMutableList() }).toMutableList()
    dp[0][0] = a[0][0]
    dp[1][0] = dp[0][0] + a[1][0]
    for (i in 0 until n - 1) {
        dp[0][i + 1] += dp[0][i] + a[0][i + 1]
        dp[1][i + 1] = Math.max(dp[1][i] + a[1][i + 1], dp[0][i + 1] + a[1][i + 1])
    }
    return Math.max(dp[0][n - 1], dp[1][n - 1])
}

Measured memory_bytes: 31652
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod=1000000007;
ll dp[1<<21];
int main()
{
    ll n;
    cin>>n;
    ll a[n][n];
    for(ll i=0;i<n;i++)
        for(ll j=0;j<n;j++)
            cin>>a[i][j];
    ll mx=1<<n;

    for(ll i=0;i<mx;i++)
        dp[i]=0;
    dp[0]=1;
    for(ll i=0;i<n;i++)
    {
        for(ll j=mx-1;j>=0;j--)
        {
            if(__builtin_popcount(j)!=(i+1))
                dp[j]=0;
            else
            {
                dp[j]=0;
                for(ll k=0;k<n;k++)
                    if((j&(1<<k))&&(a[i][k]))
                        dp[j]=(dp[j]+dp[j^(1<<k)])%mod;
            }
        }
    }
    cout<<dp[mx-1]<<endl;
    return 0;
}


Measured memory_bytes: 16640
#include <iostream>
#include <vector>
using namespace std;
int main(){
  while(true){
    int a,b;
    vector<int> vec = vector<int>(101);
    while(true){
      if(!(cin >> a >> b))return 0;
      if(a == 0 && b == 0)break;
      vec[a]++;
      vec[b]++;
      
    }
    int flag = 0;
    if(!(vec[1]%2 == 1 && vec[2]%2 == 1) ){
      cout << "NG" << endl;
      continue;
    }


    for(int i = 3;i < 101;i++){

      if(vec[i]%2 != 0){
	cout << "NG" << endl;
	flag = 1;
	break;
      }
    }
    if(flag == 0)
      cout << "OK" << endl;
  }
  return 0;
}

Measured memory_bytes: 1192
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define vpi vector<ppi>
#define ppl pair<ll,ll>
#define all(x) x.begin(),x.end()
#define ii int,int 
#define ff first    
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define imx INT_MAX
#define imn INT_MIN
#define inf LONG_MAX
#define minf LONG_MIN
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse 
#define itr iterator 
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793

/*
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
#define si short int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/

int main()
{
	fast


		
	int n;
	cin>>n;

	cout<<n*n*n;	












	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define vv(T) vector<vector<T>>
using namespace std;
using ll = long long;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using vll = vector<long long>;
using vvll = vector<vector<long long>>;
using vbool = vector<bool>;
using vvbool = vector<vector<bool>>;
using qint = queue<int>;
using sint = stack<int>;
using pii = pair<int, int>;


int main(){
    int n, x, t;
    cin >> n >> x >> t;

    int ans = 0;
    while(n){
        n -= x;
        ans += t;
        if(n <= 0) break;
    }

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


Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>
typedef long long ll;

int main(void)
{
    ll ans = 2019;
    ll l, r;

    scanf("%lld%lld", &l, &r);
    if (r - l >= 2019)
    {
        puts("0");
        return 0;
    }
    else
        for (ll i = l; i < r + 1; i++)
            for (ll j = l + 1; j < r + 1; j++)
                if (i != j && (i * j) % 2019 < ans)
                    ans = (i * j) % 2019;

    printf("%lld\n", ans);

    return 0;
}

Measured memory_bytes: 128