akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    string a, b;
    cin >> a >> b;
    cout << ( a == b ? "=" : a > b ? ">" : "<" ) << endl;
    return 0;
}

Measured memory_bytes: 256
//#pragma warning(disable:4996)
#include <stdio.h>

int main() {
	/*int n, m;
	int L[100000];
	int R[100000];
	bool a[100000];//false：ダメ,true：いける
	for (int i = 0; i < 100000; i++) {
		a[i] = true;
	}

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

	for (int i = 0; i < m; i++) {
		for (int j = 0; j < n; j++) {
			if (a[j] && (j < L[i]-1 || R[i]-1 < j)) {
				a[j]=false;
			}
		}
	}
	int answer = 0;
	for (int i = 0; i < n; i++) {
		if (a[i]) {
			answer++;
		}
	}
	printf("%d\n", answer);
	//while (1);
	*/
	int n, m;
	int L[100500];
	int R[100500];

	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++) {
		scanf("%d %d", &L[i], &R[i]);
	}
	int min = 0;
	int max = 100500;
	for (int i = 0; i < m; i++) {
		if (max < L[i] || R[i] < min) {//かぶってない
			min = max + 1;//0の出力
			break;
		}
		if (L[i] <= max && min <= R[i]) {
			if (min < L[i]) {
				min = L[i];
			}
			if (R[i] < max) {
				max = R[i];
			}
		}
	}
	printf("%d\n", max - min + 1);
	//while (1);
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+5;
typedef long long ll;
const ll mod=1000000007;
bool num[26];

int main(int argc, char const *argv[])
{
	string s;
	while(cin>>s){
		memset(num,0,sizeof(num));
		int n=s.length();
		for(int i=0;i<n;i++){
			num[s[i]-'a']=1;
		}
		int ans=-1;
		for(int i=0;i<26;i++){
			if(num[i]==0){
				ans=i+'a';
				break;
			}
		}
		if(ans==-1){
			printf("None\n");
		}
		else{
			printf("%c\n",ans);
		}
	}
	return 0;
}

Measured memory_bytes: 512
N, M = map(int, input().split())

lst = [0] + [1] + [-1]*N
for i in range(M):
    lst[int(input())+1] = 0

for i in range(2, N+2):
    if lst[i] == -1:
        lst[i] = lst[i-1] + lst[i-2]

print (lst[N+1]%1000000007)

Measured memory_bytes: 460004
/*_BELIEVE_*/

//CF,CC,AtC,SPOJ: hp1999
//HE: hemant269
//HR: hemant2132

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

#define     int          long long int
#define     fast()       ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define     all(x)       x.begin(),x.end()
#define     mem(a,b)     memset(a,b,sizeof(a))
#define     gcd(a,b)     __gcd((a),(b))
#define     lcm(a,b)     ((a)*(b))/gcd((a),(b))
#define     pb           push_back
#define     ins          insert
#define     F            first
#define     S            second

const int inf=1e18,M=1e9+7;
const int N=1;

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

    string s;
    map<string,int> mp;
    for(int i=0;i<n;++i)
    {
        cin>>s;
        sort(all(s));
        ++mp[s];
    }

    int ans=0;
    for(auto c:mp)
    {
        ans+=((c.S)*(c.S-1))/2;
    }

    cout<<ans;
}

int32_t main()
{
    fast();

    int t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }

    return 0;
}



Measured memory_bytes: 11264
#include <iostream>
#include <vector>

using namespace std; 

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

  // O(MN)
  vector<vector<int>> vec(M);
  for (int i = 0; i < M; i++) {
    int k;
    cin >> k;
    vec[i].resize(k);
    for (int j = 0; j < k; j++) {
      cin >> vec[i][j];
      --vec[i][j];
    }
  }

  // O(M)
  vector<int> p(M);
  for (int l = 0; l < M; l++) {
    cin >> p[l];
  }

  // O(MN * 2^N)
  int ans = 0;
  for (int i = 0; i < (1 << N); ++i) { 
    // Each b contains info for the ith switch at bit position i from right 
    bool ok = true;
    for (int j = 0; j < M; ++j) {
      // For each light 
      int c = 0;
      for (int id : vec[j]) {
        // For each switch connected to light
        // Note: != takes precedence over &, be careful!
        if ((i >> id) & 1) {
          ++c;
        }
      }
      c %= 2;
      if (c != p[j]) {
        ok = false;
      }
    }
    if (ok) {
      ans++;
    }
  }

  cout << ans << endl;
}

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

using LL = long long;
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

void solve(long long N) {
  LL ans = 0;

  if (N % 2) {
    cout << 0 << endl;
    return;
  }

  N /= 2;
  while ((LL)N / 5 != 0) {
    ans += N / 5;
    N /= 5;
  }

  cout << ans << endl;
  return;
}

int main() {
  long long N;
  scanf("%lld", &N);
  solve(N);
  return 0;
}


Measured memory_bytes: 256
from fractions import gcd
a,b=map(int,input().split())
num=gcd(a,b)
l=[1]
while num!=1:
    x=int(num**(1/2))
    for i in range(2,x+2):
        if num%i==0:
            num=num//i
            l.append(i)
            break
        elif i==x+1:
            l.append(num)
            num=1
            break
print(len(set(l)))

Measured memory_bytes: 5180
#include "bits/stdc++.h"
using namespace std;
typedef long long li;

const li mod = 998244353;
const li max_v = 300 * 300 + 5;

li pow(li x, li n) {
    if (n == 0) {
        return 1;
    }
    if (n == 1) {
        return x;
    }

    li sq = pow(x, n / 2);
    if (n & 1) {
        return sq * sq % mod * x % mod;
    }
    return sq * sq % mod;
}

li inv(li x) {
    return pow(x, mod - 2);
}


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

    li n;
    cin >> n;

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

    const li total = accumulate(ls.begin(), ls.end(), 0LL);

    vector<li> dbl(max_v, 0), sin(max_v, 0);
    dbl[0] = pow(2LL, n);
    sin[0] = 1;

    const li inv2 = inv(2LL);
    for (int i = 0; i < n; ++i) {
        for (int j = max_v - 1; j >= 0 ; --j) {
            int prev = j - ls[i];
            if (prev < 0) {
                break;
            }
            dbl[j] += dbl[prev] * inv2 % mod;
            dbl[j] %= mod;
            sin[j] += sin[prev];
            sin[j] %= mod;
        }
    }

    li notans = 0;
    for (int i = 0; i < max_v; ++i) {
        if (i * 2 < total) {
            continue;
        }
        if (i * 2 == total) {
            notans = (notans - sin[i] % mod + mod) % mod;
        }
        notans += dbl[i];
        notans %= mod;
    }

    notans = notans * 3 % mod;
    li ans = (pow(3LL, n) - notans + mod) % mod;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1664
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

MOD = 998244353

N = int(read())

import numpy as np

def cumprod(arr,MOD):
    L = len(arr); Lsq = int(L**.5+1)
    arr = np.resize(arr,Lsq**2).reshape(Lsq,Lsq)
    for n in range(1,Lsq):
        arr[:,n] *= arr[:,n-1]; arr[:,n] %= MOD
    for n in range(1,Lsq):
        arr[n] *= arr[n-1,-1]; arr[n] %= MOD
    return arr.ravel()[:L]

def make_fact(U,MOD):
    x = np.arange(U,dtype=np.int64); x[0] = 1
    fact = cumprod(x,MOD)
    x = np.arange(U,0,-1,dtype=np.int64); x[0] = pow(int(fact[-1]),MOD-2,MOD)
    fact_inv = cumprod(x,MOD)[::-1]
    return fact,fact_inv

U = 10**7 + 10
fact, fact_inv = make_fact(U,MOD)

x = np.full(U,2,dtype=np.int64); x[0] = 1
pow2 = cumprod(x,MOD)

n = N//2
comb = fact_inv[:n] * fact_inv[N:N-n:-1] % MOD * fact[N] % MOD

x = (comb * pow2[:n] % MOD).sum()
answer = pow(3,N,MOD) - x - x
answer %= MOD
print(answer)


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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

    ll H,W; cin >> H >> W;

    char field[105][105];
    ll d[105][105];

    for (int i = 0;i < H;i++){
        for (int j = 0;j < W;j++){
            cin >> field[i][j];
            d[i][j] = LLONG_MAX;
        }
    }

    d[0][0] = 0;
    if(field[0][0] == '#'){ d[0][0] = 1;}

    for (int i = 0;i < H;i++){
        for (int j = 0;j < W;j++){
            if(i+1 < H){
                if(field[i][j] == '.'){
                    if(field[i+1][j] == '.') d[i+1][j] = min(d[i][j],d[i+1][j]);
                    else d[i+1][j] = min(d[i][j]+1,d[i+1][j]);
                }else{
                    d[i+1][j] = min(d[i][j],d[i+1][j]);
                }
            }
            if(j+1 < W){
                if(field[i][j] == '.'){
                    if(field[i][j+1] == '.') d[i][j+1] = min(d[i][j],d[i][j+1]);
                    else d[i][j+1] = min(d[i][j]+1,d[i][j+1]);
                }else{
                    d[i][j+1] = min(d[i][j],d[i][j+1]);
                }
            }
        }
    }

    cout << d[H-1][W-1] << endl;

    return 0;

}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define MOD 1000000007
typedef long long ll;
using namespace std;
ll modpow(ll a, ll n) {
	if (n == 0)
		return 1;
	if (n % 2 == 1)
		return (a * modpow(a, n - 1) % MOD);
	ll t = modpow(a, n / 2);
	return (t * t % MOD);
}
ll comb(ll n, ll r) {
	if (n < r || n < 0 || r < 0)
		return 0;
	ll x = 1, y = 1;
	for (ll i = n; i > n - r; i--)
		x = x * i % MOD;
	for (ll i = 2; i <= r; i++)
		y = y * i % MOD;
	return (x * modpow(y, MOD - 2) % MOD);
}
int main() {
	int s;
	cin >> s;
	ll ans = 0;
	for (int i = 1; i < 2000; i++) {
		int t = s - 3 * i;
		if (t < 0)
			continue;
		ans += comb(t + i - 1, i - 1);
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define _LIBCPP_DEBUG 0
using namespace std;
typedef long long int ll;
ll MOD = 1e9 + 7;
int INF = 1 << 20;

int main(void){

    double L; cin>>L;
    
    printf("%lf",pow(L/3,3));
    return 0;
}


Measured memory_bytes: 256
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

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

    string res;
    while (N != 0)
    {
        char c = (N - 1) % 26 + 'a';
        res.push_back(c);
        N = (N - 1) / 26;
    }
    reverse(ALL(res));
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 3632
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()
const int MAX = 110;

int main()
{
    int n;
    while(cin >> n && n)
    {
        int num[MAX] = {};
        int des;
        REP(n) cin >> num[i]; 
        cin >> des;

        int ls = 0, rs = n - 1, ans = 0, cen = 0;
        while(1)
        {
            //cout << "center = " << (ls + rs) / 2 << endl;
            if(ls > rs) break;
            ans++;
            cen = (ls + rs) / 2;
            if(num[cen] == des) break;
            if(num[cen] < des) ls = cen + 1;
            else rs = cen - 1;

        }
        cout << ans << endl;
    }

    return 0;
}

Measured memory_bytes: 1160
#pragma region
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
  return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
  cin >> first;
  ci(rest...);
  return;
}
inline void co(void){
  cout << endl;
  return;
}
template <typename First, typename... Rest>
void co(First first, Rest... rest){
  cout << first << "";
  co(rest...);
  return;
}
#define ll long long
#define ld long double
#define st string
#define wh while
#define ve vector
#define mp make_pair
#define tp tuple
#define mt make_tuple
#define pb push_back
#define pof pop_front
#define pob pop_back
#define pf push_front
#define fr front
#define ft first
#define sc second
#define tos to_string
#define len length
#define rt return
#define br break
#define con continue
#define lcm(n, m) (n * m / __gcd(n, m))
#define np next_permutation
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m) - 1;i>=(int)(n);i--)
#define rev(i, m) revi(i, m, 0)
#define sz(v) ((int)(v).size()) 
#define each(i, n) for(auto&& i: n)
#define all(n) n.begin(), n.end()
#define allr(n) n.rbegin(), n.rend()
#define sp(n) cout << fixed << setprecision(n)
#define pi 3.14159265358979323846
#define inf 1000000007
#pragma endregion
// sqrt ルート, int 2*10^9, gcd　最大公約数
// __builtin_popcount bitの個数

ve<int> dx = {0, 0, 1, -1}, dy = {1, -1, 0, 0};

int main() {
  int a, p;
  ci(a, p);
  co((a * 3 + p) / 2);
}

Measured memory_bytes: 256
L,R = map(int,input().split())
a=R-L
Y=2019
if a<2019:
  for i in range(L,R+1):
    for j in range(L,R+1):
      if Y>(i*j)%2019 and i!=j:
        Y= (i*j)%2019
  print(Y)
else:
  print(0)
    

Measured memory_bytes: 2940
from math import gcd
import collections

def prime_factorize(n):
  a = []
  while n % 2 == 0:
    a.append(2)
    n //= 2
  f = 3
  while f * f <= n:
    if n % f == 0:
      a.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    a.append(n)
  return a

n = int(input())
a = tuple(map(int,input().split()))

g = a[0]
for ai in a:
  g = gcd(g,ai)
if g != 1:
  print('not coprime')
  exit()
b = {}
s = 0
for ai in a:
  c = collections.Counter(prime_factorize(ai))
  for k,v in c.items():
    if k in b:
      print('setwise coprime')
      exit()
    else:
      b[k] = v
print('pairwise coprime')


Measured memory_bytes: 194556
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <array>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

int main() {
    int A,B,C;
    cin>>A>>B>>C;
    if(A>C||C>B)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 256
int main(void)
{
    int x=1, y=1;

    while (x != 0 || y != 0)
    {
        scanf("%d %d", &x, &y);

        if (x==0&&y==0)
        {
            return 0;
        }
        else
        {
            if (y >= x)
            {
                printf("%d %d\n", x, y);
            }
            else
            {
                if (x > y)
                {
                    printf("%d %d\n", y, x);
                }
            }
        }
    }
    return 0;
}


Measured memory_bytes: 2044
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <cctype>
#include <complex>
#include <string>
#include <sstream>
#include <fstream>
#include <cassert>
using namespace std;

//common
typedef long long i64,ll;

#define BR "\n"
#define ALL(c) (c).begin(),(c).end()
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define FOR(i,l,r) for(int i=(l);i<(int)(r);++i)
#define EACH(it,o) for(auto it = (o).begin(); it != (o).end(); ++it)
#define IN(l,v,r) ((l)<=(v) && (v)<(r))

//debug
#ifdef NDEBUG
#define DUMP(x)
#define DUMPLN(x)
#define DEBUG(x)
#define DEBUGLN(x)
#define LINE()
#define LINELN()
#define CHECK(exp,act)
#define STOP(e)
#else
#define DUMP(x)  cerr << #x << " = " << (x)
#define DUMPLN(x)  DUMP(x) <<endl
#define DEBUG(x) DUMP(x) << LINE() << " " << __FILE__
#define DEBUGLN(x) DEBUG(x)<<endl
#define LINE()    cerr<< " (L" << __LINE__ << ")"
#define LINELN()    LINE()<<endl
#define CHECK(exp,act)  if(exp!=act){DUMPLN(exp);DEBUGLN(act);}
#define STOP(e)  CHECK(e,true);if(!(e)) exit(1);
#endif

template<class T> inline string toString(const vector<T>& x) {
	stringstream ss;
	REP(i,x.size()){
		if(i!=0)ss<<" ";
		ss<< x[i];
	}
	return ss.str();
}

template<class T> inline string toString(const vector<vector<T> >& map) {
	stringstream ss;
	REP(i,map.size()){
		if(i!=0)ss<<BR;
		ss<< toString(map[i]);
	}
	return ss.str();
}
template<class K,class V>  string toString(map<K,V>& x) {
	string res;stringstream ss;
	for(auto& p:x)ss<< p.first<<":" << p.second<<" ";
	return ss.str();
}

string BITtoString(int bit){
    stringstream ss;
    while(bit!=0){ss<<(bit%2);bit/=2;}
    string res=ss.str();reverse(ALL(res));
    return res;
}

template<typename T,typename V> inline T mod(T v,V MOD){
	return (v%MOD+MOD)%MOD;
}

namespace EGraph{
	typedef int Cost;Cost CINF=1<<28;
	struct Edge{
		int from,to;Cost cost;
		Edge(int from,int to,Cost cost)
		: from(from),to(to),cost(cost) {};
		bool operator<(Edge r) const{
			return cost<r.cost;
		}
		bool operator>(Edge r) const{
			return cost>r.cost;
		}
	};
	typedef vector<vector<Edge> >  Graph;
}
using namespace EGraph;
class Main{
public:
	
	void run(){
		Graph g(6);
		g[0].push_back(Edge(0,1,0));g[0].push_back(Edge(0,2,1));
		g[1].push_back(Edge(1,3,1));
		g[2].push_back(Edge(2,1,0));
		g[3].push_back(Edge(3,4,0));g[3].push_back(Edge(3,5,1));
		g[4].push_back(Edge(4,2,1));g[4].push_back(Edge(4,5,0));
		g[5].push_back(Edge(5,1,1));g[5].push_back(Edge(5,2,0));
		while(true){
			string s;cin >> s;
			if(s=="#")break;

			int p=0;bool ok=false;
			REP(i,s.size()){
				
				bool ex=false;
				EACH(e,g[p])if(e->cost==s[i]-'0'){
					ex=true;p=e->to;break;
				}
				if(!ex)break;
				if(i+1==s.size() && p==5)ok=true;
			}
			cout << (ok?"Yes":"No")<<endl;
		}
	}
};

 int main(){
	//ios::sync_with_stdio(false);
 	Main().run();
 	return 0;
 }

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

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

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

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

// constexpr int MAX = 20;

// vector<vector<int>> grundy(2 * MAX, vector<int>(2 * MAX, -1));
// int mex(vector<int> &v) {
//     if (v.size() == 0) return 0;
//     sort(all(v));
//     if (v.front() > 0) return 0;
//     rep (i, v.size() - 1) {
//         if (v[i + 1] > v[i] + 1) return v[i] + 1;
//     }
//     return v.back() + 1;
// }
// int dfs (int i, int j) {
//     // eprintf("(%d,%d)", i, j);
//     if (i > j) swap(i, j);
//     if (int r = grundy[i][j]; r != -1) return r; 
//     vector<int> v;
//     rep (x, 1, 1 + i / 2) v.push_back(dfs(i - x * 2, j + x));
//     rep (y, 1, 1 + j / 2) v.push_back(dfs(i + y, j - y * 2));
//     return grundy[i][j] = mex(v);
// }

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    // rep (i, MAX) {
    //     rep (j, i + 1) eprintf("%2d ", dfs(i, j));
    //     eprintf("\n");
    // }
    ll x, y; cin >> x >> y;
    cout << (abs(x - y) > 1 ? "Alice\n" : "Brown\n");
    return 0;
}

Measured memory_bytes: 3652
#include <stdio.h>

#define judge(a,b) ((b)%(a-1)==0)?0:1

int main(void)
{
  int A, B;
  int tap = 0;
  int count = 1;

  scanf("%d %d",&A,&B);

  while(count<B){
    tap++;
    count += A-1;
  }

  printf("%d\n",tap);

  return 0;
}


Measured memory_bytes: 128
def F(A, B):
    if len(str(A)) > len(str(B)):
        max = len(str(A))
    else:
        max = len(str(B))
    
    return max

N = int(input())

n = int(N**(1/2))

min = 10
for i in range(1, n+1):
    if N % i == 0:
        A = i
        B = int(N / i)
        
        max = F(A, B)
        
        if max < min:
            min = max
else:
    print(min)

Measured memory_bytes: 3064
#!/usr/bin/env python3
import sys


def solve(A: int, B: int, C: int, D: int, E: int):
    R = [A, B, C, D, E]
    mn = 10
    ret = 0
    count = 0
    for r in R:
        if r % 10 > 0 and r % 10 < mn:
            mn = r % 10
        if r % 10 == 0:
            count += 1
        ret += (r // 10) * 10
    ret += (5 - count) * 10
    ret -= 10 - mn
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    E = int(next(tokens))  # type: int
    solve(A, B, C, D, E)

if __name__ == '__main__':
    main()


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

int main()
{
  int X;
  cin >> X;
  vector<int> V;
  V.push_back(0);
  while (1)
  {
    int M = V.size();
    for (int i = 0; i < M; i++)
    {
      for (int j = 0; j < M; j++)
      {
        if (V.at(i) - V.at(j) == X)
        {
          cout << i << " " << j << endl;
          return 0;
        }
        else if (V.at(i) + V.at(j) == X)
        {
          cout << i << " " << (-1) * j << endl;
          return 0;
        }
      }
    }
    int a = V.size();
    int n = a * a * a * a * a;
    V.push_back(n);
  }
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define BOOST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define mp make_pair
#define pb push_back
#define ll long long
#define test(t) int t ; cin>>t ; while(t--)
ll mulmod(ll a, ll b, ll mod){ll res = 0;a = a % mod;while (b > 0){if (b % 2 == 1)res = (res + a) % mod;a = (a * 2) % mod;b /= 2;}return res % mod;}
int n;
int solve(int a , int b , int c){
	return min( (abs(b - a) + abs(c - b)) , (abs(c-a) + abs(b - c)));
}
int main(){
	BOOST;
	// cin >> n;
	int arr[3];
	for(int i = 0 ; i < 3 ; ++i){
		cin >> arr[i];
	}
	sort(arr, arr + 3);
	int a = solve(arr[0] , arr[1] , arr[2]);
	int b = solve(arr[1] , arr[0] , arr[2]);
	int c = solve(arr[2] , arr[1] , arr[0]);
	cout << min(a , min(b , c));
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}

#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define rep2(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)

long long INF = 1LL<<60;
ll n,k;
int main(){
    cin>>n>>k;
    double p=0;
    for(ll i=1;i<=n;i++){
        ll temp=i;
        double tmp_p=1.0/n;
        while(temp<k){
            tmp_p*=0.5;
            temp*=2;
        }
        p+=tmp_p;
    }
    cout<<fixed<<setprecision(10)<<p<<endl;
    return 0;
}




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

int main(){
    int n,k;
    cin>>n>>k;
    int res=2;

    if (n<k)
    {
        cout<<1;
        return 0;
    }

    while (!(pow(k,res)-1>=n))
    {
        res++;
    }
    
    cout<<res;
}

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

int main(){
    int r, g, b;
    cin >> r >> g >> b;
    int ans = r*100 + g*10 + b;
    if(ans%4==0){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
//raja1999

//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string> 
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
//setbase - cout << setbase (16)a; cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 <<endl;prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
using namespace __gnu_pbds;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
#define int ll

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

//std::ios::sync_with_stdio(false);
int a[200005],k;
int solve(int l,int r){
	if(l==r){
		if(a[l]%k==1){
			return 1;
		}
		return 0;
	}
	int mid=(l+r)/2,ans=0,s=0,c=0,i;
	ans=solve(l,mid);
	vii vec,vec1,vec2;
	map<int,int>mapi,mapi1;
	ans+=solve(mid+1,r);
	f(i,mid+1,r+1){
		s+=a[i];
		s%=k;
		c++;
		vec.pb(mp(s,c-s));
		vec1.pb(mp(s,c-s+k));
		mapi[c-s]++;
	}
	sort(all(vec));
	sort(all(vec1));
	s=0;
	c=0;
	fd(i,mid,l){
		s+=a[i];
		s%=k;
		c++;
		vec2.pb(mp(s,s-c));
	}
	int cur,cur1;
	sort(all(vec2));
	cur=vec.size()-1;
	cur1=vec1.size()-1;
	rep(i,vec2.size()){
		while(cur>=0&&vec[cur].ff+vec2[i].ff>=k){
			mapi[vec[cur].ss]--;
			cur--;
		}
		while(cur1>=0&&vec1[cur1].ff+vec2[i].ff>k){
			mapi1[vec1[cur1].ss]++;
			cur1--;
		}
		ans+=mapi[vec2[i].ss]+mapi1[vec2[i].ss];
	}
	return ans;
}
main(){
	std::ios::sync_with_stdio(false); cin.tie(NULL);
	int t,t1;
	//cin>>t;
	t=1;
	t1=t;
	while(t--){
		int n,i;
		cin>>n>>k;
		rep(i,n){
			cin>>a[i];
		}
		cout<<solve(0,n-1)<<endl;
	}
	return 0;
} 
	

Measured memory_bytes: 31552
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <numeric>
#include <queue>
#include <string>
#include <vector>

using namespace std;
const double PI = 3.14159265358979323846;
int main() {
    char s;
    cin >> s;
    if(s >= 'a' && s <= 'z') {
        cout << 'a' << endl;
    } else {
        cout << 'A' << endl;
    }
}


Measured memory_bytes: 3640
# -*- coding: utf-8 -*-

""" ビット全検索をちゃんと使ってみる版 """

D, G = map(int, input().split())

# 各点数問題毎の、全問解いた場合の回答数と得点を保持
class ScoreSet:
    def __init__(self, times, score):
        self.times = times
        self.score = score

# 各パターン毎の、合計回答数と合計得点と、どの点数問題を全問解いたのかを保持
class ScoreSetSum:
    def __init__(self, times, score, bool_list):
        self.times = times
        self.score = score
        self.bool_list = bool_list

# 入力内容から、ScoreSetのリストを作成
scoreSetList = []
for i in range(D):
    p, c = map(int, input().split())
    scoreSetList.append(ScoreSet(p, p*100*(i+1) + c))

# どの点数問題を全問解いたのかの各パターンの全網羅
# bool_lists = list(itertools.product([True, False], repeat=D))

# ビット数に応じた全パターン数のループ
bool_lists = []
for i in range(1<<D):
    # あるパターンでの各ビットの0or1を見ていくループ
    bool_lists.append([])
    for j in range(D):
        # 右ビットシフトした時の1桁目が1か0かで処理を分ける
        if 1 & i>>j == 1:
            bool_lists[i].append(True)
        else:
            bool_lists[i].append(False)

# パターン全網羅とScoreSetのリストから、ScoreSetSumのリストを作成
scoreSetSumList = []
for bool_list in bool_lists:
    times_tmp = 0
    score_tmp = 0
    for i in range(len(bool_list)):
        if bool_list[i]:
            times_tmp += scoreSetList[i].times
            score_tmp += scoreSetList[i].score
    scoreSetSumList.append(ScoreSetSum(times_tmp, score_tmp, bool_list))

# ScoreSetSumのリストを元に、適切なパターンを探していく
ans = float("inf")
for scoreSetSum in scoreSetSumList:
    tmp = float("inf")
    # 得点が既にG以上であれば、そのままその回答数が候補
    if scoreSetSum.score >= G:
        tmp = scoreSetSum.times
    else:
        # 足りなかったら、全問解いていない点数問題から最も高いもの選ぶ
        for i in range(D-1, -1, -1):
            if scoreSetSum.bool_list[i] == False:
                score = scoreSetSum.score
                times = scoreSetSum.times
                # 選んだ点数問題を1問ずつ解いていく
                for j in range(scoreSetList[i].times):
                    score += 100*(i+1)
                    times += 1
                    # G以上に達した時点で、その時の回答数が候補
                    if score >= G:
                        tmp = times
                        break
                    # 最後まで解いてもG以上にならなければ、このパターンは候補外
                break
    # 今までの最小と今回の候補を比較
    ans = min(ans, tmp)

print(ans)

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

using namespace std;

int main()
{
    int n;
    cin >> n;
    auto x = (int)(((double)n + 0.999) / 1.08);
    auto n1 = x * 108 / 100;
    if (n != n1) {
        cout << ":(" << endl;
    }
    else {
        cout << x << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <cmath>
#include <cstdlib>

using namespace std;
struct node
{
    double p,t,v;
}nd[105];
int n,m,L;
double dp[105][55][55];
int main()
{
    //freopen("D.in", "r", stdin);
    //freopen("D.out3", "w", stdout);
    
    while(~scanf("%d%d%d",&n,&m,&L))
    {
        for(int i=0;i<n;i++)
        {
            scanf("%lf%lf%lf",&nd[i].p,&nd[i].t,&nd[i].v);
            nd[i].p/=100.0;
        }
        for(int i=0;i<n;i++)
        {
            dp[i][0][0]=1;
            for(int j=1;j<=m;j++)
                for(int k=0;k<=j;k++)
                {
                    if(k>0)
                        dp[i][j][k]=dp[i][j-1][k]*(1-nd[i].p)+dp[i][j-1][k-1]*nd[i].p;
                    else dp[i][j][k]=dp[i][j-1][k]*(1-nd[i].p);
                }
        }
        /*for(int i=0;i<n;i++)
        {
            for(int j=0;j<=m;j++)
            {
                for(int k=0;k<=m;k++)
                    printf("%.6f ",dp[i][j][k]);
                puts("");
            }
            puts("");
        }
         */
        for(int i=0;i<n;i++)
        {
            double ans=0;
            for(int j=0;j<=m;j++)
            {
                double ans1=dp[i][m][j],t=L/(nd[i].v)+j*nd[i].t;
                for(int ii=0;ii<n;ii++)
                {
                    if(ii==i)continue;
                    double tem=0,tt=L/nd[ii].v;
                    for(int jj=0;jj<=m;jj++)
                    {
                        if(tt+jj*(nd[ii].t)>t)
                            break;
                        tem+=dp[ii][m][jj];
                    }
                    ans1*=(1.0-tem);
                }
                ans+=ans1;
            }
            printf("%.8f\n",ans);
        }
    }
    return 0;
}

Measured memory_bytes: 3612
//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const int INF= 1e9+5;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
int main(){
  int n;
  ll l;
  cin>>n>>l;
  vl a(n);
  rep(i,n)cin>>a[i];
  bool cant=true;
  int ans;
  rep(i,n-1){
    if(a[i]+a[i+1]>=l){
      ans=i;
      cant=false;
    }
  }
  if(cant){
    cout<<"Impossible"<<endl;
    return 0;
  }
  else cout<<"Possible"<<endl;
  ans++;
  for(int i=n-1;i>ans;i--)cout<<i<<endl;
  for(int i=1;i<ans;i++)cout<<i<<endl;
  cout<<ans<<endl;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define double long double
using namespace std;

ll x, k, d, p;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> x >> k >> d;
    x = abs(x);
    p = x / d;
    if (p >= k) {
        cout << x - k * d;
        return 0;
    }
    k -= p;
    x %= d;
    if (k % 2 == 0) {
        cout << x;
        return 0;
    }
    cout << d - x;
    return 0;
}


Measured memory_bytes: 3628
#include <iostream>

using namespace std;
int main(){
  int n;
  int num[10000];
  while( cin >> n,n ){
    int max = -100001;

    for(int i = 0 ; i < n ; i++)cin >> num[i];

    for(int i = 0 ; i < n ; i++){
      int sum = 0;
      for(int j = i ; j < n ; j++){
	sum += num[j];
	if(sum > max)max = sum;
      }
    }
    cout << max << endl;
  }
  return 0; 
}

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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

constexpr int dx[8] = { 1,1,0,-1,-1,-1,0,1 };
constexpr int dy[8] = { 0,1,1,1,0,-1,-1,-1 };


using namespace std;

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s; cin >> s;
	int n = s.size();
	int l = -1, r = -1;
	REP(i, 26) {
		vi cnt(n + 1, 0);
		REP(j, n) {
			if (i + 'a' == s[j]) {
				cnt[j + 1] = cnt[j] + 1;
			}
			else {
				cnt[j + 1] = cnt[j] - 1;
			}
		}
		int m = 0, p = 0;
		FOR(j, 1, n) {
			if (cnt[j + 1] - m >= 1) {
				r = j + 1;
				l = p + 1;
			}
			if (chmin(m, cnt[j]))p = j;
		}
	}
	cout << l << " " << r << endl;
}

Measured memory_bytes: 848
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef vector <int> vi;
#define REP(i,n) for (int i=0; i<n; i++)
#define ALL(x) x.begin(), x.end()

string i2s(int n){
  stringstream ss;
  ss << n;
  return ss.str();
}

int op(int x, int y, int mode){
	switch (mode){
	case 0:
		return x+y;
	case 1:
		return x-y;
	case 2:
		return x*y;
	}
}

string check(vi x, int n){
	int x0=x[0], x1=x[1], x2=x[2], x3=x[3];
	string s0=i2s(x0), s1=i2s(x1), s2=i2s(x2), s3=i2s(x3);
	string ops="+-*", eq1, eq2;
	int n1 = ops.size();
	REP(i1, n1){
		int a1 = op(x0, x1, i1);
		eq1 = "("+s0+" "+ops[i1]+" "+s1+")";
		REP(i2, n1){
			int a2 = op(a1, x2, i2);
			eq2 = "("+eq1+" "+ops[i2]+" "+s2+")";
			REP(i3, n1)
				if (op(a2, x3, i3)==n) return "("+eq2+" "+ops[i3]+" "+s3+")";
			a2 = op(x2, x3, i2);
			eq2 = "("+s2+" "+ops[i2]+" "+s3+")";
			REP(i3,n1)
				if (op(a1, a2, i3)==n) return "("+eq1+" "+ops[i3]+" "+eq2+")";
		}
	}
	return "";
}

vi getx(){
	string line;
	getline(cin,line);
	istringstream is(line);
	vi x;
	int tmp;
	bool f = true;
	while(is>>tmp){
		if (tmp!=0) f = false;
		x.push_back(tmp);
	}
	if (f) x.clear();
	return x;
}

int f0041(){
	int n=10;
	while (true){
		vi x = getx();
		if (x.empty()) return 0;

		sort(ALL(x));
		bool f = true;
		do{
			string s = check(x, n);
			if (s != ""){
				cout<<s<<endl;
				f = false;
				break;
			}
		}while (next_permutation(ALL(x)));
		if (f) cout<<"0"<<endl;
	}
}

int main(void){
	f0041();
}

Measured memory_bytes: 1264
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>

#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 62;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll conbinationMemo[100][100];

ll cmemoInit(){
    rep(i, 100){
        rep(j, 100){
            conbinationMemo[i][j] = -1;
        }
    }
}
 
ll nCr(ll n, ll r){
    if(conbinationMemo[n][r] != -1) return conbinationMemo[n][r];
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return conbinationMemo[n][r] = (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------
map<int,int> mp;
int ans = 0;
void dfs(int now, vector<int> pos){
    if(now == 13){
        int tmp = 1e9;
        rep(i, pos.size()){
            rep(j, pos.size()){
                if(i == j) continue;
                tmp = min({tmp, pos[i] + (24 - pos[j]), abs(pos[i] - pos[j])});
            }
        }
        ans = max(ans, tmp);
        return;
    }

    if(mp[now] == 2){
        pos.push_back(now);
        pos.push_back(24 - now);
        dfs(now + 1, pos);
    } else if(mp[now] == 1){
        vector<int> next = pos;
        next.push_back(now);
        dfs(now + 1, next);
        if(now != 0 || now != 12){
            next = pos;
            next.push_back(24 - now);
            dfs(now + 1, next);
        }
    } else {
        dfs(now + 1, pos);
    }
}
int main(void){
    int n;
    cin >> n;

    mp[0] = 1;
   
    rep(i, n){
        int d;
        cin >> d;
        mp[d]++;
    }

    for(auto &i : mp){
        if(i.second > 2){
            cout << 0 << endl;
            return 0;
        }
    }

    if(mp[0] >= 2 || mp[12] >= 2){
        cout << 0 << endl;
        return 0;
    }

    vector<int> pos;
    dfs(0, pos);
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if(s.charAt(0) == s.charAt(1) && s.charAt(1)== s.charAt(2) || s.charAt(1) == s.charAt(2) && s.charAt(2)== s.charAt(3)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 21844
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <deque>
#include <ctime>
#include <map>
#include <set>

#define ll long long
#define inf 0x3f3f3f3f
#define il inline

namespace io {

#define in(a) a = read()
#define out(a) write(a)
#define outn(a) out(a), putchar('\n')

#define I_int ll
inline I_int read() {
    I_int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-') f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        x = x * 10 + c - '0';
        c = getchar();
    }
    return x * f;
}
char F[200];
inline void write(I_int x) {
    if (x == 0) return (void) (putchar('0'));
    I_int tmp = x > 0 ? x : -x;
    if (x < 0) putchar('-');
    int cnt = 0;
    while (tmp > 0) {
        F[cnt++] = tmp % 10 + '0';
        tmp /= 10;
    }
    while (cnt > 0) putchar(F[--cnt]);
}
#undef I_int

}
using namespace io;

using namespace std;

#define N 1000100

int main(){
	int a, b, c, d;
	in(a), in(b), in(c), in(d);
//	printf("%d\n",a*b-c*a-b*d+c*d);
	outn((a-c)*(b-d));
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
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; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)

int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int bingo[3][3];
bool flag[3][3];
int cnt[2][105];
int h, w;
int choco[1010][1010];
int s[11][11];

int main() {
	ll n, m;
	cin >> n >> m;
	ll s = n;
	ll c = m;
	ll ans = min(s, c / 2);
	c -= ans * 2;
	ans += c / 4;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
int n,i,ans;
  ans=1;
  scanf("%d",&n);
  
  int min[n],p[n];
  scanf("%d",&p[0]);
  min[0]=p[0];
  
  for(i=1;i<n;++i)
  {
  scanf("%d",&p[i]);
  if(p[i]<min[i-1]) {min[i]=p[i];
                    ans++;
                    }
  else min[i]=min[i-1];    
  }
  
printf("%d",ans);
return 0;
}

Measured memory_bytes: 3264
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
  private static class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
      reader = new BufferedReader(new InputStreamReader(in));
      tokenizer = null;
    }

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

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

      return tokenizer.nextToken("\n");
    }

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

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

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

    public int[] nextIntArray(int n) {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = nextInt();
      return a;
    }

    public long[] nextLongArray(int n) {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = nextLong();
      return a;
    }
  }

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    int n = sc.nextInt();
    if (n == 1) {
      System.out.println("Hello World");
    } else {
      int a = sc.nextInt();
      int b = sc.nextInt();
      System.out.println(a + b);
    }
  }
}

Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
#define LONGLONGMAX 9223372036854775807
#define LONGLONGMIN -9223372036854775807
#define INTMAX 32767
#define INTMIN -32767
#define ROUNDUP(divisor,dividend) (divisor + (dividend - 1)) / dividend
string s,t;
int main(){
  cin >> s;
  t=s;
  reverse(t.begin(),t.end());
  cout << (s.length()==2 ? s : t) << endl;
}


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

int main() {   
    int num;
    long long tmp;
    map<long long, int> m;

    cin >> num;

    for (int i = 0; i < num; i++) {
        cin >> tmp;
        if (m[-tmp] > 4) continue;
        m[-tmp]++;
    }

    tmp = 0;
    for (auto itr : m) {
        if (itr.second < 2) continue;

        if (itr.second >= 2) {
            if (tmp == 0) {
                tmp = itr.first;
            } else {
                cout << tmp * itr.first;
                return 0;
            }
        }
        
        if (itr.second >= 4) {
            cout << itr.first * itr.first;
            return 0;
        }

    }

    cout << 0;
}

Measured memory_bytes: 9828
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
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;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
ll mod=1e9+7;
const int MAX = 10000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];

void COMinit() {// テーブルを作る前処理
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; 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;
	}
}

long long COM(int n, int k){ // 二項係数:nCk計算
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main(){
	int k,n;
	COMinit();
	ll ans=1LL;
	cin >>n>>k;

	n-=k;
	ans*=n;
//	cout<<n<<endl;
	for(int i=1;i<=k;i++){
		ans=COM(n+1,i)%mod;
	//	clog<<n+1<<" "<<i<<"--";
		if(i!=k){
			ans*=COM(k-1,i-1)%mod;
		//	clog<<i<<" "<<k-i<<"--";
			// i, k-i
		}
		cout << ans%mod<< endl;
	//	clog<<endl;
	}
}
/*
  5 3   2,3
  |ooo|

  oo

  |o

  ||
2000 3
2 0
2 1
3 0
*/

Measured memory_bytes: 3780