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

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);i--)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll) 1e9 + 7;
//constexpr long long MOD = 998244353LL;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve(){
    ll n,m;
    cin>>n>>m;
    if(n%2==1){
        REP(i,m){
            cout<<m-i<<" "<<m - i + 2 * i + 1 <<en;
        }
        return;
    }
    
    REP(i,m){
        cout<<m-i<<" "<<m-i+2*i+1+(2*i+1>=n/2? 1:0)<<en;
    }

}

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

    solve();
    //ll t;cin>>t;REP(i,t) solve();

    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<vector>
#include<stdio.h>
using namespace std;

void solve() {

	string s;
	int K = 9;
	int N;
	int **data;
	cin >> N;
	data = new int*[K];
	for (int i = 0;i < K;i++) {
		data[i] = new int[K];
	}

	for (int i = 0;i < K;i++) {
		for (int j = 0;j < K;j++) {
			data[i][j] = (i + 1)*(j + 1);
		}
	}

	bool flag = false;
	for (int i = 0;i < K;i++) {
		for (int j = 0;j < K;j++) {
			if (data[i][j] == N)flag = true;
		}
	}
	
	if (flag) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}


}


int main() {
	
	solve();

}

Measured memory_bytes: 256
#include <cstdio>


int main() {
    int i = 1, poza, pozz, sema = 0;
    char ch;
    ch = fgetc(stdin);
    while (ch != '\n') {
        if (ch == 'A' && sema == 0) {
            sema = 1;
            poza = i;
        }
        if (ch == 'Z')
            pozz = i;
        ch = fgetc(stdin);
        i++;
    }
    int rez = pozz - poza + 1;
    printf("%d", rez);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
	int a, b, c, cnt = 0;
	cin >> a >> b >> c;
	int ans = b / c - a / c;
	if (a % c == 0) {
		ans++;
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
     string s;
     cin>>s;
     int l=s.length();
     int c=0;
     for(int i=0;i<l;i++){
        if(s[i]=='9') c++;
     }
     if(c>=1) cout<<"Yes"<<endl;
     else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(input())
    a = list(map(int, readline().split()))
    b = list(map(int, readline().split()))
    c = list(map(int, readline().split()))
    a.sort()
    b.sort()
    c.sort()

    count_ab = [0] * n
    count_bc = [0] * n

    import bisect

    for bi, middle in enumerate(b):
        count_ab[bi] = bisect.bisect_left(a, middle)

    for ci, bottom in enumerate(c):
        count_bc[ci] = bisect.bisect_left(b, bottom)

    from itertools import accumulate

    cum_ab = [0] + list(accumulate(count_ab))
    ans = 0

    for i in range(n):
        num = count_bc[i]
        ans += cum_ab[num]

    print(ans)

if __name__ == '__main__':
    main()


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

using namespace std;

int a[10001];
int b[101][101];

int main() {
    ios_base::sync_with_stdio(false);
    int h, w, n;
    cin >> h >> w >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    int q = 0, j = 0, r = 1;
    bool ch = false;
    while (!ch) {
        if (j % 2 == 0) {
            for (int i = 0; i < h; ++i) {
                b[i][j] = r;
                a[q]--;
                if (a[q] == 0) {
                    q++;
                    r++;
                }
            }
            j++;
            if (j == w) {
                ch = true;
                break;
            }
        } else {
            for (int i = h-1; i > -1; --i) {
                b[i][j] = r;
                a[q]--;
                if (a[q] == 0) {
                    q++;
                    r++;
                }
            }
            j++;
            if (j == w) {
                ch = true;
                break;
            }
        }
    }
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            cout << b[i][j] << ' ';
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define int long long
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define FOR(i,a,b) for(long long i=a; i<b; i++)
#define ll long long
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define PB(x) push_back(x)
#define MP make_pair
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<'Y'<<'e'<<'s'<<endl
#define coutn cout<<'N'<<'o'<<endl
#define coutY cout<<'Y'<<'E'<<'S'<<endl
#define coutN cout<<'N'<<'O'<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
const long long dx[4]={1,0,-1,0};
const long long dy[4]={0,1,0,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;
//cout<<fixed<<setprecision(15)<<

signed main(){
    int n; cin >> n;
    vint l(n);
    rep(i,n) cin >> l[i];
    sort(all(l));
    int res=0;
    rep(i,n-2){
        FOR(j,i+1,n-1){
            auto k=lower_bound(all(l),l[i]+l[j])-l.begin();
            res+=max(k-(j+1),0LL);
        }
    }
    cout<<res<<endl;
}

Measured memory_bytes: 384
N, X = map(int, input().split())

a, p = [1], [1]

for i in range(N):
    a.append(2*a[i] + 3)
    p.append(2*p[i] + 1)

def burger(N, X):
    if N == 0:
        return 0 if X <= 0 else 1

    elif X <= 1 + a[N-1]:
        return burger(N-1, X-1)

    else:
        return p[N-1] + 1 + burger(N-1, X-2-a[N-1])

print(burger(N, X))


Measured memory_bytes: 3064
//
//AtCoder Beginner Contest XXX
//X - XXXX
//

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define reAll(x) (x).rbegin(),(x).rend()

using ll = long long;

const double PI = 3.14159265358979323846;
const int MOD = 1000000007;

int main()
{
    int s,w;

    cin >> s >> w;

    if (s <= w){
        cout << "unsafe" << endl;
    }else{
        cout << "safe" << endl;
    }

    return 0;
}


Measured memory_bytes: 3636
import java.util.Scanner;

public class Main 
{
	static int h,w,k;
	static boolean[][] c;

	static class Division
	{
		int start;
		int fin;
		
		public Division(int s)
		{
			start = s;
		}
	}
	
	static int div(int ca)
	{
		
//		System.out.println(Integer.toString(ca,2));
		int cuts = 0;
		for(int y = 0; y < h-1; y++)
		{
			boolean cut = (mask[y] & ca)>0;
			if(cut)cuts++;
		}
		int an = cuts;
		
		Division[] div = new Division[cuts+1];
		
		int curcut = 0;
		div[0] = new Division(0);
		div[0].fin = h-1; //in case of no further divs
		for(int y = 0; y < h-1; y++)
		{
			boolean cut = (mask[y] & ca)>0;
			
			if(cut)
			{
				div[curcut].fin = y;
				
				curcut++;
				div[curcut] = new Division(y+1);
			}
		}
		div[curcut].fin = h-1;
		int divs = cuts+1;
		
		int[] belongto = new int[h];
		int curd = 0;
		
		for(int i = 0; i < divs; i++)
		{
//			System.out.println(div[i].start + "-" + div[i].fin);
		}

		
		for(int y = 0; y < h; y++)
		{
			if(div[curd].fin < y)curd++;
			belongto[y] = curd;
//			System.out.println(y + " belongs to " + curd + ", fin " + div[curd].fin);
		}
		
		
		int[] load = new int[divs];
		for(int x = 0; x < w; x++)
		{
//			System.out.println("x " + x);
//			System.out.println(div[i].start + "-" + div[i].fin);
			boolean cuthere = false;
			
			for(int y = 0; y < h; y++)
			{
				if(c[y][x])
				{
					load[belongto[y]]++;
					
//					System.out.println("Load of " + belongto[y] + " is now " + load[belongto[y]]);
					
					if(load[belongto[y]] > k)
						cuthere = true; //cut before here so that this one belongs to next load
				}
			}
			if(cuthere)
			{ //fresh new loads
				an++;
				for(int i = 0; i < divs; i++)
					load[i] = 0;
				for(int y = 0; y < h; y++)
				{
					if(c[y][x])
						load[belongto[y]]++;
					if(load[belongto[y]] > k)
					{ //still overloaded! abandon.
						return 99999999;
					}
				}
				
			}
		}
//		System.out.println("Rets " + an + ", cuts " + cuts);
		return an;
	}
	
	static int[] mask = new int[9];
	static int[][] suml;
	
	public static void main(String[] args) 
	{
		int cuma = 1;
		for(int i = 0; i < 9; i++)
		{
			mask[i] = cuma;
			cuma *= 2;
		}
		
		Scanner sc = new Scanner(System.in);
		h = sc.nextInt();
		w = sc.nextInt();
		k = sc.nextInt();
		c = new boolean[h][w];
		suml = new int[h][w];
		
		for(int i = 0; i < h; i++)
		{
			String s = sc.next();
			for(int x = 0; x < w; x++)
			{
				c[i][x] = s.charAt(x) == '1';
//				if(x>0)suml[h][x] = suml[h][x-1];
//				if(c[i][x])suml[h][x]++;
			}
		}
		
		int cases = 1;
		for(int i = 0; i < h-1; i++)
			cases *= 2;
		int mi = 999999999;
		for(int ca = 0; ca < cases; ca++)
		{ //cut after this?
			mi = Math.min(mi, div(ca));
		}
		
//		System.out.println("....");
		System.out.println(mi);
		
	}

}


Measured memory_bytes: 23380
As = 3.times.map{gets.split.map(&:to_i)}
N = gets.to_i
Bs = readlines.map(&:to_i)

as = As.flatten
Bs.each do |b|
  if i = as.index(b)
    as[i] = 'o'
  end
end
as = as.each_slice(3).to_a
at = as.transpose
ad = [(0 .. 2).map{|i| as[i][i]}] + [(0 .. 2).map{|i| as[i][2 - i]}]
puts (as + at + ad).any?{|a| a == %w(o o o)} ? 'Yes' : 'No'

Measured memory_bytes: 3836
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;

int main() {

int s,w; cin>>s>>w; 
  if(s>w){cout<<"safe"<<endl;}
  else{cout<<"unsafe"<<endl;}

  
}


Measured memory_bytes: 3632
N, M = map(int, input().split())
if N == 1:
    print(1)
    quit()
S = [-1] * (N + 1)
S[0] = 1
for i in range(M):
    S[int(input())] = 0
if S[1] != 0:
    S[1] = 1
for i in range(2, N + 1):
    if S[i] == 0:
        continue
    else:
        S[i] = (S[i - 1] + S[i - 2]) % 1000000007
        if S[i] == 0:
            print(0)
            quit()
print(S[N])

Measured memory_bytes: 12696
#include <bits/stdc++.h>
using namespace std;
int main(){
  
  int A, B, C;
  cin >> A >> B >> C;
  
  if(A == B or A == C or B == C){
    if(A == B and A == C) {
      cout << "No";
	  return 0;
    }cout << "Yes";
  }else{
    cout << "No";
  }
}

Measured memory_bytes: 256
import java.util.*;
class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n/2];
        int[] b = new int[n/2];
 
        for(int i = 0; i < n/2; i++){
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();
        }
 
        int ans_a1 = 1;
        int ans_a2 = 1;
        int ans_b1 = 1;
        int ans_b2 = 1;
        
        Arrays.sort(a);
        Arrays.sort(b);
 
        int k = 1; 
        int l = 1;
        int x1 = a[0];
        int y1 = b[0];
 
        for(int i = 1; i < n/2; i++){
            if(a[i] == a[i-1]){
                k++;
                if(ans_a1 <= k){
                    ans_a2 = ans_a1;
                    ans_a1 = k;
                    x1 = a[i-1];
                }
                else if(ans_a2 <= k)
                    ans_a2 = k;
            }
            else
                k = 1;
        }
        for(int i = 1; i < n/2; i++){
            if(b[i] == b[i-1]){
                l++;
                if(ans_b1 <= l){
                    ans_b2 = ans_b1;
                    ans_b1 = l;
                    y1 = b[i-1];
                }
                else if(ans_b2 <= l)
                    ans_b2 = l;
            }
            else
                l = 1;
        }
        int ans = n - (ans_a1 + ans_b1);
        if(ans_a1 == n/2) ans_a2 = 0;
        if(ans_b1 == n/2) ans_b2 = 0;
        if(x1 == y1)
            ans = Math.min(n - (ans_a1 + ans_b2), n - (ans_b1 + ans_a2));
        System.out.println(ans);
    }
}

Measured memory_bytes: 52068
package main

import (
	"fmt"
)

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	if n == 1 && m != 1 {
		fmt.Println(m - 2)
	} else if n != 1 && m == 1 {
		fmt.Println(n - 2)
	} else {
		fmt.Println(n*m - (2*n + 2*m - 4))
	}
}


Measured memory_bytes: 512
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second
#define mp make_pair
 
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1ll << 60;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
  ll N; cin >> N;
  if (N % 2 != 0){
    cout << 0 << endl;
    return 0;
  }
  ll ans = 0, now = 10;
  while (N >= now){
    ans += N / now; now *= 5;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
N = int(input())
A = [int(i) for i in input().split()]
# dif = A1-A2+A3-A4 ...
dif = sum([A[i] * pow(-1, i) for i in range(N - 1)])
ans = [0] * N
ans[0] = A[-1] + dif
ans[-1] = A[-1] - dif
for i in range(1, N - 1):
    ans[i] = 2 * A[i - 1] - ans[i - 1]
print(*ans)


Measured memory_bytes: 14020
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
#define fore(i,x,y) for(ll i=(x);i<(y);i++)
#define disp(a) cout << a << endl;
typedef long long ll;
using namespace std;
int main()
{
	int a, b;
	cin >> a >> b;
	if (a <= b) {
		disp(a);
	}
	else {
		disp(a-1);
	}

}

Measured memory_bytes: 256
n=int(input())
l=list(map(int,input().split()))
c=abs(l[0])
for i in range(len(l)-1):
  c+=abs(l[i+1]-l[i])
c+=abs(l[n-1])
print(c-abs(l[0])-abs(l[1]-l[0])+abs(l[1]))
for i in range(1,n-1):
  print(c-abs(l[i]-l[i-1])-abs(l[i+1]-l[i])+abs(l[i+1]-l[i-1]))
print(c-abs(l[n-1]-l[n-2])-abs(l[n-1])+abs(l[n-2]))

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

#define rep(i,x,y) for(long long int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define show(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define show(x)
#endif

typedef long long int ll;
typedef pair<int,int> pii;
template<typename T> using vec=std::vector<T>;

const int inf=1<<30;
const long long int infll=1LL<<62;
const double eps=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
    	os << v << ",";
    }
    os << "]";
    return os;
}

void solve(){
    ll x_size,y_size,z_size,a,b,c,n;
    cin >> x_size >> y_size >> z_size >> a >> b >> c >> n;

    vector<ll> cnt1(n);
    rep(i,0,n) cnt1[i]+=(x_size-a)/n;
    rep(x,a+n*((x_size-a)/n),x_size) ++cnt1[(x-a)%n];
    rep(i,0,n) cnt1[i]+=(a+1)/n;
    for(ll x=a-n*((a+1)/n); x>=0; --x) ++cnt1[(a-x)%n];
    --cnt1[0];

    vector<ll> cnt2(n);
    rep(i,0,n) cnt2[i]-=cnt1[i];
    rep(i,0,n) cnt2[i]+=x_size*((y_size-b)/n);
    {
        vector<ll> tmp1(n);
        ll y1=b+n*((y_size-b)/n),z1=c;
        rep(x,0,x_size) ++tmp1[(abs(x-a)+abs(y1-b)+abs(z1-c))%n];
        rep(y,y1,y_size){
            rep(i,0,n) cnt2[i]+=tmp1[i];
            vector<ll> tmp2(n);
            rep(i,0,n) tmp2[i]=tmp1[(i-1+n)%n];
            swap(tmp1,tmp2);
        }
    }
    rep(i,0,n) cnt2[i]+=x_size*((b+1)/n);
    {
        vector<ll> tmp1(n);
        ll y1=b-n*((b+1)/n),z1=c;
        rep(x,0,x_size) ++tmp1[(abs(x-a)+abs(y1-b)+abs(z1-c))%n];
        for(ll y=y1; y>=0; --y){
            rep(i,0,n) cnt2[i]+=tmp1[i];
            vector<ll> tmp2(n);
            rep(i,0,n) tmp2[i]=tmp1[(i-1+n)%n];
            swap(tmp1,tmp2);
        }
    }

    vector<ll> cnt3(n);
    rep(i,0,n) cnt3[i]-=cnt2[i];
    rep(i,0,n) cnt3[i]+=x_size*y_size*((z_size-c)/n);
    {
        vector<ll> tmp1(n),tmp2(n);
        rep(i,0,n) tmp1[i]=cnt2[i];
        rep(z,c+n*((z_size-c)/n),z_size){
            rep(i,0,n) cnt3[i]+=tmp1[i];
            vector<ll> tmp2(n);
            rep(i,0,n) tmp2[i]=tmp1[(i-1+n)%n];
            swap(tmp1,tmp2);
        }
    }
    rep(i,0,n) cnt3[i]+=x_size*y_size*((c+1)/n);
    {
        vector<ll> tmp1(n),tmp2(n);
        rep(i,0,n) tmp1[i]=cnt2[i];
        for(ll z=c-n*((c+1)/n); z>=0; --z){
            rep(i,0,n) cnt3[i]+=tmp1[i];
            vector<ll> tmp2(n);
            rep(i,0,n) tmp2[i]=tmp1[(i-1+n)%n];
            swap(tmp1,tmp2);
        }
    }

    rep(i,0,n) cout << cnt3[i] << (i==n-1?"\n":" ");
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(10);
    solve();
    return 0;
}

Measured memory_bytes: 3240
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()

def prime(n):
    if n<=1: return []
    S=[1]*(n+1)
    S[0]=0; S[1]=0
    for i in range(2,n):
        if S[i]==0: continue
        for j in range(2*i,n+1,i):
            S[j]=0
    return [p for p in range(n+1) if S[p]]

def resolve():
    n=int(input())
    P=prime(55555)
    S=set()
    for p in P:
        if(p%5==1): S.add(p)
    print(*list(S)[:n])
resolve()

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

int main() {
  int N, A;
  
  cin >> N >> A;
  
  int R = N % 500;
  
  if (R <= A) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int h = sc.nextInt();
		int w = sc.nextInt();
		sc.close();

		System.out.println((H-h) * (W-w));
	}
}


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

using namespace std;

int main()
{
  int N;
  cin >> N;

  int X, Y, Z;
  map<int, bool> mp1, mp2;
  cin >> X;
  for ( int i = 0; i < X; i++ ) {
    int a;
    cin >> a;
    mp1[a] = true;
  }

  cin >> Y;
  for ( int i = 0; i < Y; i++ ) {
    int a;
    cin >> a;
    mp2[a] = true;
  }

  cin >> Z;
  int ans = 0;
  for ( int i = 0; i < Z; i++ ) {
    int a;
    cin >> a;
    if ( !mp1[a] || mp2[a] ) ans++;
  }

  cout << ans << endl;
}

Measured memory_bytes: 3116
if __name__ == "__main__":
  num = input()
  slimes = input()

  tmp = []
  for i in range(0,len(slimes)):
    if len(tmp):
      if slimes[i] != tmp[-1]:
          tmp.append(slimes[i])
    else:
      tmp.append(slimes[i])
  print(len(tmp))

Measured memory_bytes: 3956
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a, b, c;
        String op;
        while (true) {
            a = scanner.nextInt();
            op = scanner.next();
            b = scanner.nextInt();
            if (op.equals("?")) {
                break;
            }
            switch (op) {
                case "+":
                    c = a + b;
                    System.out.println(c);
                    break;
                case "-":
                    c = a - b;
                    System.out.println(c);
                    break;
                case "*":
                    c = a * b;
                    System.out.println(c);
                    break;
                case "/":
                    c = a / b;
                    System.out.println(c);
                    break;
                default:
                    break;
            }

        }

    }
}

Measured memory_bytes: 26276
import sys
import numpy as np
input = sys.stdin.readline

def main():
    N, K = map(int, input().split())
    a = list(map(int, input().split()))

    MOD = int(1e9) + 7
    left = [0] * N
    right = [0] * N
    for i in range(N):
        for j in range(i):
            if a[j] < a[i]:
                left[i] += 1
        for j in range(i, N):
            if a[j] < a[i]:
                right[i] += 1
    # print(left)
    # print(right)
    ans = 0
    for i in range(N):
        start = (left[i] + right[i]) * (K - 1) + right[i]
        end = right[i]
        ans += ((start + end) * K) // 2
        ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

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

using namespace std;

const int maxn = 10;
int h, w, a[maxn][maxn], cunt;
int f(int i, int j);

bool ok(int i, int j) {
	if(a[i][j] == 1) {
		if(i == 0 and j == 0 ) {
			return false;
		}
		if(a[i - 1][j] == 1 xor a[i][j - 1] == 1) {
			if(a[i - 1][j] == 1){
				return ok(i - 1, j);
			}
			else{
				return ok(i, j - 1);
			}
		}
		else{
		    return true;
		}
	}
	else{
		return true;
	}
}

int main()
{
	string s[maxn];
	cin >> h >> w;
	for(int i = 0; i < h; i++) {
		cin >> s[i];
	}
	for(int i = 0; i < h; i++) {
		for(int j = 0; j < w; j++) {
			if(s[i][j] == '#') {
				a[i][j] = 1;
				cunt++;
			}
		}
	}
	if(cunt != h + w - 1) {
		cout << "Impossible";
		return 0;
	}
	if(ok(h - 1, w - 1)) {
		cout << "Impossible";
		return 0;
	}
	else{
		cout << "Possible";
	}
}


Measured memory_bytes: 256
//パーティション
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define vec_input(v) for(auto it=v.begin();it!=v.end();it++){cin>>*it;}
#define vec_output(v) for(auto it=v.begin();it!=v.end();it++){if(it!=v.begin())cout<<" ";cout<<*it;}cout<<endl;
#define vec_debug(v) for(auto it=v.begin();it!=v.end();it++){cerr<<*it<<" ";}cerr<<endl;
#define yn(ans) cout<<(ans?"Yes":"No")<<endl
#define YN(ans) cout<<(ans?"YES":"NO")<<endl
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;

int partition(vector<int> &A,int p,int r){
    int x=A[r];
    int i=p-1;
    for(int j=p;j<r;j++){
        if(A[j]<=x){
            i++;
            swap(A[i],A[j]);
        }
    }
    swap(A[i+1],A[r]);
    return i+1;
}

int main(){
    int n;
    cin>>n;
    vector<int> vec(n);
    vec_input(vec);
    int index;
    index=partition(vec,0,n-1);
    rep(i,n){
        if(i)cout<<" ";
        if(i==index)cout<<"["<<vec[i]<<"]";
        else cout<<vec[i];
    }
    cout<<endl;
}


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

int main() {
    int H, W;
    cin >> H >> W;

    char minesweeper[H][W];
    rep(h, H) {
        rep (w, W) {
            cin >> minesweeper[h][w];
        }
    }

    rep(h, H) {
        rep(w, W) {
            if (minesweeper[h][w] == '#') {
                continue;
            } else {
                int count = 0;
                for (int i = max(0, h - 1); i < min(h + 2, H); i++) {
                    for (int j = max(0, w - 1); j < min(w + 2, W); j++) {
                        if (i == h && j == w) {
                            continue;
                        } else if (minesweeper[i][j] == '#') {
                            count++;
                        }
                    }
                }
                minesweeper[h][w] = '0' + count;
            }
        }
    }

    rep(h, H) {
        rep (w, W) {
            cout << minesweeper[h][w];
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func newScanner() *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	// buf := make([]byte, 10000)
	// scanner.Buffer(buf, 1000000)
	return scanner
}

func scanInt(s *bufio.Scanner) int {
	if s.Scan() {
		t := s.Text()
		if v, err := strconv.Atoi(t); err == nil {
			return v
		}
		panic(fmt.Sprintln("Could't scan int from input", t))
	}
	panic(s.Err())
}

func scanInts(s *bufio.Scanner, n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = scanInt(s)
	}
	return a
}

func main() {
	sc := newScanner()
	n := []int{1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}
	k := scanInt(sc)
	fmt.Println(n[k-1])
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <cassert>
using namespace std;
using ll = long long;


int main() {
	int n; cin >> n;
	vector<string> s(n);
	for (int i = 0; i < n; i++) cin >> s[i];
	map<string, int> cnt;
	for (int i = 0; i < n - 1; i++) {
		if (s[i].back() != s[i + 1].front()) {
			cout << "No" << endl;
			return 0;
		}
		cnt[s[i]]++;
	}
	cnt[s[n - 1]]++;
	for (auto p : cnt) {
		if (p.second >= 2) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
} 

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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

const double EPS = 1e-9;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<60;
const long long MOD = 1000000007;

#define CLR(a) memset((a), 0, sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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

struct mint {
    long long x;
    mint(long long x=0):x((x%MOD+MOD)%MOD){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += MOD-a.x) >= MOD) x -= MOD;
    	return *this;
    }
    mint& operator*=(const mint a) {
    	(x *= a.x) %= MOD;
    	return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(long long t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
    	if (t&1) a *= *this;
        return a;
    }
    // for prime MOD
    mint inv() const {
        return pow(MOD-2);
    }
    mint& operator/=(const mint a) {
    	return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res/=a;
    }
};

int main(void){
    ll n,m; cin >> m >> n;
    cout << mint(m).pow(n).x << en;
    return 0;
}


Measured memory_bytes: 3112
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<string>
#include<iostream>
using namespace std;
int main() {
	string st;
	cin >> st;
	bool n(st.find('N') != -1);
	bool s(st.find('S') != -1);
	bool e(st.find('E') != -1);
	bool w(st.find('W') != -1);
	printf("%s\n", w == e && n == s ? "Yes" : "No");
}


Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
using namespace std;

#define INF (1ll<<60)


long long M = 1000000007;


int main(int argc, char const *argv[]) {
    int n;cin>>n;
    long long x;cin>>x;
    vector<long long> a(n);
    for(int i=0;i<n;++i)cin>>a[i];
    sort(a.begin(),a.end());
    int res=0;
    for(int i=0;i<n;++i){
        x-=a[i];
        if(x<0)break;
        res++;
    }
    if(res==n&&x>0)res--;
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 256
#
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.insert(0,0)
visited={}
l=[0]
i=a[1]
while True:
    if visited.get(i,False)==False:
        visited[i]=True
        l.append(i)
        i=a[i]
    else:
        index=l.index(i)
        l1=l[0:index]
        l2=l[index:]
        #print(i,l1,l2)
        break
#print(l1,l2)
if k<=len(l1)-1:
    print(l1[k])
else:
    if len(l1)>1:
        k-=(len(l1)-1)
    idx=(k-1)%len(l2)
    print(l2[idx])

Measured memory_bytes: 35520
#include<stdio.h>
#include<stdlib.h>

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

//Node treeMinimum(Node x){


//}

//Node treeMaximum(Node x){


//}

//Node treeSearch(Node u, int k){


//}

//Node treeSuccessor(Node x){


//}

//void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



//}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;
  
  while(x!=NIL){
    y=x;
    if(z->key < x->key) x=x->left;
    else x=x->right;
  }
  z->parent=y;

  if(y==NIL) root=z;
  else if(z->key < y->key) y->left=z;
  else y->right=z;
}

void inorder(Node u){
  if(u->left!=NIL) inorder(u->left);
  printf(" %d",u->key);
  if(u->right!=NIL) inorder(u->right);
}
void preorder(Node u){
  printf(" %d",u->key);
  if(u->left!=NIL) preorder(u->left);
  if(u->right!=NIL) preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    /*if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
      } else*/ if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      //treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}



Measured memory_bytes: 25152
#include<bits/stdc++.h>
using namespace std;
#define int           long long
#define	pb            push_back
#define all(a)        (a).begin(),(a).end()
#define sz(x)         (int)x.size()
#define F             first
#define S             second
#define endl          "\n"
#define inf           1000000007
#define FOR(i, a, b)  for(int i=a; i<b; i++)
#define bigboi        1e18
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count()); 
#define SHUF(v) shuffle(all(v), RNG);
// Use mt19937_64 for 64 bit random numbers. 

vector<int> adj[100005], dp(100005, 0), vis(100005);

void dfs(int u){
	vis[u] = 1;
	int res=0;
	for(int v:adj[u]){
		if(!vis[v]){
			dfs(v);
		}
		dp[u] = max(dp[u], 1+dp[v]);
	}
}
void solve(){	
	int n, m;
	cin>>n>>m;
	FOR(i, 0, m) {
		int a, b;
		cin>>a>>b;
		adj[a].pb(b);
	}
	int res=-1;
	FOR(i, 1, n+1){
		if(!vis[i]) dfs(i);
	}
	//FOR(i, 1, n+1) cout<<dp[i]<<" ";
	cout<<*max_element(all(dp))<<endl;
}
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0); 	
	int t=1;
	//cin>>t;
	FOR(i, 1, t+1){	
		//cout<<"Case #"<<i<<": ";
		solve();
	}
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
	return 0;
 
}


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

int findsumoo(int n){
    int sum = 0;

    while(n >0){
        sum += n % 10;
        n /= 10;
    }

    return sum;
}

int main(){
    int N,A,B;
    int total = 0;
    cin >> N >> A >> B;
    for(int i=0;i<=N;i++){
        int sum = findsumoo(i);
        if(sum >= A && sum <= B)    total += i;
    }

    cout << total << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
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;}


struct FastIO{
  FastIO(){
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
}fastio_beet;

//INSERT ABOVE HERE
const int MAX = 2020;
bool a[MAX][MAX]={};
using BS = bitset<MAX>;
BS st[MAX],dpL[MAX],dpR[MAX];
signed main(){
  int n;
  cin>>n;
  for(int i=1;i<n;i++){
    string s;
    cin>>s;
    for(int j=0;j<i;j++){
      a[i][j]=s[j]-'0';      
      a[j][i]=!a[i][j];
    }
  }
  
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      if(a[i][j]) st[i].set(j);
      
  for(int i=0;i<n;i++){
    dpL[i].set(i);
    dpR[i].set(i);
  }

  for(int w=2;w<=n;w++){
    for(int i=0;i+w<=n;i++){
      int l=i,r=i+w-1;
      {
        BS x=dpR[l+1]&dpL[r]&st[l];      
        if((int)x._Find_next(l)<=r) dpL[r].set(l);
      }
      { 
        BS x=dpR[l]&dpL[r-1]&st[r];
        if((int)x._Find_next(l-1)<r) dpR[l].set(r);        
      }
    }
  }
  
  cout<<(dpR[0]&dpL[n-1]).count()<<endl;  
  return 0;
}


Measured memory_bytes: 5760
#include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <typeinfo>
#define PI 3.14159265359
#define INF 99999999;
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)
#define EPS 1e-10
typedef long long ll;
using namespace std;
typedef pair<int, int> P;

double distanceAB(double xa, double ya, double xb, double yb);
//void trace(int A[], int N);

/*
class Target
{
public:
	vector <string> draw(int n)
	{

	}
};
*/


static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;

int n, M[MAX][MAX];

int prim()
{
	int u, minv;
	int d[MAX], p[MAX], color[MAX];
	
	REP(n)
	{
		d[i] = INFTY;
		p[i] = -1;
		color[i] = WHITE;
	}
	
	d[0] = 0;
	
	while (1)
	{
		minv = INFTY;
		u = -1;
		REP(n)
		{
			if (minv > d[i] && color[i] != BLACK)
			{
				u = i;
				minv = d[i];
			}
		}
		if (u == -1) break;
		color[u] = BLACK;
		rep(v, n)
		{
			if (color[v] != BLACK && M[u][v] != INFTY)
			{
				if (d[v] > M[u][v])
				{
					d[v] = M[u][v];
					p[v] = u;
					color[v] = GRAY;
				}
			}
		}
	}
	
	int sum = 0;
	REP(n)
	{
		if (p[i] != -1) sum += M[i][p[i]];
	}
	
	return sum;
}


int main()
{
	cin >> n;
	
	rep(i, n)
	{
		rep(j, n)
		{
			int e;
			cin >> e;
			M[i][j] = (e == -1) ? INFTY : e;
		}
	}
	
	cout << prim() << endl;
	
	return 0;
}


/*
void trace(int A[], int N)
{
	REP(N)
	{
		if (i > 0) cout << " ";
		cout << A[i];
	}
	cout << endl;
}
*/


double distanceAB(double xa, double ya, double xb, double yb)
{
	return sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));
}

Measured memory_bytes: 1196
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int S = sc.nextInt();
    int W = sc.nextInt();
    sc.close();

    boolean ans = S <= W;

    System.out.println(ans ? "unsafe" : "safe");
  }
}


Measured memory_bytes: 35684
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


// Union-Find Disjoint Sets Library written in OOP manner, using both path compression and union by rank heuristics
// initialize: UnionFind UF(N)

class UnionFind {                                              // OOP style
private:
	vector<int> p, rank, setSize;
	// p = path toward the root of disjoint set; p[i] = i means it is root
	// rank = upper bound of the actual height of the tree; not reliable as accurate measure
	// setSize = size of each disjoint set

	int numSets;
public:
	UnionFind(int N) {
		setSize.assign(N, 1);
		numSets = N;
		rank.assign(N, 0);
		p.assign(N, 0);
		for (int i = 0; i < N; i++) p[i] = i;	// each belongs to its own set
	}

	int findSet(int i) {
		return (p[i] == i) ? i : (p[i] = findSet(p[i]));		// path compression: cut short of the path if possible
	}

	bool isSameSet(int i, int j) {
		return findSet(i) == findSet(j);
	}

	void unionSet(int i, int j) {
		if (!isSameSet(i, j)) {
			numSets--;
			int x = findSet(i), y = findSet(j);
			// rank is used to keep the tree short
			if (rank[x] > rank[y]) { p[y] = x; setSize[x] += setSize[y]; }
			else {
				p[x] = y; setSize[y] += setSize[x];
				if (rank[x] == rank[y]) rank[y]++;
			}
		}
	}

	int numDisjointSets() {		// # of disjoint sets
		return numSets;
	}

	int sizeOfSet(int i) {		// size of set
		return setSize[findSet(i)];
	}
};

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

	int a, b;
	cin >> a >> b;
	if (a + b >= 10) cout << "error\n";
	else cout << a + b << "\n";

	return 0;
}


Measured memory_bytes: 888
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> a(n), b(n);
    for(int i=0; i<n; ++i)
        cin >> a[i] >> b[i];
    vector<int> c(m), d(m);
    for(int i=0; i<m; ++i)
        cin >> c[i] >> d[i];

    for(int i=0; i<n; ++i){
        int ans = -1;
        int minDist = INT_MAX;
        for(int j=0; j<m; ++j){
            int dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
            if(dist < minDist){
                minDist = dist;
                ans = j + 1;
            }
        }
        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int n,i,t,small,dif,mv;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&t);
        if(i==0) small = t;
        dif = t-small;
        if(small>t)
        {
            small = t;
        }
        if(i==1) mv = dif;
        if(i>1)
        {
            if(mv<dif) mv = dif;
        }
    }
    printf("%d\n",mv);
}


Measured memory_bytes: 2100
S = list(input())
ACGT = ['A', 'C', 'G', 'T']

count_list = []
for i in range(len(S)):
    count = 0
    for j in range(i, len(S)):
        if S[j] in ACGT:
            count += 1
        else:
            break
    count_list.append(count)

print(max(count_list))

Measured memory_bytes: 9064
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using ll=long long;
using namespace std;
int main(){
  ll a;
    double b;
cin>>a>>b;
  ll ib=100*b+0.5;//一旦bを100倍 doubleからllの変換で微妙な誤差が切り捨てられる？
//  cout<<ib<<endl;
  a*=ib;//整数同士で演算
  a/=100;//1/100で元に戻す
  cout<<a<<endl;
}
  


Measured memory_bytes: 3724
#include<bits/stdc++.h>
using namespace std;
int n, m, q, a[210000], b[210000], c, dist[110000], T[110000], cnt, U[110000];
vector<pair<int, int> >x[110000], y[110000]; bool used[210000];
int main() {
	scanf("%d%d%d", &n, &m, &q);
	for (int i = 0; i < m; i++) { scanf("%d%d", &a[i], &b[i]); x[a[i]].push_back(make_pair(b[i], i)); x[b[i]].push_back(make_pair(a[i], i)); }
	fill(dist, dist + n + 1, 999999); dist[1] = 0; queue<int> Q; Q.push(1);
	while (!Q.empty()) { int a1 = Q.front(); Q.pop(); for (pair<int, int> i : x[a1]) { if (dist[i.first] > dist[a1] + 1) { dist[i.first] = dist[a1] + 1; Q.push(i.first); } } }
	for (int i = 1; i <= n; i++) { for (pair<int, int> j : x[i]) { if (dist[i] < dist[j.first]) { y[i].push_back(j); T[j.first]++; } } }
	for (int i = 0; i < q; i++) {
		scanf("%d", &c); c--; queue<pair<int, int> > Q1; int ss = -1;
		if (dist[a[c]] < dist[b[c]])ss = b[c];
		if (dist[a[c]] > dist[b[c]])ss = a[c];
		if (ss >= 1 && U[ss] == 0 && used[c] == false) {
			Q1.push(make_pair(ss, c));
			while (!Q1.empty()) {
				int a1 = Q1.front().first, a2 = Q1.front().second; Q1.pop();
				if (U[a1] == 1 || used[a2] == true) continue; T[a1]--; used[a2] = true; if (T[a1] != 0) continue; cnt++; U[a1] = 1;
				for (pair<int, int> j : y[a1]) { if (U[j.first] == 0) Q1.push(j); }
			}
		}
		printf("%d\n", cnt);
	}
	return 0;
}

Measured memory_bytes: 20084
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define MOD 1000000007
const int INF = 1LL<<30;

int main(){
   ll a,b,c;
   cin>>a>>b>>c;
   ll l=4*a*b;
   ll r=(c-a-b)*(c-a-b);

   if(c-a-b<0) cout<<"No"<<endl;
   else if(l<r) cout<<"Yes"<<endl;
   else cout<<"No"<<endl;
}

Measured memory_bytes: 3576
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int x1 = sc.nextInt();
    int y1 = sc.nextInt();
    int x2 = sc.nextInt();
    int y2 = sc.nextInt();
    
    int x3 = x2-(y2-y1);
    int y3 = y2+(x2-x1);
    int x4 = x3-(x2-x1);
    int y4 = y3-(y2-y1);
    
    
   	   	System.out.println(x3 +" "+ y3 +" "+ x4 +" "+ y4);
   }
}

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

int main(){
    int X, Y, Z, K; cin >> X >> Y >> Z >> K;
    vector<ll> A(X), B(Y), C(Z);
    for(int i = 0; i < X; i++) cin >> A[i];
    for(int i = 0; i < Y; i++) cin >> B[i];
    for(int i = 0; i < Z; i++) cin >> C[i];

    sort(A.rbegin(), A.rend());
    sort(B.rbegin(), B.rend());
    sort(C.rbegin(), C.rend());
    
    priority_queue<tuple<ll, int, int, int>> pq;
    set<tuple<int, int, int>> st;
    st.insert(make_tuple(0, 0, 0));
    pq.push(make_tuple(A[0] + B[0] + C[0], 0, 0, 0));

    for(int i = 0; i < K; i++){
        ll data = get<0>(pq.top());
        int a = get<1>(pq.top());
        int b = get<2>(pq.top());
        int c = get<3>(pq.top());

        cout << data << endl;
        pq.pop();

        if(a + 1 < A.size() && !(st.count(make_tuple(a + 1, b, c)))){
            pq.push(make_tuple(A[a + 1] + B[b] + C[c], a + 1, b, c));
            st.insert(make_tuple(a + 1, b, c));
        }
        if(b + 1 < B.size() && !(st.count(make_tuple(a, b + 1, c)))){
            pq.push(make_tuple(A[a] + B[b + 1] + C[c], a, b + 1, c));
            st.insert(make_tuple(a, b + 1, c));
        }
        if(c + 1 < C.size() && !(st.count(make_tuple(a, b, c + 1)))){
            pq.push(make_tuple(A[a] + B[b] + C[c + 1], a, b, c + 1));
            st.insert(make_tuple(a, b, c + 1));
        }
    }
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
#define int long long
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define DEBUG(x) cerr << #x << " = " << x << endl
using namespace std;
const int INF = (int)1e9;
struct RMQ {
	vector<pair<int, int>> data;
	int N;
	RMQ(int size) {
		N = 1;
		while(N < size) N *= 2;
		data.assign(2*N - 1, make_pair(INF, -1));
	}
	void update(int k, int a) {
		k += N - 1;
		data[k] = make_pair(a, k - N + 1);
		while(k > 0) {
			k = (k - 1)/2;
			data[k] = min(data[2*k + 1], data[2*k + 2]);
		}
	}
	pair<int, int> minimum(int a, int b) const {
		return minimum_sub(a, b, 0, 0, N);
	}
	pair<int, int> minimum_sub(int a, int b, int k, int l, int r) const {
		if(r <= a || b <= l) return make_pair(INF, -1);
		if(a <= l && r <= b) return data[k];

		return min(minimum_sub(a, b, 2*k + 1, l, (l + r)/2),
				minimum_sub(a, b, 2*k + 2, (l + r)/2, r));
	}
};
int solve(int l, int r, const RMQ &rmq) {
  if(r < l) return 0;
  auto rmqret = rmq.minimum(l, r + 1);
  int retval = (rmqret.second - l + 1) * (r - rmqret.second + 1) * rmqret.first;
  // cerr << "[" << l << "," << r << "] retval = " << retval << " rmqret = " << rmqret.first << "," << rmqret.second << endl;
  retval += solve(l, rmqret.second - 1, rmq);
  retval += solve(rmqret.second + 1, r, rmq);
  return retval;
}
signed main() {
	ios::sync_with_stdio(false);
  int N; cin >> N;
  RMQ rmq(N);
  REP(i,N) {
    int a; cin >> a;
    rmq.update(i, a);
  }
  cout << solve(0, N - 1, rmq) << endl;
}


Measured memory_bytes: 58624
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<map>
#include<set>

using namespace std;

typedef long long ll;
typedef vector<int> VI;

#define FOR(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR1(i,n) for(int (i)=1;(i)<(n);(i)++)
#define eFOR(i,n) for(int (i)=0;(i)<=(n);(i)++)
#define eFOR1(i,n) for(int (i)=1;(i)<=(n);(i)++)
#define SORT(i) sort((i).begin(),(i).end())

int main() {

	int a, b, c;
	cin >> a >> b >> c;
	if (a < c && c < b)cout << "Yes" << endl;
	else if (a > c && c > b)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 256
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <bits/stdc++.h>
using namespace std;
void solve(){
    int X,Y;
    cin>>X>>Y;
    if((4*X>=Y) &&(((4*X)-Y)%2==0)&&(Y>=2*X)&& ((Y-(2*X))%2==0)){
        cout<<"Yes"<<'\n';
    }
    else{
        cout<<"No"<<'\n';
    }
}
int main()
{
    
    
    solve();
    return 0;
}


Measured memory_bytes: 3628