akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

map<long long, int> factorization(long long N) {
	map<long long, int> re;
	for (int loop = 2; (long long)loop * (long long)loop <= N; loop++) {
		if (N % loop == 0) {
			N /= loop;
			re[loop]++;
			loop--;
			if (N == 1) break;
		}
	}
	if (N > 1) re[N]++;
	return re;
}

struct Memo {
	long long fact = 0;
	long long fact_inv = 0;
	long long inv = 0;
};
class Combination {
private:
	int m_module = 1000000007;
	vector<struct Memo> memo;
public:
	int calculate(int, int);
	Combination(int, int);
};
int Combination::calculate(int n, int k) {
	return ((memo[n].fact * memo[k].fact_inv) % m_module * memo[n - k].fact_inv) % m_module;
}
Combination::Combination(int memo_max, int module = 1000000007) {
	m_module = module;
	memo.push_back({ 1,1,0 });
	memo.push_back({ 1,1,1 });
	for (int loop = 2; loop <= memo_max; loop++) {
		struct Memo temp;
		temp.fact = (memo[loop - 1].fact * loop) % m_module;
		temp.inv = m_module - (memo[m_module % loop].inv * int(m_module / loop)) % m_module;
		temp.fact_inv = (memo[loop - 1].fact_inv * temp.inv) % m_module;
		memo.push_back(temp);
	}
}

void A_Black_Jack(void) {
	
	int A1, A2, A3;
	cin >> A1 >> A2 >> A3;
	
	cout << ((A1 + A2 + A3 >= 22) ? "bust" : "win") << flush;
	return;
}

void B_Palindrome_philia(void) {

	string S;
	cin >> S;

	int hug = 0;
	for (int loop = 0; (loop + 1) * 2 <= (int)S.size(); loop++) {
		if (S[loop] != S[S.size() - 1 - loop]) hug++;
	}

	cout << hug << flush;
	return;
}

int main(void) {

	//A_Black_Jack();
	B_Palindrome_philia();
	return 0;
}


Measured memory_bytes: 256
// package other2017.codefestival2017.qualb;

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String tk = in.nextToken();

        out.println(tk.substring(0, tk.length() - 8));
        out.flush();
    }

    public static void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static class InputReader {
        private static final int BUFFER_LENGTH = 1 << 12;
        private InputStream stream;
        private byte[] buf = new byte[BUFFER_LENGTH];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int next() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public char nextChar() {
            return (char) skipWhileSpace();
        }

        public String nextToken() {
            int c = skipWhileSpace();
            StringBuilder res = new StringBuilder();
            do {
                res.append((char) c);
                c = next();
            } while (!isSpaceChar(c));
            return res.toString();
        }

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

        public long nextLong() {
            int c = skipWhileSpace();
            long sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = next();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = next();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public double nextDouble() {
            return Double.valueOf(nextToken());
        }

        int skipWhileSpace() {
            int c = next();
            while (isSpaceChar(c)) {
                c = next();
            }
            return c;
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    }
}

Measured memory_bytes: 21204
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					System.out.println("F");
				} else {
					if (m + f >= 50) {
						if (m + f >= 80) {
							System.out.println("A");
						} else {
							if (m + f >= 65) {
								System.out.println("B");
							} else {
								System.out.println("C");
							}
						}
					} else {
						if (m + f >= 30) {
							if (r >= 50) {
								System.out.println("C");
							} else {
								System.out.println("D");
							}
						} else {
							System.out.println("F");
						}
					}
				}
			}
		}
		sc.close();
	}

}



Measured memory_bytes: 26352
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define INF 1e15;
using namespace std;
typedef long long ll;
int main() {
  ll n, c;
  cin >> n >> c;
  vector<ll> x(n), v(n), sl(n), sr(n);
  REP(i, n) { cin >> x[i] >> v[i]; }

  sl[0] = v[0];
  sr[n - 1] = v[n - 1];
  FOR(i, 1, n) { sl[i] = sl[i - 1] + v[i]; }
  REPR(i, n - 2) { sr[i] = sr[i + 1] + v[i]; }

  vector<ll> mx_l(n), mx_r(n);

  ll ans = 0;
  REP(i, n) {
    ans = max(ans, sl[i] - x[i]);
    mx_l[i] = ans;
  }
  ll mx = 0;
  REPR(i, n - 1) {
    ans = max(ans, sr[i] - (c - x[i]));
    mx = max(mx, sr[i] - (c - x[i]));
    mx_r[i] = mx;
  }

  REP(i, n - 1) { ans = max(ans, sl[i] - 2 * x[i] + mx_r[i + 1]); }

  FORR(i, n - 1, 1) { ans = max(ans, sr[i] - 2 * (c - x[i]) + mx_l[i - 1]); }

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

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

int N;

int main() {
    cin >> N;

    set<int> A;
    for (int i = 0; i < N; i++) {
        int a;
        cin >> a;
        A.insert(a);
    }

    cout << (A.size() == N ? "YES" : "NO") << endl;

    return 0;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H1,M1,H2,M2,K;
  cin>>H1>>M1>>H2>>M2>>K;
  int time;
  time=H2*60+M2-H1*60-M1-K;
  cout<<time<<endl;




}

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

const long long MOD = 1000000007;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;




struct CalcCombination{
    ll maximum;
    ll mod;
    vector<ll> fac,finv,inv;
    CalcCombination(ll n, ll mod):maximum(n),mod(mod),fac(n+1),finv(n+1),inv(n+1){
        fac[0] = fac[1] = 1;
        finv[0] = finv[1] = 1;
        inv[1] = 1;
        for (int i = 2; i <= maximum; i++){
            fac[i] = fac[i - 1] * i % mod;
            inv[i] = mod - inv[mod%i] * (mod / i) % mod;
            finv[i] = finv[i - 1] * inv[i] % mod;
        }
    };
    ll get(ll n, ll k){
        if (n < k) return 0;
        if (n < 0 || k < 0) return 0;
        return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
    };
};



template<typename T>
std::map<T,T> prime_factor(T n){
  std::map<T,T> res;
  for (T i=2;i*i<=n;i++){
    while( n%i == 0){
      ++res[i];
      n/=i;
    }
  }
  if (n!=1) res[n] = 1;
  return res;

}

void solve(long long N, long long M){
    map<ll,ll> prime_counts = prime_factor(M);
    // M< 10**9 < 2**30
    // v < 40は多分正しい
    CalcCombination comb(max(N+40,2*N),MOD);
    ll ret = 1;
    for (auto const& obj : prime_counts){
            ll k = obj.first;
            ll v = obj.second;
            if (k!=1){
                ret *= comb.get(N+v-1,N-1);
                ret %=MOD;
            }
    }
    printf("%lld\n",ret%MOD);

}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    solve(N, M);
    return 0;
}


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

int main(){
  string N;
  cin>>N;
  
  int A=N.at(0);
  int B=N.at(1);
  int C=N.at(2);
  int D=N.at(3);
  
  if((A==B&&B==C)||(B==C&&C==D)){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}
  

Measured memory_bytes: 384
#include <stdio.h>

int main()
{
  int i, j;
  int n, m;
  int a[100][100];
  int b[100];
  int c[100] = { 0 };
  
  scanf("%d %d", &n, &m);

  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      scanf("%d", &a[i][j]);
    }
  }

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

  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      c[i] += a[i][j] * b[j];
    }
    printf("%d\n", c[i]);
  }

  return 0;
}



Measured memory_bytes: 2108
from itertools import product
from collections import Counter
K = int(input())

import functools
def gcd(a,b):
    while b:
        a,b = b, a%b
    return a

def list_gcd(l):
    return functools.reduce(gcd,l)

ans = 0
l = []
for i,j in product(range(1,K+1),repeat=2):
    l.append(gcd(i,j))
dic = Counter(l)

for k,v in dic.items():
    for i in range(1,K+1):
        ans += gcd(k,i)*v

print(ans)


Measured memory_bytes: 75544
def solve():
    S = input()
    cnt = 0
    if S[0] != 'A':
        print('WA')
        exit()
    for i in range(1, len(S)):
        if S[i].isupper():
            if i == 1 or i == len(S) - 1 or S[i] != 'C':
                print('WA')
                exit()
            cnt += 1
    if cnt != 1:
        print('WA')
        exit()
    print('AC')






if __name__ == "__main__":
    solve()

Measured memory_bytes: 9088
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] t = new int[n];
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            t[i] = scanner.nextInt();
            a[i] = scanner.nextInt();
        }

        long answer;
        if (n > 1) {
            long takahashi = t[0];
            long aoki = a[0];
            for (int i = 1; i < n; i++) {
                if (t[i] < takahashi || a[i] < aoki) {
                    long rate = Math.max((takahashi - 1) / t[i] + 1, (aoki - 1) / a[i] + 1);
                    takahashi = t[i] * rate;
                    aoki = a[i] * rate;
                } else {
                    takahashi = t[i];
                    aoki = a[i];
                }
            }
            System.out.println(takahashi + aoki);
        } else {
            System.out.println(t[0] + a[0]);
        }
    }
}


Measured memory_bytes: 24248
#include<bits/stdc++.h>
#include <unistd.h>
using namespace std;
#define nl cout<<"\n"
#define endl '\n'
#define pb push_back
#define se second
#define fi first
#define int long long 
#define pi pair<int,int>
#define vpi vector<pi>
#define vvpi vector<vpi>
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define For(i,n) for(int i=0;i<n;i++)
#define Forn(i,a,n) for(int i=a;i<n;i++)
#define pie =3.14159265358979323846264338327950;
const int mod= 998244353;

void solve(){
	fio;
	int n;
	cin>>n;
	stack<int> st;
	int ans=0;
	for(int i=0;i<n;i++){
		int a;
		cin>>a;
		if(st.empty()){
			st.push(a);
		}
		else{
			if(st.top()>=a){
				ans+= st.top()-a;
			}
			else{
				st.push(a);
			}
		}
	}
	cout<<ans<<endl;
}

int32_t main(){
	fio;
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int t=1;
	//cin>>t;
	for(int i=1;i<=t;i++){ 
		//cout<<"Case #"<<i<<":\n";
		solve();
	}
	return 0;
}


Measured memory_bytes: 4760
#include "bits/stdc++.h"

#define REP(i,x,y) for(int i=(x);i<(y);i++)
#define RREP(i,x,y) for(int i=(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
// #define int long long

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

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#else
#define eprintf(...) 42
#define dump(x) 42
#define debug(x) 42
#endif

typedef long long ll;

const ll MOD = 1e9 + 7;

void solve(int N, int K) {
	cout << N - K + 1 << '\n';

    return;
}

signed main() {
    int N, K;
    cin >> N >> K;
    
    solve(N, K);
    
    return 0;
}



Measured memory_bytes: 256
#!/usr/bin/env python3
s = input()
l, r = 0, len(s) - 1
c = 0
while l < r:
    if s[l] == s[r]:
        l += 1
        r -= 1
    elif s[l] == "x":
        l += 1
        c += 1
    elif s[r] == "x":
        r -= 1
        c += 1
    else:
        print(-1)
        exit()
print(c)

Measured memory_bytes: 9276
//use std::convert::TryInto;
#![allow(dead_code)]

fn main(){
    let a: char = input();
    let res: char = if 'Z'<a {'a'} else {'A'};
    println!("{}", res);
}


/*
 * input function
 */
fn input<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(begin(a), end(a));
  ll ans = 0L;
  for (int l = 0; l < n; l++) {
    for (int m = l + 1; m < n; m++) {
      // a[m] <= a[r] < a[l] + a[m]
      int r = lower_bound(begin(a) + m + 1, end(a), a[l] + a[m]) - begin(a) - 1;
      ans += r - m;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<stack>
#include<iostream>
#include<string>
#include<cstring>
using namespace std;
struct thepair
{
int first;
//int second;
int data;
thepair():data(0) {}
void set(int a,int b) 
{
	first = a;
	data = b;
}
};
int main()
{
	int totals = 0;
	stack<thepair> s;
	stack <int> s1;
	string a;
	cin >> a;
	stack<int> down;
	thepair work;//记录面积与位置的临时变量
	int len = a.length();
	bool status = false;//判断tmp是否增加过,true时为压入栈标志
	for (int i = 0; i < len; ++i) 
	{
		//是否将积水处面积及其位置压入栈,work.data为面积不为零
		if (status&&work.data) 
		{
			if (!s.empty())
			{
				//当当前积水处较以往积水处位置靠前
				while (!s.empty()&&s.top().first > work.first) 
				{
					work.data += s.top().data;
					s.pop();
					//s.push(work);
				}
			}
			s.push(work);
			work.data = 0;
		}
		status = true;
		if (a[i] != '/'&&a[i] != '_') {
			down.push(i);
			continue;
		}
		else if (a[i] == '_')continue;
		else 
		{
		/*solve*/
			if (down.empty())continue;
			work.first = down.top(); down.pop();
			work.data += i - work.first;
			status = false;
		}
	}

	if (work.data) 
	{
		if (!s.empty())
		{
			//当当前积水处较以往积水处位置靠前
			while (!s.empty()&&s.top().first > work.first)
			{
				work.data += s.top().data;
				s.pop();
				//s.push(work);
			}
		}
		s.push(work);
	}

	len = s.size();
	for (int i = 0; i < len; ++i) 
	{
		s1.push(s.top().data);
		totals += s1.top();
		s.pop();
	}

	cout << totals<< endl;
	cout << len;
	for (int i = 0; i < len;++i)
	{
		cout << " "<< s1.top() ;
		s1.pop();
	}
	cout << endl;
}


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

char isl[12][12];

void dfs(int x, int y) {
	isl[x][y] = '0';

	for (int i = -1;i <= 1;i += 2) {
		int ax = x + i;
		if (0 <= ax&&ax < 12&&isl[ax][y] == '1') { dfs(ax, y); }
	}

	for (int j = -1;j <= 1;j += 2) {
		int ay = y + j;
		if (0 <= ay&&ay < 12&&isl[x][ay] == '1') { dfs(x, ay); }
	}
	return;
}

int main() {

	while (cin>>isl[0]) {
		int ca = 0;
		for (int i = 1;i < 12;i++) {
			for (int j = 0;j < 12;j++) {
				cin >> isl[i][j];
				if (isl[i][j] == EOF) { break; }
			}
		}

		for (int i = 0;i < 12;i++) {
			for (int j = 0;j < 12;j++) {
				if (isl[i][j] == '1') {
					dfs(i, j);
					ca++;
				}
			}
		}
		cout << ca << endl;
	}
	return 0;
}

Measured memory_bytes: 3100
#include<iostream>
using namespace std;
int main(){
  int N,m;
  cin>>N;
  while(N--){
    int B,C=0,i=0;
    bool f=true;
    cin>>B;
    while(++i<10){
      cin>>m;
      if(B<m){
	if(B<C&&C<m)C=m;
	else B=m;
      }else if(C<m){
	C=m;
      }else{
	f=false;
      }
    }
    cout<<(f?"YES":"NO")<<endl;
  }
  return 0;
}

Measured memory_bytes: 1152
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long K = sc.nextLong();
        long A[] = new long[N];
        for (int n = 0; n < N; n++) A[n] = sc.nextLong();
        long x = 0;
        final int DIGIT = 40;
        for (int i = DIGIT - 1; i >= 0; i--) {
            int count = 0;
            for (int j = 0; j < N; j++) count += (1 & (A[j] >> i));
            if (count <= N / 2) 
                if ((x | 1l << i) <= K) x = x | 1l << i;
        }
        long sum = 0;
        for (int i = 0; i < N; i++) sum += (x ^ A[i]);
        System.out.println(sum);
        sc.close();
    }
}


Measured memory_bytes: 58968
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#include <vector>
#define lson rt << 1, l, mid
#define rson rt << 1 | 1, mid + 1, r
#define LONG_LONG_MAX 9223372036854775807LL
#define pblank putchar(' ')
#define ll LL
#define fastIO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> P;
int n, m, k;
const int maxn = 1e5 + 10;
template <class T>
inline T read()
{
    int f = 1;
    T ret = 0;
    char ch = getchar();
    while (!isdigit(ch))
    {
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while (isdigit(ch))
    {
        ret = (ret << 1) + (ret << 3) + ch - '0';
        ch = getchar();
    }
    ret *= f;
    return ret;
}
template <class T>
inline void write(T n)
{
    if (n < 0)
    {
        putchar('-');
        n = -n;
    }
    if (n >= 10)
    {
        write(n / 10);
    }
    putchar(n % 10 + '0');
}
template <class T>
inline void writeln(const T &n)
{
    write(n);
    puts("");
}
int main(int argc, char const *argv[])
{
#ifndef ONLINE_JUDGE
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#endif
    int a = read<int>(), b = read<int>();
    if (a >= 1 && a <= 9 && b >= 1 && b <= 9)
        writeln(a * b);
    else
        puts("-1");
    return 0;
}

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;
using ld = long double;
const int MOD = 1e9+7;


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

    ll cnt = 0;
    if(a & 1 || b & 1 || c & 1){
        cout << cnt << endl;
        return 0;
    }
    while(1){
        ll x = a / 2;
        ll y = b / 2;
        ll z = c / 2;
        a += y;
        a += z;
        b += x;
        b += z;
        c += x;
        c += y;
        cnt++;

        if(a & 1 || b & 1 || c & 1){
            cout << cnt << endl;
            return 0;
        }
        if(a == b && b == c){
            cout << -1 << endl;
            return 0;
        }
    }

    return 0;
}


Measured memory_bytes: 3600
using System;
using System.Linq;
class c
{
    static void Main()
    {
        var nm = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        var ans = new int[nm[1]];
        for (int i = 0; i < nm[0]; i++)
        {
            var line = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            for (int j = 1; j < line.Length; j++)
            {
                ans[line[j] - 1]++;
            }
        }
        Console.WriteLine(ans.Where(f => f == nm[0]).Count());
    }
}

Measured memory_bytes: 13396
#include<iostream>
using namespace std;
int N,M,A,C,ans;
string S;
int main(){
    cin>>N>>M;
    for(int i=0;i<M;i++){cin>>A;C+=A;}
    ans=N-C;
    cout<<(ans>=0?ans:-1)<<endl;
    return 0;
}

Measured memory_bytes: 3592
N = int(input())
if(N == 1):
  A1,B1 = map(int,input().split())
  print(str(A1+B1))
  exit()
for i in range(N-1):
  if(i == 0):
    A1,B1 = map(int,input().split())
    A2,B2 = map(int,input().split())
    if(A1 <= A2):
      MA = A2
      MB = B2
    else:
      MA = A1
      MB = B1
    A1 = A2
    B1 = B2
  else:
    A2,B2 = map(int,input().split())
    if(MA <= A2):
      MA = A2
      MB = B2
    A1 = A2
    B1 = B2
print(str(MA + MB))


Measured memory_bytes: 3064
"""Boot-camp-for-Beginners_Easy008_B_1-21_28-August-2020.py"""
import numpy as np

a, b = map(int, input().split())

AB = int(str(a) + str(b))
if np.sqrt(AB)==int(np.sqrt(AB)):
    print("Yes")
else:
    print("No")


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

int main(){
  int N, M;
  cin >> N >> M;
  vector<long long int> H(N);
  for(int i = 0; i < N; i++){
    cin >> H.at(i);
  }
  vector<vector<int>> road(M, vector<int>(2));
  vector<bool> higher(N , true);
  for(int i = 0; i < M; i++){
    cin >> road.at(i).at(0) >> road.at(i).at(1);
    
    if(H.at(road.at(i).at(0) - 1) < H.at(road.at(i).at(1) - 1)){
      higher.at(road.at(i).at(0) - 1) = false;
    }else if(H.at(road.at(i).at(0) - 1) == H.at(road.at(i).at(1) - 1)){
      higher.at(road.at(i).at(0) - 1) = false;
      higher.at(road.at(i).at(1) - 1) = false;
    }else{
      higher.at(road.at(i).at(1) - 1) = false;
    }
  }
  
  int ans = 0;
  for(int i = 0; i < N; i++){
    if(higher.at(i) == true) ans++;
  }
  
  cout << ans;
  return 0;
}

Measured memory_bytes: 9592
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3:
  print(1)
else:
  array = np.zeros(s+1)
  array[0] = 1
  for i in range(3, s+1):
    array[i] = np.sum(array[:i-2]) % mod
  print(int(array[s]))


Measured memory_bytes: 27108
import java.util.Scanner;

public class Main {

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

    private Scanner scan = new Scanner(System.in);
    private final int A;
    private final int B;
    private final int C;

    public Main() {
	A = Integer.parseInt(scan.next());
	B = Integer.parseInt(scan.next());
	C = Integer.parseInt(scan.next());

	scan.close();
    }

    public final void answer() {
	boolean possible = false;
	for (int x = 1; x <= B; x++) {
	    if(A*x % B == C) {
		possible = true;
		break;
	    }
	}
	System.out.println(possible ? "YES" : "NO");
    }
}


Measured memory_bytes: 23892
#import<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long LL;
LL i,j,k,m,n,s,x,a[200040];
double b;
main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>b;
	cout<<b*2*3.14159265358979323846;
}

Measured memory_bytes: 3816
#include<cstdio>
#include<iostream>
#include<ctype.h>
#include<string>
using namespace std;
int main(){
	int N;
	cin >> N;
	double x[N], total = 0;
	string u[N];
	for(int i = 0; i < N; i++){
		cin >> x[i] >> u[i];
		if(u[i] == "JPY"){
			total += x[i];
		}
		else{
			total += x[i] * 380000.0;
		}
	}
	cout << total << endl;
	return 0;
}


Measured memory_bytes: 384
S = input()
T = input()
#N,A,B = map(int,input().split())
#X_list = list(map(int,input().split()))
#X1_list = [int(input()) for i in range(N)]
#X2_list = [list(map(int,input().split())) for i in range(N)]
ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1
print(ans)

Measured memory_bytes: 2940
t=0;s=[0]*86400;
gets.to_i.times{a,b=gets.split.map &:to_i;
  t+=a+b;
  s[(t-b)%86400]+=1
}
r=0;
[*0..10800].map{|a|r+=s[a]};
p [r,[*10801...100000].map{|a|
  r-=s[(a-10801)%86400]-s[a%86400];
  r
}.max].max


Measured memory_bytes: 4988
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
#include <string>
#include <time.h>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }

int N, a[112345], b[112345];
vector<vector<int>> Edge;
map<pair<int, int>, int> C;

int main() {

	cin >> N;
	rep(i, N - 1) cin >> a[i] >> b[i];
	Edge.resize(N);
	rep(i, N - 1) {
		Edge[a[i] - 1].push_back(b[i] - 1);
		Edge[b[i] - 1].push_back(a[i] - 1);
	}

	queue<int> q;
	set<int> closed;
	q.push(0);

	while (!q.empty()) {
		set<int> used;
		int cur = q.front();
		q.pop();
		closed.insert(cur);
		for (auto e : Edge[cur]) {
			if (C.find({ cur, e }) != C.end()) used.insert(C[{cur, e}]);
		}
		int c = 0;
		for (auto e : Edge[cur]) {
			if (used.find(c) != used.end()) c++;
			if (C.find({ cur, e }) == C.end()) {
				C[{ cur, e }] = c;
				C[{ e, cur }] = c;
				c++;
				if (closed.find(e) == closed.end()) q.push(e);
			}
		}
	}

	int K = 0;
	for (auto c : C) {
		K = max(K, c.second);
	}
	cout << K + 1 << endl;
	rep(i, N - 1) {
		cout << C[{a[i] - 1, b[i] - 1}] + 1 << endl;
	}



	return 0;
}

Measured memory_bytes: 24064
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  double a,b,x;
  cin >> a >> b >> x;
  const double pai=3.1415926535897932;
  if(a*a*b/2.0 <= x){
  const double m = 2*(a*a*b-x)/(a*a);
  cout << fixed << setprecision(12) << atan(m/a)*180.0/pai << endl;}
  else{const double m = 2*x/(a*b);
      cout << fixed << setprecision(12) << atan(b/m)*180.0/pai << endl;;}
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
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 (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll t1,t2,t3;
const ll mod = 998244353;
const int INF = 1e9;
const ll INFLONG = 1e18;

vector<ll> vec(8,0);
vector<ll> emb(8,-1);
vector<ll> embnum(8,0);
ll sum = 0;

bool can = false;

void dfs(ll k){
  if(can){
    return;
  }
  if(k == 8){
    sum++;
    ll tcan = true;
    rep(i,8){
      REP(j,i+1,8){
        if(vec[i] - i == vec[j] - j || vec[i]+i == vec[j]+j){
          tcan = false;
        }
      }
    }
    if(tcan){
      can = true;
    }
  }else{
    if(emb[k] != -1){
      dfs(k+1);
    }else{
      vector<ll> arr(8,0);
      rep(i,k){
        arr[vec[i]] = 1;
      }
      rep(i,8){
        if(!embnum[i]){
          if(arr[i] == 0 && !can){
            vec[k] = i;
            dfs(k+1);
          }
        }
      }
    }
  }
}

int main(){
  ll n;
  cin >> n;
  rep(i,n){
    cin >> t1 >> t2;
    emb[t1] = t2;
    embnum[t2] = 1;
    vec[t1] = t2;
  }
  dfs(0);
  rep(i,8){
    rep(j,8){
      if(vec[i] != j){
        cout << ".";
      }else{
        cout << "Q";
      }
    }
    cout << endl;
  }
  //cout << sum << endl;
}


Measured memory_bytes: 3096
#include<bits/stdc++.h>
 
using namespace std;
 
#define INF 1000000007
#define LINF 1000000000000000007
 
typedef long long ll;
typedef pair<ll,ll> P;


string s;

int main(){
	cin >> s;
	
	if(s == "zyxwvutsrqponmlkjihgfedcba"){
		cout << -1 << endl;
		return 0;
	}
	int n = s.size();
	if(n == 26){
		for(int i = n-2; i >= 0; i--){
			if(s[i] < s[i+1]){
				for(int j = 0; j < i; j++){
					cout << s[j];
				}
				char c = 'z';
				for(int j = i+1; j < n; j++){
					if(s[j] > s[i]) c = min(c, s[j]);
				}
				cout << c << endl;
				return 0;
			}
		}
	}
	bool used[26] = {0};
	for(int i = 0; i < n; i++){
		used[(int)(s[i] - 'a')] = 1;
	}
	cout << s;
	for(int i = 0; i < 26; i++){
		if(!used[i]){
			cout << (char)('a'+i) << endl;
			break;
		}
	}
	
	return 0;
}

Measured memory_bytes: 256
import sys
def main():
    N=int(sys.stdin.readline())
    a=[]
    for _ in [0]*N:a.append(list(map(int,sys.stdin.readline().split())))
    dp=[[0,0,0] for _ in [0]*N]
    dp[0]=a[0]
    for i in range(1,N):
        for j in range(3):dp[i][j]=max([dp[i-1][(j+1)%3],dp[i-1][(j+2)%3]])+a[i][j]
    print(max(dp[N-1]))
if __name__=='__main__':main()

Measured memory_bytes: 103940
#include <bits/stdc++.h>
#include<iostream>
#include<vector>
#include<string>
#include <sstream>
using namespace std;

int main(){
  long A, B, N, a, b, L;
  cin >> A >> B >> N;
 
    if(N >= B){
    a = A*(B-1)/B;
    b = (B-1)/B;
    L = a - A*b; 
    }
   
    else{
    a = A*N/B;
    b = N/B;
    L = a - A*b; 
    }

  cout << L << endl;
  return 0;
}

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

int main(){
  int n,r,r_0,maxv,minv;
  cin >> n;
  
  cin >> r_0;
  cin >> r;
  maxv = r - r_0;
  minv = r < r_0 ? r : r_0;
  for(int i=0;i<n-2;i++){
    cin >> r;
    maxv = r - minv > maxv ? r - minv : maxv;
    minv = r < minv ? r : minv;
  }
  cout << maxv << endl;
}


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

#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pdd pair<double,double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#define rep(i,n) for( int i = 0; i < n; ++i )
#define repi(i,n) for( int i = 1 ; i <= n; ++i )
#define repn(i,n) for( int i = n - 1 ; i >= 0 ; --i )
#define repf(j,i,n) for( int j = i ; j < n ; ++j )
#define die(s) {std::cout << s << nl;}
#define dier(s) {std::cout << s; return 0;}
#define vi vector<int>
typedef long long ll;

using namespace std;


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.precision(0); 
	ll n;
	cin >> n;
	repi(i , 10000){
		repi(j , 10000){
			ll a = n * i * j;
			ll b = n * i + n * j - 4LL * i * j;
			if(b < 0 && a % (-b) == 0){
				cout << -a / b << " " << i << " " << j << nl;
				return 0;
			}
		}
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<int> >
    A(H, vector<int>(W)),
    B(H, vector<int>(W)),
    C(H, vector<int>(W));
  rep(i, H) rep(j, W) cin >> A[i][j];
  rep(i, H) rep(j, W) cin >> B[i][j];
  rep(i, H) rep(j, W) C[i][j] = abs(A[i][j] - B[i][j]);
  int N = 80*80*2;
  vector<vector<vector<bool> > > dp(H, vector<vector<bool> >(W, vector<bool>(N*2)));
  int sub = C[0][0];
  dp[0][0][sub+N] = true;
  dp[0][0][-sub+N] = true;
  rep(i, H) rep(j, W) {
    rep(k, N*2) {
      if(i+1 < H) {
        if(k+C[i+1][j] >= 0 && k+C[i+1][j] < N*2)
          dp[i+1][j][k+C[i+1][j]] = dp[i+1][j][k+C[i+1][j]] | dp[i][j][k];
        if(k-C[i+1][j] >= 0 && k-C[i+1][j] < N*2)
          dp[i+1][j][k-C[i+1][j]] = dp[i+1][j][k-C[i+1][j]] | dp[i][j][k];
      }
      if(j+1 < W) {
        if(k+C[i][j+1] >= 0 && k+C[i][j+1] < N*2)
          dp[i][j+1][k+C[i][j+1]] = dp[i][j+1][k+C[i][j+1]] | dp[i][j][k];
        if(k-C[i][j+1] >= 0 && k-C[i][j+1] < N*2)
          dp[i][j+1][k-C[i][j+1]] = dp[i][j+1][k-C[i][j+1]] | dp[i][j][k];
      }
    }
  }
  int ans = inf;
  rep(i, N*2)
    if(dp[H-1][W-1][i]) ans = min(ans, abs(i-N));
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 23040
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int isprime(int n){
    int count =0;
    for(int i=2;i<=sqrt(n);i++)
    if(n%i==0)count++;
    if(count)return 0;
    return 1;
}
int main()
{
    int n;
    cin>>n;
    if(n%1000)
    cout<<1000-n%1000;
else cout<<0;
    return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define repr(i,x,n) for(int i=x; i<(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
typedef long long ll;
using VI = vector<int>;
using VS = vector<string>;
using graph = vector<vector<int>>;
int main()
{
    int n,k,ans=0;
    cin>>n>>k;
    VI fun(n);
for (int i = 0; i < k; i++)
{
    int num;
    cin>>num;
    for (int i = 0; i < num; i++)
    {
        int j;
        cin>>j;
        fun.at(j-1)++;

    }
    
}
for (int i = 0; i < n; i++)
{
    if (fun.at(i)==0)
    {
        ans++;
    }
    
}
cout<<ans<<endl;

    return 0;
}

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

int main()
{
    cout << fixed << setprecision(15);
    ll N;
    cin >> N;

    vector<ll> dp(100010, INF);

    vector<ll> A;

    A.push_back(1);

    ll six = 1;
    while(six < 100010){
        six = six*6;
        if(six > 100010) break;
        A.push_back(six);
    }
    ll nine = 1;
    while(nine < 100010){
        nine = nine*9;
        if(nine > 100010) break;
        A.push_back(nine);
    }

    // ちょうどのものを1で初期化
    for(auto v: A){
        // cout << v << endl;
        dp[v] = 1;
    }
    
    for(ll i=1; i<=N; i++){
        // cout << i<< endl;
        for(auto v: A){
            if(i-v > 0){
                dp[i] = min(dp[i], dp[i-v]+1);
            }
        }
    }
    cout << dp[N] << endl;
    return 0;
}

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

int main()
{
  string s,t;
  cin>>s>>t;
  int m=s.length();
  int n=t.length();
  int dp[m + 1][n + 1];

  for(int i=0;i<=m;i++)
  {
      for(int j=0;j<=n;j++)
      {
          if(i==0||j==0)
            dp[i][j]=0;
          else if(s[i-1]==t[j-1])
          {
              dp[i][j]=dp[i-1][j-1]+1;
          }
          else
          {
              dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
          }
      }
  }
  int index =dp[m][n];
   char lcs[index+1]; ;
   lcs[index]='\0';

   int i=m,j=n;
   while(i>0&&j>0)
   {
       if(s[i-1]==t[j-1])
       {
           lcs[index-1]=s[i-1];
           i--;
           j--;
           index--;
       }
       else if(dp[i-1][j]>dp[i][j-1])
        i--;
       else
        j--;
   }
   cout<<lcs;

    return 0;
}


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

#define y1 as214
#define ii pair < int , ll >
#define iii pair < int , ii >
#define iv pair < ii , ii >

#define fi first
#define se second
#define fr front()
#define pb push_back

#define FOR(i , x , n) for(int i = x ; i <= n ; ++i)
#define REP(i , n) for(int i = 0 ; i < n ; ++i)

#define ll long long
#define oo INT_MAX

/// dp[i] là con đường dài nhất kết thúc tại i trong subtree của i.

const int N = 1e5 + 5;
int n , m;
int dp[N];
bool mark[N];
vector < int > g[N];

void DFS(int i)
{
    mark[i] = true;
    REP(s , g[i].size())
    {
        int u = g[i][s];
        if(!mark[u])
            DFS(u);
        dp[i] = max(dp[u] + 1 , dp[i]);
    }
}

int main()
{
    //freopen("G.inp","r",stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    FOR(i , 1 , m)
    {
        int x , y;
        cin >> x >> y;
        g[x].pb(y);
    }
    FOR(i , 1 , n)
        if(!mark[i])
            DFS(i);
    int res = 0;
    FOR(i , 1 , n)
        res = max(res , dp[i]);
    cout << res << endl;
}


Measured memory_bytes: 8320
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>

#define rep(i, a, b) for ( int i = (a); i < (b); i++ )
#define per(i, a, b) for ( int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#define bg begin()
#define en end()
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

using namespace std;

typedef long long ll;
typedef long double ld;

using P = pair<int, int>;

static const long long MOD = 1000000007;
static const long long LINF = (ll)(1e18+99);
static const int INF = 1e9+99;

int ans;

int main(void) {
    int a;
    cin >> a;
    ans = a+a*a+a*a*a;



  
    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 3616
n,a,b=map(int,input().split())
mod=10**9+7


P = 10**9 + 7
N = 200001
inv_t = [0]+[1]
for i in range(2,N):
  inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

def power_func(a,n,p):
  bi=str(format(n,"b"))#2進表現に
  res=1
  for i in range(len(bi)):
    res=(res*res) %p
    if bi[i]=="1":
      res=(res*a) %p
  return res

def comb(x):
    res=1
    for i in range(n-x+1,n+1):
        res*=i
        res=res%mod
    for i in range(1,x+1):
        res*=inv_t[i]
        res=res%mod
    return res

al=power_func(2,n,mod)-1
print((al-comb(a)-comb(b))%mod)

Measured memory_bytes: 11052
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>

using namespace std;

int main(){
    int A[3][3];
    int check[8] = {0,0,0,0,0,0,0,0};
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 3; j++) cin >> A[i][j];
    }
    int N;
    cin >> N;
    int b[N];
    for(int k = 0; k < N; k++){
        cin >> b[k];
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(b[k] == A[i][j]){
                    check[i] += 1;
                    check[j+3] += 1;
                    if(i == j) check[6] += 1;
                    if(i == 2-j) check[7] += 1;
                    if(check[i]==3 || check[j+3]==3 || check[6]==3 || check[7]==3){
                        cout << "Yes" << endl;
                        return 0;
                    }
                }
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

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

int divisor(int num) {
	int count = 0;
	for (int i = 1; i <= num; i++) {
		if (num % i == 0) { // 余りが0
							// 0で割らないように注意
			count++;
		}
	}
	return count; // numの約数の個数
}

int main() {
	int N , max;
	cin >> N;
	int count_divisable = 0;
	for (int j = 1; j<= N; j++) {
		if (j%2==1 && divisor(j) == 8) {
			count_divisable++;
		}
	}
	cout << count_divisable << endl;
	return 0;
}

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

int main ()
{
    int n;
    cin >> n;
    vector<vector<int> > V(n+1, vector<int>(n+1, 0));
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            cin >> V[i][j];
    
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n - 1; j++) {
            V[i][j+1] += V[i][j];
        }
    }

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j < n; j++) {
            V[j+1][i] += V[j][i];
        }
    }

    int res = -100000000;
    for (int i = 0; i < n; i++) {
        for (int l = 0; l < n; l++) {
            for (int j = i+1; j <= n; j++) {
                for (int k = l+1; k <= n; k++) {
                    if ((V[j][k] - V[i][k]) - (V[j][l] - V[i][l]) > res)
                        res = (V[j][k] - V[i][k]) - (V[j][l] - V[i][l]);
                }
            }
        }
    }
    cout << res << endl;
    
    return 0;
}

Measured memory_bytes: 1256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define int ll
//largest sum
//probably second question
int32_t main() {
    int n;
    cin>>n;
    int arr[n], maxi[n];
    int c = 0;
    for(int i= 0; i<n; i++){
        int temp;
        cin>>temp;
        arr[i] = temp;
        if(i == 0){
            maxi[0] = temp;
        }
        else{
            maxi[i] = min(maxi[i-1], temp);
        }
        if(i == 0)c++;
        else if(maxi[i-1] >= arr[i]){
            c++;
        }
    }
    cout<<c<<endl;
}


Measured memory_bytes: 3328
package main

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

func main() {
	n := getInt()
	k := getInt()
	hs := getIntSlice(n)

	ans := 0
	for _, h := range hs {
		if h >= k {
			ans++
		}
	}

	fmt.Println(ans)
}

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

var sc = bufio.NewScanner(os.Stdin)

func init() {
	// buf := 200001
	// sc.Buffer(make([]byte, buf), buf)
	sc.Split(bufio.ScanWords)
}

func getInt() int {
	i, err := strconv.Atoi(getString())
	if err != nil {
		panic(err)
	}
	return i
}

func getIntSlice(n int) []int {
	is := make([]int, n)
	for i := range is {
		is[i] = getInt()
	}
	return is
}

func getString() string {
	sc.Scan()
	s := sc.Text()
	return s
}


Measured memory_bytes: 1792
#include <stdio.h>

int main(void) {
  int m,h,lencard,i,j,a = 0;
  char card[201],cardsub[201];

  while(1){
    first:
    for(i = 0; i < 200; i++){
      card[i] = getchar();
      if(card[i] == '\n')break;
    }
    lencard = i;
    if(lencard == 0){
      goto first;
    }
    if(lencard == 1)break;

    scanf("%d",&m);
    for(i = 0; i < m; i++){
      scanf("%d",&h);
      for(j = 0; j < h; j++){
        cardsub[j] = card[j];
      }
      for(j = 0; j < lencard; j++){
        card[j] = card[j + h];
      }
      int k = 0;
      for(j = lencard - h; j < lencard; j++){
        card[j] = cardsub[k];
        k++;
      }
    }
    for(i = 0; i < lencard; i++)printf("%c",card[i]);
    printf("\n");
    a++;
  }
  return 0;
}


Measured memory_bytes: 2104
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  vector<int> W(N);
  for(int i = 0; i < N; i++){
    cin >> W.at(i);
  }
  int ans = N * 100;
  for(int i = 0; i < N; i++){
    int sum = 0;
    W.at(i) *= -1;
    for (int j = 0; j < N; j++){
      sum += W.at(j);
    }
    if (sum < 0){
      sum *= -1;
    }
    ans = min(ans, sum);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
N=int(input())
SIZ=55556
prime=[True for i in range(SIZ)]
prime[0]=False
prime[1]=False

for num in range(SIZ):
    if prime[num]:
        times=2
        while num*times<SIZ:
            prime[num*times]=False
            times+=1
for num in range(SIZ):
    if prime[num] and num%5==1 and N>0:
        N-=1
        print(num,end=" ")
print()


Measured memory_bytes: 3608
#include "bits/stdc++.h"
using namespace std;
#define MAX ('z' - 'a' + 1)
bool flag[MAX];
int main() {
  cin.tie(0); ios_base::sync_with_stdio(false);
  string S; cin >> S;
  for (auto s : S) flag[s - 'a'] = true;
  for (int i{0}; i < MAX; ++i) {
    if (!flag[i]) {
      cout << static_cast<char>('a' + i) << "\n";
      return 0;
    }
  }
  cout << "None\n";
  return 0;
}


Measured memory_bytes: 512
/*
  ∧,,∧
( 'ω' )つ ＜WA,またお前か！！　
（m9 ＼ 　　
　 ＼　 ＼
　 　 ) ) ＼
　 ／／ ＼ ＼
　 (＿） 　 (＿)
*/

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

#define all(x) (x).begin(),(x).end()
#define rep(x, y) for (int x = 0; x < y; x++)
#define MOD 1000000007

typedef long long LL;
typedef long double LD;

bool compare_by_b(pair<int, int> a, pair<int, int> b)
{
    if (a.second != b.second) {
        return a.second < b.second;
    } else {
        return a.first < b.first;
    }
}

ostringstream oss_global;
string s_global = oss_global.str();

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

    int M = max({A, B, C});
    int ans = 9*M + A + B + C;

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


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

int main()
{
    int a;
    ll b, n;
    cin >> a >> b >> n;
    ll x = min(n, b - 1);
    cout << (a * x) / b - a * (x / b) << endl;
}


Measured memory_bytes: 3656
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y-1);(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
//template<class T> using vv=vector<vector<T>>;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}

vector<ll> dst,c;
int x,n;
typedef ll Cost;
typedef pair<Cost,int> Que;
const int UB=212345;
ll d2[2*UB+10],INF=1e16;
ll *d=d2+UB+5;

ll dij(int s){
  priority_queue<Que,vector<Que>,greater<Que> > que;
  fill(d2,d2+412345,INF);
  d[s]=0;
  que.push(Que(0,s));
  while(!que.empty()){
    Que p=que.top();que.pop();
    int v=p.Y;
    if(v==x)
      return d[v];
    if(d[v]<p.X)continue;
    for(int sgn:{1,-1})rep(i,n){
	int w=v+sgn*dst[i];
	if(abs(w)>UB)continue;
	if(d[w]>d[v]+c[i]){
        d[w]=d[v]+c[i];
        que.push(Que(d[w],w));
      }
    }
  }
}

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  int i,j,k;
  cin>>n>>x;
  dst.resize(n); c.resize(n);
  rep(i,n)
    cin>>dst[i]>>c[i];
  ll gcd=0;
  rep(i,n)
    gcd=__gcd(dst[i],gcd);
  if(x%gcd!=0){
    cout<<-1<<endl;
  }else{
    cout<<dij(0)<<endl;
  }
  return 0;
}


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

int main() {
  char c;
  cin >> c ;
  if((c=='a')||(c=='e')||(c=='i')||(c=='o')||(c=='u')) {
    cout <<"vowel"<< endl;
  }
  else {
    cout << "consonant" << endl;
  }
}
  

Measured memory_bytes: 256
import Prelude as P
import Data.List
import Data.Vector.Unboxed as V hiding(sum,forM,forM_,map)
import Data.Array.Unboxed  as A
import Data.Array.MArray
import Data.Array.ST
import Control.Monad
import Control.Monad.ST

type P = Vector Double
type DP s = STUArray s (Int,Int) Double

setArr :: DP s -> P -> Int -> ST s ()
setArr dparr ps n = do
  let p i  = ps V.! (i-1)
      p_ i = 1-(p i)
  forM_ [1..n] $ \i -> writeArray dparr (0,i) $ (V.scanl (\x y -> x*(1-y)) 1 ps) V.! i
  forM_ [1..div (n-1) 2] $ \i -> do
    writeArray dparr (i,i)   $ (V.scanl (\x y -> x*y) 1 ps) V.! i

dp_i :: DP s -> P -> Int -> Int -> ST s ()
dp_i dparr ps k i = do
  let p i  = ps V.! (i-1)
      p_ i = 1-(p i)
  ek  <- readArray dparr (k,i-1)
  ek1 <- readArray dparr (k-1,i-1)
  writeArray dparr (k,i) $ ek*(p_ i) + ek1*(p i)

solve :: P -> Int -> ST s Double
solve ps n = do
  dparr <- newArray ((0,1),(div (n-1) 2,n)) 0
  setArr dparr ps n
  forM_ [1..div (n-1) 2] $ \k ->
   forM_ [k+1..n] $ \i -> dp_i dparr ps k i
  ans0 <- forM [0..div (n-1) 2] $ \k -> readArray dparr (k,n)
  return $ 1-(sum ans0)

main :: IO ()
main = do
  n <- read <$> getLine
  ps <- map read.words <$> getLine
  putStrLn $ show $ runST $ solve (V.fromList ps)  n


Measured memory_bytes: 37500