akhauriyash/Code-Regression huggingface dataset:
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    const [n,m] = nextIntArray()
    console.log((1900*m + 100*(n-m))*Math.pow(2,m))

}
Main()


Measured memory_bytes: 30380
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>

using namespace std;

typedef unsigned long long int ULL;
typedef long long LL;
typedef long double LD;

int main()
{
	LL n;
	cin >> n;
	vector<LL> a(n), b(n), c(n-1);

	for (auto &e : a) {
		cin >> e;
	}
	for (auto &e : b) {
		cin >> e;
	}
	for (auto &e : c) {
		cin >> e;
	}

	LL cnt = 0;

	for (int i = 0; i < n; ++i) {
		cnt += b[a[i]-1];
		if (i > 0 && a[i-1]+1 == a[i]) {
			cnt += c[a[i-1]-1];
		}
	}
	cout << cnt << endl;
}

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    while(cin>>n)
    {
        vector<ll> arr;
        for(int i=0;i<n;i++)
        {
            ll x;
            cin>>x;
            arr.push_back(x);
        }
        map<ll,ll> mp;
        mp[n-1]=0;
        ll ans=0;
        for(int i=n-2;i>=0;i--)
        {
            if(arr[i]>=arr[i+1])
            {
                mp[i]=mp[i+1]+1;
                ans=max(ans,mp[i]);
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}


Measured memory_bytes: 7284
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define Rep(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define tmax(x, y, z) max((x), max((y), (z)))
#define tmin(x, y, z) min((x), min((y), (z)))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
const ll INF = 1LL << 60;
const ll MM = 1000000000; const ll MOD = MM + 7; const ll MMM=9223372036854775807;//2^63 -1
#define ADD(a,b) a = (a + ll(b)) % MOD
#define MUL(a,b) a = (a * ll(b)) % MOD
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true;} return false;}
template<typename A, size_t N, typename T> void FILL(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
using Graph = vector<vector<ll>>;
ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
ll ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//cout << fixed << setprecision(10);


int main(){
    ll n, ans = 0; cin >> n;
    vector<ll> l(n);
    rep(i, n) cin >> l[i];
    rep(i, n-2){
        Rep(j, i+1, n-1){
            Rep(k, j+1, n){
                ll a = l[i], b = l[j], c = l[k];
                if(a != b && b != c && c != a && abs(b-c) < a && a < (b+c)) ans++;
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3624
#include<stdio.h>
#include<string.h>
#define LEN 100005
#define MAX 100000

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN+1];
int head,tail,n;

void enqueue(P x){
  if(isFull()){
    printf("error(overflow)");
  }
  Q[tail] = x;
  if(tail+1 == MAX)tail = 0;
  else tail++;
}
P dequeue(){
  P a;
  if(isEmpty()){
    printf("error(underflow)");
}
  a = Q[head];
  if(head+1 ==MAX)head=0;
  else head++;
  return a;
}
int isEmpty(void){
  if(head==tail)
    return 1;
  else return 0;
}
int isFull(void){
  if((head == tail+1)% MAX)
    return 1;
  else return 0;
}
int main(){
  int elaps = 0,c;
  int i,q;
  P u;
  scanf("%d%d",&n,&q);

  for(i=1;i<=n;i++){
    scanf("%s",Q[i].name);
    scanf("%d",&Q[i].t);
  }
  head =1;
  tail= n+1;
  while(n!=0){
    u = Q[head];
    u.t = Q[head].t - q;
    if(u.t>0){
      elaps = elaps+q;
      enqueue(u);
      Q[head] = dequeue();
    }else{
      elaps = elaps + Q[head].t;
      printf("%s %d\n",u.name,elaps);
      Q[head] = dequeue();
      n--;
    }
  }
  return 0;
}

Measured memory_bytes: 10756
# A - Connection and Disconnection
# https://atcoder.jp/contests/agc039/tasks/agc039_a

S = list(input())
k = int(input())

S_cnt = 0
repS = S[:]
for i in range(1, len(S)):
  if repS[i] == repS[i - 1]:
    repS[i] = "*"
    S_cnt += 1

if all(i == j for i, j in zip(S, S[1:])):
  ans = len(S) * k // 2
else:
  if S[0] != S[-1]:
    ans = S_cnt * k
  else:
    l = 0
    for s in S:
      if s == S[0]:
        l += 1
      else:
        break
    r = 0
    for s in S[::-1]:
      if s == S[-1]:
        r += 1
      else:
        break
    ans = S_cnt * k - (l // 2 + r // 2 - (l + r) // 2) * (k - 1)

print(ans)

Measured memory_bytes: 3064
macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); input_inner!{iter, $($r)*} }; ($($r:tt)*) => { let mut s = { use std::io::Read; let mut s = String::new(); std::io::stdin().read_to_string(&mut s).unwrap(); s }; let mut iter = s.split_whitespace(); input_inner!{iter, $($r)*} }; } macro_rules! input_inner { ($iter:expr) => {}; ($iter:expr, ) => {}; ($iter:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($iter, $t); input_inner!{$iter $($r)*} }; } macro_rules! read_value { ($iter:expr, ( $($t:tt),* )) => { ( $(read_value!($iter, $t)),* ) }; ($iter:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>() }; ($iter:expr, chars) => { read_value!($iter, String).chars().collect::<Vec<char>>() }; ($iter:expr, usize1) => { read_value!($iter, usize) - 1 }; ($iter:expr, $t:ty) => { $iter.next().unwrap().parse::<$t>().expect("Parse error") }; }

fn main() {
    input!{
        n: i32,
    }
    println!("{}", if n % 2 == 0 {
        0.5
    } else {
        let n = n as f32;
        (n + 1.0) / 2.0 / n 
    });
}

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

#include <iostream>
#include <fstream>

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

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

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

#endif //INCLUDE_DEBUG_HPP

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

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

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

class AHaiku {
public:
	void solve(std::istream& in, std::ostream& out)
	{
	    string s;
	    in >> s;
	    for(int i=0; i<s.length(); i++){
	        if(s[i] == ',') out << " ";
	        else out << s[i];
	    }
	    out << endl;
	}
};


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


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

const int N = 110000;

struct Edge {
	int u, v, t;
	Edge(int u = 0, int v = 0, int t = 0) : u(u), v(v), t(t) {}
} E[N];

int root[N];

int find_root(int u) {
	if (u == root[u]) return root[u];
	return root[u] = find_root(root[u]);
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int n, q;
	long long m; cin >> n >> m >> q;
	for (int i = 0; i < q; i++) cin >> E[i].u >> E[i].v >> E[i].t, E[i].u++, E[i].v++;
	for (int i = 1; i <= n; i++) root[i] = i;
	for (int i = 0; i < q; i++) if (E[i].t == 0) {
		int a = find_root(E[i].u), b = find_root(E[i].v);
		if (a == b) continue;
		root[a] = b, m--;
	}
	int cnt = 0;
	for (int i = 0; i < q; i++) if (E[i].t == 1) {
		cnt++;
		int a = find_root(E[i].u), b = find_root(E[i].v);
		if (a == b) {
			cout << "No\n";
			return 0;
		}
	}
	int now = 0;
	for (int i = 1; i <= n; i++) now += root[i] == i;
	if ((cnt && now <= 2) || (m < now - (cnt == 0) || m > (long long)now * (now - 1) / 2)) {
		cout << "No\n";
		return 0;
	}
	cout << "Yes\n";
	return 0;
}


Measured memory_bytes: 1920
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {
	
	public static void main(String[] args) throws IOException {
		try(final Scanner sc = new Scanner(System.in)){
			final char[] chs = sc.next().toCharArray();
			
			int answer = 0;
			int length = 0;
			for(int i = 0; i < chs.length; i++) {
				switch(chs[i]) {
				case 'A':
				case 'C':
				case 'G':
				case 'T':
					length += 1;
					break;
				default:
					length = 0;
					break;
				}
				
				answer = Math.max(answer, length);
			}
			
			System.out.println(answer);
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

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

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

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

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}

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

#define MAX 10000

int main(){
  int N;
  cin >> N;
  vector<pair<int, int>> A(N);
  int tmp;
  
  for (int i = 0; i < N; i++) {
    cin >> tmp;
    A[i] = make_pair(tmp, i);
  }
  
  sort(A.begin(), A.end());
  
  for (int i = 0; i < N; i++) cout << A[i].second + 1 << " ";
  
  return 0;
}

Measured memory_bytes: 1536
import sys
input = sys.stdin.readline
f = lambda:map(int,input().split())
d,g = f()
g//=100
ll = []
for i in range(d):
  p,c = f()
  ll.append([i+1,p,c//100])
ll = ll[::-1]
import itertools as it
ans = 10**9
for t in it.product(range(2),repeat=d):
  cnt = 0
  tot = 0
  flg = 1
  lg = [1,0]
  for i,b in enumerate(t):
    u,p,c = ll[i]
    if b:
      cnt += p
      tot += u*p+c
    elif flg:
      lg = [u,p]
      flg = 0
  if g <= tot+lg[0]*lg[1]:
    ans=min(ans,cnt+max(g-tot,0)//lg[0])
print(max(1,ans))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using mii = map<int, int>;
using mll = map<ll, ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vpi = vector<pii>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpl = vector<pll>;
using vs = vector<string>;

int main()
{
    int h, a;
    cin >> h >> a;
    if(h%a == 0) cout << h/a << endl;
    else cout << h/a + 1 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
// template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b; cin >> a >> b;
    cout << (a <= b ? "unsafe" : "safe") << "\n";
    return 0;
}

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

int main()
{
    long long k,a,b,c=0;
    cin>>k>>a>>b;
    if(a>=k)
    {
        cout<<1<<endl;
        return 0;
    }else if(b>=a){
        cout<<-1<<endl;
        return 0;
    }else if((k-a)%(a-b)>=1){
        c=1;
    }
    cout<<((k-a)/(a-b)+c)*2+1<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{   int a, b, c, d;
    scanf("%d %d %d %d", &a, &b , &c, &d);
    if((a-b<=d && b-c<=d && a-b>=-d && b-c>=-d) || (a-c<=d && a-c>=-d))printf("Yes\n");
        else printf("No\n");
        return 0;
}



Measured memory_bytes: 1648
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
 
static const int N = 100;
static const int INFTY = (1<<21);

int n,M[N][N];
int d[N];

void bfs(int s)
{
    queue<int> q;
    q.push(s);
    for(int i = 0; i < n; i++){
        d[i] = INFTY;
    } 
    d[s] = 0;
    int u;
    while(!q.empty()){
        u = q.front();
        q.pop();
        for(int v = 0; v < n; v++){
            if(M[u][v] == 0){
                continue;
            }
            if(d[v] != INFTY){
                continue;
            }
            d[v] = d[u] + 1;
            q.push(v);
        }
    }
    for(int i = 0; i < n; i++){
        cout  << i + 1 << ' ' << ((d[i] == INFTY) ? (-1) : d[i]) << endl;
    }
}

int main()
{
    int u,k,v;
    cin >> n;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            M[i][j] = 0;
        }
    }
    for(int i = 0; i < n; i++){
        cin >> u >> k;
        u--;
        for(int j = 0; j < k; j++){
            cin >> v;
            v--;
            M[u][v] = 1;
        }
    }
    bfs(0);

    return 0;
}


Measured memory_bytes: 3136
n = int(input())
a = list(map(int, input().split()))
already = False
for i in range(len(a)):
    if a[i] == 0:
        print(0)
        already = True
        break
ans = 1
if not already:
    for i in range(len(a)):
        ans *= a[i]
        if ans > 1000000000000000000:
            print(-1)
            already = True
            break

if ans <= 1000000000000000000 and not already:
    print(ans)


Measured memory_bytes: 21480
#include <bits/stdc++.h>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include <string>
#define ll long long
#define ull unsigned long long
#define make(type,x) type x; cin>>x
#define make2(type,x,y) type x,y; cin>>x>>y
#define fr(x,y) for(long long x=0;x<y;x++)
#define makevec(x,y,n) vector <x> y(n); for(ll i=0;i<n;i++) cin>>y[i]
#define M (ll)1000000007
#define MM (ll) 1e8
#define INF (ll) 1e18
# define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)

using namespace std;

template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
bool sortbysec(const pair <ll,ll> &a,const pair <ll,ll> &b){
    return a.second<b.second;
}

struct cmp {
	bool operator() (const pair<int, int> &a, const pair<int, int> &b) const {
		int lena = a.second - a.first + 1;
		int lenb = b.second - b.first + 1;
		if (lena == lenb) return a.first < b.first;
		return lena > lenb;
	}
};

ll calcpow(ll x, ll y)
{
    ll temp;
    if(y == 0)
        return 1;
    temp = calcpow(x, y / 2);
    if (y % 2 == 0)
        return temp * temp;
    else
    {
        if(y > 0)
            return x * temp * temp;
        else
            return (temp * temp) / x;
    }
}
ll gcd(ll a, ll b){
    if(b==0) return a;
    return gcd(b,a%b);

}
ll egcd(ll a, ll b, ll &x,ll &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    ll x1;
    ll y1;
    ll g=egcd(b,a%b,x1,y1);
    x=y1;
    y=x1-y1*(a/b);
    return g;
}


bool isprime(ll a){
bool flag=1;
for(ll i=2;i*i<=a;i++){
    if(a%i==0) {flag=0; break;}
}
return flag;
}



int main(){
    IOS;
    makevec(ll,vec,5);
    ll ans=0;
    fr(i,5) if(vec[i]==0) ans=i;
    cout<<ans+1<<endl;


    return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
#define rep(i,a,b) for(int i=a;i<(b);++i)
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
using ll = long long;
constexpr long long INF = 1LL << 62;
constexpr int MOD = 1e9 + 7;
constexpr double EPS = 1e-10;


int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    int r;cin>>r;
    cout << 3*r*r << endl;

    return 0;
}

Measured memory_bytes: 256
n = int(input())
arr  = list(map(int,input().split()))

current_money = 1000
for i in range(n-1):
    stocks = 0
    if (arr[i] < arr[i+1]):
        stocks = current_money//arr[i]
        current_money += (arr[i+1]-arr[i])*stocks
print(current_money)

Measured memory_bytes: 9188
import java.util.*;
import java.io.*;
class Main
{
    public static void main(String args[])throws IOException
    {
        Reader in = new Reader();
        System.out.println(2 * Math.PI * in.nextDouble());
    }
}
class Reader
{
    final private int BUFFER_SIZE = 1 << 16;
    private DataInputStream din;
    private byte[] buffer;
    private int bufferPointer, bytesRead;

    public Reader()
    {
        din = new DataInputStream(System.in);
        buffer = new byte[BUFFER_SIZE];
        bufferPointer = bytesRead = 0;
    }

    public Reader(String file_name) throws IOException
    {
        din = new DataInputStream(new FileInputStream(file_name));
        buffer = new byte[BUFFER_SIZE];
        bufferPointer = bytesRead = 0;
    }

    public String readLine() throws IOException
    {
        byte[] buf = new byte[64]; // line length
        int cnt = 0, c;
        while ((c = read()) != -1)
        {
            if (c == '\n')
                break;
            buf[cnt++] = (byte) c;
        }
        return new String(buf, 0, cnt);
    }

    public int nextInt() throws IOException
    {
        int ret = 0;
        byte c = read();
        while (c <= ' ')
            c = read();
        boolean neg = (c == '-');
        if (neg)
            c = read();
        do
        {
            ret = ret * 10 + c - '0';
        }  while ((c = read()) >= '0' && c <= '9');

        if (neg)
            return -ret;
        return ret;
    }

    public long nextLong() throws IOException
    {
        long ret = 0;
        byte c = read();
        while (c <= ' ')
            c = read();
        boolean neg = (c == '-');
        if (neg)
            c = read();
        do {
            ret = ret * 10 + c - '0';
        }
        while ((c = read()) >= '0' && c <= '9');
        if (neg)
            return -ret;
        return ret;
    }

    public double nextDouble() throws IOException
    {
        double ret = 0, div = 1;
        byte c = read();
        while (c <= ' ')
            c = read();
        boolean neg = (c == '-');
        if (neg)
            c = read();

        do {
            ret = ret * 10 + c - '0';
        }
        while ((c = read()) >= '0' && c <= '9');

        if (c == '.')
        {
            while ((c = read()) >= '0' && c <= '9')
            {
                ret += (c - '0') / (div *= 10);
            }
        }

        if (neg)
            return -ret;
        return ret;
    }

    private void fillBuffer() throws IOException
    {
        bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
        if (bytesRead == -1)
            buffer[0] = -1;
    }

    private byte read() throws IOException
    {
        if (bufferPointer == bytesRead)
            fillBuffer();
        return buffer[bufferPointer++];
    }

    public void close() throws IOException
    {
        if (din == null)
            return;
        din.close();
    }
}


Measured memory_bytes: 33348
using System;
using System.Collections;
class main{
	public static void Main(){
		long sum = 0;
		long n = long.Parse(Console.ReadLine());
		string[] str = Console.ReadLine().Split(' ');
		long[] a = new long[n];
		for (long i = 0; i < n; i++)
		{
			a[i] = long.Parse(str[i]);
		}
		Array.Sort(a);
		foreach (long ai in a)
		{
			sum += ai;
		}
		Console.WriteLine("{0} {1} {2}", a[0], a[n - 1], sum);
	}
}

Measured memory_bytes: 10104
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
 
int main() {
  int N;
  int tmp;
  int sum = 1;
  cin >> N;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
      cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  tmp = vec.at(0);
  for(int i=1;i<N;i++){
      if(tmp != vec.at(i)){
          sum++;
      }
      tmp = vec.at(i);
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
int n;
char str[100005];
int main(){
	scanf("%s",str+1); n=strlen(str+1);
	if(str[n]=='1') return puts("-1"),0;
	for(int i=1;i+i<n;++i) if(str[i]!=str[n-i]) return puts("-1"),0;
	if(str[1]=='0') return puts("-1"),0;
	int now=n;
	for(int i=n-1;i>=1;--i){
		if(str[i]=='1'){
			for(int j=now-1;j>=i;--j) printf("%d %d\n",now,j);
			now=i;
		}
	}
	return 0;
}

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

using ll = long long;
#define int long long
using P = pair<int, int>;

#define LOG(variable) cerr << #variable":\t" << (variable) << "\n"
#define LOGCON(i, container) for(int (i) = 0; (i) < (container).size(); ++(i)) cerr << (i) << ":\t" << (container)[(i)] << "\n"
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, n, r) for(int i = (n); i >= (r); --i) // from n to r
#define REPOBJ(itr, obj) for(auto itr = (obj).begin(); itr != (obj).end() ; ++itr)
#define REPROBJ(itr, obj) for(auto itr = (obj).rbegin(), e = (obj).rend(); itr != e; ++itr)
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))
template<typename T = int>
T in() {T a; cin >> a; return a;}
/***** MAIN *****/
signed main() {
  int n; cin >> n;
  if(n) {
    cout << 0 << endl;
  } else {
    cout << 1 << endl;
  }
  return 0;
}
/***** MAIN *****/

Measured memory_bytes: 3620
import java.util.*;
class Main{
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int w = sc.nextInt();
        char[] c = new char[w];
        int[][] map= new int[h][w];
        int t = 0;
        for(int i = 0; i < h; i++){
            c = sc.next().toCharArray();
            t = -1;
            for(int j = 0; j < w ; j++){
                if(c[j] == 'c') t = 0;
                map[i][j] = t;
                if(t != -1) t++;
            }
        }
        for(int i = 0; i < h; i++){
            for(int j = 0; j < w; j++){
                if( j == w-1) System.out.println(map[i][j]);
                else{
                    System.out.print(map[i][j]+" ");
                }
            }
        }
    }
}

Measured memory_bytes: 35004
use std::io::Read;
use std::io::{stdout, BufWriter, Write};
use std::cmp::min;
use std::cmp::max;

fn main() {
    let mut buf = String::new();

    // stdinから全てbufに読み込む
    std::io::stdin().read_to_string(&mut buf).unwrap();

    // 読み込んだ文字列をスペースで分解する
    let mut iter = buf.split_whitespace();

    // about r
    let r: i64 = iter.next().unwrap().parse().unwrap();
    // about g
    let g: i64 = iter.next().unwrap().parse().unwrap();
    // about b
    let b: i64 = iter.next().unwrap().parse().unwrap();
    // about n
    let n: i64 = iter.next().unwrap().parse().unwrap();

    // ans
    let mut ans: i64 = 0;

    let weight_min: i64 = min(r, min(g, b));
    let loop_min: i64 = (n + 1) / weight_min + 1;
 
    let weight_max: i64 = max(r, min(g, b));
    let loop_max: i64 = (n + 1) / weight_max + 1;
 
    let weight_mid: i64 = r + g + b - weight_min - weight_max;
    let loop_mid: i64 = (n + 1) / weight_mid + 1;

    for i_min in 0..loop_min {
        for i_mid in 0..loop_mid {
            let i_max: i64 = (n - weight_min * i_min - weight_mid * i_mid) / weight_max;
            if i_max < 0 {
                continue;
            }
            let num_ball: i64 = i_min * weight_min + i_mid * weight_mid + i_max * weight_max;
            if num_ball == n {
                ans += 1;
            }
        }
    }

    // 出力
    let out = stdout();
    let mut out = BufWriter::new(out.lock());
    writeln!(out, "{}", ans).unwrap();
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int N = 1e5+10;
const int MAX = 1e5+10;
const double exps = 1e-8;

inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a > b ? b : a; }
bool pal(string s) {
    string tmp=s;
    reverse(tmp.begin(),tmp.end());
    return tmp==s;
}
int main () {
    string s;
    cin >> s;
    int n=s.size();
    if(pal(s)&&pal(s.substr(0,(n-1)/2))&&pal(s.substr((n+3)/2-1,n))) {
        cout<<"Yes";
    }else {
        cout<<"No";
    }
}

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

int main(){

  int n;

  cin>>n;

  vector<int> v(3);
  
  for(int i=0;i<n;++i){
    cin>>v[0]>>v[1]>>v[2];  
    
    sort(v.begin(),v.end());
    if(v[0]*v[0]+v[1]*v[1]==v[2]*v[2])
      cout<<"YES"<<endl;
    else
      cout<<"NO"<<endl;
  }	

}



Measured memory_bytes: 3120
#include<iostream>
#include<iomanip>
#include<string>
#include<queue>
#include<vector>
#include<cmath>
#define ll long long
using namespace std;
int main(){
  ll l,r,result;
  cin>>l>>r;
  r=min(r,l+673);

  result=1000000000;
  for(ll i=l;i<r;i++){
    for(ll j=i+1;j<=r;j++){
    result=min(result,(i*j)%2019);
    }
  }
  cout<<result;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi vector<vector<int> >
#define vvl vector<vector<ll> >
#define vll vector<ll>
#define rep(c, a, b) for(ll c=a;c<b;c++)
#define re(c, b) for(ll c=0;c<b;c++)
typedef long long int ll;
typedef long double ld;
using namespace std;

//-------------------------------------------------------------------
#define P 1000000007
#define N_MAX 2000000
typedef long long int ll;
ll fac[N_MAX+1];
ll inv[N_MAX+1];
ll finv[N_MAX+1];

ll comb(ll n, ll k){
    return (((fac[n]*finv[n-k])%P)*finv[k])%P;
}

void init(){
    fac[0] = finv[0] = fac[1] = finv[1] = inv[1] = 1;
    for(int i = 2; i <= N_MAX; i++){
        fac[i] = (fac[i-1]*i)%P;
        inv[i] = ((-(P/i)*inv[P%i])%P+P)%P;
        finv[i] = (finv[i-1]*inv[i])%P;
    }
}
ll pp(ll a, ll b){
  return (a * b)%P;
}
//-------------------------------------------------------------------
vvl G = vv(200001, 0, 0, ll);
vll chi(200001, 0);
vll r(200001, 1), ir(200001, 1);
ll n, ans = 0;
ll dfs(ll now, ll from){
  ll ret = 1;
  vll tmp;
  for(int i=0;i<G[now].size();i++){
    if(G[now][i] == from) continue;
    ll s = dfs(G[now][i], now);
    ret += s;
    tmp.push_back(s);
  }
  tmp.push_back(n-ret);
  ll ad = (r[n-1] - 1 + P)%P;
  if(tmp.size()==1) ad = 0;
  else {
    for(int i=0;i<tmp.size();i++){
      ad = (ad - (r[tmp[i]]-1+P)%P + P)%P;
    }
  }
  ans = (ans + ad)%P;
  chi[now] = ret;
  return ret;
}
int main(int argc, char const *argv[]) {
  ll a, b;std::cin >> n;
  init();
  rep(i, 1, 200001) r[i] = pp(r[i-1], 2), ir[i] = pp(ir[i-1], inv[2]);
  re(i, n-1){
    std::cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(1, -1);
  std::cout << pp(ans, ir[n]) << '\n';
  return 0;
}


Measured memory_bytes: 76672
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

const char nl = '\n';

void solve()
{
    int a; cin >> a;
    cout << a + a * a + a * a * a <<  nl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    solve();
    return 0;
}

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

using namespace std;

using ll = long long;

struct Point {
   int x, y;
   Point(int x = 0, int y = 0) :
      x(x), y(y) {}
   bool operator < (const Point &p) const {
      return x < p.x || (x == p.x && y < p.y);
   }
   Point operator + (const Point &p) const {
      return Point(x + p.x, y + p.y);
   }
   Point operator - (const Point &p) const {
      return Point(x - p.x, y - p.y);
   }
   ll operator * (const Point &p) const {
      return (ll) x * p.y - (ll) y * p.x;
   }
   ll norm() {
      return (ll) x * x + (ll) y * y;
   }
};

vector<Point> minkowski(vector<vector<Point>> pss) {
   vector<Point> ans(1, Point());
   vector<Point> go;
   int cnt = 0;
   for (auto &ps : pss) {
      rotate(ps.begin(), min_element(ps.begin(), ps.end()), ps.end());
      ans[0] = ans[0] + ps[0];
      int sz = ps.size();
      go.emplace_back(ps[1] - ps[0]);
   }
   sort(go.begin(), go.end(), [&](Point p, Point q) {
      bool fp = p < Point();
      bool fq = q < Point();
      if (fp ^ fq) {
            assert(false);
         return fq;
      } else {
         return p * q > 0;
      }
   });
   for (auto p : go) {
      ans.emplace_back(ans.back() + p);
   }
   for (auto p : go) {
      ans.emplace_back(ans.back() - p);
   }
   return ans;
}

int main() {
   ios_base::sync_with_stdio(false);
   int n;
   cin >> n;
   vector<vector<Point>> pss;
   while (n--) {
      int x, y;
      cin >> x >> y;
      if (!x && !y) continue;
      pss.emplace_back(vector<Point> {{0, 0}, {x, y}});
   }
   vector<Point> ps = minkowski(pss);
   ll ans = 0;
   for (auto p : ps) {
      // cerr << p.x << " " << p.y << "\n";
      ans = max(ans, p.norm());
   }
   cout << fixed << setprecision(10) << sqrt(ans) << "\n";
}


Measured memory_bytes: 256
a, b, c, d, e, f = map(int, input().split())
a *= 100
b *= 100

# 最初に水の入れ方の組み合わせを考える
water = []
for i in range(f//a+1):
    for j in range(f//b+1):
        if a*i + b*j <= f and not (i == 0 and j == 0):
            water.append(a*i + b*j)
water = list(set(water))
            
# 各組み合わせに対して砂糖を入れられる最大量
sugar = []
for w in water:
    sugar.append(min(f - w, (w//100)*e))
    
# 全探索
ans = [water[0], 0]
max_conc = 0
for w, s in zip(water, sugar):
    for i in range(s//c+1):  # 砂糖をc*i(g)入れる
        j = (s - c*i)//d  # d(g)入れられるだけ入れる
        cap = (c*i+d*j)  # 砂糖の量
        if (cap / (w + cap))*100 > max_conc:
            max_conc = (cap / (w + cap))*100
            ans = [w+cap, cap]
            
print(*ans)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <math.h>
#include <sstream>
#include <iomanip>
#include <time.h>
#include <fstream>
#include <map>

using namespace std;

int main(){
	string s;
	cin>>s;
	int len = s.length();
	if (s[0] != 'A'){
		cout<<"WA"<<endl;
		return 0;
	}
	int occ = 0;
	for(int i = 2; i <len - 1; i++){
		if (s[i] =='C') occ++;
	}
	if (occ != 1){
		cout<<"WA"<<endl;
		return 0;
	}
	if (s[len - 1] == 'C'){
		cout<<"WA"<<endl;
		return 0;
	}

	int caps = 0;
	for (int i = 0; i < len; i++){
		if ((s[i] >= 65) && (s[i] <= 90 )) caps++;
	}
	if (caps != 2){
		cout<<"WA"<<endl;
		return 0;
	}
	cout<<"AC"<<endl;
	return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
def main():
    T = list(input().rstrip())
    CNT = 0
    for i in range(len(T)):
        if T[i] == '?':
            if T[i-1] == 'P':
                T[i] = 'D'
                CNT += 2
            else:
                T[i] = 'D'
                CNT += 1
        elif T[i] == 'D':
            CNT += 1
    print(''.join(T))

if __name__ == '__main__':
    main()

Measured memory_bytes: 10800
#include<bits/stdc++.h>
using namespace std;
int main(){
  vector<int> a;
  int n,b,p;
  cin>>p;
  for(int i=0;i<p;i++){
    cin>>n;
    if(n==0){
      cin>>b;
      a.push_back(b);
    }
    if(n==1){
      cin>>b;
      cout<<a[b]<<endl;
    }
    if(n==2){
      a.pop_back();
    }
  }
 
  return 0;
}
  



Measured memory_bytes: 3836
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

typedef long long ll;

int main() {
    int a, b, c;
    ll k;
    cin >> a >> b >> c >> k;
    if (k % 2 == 0) cout << a - b << endl;
    else cout << b - a << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[n];
        for(int i=0;i<n;i++){
            a[i] = sc.nextInt();
        }
        int count = 0;
        for(int i=0;i<n;i++){
            int min = i;
            for(int j=i;j<n;j++){
                if(a[j]<a[min]){
                    min = j;
                }
            }
            if(i != min){
                int temp = a[i];
                a[i] = a[min];
                a[min] = temp;
                count++;
            }
        }
        System.out.print(a[0]);
        for(int i=1;i<n;i++){
            System.out.printf(" %d",a[i]);
        }
        System.out.println();
        System.out.println(count);
    }
}


Measured memory_bytes: 26424
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=(b-1);i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define INF 1000000007

int main() {
  string s;
  cin>>s;
  if(s[s.sz-1]=='0'){
    s+="1";
  }
  else{
    s+="0";
  }
  vector<ll> v;
  ll c = -1;
  rep(i,0,s.sz){
    c++;
    if(i>0){
      if(s[i]!=s[i-1]){
        v.pb(c);
        c=0;
      }
    }
  }
  ll sum = 0;
  rep(i,0,v.sz){
    sum += v[i];
  }
  if(v.sz==1){
    cout << v[0] << endl;
  }
  else if(v.sz==2){
    cout << max(v[0],v[1]) << endl;
  }
  else{
    ll mx = 0;
    ll mn = 1000000000;
    ll a1 = 0;
    ll b1 = sum;
    rep(i,0,v.sz){
      if(mn>abs(b1-a1)){
        mn = abs(b1-a1);
      }
      a1+=v[i];
      b1-=v[i];
    }
    a1 = 0;
    b1 = sum;
    rep(i,0,v.sz){
      if(mn==abs(b1-a1)){
        mx = max(mx,max(a1,b1));
      }
      a1+=v[i];
      b1-=v[i];
    }
    cout << mx << endl;
  }
  return 0;
}

Measured memory_bytes: 1020
#include <bits/stdc++.h>
#include <cstring>
#include <limits>
using namespace std;
#define ll long long int
#define X first
#define Y second
#define fw(i, start, end) for (ll i = start; i < end; ++i)
#define fe(i, start, end) for (ll i = start; i <= end; ++i)
#define L(T)  \
    ll T;     \
    cin >> T; \
    while (T--)
#define FASTIO                   \
    ios::sync_with_stdio(false); \
    cin.tie(nullptr);            \
    cout.tie(nullptr);
#define endl "\n"

ll dp[420][420];
ll n;
ll a[420];
ll s[420];
ll summa(ll i, ll j)
{
    return s[j] - s[i - 1];
}
ll solve(ll i, ll j)
{
    if (dp[i][j] != -1)
        return dp[i][j];
    dp[i][j] = LONG_LONG_MAX;
    if (i == j)
        return dp[i][j] = 0;
    if (j - i == 1)
        return dp[i][j] = a[i] + a[j];
    // fe(L, 1, j)
    // {
    //     fe(R, L, j)
    //     {
    //         dp[L][R] = min(dp[L][R], solve(L, R - 1) + solve(L - 1, R));
    //     }
    // }
    fw(L, i, j)
    {
        dp[i][j] = min(dp[i][j], solve(i, L) + solve(L + 1, j) + summa(i, j));
    }
    return dp[i][j];
}
int main()
{
    FASTIO
    // L(T)
    {
        cin >> n;
        memset(s, 0, sizeof s);
        fw(i, 1, n + 1)

        {
            cin >> a[i];
            // s[i] += a[i];
        }
        fw(i, 1, n + 1)
            s[i] = s[i - 1] + a[i];
        memset(dp, -1, sizeof dp);
        solve(1, n);
        cout << dp[1][n] << endl;
    }
    return 0;
}

Measured memory_bytes: 1664
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
typedef vector<int> vi;
typedef vector<ll> vl;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define IN cin >> 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (m-1); i >= (int)(n); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.end(), v.begin());
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - a) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}

//ll ncr[100][100];
//ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

//ll npr[100][100]={};
//ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

//ll nHr(int n,int r){ret nCr(n+r-1,r);}

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


int main(){
    ll a,b,k;
    IN a >> b >> k;

    set<ll> s;
    rep(i,a,a+k){
        if(b < i )break;
        s.it(i);
    }
    rrep(i,b+1,b-k+1){
        if(i < a)break;
        s.it(i);
    }

    for(auto i : s)P(i);

	return  0;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
#![allow(unused_macros)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;


//
// Macro debug!
//

#[cfg(debug_assertions)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($($arg:expr),*) => {};
}


//
// Macro input!
//

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}


//
// IteratorExt
//

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}


//
// Main
//

fn main() {
    input! {
        s: chars,
    }

    let c = s[0];
    let ans = (c as u8 + 1) as char;
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

// 間に2個空きがある → skip++;
// 間に3個空きがある → skip += 2;
// Nが偶数なら skip=1 まで許可、奇数ならskip=2まで許可

struct dpdata{
	ll x01;   // a[i] を選んだ
	ll x11;   // a[i] を選んだ skip1
	ll x21;   // a[i] を選んだ skip2

	ll x00;   // a[i] を選んでない
	ll x10;   // a[i] を選んでない skip1
	ll x20;   // a[i] を選んでない skip2
};

dpdata dp[200005];

int main(){
	ll n;
	cin >> n;
	
	vector<ll> a(n);
	for ( int i = 0; i < n; i++ )
		cin >> a[i];
	
	
	dp[0] = { a[0], 0, 0, 0, 0, 0 };
	
	for ( int i = 1; i < n; i++ ){
		dpdata &d = dp[i-1];
		
		dp[i] = {
			     d.x00 + a[i],
			     d.x10 + a[i],
			     d.x20 + a[i],
			     
			     d.x01, 
			max( d.x11, d.x00 ),
			max( d.x21, d.x10 )
		};
	}
	
	{
		dpdata &d = dp[n-1];
		if ( n % 2 == 0 ){
			cout << max({d.x00, d.x01, d.x11}) << endl;
		}
		else {
			cout << max({d.x00, d.x10, d.x21, d.x11}) << endl;
		}
	}
	
	return 0;
}




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

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int priceRange = Integer.valueOf(in.readLine()); // n
		int minv = Integer.valueOf(in.readLine()); // 最小値
	    int tmp = 0; // 退避用
	    int maxv = 0; // 最大利益（価格の差）
		for (int i = 1; i <= priceRange -1 ; i++) {

			tmp = Integer.valueOf(in.readLine());
			if (i == 1) { // 初回を、最大利益の初期値とする
			maxv = tmp -minv;
			}
			if (maxv < (tmp -minv)) { // 最大利益の更新
				maxv = tmp -minv;
			}
			if (minv > tmp) { // 最小値の更新
				minv = tmp;
			}
		}
        System.out.println(maxv);
	}

}



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

#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define read()          freopen("in.txt","r",stdin)
#define write()         freopen("out.txt","w",stdout)
#define sf(n)           scanf("%d",&n)
#define sfd(n)          scanf("%lf",&n)
#define sl(x)           scanf("%I64d",&x)
#define sfl(n)          scanf("%lld", &n)
#define sfc(n)          scanf(" %c",&n)
#define sful(n)         scanf("%llu",&n)
#define ull             unsigned long long
#define endll           pf("\n")
#define pf              printf
#define PI              acos(-1.0)
#define eps             1e-12
#define mem(a,b)        memset(a,b,sizeof(a))
#define pb              push_back
#define xx              first
#define yy              second
#define pii             pair<int, int>
#define pll             pair<ll, ll>
#define MP make_pair
#define ll              long long
#define uniq(a)      a.erase(unique(a.begin(), a.end()), a.end())
#define cnd tree[idx]
#define lnd tree[idx<<1]
#define rnd tree[(idx<<1)+1]
#define lndp (idx<<1),(b),((b+e)>>1)
#define rndp ((idx<<1)+1),(((b+e)>>1)+1),(e)
#define inf 1999999999
#define MX 100005
#define MOD  1000000000
#define mod1 1000000009
#define var    int i,j,c=0,t,l,r,mid,z=0,k,x,y

//int dx[8]={0,0,1,1,-1,-1,1,-1};  //8 direction
//int dy[8]={1,-1,1,-1,1,-1,0,0};
//int dx[4]={1,-1,0,0};  //4 direction
//int dy[4]={0,0,1,-1};
ll n,m,a[200005];

int main()
{
    ll var;
    sfl(n);sfl(m);
    for(i=0;i<m;i++)
    {
        sfl(x);
        n-=x;
    }
    if(n<0)n=-1;
    cout<<n<<endl;
}


Measured memory_bytes: 3664
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int W = sc.nextInt();
      	
		if(W%2==0){
        System.out.println(W/2);}
      	else if(W%2==1){
        System.out.println(W/2+1);}
	}
}


Measured memory_bytes: 35752
import Control.Monad

readIntLine :: IO ([Int])
readIntLine = do
    x <- getLine
    return $ map (read :: String -> Int) $ words x

main :: IO ()
main = do
    [a,b] <- readIntLine
    print $ solve a b

solve a b
    | a < 6  = 0
    | a < 13 = div b 2
    | otherwise = b


Measured memory_bytes: 508