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

using _i64 = int64_t;
using _u64 = uint64_t;
using _f64 = double;

#define _for(i, start, end) for(_i64 i = (_i64)start; i < (_i64)end; ++i)
#define _rep(i, number) _for(i, 0, number)
#define _foreach(e, data) for(auto& e : data)
#define _all(data) data.begin(), data.end()

template<typename type>
_i64 _size(const type& data) { return static_cast<_i64>(data.size()); }
template<typename type, size_t size>
_i64 _size(const type (&)[size]) { return static_cast<_i64>(size); }

enum _flag : bool { able = true, disable = false };

struct _time {
    _time(_flag flag) { check = flag; if(!check) { return; } gettime(start); }
    ~_time() {
        if(!check) { return; }; gettime(end);
        _i64 elapse = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cout << endl << "Time: " << elapse << " ms" << endl;
    }
    private:
    using _timer = chrono::time_point<chrono::system_clock>;
    _timer start, end; bool check;
    void gettime(_timer& time) { time = chrono::system_clock::now(); }
};

struct _ini { _ini() { ios::sync_with_stdio(false); cin.tie(nullptr); } } _ini;

int main() {
    {
        _time time(disable);
        _i64 a, b; cin >> a >> b;
        cout << a / b << " " << a % b << " ";
        cout << fixed << setprecision(5)<< (_f64)a / (_f64)b << endl;
    }
    return 0;
}


Measured memory_bytes: 3312
#include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define mod 1000000007
#define mx 1000002
mt19937 myrand(time(0));

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(),cout.tie();
    ll n;
    cin>>n;
    map<string,ll> mp;
    for(int i=0;i<n;i++){
        string s;
        cin>>s;
        mp[s]++;
    }
    cout<<"AC x "<<mp["AC"]<<endl;
    cout<<"WA x "<<mp["WA"]<<endl;
    cout<<"TLE x "<<mp["TLE"]<<endl;
    cout<<"RE x "<<mp["RE"]<<endl;
    return 0;
}


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

using namespace std;

using i64 = int64_t;

const i64 MOD = 1e9+7;

const i64 INF = 1e18+7;


signed main(){
    int a, b, c, d, n, x, y;
    string s, t;


    auto Yes = [&](bool t){
        cout << (t ? "Yes" : "No") << endl;
    };
    auto YES = [&](bool t){
        cout << (t ? "YES" : "NO") << endl;
    };
    auto tri = [&](bool t, string a, string b){
        cout << (t ? a : b) << endl;
    };

    auto f = [&](double xx){
        return floor((xx * xx + 4.0) / 8.0);
    };

    cin >> s;
    a = 0;
    for(auto& xx : s){
        if(!a && xx == 'C')
            ++a;
        else if(a == 1 && xx == 'F')
            ++a;
    }
    Yes(a == 2);
}


Measured memory_bytes: 256
module Main(main) where

-- | solve
--
-- >>> solve 0 [8,12,40]
-- 2
--
-- >>> solve 0 [5,6,8,10]
-- 0
--
-- >>> solve 0 [382253568,723152896,37802240,379425024,404894720,471526144]
-- 8
--
solve :: Int -> [Int] -> Int
solve c ns = if (and . map even) ns then solve (c+1) (map (`div` 2) ns) else c


main :: IO ()
main = do
    getLine
    ns <- map read . words <$> getLine
    print $ solve 0 ns



Measured memory_bytes: 1020
#include <queue>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <time.h>
#include <functional>

//#include "All.h"

using namespace std;
typedef long long int ll;

#define EPS (1e-9)
#define INF (1e9)
#define PI (acos(-1))
#define REP(i,n) for(int i=0;i<n;i++)

int gcd(int a, int b) {
    if (a < b) swap(a, b);
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll beki(ll a, ll b) {
    ll tmp = 1;
    REP(i, b) tmp *= a;
    return tmp;
}

ll N;
ll A[100010];
ll ans = 1;

int main() {
    cin >> N;
    REP(i, N) {
        cin >> A[i];
    }
    sort(A, A + N, greater<ll>());
    if (A[N - 1] == 0) {
        cout << 0 << endl;
        return 0;
    }
    REP(i, N) {
        if (ans > (ll)1e18 / A[i]) {
            cout << -1 << endl;
            return 0;
        }
        ans *= A[i];
        if (ans > (ll)1e18) {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
}


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

typedef long long lint;
typedef long double louble;

template<typename T1,typename T2> inline T1 max(T1 a,T2 b){return a<b?b:a;}
template<typename T1,typename T2> inline T1 min(T1 a,T2 b){return a<b?a:b;}
template<typename T1,typename T2> inline T1 gmax(T1 &a,T2 b){return a=a<b?b:a;}
template<typename T1,typename T2> inline T1 gmin(T1 &a,T2 b){return a=a<b?a:b;}

namespace ae86
{
	const int bufl = 1<<16;
	
	char buf[bufl],*s=buf,*t=buf;
	
	inline int fetch()
	{
		if(s==t){t=(s=buf)+fread(buf,1,bufl,stdin);if(s==t)return EOF;}
		return *s++;
	}
	
	inline int ty()
	{
		int a=0,b=1,c=fetch();
		while(!isdigit(c))b^=c=='-',c=fetch();
		while(isdigit(c))a=a*10+c-48,c=fetch();
		return b?a:-a;
	}
}
using ae86::ty;

const int _ = 200007 , __ = _<<1;

int to[__],ne[__],he[_]={0},ecnt=1;
inline void adde(int a,int b){to[++ecnt]=b,ne[ecnt]=he[a],he[a]=ecnt;}
inline void addde(int a,int b){adde(a,b),adde(b,a);}

int n,dep[_],mxdep;

void dfs(int x,int ff)
{
	dep[x]=1;
	for(int i=he[x];i;i=ne[i])
		if(to[i]!=ff)dfs(to[i],x),gmax(mxdep,dep[x]+dep[to[i]]),gmax(dep[x],dep[to[i]]+1);
	gmax(mxdep,dep[x]);
}

int main()
{
	n=ty();
	for(int i=1,a,b;i<n;i++)a=ty(),b=ty(),addde(a,b);
	mxdep=0,dfs(1,0);
	puts(mxdep%3==2?"Second":"First");

	return 0;
}


Measured memory_bytes: 13952
import java.util.*;

class Main
{
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    
	    Integer[] array = new Integer[3];
	    for(int i = 0; i < 3; ++i) {
	        int tmp = sc.nextInt();
	        array[i] = tmp;
	    }
	    
	    Arrays.sort(array);
	    
	    int sum = Math.abs(array[0] - array[1]) + Math.abs(array[1] - array[2]);
	    
	    System.out.println(sum);
	}
}

Measured memory_bytes: 22996
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

immutable long INF = 1L << 50;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1];
    auto P = s[2].to!long;
    auto G = new Edge!long[][](N);
    foreach (_; 0..M) {
        s = readln.split.map!(to!int);
        auto u = s[0] - 1;
        auto v = s[1] - 1;
        long c = -s[2] + P;
        G[u] ~= Edge!long(v, c);
    }

    auto dist = bellman_ford!(long, INF)(G, 0);

    if (dist[N-1] == -INF) {
        writeln(-1);
    } else {
        writeln(max(0L, -dist[N-1]));
    }
}

struct Edge(T) {
    int to;
    T cost;
}

T[] bellman_ford(T, T inf)(const Edge!(T)[][] graph, int start) {
    int n = graph.length.to!int;
    auto dist = new T[](n);
    dist[] = inf;
    dist[start] = 0;

    foreach (i; 0..n) {
        foreach (u; 0..n) {
            foreach (e; graph[u]) {
                if (dist[u] != inf && dist[e.to] > dist[u] + e.cost) {
                    dist[e.to] = dist[u] + e.cost;
                    if (i == n - 1) {
                        dist[e.to] = -inf;
                    }
                }
            }
        }
    }

    auto stack = new int[](n);
    int sp = 0;

    foreach (i; 0..n) {
        if (dist[i] == -inf) {
            stack[sp++] = i;
        }
    }

    while (sp > 0) {
        int u = stack[--sp];
        foreach (e; graph[u]) {
            if (dist[e.to] == -inf) continue;
            dist[e.to] = -inf;
            stack[sp++] = e.to;
        }
    }

    return dist;
}


Measured memory_bytes: 3196
/*
    author:@bhaskar_8998
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
using namespace __gnu_pbds; 
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;  
typedef long long i64;
typedef vector<int> vi;
typedef vector<long> vl;
typedef pair<int,int>pii;
#define all(A) (A).begin(),(A).end()
#define pb push_back
#define MOD 1000000007
#define fastio() {ios_base::sync_with_stdio(false);cin.tie(NULL);}

int main(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif
    fastio();
    i64 ss[31];
    for(int i=1,ts=2;i<=30;i++){
        ss[i]=ts;
        ts*=2;
    }
    clock_t beg=clock();
    int t=1;
    // cin>>t;
    while(t--){
        string s;
        cin>>s;
        if(s=="ABC")cout<<"ARC";
        else cout<<"ABC";
    }
    clock_t end=clock(); 
    fprintf(stderr, "\n%lf sec\n", (double)(end-beg)/(CLOCKS_PER_SEC));
    return 0;
}


    

Measured memory_bytes: 3808
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<stdlib.h>
#include<set>
#include<math.h>
#include<iomanip>
#include<unordered_map>
#include<algorithm>

using namespace std;


int main(void)
{
    int n;
    cin>>n;
    double sum=0;
    
    for(int i=0;i<n;i++){
        double a;
        cin>>a;
        sum+=1/a;
    }
    cout<<1/sum<<endl;
}


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

#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())
#define endl "\n"


template <typename T, typename K> struct P {
	T a; K b;
};

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
vector <P <ll, ll> >prime_factorize( ll N );
ll pow( ll a, ll n );
void initialize( void );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;
int main( void ){
	// initialize();
	int N; cin >> N;
	vector <int> vec( N + 4, 0 );
	int lim = sqrt( N + 1 ) + 1;
	rep( i, 1, lim ){
		rep( j, 1, lim ){
			rep( k, 1, lim ){
				int temp = i * ( i + j + k ) + j * ( j + k ) + k * k;
				if (temp <= N)
					vec[ temp ]++;
			}
		}
	}
	rep( i, 1, N + 1 ){
		cout << vec[ i ] << endl;
	}
}

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

/*
 * @fn eratosthenes
 * @brief O(NloglogN)~=(N)
 * @param N: その数まで
 * @return 0 or 1 の配列 (boolは都合が悪い)
 */
int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}

/*
 * @fn prime_factorize
 * @brief O(√N): 素因数分解
 * @param N: 素因数分解する数
 * @return vec: (a: 素数, b: 個数)
 */
vector <P <ll, ll> >prime_factorize( ll N ){
	vector <P <ll, ll> > vec;
	int lim = sqrt( N ) + 1;
	rep( i, 2, N + 1 ){
		if (i >= lim){
			vec.push_back( P <ll, ll>{N, 1} );
			break;
		}
		if (N % i == 0){
			vec.push_back( P <ll, ll>{i, 0} );
			while(N % i == 0){
				N /= i;
				vec.back().b++;
			}
		}
	}
	return vec;
}
/*
 * @fn pow
 * @brief a^n
 * @param a: 基数
 * @param n: 指数
 */
ll pow( ll a, ll n ) {
	ll res = 1;
	while (n > 0){
		if (n & 1) res = res * a;
		a = a * a;
		n >>= 1;
	}
	return res;
}

void initialize( void ){
	cout << fixed << setprecision( 10 );
}


Measured memory_bytes: 3552
#define _USE_MATH_DEFINES
#include  <iostream>
#include  <algorithm>
#include  <climits>
#include  <vector>
#include  <string>
#include  <cstring>
#include  <stack>
#include  <queue>
#include  <cmath>
#include  <iomanip>
#include  <set>
#include  <map>
#include  <new>
#include <cstdint>
#include <cctype>
using namespace std;
#define rep(i,n)  for(int i = 0; i < n; i++)
#define lrep(i,n,m)  for(int i = n; i < m; i++)

using ll = long long;
using Vii = vector<vector<int> >;
using Gjudge = vector<vector<bool>>;
using Vi = vector<int>;
using Vl = vector<ll>;
using Vll = vector<vector<ll> >;
using Vs = vector<string>;
using Vb = vector<bool>;
using the = pair<int, int>;
using lthe = pair<ll, ll>;

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

const int Mod = static_cast<int>(1e9 + 7);
const int INF = INT_MAX;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,1,0,-1 };

int main() {
    int n, w;
    cin >> n >> w;
    Vll dp(n, Vl(w + 1, -1));
    Vl W(n), V(n);
    rep(i, n)  cin >> W[i] >> V[i];

    //初期条件
    rep(i, w + 1) {
        if (i < W[0])  dp[0][i] = 0;
        else dp[0][i] = V[0];
    }
    //dp
    for (int i = 1; i < n; i++) {
        for (int j = 0; j <= w; j++) {
            if (j - W[i] >= 0)  dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - W[i]] + V[i]);
            else  dp[i][j] = dp[i - 1][j];
        }
    }
    cout << dp[n - 1][w] << endl;
}


Measured memory_bytes: 79360
#include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;


int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll A, B, K; cin >> A >> B >> K;
  if (K <= A) {
    cout << A - K << " " << B << endl;
    return 0;
  }else if (K <= A + B) {
    cout << "0 " << (A + B) - K << endl;
  }else {
    cout << "0 0" << endl;
  }

  return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
int main(void){
    int i,n;
    double x1,x2,x3,y1,y2,y3;
    double det,a,b,c,d,e,f;
    double px,py,r;
    
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
        scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
        det=x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2);
        a=y2-y3;
        b=y2-y1;
        c=x3-x2;
        d=x1-x2;
        e=(x1*x1+y1*y1-x2*x2-y2*y2)/2;
        f=(x2*x2+y2*y2-x3*x3-y3*y3)/2;
        
        px=(a*e+b*f)/det;
        py=(c*e+d*f)/det;
        r=sqrt((px-x1)*(px-x1)+(py-y1)*(py-y1));
        
        printf("%.3f %.3f %.3f\n",px,py,r);
    }
    
    return 0;
}

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

struct UnionFind {
  vector<int> d;
  UnionFind(int n): d(n,-1) {}
  int root(int x) {
    if (d[x] < 0) return x;
    return d[x] = root(d[x]);
  }
  bool unite(int x, int y) {
    x = root(x); y = root(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x,y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return root(x) == root(y);}
  int size(int x) { return -d[root(x)];}
};

int deg[100005];
vector<int> to[100005];

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  UnionFind uf(n);
  rep(i,m) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    deg[a]++;
    deg[b]++;
    uf.unite(a,b);
  }
  rep(i,k) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  rep(i,n) {
    int ans = uf.size(i)-1-deg[i];
    for (int u : to[i]) {
      if (uf.same(i,u)) --ans;
    }
    printf("%d%c", ans, i==n-1?'\n':' ');
  }
  return 0;
}


Measured memory_bytes: 9172
#include<stdio.h>
#include<cstring>
#include<iostream>
using namespace std;


int main(){
   int cnt[26] = {};
   char ch;

   while ( cin >> ch ){
       ch = tolower(ch);
       if (isalpha(ch)){
           int num = ch - 'a';  // 文字 ch の番号
           cnt[num]++; 
        }


    }

    for ( int i = 0; i < 26 ; i++){
        printf("%c : %d\n", i + 'a', cnt[i]);
    }

   return 0;


}


Measured memory_bytes: 3232
#include <stdio.h>
#include <stdlib.h>//random,NULL
#include <string.h>
#include <time.h>
#include <unistd.h>//sleep()
#include <math.h>
#include <stdbool.h>

#define rep(i,n) for(int i=0; i<((int)n); i++)
#define REP(i,n) for(int i=0; i<=((int)n); i++)
#define srep(i,a,n) for(int i=a; i<((int)n); i++)
#define SREP(i,a,n) for(int i=a; i<=((int)n); i++)
#define rrep(i,n) for(int i=n-1; i>=0; i--)
#define RREP(i,n) for(int i=n; i>=0; i--)
#define INF 1000000000

int main(){
  char buf[1024];
  int N,M,C;

  fgets(buf,sizeof(buf),stdin);
  sscanf(buf, "%d %d %d", &N, &M, &C);

  int *B=(int *)malloc(sizeof(int)*M);
  rep(i,M){
    scanf("%d", &B[i]);
  }

  int **A=(int **)malloc(sizeof(int *)*N);
  rep(i,N){
    A[i]=(int *)malloc(sizeof(int)*M);
  }

  rep(i,N){
    rep(j,M){
      scanf("%d", &A[i][j]);
    }
  }

  int count=0;
  rep(i,N){
    int sum=0;
    rep(j,M){
      sum+=A[i][j]*B[j];
    }
    sum+=C;
    if(sum>0){
      count++;
    }
  }

  printf("%d\n", count);

  return 0;


}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <complex>
#include <map>
#include <set>
#include <bitset>


#define forin(i, f, t) for(ll i = f; i < t; i++)

using namespace std;
using ll = long long;
using ULL = unsigned long long;
using Pair = pair<ll, ll>;

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    
    ll sum = 0;
    bitset<4000010> f;
    f[0] = 1;
    while (n-- > 0) {
        ll a;
        cin >> a;
        f |= f << a;
        sum += a;
    }
    for (sum = (sum + 1) >> 1; !f[sum]; sum++);
    cout << sum << endl;;
    
}



Measured memory_bytes: 1664
n = int(input())
A = [int(input())-1 for _ in range(n)]

visited = [0]*n
ans = 0
i = 0
while True:
  i = A[i]
  ans += 1  
  if visited[i]==1:
    ans = -1
    break    
  visited[i] = 1
  if i == 1:
    break
  
print(ans)    

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

using namespace std;

int main() {
   ios_base :: sync_with_stdio(0);
   cin.tie(0) , cout.tie(0);
   string t;
   cin >> t;
   int n = (int)t.size();
   int ans = 0;
   for (int i = 0; i < n / 2; i++) {
      if (t[i] != t[n - i - 1]) {
         ans++;
      }
   }
   cout << ans << '\n';
   return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, t[1000000], m = 0, k;
    cin >> n;
    int a[n];
    for (int i = 0; i < 1000000; i++) t[i] = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        t[a[i]]++;
        t[a[i] + 1]++;
        t[a[i] + 2]++;
    }
    for (int i = 0; i < 1000000; i++)
        if (m < t[i]) m = t[i];
    cout << m;
}

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

const bool DEBUG = false;

int N;
vector<long long> H;

void input() {
  cin >> N;
  H = vector<long long>(N);
  for (size_t i = 0; i < N; i++) cin >> H[i];
}

int main(int argc, char const *argv[]) {
  input();
  for (int i = N - 2; i >= 0; i--) {
    long long diff = H[i + 1] - H[i];
    if (DEBUG) cout << i << ", " << diff << endl;
    if (diff >= 0)
      continue;
    else if (diff == -1)
      H[i]--;
    else {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;

  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
const int maxn=1e5+5;
const int MOD=1e9+7;
int a[maxn];
ll f[maxn];
int first[maxn];
ll ans1[maxn];
int cmp(int a,int b)
{
    return a>b;
}
string s;
map<ll,int> mp;
vector<int> v;
int main()
{
    ll x,k,d;
    cin>>x>>k>>d;
    ll x1=abs(x);
    ll st=x1/d;
    if(st>=k){
        cout<<x1-k*d;
    }
    else{
        k-=st;
        if(k%2){
            cout<<abs(x1%d-d);
        }
        else cout<<x1%d;
    }

}




Measured memory_bytes: 3632
from collections import deque
import sys

def main():
    input = sys.stdin.readline
    n,k = map(int,input().split())

    a = [int(x) for x in input().split()]

    #ループを探す？

    checked_dict = {1:0}
    que = deque([a[0]])

    counter = 0


    while True:
        counter += 1
        x = que.popleft()
        if counter == k:
            print(x)
            exit()
        if x in checked_dict:
            startflg = checked_dict[x]
            loop_length = counter - startflg

            inverse_dict = {v:k for k,v in checked_dict.items()}

            loop_list = [inverse_dict[i] for i in range(startflg,startflg+loop_length)]
            amari = (k-startflg) % loop_length
            print(loop_list[amari])
            exit()
        else:
            que.append(a[x-1])
            checked_dict[x] = counter

if __name__ == '__main__':
    main()

Measured memory_bytes: 125668
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
ll mod = 1000000007;
ll INF = 1000000099;



signed main(){
    int d;
    string s="Christmas";
    cin>>d;
    for(int i=25;21<i;i--)
    {
        if(d==i){
            cout << s << endl;
        }else{
            s+=" Eve";
        }
    }
}



Measured memory_bytes: 256
import Foundation
func toTuple<T>(_ args: [T]) -> (T, T) { (args[0], args[1]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let (d, n) = toTuple(readInts())
var ans = 0
var count = 0
if d == 0 {
  while count < n {
    ans += 1
    if ans % 100 != 0 {
      count += 1
    }
  }
} else if d == 1 {
  while count < n {
    ans += 100
    if !(ans / 100).isMultiple(of: 100) {
      count += 1
    }
  }
} else {
  while count < n {
    ans += 10000
    if !(ans / 10000).isMultiple(of: 100) {
      count += 1
    }
  }
}
print(ans)

Measured memory_bytes: 13424
from itertools import accumulate
N = int(input())
A = list(map(int,input().split()))
ans = 0
mod = 10**9 +7
accum = list(accumulate(A))

for i in range(N-1,0,-1):
    ans += A[i]*accum[i-1]%mod
    ans %= mod
print(ans)


Measured memory_bytes: 102132
# -*- coding: utf-8 -*-

w = int ( input ( ) )
n = int ( input ( ) )

lis = list ( range ( 1, w + 1 ) )
for i in range ( n ):
  ( a, b ) = map ( int, input ( ).split ( "," ) )
  ( lis[ a - 1 ], lis[ b - 1 ] ) = ( lis[ b - 1 ], lis[ a - 1 ] )
for x in lis:
  print ( x )

Measured memory_bytes: 6720
s = input()
t = input()

for i in range(len(t)):
  if not t[i] in s:
    print(-1)
    break
else:
  j = -1
  counter = 0
  for i in range(len(t)):
    if t[i] in s[j+1:]:
      j = s[j+1:].find(t[i]) + j + 1
    else:
      counter += 1
      j = s.find(t[i])
  print(counter * len(s) + j + 1)


Measured memory_bytes: 3316
N = int(input())

t = [0]
x = [0]
y = [0]
for i in range(N):
    t_, x_, y_ = map(int, input().split())
    t.append(t_)
    x.append(x_)
    y.append(y_)

can = True
for i in range(N):
    dt = t[i+1] - t[i]
    dist = abs(x[i+1]-x[i]) + abs(y[i+1]-y[i])
    if dt < dist:
        can = False
    if dist % 2 != dt % 2:
        can = False

if can:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 11816
N, W, *A = map(int, open(0).read().split())
A = zip(*[iter(A)]*2)

# dp[i][j] iまでの品物からいくつか選んで重さの総和がjのときの価値の最大値
dp = [[0]*(W+1) for _ in range(N+1)]

for i, (w, v) in enumerate(A):
    for j in range(W+1):
        if j < w:
            dp[i+1][j] = dp[i][j]
        else:
            dp[i+1][j] = max(dp[i][j], dp[i][j-w]+v)

print(max(dp[N]))

Measured memory_bytes: 119916
#include <iostream>
#include <map>
#include <vector>

#include <algorithm>

using namespace std;

int main()
{
    map<int,int> map_int_int; 
    int test;
    cin >> test;
    
    for(int i = 0; i<test; i++)
    {
    	int bil;
    	cin>> bil;
    	if(!map_int_int[bil]) map_int_int[bil] = 1;
    	else map_int_int[bil]++;
	}
	
	int remove=0;
	for (map<int,int>::iterator it = map_int_int.begin() ; it != map_int_int.end() ; ++it) // mengiterasi semua isi dari map_int_string
    {
        pair<int,int> cur = *it;
//		cout << cur.first;
//		cout << "\n";
//		cout << cur.second;
		if(cur.second>cur.first) remove += cur.second - cur.first;
		else if (cur.second < cur.first) remove += cur.second;
    }
    
    cout << remove << "\n";
}

Measured memory_bytes: 4736
#include <stdio.h>

int main(int argc, char* argv[]) {

	int n, prev, curr;
	int count = 0;
	scanf("%d", &n);
	prev = n % 10;
	n = n / 10;
	count++;
	while(n != 0) {
		curr = n % 10;
		if(prev == curr) {
			count++;
			prev = curr;
		} else {
			count = 1;
			prev = curr;
		}
		if(count == 3) {
			printf("Yes");
			return 0;
		}
		n = n / 10;
	}

	printf("No");

	return 0;
}

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

#define si(v) int(v.size())
#define all(v) v.begin(), v.end()
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n, m) for (ll i = n; i <= (m); ++i)
#define rep3(i, n, m) for (ll i = n; i >= (m); --i)

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; }

using ll = long long;
using ld = long double;
using namespace std;

signed main()
{
  cout << fixed << setprecision(20);
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  string s; cin >> s;
  
  map<char,int> mp;
  rep(i, si(s)) ++mp[s[i]];

  for (auto p : mp) {
    if (p.second % 2) {
      cout << "No\n";
      return (0);
    }
  }

  cout << "Yes\n";
  
  return (0);
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1;} return 0;}
struct init{init(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}}init_;

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 4e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//
using mint = modint998244353;
using P = pair<mint, mint>;

P op(P a, P b) { return P(a.first + b.first, a.second + b.second); };

P mapping(P B, P a) { return P(a.first * B.first + B.second * a.second, a.second); };

P e() { return P(0, 0); }

P com(P A, P B) {
    return {A.first * B.first, A.first * B.second + A.second};
}

P id() { return P(1, 0); }

// ACL template
int main() {
    ll N, Q;
    cin >> N >> Q;
    lazy_segtree<P, op, e, P, mapping, com, id> seg(N);
    rep(i, N){
        ll a;
        cin >> a;
        seg.set(i, P(a, 1));
    }

    rep(_, Q){
        ll q;
        cin >> q;
        if(q == 0){
            ll l, r, b, c;
            cin >> l >> r >> b >> c;
            seg.apply(l, r, P(b, c));
        }else{
            ll l, r;
            cin >> l >> r;
            cout << seg.prod(l, r).first.val() << '\n';
        }
    }
}

Measured memory_bytes: 19276
using System;

namespace ABC_153_A_Csharp_ver
{
    class Program
    {
        static void Main(string[] args)
        {
            var word = Console.ReadLine().Split(' ');
            int H = int.Parse(word[0]);
            int A = int.Parse(word[1]);
            for (int i = 1; i <= H; i++)
            {
                if (H - A * i <= 0)
                {
                    Console.WriteLine(i);
                    break;
                }
            }
            Console.ReadKey();
        }
    }
}

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

//#include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
// using cint = cpp_int;
//#pragma GCC optimize("", on)
//#pragma GCC optimization_level 3

// Define
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ll MOD = 1e9 + 7;
const ll INF = LONG_MAX;
const ull MAX = ULONG_MAX;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define x first
#define y second
#define endl '\n'
#define space ' '
#define def inline auto
#define func inline constexpr ll
#define run __attribute__((constructor)) def _
#define all(v) begin(v), end(v)
#define input(a) scanf("%lld", &(a))
#define print(a) printf("%lld\n", (a))

// Debug
#define debug(...)                                                             \
    {                                                                          \
        cerr << __LINE__ << ": " << #__VA_ARGS__ << " = ";                     \
        for (auto &&X : {__VA_ARGS__}) cerr << "[" << X << "] ";               \
        cerr << endl;                                                          \
    }

#define dump(a, h, w)                                                          \
    {                                                                          \
        cerr << __LINE__ << ": " << #a << " = [" << endl;                      \
        rep(i, h) {                                                            \
            rep(j, w) cerr << a[i][j] << space;                                \
            cerr << endl;                                                      \
        }                                                                      \
        cerr << "]" << endl;                                                   \
    }

#define lldump(a, n) dump(vector<vector<ll>>{a}, 1, n)

// Loop
#define inc(i, a, n) for (ll i = (a), _##i = (n); i <= _##i; ++i)
#define dec(i, a, n) for (ll i = (a), _##i = (n); i >= _##i; --i)
#define each(i, a) for (auto &&i : a)
#define rep(i, n) inc(i, 0, n - 1)
#define loop() for (;;)

// Stream
#define fout(n) cout << fixed << setprecision(n)
#define fasten cin.tie(0), ios::sync_with_stdio(0)

// Speed
run() { fasten, fout(10); }
#pragma GCC optimize("O3")
#pragma GCC target("avx")

// Math
func gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
func lcm(ll a, ll b) { return a * b / gcd(a, b); }
func sign(ll a) { return a ? abs(a) / a : 0; }

def in() {
    ll A;
    cin >> A;
    return A;
}

string S, T, A = "";
signed main() {
    cin >> S >> T;
    rep(i, S.size() + T.size()) {
        if (i & 1) {
            A += T[i / 2];
        } else {
            A += S[i / 2];
        }
    }
    cout << A << endl;
}

// for compilation: g++ -Ofast -march=native -o _ _.cpp -std=c++17


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    ll a,b,x; cin>>a>>b>>x;
    cout<<b/x-(a+x-1)/x+1<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int int64_t
signed main(){
  int l,r,d,ans=0;
  cin>>l>>r>>d;
  for(int i=l;i<=r;i++){
    if(i%d==0) ans++;
  }
  cout<<ans<<"\n";
}

Measured memory_bytes: 3532
#include <map>
#include <algorithm>
#include <cassert>
#include <climits>
#include <complex>
#include <cstdio>
#include <string>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;

template<class T> bool chmin(T &a, T b) { return a>b?(a=b,true):false; }
template<class T> bool chmax(T &a, T b) { return a<b?(a=b,true):false; }
#define forn(i,x,y) for(int i=(x);i<(int)(y);i++)
#define rep(i,y) for(int i=0;i<(int)(y);i++)
#define repb(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)

template<class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << " ";
    os << *it;
  }
  return os;
}

int N;
int a[100100];
// int N;
// int a[100100];
// int main() {
//   ios_base::sync_with_stdio(0); cin.tie(0);
//   cin >> N;
//   rep(i,N) {
//     cin>>a[i];
//   }
//   sort(a,a+N);
//   int mx = a[N-1];
//   int cur = 0;
//   int x = 0;
//   forn(i,1,mx+1) {
//     if (i>a[cur]) cur++;
//     x ^= (N-cur);
//   }
//   if (x != 0) puts("first");
//   else puts("second");
// }

int main() {
  cin >> N;
  string ans = "second";
  rep(i,N) {
    int a; cin>>a;
    if(a%2==1) ans="first";
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define LL long long
#define MEM(x,y) memset(x,y,sizeof(x))
#define MOD(x) ((x)%mod)
#define mod 1000000007
#define pb push_back
#define STREAM_FAST ios::sync_with_stdio(false)

using namespace std;
const int maxn = 2e5+7;
int f[maxn];
struct node
{
    int u,v;LL w;
    node(int u,int v,LL w):u(u),v(v),w(w){}
    node(){}
    bool operator < (const node &rhs) const
    {
        return w<rhs.w;
    }
}edge[maxn];

struct P
{
    int id;LL val;
    P(int id,LL val):id(id),val(val){}
    P(){}
    bool operator < (const P &rhs) const
    {
        return val<rhs.val;
    }
}x[maxn],y[maxn];

int find(int x)
{
    if (x==f[x]) return x;
    return f[x]=find(f[x]);
}

int main()
{
    int n;scanf("%d",&n);
    for (int i=1;i<=2*n;i++) f[i]=i;
    for (int i=1;i<=n;i++)
    {
        scanf("%lld %lld",&x[i].val,&y[i].val);
        x[i].id=y[i].id=i;
    }
    sort(x+1,x+1+n);
    sort(y+1,y+1+n);
    
    int tot=0;
    for (int i=2;i<=n;i++)
    {
        edge[++tot]=node(x[i-1].id,x[i].id,x[i].val-x[i-1].val);
        edge[++tot]=node(y[i-1].id,y[i].id,y[i].val-y[i-1].val);
    }
    
    sort(edge+1,edge+1+tot);
    
    int cnt=0;LL ans=0;
    for (int i=1;i<=tot;i++)
    {
        int u=find(edge[i].u),v=find(edge[i].v);
        if (u!=v)
        {
            ++cnt;
            f[u]=v;
            ans+=edge[i].w;
        }
        if (cnt==n-1) break; 
    }
    printf("%lld\n",ans);
    return 0;
}






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

using namespace std;

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

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

    vector<int> dp(n);
    dp[0] = h[0];
    for(int i = 1; i < n; i++)
        dp[i] = max(h[i], dp[i - 1]);
    int ans = 1;
    for(int i = 1; i < n; i++)
    {
        if(dp[i - 1] <= h[i])
            ans++;
    }

    cout << ans;

    return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2")  //Enable AVX

using namespace std;

using ll = long long;

#define mp make_pair

const int p = 1000000007;


int mul(int a, int b) {
    return (1LL * a * b) % p;
}

int add(int a, int b) {
    int s = (a+b);
    if (s>=p) s-=p;
    return s;
}

int sub(int a, int b) {
    int s = (a+p-b);
    if (s>=p) s-=p;
    return s;
}

int po(int a, int deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    int t = po(a, deg/2);
    return mul(t, t);
}

int inv(int n)
{
    return po(n, p-2);
}

/*struct DSU {
    vector<int> sz;
    vector<int> parent;

    void make_set(int v) {
        parent[v] = v;
        sz[v] = 1;
    }

    int find_set(int v) {
        if (v == parent[v])
            return v;
        return parent[v] = find_set(parent[v]);
    }

    void union_sets(int a, int b) {
        a = find_set(a);
        b = find_set(b);
        if (a != b) {
            if (sz[a] < sz[b])
                swap(a, b);
            parent[b] = a;
            sz[a] += sz[b];
        }
    }

    DSU(int n) {
        sz.resize(n);
        parent.resize(n);
        for (int i = 0; i < n; i++) make_set(i);
    }
};*/

/*const int N = 1000000;

vector<int> facs(N), invfacs(N);

void init()
{
    facs[0] = 1;
    for (int i = 1; i<N; i++) facs[i] = mul(facs[i-1], i);
    invfacs[N-1] = inv(facs[N-1]);
    for (int i = N-2; i>=0; i--) invfacs[i] = mul(invfacs[i+1], i+1);
}

int C(int n, int k)
{
    return mul(facs[n], mul(invfacs[k], invfacs[n-k]));
}*/



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

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

    set<int> vals;
    for (auto it: a) vals.insert(it);
    map<int, int> cnt, minn;
    for (auto it: vals) minn[it] = 1e9;
    for (int i = 0; i<n; i++)
    {
        cnt[a[i]]++;
        minn[a[i]] = min(i, minn[a[i]]);
    }

    vector<int> val(vals.begin(), vals.end());
    reverse(val.begin(), val.end());

    vector<ll> answer(n);

    //for (auto it: val) cout<<it<<' ';
    for (int i = 0; i<val.size() - 1; i++)
    {
        answer[minn[val[i]]]+=1ll*cnt[val[i]]*(val[i]-val[i+1]);
        cnt[val[i+1]]+=cnt[val[i]];
        minn[val[i+1]] = min(minn[val[i+1]], minn[val[i]]);
    }

    answer[0]+=1ll*val.back()*n;
    for (int i = 0; i<n; i++) cout<<answer[i]<<endl;


}

Measured memory_bytes: 16640
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int r = sc.nextInt();
    int g = sc.nextInt();
    int b = sc.nextInt();

    System.out.println(((r * 100) + g * 10 + b) % 4 == 0 ? "YES" : "NO");
  }
}

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

int main(void){
    int n, a[11][11], i, j ;
    cin >> n;
    
    while(n != 0){
        //初期化
        for(i=0; i<=10; i++){
            for(j=0; j<=10; j++){
                a[i][j]=0;
            }
        }
        
        for(i=0; i<n; i++){
            for(j=0; j<n; j++){
                cin >> a[i][j];
                a[i][n] += a[i][j];
                a[n][j] += a[i][j];
                cout << setw(5) << a[i][j];
            }
            a[n][n] += a[i][n];
            cout << setw(5) << a[i][n] << endl;
        }
        for(j=0; j<=n; j++){
            cout << setw(5) << a[n][j];
        }
        cout << endl;
        cin >> n;
    }
    return 0;
}



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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a), 0LL)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
int const inf = 1e9;
ll const INF = 1e18;

inline void ios_(){cin.tie(0); ios::sync_with_stdio(false);}
template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    int m, d;
    cin >> m >> d;
    int ans = 0;
    FOR(i, 1, m+1){
        FOR(j, 1, d+1){
            if((j/10) > 1 && (j%10) > 1 && (j/10) * (j%10) == i) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll          long long
#define endl        "\n"
#define si(a)       scanf("%d",&a)
#define si2(a,b)    scanf("%d%d",&a,&b)
#define sl(a)       scanf("%lld",&a)
#define sl2(a,b)    scanf("%lld%lld",&a,&b)
#define pb          push_back
#define mk          make_pair
#define loop(n)     for(int i=0; i<n; i++)
#define FOR(a,b)    for(int i=a; i<=b; i++)
#define sz          size()
#define ff          first
#define ss          second
#define mem(a,val)  memset(a, val, sizeof(a))
#define md          1000000007
#define pi          acos(-1.0)


int main()
{
   long double a,b,h,m;
   cin>>a>>b>>h>>m;
   h=h*30 + m*.5;
   m=m*6;

   long double dif=abs(m-h);
   long double pp= (pi*dif)/180;

   long double ans= a*a + b*b - 2*a*b*(cos(pp));
   ans= sqrt(ans);

   cout<< setprecision(10)<<fixed<<ans<<endl;
}


Measured memory_bytes: 4176
#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<iostream>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
ll n;
ll a[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
int main(void)
{
	scanf("%lld",&n);
	printf("%lld",a[n-1]);
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<set>
#include<stdio.h>
#include<ctype.h>
using namespace std;
int main()
{
	int a, b;
	cin >> a >> b;
	if (a < 10 && b < 10)
	{
		cout << a*b << endl;
	}
	else
	{
		cout << -1 << endl;
	}
}




Measured memory_bytes: 256
import java.util.*;

public class Main {
	
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int w = sc.nextInt();
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < h; i++) {
			String s = sc.next();
			sb.append(s).append("\n").append(s).append("\n");
		}
		System.out.print(sb);
	}
}


Measured memory_bytes: 21972
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#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;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
 
signed main() {
    int N;
    while(cin >> N, N) {
        // time, lap, velocity
        queue< tuple<int, int, int> > que[2];
        vector< pair<int, int> > info;
        for(int i=0; i<N; i++) {
            int t, c; cin >> t >> c;
            info.emplace_back(t, c);
        }
        sort(info.begin(), info.end());

        for(auto e : info) {
            int a, b; tie(a, b) = e;
            que[0].emplace(0, b, a);
        }

        int ans = 0;
        while(que[0].size() or que[1].size()) {
            int k = (que[0].empty() or (que[1].size() and get<0>(que[1].front()) < get<0>(que[0].front())));

            auto e = que[k].front();
            ans = get<0>(e);
            vector< tuple<int, int, int> > goal;
            while(que[k].size() and get<0>(que[k].front()) <= ans) {
                goal.push_back(que[k].front());
                que[k].pop();
            }

            sort(goal.begin(), goal.end(), [](auto x, auto y) {
                    return get<2>(x) < get<2>(y);
                });

            for(auto e : goal) {
                if(get<1>(e)) {
                    que[1-k].emplace(ans + get<2>(e), get<1>(e) - k, get<2>(e));
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}



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

int main() {
  int n; cin >> n;
  vector<int> num(n);
  for(int i=0; i<n; i++)  cin >> num[i];
  int na, ac=0;
  for(int i=0; i<n; i++){
    cin >> na;
    if(num[i]-na>0) ac+=num[i]-na;
  }
  cout << ac;
}

Measured memory_bytes: 256
// Problem : A - Registration
// Contest : AtCoder - AtCoder Beginner Contest 167
// URL : https://atcoder.jp/contests/abc167/tasks/abc167_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <iostream>
#include <string>
using namespace std;
string s,t;
int main()
{
 cin>>s>>t;
 int l=s.length();
 for(int i=0;i<l;i++)
  if(s[i]!=t[i])
  {
   cout<<"No"<<endl;
   return 0;
  }
 cout<<"Yes"<<endl;
 return 0;
}

Measured memory_bytes: 3592
#include <iostream>
using namespace std;
int main(){
    int n,p,ans=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>p;
        if(i+1!=p) ans++;
    }
    if(ans<=2) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
  int K,N,A[200000+1];
  cin >> K >> N;
  for(int i=0;i<N;i++)cin >> A[i];
  int ans=A[N-1]-A[0];  
  for(int i=1;i<N;i++){
    ans=min(ans,K-A[i]+A[i-1]);
  }
  cout << ans << endl;
  return 0;
}

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

int main() {
  long long N,D;
  cin >> N >> D;
  vector<pair<long long,long long>> V(N);
  for (long long i = 0; i < N; i++)
    cin >> V.at(i).first >> V.at(i).second;
  
  long long count = 0;
  for (long long j = 0; j < N; j++) {
    if ((V.at(j).first)*(V.at(j).first) + (V.at(j).second)*(V.at(j).second)<= D*D)
      count++;
  }
  cout << count << endl;
    
}


Measured memory_bytes: 6428
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000 // 1 billion, safer than 2B for Floyd Warshall’s
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pcont(x) for(auto i: x){cout << i << " ";} cout << "\n";

int main(){
    IOS;
    int a,b,c;
    cin >> a >> b >> c;
    int k;
    cin >> k;
    int rem = k;
    while(b<=a){
        b*=2;
        rem--;
    }
    while(c<=b){
        c*=2;
        rem--;
    }
    if(rem < 0)cout << "No\n";
    else cout << "Yes\n";
    return 0;
}

Measured memory_bytes: 3652