akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<map>
#include<string>
#define ll long long
using namespace std;
int main(){
     int N,sum;
     int C[25], V[25];
     cin >> N;
     sum = 0;
     for(int i = 0; i < N; i++){
          cin >> V[i];
     }
     for(int i = 0; i < N; i++){
          cin >> C[i];
          if(V[i] - C[i] > 0){
               sum += V[i] - C[i];
          }
     }
     cout << sum << endl;
     return 0;
}

Measured memory_bytes: 256
import numpy as np

bingo_list=[list(map(int,input().split())) for i in range(3)]


flag = False
n = int(input())
n_list=[list(map(int,input().split())) for i in range(n)]
bingo_list=np.asarray(bingo_list)

for j in n_list:
    if j in bingo_list:
        bingo_list = np.where(bingo_list==j, 0, bingo_list)


for i in range(3):
    if sum(bingo_list[i]) == 0 or sum(bingo_list[:, i]) == 0:
        flag = True
        break

a = (bingo_list[0][0]+bingo_list[1][1]+bingo_list[2][2])
b = (bingo_list[0][2]+bingo_list[1][1]+bingo_list[2][0])
if(a == 0 or b == 0):
    flag = True

if(flag == True):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 13408
#include <bits/stdc++.h>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define stdi(in) freopen(in, "r", stdin)
#define stdo(out) freopen(out, "w", stdout)
#define stdio(in, out) stdi(in); stdo(out)
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define MAX 100007
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
#define ordered_set tree<int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

ll arr[405], presum[405];
ll dp[405][405];
int n;

ll solve(int l, int r){
    if(l>r) return 0;

    if(l==r) return 0;

    if(dp[l][r]!=-1) return dp[l][r];

    ll ans = 2e18;
    

    for(int i=l;i<r;i++){
        ans = min(ans, solve(l,i)+solve(i+1, r));    
    }

    return dp[l][r] = presum[r]-presum[l-1]+ans;

}


int main(){
    /*#ifndef ONLINE_JUDGE
        stdio("in", "out");
    #endif*/

    cin>>n;
    memset(dp, -1, sizeof(dp));
    presum[0] = 0;
    for(int i=1;i<=n;i++){
        cin>>arr[i];
        presum[i] = presum[i-1]+arr[i];
    }

    cout<<solve(1, n)<<'\n';
    

    return 0;   
}

Measured memory_bytes: 1536
import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		try {
			String packageName = new Main().getClass().getPackage().getName();
			System.setIn(new FileInputStream("src/" + packageName + "/input.txt"));
			// System.setOut(new PrintStream(new FileOutputStream("src/" + packageName + "/result.txt")));
		} catch (FileNotFoundException e) {
		} catch (NullPointerException e) {
		}
		new Main().run();
	}

	void tr(Object... os) {
		System.err.println(deepToString(os));
	}

	Scanner sc;
	void run() {
		sc = new Scanner(System.in);
		int T = sc.nextInt();
		while (T -- > 0) solve();
	}
	void solve() {
		int sx = sc.nextInt();
		int sy = sc.nextInt();
		int lenx = sc.nextInt();
		int leny = sc.nextInt();

		int ans = 0;
		int M = sc.nextInt();
		for (int i = 0; i < M; i++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (sx <= x && x <= sx + lenx && sy <= y && y <= sy + leny) ans++;
		}
		System.out.println(ans);
	}

}

Measured memory_bytes: 12000
#include<iostream>
using namespace std;
int main(){
  int A,B,C,K;
  cin >> A >> B >> C >> K;
  if(K < A) cout << K << endl;
  else if(K-A-B <= 0) cout << A << endl;
  else cout << A - (K-A-B) << endl;
  return 0;
}

Measured memory_bytes: 3632
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
int main(){
  long long a,b,c,x,y;
  cin>>a>>b>>c>>x>>y;
  c *= 2;
  if (a + b <= c){
    cout<<a * x + b * y;
    return 0;
  }
  if ((a <= c) and (b <= c)){
    if (x >=y) cout<<y * c + (x - y) * a;
    else cout<<x * c + (y - x)*b;
    return 0;
  }
  if ((a >= c) and (b >= c)){
  	if (x >= y) cout<<x * c;
  	else cout<< y * c;
  	return 0;
  }
  if ((a >= c) and (b <= c)){
  	if (y >= x) cout<<x * c + (y - x)*b;
  	else cout<<x * c;
  	return 0;
  }
  if ((a <= c) and (b >= c)){
  	if (x >= y) cout<<y * c + (x - y)*a;
  	else cout<<y * c;
  	return 0;
  }
}

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

using namespace std ;

typedef long long ll ;
int n ;
char s[1000] ;
int count[30] ;


int main(void){
//	freopen("1.txt","r",stdin) ;
	scanf("%s",s) ;
	n = strlen(s) ;
	int mmin = 10000 ;
	for(int i=0; i<26; i++) {
		char ch = 'a' + i ;
		int loc = 0,t = 0, maxlen = 0 ;
		while(loc<n) {
			if(s[loc]==ch) loc ++ ;
			if(loc>=n) break ;
			t = 0 ;
			while(s[loc]!=ch) {
				loc++ ; t++ ;
				if(loc>=n) break ;
			}
			if(t>maxlen) maxlen = t;
		}
		if(mmin>maxlen) mmin = maxlen ;
	}
	printf("%d\n",mmin) ;

	return 0 ;
}

Measured memory_bytes: 128
<?php
list($h,$w)=fscanf(STDIN,"%d %d");
$pastRange=array(-1,-1);
$ansflg=false;
for($i=0;$i<$h;++$i){
    $input=trim(fgets(STDIN));
    $start=strpos($input,"#");
    $end=strrpos($input,"#");
    if(($start>$pastRange[0]&&$end>$pastRange[1])||($start===$pastRange[1]&&$start<=$end)){
        $ansflg=true;
        $pastRange=array($start,$end);
    }else{
        $ansflg=false;
        break;
    }
}
if($ansflg){
    echo "Possible";
}else{
    echo "Impossible";
}
?>


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

int main() {
  int N;
  cin >> N;
  int ans;
  if(N<10) ans=N;
  else if(N<100) ans=9;
  else if(N<1000) ans=N-90;
  else if(N<10000) ans=909;
  else if(N<100000) ans=N-9090;
  else ans=90909;
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define fio ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
// #define y1 asdf__y1;

const int N = 2e5+5;
pii P[N];
int X1,X2,Y1,Y2,n;

vector<pii> ir;
set<int> cc;
map<int,int> lab;
int A[N];

//point SET update, range MAX query
template <class T>
struct segt {
	int N;
	vector<T> t;
	segt(int N):N(N),t(2*N){}

	constexpr static T NONE = numeric_limits<T>::lowest();
	static inline T combine(T a, T b) {return max(a,b);}

	//update point i
	void update(int i, T val) {
		for(t[i+=N] = val;i>1;i>>=1)
			t[i>>1] = combine(t[i],t[i^1]);
	}

	//query range [l,r]
	T query(int l, int r) const {
		T ans = NONE;
		if(r < l) return 0;
		for(l+=N,r+=N+1;l<r;l>>=1,r>>=1) {
			if(l&1) ans = combine(ans,t[l++]);
			if(r&1) ans = combine(ans,t[--r]);
		}
		return ans;
	}
};

segt<int> t(0);

const bool dbg = 0;

int main() {	
	scanf("%d%d%d%d",&X1,&Y1,&X2,&Y2);
	scanf("%d",&n);
	for(int i = 0; i < n; ++i)
		scanf("%d%d",&P[i].fi,&P[i].se);
	if(X1 > X2) {
		X1 = -X1, X2 = -X2;
		for(pii &p : P)
			p.fi = -p.fi;
	}
	if(Y1 > Y2) {
		Y1 = -Y1, Y2 = -Y2;
		for(pii &p : P)
			p.se = -p.se;
	}
	for(int i = 0; i < n; ++i) {
		pii p = P[i];
		if(X1 <= p.fi && p.fi <= X2 && Y1 <= p.se && p.se <= Y2) {
			ir.pb(p);
			cc.insert(p.se);
		}
	}
	int ctr = 0;
	for(int a : cc)
		lab[a] = ctr++;
	sort(ir.begin(),ir.end());
	n = ir.size();
	t = segt<int>(n);
	int ans = 0;
	for(int i = 0; i < n; ++i) {
		int a = lab[ir[i].se];
		int bst = 1+t.query(0,a);
		t.update(a,bst-t.query(a,a));
		ans = max(ans,bst);
	}
	long double pi = 2*acosl(0);
	long double ra = (long double)(Y2-Y1 + X2-X1) * 100.0;
	if(ans == Y2-Y1+1 || ans == X2-X1+1) {
		ra += 10*pi-20;
		--ans;
		if(dbg) cout << "1 bad\n";
	}
	ra += (5*pi-20) * ans;
	if(dbg) cout << ans << " good\n";
	printf("%.20lf\n",double(ra));
}

Measured memory_bytes: 23664
#include<bits/stdc++.h>
using namespace std;
#define LL long long
const int maxn=1e5+10;
int q[maxn];
int h[maxn];
int a[maxn];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	q[1]=a[1];
	h[n]=a[n];
	for(int i=2;i<=n;i++)
		q[i]=__gcd(a[i],q[i-1]);
	for(int i=n-1;i>=1;i--)
		h[i]=__gcd(h[i+1],a[i]);
	int maxx=h[2];
	maxx=max(maxx,q[n-1]);
	for(int i=2;i<=n-1;i++)
		maxx=max(maxx,__gcd(q[i-1],h[i+1]));
	printf("%d",maxx);
}

Measured memory_bytes: 1408
#include<iostream>
#include <list>
#include<stack>
#include<queue>
#include <vector>
#include <set>
#include <map>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<string>
#include <functional>
#include"time.h"
using namespace std;

#define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define LL long long
#define CLR(a) memset((a),0,sizeof(a))
#define SZ(x) (int((x).size()))
#define dump(x)  cerr << #x << " = " << (x) << endl
const int INF = (1 << 30);

//毎回変える場所
#define N_MAX 200


//問題文のとおり
int N, M, K;

int main() {
	cin >> N >> M >> K;
	REP(i, M+1)REP(j, N+1) {
		if (i*N + j*M - i*j*2 == K)
			goto clear;
	}
	cout << "No" << endl;
	cin >> N;
	return 0;
clear:
	cout << "Yes" << endl;
	cin >> N;
	return 0;
}

Measured memory_bytes: 256
k,s = map(int, input().split())
a = (s+2)*(s+1)/2
b = (s-k+1)*(s-k)/2
c = (s-2*k)*(s-2*k-1)/2
 
if s <= k:
    print(int(a))
elif s <= 2*k+1:
    print(int(a-3*b))
elif s <= 3*k:
    print(int(a-3*b+3*c))

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

#define fi first
#define se second
#define pb push_back
#define mod(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	char c; cin >> c;
	if(c >= 'A' && c <= 'Z'){
		cout << 'A' << '\n';
		return 0;
	}
	cout << 'a' << '\n';
	return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/


Measured memory_bytes: 3644
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
  
  int N;cin>>N;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin>>vec[i];
  }
  
  
  int ans=0;
  
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;j++){
      ans+=vec[i]*vec[j];
    }
  }
  
  cout<<ans<<endl;
}

Measured memory_bytes: 3568
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a[3];
  int k;
  for(int i=0;i<3;i++){
    cin>>a[i];
  }
  cin>>k;
  sort(a,a+3);
  for(int i=0;i<k;i++){
    a[2]*=2;
  }
  cout<<a[0]+a[1]+a[2]<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF pow(10, 9) + 7
#define rep(i, N) for(ll i = 0; i < N; i++)
#define rep2(i, j, k) for(ll i = j; i < k; i++)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define chmax(x, y) x = max(x, y)
#define print(x) cout << x << "\n"
#define printv(vec) rep(i, vec.size()) cout << vec[i] << " "
#define ALL(v) v.begin(), v.end()
#define SUM(v) accumulate(ALL(v), 0)
#define MAX(v) *max_element(ALL(v))
#define MIN(v) *min_element(ALL(v))
#define SORT(v) sort(ALL(v))
#define REV(v) reverse(ALL(v))
typedef long long ll;
using namespace std;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vs = vector<string>;
using vvs = vector<vector<string>>;

void solve(){
	
	ll n, s, H;
	vl x(105), y(105), h(105);
	ll z = 0;

    cin >> n;
    rep(i, n){
        cin >> x[i] >> y[i] >> h[i];
        if(h[i]) s = i;
    }
	
    rep(i, 101){
        rep(j, 101){
            H = h[s] + abs(x[s] - i) + abs(y[s] - j);
            bool flg = 1;
            rep(k, n){
                if(max(H - abs(i - x[k]) - abs(j - y[k]), z) != h[k])  flg = 0;
            }
            if(flg && H){
                cout << i << " " << j << " " << H << endl;
                return;
            }
        }
    }	

}	

int main(){
    
    fastio;
	solve();
    
	return 0;
	
}


Measured memory_bytes: 3664
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        
        System.out.println(b + Math.min(1+a+b, c));
    }
}

Measured memory_bytes: 21844
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<utility>
#include<memory>
#include<cmath>
#include<stack>
#include<tuple>
#include<numeric>
#include<cassert>

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define pb push_back
#define DEBUG false

using namespace std;

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

const int mod=1e9+7,INF=1<<30;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll LINF=1LL<<60;
const int MAX_N = 5003;
const ll lmod = 1e9+7;

int N,K,a[MAX_N];
bool dp[MAX_N*2];

int main(){
  scanf("%d%d",&N,&K);
  int temp = 0;
  a[temp++] = 0; //dummy
  rep(i,N){
    int b;
    scanf("%d",&b);
    if(b<K) a[temp++] = b;
  }
  N = temp;
  sort(a,a+N);
  a[N] = K; //dummy
  int l = 0,r = N+1,mid;
  while(abs(r-l)>1){
    mid = (l+r)/2;
    fill(dp,dp+K,false);
    dp[0] = true;
    rep(j,N){
      if(j==mid) continue;
      for(int k=K; k>=a[j]; k--){
        dp[k] |= dp[k-a[j]];
      }
    }
    bool need = false;
    REP(j,K-a[mid],K) need |= (dp[j]);
    if(!need) l = mid;
    else r = mid;
  }
  cout << l << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int a[25][25],h,w,di[4]={-1,0,0,1},dj[4]={0,-1,1,0},mx,c[25][25];
queue<tuple<int,int,int>> q;
int main(){
    scanf("%d %d",&h,&w);
    for(int i=0;i<h;i++){
        scanf("\n");
        for(int j=0;j<w;j++){
            char c;
            scanf("%c",&c);
            a[i][j]=(c=='#');
        }
    }
    for(int i=0;i<h;i++)for(int j=0;j<w;j++)if(!a[i][j]){
        q.emplace(i,j,0);
        for(int k=0;k<h;k++)for(int l=0;l<w;l++)c[k][l]=0;
        c[i][j]=1;
        while(!q.empty()){
            int x,y,cst;
            tie(x,y,cst)=q.front();
            q.pop();
            for(int k=0;k<4;k++){
                int xx=x+di[k],yy=y+dj[k];
                if(xx<0||xx>=h||yy<0||yy>=w)continue;
                if(!a[xx][yy]&&!c[xx][yy]){
                    c[xx][yy]=1;
                    q.emplace(xx,yy,cst+1);
                    mx=max(mx,cst+1);
                }
            }
        }
    }
    printf("%d",mx);
}

Measured memory_bytes: 256
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("O3")
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
#include<set>
#include<vector>
#include<sstream>
#include<queue>
#include <iomanip>
#include<unordered_set>
#include <stack>
#include <unordered_map>
#include <map>
#include<numeric>
constexpr auto INF = 9223372036854775807;
typedef long long int ll;
typedef unsigned long long int ull;
typedef unsigned long int ul;
#define f(i,a,b) for(ll i=(ll)a;i<(ll)b;i+=1)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i-=1)
#define endl '\n'
#define N 1000000007 // prime modulo value 
#define M 998244353
#define all(x) x.begin(),x.end()
#define mkp(a,b) make_pair(a,b)
using namespace std;

inline int mex(unordered_set<int> st)
{
	int m = 0;
	while (st.find(m) != st.end())
	{
		m += 1;
	}
	return m;
}
inline int calculateGrundy(int n)
{
	if (n == 1)
		return 0;
	unordered_set<int> mexi;
	for (int i = 1; i <= sqrt(n); i += 1)
	{
		if (n % i == 0)
		{
			if (n / i != n)
				mexi.insert(calculateGrundy(n / i));
			mexi.insert(calculateGrundy(i));
		}
	}
	return mex(mexi);
}
inline ll gcd(ll a, ll b)
{
	// This is code taken from geeksforgeek
	if (b == 0)
		return a;
	return gcd(b, a % b);
}
ll power(ll x, ll y)
{
	// This is code taken from geeksforgeek
	ll res = 1;

	x = x;
	if (x == 0) return 0;
	while (y > 0)
	{
		if (y & 1)
			res = (res * x);
		y = y >> 1;
		x = (x * x);
	}
	return res;
}
/*ll power(ll x, ll y, ll p)
{
	ll res = 1;

	x = x % p;

	while (y > 0)
	{

		if (y & 1)
			res = (res * x) % p;

		y = y >> 1;
		x = (x * x) % p;
	}
	return res;
}

*/
ll modInverse(ll n, ll p)
{
	return power(n, p - 2);
}

ll nCrModPFermat(ll n, ll r, ll p)
{
	if (r == 0)
		return 1;

	vector<ll> fac(n + 1, 0);
	fac[0] = 1;
	for (ll i = 1; i <= n; i++)
		fac[i] = fac[i - 1] * i % p;

	return (fac[n] * modInverse(fac[r], p) % p *
		modInverse(fac[n - r], p) % p) % p;
}

bool check(ll a)
{
	ll count = 0;
	while (a % 2 == 0)
	{
		a /= 2;
		count += 1;
	}
	if (count > 1)
		return false;
	bool flag = true;
	for (ll i = 3; i <= sqrt(a); i += 2)
	{
		if (a % i == 0)
		{
			flag = false;
			break;
		}
	}
	return flag;
}
ll sum(ll n)
{
	return (n * (n + 1)) / 2;
}

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	ll n, xr = 0;
	cin >> n;
	vector<ll> arr(n, 0);
	f(i, 0, n)
	{
		cin >> arr[i];
		xr ^= arr[i];
	}
	f(i, 0, n-1)
	{
		cout << (xr ^ arr[i]) << " ";
	}
	cout << (xr ^ arr[n - 1]);
	return 0;
}

Measured memory_bytes: 4788
#include <stdio.h>

int n, a, b, sd, num, total=0;
bool flag;

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

    for(int i=1; i<= n; i++){
        flag = true;
        sd = 0;
        num = i;
        while(num != 0){
            sd += num%10;
            num = num/10;
        }
        if(sd >= a && sd <= b){
            total += i;
        }
    }
    printf("%d\n", total);
}


Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String O = sc.next();
		String E = sc.next();
		String Osplit[]  = O.split("");
		String Esplit[]  = E.split("");

		if(O.length() == E.length()) {
		for(int i = 0; i < (Osplit.length) ;i++) {
			System.out.print(Osplit[i]+Esplit[i]);
		}
		}
		if(O.length() > E.length()) {
			for(int i = 0; i < (Osplit.length-1) ;i++) {
				System.out.print(Osplit[i]+Esplit[i]);
			}
			System.out.print(Osplit[O.length()-1]);

		}
		if(E.length() > O.length()) {
			for(int i = 0; i < (Osplit.length) ;i++) {
				System.out.print(Osplit[i]+Esplit[i]);
			}
			System.out.print(Osplit[E.length()-1]);

		}



	}

}


Measured memory_bytes: 21844
<?php
fscanf(STDIN,"%d",$a);
  if((1 <= $a)&&(81 >= $a)){
    if((1 <= $a)&&(9 >= $a)){
    echo 'Yes';
  }else{
    $b = $a / 2;
    if (is_int($b)&&(9 >= $b)) {
      echo 'Yes';
    }else{
      $c = $a / 3;
      if (is_int($c)&&(9 >= $c)) {
        echo 'Yes';
      }else{
        $d = $a / 4;
        if (is_int($d)&&(9 >= $d)) {
          echo 'Yes';
        }else{
          $e = $a / 5;
          if (is_int($e)&&(9 >= $e)) {
            echo 'Yes';
          }else{
            $f = $a / 6;
            if (is_int($f)&&(9 >= $f)) {
              echo 'Yes';
            }else{
              $g = $a / 7;
              if (is_int($g)&&(9 >= $g)) {
                echo 'Yes';
              }else{
                $h = $a / 8;
                if (is_int($h)&&(9 >= $h)) {
                  echo 'Yes';
                }else{
                  $j = $a / 9;
                  if (is_int($j)&&(9 >= $j)) {
                    echo 'Yes';
                  }else{
                    echo 'No';
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  }else{
      echo 'No';
    }
?>


Measured memory_bytes: 3576
def main():
    N = int(input())
    A = [int(input()) for i in range(N)]
    A.sort()
    BIG, SMALL = -1, 0
    big_index = N-1
    small_index = 0

    left = A[big_index]
    left_sign = BIG
    right = A[big_index]
    right_sign = BIG
    big_index-=1
    result = 0
    for i in range(1, N):
        val1, val2 = 0, 0
        s = A[small_index]
        b = A[big_index]
        against1, against2 = 0, 0
        if left_sign == BIG:
            val1 = abs(left - s)
            against1 = SMALL
        else:
            val1 = abs(left - b)
            against1 = BIG
        if right_sign == BIG:
            val2 = abs(right - s)
            against2 = SMALL
        else:
            val2 = abs(right - b)
            against2 = BIG
        if val1 > val2:
            result += val1
            if against1 == BIG:
                left = b
                left_sign = against1
                # print(b)
                big_index -= 1
            else:
                left = s
                left_sign = against1
                # print(s)
                small_index += 1
        else:
            result += val2
            if against2 == BIG:
                right = b
                right_sign = against2
                # print(b)
                big_index -= 1
            else:
                right = s
                right_sign = against2
                # print(s)
                small_index += 1
    print(result)



if __name__ == "__main__":
    main()

Measured memory_bytes: 51416
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <set>

using namespace std;

char st[100010];


int main()
{
    int n;scanf("%d",&n);
    scanf("%s",st);
    int ans=1;
    for (int i=1;i<n;++i)
    if (st[i]!=st[i-1])
        ++ans;
    printf("%d\n",ans);


}


Measured memory_bytes: 384
//15:32
#include <stdio.h>
#include <string.h>
#include <algorithm>

typedef long long ll;
ll max(ll a, ll b){return(a>b)?a:b;}
ll min(ll a, ll b){return(a<b)?a:b;}
ll abs(ll a){return(a<0)?-a:a;}

ll gcd(ll a, ll b){
        if(b > a){
                ll tmp = b;
                b = a;
                a = tmp;
        }
        if(b == 0) return a;
        else return gcd(b, a%b);
}
ll lcm(ll a, ll b){
        ll gcdi = gcd(a,b);
        return a/gcdi*(b);
}

#define MOD (1000000000+7)
int main(){
        int N;
        scanf("%d",&N);

        char cnt[8];
        memset(cnt,0,sizeof(cnt));
        int score;
        int cnt32 = 0;

        for(int i = 0; i < N; i++){
                scanf("%d",&score);
                if(score >= 3200) cnt32++;
                else cnt[score/400] = 1;
        }
        int total = 0;
        for(int i = 0; i < 8; i++){
                total += cnt[i];
        }
        if(total == 0){
                printf("%d %d\n", 1, cnt32);
        }else{
                printf("%d %d\n", total, total+cnt32);
        }
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

constexpr int M = 5014;

int dp[M][M];

void print() {
	for (int j = 10; j >= 0; --j) {
		for (int i = j-1; i >= 0; --i) {
			printf("i = %d, j = %d, dp = %d\n",i,j,dp[i][j]);
		}
		cout<<endl;
	}
}

int main(int argc, char const *argv[]) {
	int n; string s;
	cin>>n>>s;

	memset(dp,0,sizeof(dp));

	for (int j = n-1; j >= 0; --j) {
		for (int i = j; i >= 0; --i) {
			if (s[i] == s[j]) {
				dp[i][j] = min(dp[i+1][j+1]+1,j-i);
			}
		}
	}

	// print();

	int ans = 0;

	rep(i,M) {
		rep(j,M) {
			ans = max(ans,dp[i][j]);
		}
	}

	cout << ans << endl;

	return 0;
}

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

#include<cstdio>
#include<cstring>
#include<string>

int main(){
  string s, t, p, com;
  int q, a, b;

  cin >> s >> q;

  for (int i=0; i<q; i++){
    cin >> com >> a >> b;
    if (com=="print"){
      cout << s.substr(a, b-a+1) << "\n";
    }
    if (com=="reverse"){
      t=s;
      for (int j=a; j<=b; j++){
	t[j]=s[b-j+a];
      }
      s=t;
    }
    if (com=="replace"){
      cin >> p;
      t=s;
      s=t.substr(0, a)+p+t.substr(b+1,t.size()-b-1);
    }
  }

  return 0;
}

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

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

#define ALL(x) begin(x), end(x)
#define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i)

void solve(ll N, vector<ll> d) {
  int ans{};
  for (auto i = 0; i != N; ++i) {
    for (auto j = i + 1; j < N; ++j) {
      ans += d[i] * d[j];
    }
  }
  cout << ans << endl;
}

int main() {
  ll N;
  cin >> N;
  vector<ll> d(N);
  for (int i = 0; i < N; i++) {
    cin >> d[i];
  }
  solve(N, move(d));
  return 0;
}


Measured memory_bytes: 256
s = input()
n = 1
a = True
for c in s:
    if n % 2 == 0:
        if c == "L" or c == "U" or c == "D":
            n += 1
            continue
        else:
            a = False
            break
    else:
        if c == "R" or c == "U" or c == "D":
            n += 1
            continue
        else:
            a = False
            break
if a:
    print("Yes")
else:
    print("No")

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

int main() {
    int w, h, n;
    cin >> w >> h >> n;
    int u = h, d = 0, l = 0, r = w;
    for (int i = 0; i < n; i++) {
        int x, y, a;
        cin >> x >> y >> a;
        switch (a) {
        case 1:
            l = max(l, x);
            break;
        case 2:
            r = min(r, x);
            break;
        case 3:
            d = max(d, y);
            break;
        case 4:
            u = min(u, y);
            break;
        }
    }

    cout << (r-l > 0 && u-d > 0 ? (r-l) * (u-d) : 0) << endl;
}


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

using namespace std;

using ll = long long;

template<typename T> using V = std::vector<T>;
using Vi = V<int>;
using VVi = V<V<int>>;
using Vl = V<ll>;
using VVl = V<V<ll>>;
using Vs = V<string>;

template<typename T1, typename T2> using P = std::pair<T1, T2>;
using Pii = P<int, int>;
using Pll = P<ll, ll>;
using Pdd = P<double, double>;

template<typename T1, typename T2> using M = std::map<T1, T2>;
using Mii = M<int, int>;
using Mll = M<ll, ll>;
using Msi = M<string, int>;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define REP2(i,s,e) for(int i=(int)(s);i<(int)(e);++i)
#define RREP(i,s,e) for(int i=(int)(s);i>=(int)(e);--i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin(),ie=(c).end();i!=ie;++i)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin(),ie=(c).rend();i!=ie;++i)
#define ALL(c) (c).begin(), (c).end()

const double PI = acos(-1);
const ll MOD = 1e9+7;

ll n, k;

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

    ll res = 0;
    REP2(i, k, n+1) {
        res += n*(n+1)/2 - (n-i)*(n-i+1)/2 - (ll)(i-1)*i/2 + 1;
        res %= MOD;
    }
    cout << res+1 << '\n';

    return 0;
}


Measured memory_bytes: 3620
num = int(input())
a = list(map(int, input().split()))
k = 1
x = y = 0
c = a[0]
for i in a[1:]:
    if c < i:
        x = 1
    elif c > i:
        y = 1
    if x == 1 and y == 1:
        k += 1
        x = y = 0
    c = i
print(k)

Measured memory_bytes: 20128
#include<iostream>
#include<algorithm>
using namespace std;
int a[40009],b,n,m,miku;
int main()
{

cin>>b>>n>>m;
for(int i=1;i<=b;i++){cin>>a[i];if(a[i]<n||a[i]>=m)miku++;
}
cout<<miku<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>

using namespace std;

long long int a[200010];

int main()
{
    int n,i;
    while(cin>>n)
    {
        long long int x,y,s=0,min1;
        for(i=0;i<n;i++)
        {
            cin>>a[i];
            s=s+a[i];
        }
        x=a[0];
        y=s-x;
        min1=fabs(x-y);
        for(i=1;i<=n-2;i++)
        {
            x=x+a[i];
            y=s-x;
            if(min1>fabs(x-y))
            {
                min1=fabs(x-y);
            }
        }
        cout<<min1<<endl;
    }
    return 0;
}


Measured memory_bytes: 1792
#include<iostream>
using namespace std;
int main(){
	int  m, f, r; //中間試験の点数 m、期末試験の点数 f、再試験の点数 r
	while (1){
			cin >> m >> f >> r;
			if (m == -1 && f == -1 && r == -1)break;
		if (m ==-1 || f == -1){
			cout << 'F' << endl;
		}
		else if (m + f >= 80){
			cout << 'A' << endl;
		}
		else if (m + f >= 65 && m + f < 80){
			cout << 'B' << endl;
		}
		else if (m + f >= 50 && m + f < 65 || r >= 50){
			cout << 'C' << endl;
		}
		else if (m + f >= 30 && m + f < 50){
			cout << 'D' << endl;
		}
		else if (m + f < 30){
			cout << 'F' << endl;
		}
	}
	return 0;
}


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

if n <= 111:
  print(111)
elif n <= 222:
  print(222)
elif n <= 333:
  print(333)
elif n <= 444:
  print(444)
elif n <= 555:
  print(555)
elif n <= 666:
  print(666)
elif n <= 777:
  print(777)
elif n <= 888:
  print(888)
elif n <= 999:
  print(999)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
string s;
const int god=128;
int ed[222];
int len=0;
string solve(int l,int r){
	if(l==r){
		string t;
		for(int i=1; i<=ed[l] ;i++) t+=s[l];
		return t;
	}
	int mid=(l+r)/2;
	string p=solve(l,mid);
	string q=solve(mid+1,r);
	int pp=0,qq=0;
	string s;
	while(pp!=p.size() || qq!=q.size()){
		if(pp==p.size()) s+=q[qq++];
		else if(qq==q.size()) s+=p[pp++];
		else{
			cout << "? ";
			cout << s << q[qq];
			for(int i=pp; i<p.size() ;i++) cout << p[i];
			cout << endl;
			int x;cin >> x;
			if(x>=len-(s.size()+p.size()-pp)) s+=p[pp++];
			else s+=q[qq++];
		}
	}
	return s;
}
int main(){
	ios::sync_with_stdio(false);
	for(int i=0; i<26 ;i++) s+=(char)('a'+i);
	for(int i=0; i<26 ;i++) s+=(char)('A'+i);
	for(int i=0; i<10 ;i++) s+=(char)('0'+i);
	for(int i=0; i<s.size() ;i++){
		cout << "? ";
		for(int j=0; j<god ;j++) cout << s[i];
		cout << endl;
		int x;cin >> x;
		ed[i]=god-x;
		len+=ed[i];
	}
	string ans=solve(0,s.size()-1);
	cout << "! " << ans << endl;
}

Measured memory_bytes: 3800
n = int(input())
import heapq
G = {}
for i in range(n):
    i = [int(i) for i in input().split()]
    k = i[1]
    G[i[0]] = list(zip(i[2::2],i[3::2]))

def dijkstra(G):
    d = [0] + [float('inf')] * (n - 1)
    Q = [(d[i], i) for i in range(n)]
    heapq.heapify(Q)
    while len(Q) != 0:
        _, u = heapq.heappop(Q)
        for v, c in G[u]:
            if d[v] > d[u] + c:
                d[v] = d[u] + c
                heapq.heappush(Q, (d[v], v))
    return d

for i,j in enumerate(dijkstra(G)):
    print(i, j)

Measured memory_bytes: 70536
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 9e18
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
ll mod = 1e9+7;
void ans(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void ans2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b){a=b; return true;} return false; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a){a=b; return true;} return false; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){fill((T*)array, (T*)(array+N), val);}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

class debug
{
public:
    template<typename T> void vdeb(T vec);
    template<typename T1, typename T2> void adeb(T1 *arr, T2 n);
    template<typename T> void mdeb(T mp);
};

#endif //INCLUDE_DEBUG_HPP

template<typename T> void debug::vdeb(T vec)
{
    cout << "#vector set debug" << endl;
    for(auto vv : vec) cout << vv << " ";
    cout << endl;
}

template<typename T1, typename T2> void debug::adeb(T1 *arr, T2 n)
{
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}

template<typename T> void debug::mdeb(T mp)
{
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
debug dbg;

class DSL_1_A {
public:
    int par[10010];
    int rank[10010];

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

    void unite(int x, int y){
        link(find(x), find(y));
    }

    void link(int x, int y){
        if(rank[x] > rank[y]){
            par[y] = x;
        }else{
            par[x] = y;
            if(rank[x] == rank[y]) rank[x]++;
        }
    }

    bool same(int x, int y){
        return find(x) == find(y);
    }

	void solve(std::istream& in, std::ostream& out)
	{
        int n, q;
        in >> n >> q;
        int a, x, y;

        for(int i=0; i<=n; i++){
            par[i] = i;
            rank[i] = 0;
        }

        for(int i=0; i<q; i++){
            in >> a >> x >> y;
            if(!a) unite(x, y);
            else out << same(x, y) << endl;
        }
	}
};


int main() {
	DSL_1_A solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}



Measured memory_bytes: 3244
///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"

#define                           ll                          long long
#define                           int                         ll
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<ll,ll>
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

const ll inf=1e18;
const int mod=998244353;
const int M=100005;
inline ll bigmod(ll B,ll P){ll R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}
inline ll ad(ll x,ll y){ll ret=(x%mod+y%mod)%mod;if(ret<0){ret+=mod,ret=ret%mod;}return ret;}
inline ll sub(ll x,ll y){ll ret=((x%mod)-(y%mod)+mod)%mod;if(ret<0){ret+=mod,ret=ret%mod;}return ret;}
inline ll gun(ll x,ll y){ll ret=((x%mod)*(y%mod))%mod;if(ret<0){ret+=mod,ret=ret%mod;}return ret;}
int k,zero=0,one=0,cur=0;
string s;
vector< vector< vector<int> > >dp;
int cnt[306];
int solve(int pos,int has,int op)
{
    if(op>k)return 0;
    if(pos==cur)return 1;
    int &ret=dp[pos][has][op];
    if(ret!=(-1))return ret;
    ret=0;
    for(int i=0;i<=cnt[pos];i++)
    {
        ret=ad(ret,solve(pos+1,has+i,op+i));
    }
    for(int i=1;i<=has;i++)
    {
         ret=ad(ret,solve(pos+1,has-i,op));
    }
    return ret;
}
 main()

{
    fast
    cin>>s>>k;
    for(auto ch:s)
    {
        if(ch=='0')zero++;
        else one++;
    }
    dp.resize(zero+3);
    for(auto &x:dp)
    {
        x.resize(one+2);
        for(auto &y:x)
        {
            y.resize(one+2,-1);
        }
    }
    while(s.size())
    {
        if(s.back()=='0')cur++;
        else cnt[cur]++;
        s.pop_back();
    }
    cout<<solve(0,0,0)<<endl;
    return 0;

}




































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

public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String str[] = br.readLine().split(" ");
            long x = Long.parseLong(str[0]);
            long y = Long.parseLong(str[1]);
            long count = 0;
            while (true) {
                if (x > y) {
                    break;
                }
                count++;
                x = x * 2;
            }
            System.out.println(count);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}


Measured memory_bytes: 21204
#include <stdio.h>
#define MAX 10000
#define NIL -1

typedef struct node{
    int p,l,r;
}Node;
Node T[MAX];
int n;

void preParse(int u){
    if(u==NIL)
        return;
    printf(" %d",u);
    preParse(T[u].l);
    preParse(T[u].r);
}

void inParse(int u){
    if(u==NIL)
        return;
    inParse(T[u].l);
    printf(" %d",u);
    inParse(T[u].r);
}

void postParse(int u){
    if(u == NIL)
        return;
    postParse(T[u].l);
    postParse(T[u].r);
    printf(" %d",u);
}
int main(void){
    int i,v,l,r,root;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        T[i].p=NIL;
    for(i=0;i<n;i++){
        scanf("%d %d %d",&v,&l,&r);
        T[v].l=l;
        T[v].r=r;
        if(l != NIL)
            T[l].p=v;
        if(r != NIL)
            T[r].p=v;
    }
    for(i=0;i<n;i++)
        if(T[i].p == NIL)
            root=i;
    puts("Preorder");
    preParse(root);
    puts("");
    puts("Inorder");
    inParse(root);
    puts("");
    puts("Postorder");
    postParse(root);
    puts("");
    return 0;
}

Measured memory_bytes: 616
//#pragma comment(linker,"/STACK:102400000,102400000")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 0x3f3f3f3f;
#define _for(i, a, b) for (int i = (a); i < (b); ++i)
#define _rep(i, a, b) for (int i = (a); i <= b; ++i)
const int max_number = 1000000;

struct points {
    double x, y;
};

// int main()
// {

//     points x, y;
//     scanf("%lf%lf%lf%lf", &x.x, &x.y, &y.x, &y.y);  //double

//     double distance;
//     double i = pow((x.x - y.x), 2);
//     double j = pow((x.y - y.y), 2);

//     distance = sqrt(i + j);

//     printf("%.8f", distance);
//     printf("\n");
//     return 0;
// }

// int main()
// {
//     double a, b, c,other;
//     double area, circumference, height;
//     scanf("%lf%lf%lf", &a, &b, &c);

//     area = a * b * 0.5 * sin(c*M_PI/180);  //sin参数是弧度而不是角度
//     other = sqrt(a * a + b * b - 2 * a * b * cos(c * M_PI / 180));
//     circumference = a + b + other;
//     height = area * 2 / a;

//     printf("%.20lf\n", area);
//     printf("%.20lf\n", circumference);
//     printf("%.20lf\n", height);

//     return 0;
// }


//C++ 中const的使用  连p也必须是double类型   三元选择符的使用
void distance(int n, double p, const vector<double> x, const vector<double> y)
{
    vector<double> result(n,0);

    double res;
    for (int i = 0; i < n; i++)

    {
        result[i] = pow(abs(x[i] - y[i]), p);
       
    }
    //printf("%d",accumulate(result.begin(), result.end(), 0));
    //printf("\n");

    res = pow(accumulate(result.begin(), result.end(), 0.0), 1 / p);  //这块不能是0,要变成0.0
    printf("%.8lf\n", res);
}

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

    vector<double> x(n,0.0);
    vector<double> y(n,0.0);  //vector初始化有点麻烦啊

    //respectively  分别的，独自的

    // for (int i = 0;i < n; i++)  //这种方法不能连着读取两行整数
    // {
    //     cin >> x[i];
    // }

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

    // for (int i; cin >> i; x.push_back(i)) {     //这种方法也不行，只能读入一行整数
    //     }
    // for (int i; cin >> i; y.push_back(i)) {}

    // string line, num;
    // vector<vector<int>> v;
    // size_t linenum = 0;
    // while (getline(cin, line)) {
    //     istringstream iss(line);
    //     while (line >> num) {
    //         v.push_back(vector<int>());
    //         v[linenum].push_back(stoi(num));
    //     }
    //     ++linenum;
    // }

    //c++ getline stoi  sstream的用法，还有stringstream

//c++ 三元结构

    for (int i = 0; i < n; i++) {
        scanf("%lf", &x[i]);
    }

    for (int i = 0; i < n; i++) {
        scanf("%lf", &y[i]);  
    }
    distance(n, 1, x, y);
    distance(n, 2, x, y);
    distance(n, 3, x, y);
    //distance(n, DBL_MAX, x, y);
    
    //如果是int，可以用INT_MAX表示正无穷，INT_MIN表示负无穷，需要包含limits.h。
//如果是double，可以用DBL_MAX表示正无穷，-DBL_MAX表示负无穷(注意不是DBL_MIN)，需要包含float.h。

    double is = 0;
    for (int i = 0; i < n; i++)
    {
        is = max(is, abs(x[i] - y[i]));   //如果用0会报错
    }

    printf("%.8lf", is);

    //abs和fabs有什么区别

    return 0;
}


Measured memory_bytes: 3416
import sys

class Bit:
    def __init__(self, n, arr):
        self.size = n
        self.tree = [0] + arr
        for i in range(1, n+1):
            x = i + (i & -i)
            if x < n + 1:
                self.tree[x] += self.tree[i]

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

    def range_sum(self, l, r):
        return self.sum(r) - self.sum(l)


def main():
    n, q = map(int, sys.stdin.buffer.readline().split())
    bit = Bit(n, list(map(int, sys.stdin.buffer.readline().split())))
    for x in sys.stdin.buffer.readlines():
        q, p, x = map(int, x.split())
        if q:
            print(bit.range_sum(p, x))
        else:
            bit.add(p+1, x)


if __name__ == "__main__":
    main()


Measured memory_bytes: 172544
// ------------------------------------
// Date:2018/ 3/17
// Problem:Otoshidama jfdklasj fdas a.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl

typedef long long ll;

static const int MOD = 1000000007;

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

  ll N, Y;
  cin >> N >>  Y;
  Y /= 1000;
  bool ok = false;
  
  REP(i, N + 1) {
    REP(j, N - i + 1) {
      if (10 * i + 5 * j + (N - i - j) == Y) {
	ok = true;
	cout << i << " " << j << " " << (N - i - j) << endl;
	return 0;
      }
    }
  }

  if (!ok) cout << "-1 -1 -1" << endl;
  
  return 0;
}



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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>  // Including tree_order_statistics_node_update

using namespace __gnu_pbds;
using namespace std;

#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#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())
#define minei(x) min_element(x.begin(), x.end()) - (x).begin()
#define maxei(x) max_element(x.begin(), x.end()) - (x).begin()
#define LSOne(S) (S & (-S))

#define uns(v) sort((v).begin(), (v).end()), v.erase(unique(v.begin(), v.end()), v.end())
#define acusum(x) accumulate(x.begin(), x.end(), 0)
#define acumul(x) accumulate(x.begin(), x.end(), 1, multiplies<int>());
#define bits(x) __builtin_popcount(x)
#define oo INT_MAX
#define inf 1000000000
#define MAXN 1000007
#define MOD 1000000007

const double pi = acos(-1.0);
const double eps = 1e-11;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
int mat[3][3];
int main() {
    std::ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    map<int, pair<int, int> > INDX;
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> mat[i][j];
            INDX[mat[i][j]] = {i, j};
        }
    }
    int n, a;
    cin >> n;
    while (n--) {
        cin >> a;
        if (INDX.count(a)) {
            mat[INDX[a].first][INDX[a].second] = 0;
        }
    }
    bool bingo = false;
    for (int i = 0; i < 3; i++) {
        int sm1 = 0, sm2 = 0;
        for (int j = 0; j < 3; j++) {
            sm1 += mat[i][j];
            sm2 += mat[j][i];
        }
        if (sm1 == 0 || sm2 == 0) bingo = true;
    }
    int sm = 0;
    for (int i = 0; i < 3; i++) {
        sm += mat[i][i];
    }
    if (sm == 0) bingo = true;
    sm = mat[0][2] + mat[1][1] + mat[2][0];
    if (sm == 0) bingo = true;
    cout << (bingo ? "Yes" : "No") << "\n";

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>
#include <unordered_set>
#include <unordered_map>

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
#define rep(i, n) for(int i = 0;i < n;i++)
const int INF = 1LL << 30;

int MOD = 1000000007;

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

    int a,b,c,d; cin >> a >> b >> c >> d;

    if(c-a==1) cout << 1 << endl;
    else cout << 0 << endl;

    return 0;
}

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

int main() {
  int n, m;
  cin >> n >> m;
  int b[50], a[50];
  for(int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
  }
  int road[50];
  for(int i = 0; i < n; i++) {
    road[i] = 0;
  }
  for(int i = 0; i < m; i++) {
    road[a[i] - 1]++;
    road[b[i] - 1]++;
  }
  for(int i = 0; i < n; i++) {
    cout << road[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 256
S = input()
power = len(S)-1
loop = 2**power

revS = list(reversed(S))
ans = 0

for i in range(loop):
    ans += int(revS[0])
    multi_ten = 10
    for j in range(power):
        digit = bin(i>>j)[-1]
        if digit == "0":
            ans += int(revS[j+1])*multi_ten
            multi_ten *= 10
        else:
            ans += int(revS[j+1])
            multi_ten = 10
print(ans)

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

using namespace std;

#define rep(i, a, b) for(auto (i)=a;i<b;i++)
#define list(i, N) for(auto (i)=0;i<N;i++)

typedef long long ll;
typedef vector <ll> vi;
typedef pair <ll, ll> pi;
#define mp make_pair
#define pb push_back
#define eb emplace_back

#define int ll
#define INF 1e18+5
#define mod 1000000007

template<class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int32_t main() {

    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    double a, b; cin >> a >> b;
    bool satisfies = false;
    double x = min(a,b);
    while(!satisfies){
        double curra = floor(x * 0.08);
        double currb = floor(x * 0.1);
        if(curra == a && currb == b){
            satisfies = true;
        }
        ++x;
        if(x > 10000) break;
    }

    if(satisfies) cout << x-1 << "\n";
    else cout << "-1\n";

    return 0;
}

Measured memory_bytes: 256