akhauriyash/Code-Regression huggingface dataset:
/**
 * Created at 17:39 on 2019/03/07
 */

import java.io.*;
import java.util.*;

public class Main {

  static FastScanner sc = new FastScanner();

  public static void main(String[] args) {

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

    int maxX = Integer.MIN_VALUE;
    int minY = Integer.MAX_VALUE;

    for (int i=0; i<N; i++) {
      maxX = Math.max(maxX, sc.nextInt());
    }

    for (int j=0; j<M; j++) {
      minY = Math.min(minY, sc.nextInt());
    }

    if (maxX >= minY || maxX >= Y || minY <= X) {
      System.out.println("War");
    } else {
      System.out.println("No War");
    }

  }

  static class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
      if (ptr < buflen) {
        return true;
      } else {
        ptr = 0;
        try {
          buflen = in.read(buffer);
        } catch (IOException e) {
          e.printStackTrace();
        }
        if (buflen <= 0) {
          return false;
        }
      }
      return true;
    }

    private int readByte() {
      if (hasNextByte()) return buffer[ptr++];
      else return -1;
    }

    private static boolean isPrintableChar(int c) {
      return 33 <= c && c <= 126;
    }

    private void skipUnprintable() {
      while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
    }

    public boolean hasNext() {
      skipUnprintable();
      return hasNextByte();
    }

    public String next() {
      if (!hasNext()) throw new NoSuchElementException();
      StringBuilder sb = new StringBuilder();
      int b = readByte();
      while (isPrintableChar(b)) {
        sb.appendCodePoint(b);
        b = readByte();
      }
      return sb.toString();
    }

    public long nextLong() {
      if (!hasNext()) throw new NoSuchElementException();
      long n = 0;
      boolean minus = false;
      int b = readByte();
      if (b == '-') {
        minus = true;
        b = readByte();
      }
      if (b < '0' || '9' < b) {
        throw new NumberFormatException();
      }
      while (true) {
        if ('0' <= b && b <= '9') {
          n *= 10;
          n += b - '0';
        } else if (b == -1 || !isPrintableChar(b)) {
          return minus ? -n : n;
        } else {
          throw new NumberFormatException();
        }
        b = readByte();
      }
    }

    public int nextInt() {
      return (int) nextLong();
    }
  }

}


Measured memory_bytes: 23116
#include <iostream>
#include <numeric>

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

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

void solve(ll N, ll L) {
  auto mi = L;
  auto ma = L+N-1;

  auto ans = (2*L+N-1)*N/2;
  if (mi < 0 && ma < 0) {
    ans -= ma;
  } else if (mi > 0 && ma > 0) {
    ans -= mi;
  }
  cout << ans << endl;
}

int main() {
  ll N;
  cin >> N;
  ll L;
  cin >> L;
  solve(N, L);
  return 0;
}


Measured memory_bytes: 256
gets
h=Hash.new r=0
gets.split.map(&:to_i).sort.reverse.each{|e|
	o=e
	while (q=-o&o)<o;o-=q;end
	o*=2
	if h[e]>0
		h[e]-=1
		r+=1
	else
		h[o-e]+=1
	end
}
p r

Measured memory_bytes: 31460
/* in the name of Anton */

/*
  Compete against Yourself.
  Author - Aryan Choudhary (@aryanc403)
*/

#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize ("-ffloat-store")

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define fo(i,n)   for(i=0;i<(n);++i)
#define repA(i,j,n)   for(i=(j);i<=(n);++i)
#define repD(i,j,n)   for(i=(j);i>=(n);--i)
#define all(x) begin(x), end(x)
#define sz(x) ((lli)(x).size())
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define endl "\n"

typedef long long int lli;
typedef long double mytype;
typedef pair<lli,lli> ii;
typedef vector<ii> vii;
typedef vector<lli> vi;


const auto start_time = std::chrono::high_resolution_clock::now();
void aryanc403()
{
#ifdef ARYANC403
auto end_time = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> diff = end_time-start_time;
    cerr<<"Time Taken : "<<diff.count()<<"\n";
#endif
}

#ifdef ARYANC403
#include "/home/aryan/codes/PastCodes/header.h"
#else
    #define dbg(args...)
#endif

const lli INF = 0xFFFFFFFFFFFFFFFL;

lli seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline lli rnd(lli l=0,lli r=INF)
{return uniform_int_distribution<lli>(l,r)(rng);}

class CMP
{public:
bool operator()(ii a , ii b) //For min priority_queue .
{    return ! ( a.X < b.X || ( a.X==b.X && a.Y <= b.Y ));   }};

void add( map<lli,lli> &m, lli x,lli cnt=1)
{
    auto jt=m.find(x);
    if(jt==m.end())         m.insert({x,cnt});
    else                    jt->Y+=cnt;
}

void del( map<lli,lli> &m, lli x,lli cnt=1)
{
    auto jt=m.find(x);
    if(jt->Y<=cnt)            m.erase(jt);
    else                      jt->Y-=cnt;
}

bool cmp(const ii &a,const ii &b)
{
    return a.X<b.X||(a.X==b.X&&a.Y<b.Y);
}

const lli mod = 1000000007L;
// const lli maxN = 1000000007L;

    lli T,n,i,j,k,in,cnt,l,r,u,v,x,y;
    lli m;
    string s;
    vi a;
    //priority_queue < ii , vector < ii > , CMP > pq;// min priority_queue .

void prt(bool fl=true)
{
    cout<<(fl?"Yes":"No")<<endl;
    exit(0);
}

int main(void) {
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    // freopen("txt.in", "r", stdin);
    // freopen("txt.out", "w", stdout);
// cout<<std::fixed<<std::setprecision(35);
// cin>>T;while(T--)
{

    cin>>n>>m>>k;
    
    repA(i,0,n)
    repA(j,0,m)
    {
        if(i*(m-j)+j*(n-i)==k)
        {
            // dbg(i,j,i*(m-j),j*(n-i),k)
            prt();
        }
    }

    prt(false);
}   aryanc403();
    return 0;
}


Measured memory_bytes: 3652
#include<stdio.h>

int main()
{
	int a=0,b=0,c=0,temp;
	scanf("%d",&temp);
	a=temp/3600;
	b=(temp-a*3600)/60;
	c=temp-a*3600-b*60;
	printf("%d:%d:%d\n",a,b,c);
	return 0;
 }
 


Measured memory_bytes: 2104
package main

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

/*
 <url:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_A>
 */

func init() {

}

func main() {
	ab, _ := SplitIntStdin(" ")
	a := ab[0];
	b := ab[1];
	if a < b {
		fmt.Println("a < b")
	} else if a > b {
		fmt.Println("a > b")
	} else {
		fmt.Println("a == b")
	}
}

// ????????????1?????????
func StrStdin() (stringReturned string) {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	stringInput := scanner.Text()

	stringReturned = strings.TrimSpace(stringInput)
	return
}

// ??´??°???1?????????
func IntStdin() (int, error) {
	stringInput := StrStdin()
	return strconv.Atoi(strings.TrimSpace(stringInput))
}

// ?????????????????????????????????????????????Split()
func SplitWithoutEmpty(stringTargeted string, delim string) (stringReturned []string) {
	stringSplited := strings.Split(stringTargeted, delim)

	for _, str := range stringSplited {
		if str != "" {
			stringReturned = append(stringReturned, str)
		}
	}

	return
}

// ??????????????§??????????????????????????????????????????
func SplitStrStdin(delim string) (stringReturned []string) {
	// ???????????§1?????????
	stringInput := StrStdin()

	// ????????§??????
	// stringSplited := strings.Split(stringInput, delim)
	stringReturned = SplitWithoutEmpty(stringInput, delim)

	return
}

// ??????????????§??????????????´??°????????????????????????
func SplitIntStdin(delim string) (intSlices []int, err error) {
	// ??????????????????????????????
	stringSplited := SplitStrStdin(" ")

	// ??´??°?????????????????????
	for i := range stringSplited {
		var iparam int
		iparam, err = strconv.Atoi(stringSplited[i])
		if err != nil {
			return
		}
		intSlices = append(intSlices, iparam)
	}
	return
}

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

int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int ascb(const void *a, const void *b) {
  return *(int *)b - *(int *)a;
}

int main(){
    int N, M;
    int X[110000];
    int L[110000];
    int i, j;
    int sum=0, sumL=0;

    scanf("%d %d", &N, &M);

    for(i=0; i<M; i++){
        scanf("%d", &X[i]);
    }

    qsort(X, M, sizeof(int), asc);

    for(i=0; i<M-1; i++){
        L[i] = X[i+1]- X[i];
    }

    qsort(L, M-1, sizeof(int), ascb);

    for(i=0; i<N-1; i++){
        sum += L[i];
    }

    printf("%d", X[M-1]-X[0]-sum);

    return 0;

}

Measured memory_bytes: 1268
#include <iostream>
#include <algorithm>
#include <vector>

template <class T>
std::vector<T> vec(int len, T elem) { return std::vector<T>(len, elem); }

using lint = long long;

constexpr lint INF = 1LL << 60;

void solve() {
    int n;
    std::cin >> n;

    std::vector<lint> xs(n), ys(n), ps(n);
    for (int i = 0; i < n; ++i) {
        std::cin >> xs[i] >> ys[i] >> ps[i];
    }

    auto xds = vec(n, vec(1 << n, INF));
    auto yds = xds;

    for (int i = 0; i < n; ++i) {
        for (int b = 0; b < (1 << n); ++b) {
            {
                auto& cost = xds[i][b];
                cost = std::abs(xs[i]);
                for (int j = 0; j < n; ++j) {
                    if ((b >> j) & 1) cost = std::min(cost, std::abs(xs[i] - xs[j]));
                }
            }

            {
                auto& cost = yds[i][b];
                cost = std::abs(ys[i]);
                for (int j = 0; j < n; ++j) {
                    if ((b >> j) & 1) cost = std::min(cost, std::abs(ys[i] - ys[j]));
                }
            }
        }
    }

    std::vector<lint> ans(n + 1, INF);

    for (int b = 0; b < (1 << n); ++b) {
        int k = __builtin_popcount(b);

        for (int c = 0; c < (1 << k); ++c) {
            int xb = 0, yb = 0;
            int j = 0;

            for (int i = 0; i < n; ++i) {
                if (((b >> i) & 1) == 0) continue;
                if ((c >> j) & 1) {
                    xb |= (1 << i);
                } else {
                    yb |= (1 << i);
                }
                ++j;
            }

            lint cost = 0;
            for (int i = 0; i < n; ++i) {
                lint dist = std::min(xds[i][xb], yds[i][yb]);
                cost += dist * ps[i];
            }

            ans[k] = std::min(ans[k], cost);
        }
    }

    for (auto a : ans) std::cout << a << "\n";
}

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

    solve();

    return 0;
}


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

bool p[10002];

string itos(int x){
  stringstream ss;
  ss << x;
  return ss.str();
}

int main(){
  for(int i=0;i<10002;i++){
    string tmp = itos(i);
    int l = tmp.size();
    bool f = true;
    for(int j=0;j<l/2;j++)
      if(tmp[j] != tmp[l-1-j]){
	f = false;
	break;
      }
    p[i] = f;
  }

  int w = 0,n; cin >> n;
  for(;;){
    if(n-w>=0 && p[n-w]){
      cout << n-w << endl;
      return 0;
    }
    if(n+w<10002 && p[n+w]){
      cout << n+w << endl;
      return 0;
    }
    w++;
  }
}

Measured memory_bytes: 1224
import itertools,sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N,M = LI()
a = set([I() for _ in range(M)])
dp = [0]*(N+1) #1_indexed
dp[0] = 1
dp[1] = 0 if 1 in a else 1
for i,j in itertools.product(range(2,N+1),[1,2]):
    if i in a:
        dp[i] = 0
        continue
    dp[i] += dp[i-j]
    dp[i] %= 10**9+7
print(dp[-1])


Measured memory_bytes: 14988
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n; cin >> n;
    vector<string> v(n);
    int cnt = 0; int cnta = 0; int cntb = 0; int cntab=0;
    int cntaa = 0; int cntbb = 0;
    for (int i = 0; i < n; i++) cin >> v[i];
    for (int i = 0; i < n; i++) {
        int m = v[i].size() - 1;
        for (int j = 0; j < v[i].size()-1; j++) {
            if (v[i].substr(j, 2) == "AB") cnt++;
        }
        if (v[i].front() == 'B') cntb++;
        if (v[i].back() == 'A') cnta++;
        if (v[i].front() == 'B' && v[i].back() == 'A') cntab++;
    }
    //cout << cnt << " " << cntab << endl;
    if (cntab) {
        cnt += cntab - 1;
        cnta -= cntab; cntb -= cntab;
        if (cnta) cnta--, cnt++;
        if (cntb) cntb--, cnt++;
    }
    //cout << cnt << " " << cnta << " " << cntb << endl; 
    cnt += min(cnta, cntb);
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 768
#include <stdio.h>
#include <math.h>
int main(){
  int q;
  while (scanf("%d",&q)){
    if (q==-1)
      break;
    double x1=q/2.0,x2;
    while (fabs(pow(x2,3)-q)>=0.00001*q){
      x2=x1-(pow(x1,3)-q)/(3*x1*x1);
      x1=x2;
    }
    printf("%f\n",x2);
  }
  return 0;
}

Measured memory_bytes: 712
#define ALL(obj) (obj).begin(), (obj).end()

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>

using namespace std;
typedef long long ll;
const ll INF = 1e18;

ll N;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> N;
    vector<ll> A(N);

    for (ll i=0; i<N; i++) {
        cin >> A[i];
    }

    sort(A.begin(), A.end());
    
    for (ll i=1; i<N; i++) {
        if (A[i] == A[i-1]) {
            cout << "NO" << endl;
            return 0;
        }
    }
    
    cout << "YES" << endl;
    
    return 0;
}


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

#define rep(i,n) for(int i = 0; i < (int)n; ++i)

int main() {
  vector<char> A(4);
  rep(i,4) cin >> A.at(i);
  rep(i,4) A.at(i) -= '0';
  int ans = 7 - A.at(0);
  if (ans ==  A.at(1) + A.at(2) + A.at(3)) printf("%d+%d+%d+%d=7", A.at(0), A.at(1), A.at(2), A.at(3));
  else if (ans ==  A.at(1) + A.at(2) - A.at(3)) printf("%d+%d+%d-%d=7", A.at(0), A.at(1), A.at(2), A.at(3));
  else if (ans ==  A.at(1) - A.at(2) + A.at(3)) printf("%d+%d-%d+%d=7", A.at(0), A.at(1), A.at(2), A.at(3));
  else if (ans ==  A.at(1) - A.at(2) - A.at(3)) printf("%d+%d-%d-%d=7", A.at(0), A.at(1), A.at(2), A.at(3));
  else if (ans == -A.at(1) + A.at(2) + A.at(3)) printf("%d-%d+%d+%d=7", A.at(0), A.at(1), A.at(2), A.at(3));
  else if (ans == -A.at(1) + A.at(2) - A.at(3)) printf("%d-%d+%d-%d=7", A.at(0), A.at(1), A.at(2), A.at(3));
  else if (ans == -A.at(1) - A.at(2) + A.at(3)) printf("%d-%d-%d+%d=7", A.at(0), A.at(1), A.at(2), A.at(3));
  else if (ans == -A.at(1) - A.at(2) - A.at(3)) printf("%d-%d-%d-%d=7", A.at(0), A.at(1), A.at(2), A.at(3));
}


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

int main(){
    int n;
    cin >> n;
    int k;
    if(n==1){
        k=1;
    }
    else{
    if(n%2==0)
    k = n/2;
    else
    k=((n-1)/2)+1;
    }
    double ans = (double)k/double(n);
    cout<<ans<<endl;

}

Measured memory_bytes: 256
N,M = map(int,input().split())
ls = [0]*(N+1)
for i in range(M):
    a = int(input())
    ls[a] = -1
ls[0] = 1
if ls[1] == -1:
    ls[1] = 0
else:
    ls[1] = 1
for i in range(2,N+1):
    if ls[i] == -1:
        ls[i] = 0
    else:
        ls[i] = ls[i-1] + ls[i-2]
print(ls[-1]%(10**9+7))


Measured memory_bytes: 470264
n = int(input())
a = [int(i) for i in input().split()]
q = int(input())
m = [int(i) for i in input().split()]
t = [0]
for i in range(n):
    for j in range(len(t)):
        t.append(t[j]+a[i])
for i in range(q):
    if m[i] in t:
        print("yes")
    else:
        print("no")



Measured memory_bytes: 42984
#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
using namespace std;
const long long int INF = 1LL << 60;
int main()
{
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	vector<long long int> dp(n,INF);
	dp[0]=0;
	for(int i=0;i<n;i++){
		if(i+1 < n){
			dp[i+1]=min(dp[i+1],dp[i]+abs(a[i]-a[i+1]));

		}
		if(i+2 < n){
			dp[i+2]=min(dp[i+2],dp[i]+abs(a[i]-a[i+2]));
			
		}
	}
	cout<<dp[n-1];
	return 0;
}


Measured memory_bytes: 1408
#include <stdio.h>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <iomanip>

#define rep(i,a,b) for(long long i=a;i<b;i++)

using namespace std;


int main(void) {

	long long N = 0, D = 0, A = 0, B = 0, C = 0;
	long long x[100] = {};

	string s;

	cin >> N;
	

	if (N % 2 == 1)N *= 2;

	cout << N << endl;


	return 0;

}

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

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

    cin >> W >> H >> N;

    int x[N], y[N], a[N];
    for (int i = 0; i < N; i++){
        cin >> x[i] >> y[i] >> a[i];
    }

    int case_1 = 0;
    int case_2 = W;
    int case_3 = 0;
    int case_4 = H;

    for (int i = 0; i < N; i++){
        if (a[i] == 1){
            if (case_1 < x[i]){
                case_1 = x[i];
            }
        }

        else if (a[i] == 2)
        {
            if (case_2 > x[i]){
                case_2 = x[i];
            }
        }

        else if (a[i] == 3)
        {
            if (case_3 < y[i]){
                case_3 = y[i];
            }
        }
        
        else if (a[i] == 4)
        {
            if (case_4 > y[i]){
                case_4 = y[i];
            }
        }
    }

    int S = (case_2 - case_1) * (case_4 - case_3);

    if ((case_2 - case_1) < 0){
        S = 0;
    }

    else if ((case_4 - case_3) < 0){
        S = 0;
    }
    

    cout << S << endl;
}

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

int main(){
    int a,b,cnt=1;
  	cin>>a>>b;
    while(cnt*10<=b)
        cnt*=10;
    a=a*cnt*10+b;
    for(int i=0;i*i<=a;i++)
        if(i*i==a) { cout<<"Yes"<<endl; return 0; }
    cout<<"No"<<endl;
  	return 0;
}


Measured memory_bytes: 256
for e in iter(input,'0 0 0'):
 d=[2]*-~sum(map(int,e.split()))
 f=[]
 for _ in[0]*int(input()):
  s,t,u,v=map(int,input().split())
  if v:d[s]=d[t]=d[u]=1
  else:f+=[(s,t,u)]
 for s,t,u in f:
  if d[t]*d[u]==1:d[s]=0
  if d[u]*d[s]==1:d[t]=0
  if d[s]*d[t]==1:d[u]=0
 for x in d[1:]:print(x)


Measured memory_bytes: 5712
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.FileReader;
import java.io.FileWriter;

import java.util.*;
import java.util.stream.LongStream;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    /* 標準入力数値配列用 long */
    static long[] inputLongArr() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        long[] longarray = new long[strarray.length];
        for (int i = 0; i < longarray.length; i++) {
            longarray[i] = Long.parseLong(strarray[i]);
        }
        return longarray;
    }

    // 標準入力数値リスト用 int
    static List<Integer> inputIntList() throws Exception {
        List<String> strList = Arrays.asList(br.readLine().trim().split(" "));
        List<Integer> intList = new ArrayList<Integer>();
        for (String elem : strList){
            intList.add(Integer.parseInt(elem));
        }
        return intList;
    }

    // 標準入力数値配列用 integer 降順ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    /*標準入力long*/
    static long inputLong() throws Exception {
        return Long.parseLong(br.readLine());
    }

    /*標準入力long*/
    static int inputInt() throws Exception {
        return Integer.parseInt(br.readLine());
    }




    public static void main(String[] args) throws Exception {
        // write your code here
        int [] nab = inputval();
        int a = nab[1];
        int b = nab[2];
        if (Math.abs(b-a) % 2 == 0){
            System.out.println("Alice");
        }else{
            System.out.println("Borys");
        }


    }

}



Measured memory_bytes: 32752
numerosStr = input().split(" ")
numero=[]
for j in numerosStr:
    numero.append(int(j))
contador=[1]

for i in range(2,numero[1]+1):
    if numero[0]/i == int(numero[0]/i) and numero[1]/i == int(numero[1]/i):
        contador.append(i)
print(contador[-numero[2]])

Measured memory_bytes: 3060
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def check(In):
    return In != "A" and In != "C" and In != "G" and In != "T"

def main():
    s = ns()

    count = 0
    ans = 0
    for i in range(len(s)):
        if check(s[i]):
            count = 0
        else:
            count += 1
            ans = max(ans, count)
    print(ans)

if __name__ == '__main__':
    main()

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

bool win(int k,int turn,int a[],int n)
{
	bool t=false;

	if(k<=0)
	{
		cout<<k<<" "<<turn<<" "<<false<<endl;
		return false;
	}

	for(int i=0;i<n;i++)
	{
		if(!win(k-a[i],(turn+1)%2,a,n))
		{
			cout<<k<<" "<<turn<<" "<<true<<endl;
			return true;
		}
	}
	
	cout<<k<<" "<<turn<<" "<<false<<endl;
	return false;
}

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

	int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	int K=k;

	int dp[k+1];

	for(int i=0;i<=k;i++)
	{
		dp[i]=0;
	}

	for(int i=0;i<=k;i++)
	{
		int t=1;
		for(int j=0;j<n;j++)
		{
			if(i-a[j]>=0)
				t &= dp[i-a[j]];
		}
		dp[i]=!t;
	}

	if(dp[k])
		cout<<"First"<<endl;
	else
		cout<<"Second"<<endl;

	return 0;
}

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

using namespace std;
typedef long long ll;
const int MAXN = 200100;

int N;
pair <int, int> p[MAXN];
ll nreach[MAXN], dp[MAXN];

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) cin >> p[i].first >> p[i].second;
    sort (p, p + N);
    for (int i = N - 1; i >= 0; i--) {
        int xend = p[i].first + p[i].second;
        int cloc = i + 1;

        while (cloc < N && p[cloc].first < xend)
            cloc = nreach[cloc];
        nreach[i] = cloc;
    }
    dp[0] = 1;
    for (int i = 0; i < N; i++) {
        dp[i] %= 998244353;
        dp[i+1] += dp[i], dp[nreach[i]] += dp[i];
    }
    cout << dp[N] % 998244353 << "\n";
}

Measured memory_bytes: 4992
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		int N,i;		
	
		int diff;
		
		N = sc.nextInt();
		i = sc.nextInt();
				
		diff = N - i + 1;
		
		System.out.println(diff);
		
	}

}

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

int main(){
  int n,t=0,x[100002];cin>>n;
  REP(i,n){
    cin>>x[i+1];
    t+=abs(x[i+1]-x[i]);
  }
  t+=abs(x[n]);
  x[0]=x[n+1]=0;
  REP(i,n) cout<<t-abs(x[i+1]-x[i])-abs(x[i+2]-x[i+1])+abs(x[i+2]-x[i])<<endl;
}

Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
int m,d;
int main(){
	cin>>m>>d;
	int ans=0;
	for(int i=1;i<=m;i++){
		for(int j=1;j<=d;j++){
			int d1=j/10,d10=j%10;
			if(d1>=2&&d10>=2&&d1*d10==i)
			ans++;
		}
	}
	cout<<ans;
	return 0;
} 

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define RFOR(i,a,b) for(int i = (int)(b-1);i>=(int)(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " <<
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

signed main(){
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout.precision(20);

  int n;
  cin >> n;
  vector<int> d(n);
  REP(i,n) cin >> d[i];

  sort(d.begin(),d.end());
  cout << d[n / 2] - d[n / 2 - 1] << endl;

  return 0;
}

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

#ifdef _DEBUG
inline void dump() { cerr << endl; }
template<typename Head> void dump(Head&& head) { cerr << head; dump(); }
template<typename Head, typename... Tail> void dump(Head&& head, Tail&&... tail) { cerr << head << ", "; dump(forward<Tail>(tail)...); }
#define debug(...) do {cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; dump(__VA_ARGS__); } while (false)
#else
#define dump(...)
#define debug(...)
#endif

template<typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template<typename T>
using Edges = vector<edge<T>>;
template<typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template<typename T>
using Matrix = vector<vector<T>>;

/////////////////////////////////////////////////////////////////////

const ll inf = 1LL<<60;

typedef pair<ll, ll> P;

int main()
{
  ll n; cin>>n;
  vector<ll> a(n);
  vector<ll> b(n);
  vector<P> c(n);
  rep(i, n) {
    cin>>a[i]>>b[i];
    c[i] = make_pair(a[i]+b[i], i);
  }
  sort(c.rbegin(),c.rend());

  ll x=0, y=0;
  rep(i, n) {
    if (i%2) y += b[c[i].second];
    else x += a[c[i].second];
  }

  cout << x-y << endl;

  return 0;
}


Measured memory_bytes: 6428
import java.util.Scanner;

public class Main {
	
	static int[] memo = new int[45];
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int N = in.nextInt();
		
		System.out.println(fib(N));
	}
	
	static int fib(int N) {
		if (N == 0 || N == 1) return 1;
		if (memo[N] != 0) return memo[N];
		return memo[N] = fib(N-1) + fib(N-2);
	}
}



Measured memory_bytes: 26260
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int a,b,k,i,j,l;
  cin >>a >>b >>k;
  j =0;
  for (i = 1;i<101;i++){
    if(a%i ==0 && b%i ==0) j++;
  }
  k = j-k+1;
  j =0;
  for (i = 1;i<101;i++){
    if(a%i ==0 && b%i ==0) j++;
    if(j == k)break;
  }
  cout << i<< endl;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
S = input()
T = input()
L = N * M


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


dic1, dic2 = {}, {}
for i in range(N):
    dic1[(L // N) * i + 1] = S[i]

for j in range(M):
    dic2[(L // M) * j + 1] = T[j]

num = L // gcd(N, M)
if dic1[1] != dic2[1]:
    num = -1
for k, v in dic1.items():
    if k in dic2:
        if dic2[k] != v:
            num = -1

print(num)

Measured memory_bytes: 21816
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define usecppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(x) ((x).begin()),((x).end())
#define eps 1e-7
#pragma GCC optimize ("unroll-loops")
#define int ll
const int mod = 998244353;
using pii = pair<int, int>;

struct Range_Maximum_Tree
{
    int n;
    vector<int> segtree;

    Range_Maximum_Tree()
    {
    }

    int initialize(const vector<int> &data, int l, int r, int node)
    {
        if (l == r)
            return segtree[node] = data[l];
        int mid = (l + r) / 2;
        int lmax = initialize(data, l, mid, node * 2);
        int rmax = initialize(data, mid + 1, r, node * 2 + 1);
        return segtree[node] = max(lmax, rmax);
    }

    int maxq(int l, int r, int node, int nodeleft, int noderight)
    {
        if (r < nodeleft || noderight < l)
            return 0;
        if (l <= nodeleft && noderight <= r)
            return segtree[node];
        int mid = (nodeleft + noderight) / 2;
        return max(maxq(l,r,node*2,nodeleft,mid),
                   maxq(l,r,node*2+1,mid+1,noderight));
    }
    void update(int left,int right, int node, int change_node ,int diff)
    {
        if (!(left <= change_node &&change_node <= right))
            return;
        if (left == right)
            segtree[node] = diff;
        else
        {
            int mid = (left + right) / 2;
            update(left, mid, node * 2, change_node, diff);
            update(mid +1,right, node * 2 +1, change_node, diff);
            segtree[node] = max(segtree[2 * node], segtree[2 * node + 1]);
        }
    }
};


vector <pii> v;
Range_Maximum_Tree T;
int nxt[202020];
vector <int> p;
int ct[202020];
int32_t main()
{
    usecppio
    int n; cin >> n;
    T.n = n;
    T.segtree.resize(4*n);
    for (int i = 0; i<n; i++)
    {
        int x, d; cin >> x >> d;
        v.push_back({x, d});
    }
    sort(all(v));
    v.push_back({1e10,0});
    nxt[n] = n;
    for (int i = n-1; i>=0; i--)
        nxt[i] = i+1;
    for (int i = 0; i<n; i++)
    {
        p.push_back(nxt[i]);
    }
    T.initialize(p,0,n-1,1);
    for (int i = n-1; i>=0; i--)
    {
        pair<int, int> pp = make_pair(v[i].first+v[i].second, 0ll);
        int u = (lower_bound(all(v),pp)-v.begin());
        nxt[i] = T.maxq(i,u-1,1,0,n-1);
        T.update(0,n-1,1,i,nxt[i]);
    }
    ct[0] = 1;
    for (int i = 0; i<n; i++)
    {
        ct[nxt[i]]+=ct[i];
        ct[nxt[i]]%=mod;
        ct[i+1]+=ct[i];
        ct[i+1]%=mod;
    }
    cout << ct[n] << '\n';
}

Measured memory_bytes: 17388
from itertools import permutations as perm
import sys
import math
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
XY = np.array(read().split(), np.int64)
X = XY[0::2]
Y = XY[1::2]

res = 0
cnt = 0
for p in perm(range(N)):
    for i in range(N - 1):
        res += math.sqrt((X[p[i + 1]] - X[p[i]])**2 + (Y[p[i + 1]] - Y[p[i]])**2)
    cnt += 1    
print(res/cnt)

Measured memory_bytes: 12388
#include <iostream>

using namespace std;

int main() {
	int x, y;
	int b = 0, a = 0;

	cin >> x >> y;

	b = y - 2 * x;
	a = 4 * x - y;
	if (a >= 0 and b >= 0 and b % 2 == 0) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}
}

Measured memory_bytes: 3640
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    prim_dict = {}

    for i in range(2, N + 1):
        p = 2
        X = i
        for p in range(2, i + 1):
            while X % p == 0:
                if p not in prim_dict:
                    prim_dict[p] = 2
                else:
                    prim_dict[p] += 1
                X /= p
    count_3over = 0
    count_5over = 0
    count_15over = 0
    count_25over = 0
    count_75over = 0
    for p in prim_dict:
        if prim_dict[p] >= 75:
            count_75over += 1L
        if prim_dict[p] >= 25:
            count_25over += 1L
        if prim_dict[p] >= 15:
            count_15over += 1L
        if prim_dict[p] >= 5:
            count_5over += 1L
        if prim_dict[p] >= 3:
            count_3over += 1L

    count = 0L
    #3,3,5
    count += (count_5over * (count_5over-1))/2 * (count_3over - 2)
    count += count_15over * (count_5over - 1)
    count += count_25over * (count_3over - 1)
    count += count_75over
    print count


if __name__ == '__main__':
    main()


Measured memory_bytes: 3024
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
	int a[3];
	for(int i=0;i<3;i++)
	cin>>a[i];
	sort(a,a+3);
	cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl;
	return 0;
	
}


Measured memory_bytes: 3156
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
string s;
int n,a,b,c,d;
int main()
{
    while(cin>>n>>a>>b>>c>>d)
    {
        cin>>s;
        s="."+s;
        bool flag=true;
        int cnt=0;
        for(int i=a; i<=d; i++)
        {
            if(s[i]=='#')
                cnt++;
            else
                cnt=0;
            if(cnt >= 2)
            {
                flag=false;
            }
        }
        if(!flag)
        {
            puts("No");
            continue;
        }
        if(c > d)
        {
            flag=false;
            cnt=0;
            if(s[b-1]!='#')
                cnt++;
            for(int i=b; i<=d; i++)
            {
                if(s[i]!='#')
                    cnt++;
                else
                    cnt=0;
                if(cnt >= 3)
                {
                   flag=true;
                }
            }
            if(s[d+1]!='#')
                cnt++;
            if(cnt >= 3)
            {
                flag=true;
            }
            if(!flag)
                puts("No");
            else
                puts("Yes");
        }
        else
        {
            if(!flag)
                puts("No");
            else
                puts("Yes");
        }
    }
    return 0;
}


Measured memory_bytes: 772
from collections import deque
def calcXor(nums):
  x=0
  for n in nums:
    x=x^n
  return x

N=int(input())
A=list(map(int,input().split()))
A_xor=calcXor(A)

ans=deque()
for a in A:
  ans.append(A_xor^a) 

#for i in range(N):  
  #print(A[0:i])
  #x=calcXor(A[0:i])
  #print(A[i+1:N])
  #y=calcXor(A[i+1:N])
  #ans.append(x^y)
print(" ".join(map(str,ans)))



Measured memory_bytes: 41936
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
int a[200005],c[200005],b[200005];
ll dp[200005];
int main(){
    int n,m;
    cin>>n;
    for(int i=1;i<=n;i++){scanf("%d",&a[i]);}
    c[1]=a[1];
    int tot=1;
    for(int i=2;i<=n;i++){
        if(a[i]!=c[tot])c[++tot]=a[i];
    }
    dp[0]=1;
    //cout<<tot<<endl;
    for(int i=1;i<=tot;i++){
        if(b[c[i]])dp[i]=(dp[i-1]+dp[b[c[i]]])%mod;
        else dp[i]=dp[i-1];
        dp[i]%=mod;
        b[c[i]]=i;
    }
    cout<<dp[tot]<<endl;
    return 0;
}


Measured memory_bytes: 4096
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <list>
#include <stdio.h>
#include <algorithm>
#define MAX 50000
#define INF 100000000
using namespace std;
typedef long long ll;
int t[MAX+1],c[21];
int main()
{	
	int n,m; 
	cin>>n>>m;
	for(int i=1;i<=m;i++)
	{
		cin>>c[i];
	}
	for(int i=1;i<=n;i++) t[i]=INF;
	t[0]=0;
	for(int i=1;i<=m;i++)
	{
		for(int j=0;j+c[i]<=n;j++)
		{
			t[j+c[i]]=min(t[j+c[i]],t[j]+1);//在可以用该币凑出该价格时，用或者不用 
		}
	}
	cout<<t[n]<<endl;
}


Measured memory_bytes: 3292
num = input()
n = len(num) - 1

for i in range(2 ** n):
    s = num[0]
    for j in range(n):
        if (i >> j) & 1:
            s += "+"
        else:
            s += "-"
        s += num[j+1]
    if eval(s) == 7:
        print(s + "=7")
        break


Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main()
{
	int N;
	cin >> N;
	vector<ull> A(N);
	for (auto i = 0; i < N; ++i)
	{
		cin >> A[i];
	}

	ull mod = (ull)1e9 + 7;
	vector<ull> sum0[60];
	vector<ull> sum1[60];
	for (auto i = 0; i < 60; ++i)
	{
		auto bit = (1ull << i);
		auto temp0 = 0ull;
		auto temp1 = 0ull;
		for (auto j = 0; j < N; ++j)
		{
			temp0 += ~A[j] & bit;
			temp0 %= mod;
			sum0[i].push_back(temp0);

			temp1 += A[j] & bit;
			temp1 %= mod;
			sum1[i].push_back(temp1);
		}
	}

	auto result = 0ull;
	for (auto i = 0; i < N - 1; ++i)
	{
		for (auto j = 0; j < 60; ++j)
		{
			auto add = 0ll;
			if ((A[i] & (1ull << j)) == 0)
			{
				add = sum1[j][N - 1] - sum1[j][i];
			}
			else
			{
				add = sum0[j][N - 1] - sum0[j][i];
			}
			if (add < 0)
			{
				add += mod;
			}
			result = result + add;
			result %= mod;
		}
	}

	cout << result << endl;

	return 0;
}

Measured memory_bytes: 432748
N, A, B, C, D = map(int, input().split())
N-=1
A-=1
B-=1
C-=1
D-=1
S = input()

overtakeFlag = False 
proceedableFlag = True
if C > D:
    for i in range(B, D+1):
        if S[i-1] == "." and S[i] == "." and S[i+1] == ".":
            overtakeFlag = True
else:
    overtakeFlag = True

for i in range(A, max(C, D)-1):
    if S[i]=="#" and S[i+1]=="#":
        proceedableFlag = False

if overtakeFlag and proceedableFlag:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9416
//#pragma comment(linker, "/STACK:102400000,102400000")
#include <fstream>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <cassert>
//#include <unordered_map>
//#include <unordered_set>
using namespace std;

typedef long long ll;
#define eps 1e-8
#define LL_INF 0x3fffffffffffffff
#define INF 1LL<<30
#define mem(a, b) memset(a, b, sizeof(a))
#define pper(i,n,m) for(int i = n;i >= m; i--)
#define repp(i, n, m) for (int i = n; i <= m; i++)
#define rep(i, n, m) for (int i = n; i < m; i++)
#define sa(n) scanf("%d", &(n))
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define DE(val) cout<<#val<<": "<<val<<endl;

const int dx4[5] = { 0,-1,0,1,0 };
const int dy4[5] = { 0,0,1,0,-1 };
const int dx8[9] = { 0,-1,0,1,0,1,1,-1,-1 };
const int dy8[9] = { 0,0,1,0,-1,1,-1,1,-1 };
const int maxn = 2e5 + 3;
const double PI = acos(-1.0);
const ll mod = 1e9 + 7;
ll po(ll a, ll b, ll mod) { ll res = 1; a %= mod; for (; b; b >>= 1) { if (b & 1)res = res*a%mod; a = a*a%mod; }return res; }
ll gcd(ll a, ll b) { if (a == 0) { return b; } else { return gcd(b%a, a); } }
void YES() { puts("YES"); exit(0); }
void Yes() { puts("Yes"); exit(0); }
void NO() { puts("NO"); exit(0); }
void No() { puts("No"); exit(0); }
void one() { puts("-1"); exit(0); }

char val[maxn];
ll le, ri;

int len, prod;
ll pre[maxn][30];
int nxt[maxn];

ll fib(ll n, ll x)
{
	if (n <= len) {
		return pre[n][x];
	}
	if (n <= 2 * len) {
		return pre[len][x] + pre[n - len][x];
	}
	ll ans1 = pre[len][x] + pre[prod][x];
	ll ans2 = pre[len][x];
	ll a = len + prod;
	ll b = len;

	while (n > a + b)
	{
		ll tmp = ans1;
		ans1 += ans2;
		ans2 = tmp;

		tmp = a;
		a += b;
		b = tmp;
	}
	return ans1 + fib(n - a, x);
}

ll cal(ll n, ll x)
{
	if (n <= len)return pre[n][x];
	if (len%prod == 0)
	{
		ll res = 1LL * (n - len) / prod*pre[prod][x] + pre[len][x];
		n -= len;
		n %= prod;
		return res + pre[n][x];
	}
	else
	{
		return fib(n, x);
	}
}

void solve()
{
	memset(pre, 0, sizeof(pre));
	scanf("%s", val + 1);

	len = strlen(val + 1);
	len /= 2;

	nxt[0] = -1;
	int k = -1;
	for (int i = 0; i < len;)
	{
		if (k == -1 || val[k + 1] == val[i + 1])
		{
			k++;
			i++;
			nxt[i] = k;
		}
		else
		{
			k = nxt[k];
		}
	}
	prod = len - nxt[len];

	repp(i, 1, len)
	{
		for (int k = 0; k < 26; k++)
		{
			pre[i][k] = pre[i - 1][k];
		}
		pre[i][val[i] - 'a']++;
	}
	scanf("%lld%lld", &le, &ri);

	rep(k, 0, 26)
	{
		printf("%lld ", cal(ri, k) - cal(le - 1, k));
	}
}


int main()
{
	solve();
	//system("pause");
	return 0;
}


Measured memory_bytes: 47744
n, x = map(int, input().split())
A = list(map(int, input().split()))

A.sort()
ans = 0
for a in A:
    x -= a
    if x < 0:
        break
    else:
        ans += 1
if 0 < x:
    ans -= 1

print(max(ans, 0))


Measured memory_bytes: 9060
#include <stdio.h>

int main(void) {
  int a[100] = {0};
  int n;
  int i;

  scanf("%d", &n);
  
  for (i = 0; i < n; i++){
    scanf("%d", &a[i]);
  }
  
  for(i = n - 1; i >= 0; i--) {
    printf("%d", a[i]);
    if(i != 0)
      printf(" ");
  }
  printf("\n");

  
  return 0;
}


Measured memory_bytes: 1968
// B.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
using namespace std;

int main()
{
    int n, d;

    cin >> n >> d;

    int hitori = 2 * d + 1;

    if (n % hitori == 0) {
        cout << n / hitori << endl;
    }
    else {
        cout << n / hitori + 1 << endl;
        
    }
    return 0;
}



Measured memory_bytes: 3572
#include <bits/stdc++.h>
 
#define ff first
#define ss second
#define mp make_pair
 
using namespace std;

typedef long long ll;

int tab[256], cnt[3];

int main(){
	int n;
	char s[4005];

	tab['R'] = 0;
	tab['G'] = 1;
	tab['B'] = 2;

	scanf("%d %s", &n, s);

	ll ans = 0;
	int sz = strlen(s);

	for(int i = 0; s[i]; i++) {
		int x = tab[s[i]];
		for(int k = i+1; k < sz; k++) {
			int y = tab[s[k]];
			if(x == y) continue;
			int d = k-i;

			int z = 3 - x- y;
			ans += cnt[z];
			if(i - d >= 0 && tab[s[i-d]] == z) ans--;
		}
		cnt[x]++;
	}
	printf("%lld\n", ans);

	return 0;
}


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

#define ft first
#define sd second
#define pb push_back
#define all(x) x.begin(),x.end()

#define ll long long int
#define vi vector<int>
#define vii vector<pair<int,int> >
#define pii pair<int,int>
#define plii pair<pair<ll, int>, int>
#define piii pair<pii, int>
#define viii vector<pair<pii, int> >
#define vl vector<ll>
#define vll vector<pair<ll,ll> >
#define pll pair<ll,ll>
#define pli pair<ll,int>
#define mp make_pair
#define ms(x, v) memset(x, v, sizeof x)
#define pr_vec(v) for(int i=0;i<v.size();i++) cout << v[i] << " " ;

#define f_in(st) freopen(st,"r",stdin)
#define f_out(st) freopen(st,"w",stdout)

#define fr(i, a, b) for(i=a; i<=b; i++)
#define fb(i, a, b) for(i=a; i>=b; i--)
#define ASST(x, l, r) assert( x <= r && x >= l )
const int  p=31,po=1,N=1e5+10, M=(ll)1e9+1 ;
const int mod = 1e9+7 ;
vl compute(string s){
        vl has(s.length());
        ll i;

        for(i=0;i<s.length();i++){
            if(i==0){
                has[i]=((s[i]-'a'+1))%mod;
            }
            else
                has[i]=(has[i-1]*p + (s[i]-'a'+1))%mod;
        }
        return has;
}
// vl ed[N],g[N],in(N),vis(N,0),cost(N,0);
vl g[N],vis(N,0),ans;
vl check;
priority_queue<ll,vl,greater<ll>> pq;


int main(){
 ios_base::sync_with_stdio(0);
  ll k,a,b,n=1;
  cin >> k >> a >> b;
  if((1+k)<=a){
      cout << 1+k;
      return 0;
  }
  n=a;
  k-=(a-1);
  if(b-a<=2){
      n+=k;
      cout << n;
      return 0;
  }

        while(1){
            // if(k<=0)
            //   break;
             if(k<2){
                n+=k;
                break;
            }
            k-=2;
           
            n+=b-a;

        }
  

  cout << n ;
  
  return 0;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> VI;
typedef vector<VI> VVI;
typedef pair<ll, ll> P;
#define INF (1LL << 31)
#define FOR(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define PRINT(V) for (auto v : (V)) cout << v << " "

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

    rep(i, s.size()) {
        if (s[i] == '?') s[i] = 'D';
    };

    cout << s << endl;
    return 0;
}


Measured memory_bytes: 3728
#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
#define N (1000000000+7)

int main(void) {
	int d;
	cin >> d;
	if (d == 25)cout << "Christmas" << endl;
	if (d == 24)cout << "Christmas Eve" << endl;
	if (d == 23)cout << "Christmas Eve Eve" << endl;
	if (d == 22)cout << "Christmas Eve Eve Eve" << endl;
	return 0;
}

Measured memory_bytes: 256
from collections import deque
import _pickle as cPickle
import cProfile
H, W =map(int,input().split())
grid = [input() for i in range(H)]
dist = [[-1]*W for _ in range(H)]

cells = deque()
for h in range(H):
    for w in range(W):
        if grid[h][w] == '.':
            dist[h][w] = 0
            cells.append((h,w))

distG = cPickle.loads(cPickle.dumps(dist, -1))
pcells = deque()
def bfs(h,w):
    pcells.append((h,w))
    d = 1
    distG[h][w] = 1
    while pcells:
        oh,ow = pcells.popleft()
        d = distG[oh][ow]
        for dx, dy in ((0,1),(0,-1),(1,0),(-1,0)):
            nw = ow + dx
            nh = oh + dy
            if nw < 0 or W <= nw or nh <0 or H <= nh:
                continue
            if distG[nh][nw] == 0:
                distG[nh][nw] = d+1
                pcells.append((nh,nw))

    return d-1

a = 0
for i in range(len(cells)):
    distG = cPickle.loads(cPickle.dumps(dist, -1))
    h,w = cells.popleft()
    a = max(a,bfs(h,w))
print(a)

Measured memory_bytes: 9772
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>
#include <unordered_map>

using namespace std;

#define int long long
#define rep(i, n) for (int i=0;i<(int)(n);++i)
#define rep1(i, n) for (int i=1;i<=(int)(n);++i)
#define range(i, l, r) for (int i=l;i<(int)(r);++i)
#define rrange(i, l, r) for (int i=r-1;i>=(int)(l);--i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using vi=vector<int>;
using pii=pair<int, int>;
using ll=long long;

bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
//int read(){int a;scanf("%lld",&a);return a;}

constexpr int TEN(int n){return n==0?1:10*TEN(n-1);}

const int inf = TEN(18)*3 + 10;
const int mod = TEN(9) + 7;

int A, B, Q;

signed main()
{
	cin >> A >> B >> Q;
	vi s(A), t(B);
	rep(i, A) cin >> s[i];
	rep(i, B) cin >> t[i];

	rep(_, Q) {
		int x; cin >> x;

		vi S, T;
		int sidx = lower_bound(all(s), x) - begin(s);
		int tidx = lower_bound(all(t), x) - begin(t);

		if (sidx > 0) sidx--;
		if (tidx > 0) tidx--;

		rep(i, 2) if (sidx + i < A) S.PB(s[sidx + i]);
		rep(i, 2) if (tidx + i < B) T.PB(t[tidx + i]);

		int ans = inf;

		rep(i, S.size()) rep(j, T.size()) {
			int ss = S[i], tt = T[j];

			if (ss > tt) swap(ss, tt);

			// ss < tt
			if (ss <= x and x <= tt) {
				chmin(ans, min(abs(x - ss), abs(x - tt)) + abs(ss - tt));
			} else if (x <= ss) {
				chmin(ans, abs(x - tt));
			} else if (x >= tt) {
				chmin(ans, abs(x - ss));
			}
		}

		printf("%lld\n", ans);
	}
}



Measured memory_bytes: 2944
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def solve(i, x):  # レベルiバーガーの下からxこ
	if i == 0:
		if x <= 0:
			return 0
		else:
			return 1
	if x <= L[i-1]+1:
		ret = solve(i-1, x-1)
	else:
		ret = P[i-1]+1+solve(i-1, x-L[i-1]-2)
	return ret

N, X = MAP()
L = [0]*(N+1)
L[0] = 1
for i in range(1, N+1):
	L[i] = 2*L[i-1]+3
P = [0]*(N+1)
P[0] = 1
for i in range(1, N+1):
	P[i] = 2*P[i-1]+1

print(solve(N, X))


Measured memory_bytes: 5200
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static int N = 3;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		sc.close();
		out.println(800*n-(n/15)*200);
	}
}


Measured memory_bytes: 23764