akhauriyash/Code-Regression huggingface dataset:
import java.awt.Robot;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

import static java.util.Comparator.*;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        Solver solver = new Solver(System.in, out);
        solver.solve();
        out.close();
    }
}
class Solver {
	Scanner sc;
	PrintWriter out;
    public Solver(InputStream in, PrintWriter out) {
    	sc = new Scanner(in);
    	this.out = out;
    }
    // ======================================================================
    // 最大公約数の取得			
    long gcd(long a, long b) {			
    	if (b == 0)	return a;	
    	return gcd(b, a % b);		
    }			
    public void solve() {
    	int N = ni();
    	long a, ans = nl();
    	for (int i = 1; i < N; i++) {
			a = nl();
			ans = gcd(ans, a);
		}
    	out.println(ans);
    }
    // ------------------------------------------
    // 入力
    // ------------------------------------------
    public int ni() {
    	return sc.nextInt();
    }
    public long nl() {
    	return sc.nextLong();
    }
    public String ns() {
    	return sc.next();
    }
    public char[] nc() {
    	return sc.next().toCharArray();
    }
    public int[] ndi(int N) {
    	int[] ans = new int[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = ni();
		}
    	return ans;
    }
    public long[] ndl(int N) {
    	long[] ans = new long[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = nl();
		}
    	return ans;
    }
    public String[] nds(int N) {
    	String[] ans = new String[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = ns();
		}
    	return ans;
    }
    public char[][] ndc(int N) {
    	char[][] ans = new char[N][];
    	for (int i = 0; i < N; i++) {
			ans[i] = nc();
		}
    	return ans;
    }
    public int[][] nddi(int N, int S) {
    	int[][] ans = new int[N][S];
    	for (int i = 0; i < N; i++) {
			for (int j = 0; j < S; j++) {
				ans[i][j] = ni();
			}
		}
    	return ans;
    }
}


Measured memory_bytes: 46968
#include <bits/stdc++.h>
#define ll long long
#define PI 3.14159265358979323846
using namespace std;
int main()
{
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
   /// https://ideone.com/Fd5s8n

   ll x;
   cin>>x;
   ll a[4000];
   a[0]=100;
   for(int i=1;i<=4000;i++){
    a[i]=a[i-1]+a[i-1]/100;
    if(a[i]>=x){
        cout << i << endl;
        return 0;
    }
   }
    return 0;

}


Measured memory_bytes: 3612
#include<cmath>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
typedef long long ll;

int main()
{
	ll n;
	cin>>n;
	ll ans=0;
	for(int i=1;i<=n;i++){
		if(i%3!=0&&i%5!=0){
			ans+=i;
		}
	}
	cout<<ans<<endl;
 	return 0;
}


Measured memory_bytes: 3636
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<vector>
using namespace std;

const int maxn=1e5+10;
int n,k,a[maxn],ans;
vector<int> g[maxn];

int dfs(int pos,bool flag){
	int dep=1;
	for(int i=0;i<g[pos].size();++i)
		dep=max(dep,dfs(g[pos][i],true)+1);
	if(flag&&dep>=k){
		++ans;
		return 0;
	}
	return dep;
}

int main(){
	ios::sync_with_stdio(false);
	cin>>n>>k;
	for(int i=1;i<=n;++i)
		cin>>a[i];
	if(a[1]!=1)
		++ans;
	for(int i=2;i<=n;++i)
		g[a[i]].push_back(i);
	for(int i=0;i<g[1].size();++i)
		dfs(g[1][i],false);
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 10880
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  string s;
  cin >> s;
  map<char, bool> m;
  for (int i = 0; i < s.size(); i++) {
    m[s[i]] = true;
  }
  if ((m['N'] && !m['S']) || (m['S'] && !m['N']) || (m['E'] && !m['W']) ||
      (m['W'] && !m['E'])) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}

Measured memory_bytes: 3572
#include <stdio.h>
int yoko,tate;
int x,y;

main(){
while(1){
	
  scanf("%d%d",&tate,&yoko);
  for(x=1;tate>=x;x++){
   for(y=1;yoko>=y;y++){
   if((y>1&&y<yoko)&&(x>1&&x<tate)){printf(".");}
   else{printf("#");}
   if(yoko==y){printf("\n");}
   if(yoko==y&&tate==x){printf("\n");}
   }
  }
  if(yoko==0&&tate==0){
  return 0;}
}  
}  
  

Measured memory_bytes: 572
import math
A,B = map(int,input().split())
ans = []
for i in range(1,1300):
    if math.floor(i * 0.08) == A and math.floor(i * 0.10) == B:
        ans.append(i)
if ans == []:
    print(-1)
else:
    print(min(ans))


Measured memory_bytes: 3060
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdlib>
#include<iomanip>
#include<iostream>
#include<numeric>
#include<string>
using namespace std;

long gcd(long x, long y) { if (x > y) { return gcd(y, x); } long r; while (y != 0) { r = x % y; x = y; y = r; }return x; }
long lcm(long x, long y) { return(x / gcd(x, y)) * y; }
void indexsort(long* first, long* last, long* func) { sort(first, last, [&](long a, long b) {return func[a] < func[b]; }); }
//--------------------

int main() {

	string res = "NO";
	long n; cin >> n;

	if (n == 7 || n == 3 || n == 5) res = "YES";

	cout << res << endl;

}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
#define MAX 2000000

int H, A[MAX + 1];

void maxHeapify(int i)
{
    int l, r, largest;
    l = 2 * i;
    r = 2 * i + 1;

    if (l <= H && A[l] > A[i])
        largest = l;
    else
        largest = i;
    if (r <= H && A[r] > A[largest])
        largest = r;

    if (largest != i)
    {
        swap(A[i], A[largest]);
        maxHeapify(largest);
    }
}

int main()
{
    cin >> H;
    for (int i = 1; i <= H; i++)
        cin >> A[i];

    for (int i = H / 2; i >= 1; i--)
        maxHeapify(i);

    for (int i = 1; i <= H; i++)
    {
        cout << " " << A[i];
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 5044
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
  int n,i,b[110],ans;
  cin >> n;
  for (i=0;i<n-1;i++) cin >> b[i];
  ans=b[0]+b[n-2];
  for (i=1;i<n-1;i++) ans+=min(b[i-1],b[i]);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

d = {}
for i, s in zip(range(1, N + 1), A):
    d[i] = s
d_sorted = sorted(d.items(), key=lambda x: x[1])

for i in range(N):
    print(d_sorted[i][0], end=" ")

Measured memory_bytes: 26296
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

typedef long long unsigned int ll;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

using namespace std;

int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	
	for (int i = 0; i < s.length(); i++) {
		int tmp = s[i] + n;
		if (tmp > 90) {
			tmp -= 91;
			s[i] = 'A' + tmp;
		}
		else {
			s[i] = tmp;
		}
	}
	cout << s << endl;
}



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

// Optimization
//#pragma GCC optimize("O3")
#define endl '\n'

// Shortcut

#define int long long
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#define For(i, l, r) for (int i = l; i < r; i++)
#define ForE(i, l, r) for (int i = l; i <= r; i++)
#define Ford(i, r, l) for (int i = r; i > l; i--)
#define FordE(i, r, l) for (int i = r; i >= l; i--)
#define Fora(i, a) for (auto i : a)

// I/O & Debug

#define PrintV(a) for (int iiii = 0; iiii < a.size(); iiii++) cout << a[iiii] << ' ';
#define PrintVl(a) for (int iiii = 0; iiii < a.size(); iiii++) cout << a[iiii] << endl;
#define PrintA(a, n) for (int iiii = 0; iiii < n; iiii++) cout << a[iiii] << ' ';
#define PrintAl(a, n) for (int iiii = 0; iiii < n; iiii++) cout << a[iiii] << endl;
#define Ptest(x) return cout << x, 0;
#define gl(s) getline(cin, s);
#define setpre(x) fixed << setprecision(x)
/*
#define debug(args...){ string _sDEB = #args; replace(_sDEB.begin(), _sDEB.end(), ',', ' '); stringstream _ssDEB(_sDEB); istream_iterator<string> _itDEB(_ssDEB); DEB(_itDEB, args); }
void DEB(istream_iterator<string> it) {}
template<typename T, typename... Args>
void DEB(istream_iterator<string> it, T a, Args... args){
    cout << *it << " = " << a << endl;
    DEB(++it, args...);
}
*/

// Functions

//#define isvowel(a) (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define bend(a) a.begin(), a.end()
#define rbend(a) a.rbegin(), a.rend()
#define mset(a) memset(a, 0, sizeof(a))
#define m1set(a) memset(a, 1, sizeof(a))
#define mn1set(a) memset(a, -1, sizeof(a))
#define mmset(a) memset(a, 0x3f, sizeof(a))
#define gcd __gcd
#define __builtin_popcount __builtin_popcountll
//mt19937 rando(chrono::steady_clock::now().time_since_epoch().count());

// Data Structure

#define pque priority_queue
#define mts multiset
#define y0 _y0_
#define y1 _y1_
#define div divi
typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <ld> vld;
typedef vector <string> vs;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <vi > vvi;
typedef vector <vll > vvll;
typedef vector <pii > vpii;
typedef vector <pll > vpll;

const int N = 3e5 + 5, mod = 1e9 + 7, mod1 = 998242353, mod2 = 1e9 + 9;
const ll inf = 1e18 + 7;

int n;
int a[N];
int ans;

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> n;
    ForE(i, 1, n){
        cin >> a[i];
    }
    int t = 0;
    ForE(i, 2, n){
        if (a[i] > a[i - 1]){
            ans = max(ans, t);
            t = 0;
        }
        else{
            t++;
        }
    }
    cout << max(ans, t);
}

/*
==================================+
INPUT:                            |
------------------------------    |

------------------------------    |
==================================+
OUTPUT:                           |
------------------------------    |

------------------------------    |
==================================+
*/

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

using namespace std;

typedef long long int lli;

void solve(int pos,lli cp,const vector< vector<int> > &edges,const vector<lli> &w, vector<lli> &ans) {
    if (ans[pos] != -1) { return; }
    cp = w[pos] + cp;
    ans[pos] = cp;
    for (int i = 0; i < edges[pos].size(); i++) {
        int np = edges[pos][i];
        solve(np, cp, edges, w, ans);
    }
}

int main() {
    lli n,q; cin >> n >> q;
    vector< vector<int> > edges(n, vector<int>(0));
    for (int i = 0; i < n - 1; i++) {
        int a, b;
        cin >> a >> b; a--; b--;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }
    vector<lli> w(n, 0);
    for (int i = 0; i < q; i++) {
        int p, x;
        cin >> p >> x; p--;
        w[p]+=x;
    }
    vector<lli> ans(n, -1);
    solve(0, 0, edges, w, ans);
    for (int i = 0; i < n; i++) {
        if (i != 0) cout << " ";
        cout << ans[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 28928
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int main()
{
    string s, ans = "";
    cin >> s;
    for(int i = 0; i < s.size(); i++)
    {
        if(s[i] == '0')
            ans += "0";
        if(s[i] == '1')
            ans += "1";
        if(ans.size() && s[i] == 'B')
            ans = ans.substr(0, ans.size() - 1);
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int K = sc.nextInt();
    TreeSet<String> words = new TreeSet<String>();
    for (int i = 0; i < s.length(); i++) {
      for (int j = 1; i + j <= s.length() && j <= K; j++) {
        words.add(s.substring(i, i + j));
      }
    }
    String[] ans = new String[words.size()];
    int i = 0;
    for (String word : words) {
      ans[i] = word;
       i++;
    }
    System.out.println(ans[K - 1]);
  }
}

Measured memory_bytes: 24532
N,T=map(int,input().split())
c_list=[]
cnt=0
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        c_list.append(c)
        cnt+=1
if cnt == 0:
    print('TLE')
else:
    print(min(c_list))

Measured memory_bytes: 3060
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


S = I()
mod = 10**9+7
ANS = [1,0,0]
for _ in range(S):
    ANS.append((ANS[-1]+ANS[-3]) % mod)

print(ANS[S])


Measured memory_bytes: 63812
using System;
class Program
{
    static void Main()
    {
        string[] s = Console.ReadLine().Split(' ');
        int a = int.Parse(s[0]);
        int b = int.Parse(s[1]);
        if(a == b)
            Console.WriteLine("a == b");
        else if(a>b)
            Console.WriteLine("a > b");
        else if(a<b)
            Console.WriteLine("a < b");
    }
}

Measured memory_bytes: 8844
// May this submission get accepted
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define DSRNG(i,is,ie) for (long long i=(is), i##_end=(ie); i>=i##_end; i--)
#define STEP(i, is, ie, step) for (long long i=(is), i##_end=(ie), i##_step = (step); i<=i##_end; i+=i##_step)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
template<class T> bool chmax(T &a, const T &b) { if (a < b) {a = b; return true;} return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) {a = b; return true;} return false; }
#define INF 0x7FFFFFFF
#define LINF 0x7FFFFFFFFFFFFFFFLL
#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")
#define DUMP(q) cerr << "[DEBUG] " #q ": " << (q) << " at " __FILE__ ":" << __LINE__ << endl
#define DUMPALL(q) do { cerr << "[DEBUG] " #q ": ["; REP(DUMPALL_ITR, (q).size()) { cerr << (q)[DUMPALL_ITR] << (DUMPALL_ITR == DUMPALL_ITR_len-1 ? "" : ", "); } cerr << "] at " __FILE__ ":" << __LINE__ << endl; } while (false)
template<class T> T gcd(T a, T b) { if (a < b) std::swap(a, b); while (b) std::swap(a %= b, b); return a; }
template<class T> T lcm(const T a, const T b) { return a / gcd(a, b) * b; }

// gcc拡張マクロ
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

// エイリアス
#define DANCE_ long
#define ROBOT_ unsigned
#define HUMAN_ signed
using  ll = DANCE_ HUMAN_ DANCE_;
using ull = DANCE_ ROBOT_ DANCE_;
using  ld = long double;
using namespace std;

// 標準入出力
struct inp {
    size_t sz;
    inp(size_t _sz = 1) : sz(_sz) {}
    template <typename T> operator T () const { T a; cin >> a; return a; }
    template <typename T> operator vector<T> () const { vector<T> a(sz); for (size_t i = 0; i < sz; i++) cin >> a[i]; return a; }
    template <typename T, typename U> operator pair<T, U> () const { T f; U s; cin >> f >> s; return pair<T, U>(f, s); }
};
inp inp1; // input one
template <typename T> void say(T &x, char end = '\n') { cout << x << end; }
template <typename T> void say(vector<T> &x, char sep = ' ', char end = '\n') { for (size_t i = 0, sz = x.size(); i < sz; i++) { cout << x[i] << (i == sz-1 ? end : sep); } }

// モジュール


// 処理内容
int main() {
    
    ios::sync_with_stdio(false); // stdioを使うときはコメントアウトすること
    cin.tie(nullptr);            // インタラクティブ問題ではコメントアウトすること
    
    ll k = inp1, x = inp1;

    cout << Yes(k * 500 >= x) << endl;
    
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
using namespace std;
 
int main(){
 	long int N,M,n,A(0),W(0);
  	string CA;
    cin >> N >> M;
  	vector<vector<int> > p(N,vector<int>(2,0));
  	for(int i = 0 ; i < M ; i ++){
     	cin >> n >> CA;
      	if(CA == "AC") p[n - 1][1] = -1;
      	if(CA == "WA" && p[n - 1][1] != -1) p[n - 1][0] ++;
    }
  	for(int i = 0 ; i < N ; i ++){
     	if(p[i][1] == -1){
         	A ++;
          	W += p[i][0];
        }
    }
  	cout << A << " " << W << endl;
}

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

#define whole(f, x, ...)                                 \
  ([&](decltype((x)) whole) {                            \
    return (f)(begin(whole), end(whole), ##__VA_ARGS__); \
  })(x)

using namespace std;
using ll = long long;

const int mod = 1e9 + 7;

template <int mod>
struct ModInt {
  int x;

  ModInt() : x(0) {}

  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

  ModInt &operator+=(const ModInt &p) {
    if ((x += p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &p) {
    if ((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &p) {
    x = (int)(1LL * x * p.x % mod);
    return *this;
  }

  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }

  ModInt operator-() const { return ModInt(-x); }

  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

  bool operator==(const ModInt &p) const { return x == p.x; }

  bool operator!=(const ModInt &p) const { return x != p.x; }

  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while (b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }

  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while (n > 0) {
      if (n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }

  friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }

  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt<mod>(t);
    return (is);
  }

  static int get_mod() { return mod; }
};

using modint = ModInt<mod>;

void solve() {
  ll n;
  int a, b;
  cin >> n >> a >> b;

  modint ans = modint(2).pow(n) - 1;

  auto f = [=](int t) {
    modint tmp(1);
    for (int i = 1; i <= t; i++) {
      tmp *= i;
    }
    tmp = tmp.pow(mod - 2);
    for (ll i = n - t + 1; i <= n; i++) {
      tmp *= i;
    }
    return tmp;
  };

  ans = ans - f(a) - f(b);

  cout << ans << endl;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);

  solve();
  return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String alphabet = "abcdefghijklmnopqrstuvwxyz";
		String input = sc.next();
		ArrayList<Character> list = new ArrayList<>();
		boolean[] flag = new boolean[alphabet.length()];

		for(int i = 0; i < flag.length; i++) {
			flag[i] = true;
		}

		for(int i = 0; i < alphabet.length(); i++) {
			list.add(alphabet.charAt(i));
		}

		for(int i = 0; i < input.length(); i++) {
			for(int j = 0; j < list.size(); j++) {
				if(list.get(j).equals(input.charAt(i))) {
					flag[j] = false;
					break;
				}
			}
		}

		boolean all = true;

		for(int i = 0; i < flag.length; i++) {
			if(flag[i]) {
				System.out.println(list.get(i));
				all = false;
				break;
			}
		}

		if(all) {
			System.out.println("None");
		}


	}
}

Measured memory_bytes: 23176
#include <iostream>

using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	if (a < b)
	{
		cout << "a < b" << endl;
	}
	else if (a > b)
	{
		cout << "a > b" << endl;
	}
	else
	{
		cout << "a == b" << endl;
	}

	return 0;
}




Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<map>
#include<cstring>
#include<iomanip> //cout << fixed << setprecision(15) << x << endl;

using namespace std;
typedef long long ll;
const int INF = 1e9 + 6;
const int MOD = 1e9 + 7;
const ll LLINF = 1LL<<60;
#define P pair<int, int>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()

int main() {
    int N; cin >> N;
    int A[N]; rep(i, N) cin >> A[i];
    deque<int> ans;
    ans.push_front(A[0]);
    rep(i, N - 1) {
        int key = (lower_bound(all(ans), A[i + 1]) - ans.begin()) - 1;
        if(key == -1) {
            ans.push_front(A[i + 1]);
        }else {
            ans[key] = A[i + 1];
        }
    }
    cout << ans.size() << endl;
}


Measured memory_bytes: 1024
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,b;
    cin >> a;
    cin >> b;
    if(a<b){
        cout << "a < b" <<endl;
    }
    else if(a>b){
        cout << "a > b" <<endl;
    }
    else{
        cout << "a == b" << endl;
    }
}



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

int main() {
    string a,b,c;
    cin >> a >> b >> c;
    char x = a[0],y = b[0],z = c[0];
    x = 'A'+(x-'a');
    y = 'A'+(y-'a');
    z = 'A'+(z-'a');
    printf("%c%c%c",x,y,z);
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef long double ld;
 
using namespace std;

void solve(int M){
    int a[M+1][M*(M+1)/2] = {0};
    for(int i=0; i<M*(M+1)/2; i++){
        for(int j=0; j<M+1; j++)    a[j][i] = 0;
    }
    int j, l;
    j = 0;
    l = 0;
    while(l < M*(M+1)/2){
        for(int i=l; i<l+M-j; i++){
            a[j][i] = 1;
        }
        l += (M-j);
        for(int k=j+1; k<=M; k++){
            a[k][l+k-M-1] = 1;
        }
        j++;
    }
    for(int i=0; i<M+1; i++){
        cout << M << " ";
        for(int k=0; k<M*(M+1)/2; k++){
            if(a[i][k] == 1)    cout << k+1 << " ";
        }
        cout << endl;
    }
}

int main(){
    int N;  cin >> N;
    int M = int(sqrt(2*N));
    if(M*(M+1) != 2*N)  cout << "No";
    else{
        cout << "Yes" << endl;
        cout << M+1 << endl;
        solve(M);
    }
}

Measured memory_bytes: 177588
#include<stdio.h>

int main(void){

  int a,b;
  char op;


  while(1){
    scanf("%d %c %d", &a, &op, &b);
    if(op=='+')
      printf("%d\n", a + b);
    else if(op=='-')
      printf("%d\n", a - b);
    else if(op=='*')
      printf("%d\n", a * b);
    else if(op=='/')
      printf("%d\n", a / b);
    else if(op=='?')
      break;
  }
  return 0;
}

Measured memory_bytes: 1840
#include <cstdio>
#include <string>
#include <iostream>
using namespace std;
string s,t;
int sa[100001];
int ta[100001];
int main(){
    
    cin >> s;
    cin >> t;
  
    for(int i=0;i<s.size();i++) sa[i+1] = sa[i] + ((s[i]=='A') ? 1 : 2);
    for(int i=0;i<t.size();i++) ta[i+1] = ta[i] + ((t[i]=='A') ? 1 : 2);

    int q,a,b,c,d;
    cin >> q;
    while(q--){
        cin >> a >> b >> c >> d;
        if( (sa[b] - sa[a-1])%3 == (ta[d]-ta[c-1])%3) cout << "YES" <<'\n';
        else cout << "NO" << '\n';
    }
    
    return 0;
}

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

using namespace std;
 
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = 1e9+7; typedef vector<ll> VL;
void dbg(){ cerr << "\n"; } template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }


int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VI p(n);
	vector<pair<string, int>> vp(n);
	rep(i, n){
	 string s ; int p;
		cin >>s >>p;
		vp[i] = make_pair(s, p*1000 + i);
	}
	sort(all(vp), [](auto l, auto r){
		return l.first != r.first? l.first < r.first: l.second > r.second;
	});
	for(auto x :vp) cout<<(x.second%1000)+1<<"\n";
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
  int a, b;
  cin >> a;
  //a = 3;
  b = 0;
  
  for (int i = 1; i <= a; i++) {
    b += i;
  }

  cout << b << endl;
  
}

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

if n % 2 == 0:
    prefix = [0] * n
    suffix = [0] * n
    for i in range(0, n):
        prefix[i] += nums[i]
        if i - 2 >= 0:
            prefix[i] += prefix[i - 2]

    for i in range(n-1, -1, -1):
        suffix[i] += nums[i]
        if i + 2 < n:
            suffix[i] += suffix[i + 2]
    ans = max(prefix[-1], prefix[-2])

    for i in range(n):
        if i % 2 == 0 and  i + 2 < n:
            ans = max(ans, prefix[i] + suffix[i + 2])
        if i % 2 == 0 and  i + 3 < n:
            ans = max(ans, prefix[i] + suffix[i + 3])
        if i % 2 == 1 and i + 2 < n:
            ans = max(ans, prefix[i] + suffix[i + 2])
    print(ans)
else:
    dp = [[0] * n for i in range(3)] # -1, 0, +1
    # dp[delta][num], inclusive
    dp[2][0] = nums[0]
    dp[0][1] = 0
    dp[1][1] = max(nums[0], nums[1])
    dp[2][1] = 0
    dp[0][2] = 0
    dp[1][2] = max(nums[:3])
    dp[2][2] = nums[0] + nums[2]
    if n == 3:
        print(max(nums))
        exit()
    dp[0][3] = max(nums[:4]) # only choose one
    dp[1][3] = max(nums[0] + nums[3], nums[0] + nums[2], nums[1] + nums[3])
    dp[2][3] = 0
    dp[0][4] = max(nums[:5])
    dp[1][4] = max([nums[i] + nums[j] for i in range(5) for j in range(i+2, 5)])
    dp[2][4] = nums[0] + nums[2] + nums[4]

    for i in range(5, n):
        if (i + 1) % 2 == 0: # even
            dp[0][i] = max(dp[1][i - 1], dp[0][i - 2] + nums[i])
            dp[1][i] = max(dp[2][i - 1], dp[1][i - 2] + nums[i])  # 0
        else:
            # odd
            dp[0][i] = max(dp[0][i - 1], nums[i] + dp[0][i - 2])
            dp[1][i] = max(dp[1][i - 2] + nums[i], dp[1][i - 1], dp[2][i - 2])
            dp[2][i] = dp[2][i - 2] + nums[i] # ok
    print(max(dp[1][-1], dp[2][-3], dp[1][-2]))


Measured memory_bytes: 105056
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; 
#define INF 1000000000
#define mod 1000000007
using ll=long long;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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; }

int n;
ll a[16][16];
ll dp[(1<<16)+1];

ll DP(int bit){
    if(dp[bit]>=0) return dp[bit];
    int m=__builtin_popcount(bit);
    if(m==1) return dp[bit]=0;
    vector<int> id(m);
    int idx=0;
    rep(i,n){
        if((bit>>i)&1){
            id[idx]=i;
            idx++;
        } 
    }
    //ここからグルーピングしない場合
    ll ret=0;
    rep(i,m){
        for(int j=i+1;j<m;j++){
            ret+=a[id[i]][id[j]];
        }
    }

    for(int b=1;b<=(1<<(m-1));b++){
        int bitl=0;
        rep(i,m){
            if((b>>i)&1)bitl+=(1<<id[i]);
        }
        int bitr=bit-bitl;
        ll l,r;
        if(dp[bitl]>=0) l=dp[bitl];
        else l=DP(bitl);
        if(dp[bitr]>=0) r=dp[bitr];
        else r=DP(bitr);
        chmax(ret,l+r);
    }
    // cout<<bitset<3>(bit)<<" : "<<ret<<endl;
    return dp[bit]=ret;
}

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

    cin>>n;
    rep(i,n){
        rep(j,n){
            cin>>a[i][j];
        }
    }
    rep(i,(1<<16)) dp[i]=-1;
    dp[0]=0;
    cout<<(DP((1<<n)-1))<<endl;
    return 0;
}


Measured memory_bytes: 768
/*
    Author:zeke

    pass System Test!
    GET AC!!
*/
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rep3(var, min, max) for (ll(var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll(var) = (max)-1; (var) + 1 > (min); --(var))
#define Mp(a, b) make_pair((a), (b))
#define F first
#define S second
#define Icin(s) \
    ll(s);      \
    cin >> (s);
#define Scin(s) \
    ll(s);      \
    cin >> (s);
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;
}
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll mod = 1e9 + 7;
ll MOD = 1e9 + 7;
ll INF = 1e18;
// cout << "Case #" << index << " :IMPOSSIBLE";
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    ll n;
    cin>>n;
    V A(n),B(n),C(n);
    rep(i,n)cin>>A[i];
    rep(i,n)cin>>B[i];
    rep(i,n)cin>>C[i];
    sort(all(A));
    sort(all(B));
    sort(all(C));
    V regB(n+1);
    rep(i,n){
        ll k=lower_bound(all(C),B[i]+1)-C.begin();
        regB[i]=n-k;
    }
    for(int i=n;i>=1;i--)regB[i-1]+=regB[i];
    ll res=0;
    rep(i,n){
        ll k=lower_bound(all(B),A[i]+1)-B.begin();
        //cout<<k<<endl;
        res+=regB[k];
    }
    cout<<res<<endl;
}


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

int main(){
    int A, B, C, D;
    cin >> A >> B >> C >> D;

    if(A + B > C + D){
        cout << "Left" << endl;
    }
    else if(A + B == C + D){
        cout << "Balanced" << endl;
    }
    else{
        cout << "Right" << endl;
    }
}

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

count = -1
mincount = -1
min = h[n-1]

for i in (reversed(h)):
    if min <= i:
        count += 1
    else:
        if mincount < count:
            mincount = count
        count = 0
    min = i
        
if mincount < count:
    mincount = count
print(mincount)


Measured memory_bytes: 63856
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;

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

ll GCD(ll x, ll y) {
    if (y == 0) return x;
    else return GCD(y, x % y);
}


#include <iostream>

int main()
{
    int A, B, X;
    cin >> X;
    cin >> A;
    cin >> B;

    cout << (X - A) % B << endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr long long int infll = 1001001001001001LL;
constexpr int INF = 1000000007;
constexpr int inf = 1000000007;
const int mod = 1000000007;

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;
}

ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return (b);
    }
    else
    {
        return (gcd(b, a % b));
    }
}

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

inline double nCr(const int n, int r)
{
    if (n == 0)
    {
        return 0;
    }
    if (r == 0)
    {
        return 1;
    }
    if (r == 1)
    {
        return n;
    }
    if (n == r)
    {
        return 1;
    }

    if (r > n / 2)
    {
        r = n / 2;
    }

    double result = 1;
    for (double i = 1; i <= r; i++)
    {
        result *= (n - i + 1) / i;
    }

    return (result);
}

template <typename T>
T seinomi(T a)
{
    if (a > 0)
    {
        return a;
    }
    else
    {
        return 0;
    }
}

template <typename T>
map<T, T> soinsuubunkai(T n) //連想配列[素因数f.first][個数f.second]
{
    map<T, T> ret;
    for (T i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;
    return ret;
}

template <typename T>
T ketasuu(T num)
{
    return std::to_string(num).length();
}

int kaizyou(int k)
{
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

template <class ForwardIt, class T>
void iota(ForwardIt first, ForwardIt last, T value)
{
    while (first != last)
    {
        *first++ = value;
        ++value;
    }
}

//nの階乗を計算
int factorial(int n)
{
    int answer = 1;
    while (n > 1)
    {
        answer *= n;
        n--;
    }
    return answer;
}
int comb(int n, int r)
{
    return factorial(n) / (factorial(r) * factorial(n - r));
}

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


template <typename T>
T amarinasi(T a,T b){
    if(a%b==0)
{
    return a/b;
}
else if(a%b>0)
{
    return a/b+1;
}
else
{
    return a/b-1;
}
}

//小数点以下10桁テンプレート（main関数内の最初に貼付け）
//std::cout << std::fixed << std::setprecision(10);

//----------------------------------------------------------------

int main(){
    ll k,s;
    cin>>k>>s;
    ll cnt=0;
for(ll i=0;i<=k;i++){
    for(ll j=0;j<=k;j++){
        if(s-i-j<=k&&s-i-j>=0){
            cnt++;
        }
    }
}
cout<<cnt<<endl;



return 0;
}










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

#define ll long long
#define ld long double

using namespace std;

ll INF = (ll) 1e20;
int iINF = (int) 1e20;
ll mod = (ll) 1e9 + 7;

mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());

signed main() {
    ll x, k, d;
    cin >> x >> k >> d;
    x = abs(x);
    ll num = ((x + d - 1) / d);
    if(num > k) {
        cout << x - k * d;
        return 0;
    }
    if(x - num * d == 0) {
        if((k - num) % 2) {
            cout << d;
        } else
            cout << 0;
        return 0;
    }
    ll ans = INF;
    x -= (num - 1) * d;
    if((k - (num - 1)) % 2) {
        ans = min(ans, abs(x - d));
    }
    else {
        ans = min(ans, abs(x));
    }
    x -= d;
    if((k - (num)) % 2) {
        ans = min(ans, abs(x + d));
    }
    else {
        ans = min(ans, abs(x));
    }
    cout << ans;
}


Measured memory_bytes: 3636
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
#include <memory>
#include <time.h>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXIST2(s,e) (find(ALL(s),(e))!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
const double EPS = 1e-9;
const double PI  = acos(-1.0);

int main(){
	int n,l;
	while(cin>>n>>l,n|l){
		vi d(n),p(n);
		REP(i,n){
			char dd;
			cin>>dd>>p[i];
			if(dd=='L'){
				d[i]=-1;
			}else{
				d[i]=1;
			}
		}
		bool not_yet=true;
		int cnt=0;
		int last=-1;
		while(not_yet){
			cnt++;
			not_yet=false;
			bool left=false;
			REP(i,n){
				if(p[i]>0&&p[i]<l){
					p[i]+=d[i];
					if(p[i]>0&&p[i]<l){
						not_yet=true;
					}else{
						if(!left){
							last=i;
						}else if(p[i]==0){
							last=i;
						}
						left=true;
					}
				}
			}
			REP(i,n){
				FOR(j,i+1,n){
					if(p[i]==p[j]){
						d[i]*=-1;
						d[j]*=-1;
					}
				}
			}
		}
		cout<<cnt<<" "<<last+1<<endl;
	}
}

Measured memory_bytes: 1192
lakes = []  # [(左岸位置, 断面積)]
lefts = []  # lefts[i]: まだ対になっていない上から i 番目の左岸位置
for i, c in enumerate(input()):
	if c == '\\':
		lefts.append(i)
	elif c == '/':
		if lefts:
			left = lefts.pop()
			area = i - left
			while lakes:
				sub_left, sub_area = lakes[-1]
				if left < sub_left:
					area += sub_area
					lakes.pop()
				else:
					break
			lakes.append((left, area))

L = [lake[1] for lake in lakes]
print(sum(L))
print(len(L), *L)


Measured memory_bytes: 6508
import sys
def s():
 W=int(input().split()[1])
 C=[0]*-~W
 for e in sys.stdin:
  v,w=map(int,e.split())
  for i in range(W,w-1,-1):
   t=v+C[i-w]
   if t>C[i]:C[i]=t
 print(C[W])
s()


Measured memory_bytes: 5924
#include<iostream>
using namespace std;
int main()
{
  long long count=0,N,S=5;
  cin>>N;
  count=N/10;
  if(N%2==1){
  cout<<0<<endl;
    return 0;
  }
  N/=10;
  while(N/S>0){
    count+=N/S;
    S*=5;
  }
  cout<<count<<endl;
  
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text.RegularExpressions;
using System.Threading;
 
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
            //人数
            long N = inputLongArray[0];
            //お菓子の種類
            long K = inputLongArray[1];
            List<long> allMem = new List<long>();
            HashSet<long> array = new HashSet<long>();
            for (long q = 1; q <= N; q++)
            {
                allMem.Add(q);
            }
            for (long i = 0;i<K;i++)
            {
               //お菓子K[i]を持ってる人数
                long dN = long.Parse(Console.ReadLine());
                //お菓子[i]を持ってる人
                long[] lArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
                for (long p = 0; p < dN; p++)
                {
                    array.Add(lArray[p]);
                }
            }
            Console.WriteLine(allMem.Count - array.Count) ;
        }
    }
}
 
//文字列の入力
//string s = Console.ReadLine();
//整数の入力
//long n = long.Parse(Console.ReadLine());
//文字列配列の入力
//string[] inputStrArray = Console.ReadLine().Split(' ');
//整数配列の入力
//long[] inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
 
//Console.WriteLine();
//Console.ReadKey();

Measured memory_bytes: 28508
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <random>
#include <complex>

#define _1 first
#define _2 second
#define pb push_back
#define mp make_pair
#define sqr(x) ((x) * (x))
#define all(x) (x).begin(), (x).end()
#define uni(x) (x).erase(unique(all(x)), (x).end())
#define reset(x, y) memset(x, y, sizeof(x))
#define BUG(x) cerr << #x << " = " << (x) << endl
#define BUGP(x) cout << #x << " = " << (x)._1 << ", " << (x)._2 << endl
using namespace std;

typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;

const int dr[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int dc[] = {0, -1, 0, 1, -1, 1, -1, 1};
// Head

const int N = 112345;

int n;
LL x[N], a[N];

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

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

    LL tot = 0, sum = 0;
    for (int i = 1; i <= n; i++) sum += a[i];
    for (int i = 2; i <= n; i += 2) tot += a[i] * 2;

    x[1] = sum - tot;
    for (int i = 2; i <= n; i++) x[i] = a[i - 1] * 2 - x[i - 1];

    for (int i = 1; i < n; i++) cout << x[i] << ' ';
    cout << x[n] << '\n';

    return 0;
}

Measured memory_bytes: 2944
def A():
    year, month, day = (int(x) for x in input().split('/'))
    if year <= 2018:
        print("Heisei")
    elif year <=2019 and month <= 4 and day <= 30:
        print("Heisei")
    else:
        print("TBD")
    return 0

if __name__== '__main__':
    A()

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


int main() {
	ll n; cin >> n;
	cout << n*(n - 1) / 2 << endl;
	return 0;
}


Measured memory_bytes: 256
/*
*******************
2018-10-27 Sat
*******************
*/
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>

using namespace std;
#define PI 3.14159265359
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORN(i,a,b) for(int i=a;i<=b;i++)
const int INF = 1<<29;
typedef unsigned long long ull;
typedef long long ll;
typedef long long int LL;

ll a,b;
int k;

int main(){
    ios_base::sync_with_stdio(false); //Fast I/O
    cin.tie(NULL);
    cout.tie(NULL);
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);	

    cin >> a >> b >> k;
    ll i=0;

    while(i<k){
        if(!(i&1)){
            if(a%2!=0){
                a--;
            }
            a/=2;
            b+=a;
        }else{
            if(b%2!=0){
                b--;
            }
            b/=2;
            a+=b;
        }
        i++;
    }

    cout << a << " " << b << endl;

    return 0;
}


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

typedef struct {
	int a;
	int b;
}work;

int cmp(const void* p, const void* q) {
	return ((work*)p)->b - ((work*)q)->b;
}

int main(void) {
	int N;
	scanf("%d", &N);
	int i;

	work data[N];
	for (i = 0;i < N;i++) {
		scanf("%d%d", &data[i].a, &data[i].b);
	}

	int n = sizeof data / sizeof(work);

	qsort(data, n, sizeof(work), cmp);

	int time = data[0].a;
	i = 0;

	while (time <= data[i].b && i < N) {
		i++;
		time += data[i].a;
	}

	if (i == N) {
		printf("Yes\n");
	}
	else {
		printf("No\n");
	}

	return 0;
}

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

using Int = long long;
const char newl = '\n';

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}
template<typename T=Int>
vector<T> read(size_t n){
  vector<T> ts(n);
  for(size_t i=0;i<n;i++) cin>>ts[i];
  return ts;
}

//INSERT ABOVE HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  Int x,k,d;
  cin>>x>>k>>d;
  x=abs(x);
  if(((__int128_t)k)*((__int128_t)d)<=(__int128_t)x) drop(x-k*d);

  Int mv=x/d;
  x-=mv*d;
  k-=mv;
  k%=2;
  if(k) x=abs(x-d);
  cout<<x<<newl;
  return 0;
}


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

int main() {
	int n,data,most=0, ans=0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> data;
		if (data >= most) {
			ans++;
			most = data;
		}
	}
	
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector<ll> vi;
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  ll a, b, c;
  cin >> a >> b >> c;
  if(a+b>=c){
    print("Yes");
  }
  else{
    print("No");
  }
}

Measured memory_bytes: 256
s=input()
if 10*int(s[0])+int(s[1])<=12 and int(s[0])+int(s[1])!=0:
  if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
    print("AMBIGUOUS")
  else:
    print("MMYY")
if 10*int(s[0])+int(s[1])>=13 or int(s[0])+int(s[1])==0:
  if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
    print("YYMM")
  else:
    print("NA")

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

#define rep(i, n) for(int i=0; i<n; ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
#define ll long long int

int main(){
   int n;
   cin>>n;
   cout << (1000-n%1000)%1000 << endl;
   return 0;
}


Measured memory_bytes: 3628
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long x = sc.nextLong();
        boolean found = false;
        for(int i=-1000; i<=1000; ++i){
            for(int j=-1000; j<=1000; ++j){
                long a = (long) Math.pow(i,5);
                long b = (long) Math.pow(j,5);
                if(a - b == x){
                    System.out.println(i + " " + j);
                    found = true;
                    break;
                }
                if(found) break;
            }
        }
    }
}


Measured memory_bytes: 38736