akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

public class Main {
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int K = scanner.nextInt();
        ArrayList<Long> luns = new ArrayList<>();
        int count = 0;
        for(int t=1; t<=10; t++){
            for(int i=1; i<=9; i++){
                extend(luns, t, i);        
            }
        }
        System.out.println(luns.get(K-1));

    }
    public static void extend(ArrayList<Long> lis, int len, long val){
        if(len == 1){
            lis.add(val);
            return;
        }
        for(int i=0; i<=9; i++){
            if(Math.abs(val%10 - i) <= 1){
                extend(lis, len-1, val*10+i);
            }
        }
    }
}

Measured memory_bytes: 31956
import java.util.*;

public class Main {
    public static void main(final String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] order = new int[5];
        for (int i = 0; i < 5; i++) {
            order[i] = sc.nextInt();
        }
        
        int[] time = new int[5];
        for(int i = 0; i < 5; i++) {
            time[i] = (order[i] / 10) * 10 + (order[i] % 10 != 0 ? 10 : 0);
        }
        int max = 0;
        int ans = 0;
        for(int i = 0; i < 5; i++) {
            max = Math.abs(time[i] - order[i]) > max ? Math.abs(time[i] - order[i]) : max;
            ans += time[i];
        }
        System.out.println(ans - max);
    }
}

Measured memory_bytes: 35700
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int g = 0;
        while (n != 0 || m != 0) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = scanner.nextInt();
            }
            for (int s = 0; s < n; s++) {
                for (int f = s+1; f < n; f++) {
                    if ((a[s] + a[f]) <= m && (a[s] + a[f]) >= g) {
                        g = a[s] + a[f];
                    }
                }
            }
            if (g == 0) {
                System.out.println("NONE");
            } else {
                System.out.println(g);
            }
            n = scanner.nextInt();
            m = scanner.nextInt();
            g =0;
        }
    }
}



Measured memory_bytes: 48292
#include <algorithm>
// #include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <bitset>
using namespace std;
typedef long long LL;
typedef double db;
const int oo=2139063143;
const int N=1010000;
const int P=1000000007;
const db eps=1e-7;
#define pritnf printf
//char buf[1<<22],*p1=buf,*p2=buf,obuf[1<<22],*O=obuf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
template <typename T>
inline void sc (T &x)
{
    x=0; static int p; p=1; static char c; c=getchar();
    while (!isdigit(c)) { if (c=='-') p=-1; c=getchar(); }
    while ( isdigit(c)) { x=(x<<1)+(x<<3)+(c-48); c=getchar(); }
    x*=p;
}
template <typename T>
inline void print (T x)
{
    if (x< 0) putchar('-'),x=-x;
    if (x>=10) print(x/10);
    putchar(x%10+'0');
}
template <typename T>
inline void pr (T x) { print(x),putchar('\n'); }
template <typename T1,typename T2>
void chkmax (T1 &A,T2 B) { A=A>=B?A:B; }
template <typename T1,typename T2>
void chkmin (T1 &A,T2 B) { A=A<=B?A:B; }
#define yes return puts("Yes"),0
#define no return puts("No"),0
int n,m;
#define pb push_back
vector <int> G[N];
bool fg=0;
bool dfs (int u,int fa,int rt,int aim)
{
	if (u==aim) return 1;
	for (int v:G[u]) if (v!=fa&&v!=rt)
		if (dfs (v,u,rt,aim)) return 1;
	return 0;
}
int deg[N];
int main ()
{
    // freopen (".in","r",stdin);
    // freopen (".out","w",stdout);
	sc(n),sc(m);
	for (int i=1; i<=m; i++)
	{
		int x,y; sc(x),sc(y);
		G[x].pb (y),G[y].pb (x);
		++deg[x],++deg[y];
	}
	for (int i=1; i<=n; i++)
		if (deg[i]&1) no;
	int d4=0;
	for (int i=1; i<=n; i++)
		if (deg[i]>=6) yes;
		else d4+=deg[i]==4;
	if (d4>=3) yes;
	if (d4<=1) no;
	int X=0,Y=0;
	for (int i=1; i<=n; i++) if (deg[i]==4)
		(X?Y:X)=i;
	for (int v:G[X])
		if (!dfs (v,X,X,Y)) yes;
	no;

    return 0;
}


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

int main() {
  int64_t q,h,s,d,n;
  cin>>q>>h>>s>>d>>n;
  int a=4*q,b=2*q+h,c=2*h,z=s;
  int64_t mini=min(a,min(b,min(c,z)));
    if(d/2>=mini){
      cout<<mini*n;
    }
    else{
      if(n%2==1&&n>2){
        cout<<d*((n-1)/2)+mini;
      }
      if(n==1){
        cout<<mini;
      }
      if(n%2==0){
        cout<<d*n/2;
      }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>

int main(){
    ll N, D, X;
    cin >> N >> D >> X;
    VL a(N+1);
    rep(i,1,N+1) cin>>a[i];
    
    ll ans=X;
    rep(i,1,N+1){
        ll day=1;
        rep(j,1,D+1){
            if(j==day){
                ans++;
                day+=a[i];
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
# 二項係数を"やるだけ"にしてくれるライブラリ
MAX = 310000
MOD = 10**9+7
factrial = [0]*MAX
inverse = [0]*MAX
factrial_inverse = [0]*MAX


# テーブルを作る前処理
def COMinit():
    global factrial, inverse, factrial_inverse
    factrial[0] = 1
    factrial[1] = 1
    inverse[1] = 1
    factrial_inverse[0] = 1
    factrial_inverse[1] = 1
    for i in range(2, MAX):
        factrial[i] = factrial[i-1] * i % MOD
        inverse[i] = MOD - inverse[MOD % i] * (MOD//i) % MOD
        factrial_inverse[i] = factrial_inverse[i-1] * inverse[i] % MOD


# 二項係数計算
def COM(n, k):
    global factrial, inverse, factrial_inverse
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return factrial[n] * (factrial_inverse[k] * factrial_inverse[n-k] % MOD) % MOD


# 前処理完了
COMinit()
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
count = Counter(A)
count = sorted(count.items(), key=lambda x: x[1], reverse=True)
# 唯一2回出ている値を取得する
dual = count[0][0]
t = 0
for i in range(len(A)):
    if A[i] == dual:
        if t == 0:
            l = i
        else:
            r = i
        t += 1
for k in range(1, N+2):
    print((COM(N+1, k) - COM(l+N-r, k-1) + MOD) % MOD)
# print(l, r)
# print(A[l], A[r])


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

#define REP(i,n) for(ll i=0;i<n;++i)
#define RREP(i,n) for(ll i=n-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<n;++i)
#define RFOR(i,m,n) for(ll i=n-1;i>=m;--i)
#define ALL(v) (v).begin(),(v).end()
#define PB(a) push_back(a)
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(aa, (v).size()) { cout << v[a]; if (a != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }
///(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)///
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vi v(n);
	REP(i, n)cin >> v[i];
	int m = *max_element(ALL(v)), l = *min_element(ALL(v));
	if ( m-l> 1)cout << "No" << endl;
	else {
		if (m == l) {
			if (m == n - 1)cout << "Yes" << endl;
			else {
				if (2 * m <= n)cout << "Yes" << endl;
				else cout << "No" << endl;
			}
		}
		else {
			int cnt = 0;
			REP(i, n)if (v[i] == l)cnt++;
			if (m > cnt && (m - cnt) * 2 + cnt <= n)cout << "Yes" << endl;
			else cout << "No" << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;
public class Main {
	 public static void main(String[] args) {
	  Scanner sc = new Scanner(System.in);
	  int i, a, b, c, d;
	  int n = sc.nextInt();
	  int [] x = new int[n+1];
	  int [] y = new int[n+1];
	  for(i = 0; i < n*(n-1)/2; i++){
	   a = sc.nextInt();
	   b = sc.nextInt();
	   c = sc.nextInt();
	   d = sc.nextInt();
	   if(c>d) x[a] += 3;
	   else if(c<d) x[b] += 3;
	   else{
	    x[a] += 1;
	    x[b] += 1;
	   }
	  }
	  for(int j = 1; j <= n; j++){
	   for(int h = 1; h <= n; h++){
	    if(x[j] < x[h]) y[j] += 1;
	   }
	  }
	  for(int k = 1; k < n+1; k++)
	   System.out.println(y[k] + 1);
	 }
	}

Measured memory_bytes: 42056
// 面倒
#include<iostream>
#include<vector>
using namespace std;

int rot[6][4] = {
    {1, 2, 4, 3},
    {2, 0, 3, 5},
    {0, 1, 5, 4},
    {0, 4, 5, 1},
    {0, 2, 5, 3},
    {2, 1, 3, 4}
};

int main(){
    int n;
    while(cin >> n, n){
        string die[n][6];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < 6; j++){
                cin >> die[i][j];
            }
        }
        vector<bool> ng(n, 0);
        for(int i = 0; i < n; i++){
            for(int j = i+1; j < n; j++){
                int k;
                for(k = 0; k < 6; k++)  if(die[i][0] == die[j][k])  break;
                for(int kaiten = 0; kaiten < 4; kaiten++){
                    bool cw = true;
                    for(int l = 0; l < 4; l++){
                        cw &= die[i][rot[0][l]] == die[j][rot[k][(kaiten+l)%4]];
                    }
                    if(cw){
                        ng[j] = true;
                    }
                }
            }
        }
        int ans = 0;
        for(int i = 0; i < n; i++)  ans += ng[i];
        cout << ans << endl;
    }
    return 0;
}


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


int main(void) {
   int N,K;
   cin>>N>>K;
   double prob = 0.;
   for (int i = 1; i <= N; i++) {
      int step = ceil(log2((double)K/i));
      // cout<<i<<" "<<step<<endl;
      prob += 1./pow(2,step>0?step:0)/N;
   }
   printf("%.10lf\n",prob);
   return 0;
}

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

using namespace std;
using ll = long long;

ll solve(ll N, const vector<ll>& xs)
{
    auto x = *min_element(xs.begin(), xs.end());

    return 4 + (N + x - 1)/x;
}

int main()
{
    ios::sync_with_stdio(false);

    ll N;
    cin >> N;

    vector<ll> xs(5);

    for (int i = 0; i < 5; ++i)
        cin >> xs[i];

    auto ans = solve(N, xs);

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;;
#define ll long long
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int main(){
    ll x, y; cin >> x >> y;
    if(abs(x-y)<=1) cout<<"Brown" << endl;
    else cout << "Alice"<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    int a[n],sum=0;
    for(int i=0;i<n;i++) {
        cin >> a[i];
    }
    sort(a,a+n);
    for(int i=0;i<n-1;i++) {
        sum+=a[i];
    }
    if(sum>a[n-1]) {cout << "Yes" << endl;}
    else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
template<typename T>
vector<T> slide_min(const vector<T>& v, int k) {
  deque<int> deq;
  vector<T> ret;
  for(int i=0; i<v.size(); i++) {
    while(!deq.empty() && v[deq.back()] >= v[i]) deq.pop_back();
    deq.push_back(i);
    if(i-k+1 >= 0) {
      ret.push_back(v[deq.front()]);
      if(deq.front() == i-k+1) deq.pop_front();
    }
  }
  return ret;
}
template<typename T>
vector<T> slide_max(const vector<T>& v, int k) {
  deque<int> deq;
  vector<T> ret;
  for(int i=0; i<v.size(); i++) {
    while(!deq.empty() && v[deq.back()] <= v[i]) deq.pop_back();
    deq.push_back(i);
    if(i-k+1 >= 0) {
      ret.push_back(v[deq.front()]);
      if(deq.front() == i-k+1) deq.pop_front();
    }
  }
  return ret;
}
int main() {
  int N, K;
  cin >> N >> K;
  vector<int> P(N);
  rep(i, N) cin >> P[i];
  vector<int> ord(N-1);
  rep(i, K-1) if(P[i+1]-P[i]>0) ord[0]++;
  REP(i, 1, N-K+1) {
    ord[i] = ord[i-1];
    if(P[i]-P[i-1]>0) ord[i]--;
    if(P[i+K-1]-P[i+K-2]>0) ord[i]++;
  }
  int cntOrd = 0;
  rep(i, N-K+1) if(ord[i] == K-1) cntOrd++;
  int cnt = 0;
  vector<int> mn = slide_min(P, K+1);
  vector<int> mx = slide_max(P, K+1);
  rep(i, N-K) if(ord[i+1] != K-1 && P[i] == mn[i] && P[i+K] == mx[i]) cnt++;
  cout << N-K+1-max(cntOrd-1, 0)-cnt << endl;
  return 0;
}


Measured memory_bytes: 4088
package main

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

const YES = "Yes"
const NO = "No"

func solve(N int64) {
	s := strconv.FormatInt(N, 10)
	for i := 0; i < len(s); i++ {
		if s[i] == '7' {
			fmt.Println(YES)
			return
		}
	}
	fmt.Println(NO)
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	const initialBufSize = 4096
	const maxBufSize = 1000000
	scanner.Buffer(make([]byte, initialBufSize), maxBufSize)
	scanner.Split(bufio.ScanWords)
	var N int64
	scanner.Scan()
	N, _ = strconv.ParseInt(scanner.Text(), 10, 64)
	solve(N)
}


Measured memory_bytes: 1756
#include<bits/stdc++.h>
 
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
 
using namespace std;
 
int N;
char a[110][110];
int win[110];
 
int main(){
  srand((unsigned int)time(NULL));
  cin >> N;
  rep(i,N) {
    string s;
    cin >> s;
    rep(j,N) { 
      a[i][j] = s[j];
      if( j < i && a[i][j] == 'o' ) ++win[i];
    }
  }
  int maxi_p = 0;
  rep(i,N) if( win[maxi_p] < win[i] ) maxi_p = i;
  bool definitely = false;
  if( win[maxi_p] == N-1 ) definitely = true;
 
  int judge_ai_hand = 1;
  int use = 0;
  rep(_,1000){
    if( definitely ) {
      printf("%d\n",maxi_p+1); fflush(stdout);
    } else {
      if( rand() % 1000 >= 10 ) {
        printf("%d\n",rand()%N+1); fflush(stdout);
      } else {
        printf("%d\n",maxi_p+1); fflush(stdout);
 
      }
    }
    scanf("%d", &judge_ai_hand);
  }
  return 0;
}

Measured memory_bytes: 1328
#include <bits/stdc++.h>
//#define TASK "file"

#define F first
#define S second
#define ALL(x) (x).begin(), (x).end()

using namespace std;
typedef long long i64;
typedef long double dbl;
const dbl PI = acos(-1.0L);
const dbl EPS = 1e-12L;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

namespace task {
i64 n, a, b;

int main() {
  cin >> n >> a >> b;
  cout << n / (a + b) * a + min(n % (a + b), a) << '\n';
  return 0;
}
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(11);
  cout.setf(ios::fixed);
#ifdef _DEBUG
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#elif defined(TASK)
  freopen(TASK".in", "r", stdin);
  freopen(TASK".out", "w", stdout);
#endif
  return task::main();
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define rando mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define fi first
#define se second
#define debug(x) cerr << " - " << #x << ": " << x << endl;
#define debugs(x, y) cerr << " - " << #x << ": " << x << " " << #y << ": " << y << endl;
#define debugii(x) cerr << " - " << #x << ": " << x.fi<<","<<x.se << endl;
#define sep() cerr << "--------------------" << endl;
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)x.size()
#define ld long double
#define ll long long
//#define int ll
#define ii pair<int,int>
#define v vector<int>
#define vii vector<ii>
#define vv vector<vector<int> >
#define mp make_pair
#define INF 1000000000
#define pb push_back
#define EPS 1e-9
const int MOD = 1000000007; // 998244353
int32_t main(){
	boost;
	double a,h,V;
	cout<<fixed<<setprecision(10);
	cin>>a>>h>>V;
	double x=2.0*h-((2.0*V)/(a*a));
	if(((2.0*V)/(a*a))<h){x=(2.0*V)/(a*h);cout<<(atan(h/x)*180.0)/acos(-1);}
	else {cout<<(atan(x/a)*180.0)/acos(-1);}
	
	return 0;
}
//long long
//array bounds
//special cases
//binary search

Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;
int p[210000];
int q[210000];
int z1[210000];
int z2[210000];
vector<pair<int,int> >pv[210000];
vector<pair<int,int> >qv[210000];
vector<int>g[210000];
long long ijk[210000][2];
int v[210000][2];
long long mod=1000000007;
long long inf=mod*mod;
int ABS(int a){return max(a,-a);}
int main(){
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	for(int i=0;i<c;i++){
		scanf("%d%d",p+i,q+i);
		p[i]--;q[i]--;
		z1[i]=p[i];
		z2[i]=q[i];
	}
	std::sort(z1,z1+c);
	std::sort(z2,z2+c);
	for(int i=0;i<c;i++){
		int tmp=lower_bound(z1,z1+c,p[i])-z1;
		pv[tmp].push_back(make_pair(q[i],i));
		tmp=lower_bound(z2,z2+c,q[i])-z2;
		qv[tmp].push_back(make_pair(p[i],i));
	}
	for(int i=0;i<c;i++){
		std::sort(pv[i].begin(),pv[i].end());
		for(int j=1;j<pv[i].size();j++){
			g[pv[i][j-1].second].push_back(pv[i][j].second);
			g[pv[i][j].second].push_back(pv[i][j-1].second);
		}
		std::sort(qv[i].begin(),qv[i].end());
		for(int j=1;j<qv[i].size();j++){
			g[qv[i][j-1].second].push_back(qv[i][j].second);
			g[qv[i][j].second].push_back(qv[i][j-1].second);
		}
	}
	priority_queue<pair<long long,pair<int,int> > >Q;
	for(int i=0;i<c;i++)for(int j=0;j<2;j++)
		ijk[i][j]=inf;
	for(int i=0;i<c;i++)if(p[i]==0){
		ijk[i][0]=q[i];
		Q.push(make_pair(-q[i],make_pair(i,0)));
	}
	while(Q.size()){
		long long cost=-Q.top().first;
		int at=Q.top().second.first;
		int type=Q.top().second.second;
		Q.pop();
		if(v[at][type])continue;
		v[at][type]=1;
		if(!v[at][!type]&&ijk[at][!type]>cost+1){
			ijk[at][!type]=cost+1;
			Q.push(make_pair(-cost-1,make_pair(at,!type)));
		}
		for(int i=0;i<g[at].size();i++){
			int to=g[at][i];
			int tp=p[to];
			int tq=q[to];
			if(type==0&&tp!=p[at])continue;
			if(type==1&&tq!=q[at])continue;
			long long toc=cost+ABS(tp-p[at])+ABS(tq-q[at]);
			if(!v[to][type]&&ijk[to][type]>toc){
				ijk[to][type]=toc;
				Q.push(make_pair(-toc,make_pair(to,type)));
			}
		}
	}
	long long ret=inf;
	for(int i=0;i<c;i++){
		if(p[i]==a-1)ret=min(ret,ijk[i][0]+b-1-q[i]);
		if(q[i]==b-1)ret=min(ret,ijk[i][1]+a-1-p[i]);
	}
	if(ret==inf)ret=-1;
	printf("%lld\n",ret);
}

Measured memory_bytes: 37364
import java.util.HashMap;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		HashMap<String, Integer> M = new HashMap<>();

		int q = sc.nextInt();

		for (int i = 0; i < q; i++) {
			int p = sc.nextInt();
			if (p == 0) {
				String key = sc.next();
				int x = sc.nextInt();
				M.put(key, x);
			} else if (p == 1) {
				String key = sc.next();
				if (M.get(key) == null) {
					System.out.println("0");
				} else {
					System.out.println(M.get(key));
				}
			} else if (p == 2) {
				String key = sc.next();
				M.remove(key);
			}
		}

		sc.close();

	}

}



Measured memory_bytes: 195040
#include<stdio.h>

int main(){

int n;
int i;
int x=100000;

scanf("%d",&n);

while(n--!=0){
x*=1.05;
if(x%1000!=0){
x=(x/1000+1)*1000;
	}
	}


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

return 0;
	}

Measured memory_bytes: 592
import java.util.*;
import java.io.*;

public class Main {
	static PrintWriter out;
	static StringBuilder sb;
	static int mod = 998244353;
	static long inf = (long) 1e18 + 1;
	static int[] col;
	static int n, m;
	static ArrayList<Integer>[] ad;
	static long[][][] memo;
	static HashSet<Integer> h;
	static int[] a;
	static Integer[][] g;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int a=sc.nextInt();
		int b=sc.nextInt();
		int c=sc.nextInt();
		int d=sc.nextInt();
		int t=c/b;
		int o=a/d;
		if(c%b!=0)
			t++;
		if(a%d!=0)
			o++;
	//	System.out.println(t+" "+o);
		if(t<=o)
			System.out.println("Yes");
		else
			System.out.println("No");
		out.flush();
	}

	static long modPow(long a, long e)

	{
		long res = 1;
		while (e > 0) {
			if ((e & 1) == 1)
				res = (res * a) % mod;
			a = (a * a) % mod;
			e >>= 1;
		}
		return res;
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public int[] nextArrInt(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextArrLong(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}

Measured memory_bytes: 32752
def main():
    n = int(input())
    A = list(map(int, input().split()))
    ans = 1000
    t, p = [], []
    if A[0] < A[1]:
        t.append(0)
    for i in range(1, n - 1):
        if A[i - 1] >= A[i] < A[i + 1]:
            t.append(i)
        elif A[i - 1] <= A[i] > A[i + 1]:
            p.append(i)
    b = 0
    for i in range(n):
        if i in t:
            b += ans // A[i]
            ans %= A[i]
        if i in p:
            ans += b * A[i]
            b = 0
    if b > 0:
        ans += b * A[-1]
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9232
#include <iostream>
#include <stack>
#include <algorithm>

int main()
{
    std::stack<int>  stOp;

    std::string input;
    std::string parts;

    std::getline(std::cin, input);
    int pos;
    int a;
    int b;
    while (1)
    {
        pos = input.find_first_of(" ");
        if (pos != std::string::npos)
        {
            parts = input.substr(0, pos);
            input = input.substr(pos+1);
        }
        else
        {
            parts = input;
        }
        
        if (parts == "+" || parts == "-" || parts == "*")
        {
            b = stOp.top();
            stOp.pop();
            a = stOp.top();
            stOp.pop();

            if      (parts == "+") stOp.push(a+b);
            else if (parts == "-") stOp.push(a-b);
            else if (parts == "*") stOp.push(a*b);
        }
        else if (std::all_of(parts.begin(), parts.end(), isdigit))
        {
            stOp.push(std::stoi(parts));
        }

        if (pos == std::string::npos) break;
    }

    std::cout << stOp.top() << std::endl;
}


Measured memory_bytes: 3184
#include<stdio.h>
int main(){


int num;
scanf("%d",&num);
int one,two,three,four;
four=num%10;
num/=10;
three=num%10;
num/=10;
two=num%10;
num/=10;
one=num;
  
if(one==two || two==three || three==four){
printf("Bad");}
else{
printf("Good");}



return 0;

}

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

using namespace std;

// エラトステネスの篩 : [0, n] の素数表を返す
// 計算時間 O(n log log n), 領域 O(n)
vector<bool> SieveOfEratosthenes(const int n) {
    vector<bool> is_prime(n + 1, true);
    is_prime[0] = is_prime[1] = false;

    for (int i = 2; i * i <= n; ++i)
        if (is_prime[i])
            for (int j = i * i; j <= n; j += i)
                is_prime[j] = false;

    return is_prime;
}

// i \in [0, n] 以下の素数の数を求める
// 計算時間 O(n log log n), 領域 O(n)
vector<int> CountPrime(const int n) {
    vector<bool> is_prime = SieveOfEratosthenes(n);
    vector<int> count(n + 1);

    for (int i = 2; i <= n; ++i)
        count[i] += count[i - 1] + is_prime[i];

    return count;
}


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

    auto cnt_prime = CountPrime(999999);
    int n;
    while (cin >> n)
        cout << cnt_prime[n] << '\n';

    return 0;
}




Measured memory_bytes: 6796
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define ye cout<<"YES";
#define no cout<<"NO";
#define ln cout<<"\n";
 // cout<<"Case #"<<ts<<": ";
#include <bits/stdc++.h>
using namespace std;

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

	 ll t=1,r,n,a,d,c,b,x,y,sum,cnt,i,j,k,m,l,q,maxx,minn,temp,ans,flag,g,ts;
	 ll mod=1000000007;
	 char ch,chh;
	 double dans;
	 string str,ttr;
	 
	 //cin >> t;

	
	for(ts=1;ts<=t;ts++)
	{
	     flag=0;sum=0;cnt=0;ans=0;k=0;maxx=0;minn=0;a=0;b=0;temp=0;
	    
	     cin >> n;
	    ll arr[n];for(i=0;i<n;i++){cin>>arr[i];}
	    
	    temp=1e18;
	    
	    sort(arr,arr+n);
	    
	    
	    if(arr[0]==0)
	    {
	        cout<<0;
	    }
	    else
	   {
	       k=arr[0];
	       
	       for(i=1;i<n;i++)
	       {
	           x=(temp/k);
	           if(arr[i]>x)
	           {
	               cout<<-1;
	               flag=1;
	               break;
	           }
	           else
	           k=(k*arr[i]);
	       }
	       if(flag==0)
	       cout<<k;
	   }
	    
	     ln
	 }
	return 0;
}


Measured memory_bytes: 4444
#include <bits/stdc++.h>
#define rep(i,n) for(long long int i = 0; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
const int N = 1000000;
const int mod = 1000000007;

int main() {
   string s; cin >> s;

   int n = s.size();
   int count = 0;
   bool flag = true;

    for (char i = 'a'; i <= 'z'; ++i) {
        for (int j = 0; j < n; ++j) {
            if(s[j] == i)count++;
        }
        if(count % 2 != 0){
            flag = false;
            break;
        }
        count = 0;
    }
   if(flag)print("Yes");
   else print("No");
}

Measured memory_bytes: 256
class Heap
  attr_accessor :nodes
  attr_reader :relational_operator

  def initialize(defalut = [], direction)
    @nodes = defalut
    @relational_operator = direction == :max ? :< : :>
  end

  def pop
    popped = nodes.shift
    return popped if nodes.empty?

    nodes.unshift(nodes.pop)

    tmp_index = 0
    while (tmp_index * 2 + 1) < nodes.size
      left_child_index = tmp_index * 2 + 1
      right_child_index = tmp_index * 2 + 2

      if right_child_index >= nodes.size
        if need_swap?(nodes[tmp_index], nodes[left_child_index])
          swap(tmp_index, left_child_index)
          tmp_index = left_child_index
        else
          break
        end
      else
        max_direction_child_index =
            if need_swap?(nodes[right_child_index], nodes[left_child_index])
              left_child_index
            else
              right_child_index
            end

        if need_swap?(nodes[tmp_index], nodes[max_direction_child_index])
          swap(tmp_index, max_direction_child_index)
          tmp_index = max_direction_child_index
        else
          break
        end
      end
    end

    popped
  end

  def push(node)
    tmp_index = nodes.size
    while tmp_index > 0 do
      parent_index = (tmp_index - 1) / 2

      if nodes[parent_index] && need_swap?(nodes[parent_index], node)
        swap(parent_index, tmp_index)
        tmp_index = parent_index
      else
        break
      end
    end

    @nodes[tmp_index] = node
  end

  private

  def need_swap?(node, other_node)
    node.send(relational_operator, other_node)
  end

  def swap(index, other_index)
    nodes[index], nodes[other_index] = nodes[other_index], nodes[index]
  end
end

class PriorityQueue
  attr_reader :heap

  def initialize(direction, default = nil)
    case direction
    when :max, :min
      @heap = Heap.new(default, direction)
    else
      ArgumentError
    end
  end

  def nodes
    heap.nodes
  end

  def dequeue
    heap.pop
  end

  def enqueue(e)
    heap.push(e)
  end
end

N, M = gets.split.map(&:to_i)
array = gets.split.map(&:to_i).sort!.reverse!
priority_queue = PriorityQueue.new(:max, array)

M.times do
  max = priority_queue.dequeue
  priority_queue.enqueue(max / 2)
end

puts priority_queue.nodes.inject(:+)

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

int main() {
    int num_pnt; scanf("%d", &num_pnt);
    vector<pair<int, int>> p;
    int cx, cy;
    
    for (int loop = 0; loop < num_pnt; ++loop) {
        scanf("%d%d", &cx, &cy);
        p.push_back(make_pair(cx, cy));
    }
    sort(p.begin(), p.end());
    
    for (auto c : p) printf("%d %d\n", c.first, c.second);
    
    return 0;
}


Measured memory_bytes: 3864
import java.util.*;

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();

        Integer[] aryX = new Integer[N];
        Integer[] aryY = new Integer[M];

        for(int i=0 ; i < N ; i++){
            aryX[i] = sc.nextInt();
            //System.out.println("aryx="+ aryX[i]);
        }

        for(int j=0 ; j < M ; j++){
            aryY[j] = sc.nextInt();
           // System.out.println("aryy="+ aryY[j]);
        }

        int xmax = aryX[0];
        int ymin = aryY[0];


        for(int k=0 ; k < N ; k++){
            if(aryX[k] > xmax){
                xmax = aryX[k];
               // System.out.println("xmax="+xmax);
            }
        }

        for(int m=0 ; m < M ; m++){
            if(aryY[m] < ymin){
                ymin = aryY[m];
               // System.out.println("ymin="+ymin);
            }
        }

        if(xmax >= ymin){
            System.out.println("War");
        }else if(X <= xmax && Y <= xmax){
            System.out.println("War");
        }else if(ymin <= X){
            System.out.println("War");
        }else{
            System.out.println("No War");
        }
    }
}

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

#define froop1(a,n) for(int i = a;i < n;i++)
#define froop2(a,n) for(int i = a;i > n;i--)

#define ll long long

#define pq(name,type) priority_queue<type> name
#define vec(name,type,length,value) vector<type> name(length,value)
#define vec2(name,type,length,width,value) vector<vector<type>> name(length,vector<type>(width,value));


int main(){
	int N;
  cin >> N;
  map<int,int> c;
   int n = sqrt(N);
    int count = 0;
    for(int j = 1;j < n;j++){
      for(int k = 1;k < n;k++){
        if(j*j + k*k + j*k > N)break;
        for(int l = 1;l < n;l++){
          int cc = j*j + k*k + l*l + j*k + k*l + l*j;
          if(c.count(cc)) c[cc]++;
          else c[cc] = 1;
        }
      }
    }
  froop1(1,N + 1){
    cout << c[i] << endl;
  }
}

Measured memory_bytes: 4696
import java.lang.Math

val ord = mutableListOf<Pair<Int, Int>>()
val tree = mutableMapOf<Int, MutableMap<Int, Int>>()

fun main(args: Array<String>)
{
    val n = readLine()!!.toInt()

    for (i in 1 until n) {
        val (a, b) = readLine()!!.split(" ").map{ it.toInt() }
        ord.add(Pair<Int, Int>(a, b))

        if (!tree.containsKey(a)) {
            tree.put(a, mutableMapOf(b to -1))
        } else {
            tree[a]!!.put(b, -1)
        }
        if (!tree.containsKey(b)) {
            tree.put(b, mutableMapOf(a to -1))
        } else {
            tree[b]!!.put(a, -1)
        }
    }

    // println("find max color")

    var colorNum = 0
    for (key in tree.keys) {
        colorNum = Math.max(tree[key]!!.count(), colorNum)
    }

    coloring(ord[0].first, -1, -1)

    println(colorNum)
    for (i in 0 until n-1) {
        println(tree[ord[i].first]!![ord[i].second])
    }
}

fun coloring(current: Int, parent: Int, previousColor: Int){
    // val children = tree[current]!!

    var col = 1
    for (key in tree[current]!!.keys) {
        if (key == parent) continue
        if (col == previousColor) col++

        tree[current]!![key] = col
        tree[key]!![current] = col
        coloring(key, current, col)
        col++
    }

    // val children = tree[parent]
    // var col = 1
    // for (key in children!!.keys) {
    //     if (children[key] == -1) {
    //         // println("coloring from $parent to $key")
    //         if (col == previousColor) col++

    //         children[key] = col
    //         tree[key]!![parent] = col

    //         coloring(key, col)
    //     }

    //     col++
    // }
}


Measured memory_bytes: 130112
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;

const int N=2005;

int n,m,T,ans,e,f,g,h,x1,y1,x2,y2;
int s[N][N],d[N][N],b[N][N],a[N][N],w[N][N];
char c[N][N];

void init(){
	int i,j;
	for (i=1;i<=n;i++)
		for (j=1;j<=m;j++) s[i][j]=s[i-1][j]+s[i][j-1]-s[i-1][j-1]+a[i][j];
	for (i=1;i<=n;i++){
		for (j=1;j<=m;j++){
			d[i][j]=d[i][j-1];
			if (a[i][j]){
				d[i][j]+=a[i-1][j];
				d[i][j]+=a[i][j-1];
			}
			b[i][j]=d[i][j]+b[i-1][j];
		}
	}
	for (i=1;i<=n;i++){
		for (j=1;j<=m;j++){
			d[i][j]=d[i][j-1];
			if (a[i][j]) d[i][j]+=a[i-1][j];
		}
	}
	for (j=1;j<=m;j++){
		for (i=1;i<=n;i++){
			w[j][i]=w[j][i-1];
			if (a[i][j]) w[j][i]+=a[i][j-1];
		}
	}
}

int main(){
	int i,j;
	scanf("%d%d%d",&n,&m,&T);
	for (i=1;i<=n;i++) scanf("%s",c[i]+1);
	for (i=1;i<=n;i++) for (j=1;j<=m;j++) a[i][j]=c[i][j]-'0';
	init();
	while (T--){
		scanf("%d%d%d%d",&e,&f,&g,&h);
		x1=min(e,g); y1=min(f,h);
		x2=max(e,g); y2=max(f,h);
		ans= s[x2][y2]-s[x2][y1-1]-s[x1-1][y2]+s[x1-1][y1-1];
		ans-=b[x2][y2]-b[x2][y1-1]-b[x1-1][y2]+b[x1-1][y1-1];
		ans+=d[x1][y2]-d[x1][y1-1];
		ans+=w[y1][x2]-w[y1][x1-1];
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 84224
#include<iostream>
#include<string.h>
using namespace std;

int num[2000*1500];

int main()
{
	int N,M;
	while(cin>>N>>M && N!=0){
		memset(num,0,sizeof(num));
		int h[1501],w[1501];
		h[0]=w[0]=0;

		for(int i=1;i<=N;i++){
			cin>>h[i];
			h[i]+=h[i-1];
		}

		for(int i=1;i<=M;i++){
			cin>>w[i];
			w[i]+=w[i-1];
		}

		for(int i=0;i<=N;i++){
			for(int j=i+1;j<=N;j++){
				num[h[j]-h[i]]++;
			}
		}

		int ans=0;
		for(int i=0;i<=M;i++){
			for(int j=i+1;j<=M;j++){
				ans+=num[w[j]-w[i]];
			}
		}
		cout<<ans<<endl;

	}
	return 0;
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int MOD = 1000000007;

int main(){
    ll n, k;
    cin >> n >> k;
    ll sum = 0;
    for (ll i = k; i <= n + 1; i++){
        ll presum = i * (i - 1) / 2;
        ll foesum = n * i - presum;
        ll a = foesum - presum + 1;
        sum = (a+sum)%MOD;
    }
    cout << sum << endl;
}

Measured memory_bytes: 3644
s = input().split()

n = int(s[0])
k = int(s[1])

snakes = []

p = input().split()
for i in range(n):
    q = int(p[i])
    snakes.append(q)

snakes.sort()

answer = 0

for i in range(k):
    x = snakes.pop()
    answer += x

print(answer)

Measured memory_bytes: 9188
// B - Two Anagrams
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()

int main(){
	string s,t; cin>>s>>t;
	sort(all(s)); sort(all(t)); reverse(all(t));
	cout<< (s<t? "Yes":"No") <<endl;
}

Measured memory_bytes: 256
N = int(input())
ans_list = []
# p_list = list(range(1,N+1))
if N%2 ==0:
   M = int(N*(N-2)/2)
   for i in range(1,N+1):
       pair = N+1-i
       for j in range(i+1,N+1):
           if j != pair:
               ans_list.append([i,j])
#         add_list = [[i,j] for j in range(i+1,N+1) if j != pair]
#         ans_list.extend(add_list)
else:
   M = int((N-1)*(N-1)/2)
   for i in range(1,N):
       pair = N-i
       for j in range(i+1,N):
           if j != pair:
               ans_list.append([i,j])
       ans_list.append([i,N])

print(M)
for ans in ans_list:
   print(ans[0],ans[1])

Measured memory_bytes: 4124
// D - すぬけ君の塗り絵

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const int MOD = 1e9 + 7;

map<pair<int, int>, int> square;
map<int, ll> counter;

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

	int a, b;
	for (int i=0; i<N; i++) {
		cin >> a >> b;
		for (int j=a-2; j<=a; j++) {
			if (j <= 0 || j+2 > H) continue;
			for (int k=b-2; k<=b; k++) {
				if (k <= 0 || k+2 > W) continue;
				square[make_pair(j, k)]++;
			}
		}
	}

	for (auto itr=square.begin(); itr!=square.end(); itr++) {
		counter[itr->second]++;
	}

	counter[0] = (ll)(H-2) * (W-2) - square.size();

	for (int i=0; i<=9; i++) {
		cout << counter[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 56448
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
li = []
for i in range(Q):
    li.append(list(map(int, input().split())))

li2 = [0for i in range(10 ** 5 + 1)]

for i in range(len(A)):
    li2[A[i]] += 1

sum1 = sum(A)

for i in range(len(li)):
    sum1 += li2[li[i][0]] * (li[i][1] - li[i][0])
    li2[li[i][1]] += li2[li[i][0]]
    li2[li[i][0]] = 0
    print(sum1)



Measured memory_bytes: 97740
// {{{ Headers
// vim:filetype=cpp:foldmethod=marker:foldmarker={{{,}}}

#include <cassert>
#include <cctype>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <deque>
#include <functional>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#include <fstream>
#include <iostream>
#include <sstream>

using namespace std;
// }}}

typedef long long int64;
const int INF = 0x3f3f3f3f;
template <class T> inline int len (const T &a) { return a.size (); }
#define ALL(x) (x).begin(), (x).end()

const int MX = 1005;
const int MOD = 1000 * 1000 * 1000 + 7;
const int dx [2] = { -1, 0 };
const int dy [2] = { 0, -1 };

vector <string> grid;
char buf [MX];
int dp [MX][MX];

int
main () {
    int R, C;
    scanf ("%d %d", &R, &C);
    for (int i = 0; i < R; i++) {
        scanf ("%s", buf);
        grid.push_back (string (buf));
    }
    dp [0][0] = 1;
    for (int i = 0; i < R; i++)
        for (int j = 0; j < C; j++)
            for (int h = 0; h < 2; h++) {
                int X = i + dx [h];
                int Y = j + dy [h];
                if (X < 0 || X >= R || Y < 0 || Y >= C) continue;
                if (grid [X][Y] == '#') continue;
                dp [i][j] = (dp [i][j] + dp [X][Y]) % MOD;
            }
    printf ("%d\n", dp [R - 1][C - 1]);

#ifdef LOCALHOST
	cerr << "time: " << (int64) clock () * 1000 / CLOCKS_PER_SEC << " ms" << endl;
#endif
    return 0;
}



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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int di2[] = {1, 1, -1, -1, 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -2, -1};
const int dj2[] = {1, -1, 1, -1, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -2, -1, 0, 1, 2, 2};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;


int main(){
  ll x, t; cin >> x >> t;
  cout << max(0ll, x-t) << endl;
}

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

int main(){
    double a, b, x, ta; cin >> a >> b >> x;
    if(x <= a * a * b / 2){
        ta = a * b * b / (2 * x);
    }else{
        x = a * a * b - x;
        ta = 2 * x / (a * a * a);
    }
    double ans = atan(ta) * 180.00000000 / 3.141592;
    cout << setprecision(9)<< ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdio>
#include <bitset>
#define ll long long
#define INF 1000000000000000001
#define MOD 1000000007
using namespace std;



int main(){
    int a;
    string s;
    
    cin >> a >> s;
    
    if(a>=3200){
        cout<<s<<endl;
    }else{
        cout<<"red"<<endl;
    }
    return 0;
}


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

int main()
{
    cout << fixed << setprecision(15);
    ll N, K;
    cin >> N >> K;

    if(N%K == 0){
        cout << 0 << endl;
    }
    else{
        cout << 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val N = sc.nextInt()
    var jpy = BigInt(0)
    var btc = BigDecimal(0)
    (0 until N) foreach { _ =>
      val x = sc.nextBigDecimal()
      val u = sc.next()
      u match {
        case "JPY" => jpy += x.toBigInteger
        case "BTC" => btc += x
      }
    }
    println((btc * BigDecimal(380000.0)) + BigDecimal(jpy))
  }

}


Measured memory_bytes: 25780
import java.util.*;

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

        String mask = "#..#";

        while (true) {
            int H = sc.nextInt();
            int W = sc.nextInt();

            if (H == 0 && W == 0)
                break;
            
            for (int row = 0; row < H; row++) {
                for (int col = 0; col < W; col++)
                    System.out.print(mask.charAt((col % 2) + (row % 2 * 2)));
                System.out.println();
            }
            System.out.println();
        }
    }
}



Measured memory_bytes: 36792
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>

using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define dbg(x) cout << #x"="<< (x) << endl
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_buck(a) 
#define in(x) cin >> x;
#define all(x) (x).begin(), (x).end()
#define INF 2147483600
#define fi first
#define se second


int main(){
	int N;
	cin>>N;
	int x,y;
	x = 800*N;
	y = 200*int(N/15);
	cout<<x-y<<endl;
	return 0;
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef unsigned long long LL;
typedef pair<int,int> P;
const LL mod=1000000007;
const LL LINF=1LL<<62;
const LL INF=1<<17;

int N,ans;
void dfs(LL k,LL sum,bool a,bool b,bool c){
    if(a&&b&&c) ans++;
    if(sum+k*3<=N) dfs(k*10,sum+k*3,1,b,c);
    if(sum+k*5<=N) dfs(k*10,sum+k*5,a,1,c);
    if(sum+k*7<=N) dfs(k*10,sum+k*7,a,b,1);
    return ;
}
int main(){
    cin >> N;
    dfs(1,0,0,0,0);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){r(1)(r(2).readFileSync("/dev/stdin","UTF-8"))},function(e,t){e.exports=function(e){for(var t=e.split("\n"),r=Number(t[0]),n=t[1].split(""),o=0,u=0,i="",f=0;f<r;f++)"("==n[f]?o+=1:(u+=1)>o&&(i="("+i,o+=1),i+=n[f];for(;u<o;)i+=")",u+=1;console.log(i)}},function(e,t){e.exports=require("fs")}]);

Measured memory_bytes: 21320
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)
    val Array(x, a, b) = sc.nextLine.split(" ").map(_.toInt)
    val point = b - a
    if (point <= 0) println("delicious")
    else if (point >= x + 1) println("dangerous")
    else println("safe")
  }
}


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

int main() {
  int a;
  while( cin >> a ) {
    int b, n;
    int sum = 0;
    cin >> b >> n;
//    cout << a << " " << b << " " << sum << endl;
    a %= b;
    a *= 10;
    for( int i = 0; a > 0 && i < n; i++ ) {
      sum += a / b;
//      cout << a << " " << b << " " << sum << endl;
      a %= b;
      a *= 10;
    }
    cout << sum << endl;
  }
  return EXIT_SUCCESS;
}

Measured memory_bytes: 1160
#include <stdio.h>

int main(){

	int x, y, d;

	scanf("%d %d", &x, &y);

	while(x!=0 && y!=0){
		if(x>=y){
			x = x%y;
		}else{
			y = y%x;
		}
	}

	printf("%d\n", (x>=y) ? x : y);

	return 0;
}

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

typedef long long ll;

int n;
int a[16][16];
ll dp[1<<16];

int main(){

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

    cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>a[i][j];
        }
    }
    for(int s=0;s<1<<n;s++){
        for(int i=0;i<n;i++)if(s>>i&1){
            for(int j=i+1;j<n;j++)if(s>>j&1){
                dp[s]+=a[i][j];
            }
        }
    }
    for(int s=0;s<1<<n;s++){
        int rs=s^((1<<n)-1);
        for(int t=rs;t;t=(t-1)&rs){
            dp[s|t]=max(dp[s|t],dp[s]+dp[t]);
        }
    }
    cout<<dp[(1<<n)-1]<<endl;

    return 0;
}

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

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

  int ans = -1;
  rep(i, 0, 1100) {
    // 税率8%のとき i==a
    if (floor(i*0.08) == a && floor(i*0.1) == b) {
      ans = i;
      break;
    }
  }

  if (ans == -1) {
    cout << "-1" << endl;
  } else {
    cout << ans << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
    int a,b,c,d,e,f,g,h;
    scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
    f=c-1-a;
    g=d+60-b;
    h=f*60+g-e;
    printf("%d",h);
}

Measured memory_bytes: 1732