akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long int> vl;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long int>> vvl;
typedef pair<int, int> pii;
typedef pair<long long int, long long int> pll;
typedef vector<pair<int, int>> vii;
typedef vector<pair<long long int, long long int>> vll;
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define test() long long int t; cin >> t; cin.ignore(); while(t--) 
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define MOD 1000000007
#define SMOD 998244353
#define pq priority_queue
#define all(x) x.begin(),x.end()
#define SP(x) setprecision(x)
#define sp " "
#define inp(a) ll a;cin>>a;cin.ignore()
#define inps(a,b) ll a,b;cin>>a>>b;cin.ignore()
#define out(a) cout<<SP(20)<<a<<'\n'
#define outs(a,b) cout<<SP(20)<<a<<" "<<b<<'\n'
#define ins insert
#define er erase
#define lb lower_bound
#define ub upper_bound
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define inpa(a,n) ll a[n]; for(int i=0; i<n; i++){cin>>a[i];}
#define inpv(a,n) vl a; for(int i=0; i<n; i++){inp(x);a.pb(x);}
#define outa(a,n) for(int i=0;i<n;i++){cout<<a[i]<<" ";}cout<<'\n';
#define outv(v) for(auto i:v){cout<<i<<" ";}cout<<'\n';
set<char> vow = {'a','e','i','o','u','A','E','I','O','U'};
ll xpow(ll n, ll m){if(m==0){return 1;}else{ll x = xpow(n, m/2);if(m&1){return x*x*n;}else{return x*x;}}}
ll xmod(ll a, ll m){return (((a%m)+m)%m);}
ll xmodpow(ll n, ll m, ll y){if(m==0){return 1;}else{ll x = xmodpow(n, m/2, y);if(m&1){return xmod((xmod((xmod(x,y)*xmod(x,y)),y)*xmod(n,y)),y);}else{return xmod((xmod(x,y)*xmod(x,y)),y);}}}
 
int main(){
    fast();
 
/* you get what you work for not what you wish for */
    
    ll x, y;
    cin >> x >> y;
    ll ans = x*y/__gcd(x, y);
    cout << ans << endl;   
}

Measured memory_bytes: 256
import Data.List
import Data.Ord
import Data.Function 
import qualified Data.Set as S

main :: IO ()
main = getLine >>= main'
    where
        main' s = readLn >>= putStrLn . solve s 

-- |
-- >>> solve "aba" 4
-- "b"
-- >>> solve "atcoderandatcodeer" 5
-- "andat"
-- >>> solve "z" 1
-- "z"
solve :: String -> Int -> String 
solve ss k = dat . head . drop (k - 1) . S.toAscList $ generate S.empty ss
    where
        generate acc xxs@(_ : xs) = generate acc' xs
            where
                acc' = foldl' (flip S.insert) acc ys
                ys = map wrap . tail . inits $ take k xxs 
        generate acc _ = acc 

newtype S = S { dat :: String }
    deriving (Eq)

wrap :: String -> S 
wrap = S 

instance Ord S where
    compare = cmp `on` dat

cmp :: String -> String -> Ordering
cmp (x : xs) (y : ys) = compare x y `mappend` cmp xs ys
cmp (_ : _) _ = GT
cmp _ (_ : _) = LT
cmp _ _ = EQ

Measured memory_bytes: 4348
n,m=map(int,input().split()) 
lista=[]
for i in range(m): 
	a=int(input())
	lista.append(a)

ans=1


def fb(num):
    """num番目のフィボナッチ数を返す
    """
    a, b = 1, 1
    for i in range(num):
        a, b = a + b, a
    return b
    
#print(fb(3))

if m==0:
	ans=ans*fb(n)
	
else:
	for i in range(m-1):
		if (lista[i]+1==lista[i+1])&(m>=2):
			ans=0
  	
  	
	else:
		lista.append(n)
		if lista[0]!=1:
				ans=ans*(fb(lista[0]-1))
				for i in range(1,m):
						ans=ans*(fb(lista[i]-lista[i-1]-2))
					
		 
					
		if lista[0]==1:
				for i in range(1,m):
						ans=ans*(fb(lista[i]-lista[i-1]-2))
					
		
		ans= ans*(fb(lista[m]-lista[m-1]-1))
		
print(ans%1000000007)
	

Measured memory_bytes: 49752
//****************************//
/**********  main *************/
//****************************//
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
 
using namespace std;
typedef long long ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define REP(i,n) for(i=0;i<n;i++)
#define FOR(i,a,b) for(i=a;i<b;i++)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
 
int main(){
    
    ll a,b,k;
    cin >> a >> b >> k;
   
        if(k <= a) {
            cout << a-k << " " << b << endl;
        } else if(k <= a+b) { 
            cout << 0 << " " << b-(k-a) << endl;
        }else{
            cout << 0 << " " << 0 << endl;
        }
    

} 
 
 
 

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#include <fstream>
#include<string.h>
#include <algorithm>
#include<math.h>
#include<vector>
#include <queue>
#include <deque> 
#define ll long long
#define M 1000000007 
#define MM 998244353
#define INF 4e18
using namespace std;
 
typedef tree<ll, null_type, less<int>, rb_tree_tag, 
             tree_order_statistics_node_update> 
    ordered_set; 
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_multiset;

int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    /*freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);*/
    /*ll t,tcitr;
    cin>>t;
    tcitr=0;
    while(tcitr<t)
    {*/
        ll n,i,j,k,p;
        cin>>n>>k;
        vector<pair<ll,ll>> v;
        for(i=0;i<k;i++)
        {
            cin>>j>>p;
            v.push_back({j,p});
        }
        ll dp[n+1]={};
        dp[1]=1;
        ll cnt,l,r;
        for(i=2;i<=n;i++)
        {
            cnt=0;
            for(j=0;j<k;j++)
            {
                if(v[j].first>=i)continue;
                l=max(1LL,i-v[j].second);
                r=i-v[j].first;
                cnt+=(dp[r]-dp[l-1]);
                if(cnt<0)cnt+=MM;
                while(cnt>=MM)cnt-=MM;
            }
            dp[i]=(dp[i-1]+cnt)%MM;
        }
        cout<<(dp[n]+MM-dp[n-1])%MM<<"\n";
        /*tcitr++;
    }*/
    return 0;
}

Measured memory_bytes: 5216
import sys
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
dist=abs(b-a)
speed=v-w
if speed<=0:
    print("NO")
    sys.exit()
if dist/speed<=t:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 9184
#include<bits/stdc++.h>
using namespace std;
int main() {
  string s, t; cin >> s >> t;
  vector<char> ss(s.size()), tt(t.size());
  for(int i = 0; i < s.size(); i++) {
    ss.at(i) = s.at(i);
  }
  for(int i = 0; i < t.size(); i++) {
    tt.at(i) = t.at(i);
  }
  sort(ss.begin(), ss.end());
  sort(tt.begin(), tt.end());
  reverse(tt.begin(), tt.end());
  string sss, ttt;
  for(int i = 0; i < s.size(); i++) {
    sss += ss.at(i);
  }
  for(int i = 0; i < t.size(); i++) {
    ttt += tt.at(i);
  }
  if(sss < ttt) {
    cout << "Yes" << endl;
  } else cout << "No" << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
//import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		//System.setIn(new FileInputStream("./input.txt"));
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] a = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
		int q = Integer.parseInt(br.readLine());
		int[] m = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
		
		int sum;
		boolean[] flag = new boolean[q];
		for(int i = 1; i < Math.pow(2, n); ++i) {
			sum = 0;
			for(int j = 0; j < n; ++j) {
				if((i & (1 << j)) > 0){
					sum += a[j];
				}
			}
			for(int k = 0; k < q; ++k) {
				if(sum == m[k]) {
					flag[k] = true;
				}
			}
		}
		for(int k = 0; k < q; ++k) {
			if(flag[k]) {
				System.out.println("yes");
			}else{
				System.out.println("no");
			}
		}
	}

}

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

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

int main() {

    int n; cin >> n;

    vector<vector<int>> f(n);
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < 10; ++j) {
            int a; cin >> a;
            f[i].push_back(a);
        }
    }

    vector<vector<int>> p(n);
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < 11; ++j) {
            int a; cin >> a;
            p[i].push_back(a);
        }
    }

    int ans = -INF;

    for (int bit = 1; bit < (1 << 10); ++bit) {
        int sum = 0;

        for (int i = 0; i < n; ++i) {
            int match = 0;

            for (int j = 0; j < 10; ++j) {
                if (bit & (1 << j) && f[i][j]) {
                    ++match;
                }
            }

            sum += p[i][match];
        }

        ans = max(ans, sum);
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define oo 1000000010
#define mod 1000000007
const int N = 500010;
int n , a[N] , sum[2];
vector< int > g[(1 << 20)];
int cur , cnt = 0 , ans = 0;
int seg[4 * N] , lazy[4 * N] , num[4 * N];
int fres = 1;
int dp[N];
inline int fastpower(int num,int po){
	fres = 1;
	while(po > 0){
		if(po & 1)
			fres = (long long)fres * num % mod;
		po >>= 1;
		num = (long long)num * num % mod;
	}
	return fres;
}

int l , r , val;

void build(int s,int e,int idx){
	if(s == e){
		if(a[s] == 0){
			num[idx] = 1;
		}
		seg[idx] = lazy[idx] = 0;
		return;
	}
	build(s,((s+e) >> 1),(idx << 1));
	build(((s+e) >> 1) + 1,e,(idx << 1) + 1);
	num[idx] = num[(idx << 1) + 1] + num[(idx << 1)];
	seg[idx] = lazy[idx] = 0;
}

inline void fix(int s,int e,int idx){
	seg[idx] += (long long)lazy[idx] * num[idx] % mod;
	if(seg[idx] >= mod)
		seg[idx] -= mod;
	if(s != e){
		lazy[(idx << 1)] += lazy[idx];
		if(lazy[(idx << 1)] >= mod)
			lazy[(idx << 1)] -= mod;
		lazy[(idx << 1) + 1] += lazy[idx];
		if(lazy[(idx << 1) + 1] >= mod)
			lazy[(idx << 1) + 1] -= mod;
	}
	lazy[idx] = 0;
}

int update(int s,int e,int idx){
	fix(s,e,idx);
	if(s > r || e < l)
		return seg[idx];
	if(s >= l && e <= r){
		lazy[idx] += val;
		if(lazy[idx] >= mod)
			lazy[idx] -= mod;
		fix(s,e,idx);
		return seg[idx];
	}
	return seg[idx] = ((update(s,((s+e) >> 1),(idx << 1)) + update(((s+e) >> 1) + 1,e,(idx << 1) + 1)) % mod);
}

int getsum(int s,int e,int idx){
	fix(s,e,idx);
	if(s > r || e < l)
		return 0;
	if(s >= l && e <= r)
		return seg[idx];
	return ((getsum(s,((s+e) >> 1),(idx << 1)) + getsum(((s+e) >> 1) + 1,e,(idx << 1) + 1)) % mod);
}

int main(){
	int all = 0;
	scanf("%d",&n);
	for(int i = 1 ;i <= n;i++){
		scanf("%d",&a[i]);
		a[i] ^= a[i - 1];
		g[a[i]].push_back(i);
		all += (a[i] == 0);
	}
	build(0,n,1);
	if(a[n] != 0){
		sum[0] = 0;
		sum[1] = 1;
		for(int i = n - 1;i>0;i--){
			if(a[i] != 0 && a[i] != a[n]) continue;
			if(a[i] == 0){
				sum[0] += sum[1];
				if(sum[0] >= mod)
					sum[0] -= mod;
				continue;
			}
			sum[1] += sum[0];
			if(sum[1] >= mod)
				sum[1] -= mod;
		}
		cout << sum[1] << endl;
		return 0;
	}
	l = n , r = n, val = 1;
	update(0,n,1);
	ans = fastpower(2 , all - 1);
	for(int i = 1 ;i < (1 << 20);i++){
		if((int)g[i].size() == 0) continue;
		for(int j = (int)g[i].size() - 1;j>=0;j--){
			l = g[i][j] , r = n;
			dp[j] = getsum(0,n,1);
			l = 0 , r = g[i][j]  , val = dp[j];
			update(0,n,1);
			ans += dp[j];
			if(ans >= mod)
				ans -= mod;
		}
		
		for(int j =(int)g[i].size()-1;j>=0;j--){
			l = 0 , r = g[i][j] , val = -dp[j] + mod;
			update(0,n,1);
		}
	}
	cout << ans << endl;
    return 0;
} 

Measured memory_bytes: 53748
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int N, K, num;
    cin >> N >> K;
    num = 1;
    
    for (int i=0; i<N; i++) {
        if (num < K) num *=2;
        else num+=K;
        
    }
    cout << num << endl;
}

Measured memory_bytes: 3620
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <random>
#include <climits>
#include <set>
#include <deque>

#define mod 1000000007
#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOREACH(i, v) for(auto i = v.begin(); i != v.end(); i++)

using namespace std;
using ll = long long;

int X[] = {-1, 0, 1, 1, 1, 0, -1, -1};
int Y[] = {1, 1, 1, 0, -1, -1, -1, 0};

int gcd(int a, int b) {
    int x = max(a, b);
    int y = min(a, b);
    int z = x % y;
    if(z == 0){
        return y;
    }else{
        return gcd(y, z);
    }
}

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

void solve() {
	int x, a, b;
	cin >> x >> a >> b;
	x = x - a;
	while(x >= b){
		x = x - b;
	}
	cout << x << endl;
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;

class Node {
    public:
        int parent, left, right;
        Node();
        string type();
};
Node::Node() {
    parent = left = right = NIL;
}

Node T[MAX]; // 配列Tの添え字がid
int D[MAX]; // それぞれのidの深さ

string Node::type() {
    if (parent == NIL) return "root";
    else if (left == NIL) return "leaf";
    else return "internal node";
}


// 節点の深さ
void setDepth(int u, int p) { // uはroot
    D[u] = p;
    if (T[u].right != NIL) setDepth(T[u].right, p);
    if (T[u].left != NIL) setDepth(T[u].left, p + 1);
}

void printChildren(int u) {
    int i = 0;
    int c = T[u].left;
    cout << "[";
    while (c != NIL) {
        if (i++) cout << ", ";
        cout << c;
        c = T[c].right;
    }
    cout << "]";
}


int main() {
    int n, id, k, c;
    cin >> n;
    // 子要素に親要素としてid,右兄弟要素として次の入力値を設定; 親要素に左子要素のみ設定;
    for (int i = 0; i < n; i++) {
        cin >> id >> k;
        int tmp;
        for (int j = 0; j < k; j++) {
            cin >> c;
            if (j == 0) T[id].left = c;
            else T[tmp].right = c;
            tmp = c;
            T[c].parent = id;
        }
    }

    for (int i = 0; i < n; i++) {
        if (T[i].parent == NIL) {
            setDepth(i, 0);
            break;
        }
    }
    
    // 出力
    for (int i = 0; i < n; i++) {
        cout << "node " << i << ": ";
        cout << "parent = " << T[i].parent << ", ";
        cout << "depth = " << D[i] << ", ";
        cout << T[i].type() << ", ";
        printChildren(i);
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 7820
#include <iostream>
#include <queue>
using namespace std;
int w, h, n;
char map[1024][1024];
// 各点到当前工厂的距&#31163;
int d[1024][1024];
const int direction[4][2] = {
    { -1, 0 },
    { 1, 0 },
    { 0, -1 },
    { 0, 1 },
};
 
int factory[16][2];
typedef pair<int, int> P;
 
 
 
//************************************
// Method:    bfs
// FullName:  bfs
// Access:    public 
// Returns:   int
// Qualifier:
// Parameter: const int & sx 起点x
// Parameter: const int & sy 起点y
// Parameter: const int & gx &#32456;点x
// Parameter: const int & gy &#32456;点y
//************************************
int bfs(int sx, const int sy, const int gx, const int gy)
{
    //memset(d, -1, sizeof(d));
    for (int i = 0; i < h; ++i)
    {
        for (int j = 0; j < w; ++j)
        {
            d[j][i] = -1;
        }
    }
    queue<P> que;
    que.push(P(sx, sy));
    d[sx][sy] = 0;
    while (que.size())
    {
        const P p = que.front(); que.pop();
        // 如果是&#32456;点就&#32467;束
        if (p.first == gx && p.second == gy)
        {
            break;
        }
 
        // 四方向漫游
        for (int i = 0; i < 4; ++i)
        {
            int nx = p.first + direction[i][0];
            int ny = p.second + direction[i][1];
            // 是否可以移&#21160;，并且&#35813;点没有&#35775;&#38382;&#36807;
            if (0 <= nx && nx < w && 0 <= ny && ny < h && map[nx][ny] != 'X' && d[nx][ny] == -1)
            {
                que.push(P(nx, ny));
                d[nx][ny] = d[p.first][p.second] + 1;
            }
        }
    }
 
    return d[gx][gy];
}
 
///////////////////////////SubMain//////////////////////////////////
int main(int argc, char *argv[])
{
 
    cin >> h >> w >> n;
    for (int i = 0; i < h; ++i)
    {
        for (int j = 0; j < w; ++j)
        {
            cin >> map[j][i];
        }
    }
 
    for (int i = 0; i < h; ++i)
    {
        for (int j = 0; j < w; ++j)
        {
            if (map[j][i] == 'S')
            {
                factory[0][0] = j;
                factory[0][1] = i;
                map[j][i] = '.';
            }
            else if (isdigit(map[j][i]))
            {
                int index = map[j][i] - '0';
                factory[index][0] = j;
                factory[index][1] = i;
            }
        }
    }
 
    int step = 0;
    for (int i = 0; i < n; ++i)
    {
        // 按&#39034;序吃遍中&#21326;
        step += bfs(factory[i][0], factory[i][1], factory[i + 1][0], factory[i + 1][1]);
    }
     
    cout << step << endl;
 
    return 0;
}

Measured memory_bytes: 6312
#include <stdio.h>
int main()
{
	int n,x;
	while(1){
		int count=0;
		scanf("%d %d",&n,&x);
		if(n==0&&x==0)
			break;
		for(int i=1;i<=n;i++){
			for(int j=i+1;j<=n;j++){
				for(int k=j+1;k<=n;k++){
					if(i+j+k==x)
						count++;
				}
			}
		}
		printf("%d\n",count);
	}
	return 0;
}

Measured memory_bytes: 1028
# 最大8本の竹からA,B,Cの3組に分ける→できない→未解決問題
# 3組に分けるやり方は再帰を用いる
from itertools import combinations


def solver(array, a_set, b_set, c_set):
    if not a_set or not b_set or not c_set:
        return float("inf")
    res_a = sum(array[x] for x in a_set)
    res_b = sum(array[x] for x in b_set)
    res_c = sum(array[x] for x in c_set)

    join_cost = sum([10 * (len(x)-1) for x in [a_set, b_set, c_set] if len(x) > 1])
    res = abs(res_a - a) + abs(res_b - b) + abs(res_c - c) + join_cost
    return res


n, a, b, c = map(int, input().split())
array = []
for i in range(n):
    array.append(int(input()))
array.insert(0, 0)

a_comb, b_comb, c_comb = [], [], []
a_index, b_index, c_index = [False for x in range(n)], [False for x in range(n)], [False for x in range(n)]

index_array = [x for x in range(1, n + 1)]
for j in range(0, n + 1):
    a_comb += [set(x) for x in combinations(index_array, j)]
    b_comb += [set(x) for x in combinations(index_array, j)]
    c_comb += [set(x) for x in combinations(index_array, j)]

res = float("inf")
tmp = 0
for a_set in a_comb:
    for b_set in b_comb:
        if a_set & b_set:
            continue
        for c_set in c_comb:
            if a_set & c_set or b_set & c_set:
                continue
            tmp += 1
            res = min(res, solver(array, a_set, b_set, c_set))

print(res)


Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
int main()
 {  ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
	//int t; 
      //  cin>>t;
        //while(t--){
          int n,k,flag=1;
          cin>>n;
          int a[n];
          for(int i=0;i<n;i++) cin>>a[i];
          for(int i=0;i<n;i++){
              if(a[i]%2==0) if(a[i]%3&&a[i]%5){flag = 0;break;}
          }
          cout<<((flag==1)?"APPROVED":"DENIED")<<"\n";
	return 0;
}

Measured memory_bytes: 256
#define rep(i, n) for (int i = 0; i < (n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
// MAX int 2,147,483,647 -> 10桁
// MAX ll 9,223,372,036,854,775,807 -> 19桁
// MAX O(n) 10^18 -> 18回
// double pi = M_PI or acos(-1)
// printf("%.10f\n", ans);

int main() {
    int a, b;
    cin >> a >> b;

    int ans = -1;
    for (int i = 2000; i > 0; i--) {
        
        if((int)(i * 0.08) == a && (int)(i * 0.1) == b) {
            ans = i;
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3628
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <unordered_set>
#include <cassert>

using namespace std;

typedef long long int ll;
typedef pair<int, int> Pii;

const ll mod = 1000000007;

vector<vector<int> > strongly_connected_component(vector<vector<int> > &edge) {
  int n = edge.size();
  vector<vector<int> > edge_rev(n);
  for (int i = 0; i < n; i++) {
    for (auto &x: edge[i]) edge_rev[x].push_back(i);
  }

  vector<int> dfs_order;
  dfs_order.reserve(n);

  vector<bool> visited1(n);
  auto dfs1 = [&](auto self, int v) {
    if (visited1[v]) return;
    visited1[v] = true;
    for (auto &x: edge[v]) {
      if (!visited1[x]) self(self, x);
    }
    dfs_order.push_back(v);
    return;
  };
  for (int i = 0; i < n; i++) dfs1(dfs1, i);

  reverse(dfs_order.begin(), dfs_order.end());

  int group_count = 0;
  vector<int> group(n, -1);
  auto dfs2 = [&](auto self, int v) {
    if (group[v] >= 0) return;
    group[v] = group_count;
    for (auto &x: edge_rev[v]) {
      if (group[x] == -1) self(self, x);
    }
    return;
  };
  for (auto &x: dfs_order) {
    if (group[x] == -1) {
      dfs2(dfs2, x);
      group_count++;
    }
  }

  vector<vector<int> > intergroup_edge(group_count);
  for (int i = 0; i < n; i++) {
    for (auto &x: edge[i]) {
      if (group[i] != group[x]) intergroup_edge[group[i]].push_back(group[x]);
    }
  }

  vector<int> topological_order;
  topological_order.reserve(group_count);

  vector<bool> visited2(group_count);
  auto dfs3 = [&](auto self, int v) {
    if (visited2[v]) return;
    visited2[v] = true;
    for (auto &x: intergroup_edge[v]) {
      if (!visited2[x]) self(self, x);
    }
    topological_order.push_back(v);
    return;
  };
  for (int i = 0; i < group_count; i++) dfs3(dfs3, i);

  reverse(topological_order.begin(), topological_order.end());

  vector<vector<int> > scc(group_count);
  for (int i = 0; i < n; i++) scc[group[i]].push_back(i);
  vector<vector<int> > topological_scc;
  for (auto &x: topological_order) topological_scc.push_back(scc[x]);

  return topological_scc;
}

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

  int n, m;
  cin >> n >> m;
  vector<vector<int> > edge(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    edge[a].push_back(b);
  }

  vector<vector<int> > scc = strongly_connected_component(edge);

  cout << scc.size() << endl;
  for (auto &x: scc) {
    cout << x.size() << " ";
    for (auto &y: x) cout << y << " ";
    cout << endl;
  }

  return 0;
}


Measured memory_bytes: 128796
T = ["maerd", "remaerd", "esare", "resare"]

s = raw_input()
s = s[::-1]

ans = True
while True:
	if s == "":
		ans = True
		break
	elif s[0] == "m" and len(s) >= len(T[0]) and s[:len(T[0])] == T[0]:
		s = s[len(T[0]):]
	elif s[0] == "r" and len(s) > 2:
		if s[2] == "m" and len(s) >= len(T[1]) and s[:len(T[1])] == T[1]:
			s = s[len(T[1]):]
		elif s[2] == "s" and len(s) >= len(T[3]) and s[:len(T[3])] == T[3]:
			s = s[len(T[3]):]
		else:
			ans = False
			break
	elif s[0] == "e" and len(s) >= len(T[2]) and s[:len(T[2])] == T[2]:
		s = s[len(T[2]):]
	else:
		ans = False
		break

if ans:
	print "YES"
else:
	print "NO"

Measured memory_bytes: 2948
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, k = map(int, readline().split())
aa = []
for i in range(k):
    d = int(readline())
    aa += list(map(int, readline().split()))
aa = set(list(aa))
cnt = 0
for i in range(1, n + 1):
    if i not in aa:
        cnt += 1
print(cnt)


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

int main() { 
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n)  {
  	cin >> a.at(i);
  }
  int min_cost = INT_MAX;
  for(int i = -100; i <= 100; i++){
    int cost = 0;
  	for(int j = 0; j < a.size(); j++){
    	cost += pow(a[j] - i, 2);
    }
    min_cost = min(min_cost, cost);
  }
  cout << min_cost << endl;
  return 0;
}

Measured memory_bytes: 3564
using System;
using System.Collections.Generic;

namespace CA {
	class Prg {
		static void Main() {
			List<string> l = new List<string>();
			for(int j = 0; j < 4; j++) {
				string m = string.Empty;
				switch (j) {
					case 0:
					m = "S ";
					break;
					case 1:
					m = "H ";
					break;
					case 2:
					m = "C ";
					break;
					case 3:
					m = "D ";
					break;
				}
				for(byte k = 1; k < 14; k++) {
					l.Add(m + k);
				}
			}
			int i = int.Parse(Console.ReadLine());
			while(i-- != 0) {
				l.Remove(Console.ReadLine());
			}
			l.ForEach(x => {
				Console.WriteLine(x);
			});
        }
	}
}

Measured memory_bytes: 9220
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

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

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int n,k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i,n)cin >> a[i];
    ll last = 1;
    rep(i,k)last *= a[i];
    ll now = last;
    for(int i=k;i<n;i++){
        now = a[i];
        last = a[i-k];
        if(last < now)cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

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

typedef long long ll;
typedef long double ld;

#define n1          "\n"
#define B                     begin()
#define E                     end()
#define F                     first
#define S                     second
#define pb                    push_back
#define pf                    push_front
#define popb                  pop_back()
#define popf                  pop_front()

const int BIG=1e5+55;
const int BIGG=1e9+7;
const ll BIGGE=1e12+55;
const double SML=(1e-7);

using namespace std;

    ll n,a[100];
    char c[100000];
    string s;

int main()
{
    ios::sync_with_stdio(false); cin.tie(NULL);
    cout.tie(NULL);
    ll ans = 0;
    cin >>n;
    char cc = 'a';
    for (int i=1; i<=26; i++,cc++) {
        c[i] = cc;
    }
    while (n) {
        int x = n%26;
        if (x == 0) {
            x = 26;
            n--;
        }
        s += c[x];
        n /= 26;
    }
    for (int i=s.size()-1; i>=0; i--)
        cout <<s[i];



    return 0;
}

Measured memory_bytes: 3656
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            char[] a = in.next().toCharArray();
            for (int i = a.length - 3; i >= 0; i -= 2) {
                StringBuilder sb = new StringBuilder();
                for (int j = 0; j <= i; ++j) sb.append(a[j]);
                if (sb.subSequence(0, sb.length() / 2 - 1).equals(sb.subSequence(sb.length() / 2, i))) {
                    out.println(i + 1);
                    return;
                }
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}



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

int main() {
	// your code goes here
	int n,k;
	cin >> n >> k;
	int ans;
	ans=1;
	for(int i=1;i<=n;i++){
		if(ans>k){
			ans=ans+k;
		}
		else ans=2*ans;
	}
	cout << ans << endl;
	return 0;
}

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

int n, q;
int a[99];
string b[99] = {"kogakubu10gokan"};

string solve(int i, int p){

  if(a[i] == p) i++;
  if(p == q) return b[i];

  return solve(i, p+1);

}

int main(){

  cin >> n >> q;

  for(int i=1;i<=n;i++) cin >> a[i-1] >> b[i];

  cout << solve(0, 0) << endl;

}

Measured memory_bytes: 1204
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<float> x(n),y(n);
    for(int i= 0; i < n; i++){
        cin >> x[i] >> y[i];
    }
    float sum = 0;
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            float d = sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
            d *= (n - 1);
            d *= 2;
            sum += d;
        }
    }
    int k = n * (n - 1);
    cout << setprecision(10) << sum / k << endl;
}

Measured memory_bytes: 384
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')
in_nl = lambda: list(map(int, readline().split()))
in_nl2 = lambda H: [in_nl() for _ in range(H)]
in_map = lambda: [s == ord('.') for s in readline() if s != ord('\n')]
in_map2 = lambda H: [in_map() for _ in range(H)]
in_all = lambda: map(int, read().split())


def main():

    N = in_n()

    ans = []
    for i in range(N):
        a, b = in_nn()
        ans.append(a == b)

    f = False
    for i in range(N - 2):
        if ans[i] == ans[i + 1] == ans[i + 2] == True:
            f = True
            break

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


if __name__ == '__main__':
    main()


Measured memory_bytes: 62112
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)
#define EPS (1e-13)

class P{                    //テァツつケ
public:
	double x,y;
	
	P(double _x=0,double _y=0):x(_x),y(_y){};
	P operator + (const P &p     )const{ return P( x+p.x , y+p.y ); }  //テ・ツ環?ァツョツ?
	P operator - (const P &p     )const{ return P( x-p.x , y-p.y ); }  //テヲツクツ崚ァツョツ?
	P operator * (const double k )const{ return P( x*k   , y*k    ); } //テ、ツケツ療ァツョツ?
	P operator / (const double k )const{ return P( x/k   , y/k    ); } //テゥツ卍、テァツョツ?
};

double sqDist(P a, P b)         {return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);}


//2テァツつケテ」ツつ津ゥツ?堙」ツつ凝・ツ債甘・ツセツвテ」ツ?ョテ・ツ??」ツ?ョテ、ツクツュテ・ツソツε・ツコツァテヲツィツ凖」ツつ津ヲツアツづ」ツつ?」ツつ?verified AOJ1132
pair<P,P> geoGetCircleOf2pAndR(P p1,P p2,double r){
	P pc1,pc2, p3;
	double d, l, dx, dy ;
	
	p3 = (p1+p2)/2.0;
	l = sqDist(p2,p3);
	
	if  (r*r < l)return pair<P,P>(P(-INF,-INF),P(-INF,-INF));
	
	d  = sqrt(r*r/l - 1.0) ;
	dx = d * (p2-p3).y ;
	dy = d * (p2-p3).x ;
	
	pc1.x = p3.x + dx ;
	pc1.y = p3.y - dy ;
	
	pc2.x = p3.x - dx ;
	pc2.y = p3.y + dy ;
	
	return pair<P,P>(pc1,pc2);
}


int main(){
	int n;
	while(cin>>n&&n){
		vector<P> points(n);
		char ch;
		rep(i,n)cin>>points[i].x>>ch>>points[i].y;
		
		int ans = 1;
		rep(i,n){
			for(int j=i+1;j<n;j++){
				P res[2];
				tie(res[0],res[1]) = geoGetCircleOf2pAndR(points[i], points[j], 1);
				if(res[0].x==-INF)continue;

				rep(k,2){
					int tmp = 0;
					P ri = res[k];
					rep(l,n){
						if( sqDist(ri, points[l])<=1+EPS )tmp++;
					}
					ans = max(tmp,ans);
				}
			}
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 3132
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _0358
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] vs = RArInt();
            int m = vs[0], f = vs[1], b = vs[2];

            if (m + f < b) Console.WriteLine("NA");
            else  Console.WriteLine(Math.Max(0, b - m));

        }
        static string RSt() { return Console.ReadLine(); }
        static int RInt() { return int.Parse(Console.ReadLine().Trim()); }
        static long RLong() { return long.Parse(Console.ReadLine().Trim()); }
        static double RDouble() { return double.Parse(Console.ReadLine()); }
        static string[] RArSt(char sep = ' ') { return Console.ReadLine().Trim().Split(sep); }
        static int[] RArInt(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => int.Parse(e)); }
        static long[] RArLong(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => long.Parse(e)); }
        static double[] RArDouble(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => double.Parse(e)); }
        static string WAr<T>(IEnumerable<T> array, string sep = " ") { return string.Join(sep, array.Select(x => x.ToString()).ToArray()); }
    }
}



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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q>
ostream& operator << (ostream& os, pair<P, Q> p)
{
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

struct edge {
  int to, cap, rev;
};

const int N = 1e5 * 2 + 10;
vector<int> g[N];

void add_edge(int src, int dst)
{
  g[src].push_back(dst);
  g[dst].push_back(src);
  return ;
}

int match[N];
int vis[N], x;
bool rec(int curr)
{
  vis[curr] = x;
  each (next, g[curr]) {
    int w = match[next];
    if (w < 0 || (vis[w] != x && rec(w))) {
      match[curr] = next;
      match[next] = curr;
      return true;
    }
  }
  return false;
}

int matching(int n = N)
{
  int res = 0;
  fill(match, match + N, -1);
  x = 1;
  fill(vis, vis + N, 0);
  for (int i = 0; i < n; ++i) {
    if (match[i] < 0) {
      res += rec(i);
      ++x;
    }
  }
  return res;
}

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n;
  int c;
  while (cin >> n >> c) {
    fill(g, g + N, vector<int>());
    vector<pair<int, int>> v[c];
    map<tuple<int, int, int>, int> name;
    int cnt = 0;
    for (int i = 0; i < n; ++i) {
      int s, t, c;
      cin >> s >> t >> c;
      --c;
      v[c].push_back(make_pair(s, t));
      name[make_tuple(c, s, t)] = cnt++;
    }
    for (int i = 0; i < c; ++i) {
      sort(v[i].begin(), v[i].end()); 
    }

    for (int i = 0; i < c; ++i) {
      for (int j = 0; j + 1 < v[i].size(); ++j) {
        tuple<int, int, int> a = make_tuple(i, v[i][j].first, v[i][j].second);
        tuple<int, int, int> b = make_tuple(i, v[i][j + 1].first, v[i][j + 1].second);
        add_edge(name[a], name[b] + name.size());
      }
    }
    for (int i = 0; i < c; ++i) {
      for (int j = 0; j < v[i].size(); ++j) {
        const pair<int, int>& p = v[i][j];
        auto a = make_tuple(i, v[i][j].first, v[i][j].second);
        for (int k = 0; k < c; ++k) {
          if (i == k) continue;
          auto itr = lower_bound(v[k].begin(), v[k].end(), make_pair(p.second + 1, 0));
          if (itr != v[k].end()) {
            auto b = make_tuple(k, itr->first, itr->second);
            add_edge(name[a], name[b] + name.size());
          }
        }
      }
    }

    cout << n - matching() << endl;
  }
  
  return 0;
}


Measured memory_bytes: 52096
import bisect
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,n-2):
    for j in range(i+1,n-1):
        x=l[i]+l[j]
        y=bisect.bisect_left(l,x)-j-1        
        ans+=y
print(ans)        


Measured memory_bytes: 3188
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		//		new Main().solveA();
		new Main().solveB();
		// new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();

			if (numA * numB % 2 == 0) {
				System.out.println("Even");
			} else {
				System.out.println("Odd");
			}

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		String numA = "";
		String numB = "";

		try {
			scanner = new Scanner(System.in);
			numA = scanner.next();
			numB = scanner.next();

			double wkNum = Double.parseDouble(numA + numB);
			int wk = (int) Math.sqrt(wkNum);
			if (Math.pow(wk, 2) == wkNum) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
}

Measured memory_bytes: 22868
N = int(input())
ABlist = sorted([tuple(map(int, input().split())) for _ in range(N)], key=lambda x: x[1])
now = 0
for a, b in ABlist:
    now += a
    if now <= b:
        continue
    else:
        print("No")
        break
else:
    print("Yes")


Measured memory_bytes: 83032
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ul unsigned long int
#define ld long double
#define f(t) for(ll i =0;i<t;i++)
#define vi vector<int>
#define vl vector<ll>
#define pri pair<int,int>
#define mpi map<int,int>
#define prl pair<ll,ll>
#define mp make_pair
#define mpl map<ll,ll>
#define umpl unordered_map<ll,ll>
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
#define inf 2e18
#define EPS 1e-3
#define PI 3.1415926535897932385
const double h = 1e-6;
const int MAX_  = 100005;
#define display(v) f(v.size())cout << v[i] << " "
#define all(v) v.begin(),v.end()

inline ll mul(ll a, ll b){ return (a * 1ll * b) % MOD; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += MOD; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > MOD) c -= MOD; return c; }
 //////////////////////*********CODE***********/////////////////////
 //////////////////////////////////////////////////////////////////

int main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);
   int n,k; 
   cin>>n>>k; 
   int arr[n];
   ll s =0;
   f(n){cin>>arr[i];s+=arr[i];}
   sort(arr,arr+n,greater<int>());
   if(arr[k-1]*4*k >= s)cout << "Yes\n";
   else cout << "No\n";

   
   return 0;
}     

Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

struct S
{
    int x, n, orig;
};

bool cmp1(S a, S b)
{
    return a.n < b.n;
}

bool cmp2(S a, S b)
{
    return a.orig < b.orig;
}

vector<S> vec, srt;

int main()
{
    int N;
    int prev, next;

    scanf("%d", &N);
    vec.resize(N);

    for(int i=0; i<N; i++)
    {
        scanf("%d", &vec[i].n);
        vec[i].x = 0;
        vec[i].orig = i+1;
    }

    sort(vec.begin(), vec.end(), cmp1);

    for(int i=0; i<N; i++)
    {
        vec[i].x = i+1;

        if(i+1 == N/2)
            prev = vec[i].n;
        else if(i+1 == N/2+1)
            next = vec[i].n;
    }

    sort(vec.begin(), vec.end(), cmp2);

    for(int i=0; i<N; i++)
    {
        if(vec[i].x < N/2+1)
            printf("%d\n", next);
        else
            printf("%d\n", prev);
    }

    return 0;
}


Measured memory_bytes: 4480
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main{
    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try{
            int n = Integer.parseInt(br.readLine());
            ArrayList<Integer> array = new ArrayList<>();
            for(int i = 0 ; i < n ; i++){
                array.add(Integer.parseInt(br.readLine()));
            }
            int max = array.get(1) - array.get(0);
            int min = array.get(0);
            for(int i = 1 ; i < n ; i++){
                if(array.get(i) - min > max){
                    max = array.get(i) - min;
                }
                if(array.get(i) < min){
                    min = array.get(i);
                }
            }

            System.out.println(max);

        }
        catch(Exception e){
            System.err.println(e);
        }


    }
}

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

int main()
{
    int a, b, k;
    cin >> a >> b >> k;

    for (int i = a; i <= b; i++)
    {
        if (i < (a + k) || i > (b - k))
        {
            cout << i << "\n";
        }
    }

}

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

int main()
{
    int N;

    scanf("%d", &N);
    std::vector<char> S;
    S.resize(N + 1);
    scanf("%s", S.data());

    int total = -1;
    char last = -1;
    for (auto s : S)
    {
        if (last == s)
        {
            continue;
        }
        last = s;
        ++total;
    }

    printf("%d\n", total);
}


Measured memory_bytes: 384
n=int(input())
a=[int(input()) for _ in range(n)]

max_i=a.index(max(a))
max_n=max(a)
a.pop(max_i)
semi_n=max(a)

for j in range(n):
  if j != max_i:
    print(max_n)
  else:
    print(semi_n)


Measured memory_bytes: 12560
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;


using ll = long long;

//#define int ll


const int N = 3e5 + 11, mod = 1e9 + 7, mod2 = 998244353;
const int MAX = 1e5 + 11;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const double INF3 = 1e8 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-4;
const double PI = acos(-1.0);


template<typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }


typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
bool prime(int n) {
    for(int i=2;i<=sqrt(n);i++){
        if(n%i==0){return 0;}
    }return 1;}

bool f(string s) {
    string t = s;
    reverse(all(t));
    return s == t;
}

int main() {
    ios;
    string s;
    cin >> s;
    if(f(s) && f(s.substr(0 , (s.size()/2)))) {
        cout << "Yes";
    }
    else {
        cout << "No";
    }
    return 0;
}



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

int main(){
    string code="CODEFESTIVAL2016";
    string inp;
    cin>>inp;
    int ans=0;

    for(int i=0;i<code.size();++i){
        if(code[i]!=inp[i])ans++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <limits>
#include <cmath>
#include <cassert>

using namespace std;
using ll = long long;

const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, k; cin >> n >> k;
    ll ans = 1;
    for(int i = 0; i < n; i++)
    {
        ans = (ans * k) % MOD;
    }
    cout << ans << endl;
    return 0;
}




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

using namespace std;

typedef long long ll;

int main(){
    string x;
    cin >> x;
    for(int a = 0; a < 3; a++){
        if(x[a] == '1')x[a] = '9';
        else x[a] = '1';
    }
    cout << x << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>

#include <string>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <deque>
#include <algorithm>
#include <random>
#include <iomanip>
using namespace std;


int main(int argc, char *argv[]) {
    const long double PI  =3.141592653589793238463;
    int a, b, x;
    cin >> a >> b >> x;
    cout << setprecision(10);
    if (x * 2 >= a * a * b) {
        long double t = (a * a * b - x) * (long double)2.0 / a / a;
        cout << atan(t / a) / PI * 180 << endl;
    }
    else {
        cout << atan(b / (x * (long double)2.0 / a / b)) / PI * 180 << endl;
    }
}




Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
struct coo
{
	int x;
	int y;
    int h;
}c[110];
int main()
{
	int n;
	cin>>n;
	for (int i=0;i<n;i++)
	{
		cin>>c[i].x;
		cin>>c[i].y;
		cin>>c[i].h;
	}
	int ch,p=0;
	while (c[p].h==0)  p++;
	for (int i=0;i<=100;i++)
	{
		for (int j=0;j<=100;j++)		
		{			
			int ch=c[p].h+abs(i-c[p].x)+abs(j-c[p].y);			
			int f=0;			
			for (int k=0;k<n;k++)			
			{				
				int hh=ch-fabs(i-c[k].x)-fabs(j-c[k].y);				
				if (hh<0)  hh=0;
				if (hh!=c[k].h)				
				{
					f=1;				
					break;				
				}			
			}			
			if (!f)			
			{				
				cout<<i<<' '<<j<<' '<<ch<<endl;
				return 0;			
		    } 		
		}
	}
	return 0;
}

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

int main() {
  int a,b,c;cin>>a>>b>>c;
  int d=a-b;
  cout<<(d>c ? 0:c-d);
  return 0;
}

Measured memory_bytes: 256