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

// Shrotening
#define fst first
#define snd second
#define pb push_back
#define mp std::make_pair

// Loop
#define FOR(i,a,b) for(auto i=(a);i<(b);++i)
#define RFOR(i,a,b) for(auto i=(a);i>=(b);--i)

#define REP(i,a) for(long i=0;i<(a);++i)
#define RREP(i,a) for(long i=(a);i>=0;--i)

#define EACH(i,a) for(auto (i)=(a).begin(),_END=(a).end();i!=_END;++i)
#define REACH(i,a) for(auto (i)=(a).rbegin(),_END=(a).rend();i!=_END;++i)

//Algorithm
#define ALL(a) (a).begin(), a.end()
#define RALL(a) (a).rbegin(), a.rend()
#define EXIST(a,x) ((a).find(x)!=(a).end())
#define SORT(a) std::sort((a).begin(), (a).end())
#define UNIQUE(a) std::sort((a).begin(), a.end()), a.erase(std::unique((a).begin(), a.end()), a.end());
#define SUM(a) std::accumulate((a).begin(), (a).end(), 0);

//Setting
#define OPT std::cin.tie(0);std::ios::sync_with_stdio(false);

//debug message
bool debug = true;
#define MSG(s)   if(debug){std::cout << s << std::endl;}
#define DEBUG(x) if(debug){std::cout << "debug(" << #x << "): " << x << std::endl;}

//alias
typedef long long LL;
typedef std::pair<int,int> PII;

typedef std::vector<char> VC;
typedef std::vector<int>  VI;
typedef std::vector<long> VL;
typedef std::vector<long long> VLL;
typedef std::vector<PII> VPII;

typedef std::vector< VC > VC2;
typedef std::vector< VI > VI2;
typedef std::vector< VL > VL2;
typedef std::vector< VLL > VLL2;

int N;
std::vector<std::string> V(12);
VI coeff(10);
int alphabetSize;
std::vector<bool> mostLeft(10);

int sum;
std::vector<bool> used(10);
int dfs(int i) {
    if(i == alphabetSize) return sum == 0;

    int ret = 0;
    REP(d, 10) {
        if(used[d]) continue;
        if(d == 0 && mostLeft[i]) continue;

        used[d] = true;
        sum += d * coeff[i];
        ret += dfs(i+1);
        sum -= d * coeff[i];
        used[d] = false;
    }
    return ret;
}

int main() {
    std::string s, alphabet;;
    while(std::cin >> N && N != 0) {
        alphabet = "";
        REP(i, N) {
            std::cin >> V[i];
            alphabet += V[i];
        }

        UNIQUE(alphabet);
                
        alphabetSize = alphabet.size();
        REP(i, alphabetSize) {
            coeff[i] = 0;
        }
        REP(i, 10) {
            used[i] = false;
            mostLeft[i] = false;
        }

        //left
        REP(i, N-1) {
            int len = V[i].length();
            if(len > 1) mostLeft[(int)alphabet.find(V[i][0])] = true;
            REP(j, len) {
                int p = alphabet.find(V[i][j]);
                coeff[p] += std::pow(10, len-j-1);
            }
        }
        //right
        int len = V[N-1].length();
        if(len > 1) mostLeft[(int)alphabet.find(V[N-1][0])] = true;
        REP(j, len) {
            int p = alphabet.find(V[N-1][j]);
            coeff[p] -= std::pow(10, len-j-1);
        }

        sum = 0;
        std::cout << dfs(0) << std::endl;
    }
}


Measured memory_bytes: 3244
<?php
//error_reporting(0);
$S = trim(fgets(STDIN));
$w = trim(fgets(STDIN));
//list($A,$B) = explode(" ",trim(fgets(STDIN)));
$res="";
for($i=0;$i<strlen($S);$i=$i+$w) {
  $res=$res.$S[$i];
  //printf("%d %s\n",$i,$S[$i]);
}
printf("%s\n",$res);


Measured memory_bytes: 3828
def BubbleSort(C, N):
	for i in range(N):
		for j in reversed(range(i+1, N)):
			if C[j][1] < C[j-1][1]:
				C[j], C[j-1] = C[j-1],C[j]
	return C

def SelectionSort(C, N):
    for i in range(N):
        minj = i
        for j in range(i,N):
            if C[j][1] < C[minj][1]:
                minj = j
        C[i],C[minj] = C[minj],C[i]
    return C
        
N = int(input())
C = input().split()
bubble = BubbleSort(C[:], N)
select = SelectionSort(C[:], N)
print(*bubble)
print("Stable")
print(*select)
print(["Not stable", "Stable"][bubble==select])




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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;

#define ZP(a, len) setfill('0') << setw(len) << right << a
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
const ll LINF = 1e11;

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


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

    ll ans = 1;
    for (int i = 1; i <= n; ++i) {
        ans *= i;
        ans %= MOD;
    }
    cout << ans << "\n";
}


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

    solve();
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <float.h>
#include <stdlib.h>
#include <functional>
#include <limits>
#include <numeric>
#include <type_traits>
#include <queue>
#include <fstream>
#include <bitset>
#include <cmath>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i <= (int)(n); i++)
#define sort1(v) sort(v.begin(),v.end())
#define reverse(v) reverse(v.begin(),v.end())
#define all(v) v.begin(),v.end()
typedef long long ll;
typedef pair<int,int> p;
bool paircom (pair<int,int> p,pair<int,int> q){
return p.second<q.second;
}

void count(vector<int> v,vector<int>& ans){
    sort1(v);
    int n=v.size();
  int k=1;
  int i=1;
  bool bl=true;
    while(true){
    while(bl){
        if(v[i-1]==v[i]){
        k++;    
      }else{
          bl=false;
      }
      i++;
      }
      ans.push_back(k);
      if(i>=(n-1))break;
      k=1;
      bl=true;
    }
    }




int main() {

int a,b,c,k;
cin >>a>>b>>c>>k;
int l=1;
for(int i=0;i<k-1;i++){
  l=l*2;
}
//if(a<b&&b<c){cout<<"Yes"}
//else if(a<b && b>c){if(b<c*l){cout <<"Yes";}else{cout << "No";}
//else{
  int co=0;
  int co2=0;
  int p=1;

if(a<b){}else{while(true){
  p=p*2;co++;
  if(a<b*p){
break;
  }
}
}
b=b*p;
p=1;
if(b<c){}else{while(true){
  p=p*2;co2++;
  if(b<c*p){
break;
  }
}
}
if(k-co-co2>=0){cout<<"Yes";}else{
  cout <<"No";
}



}

    

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

static const int MAX=200000;
int main(void) {
    int R[MAX],n;


    cin >>n;
    for(int i=0;i<n;i++){
        cin>>R[i];
    }
    int MAX_V=-R[0];
    int MIN_V=R[0];

    for(int i=1;i<n;i++){
        MAX_V=max(MAX_V,R[i]-MIN_V);
        MIN_V=min(MIN_V,R[i]);

    }
    cout<<MAX_V<<endl;

    return 0;
}


Measured memory_bytes: 3876
#include<iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <bits/stdc++.h>

using namespace std;

int main (){
    int N,L; cin >> N >> L;
    vector<string> v(N);
    for (int i=0;i<N;i++){
        cin >> v[i];
    }

    sort(v.begin(),v.end());
    for (int i=0;i<N;i++)
        cout << v[i];
    
}

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

using namespace std;

int main() {
	string a, b;
	int	ans=0;
	cin >> a >> b;
	ans = stoi(a + b);


	for (int i = 1; i <= 333; i++) {
		if (ans == i * i) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	
	cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <cmath>
#include <tuple>
#include <cassert>
#include <array>
#include <iomanip>

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using ti = tuple<int, int, int>;

const double eps=1e-14;
const int mod = 1e9 + 7;
const int inf = ((1<<28));
const ll linf = (1LL<<58);

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    cout << 800*n - 200*(n/15) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 5;
const int INF = 0x3f3f3f3f;
const ll p = 1e9 + 7;
#define DEBUG(x) cout << (x) << '\n'
#define fi first
#define se second

char s[MAXN];
void run(){
    cin >> s + 1;
    int x = 0;
    for(int i = 1; s[i]; i++)
        x += s[i] - '0';
    DEBUG(x % 9 == 0 ? "Yes" : "No");
}
int main(){
#ifdef Irene
    freopen("in.txt", "r", stdin);
#endif // Irene
    ios_base::sync_with_stdio(false);

    run(); return 0;
}


Measured memory_bytes: 3756
#include <iostream>

using namespace std;
int main(){
  string str;
  bool flag = false;
  cin >> str;
  //cout << str;
  for(int i=1;i<4;i++){
    if(str.c_str()[i] == str.c_str()[i-1])
      flag = true;
  }
  if (flag == false){
    cout << "Good\n";
  }else{
    cout << "Bad\n";
  }
  return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
print(" ".join(map(str,a)))
for i in range(1,n):
  v = a[i]
  j = i-1
  while j >= 0 and a[j] > v:
    a[j+1] = a[j]
    j -=1
  a[j+1] = v
  print(" ".join(map(str,a)))


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

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

    ll dist[n];
    ll inf = 1e18;
    for (int i = 0; i < n; i++) {
        dist[i] = inf;
    }
    dist[0] = 0;
    for (int loop = 0; loop < n - 1; loop++) {
        for (int i = 0; i < m; i++) {
            if (dist[a[i]] == inf) continue;

            if(dist[b[i]] > dist[a[i]] + c[i]) {
                dist[b[i]] = dist[a[i]] + c[i];
            }
        }
    }

    ll ans = dist[n - 1];

    bool negative[n];
    for (int i = 0; i < n; i++) {
        negative[i] = false;
    }
    for (int loop = 0; loop < n; loop++) {
        for (int i = 0; i < m; i++) {
            if (dist[a[i]] == inf) continue;

            if (dist[b[i]] > dist[a[i]] + c[i]) {
                dist[b[i]] = dist[a[i]] + c[i];
                negative[b[i]] = true;
            }
            if (negative[a[i]]) {
                negative[b[i]] = true;
            }
        }
    }

    if (negative[n - 1]) {
        cout << "inf" << endl;
    } else {
        cout << -ans << endl;
    }


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/
 

// void chmod(ll &M){
//     if(M >= mod) M %= mod;
//     else if(M < 0){
//         M += (abs(M)/mod + 1)*mod;
//         M %= mod;
//     }
// }


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

    int n; cin >> n;
    vector<pair<ll, ll>> ba(n);
    for(int i=0; i<n; ++i) cin >> ba[i].second >> ba[i].first;
    sort(ba.begin(), ba.end());

    ll time = 0;
    for(int i=0; i<n; ++i){
        time += ba[i].second;
        if(time > ba[i].first){
            cout << "No" << endl;
            return 0;
        }
    }

    cout  << "Yes" << endl;
    
    return 0;
}



Measured memory_bytes: 3456
MOD=10**9+7
cnt=0; sum=0; prev=nil; can=true; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.chomp.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def desc(ar) ar.sort!{|x,y| y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+) end

def C(a,b) b==0||a==b ? 1 : (b=a-b if a/2<b;(a-b+1..a).inject(:*)/(1..b).inject(:*)) end
def rui(ar) s=[0]; ar.size.times{|i| s<<s[-1]+ar[i]}; s end
def rev_rui(ar) s=[0]; ar.size.times.reverse_each{|i| s<<s[-1]+ar[i]}; s end

def puts_yesno(b) puts(b ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def debug(k,v) puts "#{k}:#{v}" end
########### ( ˘ω˘ )ｽﾔｧ… ###########
m=gi
puts 24+24-m

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define INF 1000000007
#define MAX_N 100
using namespace std;

struct Edge {
    int to, cap, rev;
};

vector<Edge> es[MAX_N * 2 + 2];
bool used[MAX_N * 2 + 2];

void add_edge(int from, int to, int cap) {
    es[from].push_back(Edge {to, cap, (int) es[to].size()});
    es[to].push_back(Edge {from, 0, (int) es[from].size() - 1});
}

int dfs(int v, int t, int f) {
    if (v == t) return f;
    used[v] = true;
    for (auto &e: es[v]) {
        if (!used[e.to] && e.cap > 0) {
            int d = dfs(e.to, t, min(f, e.cap));
            if (d > 0) {
                e.cap -= d;
                es[e.to][e.rev].cap += d;
                return d;
            }
        }
    }
    return 0;
}

int max_flow(int s, int t, int n) {
    int flow = 0;
    while (true) {
        fill(used, used + n, false);
        int f = dfs(s, t, INF);
        if (f == 0) return flow;
        flow += f;
    }
}


int main() {
    int n;
    cin >> n;
    int a[n], b[n], c[n], d[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
        add_edge(2 * n, i, 1);
    }
    for (int i = 0; i < n; i++) {
        cin >> c[i] >> d[i];
        add_edge(n + i, 2 * n + 1, 1);
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (a[i] < c[j] && b[i] < d[j]) {
                add_edge(i, n + j, 1);
            }
        }
    }
    cout << max_flow(2 * n, 2 * n + 1, 2 * n + 2) << endl;
    return 0;
}


Measured memory_bytes: 384
arr = input().split()

cnt_5 = 0
cnt_7 = 0
for a in arr:
    if a == '5':
        cnt_5+=1
    elif a == '7':
        cnt_7+=1

if cnt_5 == 2 and cnt_7 == 1:
    print("YES")
else:
    print("NO")

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


public class Main {


    private void solve(InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int m = in.nextInt();
        int x = in.nextInt();
        int y = in.nextInt();
        List<Integer> A = new ArrayList<>();
        A.add(x);
        for (int i = 0; i < n; i++) {
            A.add(in.nextInt());
        }
        List<Integer> B = new ArrayList<>();
        B.add(y);
        for (int i = 0; i < m; i++) {
            B.add(in.nextInt());
        }

        Collections.sort(A);
        Collections.sort(B);
        out.println(B.get(0) <= A.get(A.size() - 1) ? "War" : "No War");

    }


    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        try (
                InputReader in = new InputReader(System.in);
                PrintWriter out = new PrintWriter(System.out)) {
            solve(in, out);
        }
    }


    static class InputReader implements AutoCloseable {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }


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

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

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

        @Override
        public void close() {

        }
    }

}


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

int main(){

  int N,M,Q;
  cin >> N >> M >> Q;
  vector<int> a(Q);
  vector<int> b(Q);
  vector<int> c(Q);
  vector<int> d(Q);

  for(int i = 0; i < Q; i++){
    cin >> a.at(i) >> b.at(i) >> c.at(i) >> d.at(i);
  }

  int n = N+M-1;
  int max = 0;

      for (int bit = 0; bit < (1<<n); ++bit) {
        vector<int> S;
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) { // 列挙に i が含まれるか
                S.push_back(i);
            }
        }
      if(S.size() == N){
        for(int i = 0; i < N; i++){
          S.at(i) -= i;
        }

        int point = 0;

        for(int i = 0; i < Q; i++){
          if(S.at(b.at(i)-1) - S.at(a.at(i)-1) == c.at(i)) point += d.at(i);
        }

        if (point > max) max = point;
      }
        
      }

      cout << max << endl;
}


Measured memory_bytes: 3644
#include<stdio.h>
#include<iostream>
#include<string>  
#include<algorithm>
#include<iomanip>
#include <set>

using namespace std;

signed int S[100003]={},L[100003]={};
	int N[100000]={};

int main(){
	int n,m;
	while(10){
	cin>>n;if(n==0)break;
	for(int i=0;i<n;i++){
		cin>>N[i]>>S[i]>>L[i];}
	bool f=1;
	for(int i=0;i<n;i++){int g=0;
		for(int j=0;j<n;j++){
			if(i==j)g+=N[i];
			else if(S[j]<=S[i]&&S[i]<L[j])g+=N[j];
			if(g>150)f=0;
			if(f==0)break;
		}
		//cout<<g;
		if(f==0)break;
	}
	if(f)cout<<"OK"<<endl;
	else cout<<"NG"<<endl;
	}
	return 0;
}

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

using ll = long long int;
using bigint = int64_t;

#define pll pair<ll, ll>
#define vll vector<ll>
#define vpll vector<pll>
#define lob lower_bound
#define upb upper_bound
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define pf push_front
#define ins insert
#define mp make_pair
#define w(t) cin >> t;while(t--)
#define bitcount __builtin_popcount
#define endl "\n"
#define sz(s) (int)s.size()
#define mem(n,m) memset(n,m,sizeof(n))
#define deb(x) cout << #x << " = " << x << endl;
#define rep(i,n) for(ll i = 0; i < n; i++)
#define ren(i,n) for(ll i = n-1; i >= 0; i--)
#define all(x) x.begin(),x.end()
#define fo(i, a, b) for(ll i = a; i <= b; i++)
#define ffo(i, a, b) for(ll i = a; i >= b; i--)
#define ffi(i,a,b,c) for(ll i = a ; i <= b ; i += c)
#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
const int MOD = 1000000007;

void io_set() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

const int MAX = 200005;

ll n, k;
ll a[MAX];

ll func(ll mid) {
	ll ret = 0;
	rep(i, n) {
		if (a[i] == 0) {
			if (mid >= 0)	{
				ret += n - 1;
			}
			continue;
		}
		if (a[i] < 0) {
			ll pk = mid / a[i];
			if (pk * a[i] > mid) {
				pk++;
			}
			ll index = lower_bound(a, a + n, pk) - a;
			ret += n - index;
			if (index <= i) {
				ret -= 1;
			}
		}
		else {
			ll pk = mid / a[i];
			if (pk * a[i] > mid) {
				pk--;
			}
			ll index = upper_bound(a, a + n, pk) - a - 1;
			if (index < 0)	{
				continue;
			}
			ret += index + 1;
			if (index >= i)	{
				ret -= 1;
			}
		}
	}
	return ret / 2;
}

void solve() {
	cin >> n >> k;
	rep(i, n) {
		cin >> a[i];
	}
	sort(a, a + n);
	ll l = -1e18, r = 1e18;
	while (l < r) {
		ll mid = l + (r - l) / 2;
		if (func(mid) >= k) {
			r = mid;
		}
		else {
			l = mid + 1;
		}
	}
	cout << l << endl;
}

int main() {
	IOS;
	//io_set();
	ll tt = 1;
	//cin >> tt;
	while (tt--) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define eb push_back
#define mp make_pair
#define hello cout<<"hello"<<"\n"
#define forr(i,a,b) for(int i=a;i<b;i++)
#define it(s)	for(auto itr:s)
#define dvg(s) 	for(auto itr:s)	cout<<itr<<" ";cout<<endl;
#define dbg(s)	cout<<#s<<"= "<<s<<endl;
typedef long long int lli;
typedef unsigned long long int ulli;
const int INF=INT_MAX;
const ulli MOD=1e9+7;


	

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::cout.precision(30);
	
	
	int n,totw;
	cin>>n>>totw;
	
	vector<lli> w(n,0),val(n,0);
	
	forr(i,0,n)
	{
		cin>>w[i]>>val[i];
	}
	
	vector<lli> dp(totw+1,0);
	forr(i,0,n)
	{
		for(int j=totw-w[i];j>=0;j--)
		{
			dp[j+w[i]]=max(dp[j+w[i]],dp[j]+val[i]);
		}
	}
	
	lli  maxi=INT_MIN;
	forr(i,0,dp.size())
	{
		maxi=max(maxi,dp[i]);
	}
	cout<<maxi<<"\n";
	
		
		
		
	return 0;
	
}













Measured memory_bytes: 1024
#include<stdio.h>
#define rep(i,n) for(int i=0;(i)<(n);(i)++)
int w,h;
int dx[4]={1,-1,0,0};
int dy[4]={0,0,-1,1};
int used[20][20];
char c[20][22];
int cnt;
void dfs(int sy,int sx){
    used[sy][sx]=1; cnt++;
    for(int d=0;d<4;d++){
        int ny=sy+dy[d],nx=sx+dx[d];
        if(c[ny][nx]=='#') continue;
        if(ny<0||ny>=h||nx<0||nx>=w) continue;
        if(used[ny][nx]==1) continue;
        dfs(ny,nx);
    }
}
int main(void){
    while(1){
        scanf("%d%d",&w,&h);
        if(w+h==0) break;
        getchar();
        rep(i,h) fgets(c[i],22,stdin);
        int starty,startx;
        rep(i,h){
            rep(j,w){
                if(c[i][j]=='@'){
                    starty=i,startx=j;
                }
                used[i][j]=0;
            }
        }
        cnt=0;
        dfs(starty,startx);
        printf("%d\n",cnt);
    }
}



Measured memory_bytes: 1976
/* #                          */

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <deque>
#include <map>
#include <iomanip>
#include <functional>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstdint>
#include <cstring>
//#pragma warning(disable:4996)

using namespace std;


/** Type Define **/
typedef long long int           ll;
typedef pair<int, int>          pii;
typedef pair<ll, ll>            pll;
typedef vector<string>          vs;
typedef vector<bool>            vb;
typedef vector<int>             vi;
typedef vector<long long>		vl;
typedef vector<vi>              vvi;
typedef vector<vl>				vvl;
typedef vector<char>            vch;
#define		it(x)  x.begin() 
#define		all(x)  x.begin(), x.end()
#define		pb(x)   push_back(x)
constexpr int           inf = 0x3f3f3f3f;
constexpr long long 	INF = 9123456789123456789;
constexpr long long     MOD = 1000000007LL;
/*************************************************/
void sol() {

}

int main() {
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    cin.tie(nullptr);

    int X; cin >> X;

    int c500 = X / 500; 
    int rem = X % 500;
    int c50 = rem / 5;
    
    cout << 1000 * c500 + 5 * c50 << '\n';

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> int size(const T &x) { return x.size(); }
#define rep(i,a,b) for(int i = (a); i < (b); i++)
#define iter(it,c) for(auto it = (c).begin(); it != (c).end();++it)
#define pb push_back
#define fs first
#define sc second
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const int INF = ~(1<<31);
const double pi = acos(-1);
const double EPS = 1e-9;

int main() {
    cin.sync_with_stdio(false);
	map<int,int> cnt;
	int n;
	cin >> n;
	rep(i,0,n) {
		int x;
		cin >> x;
		cnt[x]++;
	}
	int ans = 0;
	iter(it,cnt) ans += it->second < it->first ? it->second : abs(it->second-it->first);
	cout << ans << endl;
    return 0;
}



Measured memory_bytes: 4736
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
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();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long ll;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

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

int main() {
    string s;
    cin >> s;
    int ans = 0;

    REP(i, 4) {
        if(s[i] == '+') ans++;
        else ans--;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define vi vector<int>
#define all(a) a.begin(),a.end()
int a,b,c,d;
signed main(){
    int n;cin>>n;
    rep(i,n){
        string s;cin>>s;
        if(s=="AC")a++;
        if(s=="WA")b++;
        if(s=="TLE")c++;
        if(s=="RE")d++;
    }
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n",a,b,c,d);
}

Measured memory_bytes: 3720
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() 
{
	int n,m; cin>>n>>m;
	int mi=2*n;
	int mx=4*n;
	if(m>=mi && m<=mx && m%2==0)
	{
		cout<<"Yes";
	}
	else{
		cout<<"No";
	}


}

Measured memory_bytes: 3632
#include<iostream>

using namespace std;
int main()
{
    int n,m,a[100001];
    cin>>n>>m;
    long long sum=0;
    for(int i=0;i<m;i+=1){
        cin>>a[i];
        sum = sum+a[i];
    }
    int s = n-sum;
    if(s==0 || s<0) cout<<"Yes\n";
    else cout<<"No\n";


    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <queue>

using namespace std;
const int maxn = 200;
int n;
vector<int> V[maxn+1];
int color[maxn+1];

vector<int> current;
bool visited[maxn+1];
bool visitedBFS[maxn+1];
int distanceBFS[maxn+1];
queue<int> Q;

bool dfs(int x,int c)
{
	color[x] = c;
	
	bool res = true;
	for (int y: V[x])
	{
		if (color[y]==-1)
			res&=dfs(y,1-c);
		
		if (!res)
			return false;
			
		if (color[y]==color[x])
			return false;
	}
	
	return true;
}

void dfs2(int x)
{
	current.push_back(x);
	visited[x] = true;
	for (int y: V[x])
	if (!visited[y])
		dfs2(y);
}

int bfs(int x)
{
	while (!Q.empty())
		Q.pop();
	
	distanceBFS[x] = 1;
	
	Q.push(x);
	
	int res = 1;
	do
	{
		int p=Q.front();
		Q.pop();
		
		for (int y: V[p])
		if (distanceBFS[y]>distanceBFS[p]+1)
		{
			distanceBFS[y] = distanceBFS[p]+1;
			res = max(res,distanceBFS[y]);
			Q.push(y);
		}
	}
	while (!Q.empty());
	
	return res;
	
	
}

int solve(int x)
{
	current.clear();
	dfs2(x);
	
	int res = 0;
	for (int i: current)
	{
		for (int j: current)
			distanceBFS[j] = maxn+1;
		
		res = max(res,bfs(i));
	}
	
	return res;
	
	
}
int main()
{
	ios_base::sync_with_stdio(0);
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin >> n;
	for (int i=1; i<=n; i++)
	for (int j=1; j<=n; j++)
	{
		char c;
		cin >> c;
		if (c=='1')
			V[i].push_back(j);
	}
	
	memset(color,-1,sizeof(color));
	
	for (int i=1; i<=n; i++)
	if (color[i]==-1)
	{
		bool flag = dfs(i,0);
		if (!flag)
		{
			cout << -1;
			return 0;
		}
	}
	
	int res = 0;
	for (int i=1; i<=n; i++)
	{
		if (!visited[i])
			res+=solve(i);
	}
	
	cout << res;
	
	return 0;
}


Measured memory_bytes: 512
object Main {
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)

    while (sc.hasNext()) {
      val s = sc.next() split Array('+', '=')
      var ans = -1;

      for (X <- 0 to 9) {
        val a = s(0).replaceAll("X", "" + X)
        val b = s(1).replaceAll("X", "" + X)
        val c = s(2).replaceAll("X", "" + X)

        if (check(a) && check(b) && check(c) && BigInt(a) + BigInt(b) == BigInt(c)) {
          ans = X
        }
      }

      println(if (ans == -1) "NA" else ans)
    }
  }

  private def check(s: String): Boolean = {
    val res: Boolean = (s.length == 1 || s(0) != '0')
    res
  }
}

Measured memory_bytes: 50160
#include <bits/stdc++.h>
#define INF 1e9
using namespace std;

#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()
#define endl "\n"

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

void solve() {
    int N;
    cin >> N;
    int cnt = 0;
    FOR(i,1,N+1) {
        int a; cin >> a;
        if((a%2 == 1) && (i%2 == 1)) cnt++;
    }
    cout << cnt << endl;
}

int main() {
    solve();
    return 0;
}

Measured memory_bytes: 3632
MODULE modCombModule
        !nCk mod mo
        !n,k <= 10**5
        INTEGER(16),PARAMETER :: mo = 10**9+7
        INTEGER(16),PARAMETER :: ma = 10**7
        INTEGER(16) :: f(0:ma) = 0
        private :: mo,ma,f
        private :: initializeF, inv
        
        contains
        
        !private
        SUBROUTINE initializeF()
          implicit none
          INTEGER(16) :: i
          
          f(0) = 1
          DO i = 1,ma
            f(i) = mod( f(i-1)*i,mo )
          END DO
        END SUBROUTINE initializeF
        
        !private
        FUNCTION inv( in ) RESULT( out )
          implicit none
          INTEGER(16),INTENT(IN) :: in
          INTEGER(16) :: out
          INTEGER(16) :: k, y
          
          out = 1
          k   = mo-2
          y   = in
          DO while( k>0 )
            if( and(k,1)==1 ) out = mod(out*y,mo)
            y = mod( y*y,mo )
            k = rshift( k,1 )
          END DO
        END FUNCTION inv
        
        !public
        FUNCTION modComb( n,k ) RESULT( r )
          implicit none
          INTEGER(16),INTENT(IN) :: n,k
          INTEGER(16) :: r
          INTEGER(16) :: a,b,c,bc
          
          CALL initializeF()
          
          a = f(n)   ! n!
          b = f(n-k) ! (n-k)!
          c = f(k)   ! k!
          
          bc = mod( (b*c),mo )
          r  = mod( a*inv(bc),mo )
        END FUNCTION
      END MODULE modCombModule
      
      
      
      program knight
      USE modCombModule
      implicit none
      integer(16) :: x,y,ans
      integer(16) :: m,n
      
      read*,x,y
      
      
      if( mod(x+y,3)/=0 ) goto 100
      
      !(x,y)
      !(1,2) : n
      !(2,1) : m
      m = (2_16*x-y) / 3_16
      n = (2_16*y-x) / 3_16
      
      if( m<0 ) goto 100
      if( n<0 ) goto 100
      
      
      ans = modComb( m+n,m )
      print*,ans
      RETURN
      
 100  print*,0
      RETURN
      
      end program
      

Measured memory_bytes: 156416
import Data.List
main=do
 getLine
 xl<-map((\[x,l]->(x-l,x+l)).map read.words).lines<$>getContents
 print$f (-1145141919)$sortOn snd xl
f p[]=0
f p((l,r):xl)
 |p<=l=1+f r xl
 |otherwise=f p xl

Measured memory_bytes: 47484
//
//  second.cpp
//  CoderTest
//
//  Created by yuya on 2019/07/25.
//  Copyright © 2019 yuya. All rights reserved.
//

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
#define ALL(x) (x).begin(), (x).end()
#define INF 1000000


int main()
{
    int N,K;
    cin >> N >> K;
    vector<double> ex(N);
    double p;
    for (int i=0; i<N; i++) {
        cin >> p;
        ex[i] = (p+1)/2;
    }
    vector<double> sum(N-K+1);
    for (int i=0; i<K; i++) {
        sum[0] += ex[i];
    }
    for (int i=1; i<N-K+1; i++) {
        sum[i] = sum[i-1] - ex[i-1] + ex[i+K-1];
    }
    
    
    cout << setprecision(10) << *max_element(sum.begin(),sum.end()) << endl;
    
    
    return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define MAX 1000000007
using namespace std;



int main(void){
	int n,m;
	cin>>n>>m;
	pair<int,int> work[m];
	rep(i,m)cin>>work[i].first>>work[i].second;
	sort(work,work+m);

	//rep(i,m)cout<<work[i].first<<" "<<work[i].second<<endl;

	int r=n;
	int ans=1;
	rep(i,m){
		if(r <= work[i].first){
			ans++;
			r=work[i].second;
		}
		if(work[i].second < r)r=work[i].second;
	}

	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 1024
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define int long long
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false),cin.tie(nullptr);
#endif
#define ff first
#define ss second
#define endl '\n'
#define all(c) c.begin(),c.end()
template<typename T>void print(T t){for(auto &it:t)cout<<it<<" "; cout<<endl;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve(){
  	string s;
    cin>>s;
    string a="8102";
    s.erase(s.begin(),s.begin()+4);
    reverse(all(s));
    s+=a;
    reverse(all(s));
    cout<<s<<endl;
    
}
int32_t main(){
  IOS;
  solve();
  //debug();
 #ifdef LOCAL_DEFINE
 cerr<<"time elapsed "<<(double)clock()/CLOCKS_PER_SEC<<endl;
 #endif	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=mod*mod*3LL;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

vector<vector<ll> > v;
vector<ll> x, dp;
bool dfs(ll now){
    vector<ll> d;
    ll s = 0, t = 0;
    for(auto& to: v[now]){
    	if(!dfs(to)) return false;
    	ll a = min(x[to], dp[to]);
    	ll b = max(x[to], dp[to]);
    	s += a;
    	t += b;
    	d.pb(b - a);
    }
    bitset<6000> bit;
    bit[0] = 1;
    for(auto& i: d) bit |= bit << i;
    for(int i=x[now]-s;i>=0;i--)if(bit[i]){
    	dp[now] = t-i;
    	return true;
    }
    return false;
}
int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n, a;
    cin >> n;
    v.resize(n);
    x.resize(n);
    dp.resize(n);
    for(int i=1;i<n;i++){
    	cin >> a;
    	a--;
    	v[a].pb(i);
    }
    for(int i=0;i<n;i++) cin >> x[i];
    if(dfs(0)) cout << "POSSIBLE" << endl;
    else cout << "IMPOSSIBLE" << endl;
    return 0;
}


Measured memory_bytes: 1280
#include <iostream>

#define int long long

using namespace std;

const int N = 2e5 + 10;

int32_t main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);    
    int a, v, b, w, t;
    cin >> a >> v >> b >> w >> t;
    int d = abs(b - a);
    if (w >= v) cout << "NO";
    else
    {
        if (t * (v - w) >= d) cout << "YES";
        else cout << "NO";
    }
    return 0;
}

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

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef long double ld;

const ll mod = (ll)1e9 + 7;
const ll mxN = 200200;

void solve() {
	ll n,k,q;
	cin>>n>>k>>q;
	vll cnt(n+2);
	for(int i=0;i<q;i++){
		ll x;cin>>x;cnt[x]++;
	}
	for(int i=1;i<=n;i++)
		puts(q-cnt[i]<k?"Yes":"No");
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(20);
	cout << fixed;

	//ll t;cin>>t;while(t--)
	solve();

}


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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair

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<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


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

    i64 maxv = 0;
    i64 n = min(A, K);
    maxv += n;
    K -= n;
    if (K <= 0) {
        cout << maxv << endl;
        return 0;
    }
    n = min(B, K);
    K -= n;
    if (K <= 0) {
        cout << maxv << endl;
        return 0;
    }
    n = min(C, K);
    K -= n;
    maxv -= n;
    cout << maxv << endl;

    return 0;
}

Measured memory_bytes: 3640
def main():
    n = int(input())
    b = list(map(int, input().split()))
    a = [b[0]] + b
    for i in range(n - 1):
        if max(a[i], a[i + 1]) != b[i]:
            a[i] = min(a[i], b[i])
            a[i + 1] = min(a[i + 1], b[i])
    print(sum(a))


if __name__ == '__main__':
    main()



Measured memory_bytes: 9188
#include <iostream>
#include <ccomplex>
#include <vector>
#include <cassert>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <list>
#include <assert.h>
#include <math.h>
#include <valarray>
#include <stdio.h>
#include <algorithm>
#include <set>
#include <complex>
#include <list>
#include <time.h>
#include <stack>
#include <locale>
#include <clocale>
#include <ctype.h>
#include <wchar.h>

using namespace std;
typedef long long int LL;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;

#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)


int xcomp(vector<LL>& a, vector<LL>& b) {
	return a[0] < b[0];
}

#define XSORT(c) sort((c).begin(),(c).end(),xcomp)

#define ALL(x) (x).begin(),(x).end()
LL mod = 1000000007;

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

	vector<int> alpha(26,0);

	REP(i, H) {
		string S;
		cin >> S;
		REP(j, W) {
			alpha[S[j] - 'a']++;
		}
	}

	vector<int> mod4(4, 0);

	REP(i, 26) {
		mod4[alpha[i] % 4]++;
	}

	int num4 = 0;
	int num2 = 0;
	int num1 = 0;

	if (H % 2 == 0 && W % 2 == 0) {
		num4 = (H / 2)*(W / 2);
	}
	if (H % 2 == 0 && W % 2 == 1) {
		num4= (H / 2)*((W-1) / 2);
		num2 = (H / 2);
	}
	if (W % 2 == 0 && H % 2 == 1) {
		num4 = (W / 2)*((H - 1) / 2);
		num2 = (W / 2);
	}
	if (H % 2 == 1 && W % 2 == 1) {
		num4 = ((H-1) / 2)*((W - 1) / 2);
		num2 = ((H-1) / 2)+ ((W - 1) / 2);
		num1 = 1;
	}

	bool flag = true;

	if (num1 >= 1) {
		if (mod4[1] + mod4[3] != 1) {
			flag = false;
		}
		else {
			if (mod4[1] == 1) {
				mod4[1]--;
				mod4[0]++;
			}else
			if (mod4[3] == 1) {
				mod4[3]--;
				mod4[2]++;
			}
			else {
				cout << "ha?" << endl;
			}
		}
	}

	if (flag) {
		while (mod4[2] >= 1&&num2>=1) {
			mod4[2]--;
			mod4[0]++;
			num2--;
		}
		if (num2 % 2 != 0) {
			flag = false;
		}
	}

	if (flag) {
		if (mod4[1] != 0 || mod4[2] != 0 || mod4[3] != 0) {
			flag = false;
		}
	}

	if (flag) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

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

int main() {
  int N;
  cin >> N;
  if (N % 10 == 3) {
    cout << "bon" << endl;
  } else if (N % 10 <= 1 || N % 10 == 6 || N % 10 == 8) {
    cout << "pon" << endl;
  } else {
    cout << "hon" << endl;
  }
}

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

int main()
{
    int a, b;
    cin >> a >> b;
    string ans;
    if (a > 0)
        ans = "Positive";
    else if( a <= 0 and 0 <= b)
        ans = "Zero";
    else
    {
        int num = b - a + 1;
        if (num % 2 == 0)
            ans = "Positive";
        else
            ans = "Negative";
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>

int main()
{
	int n;
	std::cin >> n;
	if (n / 10 == 9 || n % 10 == 9) {
		std::cout << "Yes" << std::endl;
	}
	else {
		std::cout << "No" << std::endl;
	}
    return 0;
}



Measured memory_bytes: 256
#include <iostream>

#include <algorithm>
#include <cmath>
#include<string>
#include<array>
#include<vector>
#include<functional>
#include<unordered_map>
#include<map>
#include<numeric>
#include<limits>
#include<utility>
#include<queue>
#include<random>

using namespace std;
typedef long long LL;

int main() {


	int a, b = 0, c = 0;
	//----------------------
	int n, X, Z,A,B;
	int ans = 0;

	cin >> X;//円
	cin >> A;//ケーキ
	cin >> B;

	X = X - A;

	for (int i = 0; X > 0; i++) {

		X = X - B;


	}

	if (X < 0) { X = X + B; }

	cout << X << endl;

	

	//cout << ans << endl;

	//------------------------
	//cin >> Z;

	return 0;
}

Measured memory_bytes: 256
N = input()
A = input().split()

total = 0
judge = 0
while judge == 0:
    li = []
    for a in A:
        if int(a) % 2 == 0:
            li.append(int(a)//2)
        else:
            judge = 1
    if judge == 0:
        total += 1
    A = li

print(total)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repd(a,b,c) for(int a=c;a>=b;a--)
#define vi vector<int>
#define all(v) v.begin(),v.end()
#define F first
#define S second
#define pb push_back
#define pbb pop_back
const int N = 5e5+100;
signed main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int T=1;
   // cin>>T;
    for(int t=1;t<=T;t++)
  {
      //  cout<<"Case #"<<t<<": ";
     int n,k;
     cin>>n>>k;
     n-=(k*(n/k));
     n=min(n,abs(n-k));
     cout<<n<<"\n";


       
       

  }
    
    
}

Measured memory_bytes: 256
#![allow(unused_imports)]
use num::integer::gcd;
use proconio::*;
use std::cmp::*;
use std::collections::VecDeque;
use std::ops::*;

fn main() {
   input! {
      s: usize,
      w: usize,
   }

   if s <= w {
      println!("unsafe");
   } else {
      println!("safe");
   }
}


Measured memory_bytes: 2168
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define mt make_tuple
typedef long long int ll;

using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;

typedef long long int ll;

ll n, v[114514], hist[2][114514], maxi[2], argmaxi[2];

int main(void){
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> v[i];
		hist[i%2][v[i]]++;
	}
	for(int h=0;h<2;h++){
		for(int i=1;i<=100000;i++){
			if (maxi[h] < hist[h][i]){
				maxi[h] = hist[h][i];
				argmaxi[h] = i;
			}
		}
	}
	sort(&hist[0][0], &hist[0][114514], greater<ll>());
	sort(&hist[1][0], &hist[1][114514], greater<ll>());

	ll ans;
	if (argmaxi[0] != argmaxi[1]){
		ans = n - maxi[0] - maxi[1];
	}else{
		ans = min(n - maxi[0] - hist[1][1], n - maxi[1] - hist[0][1]);
	}
	cout << ans << endl;




    return 0;
}


Measured memory_bytes: 2816
import java.util.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String b = sc.next();
        String c = sc.next();
        System.out.println(a.substring(0, 1) + b.substring(1, 2) + c.substring(2, 3));
    }
}

Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int m=1e9+7;
int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    fastio
    string s;
    cin>>s;
    int flag=1;
    for(int i=0;i<s.size();++i){
        if((i%2==0 && s[i]=='L') || (i%2==1 && s[i]=='R') ){
            flag=0;
            break;
        }
    }
    if(flag) cout<<"Yes";
    else cout<<"No";
    return 0;
}

Measured memory_bytes: 3612
import java.io.*;
        import java.math.BigDecimal;
        import java.math.BigInteger;
        import java.util.*;

public class Main {
    static Input in = new Input(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        int N = in.nextInt();
        Set<String> S = new HashSet<>();
        for (int i = 0; i < N; i++)
            S.add(in.next());
        out.println(S.size());
        out.flush();
    }

    static class Input {
        private BufferedReader br;
        private String[] buff;
        private int index = 0;

        Input(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }
        String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }
        String next() {
            while (buff == null || index >= buff.length) {
                buff = nextLine().split(" ");
                index = 0;
            }
            return buff[index++];
        }
        byte nextByte() {
            return Byte.parseByte(next());
        }
        short nextShort() {
            return Short.parseShort(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        float nextFloat() {
            return Float.parseFloat(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
        BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }
    }
}

Measured memory_bytes: 62840
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

// vectorの重複削除
// std::sort(test.begin(), test.end());
// test.erase(std::unique(test.begin(), test.end()), test.end());

using namespace std;
using ll = long long;
using P = pair<int, int>; // vector<P> ba(n); みたいな感じですぐ使える ba[i] = P(a, b); make_pairをしなくてもいい
// typedef vector<int> v;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}
#define rep(i, c) for(int i = 0; i < int(c); i++)
#define ALL(x) (x).begin(), (x).end() //sort(ALL(obj))みたいな
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値
#define pb push_back //
// const int MOD = 1000000007;


int main() {
  char C;
  cin >> C;
  cout << ++C << endl; 
}


Measured memory_bytes: 256
N = int(input())
T, A = map(int,input().split())
# print(N,T,A)
list_H = list(map(int,input().split()))
# print(list_H)
ans = 0
min_diff = 1000
for i, h in enumerate(list_H):
    tmp = abs(A-(T-h*0.006))
    if tmp < min_diff:
        ans = i+1
        min_diff = tmp
print(ans)

Measured memory_bytes: 3060