akhauriyash/Code-Regression huggingface dataset:
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define Endl endl

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> using vv=vector<vector<T>>;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
#define out(args...){vector<string> a_r_g_s=s_p_l_i_t(#args, ','); e_r_r(a_r_g_s.begin(), args); }
vector<string> s_p_l_i_t(const string& s, char c) { vector<string> v; stringstream ss(s); string x; while(getline(ss,x,c)) v.emplace_back(x); return move(v);}
void e_r_r(vector<string>::iterator it) {}
template<typename T, typename... Args> void e_r_r(vector<string>::iterator it, T a, Args... args){ if(*it==" 1"||*it=="1") cerr<<endl; else cerr << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << ", "; e_r_r(++it, args...);}
const ll MOD=1e9+7;

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  ll k,s;
  cin>>k>>s; ++k;
  ll re=(s+2)*(s+1);
  if(k<=s) re-=3*(s-k+2)*(s-k+1);
  if(2*k<=s) re+=3*(s-2*k+2)*(s-2*k+1);
  cout<<re/2<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
char s[5];
scanf("%s",s);
if(s[0]==s[1]||s[1]==s[2]||s[2]==s[3]){printf("Bad");}
else{printf("Good");}
return 0;
}

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

#define debug(a) cout << #a << " " << a << endl;
#define _debug(a, i) cout << #a << "[" << i << "]" << " = " << a[i] << endl;
#define fastio ios_base::sync_with_stdio(false); \
			cin.tie(0);							 \
			cout.tie(0);
#define PI 3.141592654

using namespace std;

using ll = long long;
const int MOD = 998244353;
const ll INF = 1e18 + 9;

ll powmod(ll base, ll exp, const ll MOD) { ll ans = 1; while (exp) { if (exp & 1)	ans = (ans * base) % MOD; base = (base * base) % MOD; exp >>= 1; } return ans; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
ll modInverse(ll n, const ll p) { return powmod(n, p - 2, p); }
void add(ll& x, ll v) { x = (x + v) % MOD; if (x < 0) x += MOD; }
//ll f[500005];
//ll kCn(ll k, ll n) { return (f[n] * modInverse((f[n - k] * f[k]) % MOD, MOD)) % MOD; }


void test_case() {
	
}


int main() {
	fastio;
//#ifndef ONLINE_JUDGE
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif // !ONLINE_JUDGE
	int x, n;
	cin >> x >> n;
	if (n == 0) {
		cout << x;
		return 0;
	}
	set<int> s;
	for (int i = -100; i <= 200; ++i)
		s.insert(i);

	for (int i = 0; i < n; ++i) {
		int t;
		cin >> t;
		s.erase(t);
	}
	int mn = 1e9;
	int ans;
	for(auto i : s) {
		if (abs(i - x) < mn) {
			mn = abs(i - x);
			ans = i;
		}	
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 3652
#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cassert>
#include <string>
#include <cstring>
#include <queue>

using namespace std;

#define rep(i,a,b) for(int i = a; i < b; i++)
#define S(x) scanf("%d",&x)
#define S2(x,y) scanf("%d%d",&x,&y)
#define P(x) printf("%d\n",x)
#define all(v) v.begin(),v.end()
#define FF first
#define SS second
#define pb push_back
#define mp make_pair

typedef long long int LL;
typedef pair<int, int > pii;
typedef vector<int > vi;

int main() {
  int n;
  S(n);
  int p = -1;
  int cnt = 0;
  while(n) {
    int r = n % 10;
    n /= 10;
    if(r == p) cnt++;
    else cnt = 1;
    p = r;
    if(cnt >= 3) {
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
  return 0;
}

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

using namespace std;

int main(){
	long long a,b;
	cin>>a>>b;
	char c;
	cin>>c;
	int d;
	cin>>d;
	b*=100;b+=d;
	a=a*b;a/=100;
	cout<<a<<endl;
}



Measured memory_bytes: 3656
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdlib>
#include<cstdio>
#include<utility>
#include<list>
using namespace std;
int main(){
	int n,K;
	cin>>n>>K;
	int l[n],ans=0; for(int i=0;i<n;i++)l[i]=0;
	for(int i=0;i<n;i++)cin>>l[i];

	sort(l, l+n, greater<int>());
	for(int i=0;i<K;i++)ans += l[i];

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


Measured memory_bytes: 256
#include<iostream>
#include<vector>

using namespace std;

int main() {
	int n = 3;
	vector< vector<int> > nbs;

	for (int i = 0; i < 4; i++) {
		vector<int> city;
		nbs.push_back(city);
	}

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

		a--;
		b--;

		nbs[a].push_back(b);
		nbs[b].push_back(a);
	}

	bool ans = true;
	for (int i = 0; i < 4; i++) {
		if (nbs[i].size() == 3) {
			ans = false;
		}
	}

	if (ans) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true);}
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true);}
template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) { return is >> p.first >> p.second;}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << ' ' << p.second;}

ll func(ll i, ll j, int k) {
    return i*i + j*j + k*k + i*j + j*k + k*i;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vi a(n);
    rep(i, sqrt(n)+1) rep(j, sqrt(n)+1) rep(k, sqrt(n)+1) {
        if(func(i+1, j+1, k+1) > n) break;
        a[func(i+1, j+1, k+1)-1]++;
    }

    rep(i, n){
        cout << a[i] << '\n';
    }
}

Measured memory_bytes: 3680
#include <bits/stdc++.h>
using namespace std;
inline long long read(){
	register long long x=0;
	register bool f=0;
	register char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-') f=1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<3)+(x<<1)+c-48;
		c=getchar();
	}
	return f?-x:x;
}
char cr[200];int tt;
inline void print(register long long x,register char k='\n') {
    if(!x) putchar('0');
    if(x < 0) putchar('-'),x=-x;
    while(x) cr[++tt]=x%10+'0',x/=10;
    while(tt) putchar(cr[tt--]);
    putchar(k);
}
const int maxn=233333;
int n;
int k,c,f[maxn],g[maxn];
char s[maxn];
bool v1[maxn],v2[maxn];
int main(){
	n=read();k=read();c=read();
	gets(s+1);
	for(int i=1;i<=n;i++){
		f[i]=s[i]=='o'?i:f[i-1];
	}
	g[n+1]=n+1;
	for(int i=n;i>=1;i--){
		g[i]=s[i]=='o'?i:g[i+1];
	}
	int mx1=0,mx2=0,t=1;
	while(1<=t&&t<=n){
		t=g[t];
		if(1<=t&&t<=n){
			v1[t]=true;
			t+=c+1;
			mx1++;
		}
	}
	t=n;
	while(1<=t&&t<=n){
		t=f[t];
		if(1<=t&&t<=n){
			v2[t]=true;
			t-=c+1;
			mx2++;
		}
	}
	if(max(mx1,mx2)>k) return 0;
	for(int i=1;i<=n;i++) if(v1[i]&&v2[i]) print(i);
	return 0;
}


Measured memory_bytes: 3712
fn input_one<T: std::str::FromStr> () -> Result<T, T::Err> {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).unwrap();
    n.trim().parse()
}

fn main() {
    let n: usize = input_one().unwrap();
    if n % 2 == 1 {
        println!("0");
    } else {
        let mut a = 0;
        let mut b = 10;
        loop {
            if n >= b {
                a += n / b;
                b *= 5;
            } else {
                break;
            }
        }
        println!("{}", a);
    }
}


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

int main(){
  int a; cin >> a;
  int u; u = a/100;
  int l; l = a%100;
  if (1 <= u && u <= 12){
    if (1 <= l && l <= 12){
      cout << "AMBIGUOUS" << endl;
      return 0;
    }
    cout << "MMYY" << endl;
    return 0;
  }
  if (1 <= l && l <= 12){
    cout << "YYMM" << endl;
    return 0;
  }
  cout << "NA" << endl;
  return 0;
}

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

int main() {
 int N,K,T;
  cin >>N >>K;
  vector<int>X(N);
   for (int i = 0; i < N; i++) {
    cin >> X.at(i);
  }
  for (int i=0; i<N; ++i) {
    for (int j=i+1; j<N; ++j) {
      if (X.at(i) > X.at(j)) {
        int M;
        M = X.at(i);
        X.at(i) = X.at(j);
        X.at(j) = M;
      }
    }
  }
  for(int i=0;i<K;i++){
    T=T+X.at(i);
  }
  cout <<T;
    
}


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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

static struct IO {
	char tmp[1 << 5];

#define putChar(c) putc_unlocked((c), stdout)
	inline IO& operator << (const string & s) { for (int i = 0; i < (int)s.size(); ++i) putChar(s[i]); return *this; }


	inline char * toString(ll n) { \
		char * p = (tmp + 30); \
			if (n) { \
				while (n) \
					*--p = (n % 10) + '0', n /= 10; \
			} else *--p = '0'; \
				return p; \
	} \
	inline IO& operator << (ll n) { return (*this) << toString(n); }

#define endl ('\n')
#define cout __io__
#define cin __io__
} __io__;
int ar[32768];
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline",  \
		"tree-vectorize", "openmp", "predictive-commoning")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper",              \
		"D_GLIBCXX_PARALLEL", "openmp")
#include <cstdio>
#include <unistd.h>
#include <sys/mman.h>
char *mmp = (char *) mmap(NULL, lseek(0, 0, SEEK_END), PROT_READ, MAP_PRIVATE, 0, 0);

inline void fs(int& x) {
	x = 0;
	register int c;
	while ((c = *mmp++) < 48);
	while (x *= 10, x += c & 15, (c = *mmp++) >= 48);
}

int cnt[200005];
int main() {
	//cin.tie(0)->sync_with_stdio(0);
	//cin.exceptions(cin.failbit);

	int n; fs(n);
	ll ans = 0;

	rep(i, 1, n + 1) {
		int t; fs(t);
		if (i - t >= 0) ans += cnt[i - t];
		if (t + i <= n) cnt[t + i]++;
	}
	cout << ans;
}


Measured memory_bytes: 5860
#include <bits/stdc++.h>
typedef long long lint;
using namespace std;

int main() {
    lint a, b, c, k;
    cin >> a >> b >> c >> k;
    if (a >= k) {
        cout << k << endl;
    } else if (a + b >= k) {
        cout << a << endl;
    } else {
        cout << a - (k - a - b) << endl;
    }
}

Measured memory_bytes: 3624
//#include <bits/stdc++.h>
//#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>
 
 
#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LINF 1000000000000000000 //9000000000000000000
#define DINF 1000000000000000.0
#define PI 3.14159265358979
#define MAXI 7500000

//.size()はunsigned int　0-1をするとオーバーフローする
 
using namespace std;
typedef long long int ll;
typedef pair< long long int , long long int> P;

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

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

struct edge{long long int to;
long long int cost;};

 
int main(void){

	long long int n,W;
	long long int w[101],v[101];
	long long int maxi=-1;

	vector< vector<long long int > >dp(101,vector<long long int > (100001,LINF));

	cin>>n>>W;
	
	LFOR(i,1,n){
		cin>>w[i]>>v[i];
	}

	dp[0][0]=0;

	LFOR(i,1,n){
		FOR(j,0,1000*n){
			if(j-v[i]>=0){
				dp[i][j]=min(dp[i-1][j],dp[i-1][j-v[i]]+w[i]);
			}else{
				dp[i][j]=dp[i-1][j];
			}
		}
	}

	LFOR(i,0,1000*n){
		if(dp[n][i]<=W){
			maxi=max(maxi,i);
		}
	}

	cout<<maxi<<endl;

}



Measured memory_bytes: 80256
#include <bits/stdc++.h>
#define fastio() ios_base::sync_with_stdio(false);
using namespace std;
typedef long long ll;
typedef long double ld;

const int maxn = 2e5+5;
int n, k;
int a[maxn];
double ev[maxn];

int main(){
	fastio();
	cin >> n >> k;
	
	for(int i = 0; i<n; i++) cin >> a[i];
	for(int i = 0; i<n; i++)
		ev[i] = double((a[i]*(a[i]+1))/2)/double(a[i]);
	int l = 0, r = 0;
	double ps = 0;
	while(r<k) ps+= ev[r++];
	double ans = ps;
	while(r<n){
		ps+= ev[r++];
		ps-= ev[l++];
		ans = max(ans, ps);
	}
	cout << setprecision(9) << fixed << ans << endl;
	
	return 0;
}


Measured memory_bytes: 2560
#include <iostream>
using namespace std;
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true; } return false; }

long long a[100010][3];
long long dp[100010][3];

int main()
{
    int N; cin >> N;
    for (int i = 1; i <= N; i++) cin >> a[i][0] >> a[i][1] >> a[i][2];

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < 3; k++) {
                if (j == k) continue;
                chmax(dp[i+1][j], a[i+1][j] + dp[i][k]);
            }
        }
    }

    long long res = dp[N][0];
    chmax(res, dp[N][1]);
    chmax(res, dp[N][2]);
    cout << res << endl;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define rrep(i,x) for(ll i = (ll)(x)-1;0 <= i; i--)
#define reps(i,x) for(ll i = 1; i < (ll)(x)+1; i++)
#define rreps(i,x) for(ll i = (ll)(x); 1 <= i; i--)
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
const ll INF = numeric_limits<ll>::max()/4;
const int n_max = 1e5+10;

int main(){
    ll a,b; cin >> a >> b;
    ll ans = 0;
    bool ok = false;
    rep(i,n_max){
        if(i * 8 / 100 == a && (i * 10 / 100) == b){
            ans = i;
            ok = true;
            break;
        }
    }

    cout << (ok ? ans : -1) << endl;
}

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

int main(){
  int n, k;
  cin >> n >> k;
  vector<ll> p(n);
  for(int i = 0; i< n; i++) cin >> p[i];
 int sum= 0;
  for(int i = 0; i< k; i++) sum += p[i];
 int ans = sum;
  for(int i = 0; i< n-k; i++){
        sum = sum+p[k+i]-p[i];
        ans = max(ans, sum);
    }
double ans2 = (ans+k)*0.5;
printf("%.10f\n",ans2);
 return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
#define INF 1000000000
#define pb push_back
#define sz(a) int((a).size())
#define all(c) c.begin(), c.end()
#define tr(c, i) for (typeof(c).begin() i = c.begin(); i != c.end(); i++)
#define present(c, x) (c.find(x) != c.end())
#define cpresent(c, x) (find(all(c), x) != c.end())


int vis[200005] = {0},n,current = 0;
vi v[200005];

void dfs(int i){

    if(vis[i]==1) return;
    current++;

    vis[i] = 1;
    int l = v[i].size();
    for(int j=0;j<l;j++){
        dfs(v[i][j]);
    }
}
  



int main() 
{ 
    int m,i,a,b;
    cin>>n>>m;
    
    while(m--){
        cin>>a>>b;
        v[a].push_back(b);
        v[b].push_back(a);
    }

    m = 0;
    for(i=1;i<=n;i++){
        if(vis[i]==0) {
            dfs(i);
            m = max(m,current);
            current = 0;
        }
    }
    cout<<m<<endl;
    return 0; 
} 

Measured memory_bytes: 21528
#include<bits/stdc++.h>
#define ll long long
#define fr(i,x,y) for(int i=(x);i<=(y);i++)
#define rf(i,x,y) for(int i=(x);i>=(y);i--)
#define frl(i,x,y) for(int i=(x);i<(y);i++)
using namespace std;
const int N=504;
const int p=998244353;
int n,a[N],b[N];
ll f[N][N][N];

void read(int &x){ scanf("%d",&x); }

ll qpow(ll sum,ll n){
	ll ans=1;
	for(;n;n>>=1,sum=sum*sum%p) if (n&1) ans=ans*sum%p;
	return ans;
}

ll mul[N],inv[N];
void init(){
	mul[0]=1;
	frl(i,1,N) mul[i]=mul[i-1]*i%p;
	inv[N-1]=qpow(mul[N-1],p-2);
	rf(i,N-2,0) inv[i]=inv[i+1]*(i+1)%p;
}

void Add(ll &x,ll y){
	x+=y;//x%=p;
	if (x<0) x+=p;
	if (x>=p) x-=p;
}

int main(){
	init();
	read(n);
	fr(i,1,n) read(a[i]),read(b[i]);
	int S=0;
	fr(i,1,n) S+=a[i];
	//S=qpow(S,p-2);
	f[0][0][0]=p-1;
	fr(i,1,n){
		fr(j,0,400) fr(k,0,400) f[i][j][k]=f[i-1][j][k];
		fr(j,0,400)
		 fr(k,0,400)
		  frl(x,0,b[i])
		   if (f[i-1][j][k]) Add(f[i][j+x][k+a[i]],p-f[i-1][j][k]*qpow(a[i],x)%p*inv[x]%p);
	}
	ll ans=0;
	fr(j,0,400)
	 fr(k,1,400)
	  Add(ans,mul[j]*f[n][j][k]%p*qpow(k,p-1-j)%p*qpow(k,p-2)%p*S%p);
	cout<<ans<<endl;
	return 0;
}

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = (int)(n); i >= 0; i--)
#define repm(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define repmr(i, m, n) for(int i = (int)(n); i >= (int)(m); i--)
#define all(x) (x).begin(),(x).end()
#define inf 2e9
#define MOD 1000000007

using namespace std;
typedef long long int lli;
typedef long long ll;

int main(){
    int n; cin >> n;
    vector<lli> x(n), y(n), h(n);
    rep(i,n) cin >> x[i] >> y[i] >> h[i];

    int cx, cy;
    bool success;
    lli high;
    rep(i,101){
        cx = i;
        rep(j,101){
            success = true;
            cy = j;
            high = -1;
            rep(k,n){
                if(h[k] != 0){
                    if(high == -1){
                        high = h[k]+abs(x[k]-cx)+abs(y[k]-cy);
                        continue;
                    }
                    lli tmp = h[k]+abs(x[k]-cx)+abs(y[k]-cy);
                    if(high != tmp){
                        success = false;
                        break;
                    }
                }
            }
            if(success){
                rep(k,n){
                    lli tmp = high-abs(x[k]-cx)-abs(y[k]-cy);
                    if(tmp < 0) tmp = 0; 
                    if(tmp != h[k]){
                        success = false;
                        break;
                    }
                }
                if(success) break;
            }
        }
        if(success) break;
    }

    cout << cx << " " << cy << " " << high << endl;

}


Measured memory_bytes: 256
integer::R1(97:122)=-1,R2(97:122)=-1
character(2*10**5) S,T
logical check
read*,S
read*,T

check=.true.
do i=1,len_trim(S)
  if(R1( ichar(S(i:i)) )==-1)then
    R1( ichar(S(i:i)) )=ichar(T(i:i))
  else
    if(R1( ichar(S(i:i)) )/=ichar(T(i:i)))check=.false.
  endif
  if(R2( ichar(T(i:i)) )==-1)then
    R2( ichar(T(i:i)) )=ichar(S(i:i))
  else
    if(R2( ichar(T(i:i)) )/=ichar(S(i:i)))check=.false.
  endif
end do

if(check)then
  print"(A)","Yes"
else
  print"(A)","No"
endif

end

Measured memory_bytes: 1164
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <tuple>
#include <cstdio>
#include <cmath>
using namespace std;
using ll = long long;
const int INF = 999999999;

int main() {
    int N; cin >> N;
    vector<int> A(N), B(N);
    B[N-1] = INF;
    for (int i = 0; i < N - 1; ++i) cin >> B[i];
    for (int i = 1; i < N; ++i) {
        A[i] = min(B[i-1], B[i]);
    }
    A[0] = max(A[1], B[0]);
    int rst = 0;
    for (int i = 0; i < N; ++i) {
        rst += A[i];
    }
    cout << rst << endl;
}


Measured memory_bytes: 256
A, B, Q = gets.split.map(&:to_i)

s = A.times.map do
  gets.to_i
end

t = B.times.map do
  gets.to_i
end

S = [-10**11 - 1] + s + [10**11 + 1]
T = [-10**11 - 1] + t + [10**11 + 1]

X = Q.times.map do
  gets.to_i
end

X.each do |x|
  distance = []
  # 最初に神社
  i = S.bsearch_index {|s| s >= x}
  # pattern1, 2
  j = T.bsearch_index {|t| t >= S[i - 1]}
  distance << (x - S[i - 1]).abs + (S[i-1] - T[j-1]).abs
  distance << (x - S[i - 1]).abs + (S[i-1] - T[j]).abs
  # p "shrine: #{S[i - 1]} template: #{T[j - 1]}"
  # p "shrine: #{S[i - 1]} template: #{T[j]}"
  # pattern3, 4
  j = T.bsearch_index {|t| t >= S[i]}
  distance << (x - S[i]).abs + (S[i] - T[j-1]).abs
  distance << (x - S[i]).abs + (S[i] - T[j]).abs
  # p "shrine: #{S[i]} template: #{T[j - 1]}"
  # p "shrine: #{S[i]} template: #{T[j]}"

  # 最初に寺
  i = T.bsearch_index {|t| t >= x}
  # pattern 5, 6
  j = S.bsearch_index {|t| t >= T[i - 1]}
  distance << (x - T[i - 1]).abs + (T[i - 1] - S[j - 1]).abs
  distance << (x - T[i - 1]).abs + (T[i - 1] - S[j]).abs
  # p "shrine: #{S[j - 1]} template: #{T[i - 1]}"
  # p "shrine: #{S[j]} template: #{T[i - 1]}"
  # pattern 7, 8
  j = S.bsearch_index {|t| t >= T[i]}
  distance << (x - T[i]).abs + (T[i] - S[j - 1]).abs
  distance << (x - T[i]).abs + (T[i] - S[j]).abs

  # p distance
  puts distance.min
end


Measured memory_bytes: 9836
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define pow(x,y) modpow(x,y)
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define RREPS(i,n) for(ll (i)=(n);(i)>0;(i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());

template <class T = int>T in(){
    T x;
    cin >> x;
    return (x);
}

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

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

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int N = in(),Z = in(),W = in();
    vector<int> a(N);
    REP(i,N)a[i] = in();
    if(N > 1){
        cout << max(abs(a[N-1] - W),abs(a[N-2] - a[N-1])) << "\n";
    }else{
        cout << abs(a[N-1] - W) << "\n";
    }
}

Measured memory_bytes: 256
import datetime
s = input()
x, y = map(int, input().split())
#print(datetime.datetime.now())
 
num_of_f = 0
for c in s:
    if c == 'F':
        num_of_f += 1
dp = [[[False] * 32001 for _ in range(2)] for _ in range(2)]
 
dp[0][0][0] = True
dp[0][1][0] = True
# print(dp)
index = 0
while index < len(s) and s[index] == 'F':
    index += 1
x -= index
xy_axis = 1
dp_index = 1
i = index + 1
num_of_f = index
while i < len(s):
    num = 0
    while i < len(s) and s[i] == 'F':
        num += 1
        i += 1
    num_of_f += num
    for j in range(-1 * num_of_f, num_of_f + 1):
        dp[dp_index][xy_axis][j] = dp[(dp_index + 1) % 2][xy_axis][j - num] or dp[(dp_index + 1) % 2][xy_axis][j + num]
    xy_axis = (xy_axis + 1) % 2
    if xy_axis == 1:
        dp_index = (dp_index + 1) % 2
    i += 1
 
# print(dp)
 
if dp[(dp_index + 1) % 2][0][x] and dp[(dp_index + xy_axis) % 2][1][y]:
    print('Yes')
else:
    print('No')
#print(datetime.datetime.now())

Measured memory_bytes: 55432
//おまじない
//#include <bits/stdc++.h>
//#include <stdio.h>
#include <iostream>
//#include <math.h>
#include<iomanip>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#define INF 1e16
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define space ' '
#define pll pair<ll,ll>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

//(int)'a'は97 (int)'A'は65 (int)'1'は49
//おまじない

const int maxn = 100000;

ll n,m;
priority_queue<ll> que;
ll a[maxn];
ll ans=0;

int main(){
    
    cin >> n>>m;
    rep(i,n){
        cin >> a[i];
        ans += a[i];
        que.push(a[i]);
    }
    //cout << ans<<endl;
    rep(i,m){
        ll arg = que.top();que.pop();
        ans = ans-(arg+1)/2;
       //cout << ans<<endl;
        arg = arg/2;
        que.push(arg);
    }
    if(ans<0)ans=0;
    cout << ans <<endl;
    
    return 0;
}


Measured memory_bytes: 1912
import math

def plot(x,y):
    print(f'{x:.8f} {y:.8f}')

def koch(n,x1,y1,x2,y2):
    if n==0:
        plot(x1,y1)
        return
    sx=(2*x1+x2)/3
    sy=(2*y1+y2)/3
    tx=(x1+2*x2)/3
    ty=(y1+2*y2)/3
    ux=(tx-sx)*(1/2)-(ty-sy)*(math.sqrt(3)/2)+sx
    uy=(ty-sy)*(1/2)+(tx-sx)*(math.sqrt(3)/2)+sy
    koch(n-1,x1,y1,sx,sy)
    koch(n-1,sx,sy,ux,uy)
    koch(n-1,ux,uy,tx,ty)
    koch(n-1,tx,ty,x2,y2)

n=int(input())
koch(n,0,0,100,0)
plot(100,0)


Measured memory_bytes: 5748
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define PI 3.14159265358979323846
#define vll vector<long long>
using namespace std;
using ll = long long;
using ld = long double;

// ----本問について----
// 問題：Reverse Polish Notation
// 問題文URL：https://onlinejudge.u-aizu.ac.jp/problems/ALDS1_3_A
// 所要時間：
// 学んだこと：
// ------------------

// ----ここから本問のソースコード----

// グローバル変数（入力）
string s;
stack<ll> sta;

ll TaP() { // Top and Pop
  ll a;
  a = sta.top();
  sta.pop();
  return a;
}

void solve() {
  if (s == "+") {
    sta.push(TaP() + TaP());
  } else if (s == "-") {
    ll a = TaP();
    ll b = TaP();
    sta.push(b - a);
  } else if (s == "*") {
    sta.push(TaP() * TaP());
  } else {
    sta.push((ll)stoi(s));
  }
}

int main() {
  while (cin >> s) {
    solve();
  }
  cout << sta.top() << endl;
  return 0;
}



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

int main(){
  string s,t;
  cin >>s>>t;
  
  sort(s.begin(),s.end());
  sort(t.begin(),t.end(),greater<char>());
  
  string ans;
  s<t ? ans = "Yes" : ans = "No";
  cout <<ans<< endl;
}


Measured memory_bytes: 256
/*
    Author : Nishant Gupta 2.0
*/
#include<bits/stdc++.h>
using namespace std;

#define LL long long int
#define getcx getchar_unlocked
#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define MAX 100005
#define LOG_MAX 20
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL (LL(1e18))
#define chk(a) cerr << endl << #a << " : " << a << endl
#define chk2(a,b) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << endl
#define chk3(a,b,c) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << endl
#define chk4(a,b,c,d) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << "\t" << #d << " : " << d << endl
#define rep(i, a, n) for(i=a;i<n;i++)
#define rev(i, a, n) for(i=a;i>=n;i--)
#define in(x) scanf("%d", &x)
#define inl(x) scanf("%lld", &x)
#define in2(x, y) scanf("%d %d", &x, &y)
#define inl2(x, y) scanf("%lld %lld", &x, &y)
#define MSV(A,a) memset(A, a, sizeof(A))
#define rep_itr(itr, c) for(itr = (c).begin(); itr != (c).end(); itr++)
#define finish(x) {cout<<x<<'\n'; return;}
typedef pair<int, int> pi;
typedef pair<LL, LL> pl;
const char en = '\n';

void solve() {
	int n;
	in(n);
	string s;
	map<string, int> mp;
	for(int i=0;i<n;i++) {
		cin>>s;
		mp[s]++;
	}
	
	cout<<"AC x "<<mp["AC"]<<en;
	cout<<"WA x "<<mp["WA"]<<en;
	cout<<"TLE x "<<mp["TLE"]<<en;
	cout<<"RE x "<<mp["RE"]<<en;
}

int main() {
	int t = 1;
	
	//~cin>>t;
	while(t--) {
		solve();
	}
    return 0;
}


Measured memory_bytes: 3696
S = str(input())

#AKIHABARA のAの有無で全パターン列挙
OK_word_set = set()

for i in range(2**(4)):
    bit_array = str(bin(i)[2:]).zfill((4))
    OK_word = ""

    #print(bit_array)

    if int(bit_array[0]) == 0:
        OK_word += "KI"
    elif int(bit_array[0]) == 1:
        OK_word += "AKI"
        
    if int(bit_array[1]) == 0:
        OK_word += "H"
    elif int(bit_array[1]) == 1:
        OK_word += "HA"
        
    if int(bit_array[2]) == 0:
        OK_word += "B"
    elif int(bit_array[2]) == 1:
        OK_word += "BA"
        
    if int(bit_array[3]) == 0:
        OK_word += "R"
    elif int(bit_array[3]) == 1:
        OK_word += "RA"

    #print(OK_word)   
    OK_word_set.add(OK_word)

#print(OK_word_set)

if S in OK_word_set:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 3064
#include<stdio.h>

int main(void){

int n;
int i,j;
int count=0;
int dummy;

scanf("%d",&n);

int p[n];

for(i=0;i<n;i++){
    scanf("%d",&p[i]);
}
/* for(i=1;i<n;i++){
    if(p[i]==1){
        dummy=p[0];
        p[0]=p[i];
        p[i]=dummy;
        break;
    }
}*/
for(i=0;i<n;i++){
    if(p[i]!=i+1){
        count++;
    }
}
/* for(i=0;i<n;i++){
    //printf("%d\n",p[i]);
}
for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
        if(p[i]>p[j]){
            dummy=p[i];
            p[i]=p[j];
            p[j]=dummy;
            count++;
            //printf("感としましt");
        }
    }
}*/
if(count<=2)
printf("YES");
else
printf("NO");

return 0;

}


Measured memory_bytes: 128
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		for (int i = 0; i <= n - 1; i++) {
			a[i] = sc.nextInt();
		}
	Arrays.sort(a);

	int me=-1+n/2;

System.out.println(a[me+1]-a[me]);
	}}

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


#define INF 1000000000000


signed main()
 {
   int n,k;
   cin>>n>>k;
   int ans=0;
   for(int i=k;i<=n+1;i++){
     int m=0,M=0;
     m=(i-1)*i/2;
     M=(2*n-i+1)*i/2;
     ans+=(M-m+1);
     ans%=1000000007;
   }
cout<<ans;
 }


Measured memory_bytes: 3672
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ll long long
#define ll_MAX LONG_LONG_MAX
#define ll_MIN LONG_LONG_MIN
#define pi pair<int,int>
#define endl "\n"
#define MAXN 100005
#define mod 1000000007
using namespace std;

void solve()
{
    
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);
    solve();
    string s,t;
    cin>>s>>t;
    ll n = s.size();
    ll k = t.size();
    ll ans = 10000;
    for(ll i=0; (i + k)<=n; i++)
    {
        ll diff = 0;
        ll p = 0;
        for(ll j=i; j<(i + k); j++)
        {
            if(s[j] != t[p])
                diff++;
            p++;
        }
        // cout<<diff<<'\n';
        ans = min(ans, diff);
    }
    cout<<ans<<'\n';
}

Measured memory_bytes: 3648
from heapq import heappush, heappop
import collections
import math
import heapq
from collections import defaultdict
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
inf = float("inf")


def main():
    N = int(input())
    E = {}
    for i in range(0, N+1):
        E[i] = []
    for i in range(N-1):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        E[a].append(b)
        E[b].append(a)

    dp = [[0 for i in range(2)] for j in range(100100)]

    def dfs(c, p):
        dp[c][0], dp[c][1] = 1, 1
        for to in E[c]:
            if to != p:
                dfs(to, c)
                dp[c][0] *= dp[to][0] + dp[to][1]
                dp[c][1] *= dp[to][0]

    dfs(0, -1)

    ans = (dp[0][0] + dp[0][1]) % MOD
    print(ans)


if __name__ == '__main__':
    main()


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

namespace _2823
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                if (x[0] == 0 && x[1] == 0) break;
                int[] ret = new int[x[1]+1];
                for (int i = 0; i < x[0]; i++)
                {
                    int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
                    ret[n[0]] = Math.Max(ret[n[0]], n[1]);
                }
                Console.WriteLine(ret.Sum());
            }
        }
    }
}

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

int main()
{
  int K;
  int X;
  cin >> K >> X;
  
  long sum = 500 * K;
  if(sum >= X)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
string s[810];
signed main(){
    int a,b;
    cin>>a>>b;
    for(int i=0;i<a;i++){
        cin>>s[i];
    }
    for(int k=0;k<b+2;k++){
        cout<<"#";
    }
    cout<<endl;
    for(int j=0;j<a;j++){
        cout<<"#";
        cout<<s[j];
        cout<<"#";
        cout<<endl;
    }
    for(int l=0;l<b+2;l++){
        cout<<"#";
    }
    cout<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String str = sc.next();

		int max = 0;
		int x = 0;

		for(int i = 0; i < n; i++){
			x += str.charAt(i) == 'I' ? 1 : -1;
			max = Math.max(x, max);
		}
		System.out.println(max);

    }
}

Measured memory_bytes: 21716
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a=0,b,c,d,e=0,f;
  cin >>a>>b;
  c=a+b,d=a*b;
  if(c==15) cout <<"+\n";
  else{
    if(d==15) cout <<"*\n";
    else cout <<"x\n";
  }
  return 0;
}


Measured memory_bytes: 256
#pragma GCC opointimize("Ofset_asc")
#pragma GCC opointimize("unroll-loops")
#pragma GCC target("avx2")
#pragma GCC opointimize("Os")
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);
#define FO cout.tie(NULL);
#define FI cin.tie(NULL);
#define IN cin>>
#define OUT cout<<
#define loop(i,a,n) for(int i=a; i<n; i++)
#define rloop(i,a,n) for(int i=a; i>=n; i--)
#define endl "\n";
#define pb push_back
#define mp make_pair
#define set_bits(a) __builtin_popcountll(a)
#define ll long long int
#define ld long double
#define vll vector<long long int>
#define pll pair<long long int, long long int>
#define mod 1000000007
#define M 998244353
using namespace std;
ll gcd(ll a, ll b)
{
    return (b?gcd(b,a%b):a);
}
ll P(ll B, ll power, ll modulo)
{
    ll ans=1LL;
    while(power>0LL)
    {
        if(power%2LL==1LL)
        {
            ans=(ans*B)%modulo;
        }
        B=(B*B)%modulo;
        power/=2LL;
    }
    return ans;
}
bool isPrime(ll n)
{
    if(n<=1LL)
    {
        return false;
    }
    if(n<=3LL)
    {
        return true;
    }
    if(n%2==0LL || n%3==0LL)
    {
        return false;
    }
    for(ll i=5LL; (i*i)<=n; i+=6LL)
    {
        if(n%i==0LL || n%(i+2LL)==0LL)
        {
            return false;
        }
    }
    return true;
}
void vok()
{
    FAST
    FO
    FI
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
        // freopen("error.txt","w",stderr);
    #endif
}
int main()
{
    vok();
    int n,k;
    IN n>>k;
    int a[n];
    loop(i,0,n)
    {
        IN a[i];
    }
    sort(a,a+n);
    int ans=0;
    loop(i,0,k)
    {
        ans+=a[i];
    }
    OUT ans<<endl
    return 0;
}

Measured memory_bytes: 3652
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e8;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
map<string,int>tmp;
string s;
int q[8][3]={
	{1,4,0},{0,2,5},{1,3,6},{2,3,7},
	{0,4,5},{1,4,6},{2,5,7},{3,6,7},
};
int main(){
	tmp["01234567"]=1;
	vector<string>out;
	out.pb("01234567");
	while(out.size()){
		//cout<<out.size()<<" "<<out[0]<<endl;
		string s=out[0];
		out.erase(out.begin());
		int d=tmp[s];
		int c;
		rep(i,8)if(s[i]=='0')c=i;
		rep(j,3){
			string w=s;
			swap(w[q[c][j]],w[c]);
			if(!tmp[w]){
				tmp[w]=d+1;
				out.pb(w);
				//cout<<w<<endl;
			}
		}
	}
	string in;
	while(cin>>in){
		string w;
		rep(i,7){cin>>w;in+=w;}
		cout<<tmp[in]-1<<endl;
	}
}

Measured memory_bytes: 3420
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int m, d;
	cin >> m >> d;

	int product_day = 0;
	for (int i = 1; i <= m; ++i) {
		for (int j = 10; j <= d; ++j) {
			if ((j % 10) >= 2 && (j / 10) >= 2 && (j % 10) * (j / 10) == i) {
				++product_day;
			}
		}
	}

	cout << product_day << "\n";

	return 0;

}

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

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

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

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

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

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

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

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;

fn main() {
    input! {
        s: chars,
        t: chars,
    }

    let mut v = vec![None; 26];
    for i in 0..s.len() {
        let index = s[i] as usize - b'a' as usize;
        if v[index].is_none() {
            v[index] = Some(t[i]);
        } else if v[index].unwrap() == t[i] {
            continue;
        } else {
            println!("No");
            return;
        }
    }
    let mut v = vec![None; 26];
    for i in 0..s.len() {
        let index = t[i] as usize - b'a' as usize;
        if v[index].is_none() {
            v[index] = Some(s[i]);
        } else if v[index].unwrap() == s[i] {
            continue;
        } else {
            println!("No");
            return;
        }
    }
    println!("Yes");
}


Measured memory_bytes: 6396
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define all(v) v.begin(),v.end()
#define sort_1(v) sort(v.begin(),v.end())
#define sort_2(v) sort(v.begin(),v.end(),greater<ll>())
#define reverse(v) reverse(v.begin(),v.end())
typedef long long ll;
typedef long double la;
using namespace std;

int main(){
    int A,B,X;
    cin >> A >> B >> X;
    vector<int> ans;
    for(int a = 0; a <= 20; a++){
        for(int b = 0; b <= 40; b++){
            if(1000*a + 500*b >= X){
                ans.pb(A*a + B*b);
                break;
            }
        }
    }
    sort_1(ans);
    cout << ans[0] << endl;
}


Measured memory_bytes: 3160
import java.util.Scanner;

public class Main {

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

		if (a < b) {
			System.out.println("a < b");
		} else if (a > b) {
			System.out.println("a > b");
		} else {
			System.out.println("a == b");
		}
	}
}

Measured memory_bytes: 17160
M = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))

zero = [0] * 60
one = [1] * 60
pow2 = [2 ** i % M for i in range(60)]


def bitcnt(a):
    j = 0
    bits = [0] * 60
    while a:
        bits[j] = a & 1
        a >>= 1
        j += 1
    return bits


ans = 0
a1 = bitcnt(A[0])
a0 = [(x + 1) % 2 for x in a1]
for i in range(1, N):
    a = A[i]
    for j in range(60):
        b1 = a & 1
        a >>= 1
        if b1:
            ans += pow2[j] * a0[j] % M
            a1[j] += 1
        else:
            ans += pow2[j] * a1[j] % M
            a0[j] += 1
        ans %= M

print(ans)


Measured memory_bytes: 123056
#include <map>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

#define to(k) E[k].to
#define next(k) E[k].next
#define fuck_it_up return !puts("-1")

using namespace std ;

typedef long long ll ;

const int N = 200010 ;

int n ;
ll minx ;
int cnt ;
int sz[N] ;
int fa[N] ;
ll dis[N] ;
int head[N] ;
struct tree{
    int id ;
    ll val ;
}base[N] ;
struct Edge{
    int to ;
    int next ;
}E[N * 2] ;
map <ll, int> s ;

bool comp(tree a, tree b){
    return a.val > b.val ;
}
void add(int u, int v){
    to(++ cnt) = v ;
    next(cnt) = head[u] ;
    head[u] = cnt ;
}
void dfs(int x){
    for (int k = head[x] ; k ; k = next(k))
        dis[to(k)] = dis[x] + n - 2 * sz[to(k)], dfs(to(k)) ;
}
int main(){
    cin >> n ;
    for (int i = 1 ; i <= n ; ++ i) sz[i] = 1 ;
    for (int i = 1 ; i <= n ; ++ i){
        scanf("%lld", &base[i].val) ;
        s[base[i].val] = base[i].id = i ;
    }
    sort(base + 1, base + n + 1, comp) ;
    for (int i = 1 ; i < n ; ++ i){
        int x = base[i].id ;
        ll y = base[i].val ;
        int delta = n - 2 * sz[x] ;
        if (delta <= 0) fuck_it_up ;
        if (!s.count(y - delta)) fuck_it_up ;
        fa[x] = s[y - delta] ; minx += sz[x] ;
        sz[fa[x]] += sz[x] ; add(fa[x], x) ;
    }
   // for (int i = 1 ; i <= n ; ++ i) cout << fa[i] << " " ;
    dis[base[n].id] = minx ; dfs(base[n].id) ;
    for (int i = 1 ; i <= n ; ++ i)
        if (dis[base[i].id] != base[i].val) fuck_it_up ;
    for (int i = 1 ; i < n ; ++ i)
        cout << base[i].id << " " << fa[base[i].id] << '\n';
}


Measured memory_bytes: 16896
# -*- coding: utf-8 -*-
def main():
    N, M =  [int(i) for i in input().split()]

    S = []
    for i in range(M):
        S.append([int(i) for i in input().split()])

    S.sort(reverse=True)
    #print(S)
    answer = "0" * N
    if N != 1 and [1, 0] in S:
        print(-1)
        return

    for s in S:
        if answer[int(s[0])-1] == "0":
            answer = answer[:int(s[0])-1] + str(s[1]) + answer[int(s[0]):]
            #print(answer)
        elif answer[int(s[0])-1] != str(s[1]):
            #print(answer)
            print(-1)
            return
        else:
            continue

    if answer[0] == "0" and len(answer) != 1:
        print("1" + answer[1:])
    else:
        print(answer)

if __name__ == "__main__":
    main()


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

struct edge{
    int id,to;
};

vector<edge> G[60];
pair<int,int> bridge[60];

//sからtまで橋bを使わずに移動できるか
bool ok(int s,int t,int b){
    queue<int> que;
    bool seen[60];
    fill(begin(seen),end(seen),false);
    que.push(s);
    while (!que.empty())
    {
        int k=que.front(); que.pop();
        seen[k]=true;
        if(k==t) return true;
        for(int i=0;i<G[k].size();i++){
            if(G[k][i].id!=b && !seen[G[k][i].to]) que.push(G[k][i].to); 
        }
    }
    return false;    
}

int main(){
    int n,m; cin >> n >> m;
    for(int i=1;i<=m;i++){
        int a,b; cin >> a >> b;
        G[a].push_back({i,b});
        G[b].push_back({i,a});
        bridge[i]={a,b};
    }
    int ans=0;
    for(int i=1;i<=m;i++){
        if(!ok(bridge[i].first,bridge[i].second,i)) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;
import java.util.Collections;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    StringBuilder A = new StringBuilder();
    for (int i = 0; i < S.length(); i++) {
      A.append('x');
    }
    System.out.println(A);
  }
}


Measured memory_bytes: 23124