akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

    int N;
    cin >> N;
    vector<ll> a(N), b(N);
    ll sum_a = 0, sum_b = 0;
    REP(i, N) {
        cin >> a[i];
        sum_a += a[i];
    }
    REP(i, N) {
        cin >> b[i];
        sum_b += b[i];
    }
    ll cnt = 0;
    REP(i, N) {
        if (a[i] < b[i]) { cnt += (b[i] - a[i] + 1) / 2; }
    }
    cout << (cnt <= sum_b - sum_a ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 384
import heapq
N, M = map(int, input().split())
A = [int(i) * -1 for i in input().split()]

heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)
    a = int(a / 2)
    heapq.heappush(A, a)

cost = 0
for a in A:
    cost -= a
print(cost)


Measured memory_bytes: 14184
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

class UnionFind
{
public:
    ll n;
    lvector uf;
    UnionFind(ll N);
    //~UnionFind();
    ll find(ll x);
    ll size(ll x) {return -(*this).uf[(*this).find(x)];}
    void unite(ll x, ll y);
};

UnionFind::UnionFind(ll N)
{
  (*this).n=N;
  rep(i,n) (*this).uf.emplace_back(-1);
}

ll UnionFind::find(ll x)
{
  if((*this).uf[x]<0) return x;
  (*this).uf[x]=(*this).find((*this).uf[x]);
  return (*this).uf[x];
}

void UnionFind::unite(ll x, ll y)
{
  x=(*this).find(x);
  y=(*this).find(y);
  if(x==y) return;
  if((*this).size(x)>(*this).size(y)) swap(x,y);
  (*this).uf[y]+=(*this).uf[x];
  (*this).uf[x]=y;
  (*this).n-=1;
  return;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,m,k,a,b,c,d;cin>>n>>m>>k;
  UnionFind un(n);
  lvector frd(n,0),blk(n,0);
  rep(i,m) {
    cin>>a>>b;a--,b--;
    un.unite(a,b);
    frd[a]+=1;frd[b]+=1;
  }
  rep(i,k) {
    cin>>c>>d;c--,d--;
    if(un.find(c)==un.find(d)) {blk[c]+=1;blk[d]+=1;}
  }
  rep(i,n) {
    ll ans=un.size(i)-blk[i]-frd[i]-1;
    if(i!=n-1) cout<<ans<<" ";
    else cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 3316
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
	string s,t;
	cin>>s>>t;
	sort(s.begin(),s.end());
	sort(t.begin(),t.end());
	reverse(t.begin(),t.end());
	if(s<t)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        long k = sc.nextLong();

            if(a+b<=k){
                a=0;
                b=0; 
                //System.out.println("1");
            }else if(a<k){
                b=b-(k-a);
                a=0;
               // System.out.println("2");
            }else{
                a=a-k;
                b=b;
               // System.out.println("3");

            }
    System.out.println(a+" "+b);

    }
}


Measured memory_bytes: 23764
#include<climits>
#include<iostream>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

const int inf = INT_MAX;
const int N   = 2000;

int ori[N];
int tool[N];
bool is_in_loop[N];
int ans;

void calc_loop_min(int *a,int p){
  int ret = inf;
  rep(i,p)is_in_loop[a[i]]=true;
  rep(i,p){
    int tmp = 0;
    rep(j,p){
      if (j == i)tmp+= ori[a[j]];
      else       tmp+=tool[a[j]];
    }
    ret=min(ret,tmp);
  }
  ans+=ret;
}

vector<int> edge[N];
bool gvis[N];
bool vis[N];
void dfs(int now,int *st,int p){
  if (gvis[now])return;
  if (vis[now]){
    calc_loop_min(st,p);
    return;
  }
  vis[now]=true;
  rep(i,edge[now].size()){
    int next=edge[now][i];
    st[p]=now;
    dfs(next,st,p+1);
  }
  if (!is_in_loop[now]){
    ans+=tool[now];
  }
  gvis[now]=true;
}

int getindex(string &a,map<string,int> &M){
  int index = M.size();
  if (M.find(a) == M.end())M[a]=index;
  return M[a];
}

main(){
  int n;
  int path[N];
  while(cin >> n&&n){
    ans=0;
    rep(i,N){
      is_in_loop[i]=false;
      edge[i].clear();
      vis[i]=false;
      gvis[i]=false;
      ori[i]=0;
      tool[i]=0;
    }

    map<string,int> M;
    rep(i,n){
      string a,b;
      int c,d;
      int index1,index2;
      cin>>a>>c>>b>>d;
      index1=getindex(a,M);
      index2=getindex(b,M);
      edge[index2].push_back(index1);
      ori[index1]=c;
      tool[index1]=d;
    }

    rep(i,M.size()){
      if (!gvis[i])dfs(i,path,0);
    }
    
    cout << ans << endl;
  }
}

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

const int N = 2005;

char s[N];
int n, r[N], l[N], f[N], ans = 1e9;
bool a[N], b[N];
vector<int>p[N];

int gr (int x) {
	if (r[x] != -1) return r[x];
	return r[x] = b[x] ? 0 : gr((x + 1) % n) + 1;
}

int gl (int x) {
	if (l[x] != -1) return l[x];
	return l[x] = b[x] ? 0 : gl((x - 1 + n) % n) + 1;
}

void Max (int &x, int y) { if (x < y) x = y; }
void Min (int &x, int y) { if (x > y) x = y; }

void Solve () {
	memset(l, -1, sizeof l);
	memset(r, -1, sizeof r);
	for (int i = 0; i < n; ++i) gr(i), gl(i);
	f[n - 1] = 0;
	for (int i = 0; i < n; ++i) {
		int cnt = 0;
		for (int j = 0; j < n; ++j) p[j].clear();
		for (int j = 0; j < n; ++j) if ((a[j] ^ b[(j + i) % n])) {
			++cnt;
			p[r[j]].emplace_back(l[j]);
		}
		for (int j = n - 1; j; --j) {
			f[j - 1] = f[j];
			for (auto v : p[j]) Max(f[j - 1], v);
		}
		for (int j = i; j < n; ++j) Min(ans, cnt + j + j - i + f[j] * 2);
	}
}

int main () {
	scanf("%s", s);
	n = strlen(s);
	for (int i = 0; i < n; ++i) a[i] = s[i] - '0';
	scanf("%s", s);
	for (int i = 0; i < n; ++i) b[i] = s[i] - '0';
	if (*max_element(b, b + n) == 0) {
		 if (*max_element(a, a + n) == 1) return puts("-1"), 0;
		 return puts("0"), 0;
	}
	Solve();
	reverse(a, a + n);
	reverse(b, b + n);
	Solve();
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
float PHI = 1.6180339;
const float  PI_F=3.14159265358979f;
#define MAX 100000 
#define endl "\n"    
#define manhunt 32 
//typedef long long float;
#define int long long
typedef pair<int, int> pii;
//#define float unsigned long long
#define FAST ios_base::sync_with_stdio(false);cin.tie();cout.tie();
 
bool sortbysec(const pair<int,int> &a, 
                   const pair<int,int> &b) 
{ 
       return a.second<b.second; 
}
 
bool sortbysec1(const pair<int,int> &a, 
                   const pair<int,int> &b) 
{ 
       return a.second>b.second; 
}
 
bool isPrime(int n) 
{ 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
} 

string query(int mid)
{
  cout << mid << endl;
  string s;
  cin >> s;
  return s;
}

int maxSubArraySum(int a[], int size) 
{ 
   int max_so_far = a[0]; 
   int curr_max = a[0]; 
  
   for (int i = 1; i < size; i++) 
   { 
        curr_max = max(a[i], curr_max+a[i]); 
        max_so_far = max(max_so_far, curr_max); 
   } 
   return max_so_far; 
} 

int32_t main()
{
    FAST
    cout << fixed << setprecision(17);

    int n,m;
    cin>>n>>m;
    int arr[m+10];
    string arr2[m+10];
    int maxn=1e5;
    int vis[maxn+10];
    int pen[maxn+10];
    for(int i=0;i<=maxn;i++)
    {
        vis[i]=0;
        pen[i]=0;
    }
    for(int i=0;i<m;i++)
    {
        cin>>arr[i]>>arr2[i];
    }
    int ac=0,wr=0;
    for(int i=0;i<m;i++)
    {
        if(vis[arr[i]]==0)
        {
            if(arr2[i]=="AC")
            {
                vis[arr[i]]=1;
                ++ac;
                wr+=pen[arr[i]];
            }
            else
            {
                ++pen[arr[i]];
            }
        }
    }
    cout<<ac<<" "<<wr<<endl;

    

  
  return 0;
}

Measured memory_bytes: 8064
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <map>

#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int INF = pow(2,29);
const int MOD = 1000000007;

struct UnionFind {
  vector<int> par;

  UnionFind(int N) : par(N) { rep(i, N) par[i] = i; }

  int root(int x) { 
    if (par[x]== x) return x;
    else return par[x] = root(par[x]);
  }

  void unite(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    if (rx==ry) return;
    par[rx] = ry;
  }

  bool same(int x, int y) {
    return root(x) == root(y);
  }

};

int main() {
  int N, M; cin >> N >> M;
  map<int, vector<int>> lan;
  rep(i, N) {
    int K; cin >> K;
    rep(j, K) {
      int L; cin >> L;
      lan[L].push_back(i);
    }
  }

  UnionFind tree(N);
  for (auto x: lan) {
    rep(i, x.second.size()-1) {
      tree.unite(x.second[i], x.second[i+1]);
    }
  }

  string result = "YES";
  // rep(i, N) cout << tree.root(i) << " "; cout << endl;
  rep(i, N) if (!tree.same(0, i)) result = "NO";
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 7168
parseInt(x)=parse(Int,x)
parseMap(x::Array{SubString{String},1})=map(parseInt,x)

function main()
	l,r = readline() |> split |> parseMap
	if r-l>=2019
		println(0)
	else
		p = l%2019
		q = r%2019
		m = 2018
		for i in p:q-1
			for j in i+1:q
				m = min(m,i*j%2019)
			end
		end
		println(m)
	end
end

main()

Measured memory_bytes: 168144
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

#include <bits/stdc++.h>
using namespace std;

vector<int> vec[100010],color(100010,-1);

void dfs(int u){
  if(color[u]==-1) color[u]=u;
  
  stack<int> s;
  s.push(u);
  while(!s.empty()){
    int r=s.top(); s.pop();
    for(auto x:vec[r]){
      if(color[x]==-1){
        color[x]=u;
        s.push(x);
      }
    }
  }
}
  

int main() {
  int n,m,q;
  cin>>n>>m;
  
  int s,t;
  rep(i,m){
    cin>>s>>t;
    vec[s].push_back(t);
    vec[t].push_back(s);
  }
  
  rep(i,n){
    if(color[i]==-1) dfs(i);
  }
  
  cin>>q;
  rep(i,q){
    cin>>s>>t;
    if(color[s]==color[t]) cout<<"yes"<<endl;
    else cout<<"no"<<endl;
  }
  
  return 0;
}


Measured memory_bytes: 11840
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input()) # n=1
def inpm(): return map(int,input().split()) # x=1,y=2
def inpl(): return list(map(int, input().split())) # a=[1,2,3,4,5,...,n]
def inpls(): return list(input().split())  # a=['1','2','3',...,'n']
def inplm(n): return list(int(input()) for _ in range(n)) # x=[] 複数行
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)] # [[2,2,2,2],[1,1,1,1],[3,3,3,3]] 
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) # [[1,1,1,1],[2,2,2,2],[3,3,3,3]] 

def main():
    n,a,b,c,d = inpm()
    for i in range(n-1):
        minus = i
        plus = n-1-i
        lower = minus*(-d) + plus*c
        higher = minus*(-c) + plus*d
        if lower <= b-a and b-a <= higher:
            print('YES')
            return
    print('NO')

if __name__ == "__main__":
    main()

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

int main(){
  int n,x,min_m;  
  vector<int> m(n);
  cin >> n >> x;
  for (int i =0; i<n; i++){
    cin >> m[i];
  }
  min_m = *min_element(m.begin(), m.begin()+n);
  int sum_m=0;
  for (int i =0; i<n; i++){
    sum_m += m[i];
  }
  int tot = n + (x-sum_m)/min_m;
  cout << tot << endl;
}
     
       

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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
// #define int long long
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

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 GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { return a * b / GCD(a, b); }

inline bool inside(int y, int x, int H, int W) {
    return (y >= 0 && x >= 0 && y < H && x < W);
}

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

signed main()
{
  int m,k; cin>>m>>k;
  int n=round(pow(2,m));
  if(k>=n||m==1&&k==1){
    cout<<-1<<endl;
    return 0;
  }
  if(m==0&&k==0){
    cout<<"0 0"<<endl;
    return 0;
  }
  if(m==1&&k==0){
    cout<<"0 0 1 1"<<endl;
    return 0;
  }
  rep(i,n){
    if(i!=k) cout<<i<<" ";
  }
  cout<<k<<" ";
  for(int i=n-1; i>=0; i--){
    if(i!=k) cout<<i<<" ";
  }
  cout<<k<<endl;
}


Measured memory_bytes: 1792
import numpy as np

H,W = map(int, input().split())
s = [list(input()) for j in range(H)]
s = (np.array(s) == ".") * 1

L = np.zeros((H, W), dtype = int)
R = np.zeros((H, W), dtype = int)
U = np.zeros((H, W), dtype = int)
D = np.zeros((H, W), dtype = int)


for j in range(W):
    if j == 0:
        L[:,j] = s[:,j]
    else:
        L[:,j] = (L[:,j-1] + 1) * s[:,j]
        

for j in reversed(range(W)):
    if j == W-1:
        R[:,j] = s[:,j]
    else:
        R[:,j] = (R[:,j+1] + 1) * s[:,j]


for i in range(H):
    if i == 0:
        U[i,:] = s[i,:]
    else:
        U[i,:] = (U[i-1,:] + 1) * s[i,:]

for i in reversed(range(H)):
    if i == H-1:
        D[i,:] = s[i,:]
    else:
        D[i,:] = (D[i+1,:] + 1) * s[i,:]

print(np.max(L + R + U + D - 3))


Measured memory_bytes: 266532
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		if(N == 1){
			Console.WriteLine(A[0] == 0 ? 0 : -1);
			return;
		}
		
		if(A[0] != 0){
			Console.WriteLine(-1);
			return;
		}
		
		long tot = 0;
		
		int r = 0;
		while(r < N){
			while(r <N - 1 && A[r+1] == A[r] + 1) r++;
//Console.WriteLine("r:{0}",r);
			tot += A[r];
			if(r == N - 1){
				r++;
				continue;
			}
			if(r < N - 1 && A[r+1] <= A[r]){
				r++;
				continue;
			}
			Console.WriteLine(-1);
			return;
		}
		
		Console.WriteLine(tot);
		
		
		
		
		
		
	}
	int N;
	long[] A;
	public Sol(){
		N = ri();
		A = new long[N];
		for(int i=0;i<N;i++) A[i] = rl();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 16604
#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
inline bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
inline bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll n, m;
  cin >> n >> m;
  print(n*(n-1)/2+m*(m-1)/2);
}


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



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll e;
    //ll x=1,y=100,z;
//    for(int i=1;i<=100;i++){
//        e=(x*x)+(y*y)+(i*i)+(x*y)+(y*i)+(i*x);
//        cout<<e<<"->"<<i<<endl;
//    }
    map<ll,ll>f;
    for(int x=1;x<=100;x++){
        for(int y=1;y<=100;y++){
            for(int z=1;z<=100;z++){
                e=(x*x)+(y*y)+(z*z)+(x*y)+(y*z)+(z*x);
                f[e]++;
            }
        }
    }
    ll n;
    cin>>n;
    for(int i=1;i<=n;i++)cout<<f[i]<<endl;
}


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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repr(i, n) for(int i = (n-1); i >= 0; --i)

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 long long ll;
typedef pair<int, int> P;

const int MAX = 200005;
const int INF = 1001001001;
const int MOD = 1000000007;

int main(){
    int N;
    cin >> N;

    vector<int> A(N);
    for (auto &i : A) cin >> i;

    ll ans = 1000;

    rep(i, N-1) {
        if (A[i] >= A[i+1]) continue;
        ans = ans % A[i] + (ll)(ans / A[i]) * A[i+1];
    }

    cout << ans << endl;
}

Measured memory_bytes: 3628
#include <iostream>

using namespace std;

int main() {
  int S, h, m, s;
  cin >> S;
  h = S / 3600;
  m = (S - 3600 * h) / 60;
  s = S - 3600 * h - m * 60; 
  cout << h << ':' << m << ':' << s << endl;
  return 0;
}


Measured memory_bytes: 3100
#include <cstdio>
#include <sstream>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <iostream>
#include <fstream>
#include <numeric>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <iterator>
#include <iomanip>
#include <unordered_map>

using namespace std;

#define MAX 30001
#define ll long long int



int main()
{
    //freopen("input.txt", "r", stdin); // for getting input from input.txt
    //freopen("output.txt", "w", stdout);// for writing output to output.txt

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    string s;
    cin>>s;
    if(s[0]==s[1] && s[1]==s[2]) cout<<"No";
    else cout<<"Yes";

}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main()
{ int n,i,j,counter;
int tinggi [100];
	cin >> n;
	counter = 0;
	for(i=0;i<n;i++)
	{
		cin >> tinggi[i];
		for(j=0;j<=i;j++)
		{
			if(tinggi[i] - tinggi[j] >= 0)
			{
				
			}
			else break;
			if(i==j)
			{
				counter++;
			}
		}
	}
	cout << counter << endl;
}

Measured memory_bytes: 256
//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>

using namespace std;
int main() {
	string s, t;
	cin >> s >> t;
	sort(s.begin(), s.end());
	sort(t.begin(), t.end(), greater<>());

	size_t Size = s.size();
	size_t Tize = t.size();
	int SumD = 0;

	for (int i = 0; i < Size; i++) {
		if (s[i] != t[i])SumD++;
		if (s[i] < t[i]) {
			puts("Yes");
			return 0;
		}
		else if (Tize - i - 1 == 0) {
			puts("No");
			return 0;
		}
		else if (Size - i - 1 == 0 && SumD == 0) {
			puts("Yes");
			return 0;
		}
	}
	puts("No");

	return(0);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define N 100010
#define ll long long
#define inf 1e9
#define MOD 1000000007
#define pii pair<ll, ll>

using namespace std;

int main()
{
    int a,b;
    char c;
    cin>>a>>c>>b;
    if(c=='+')
        cout<<(a+b)<<endl;
    else
        cout<<(a-b)<<endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define forn(i,n) for(int i = 0; i < (int) n; i++)
#define ios ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;

#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define forn(i,n) for(int i = 0; i < (int) n; i++)
#define ios ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;
typedef long long ll;

// dim
const int d = 63;
ll basis[d];

void insert(ll bm) {
  forn(i, d) if (bm >> i & 1)
    if (!basis[i]) {
      basis[i] = bm;
      return;
    } else bm ^= basis[i];
  assert(!bm);
}

bool inside(ll bm) {
  forn(i, d) if (bm >> i & 1)
    if (!basis[i]) return 0;
    else bm ^= basis[i];
  assert(!bm);
  return 1;
}

void solve() {
  int n;
  cin >> n;
  vector<ll> a(n);
  forn(i, n) cin >> a[i];
  string s;
  cin >> s;
  fill(basis, basis + d, 0);

  for(int i = n - 1; i >= 0; i--) {
    if (s[i] == '0') insert(a[i]);
    else if (!inside(a[i])) {
      cout << "1\n";
      return;
    }
  }

  cout << "0\n";
}

int main() {
  ios;
  int t;
  cin >> t;
  while(t--) solve();
}


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

int main() {
	//cout<<"GfG!";
	
	int t =1;
	//cin>>t;
	while(t--)
	{
	    
	    int a;
	    int b,c;
	    cin>>a>>b>>c;
	    int temp = b/a ;
	    int temp1 = a*(temp+1);
	    if(temp1<=c)
	        cout<<"OK"<<endl;
	    else if(temp*a >=b && (temp*a <= c)) 
	        cout<<"OK";
	   else
	        cout<<"NG"<<endl ;
	    
	    
	}
	return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <list>
#include <algorithm>

using namespace std;

typedef long long s64;

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

	if (c <= b+1)
	{
		cout << (b + c) << endl;
		return 0;
	}

	c -= b;
	cout << (std::min(a+1, c) + b + b) << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define pi  acos(-1)
const int w=5e5+5;
const ll mod=1e9+7;
int main()
{
    int i,j;
    ll a,b,c;
    cin>>a>>b>>c;
    ll u=c-a-b;
    if(u<=0)
        puts("No");
    else
    {
        u*=u;
        ll v=4*a*b;
        if(v<u)
            puts("Yes");
        else
            puts("No");
    }
    return 0;
}


Measured memory_bytes: 256
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<stdlib.h>
#include<queue>
#include<map>
#include<vector>
#include<cmath>
#include<fstream>
#include <set>
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
const int  MAXN =2e5+10;
const int mod = 1e14 ;
const long long INF = 0x7f7f7f7f7f7f7f7f;
const int inf= 0x3f3f3f3f;
#define eps 1e-8
#define PI 3.1415926535898
#define lowbit(x) (x&(-x))
using namespace std ;
//getline(cin,s);
//set<ll>::iterator it;
//map<int,int>::iterator it;
typedef long long ll;
ll a[MAXN];
int main()
{
	int n,k;
	ll ans=1,ans1=0,pre=1,pre1=0;
	scanf("%d %d",&n,&k);
	for(int i=1;i<=n;i++) 
	{
	    scanf("%lld",&a[i]);
	} 
	for(int i=k+1;i<=n;i++)
	{
		if(a[i]>a[i-k]) printf("Yes\n");
		else printf("No\n");
		pre=ans;
	}
	return 0;
} 

Measured memory_bytes: 5220
import java.util.*;
public class Main {
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);
	int N = Integer.parseInt(scan.next());
	int a[] = new int[N];
	for(int i=0;i<N;i++){
	    a[i]= Integer.parseInt(scan.next());
	}
	int p=0;
	for(int i=0;i<N;i++){
	    int j=0;
	    j=a[i];
	    if((i+1)==a[j-1])
		p++;
	}
	p = p/2;
	System.out.println(p);
    }
}

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

int main(){
  
  int n;
  cin >> n;
  
  int l, i=0, a[2*n-1];
  while(cin>>l){
        a[i] = l;
        i++;
  }
  

  int ans=0;
  for (int k = 0; k < n; k++) {
    if(a[k] > a[n+k]){
      ans = ans + a[k] - a[n+k];
    }
  }
cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
long long int mod = (long long int)1000000007;
using namespace std;

void solve()
{
    ll i,j,k,n;
    std::cout.precision(10);
    int yes=0;
    ll a,b,c;
    cin>>a>>b>>c>>k;
    ll sum=0;
    sum=min(k,a);
    k-=a;
    if(k>0)
    {
      
        k-=b;
    }
    if(k>0)
    {
        sum-=min(k,c);
        k-=c;
    }
    cout<<sum;
}

int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
    int i,j,k;
    int t;
    std::cout.precision(10);
    t=1;
    while(t--)
    {
        solve();
        cout<<"\n";
    }
}

Measured memory_bytes: 3656
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int n = stdin.nextInt();
        int m = stdin.nextInt();

        int[] c = new int[n];
        for (int i = 0; i < m; i++) {
            int a = stdin.nextInt() - 1;
            int b = stdin.nextInt() - 1;
            c[a] += 1;
            c[b] += 1;
        }

        String answer = Arrays.stream(c).allMatch(v -> v % 2 == 0) ? "YES" : "NO";
        System.out.println(answer);
    }
}

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

int main() {
  string s;
  getline(cin, s);
  for(int i = 0; i < s.size(); i++) {
    if(isupper(s.at(i))) s.at(i) = tolower(s.at(i));
    else if(islower(s.at(i))) s.at(i) = toupper(s.at(i));
  }

  cout << s << "\n";
}


Measured memory_bytes: 3204
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

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

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

    sort(a.begin(),a.end(),greater<ll>());

    map<ll,ll> mp;

    for(int i = 0; i < n; i++){
        if(mp.find(a[i]) == mp.end()){
            mp[a[i]] = 1;
        }else{
            mp[a[i]]++;
        }
    }

    ll ans = 0;

    for(int i = 0; i < n; i++){
        if(mp[a[i]] > 0){
            mp[a[i]]--;
            bitset<32> bs(a[i]);
            ll msb;
            for(int j = 31; j >= 0; j--){
                if(bs[j]){
                    msb = j+1;
                    break;
                }
            }
            ll need = (1LL << msb) - a[i];
            if(mp[need] > 0){
                mp[need]--;
                ans++;
            }
        }
    }

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

Measured memory_bytes: 26880
#include<bits/stdc++.h>
using namespace std;
int N, M;
int main(){
  cin >> N >> M;
  vector<vector<int>> adj (N);
  for(int i = 0; i < M; i++){
    int a, b; cin >> a >> b; a--; b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  queue<pair<int, int>> q; q.push({0, -1});
  vector<int> res (N, -2);
  while(!q.empty()){
    auto curr = q.front(); q.pop();
    if(res[curr.first] != -2) continue;
    res[curr.first] = curr.second;
    for(int i = 0; i < adj[curr.first].size(); i++){
      q.push({adj[curr.first][i], curr.first});
    }
  }
  cout << "Yes" << endl;
  for(int i = 1; i < N; i++) cout << res[i] + 1 << endl;
}


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

using namespace std;
 
using ll = long long;
using ull = unsigned long long;
using ldouble = long double;
 
const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s) cout << fixed << setprecision(10) << s << endl;

string res;

int main()
{
    ll n;
    cin >> n;

    println(n * (n + 1)/ 2);
}


Measured memory_bytes: 3584
using System;

namespace AOJ.Volume1
{
    public class Train
    {
        public static int Main()
        {
            int cnt = int.Parse(Console.ReadLine());
            for (int c = 0; c < cnt; c++)
            {
                string input = Console.ReadLine();
                
                // 列車の初期化
                string answer = input.Substring(0, 1);
                while (input.IndexOf("->") > 0 || input.IndexOf("<-") > 0)
                {
                    string move = input.Substring(1, 2);
                    string before = input.Substring(0, 1);
                    string after = input.Substring(3, 1);
                    // 前の車両に移動する場合(a->b)→"a"が最後尾なら文字列の最後に"b"を追加
                    // 後ろの車両に移動する場合(a<-b)→"a"が先頭なら文字列の先頭に"b"を追加
                    if (move == "->")
                    {
                        if (answer.IndexOf(before) == answer.Length - 1) { answer += after; }
                    }
                    else
                    {
                        if (answer.IndexOf(before) == 0) { answer = after + answer; }
                    }
                    input = input.Substring(3);
                }

                Console.WriteLine(answer);
            }
            return 0;
        }
    }
}

Measured memory_bytes: 10452
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

#define pb push_back
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<i_i, int> p_i;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
template<class T> using vv=vector<vector< T > >;
typedef deque<int> di;
typedef deque<deque<int> > ddi;

int main() {
  while(true) {
    int n;
    cin >> n;
    if (n == 0) { break; }
    set<char> set;
    map<char, char> map;
    for (int i = 0; i < n; ++i) {
      char tmp1, tmp2;
      cin >> tmp1 >> tmp2;
      set.insert(tmp1);
      map[tmp1] = tmp2;
    }

    int m;
    cin >> m;
    string str;
    for (int i = 0; i < m; ++i) {
      char tmp;
      cin >> tmp;
      if (set.count(tmp) == 1) {
        tmp = map[tmp];
      }
      str += tmp;
    }
    str += "\n";
    cout << str;
  }

  return 0;
}

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

using ll=long long; 

void solve(){
	int n,m,k;
	cin>>n>>m>>k;
	for(int i=0; i<n+1; i++){
		for(int j=0; j<m+1; j++){
			int s=i*j;
			s+=(n-i)*(m-j);
			if(s==k){
				cout<<"Yes"<<endl;
				return;
			}
		}
	}
	cout<<"No"<<endl;
}

signed main(){
	//while(1)
	solve();
}

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

int main(){
  int h,w;
  cin >> h >> w;
  char a[h][w];
  int tate[w]={0},yoko[h]={0};
  rep(i,h)rep(j,w){
    cin >> a[i][j];
    if(a[i][j]=='#')tate[j]=1;
    if(a[i][j]=='#')yoko[i]=1;
  }

  rep(i,h){
    rep(j,w){
      if(yoko[i]==1 && tate[j]==1){
        cout << a[i][j];
      }
    }
    if(yoko[i]==1)cout << endl;
  }

}

/*
愚直に消していく手段が思いつかなかったので解説を読んだ
>> まず，黒いマスが含まれる行および列をマークします．
>> その後，マークされた行とマークされた列が交差する位置の ai,j のみを出力すればよいです．
天才か？？？？？
*/

Measured memory_bytes: 256
l, r = map(int, input().split())
l_mod = l % 2019
r_mod = r % 2019
if l_mod == 0 or r_mod == 0 or l_mod >= r_mod or r - l >= 2019:
  print(0)
else:
  ans = 2019
  for i in range(l_mod, r_mod):
    for j in range(i + 1, r_mod + 1):
      ans = min(ans, (i * j) % 2019)
  print(ans)

Measured memory_bytes: 41836
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

vector<vector<int> > G;
vector<int>  dist;

int main() {
    int n, m, s, t;  cin >> n >> m;
    G.resize(3*n);
    dist.resize(3*n, -1);
    for (int i = 0; i < m; i++) {
        int u, v;   cin >> u >> v;  u--, v--;
        G[u].push_back(v+n);
        G[u+n].push_back(v+2*n);
        G[u+2*n].push_back(v);
    }
    cin >> s >> t;
    queue<int> que;
    dist[s-1] = 0;
    que.push(s-1);

    while (!que.empty()) {
        int u = que.front();
        que.pop();

        for (auto v: G[u]) {
            if (dist[v] != -1)
                continue;
            
            dist[v] = dist[u] + 1;
            que.push(v);
        }
    }

    cout << ((dist[t-1] == -1) ? -1 : dist[t-1] / 3) << endl;
    return 0;
}

Measured memory_bytes: 20848
# a1 = 0 とする
B = list(map(int, input().strip().split(' ')))
for _ in range(2):
  C = list(map(int, input().strip().split(' ')))
  if B[0]-C[0] == B[1]-C[1] == B[2]-C[2]:
    continue
  else:
    print('No')
    exit()
print('Yes')

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

#define pb push_back
#define ll long  long
#define endl "\n"
#define ui unsigned integer

using namespace std;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	set<int>v;
	int a,b,c,d,i,t,count=0;
	bool x=0;
	cin>>t;
	while(t--){
        cin>>a;
       auto it=v.find(a);
       if(*it!=a){v.insert(a);}
       else{v.erase(a);}
	}
	cout<<v.size()<<endl;




	return 0;
}


Measured memory_bytes: 8252
def ok(i,j,k):
    if i<j+k and j<i+k and k<i+j:
        return(True)
    else:
        return(False)

n=int(input())
l=list(map(int,input().split()))

an=0
if n<3:
    print('0')
    exit()
for i in range(n):
    for j in range(i+1,n):
        if l[i]==l[j]:
            continue
        for k in range(j+1,n):
            if l[i]==l[k] or l[j]==l[k]:
                continue
            else:
                if ok(l[i],l[j],l[k]):
                    an+=1
print(an)

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

using namespace std;
typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef map <int , int> mint;
typedef map <ll , ll> mll;
typedef set <int> si;
typedef set <ll> sll;
typedef si :: iterator sitr;
typedef si :: reverse_iterator rsitr;
typedef sll :: iterator sltr;
typedef sll :: reverse_iterator rsltr;
#define mset multiset

typedef mset <int> msi;
typedef mset <ll> msll;
typedef msi :: iterator msitr;
typedef msi :: reverse_iterator msritr;
typedef msll :: iterator msltr;
typedef msll :: reverse_iterator mslritr;

#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'

char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 126)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 126)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 126)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
// end of Template

ll ans,n;
int main(){

//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    for(int i=0;i<=1e5;i++){
        if(i*i > n){ans=(i-1)*(i-1);break;}
    }
    cout<<ans<<newl;

}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int min = Integer.MAX_VALUE;
		for(int i=1;i<a;i++) {

			int tmpA = i;
			int sum = 0;

			while(tmpA > 0) {
				sum += tmpA%10;
				tmpA = tmpA/10;
			}

			int tmpB = a - i;

			while(tmpB > 0) {
				sum += tmpB%10;
				tmpB = tmpB/10;
			}

			if(sum < min) {
				min = sum;
			}

		}


		System.out.println(min);

	}



}

Measured memory_bytes: 22612
// C - Walk on Multiplication Table
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
	ll N; cin>>N;
	ll ans = LLONG_MAX;
	ll n = sqrt(N);
	for(ll a=n; a>=1; --a){
		if(N%a) continue;
		ll b = N/a;
		ans = a + b - 2;
		break;
	}
	cout<< ans <<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int m, nmin, nmax;
	while (cin >> m >> nmin >> nmax&&m&&nmin&&nmax) {
		int p[200];
		for (int i = 0; i < m; i++)cin >> p[i];
		int soeji, sa1=p[nmin-1]-p[nmin],sa2;
		for (int i = nmin - 1; i <= nmax - 1; i++) {
			if (sa1 <= p[i] - p[i + 1]) {
				sa1 = p[i] - p[i + 1];
				soeji = i+1;
			}
		}
		cout << soeji << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
use proconio::input;

fn main() {
	input! {
		x: u64
	}

	let mut monney: u64 = 100;
	let mut cnt = 0;

	loop {
		monney = monney + monney / 100;
		cnt += 1;
		if monney >= x {
			println!("{}", cnt);
			return;
		}
	}
}


Measured memory_bytes: 2132
//Keep Working Hard
  #include<bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp> 
  #include <ext/pb_ds/tree_policy.hpp>
  #pragma comment(linker, "/stack:200000000")
  #pragma GCC optimize("O3")
  #pragma GCC optimize("Ofast") 
  #pragma GCC optimize("unroll-loops")
 using namespace std;
  using namespace __gnu_pbds;
 #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define int long long
  #define all(v) v.begin(),v.end()
  #define f first
  #define s second
  #define PB push_back
  #define MP make_pair
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  #define MOD 1000000007
  #define N 200005
  #define INF 1000000000000000



typedef tree<
pair<int, int>,
null_type,
less<pair<int, int>>,
rb_tree_tag,
tree_order_statistics_node_update> ordered_set;


int a[N],b[N];


int32_t main()
{


   int arr[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

   int n;
   cin >> n;
   cout << arr[n-1];


  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

void bakuha(int,int,char[8][9]);

int main(void) {
	char bomb[8][9];
	int x,y;
	int i;
	int count,max;
	scanf("%d",&max);
	for(count=0;count<max;count++) {
		for(i=0;i<8;i++)scanf("%s",bomb[i]);
		scanf("%d",&x);
		scanf("%d",&y);
		bakuha(x-1,y-1,bomb);
		printf("Data %d:\n",count+1);
		for(i=0;i<8;i++)printf("%s\n",bomb[i]);
	}
	return 0;
}

void bakuha(int x,int y,char bomb[8][9]) {
	int i;
	if(bomb[y][x]!='1')return;
	bomb[y][x]='0';
	for(i=1;i<=3;i++) {
		if(x-i>=0)bakuha(x-i,y,bomb);
		if(x+i<8)bakuha(x+i,y,bomb);
		if(y-i>=0)bakuha(x,y-i,bomb);
		if(y+i<8)bakuha(x,y+i,bomb);
	}
}

Measured memory_bytes: 0
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>
#include <cstdlib>
#include <map>
#include <queue>
#include <deque>
#include <algorithm>
#include <stack>
#include <functional>
#include <sstream>
#define rep(i,j,n) for(i=j;i<(n);i++)
#define rrep(i,j,n) for(i=(n)-1;i>j-1;i--)
typedef long long int lli;
#define N 1000000007
#define M 998244353

using namespace std;

int main(){
    lli k,a=0;
    map<lli,lli> mp;
    lli i=1;
    cin>>k;
    if(k%2==0){
        i=-1;
    }
    else{
        while(1){
            a=a*10+7;
            a%=k;
            mp[a]++;
            if(a==0){
                break;
            }
            if(mp[a]==2){
                i=-1;
                break;
            }
            i++;
        }
    }
    cout<<i<<endl;
}


Measured memory_bytes: 65948
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;



int main(){
	string str;
	string d="00kstnhmyr";
	cin>>str;
	for(int i=0;i<str.size();i+=2){
		if(str[i]=='1'){
			if(str[i+1]=='T')cout<<"a";
			if(str[i+1]=='L')cout<<"i";
			if(str[i+1]=='U')cout<<"u";
			if(str[i+1]=='R')cout<<"e";
			if(str[i+1]=='D')cout<<"o";
		}
		else if(str[i]=='0'){
			if(str[i+1]=='T')cout<<"wa";
			if(str[i+1]=='U')cout<<"nn";
			if(str[i+1]=='D')cout<<"wo";
		}
		else{
			cout<<d[str[i]-'0'];
			if(str[i+1]=='T')cout<<"a";
			if(str[i+1]=='L')cout<<"i";
			if(str[i+1]=='U')cout<<"u";
			if(str[i+1]=='R')cout<<"e";
			if(str[i+1]=='D')cout<<"o";
			
		}
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 1184
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int,  int>;
using pll = pair<ll, ll>;
using edge = pair<int, ll>;
using graph = vector<vector<int>>; 
using WeightedGraph = vector<vector<edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

int main() {
  ll x,y;cin >> x>> y;
  ll n=x, ans = 0;
  while(n<=y){
    ++ans;
    n*=2LL;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>

using namespace std;

struct Segment {
    int x1, y1, x2, y2;
    
    Segment(int x1 = 0, int y1 = 0, int x2 = 0, int y2 = 0): 
    x1(min(x1, x2)), x2(max(x1, x2)), y1(min(y1, y2)), y2(max(y1, y2)) {}
    
};

const int LEFT = 0;
const int BOTTOM = 1;
const int TOP = 2;
const int RIGHT = 3;

struct Event {
    int seg;
    int type;
    int x;
    
    Event(int seg = -1, int type = -1, int x = -1): seg(seg), type(type), x(x) {}
    
    bool operator<(const Event other) const {
        if (x == other.x) {
            return type < other.type;
        }
        else {
            return x < other.x;
        }
    } 
};

int main() {
    int n;
    cin >> n;
    int x1, y1, x2, y2;
    vector<Segment> segs(n);
    vector<Event> events;
    
    for (int i = 0; i < n; i++) {
        cin >> x1 >> y1 >> x2 >> y2;
        segs[i] = Segment(x1, y1, x2, y2);
        if (segs[i].y1 == segs[i].y2) {
            events.push_back(Event(i, LEFT, segs[i].x1));
            events.push_back(Event(i, RIGHT, segs[i].x2));
        }
        else {
           events.push_back(Event(i, BOTTOM, segs[i].x1));
           events.push_back(Event(i, TOP, segs[i].x1)); 
        }  
    }
    
    sort(events.begin(), events.end());
    
//    for (Segment s : segs) {
//        cout << s.x1 << " " << s.y1 << " " << s.x2 << " " << s.y2 << endl;
//    }
//    
//    for (Event e : events) {
//        cout << e.x << " " << e.type << " " << e.seg << endl;
//    }
    
    int count = 0;
    set<int> bst;
    
    for (Event e: events) {
        Segment s = segs.at(e.seg);
        if (e.type == LEFT) {
            bst.insert(s.y1);
        }
        else if (e.type == RIGHT) {
            bst.erase(s.y1);
        }
        else if (e.type == TOP) {
            auto lower = bst.lower_bound(s.y1);
            auto upper = bst.upper_bound(s.y2);
            count += distance(lower, upper);
        }
    }
    cout << count << endl;
    
    return 0;
}

Measured memory_bytes: 9504
/*
    @uthor: Amit Kumar
    user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll    long long
#define ld    long double
#define ull   unsigned long long
#define endl "\n"
ll google_itr = 1;
#define google(x) cout<<"Case #"<<x<<":"
#define pi 3.14159265358979323846264338327950L

const ll mod = 1e9+7;
const ll inf = 1e18;

ll popcount(ll num){
    num = num - ((num >> 1) & 0x55555555);
    num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
    return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}

void virus(){
       ll l,k;
       cin>>l>>k;
       vector<ll> a(l);
       for(auto &i:a) cin>>i;
       sort(a.begin(),a.end());
       ll s=0;
       for(auto i=0;i<k;i++) s+=a[i];
       cout<<s;
}


int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/

    ll t=1;
    //cin>>t;
    while(t--){
           auto start = high_resolution_clock::now();
           virus();
           auto stop = high_resolution_clock::now();
           auto duration = duration_cast<seconds>(stop - start);
         //cout << "Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

Measured memory_bytes: 3660