akhauriyash/Code-Regression huggingface dataset:
// ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
// ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
// [███████████████████].░░░░░░░░░░░░░░
// ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░

//PointBlank's code (⌐■_■)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
 
ll power(ll x, ll y); 
#define repp(I, A, B) for(int I = A; I <= B; I++)
#define rep(I, A, B) for(int I = A; I < B; I++)
#define rrep(I, B, A) for(int I = B; I >= A; I--)
#define pb emplace_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define LB lower_bound
#define UB upper_bound
#define MP make_pair
#define mem(A, B) memset(A, B, sizeof(A));
#define mem0(A) memset(A, 0, sizeof(A));
#define quickio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define bitcount(n) __builtin_popcountll(n)
#define in_edges(M) repp(I, 1, M){int A, B; cin >> A >> B; v[A].pb(B), v[B].pb(A);}
#define in_dedges(M) repp(I, 1, M){int A, B; cin >> A >> B; v[A].pb(B);}
#define in_wedges(M) repp(I, 1, M){int A, B, C; cin >> A >> B >> C; v[A].pb(B, C), v[B].pb(A, C);}
#define in_dwedges(M) repp(I, 1, M){int A, B, C; cin >> A >> B >> C; v[A].pb(B, C);}
#define endl "\n"

const ll MOD = 1000000007;
const ll INF = 1e18;
 
int main() //PointBlank's code ¯\_(ツ)_/¯
{
    quickio
    ll n;
    cin >> n;

    ll arr[n + 1];
    repp(i, 1, n) cin >> arr[i];

    vector<ll> post(n + 5, 0);


    rrep(i, n, 1) post[i] = (post[i + 1] + arr[i])%MOD;
    // repp(i, 1,n) cout << post[i] << " "; cout << endl;

    ll res = 0;
    repp(i, 1, n - 1){
        ll b = post[i + 1] % MOD;
        ll a = (arr[i] * b) % MOD;
        res = (res + a) % MOD;
    }

    cout << res;
}

ll power(ll x, ll y)
{ 
    ll res = 1; x %= MOD;
    while(y > 0){if(y & 1) res = (res*x) % MOD; y = y>>1, x = (x*x) % MOD;} 
    return res; 
}

Measured memory_bytes: 6340
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<iterator>
#include<set>

#define rep(i,n) for(i=0;i<n;i++);
#define endl "\n"
using namespace std;
int main()
{
long long int b,i,n,m,c=0,p=0,q=0,r=0,s=0;
string s1;
cin>>n;
for(int i=0;i<n;i++)
{
    cin>>s1;
    if((s1.compare("AC"))==0)++p;
    else if((s1.compare("WA"))==0)++q;
    else if((s1.compare("TLE")==0))++r;
    else ++s;



}
cout<<"AC x "<<p<<endl;
cout<<"WA x "<<q<<endl;
cout<<"TLE x "<<r<<endl;
cout<<"RE x "<<s<<endl;


}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
int main(){
  int N;
  cin>>N;
  int K;
  cin>>K;
  int a[N];
  int ans = 0;
  for(int i = 0;i<N;i++){
    cin>>a[i];
    if(a[i]>=K){
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define LL long long 
#define LLU long long unsigned
#define rarr(arr, n) for(int aab = 0; aab < n; aab++){cin >> arr[aab];}
#define parr(arr, n) for(int aab = 0; aab < n; aab++){cout << arr[aab] << " ";}
#define pb push_back
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define debug(x) cout << #x << " = " << x << "\n";

#define freopen freopen("in.txt", "r", stdin);freopen("out.txt", "w", stdout);ios_base::sync_with_stdio(0);cin.tie(0);

int main(){  
    int n;
    cin >> n;
    long long int rcount = 0, wcount = 0;
    bool seew = false;
    char arr[n];
    for(int i = 0; i < n; i++){
    	cin >> arr[i];
    	if(arr[i] == 'R'){
    		rcount++;
    	}
    }
    long long int ans = 0;
    for(int i = 0; i < rcount; i++){
    	if(arr[i] == 'W'){
    		ans++;
    	}
    }
    cout << ans;
}

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

using namespace std;
using ll = long long;
using ii = pair<ll, ll>;

const int MAX { 200010 };
const ll MOD { 1000000007 }, oo { 1LL << 62 };

int solve(const string& s)
{
    if (s == "RRR")
        return 3;
    else if (s == "RRS" or s == "SRR")
        return 2;
    else if (s.find('R') != string::npos)
        return 1;

    return 0;
}

int main()
{
    ios::sync_with_stdio(false);

    string s;
    cin >> s;

    auto ans = solve(s);

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 3652
#include <iostream>
using namespace std;
int main()
{
	int x;
	cin >>x;
	int a[42] = { 1,4,8,9,16,25,27,32,36,49,64,81,100, 121 ,125 ,128 ,144,169,196 ,216,225,243 ,256 ,289 ,324 ,343 ,361 ,400 ,441 ,484 ,512 ,529 ,576 ,625 ,676  ,729 ,784 ,841 ,900 ,961 ,1000,1002
	};
	for (int i = 0; i<42; i++) {
		if (x - a[i] < 0) {
			cout << a[i - 1];
			break;
		}
	}
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		double a = sc.nextDouble();
      double b = a;
      if((int)a % 2 != 0){
      	a ++;
      }
		System.out.println((a  / 2) / b);
		
		
	}
}

Measured memory_bytes: 37444
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<iomanip>
#include<math.h>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
#define LINF (long long)4e18

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;


int main(){
   int N; cin >> N;
   string S = to_string(N);
   int ans = 0;
   if(S.size() == 1){
       ans = N;
   }
   else if(S.size() == 2){
       ans = 9;
   }
   else if(S.size() == 3){
       ans += 9;
       ans += N - 100 + 1;
   }
   else if(S.size() == 4){
       ans += 9;
       ans += 900;
   }
   else if(S.size() == 5){
       ans += 909;
       ans += N - 10000 + 1;
   }
   else ans = 90909;
   cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;

//定数
//円周率
const double pi = 3.141592653589793238462643383279;
//天井
const int INF = 1000000000; // = 10^9
const ll LINF = 1000000000000000; // = 10^15
//ABC文字列
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZABC";
const string abc = "abcdefghijklmnopqrstuvwxyzabc";
//よくあるmodくん
const ll MOD = 1000000007; // = 10^9 + 7

//データ構造
//隣接リスト用構造体（有向グラフ向け）
struct edge {
  ll to; // E.toでその辺の終点へアクセスできる
  ll cost; // e.costでその辺の重みにアクセスできる
};
//Union_Find木
struct UnionFind {
  vector<int> UF; // UF.at(i) : iの親の番号
  vector<int> SIZE; // SIZE.at(root(i)) : iと連結されてる要素の数
  UnionFind(int N) : UF(N), SIZE(N, 1) { // 最初は全てが根であるとして初期化
    for(int i = 0; i < N; i++) {
      UF.at(i) = i;
    }
  }
  int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
    if (UF.at(x) == x) {
      return x;
    }
    return UF.at(x) = root(UF.at(x));
  }
  void unite(int x, int y) { // xとyの木を併合
    int rx = root(x); // xの根をrx
    int ry = root(y); // yの根をry
    if (rx == ry) {
      return; // xとyの根が同じ(=同じ木にある)時はそのまま
    }
    // xとyの根が同じでない(=同じ木にない)時：小さい方の根を大きい方の根につける
    if (SIZE.at(rx) < SIZE.at(ry)) {
      UF.at(rx) = ry;
      SIZE.at(ry) += SIZE.at(rx);
      SIZE.at(rx) = 0;
    }
    else {
      UF.at(ry) = rx;
      SIZE.at(rx) += SIZE.at(ry);
      SIZE.at(ry) = 0;
    }
  }
  bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
  int size(int x) { // xと連結されてる要素の数を返す
    return SIZE.at(root(x));
  }
};

//関数 (計算量)
//ctoi (O(1))
int ctoi(char c){
  if (c == '0') return 0;
  if (c == '1') return 1;
  if (c == '2') return 2;
  if (c == '3') return 3;
  if (c == '4') return 4;
  if (c == '5') return 5; 
  if (c == '6') return 6;
  if (c == '7') return 7;
  if (c == '8') return 8;
  if (c == '9') return 9;
  return -1;  
}
//to_char (O(1))
char to_char(int i){
  if (i == 0) return '0';
  if (i == 1) return '1';
  if (i == 2) return '2';
  if (i == 3) return '3';
  if (i == 4) return '4';
  if (i == 5) return '5';
  if (i == 6) return '6';
  if (i == 7) return '7';
  if (i == 8) return '8'; 
  if (i == 9) return '9';
  return ' ';  
}
//素数判定 
//一つ一つの判定ではこっちの方が速い(一つ当たりO(√N))
//一方100までに何個あるかなどはEratosthenesの篩の方が良い（O(NlogN))
bool PN(int x) {
  if (x <= 1) return false; // 1や0,-1は素数ではない
  if (x == 2) return true; // √2 + 1 > 2 なので下でやると 2 ％ 2 = 0 となり判定できない
  for (int i = 2; i < sqrt(x) + 1; i++) {
    if (x % i == 0) return false; // 割れたら素数じゃない
  }
  return true;
}
// A^N mod M を計算する。modしたくなかったらM = LINFとかにすればよい。(O(√N))
ll modpow(ll A, ll N, ll M) {
  long long ans = 1;
  while (N > 0) {
    if (N & 1) ans = ans * A % M;
      A = A * A % M;
      N >>= 1;
   }
  return ans;
}
  
//メイン処理
int main() {
  cout << fixed << setprecision(16); //精度向上
  //ここまでテンプレ
  int A, B, C, D;
  cin >> A >> B >> C>> D;
  cout << min(A, B) + min(C, D) << endl;
}

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

int n;
string s;
int le,ri,cnt,pos;
int main(){
	while(1){
		cin >> n;
		if(n==0)break;
		pos=cnt=le=ri=0;
		for(int i=0;i<n;i++){
			cin >>s;
			if(s=="lu"){
				le=1;
				if(le&&ri&&!pos){
					pos=1;
					cnt++;
				}
			}else if(s=="ru"){
				ri=1;
				if(le&&ri&&!pos){
					pos=1;
					cnt++;
				}
			}else if(s=="ld"){
				le=0;
				if(!(le||ri)&&pos){
					pos=0;
					cnt++;
				}
			}else if(s=="rd")
				ri=0;
				if(!(le||ri)&&pos){
					pos=0;
					cnt++;
				}
		}
		cout << cnt<<endl;

	}
	return 0;
}

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

using namespace std;

int Search(int n, const vector<int> &par) {
	if (par[n] == n)
		return n;
	else
		return Search(par[n], par);
}

void uni(const int a, const int b, vector<int> &par, vector<int> &dep) {
	if (dep[a] < dep[b])
		par[a] = b;
	else if (dep[a] > dep[b])
		par[b] = a;
	else {
		par[b] = a;
		dep[a]++;
	}
}

int main(void) {
	int num, m, a, b, z, i = 0, ans = 0;
	scanf("%d%d", &num, &m);
	vector<int> par(num + 1), dep(num + 1, 0), exi(num + 1, true);
	for (; i <= num; i++)
		par[i] = i;
	for (i = 0; i < m; i++) {
		scanf("%d%d%d", &a, &b, &z);
		a = Search(a, par);
		b = Search(b, par);
		if (a != b)
			uni(a, b, par, dep);
	}
	for (i = 1; i <= num; i++) {
		a = Search(i, par);
		if (exi[a]) {
			ans++;
			exi[a] = false;
		}
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 1408
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
class Main{
    public static void main(String args[]){
	try{
	    InputStreamReader is = new InputStreamReader(System.in);
	    BufferedReader br = new BufferedReader(is);
	    String str = br.readLine();
	    char[] cary = str.toCharArray();
	    for(int i=(cary.length-1);i>=0;i--){
		System.out.print(cary[i]);
	    }
	    System.out.print("\n");

	}
	catch(Exception e){
	    System.exit(0);
	}
    }
}

Measured memory_bytes: 16860
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
using namespace std;

int main(){
    int N;
    int d[100000];
    cin >> N;
    for (int i =0; i < N; i++){
        cin >> d[i];
    }
    sort(d, d + N);
    cout << d[N/2] - d[N/2 - 1];
    return 0;
}

Measured memory_bytes: 4028
#coding: utf-8
from collections import deque
N, M = map(int, input().split())
dd = {i:[] for i in range(N)}
for i in range(M):
    a, b = map(int, input().split())
    dd[a-1].append(b-1)
    dd[b-1].append(a-1)
ans = [0 for _ in range(N)]
visited = [False for _ in range(N)]
queue = []
for i in range(len(dd[0])):
    queue.append([0, dd[0][i]])
queue = deque(queue)
while queue:
    q = queue.popleft()
    if visited[q[1]]:
        continue
    visited[q[1]] = True
    ans[q[1]] = q[0] + 1
    for v in dd[q[1]]:
        if not visited[v]:
            queue.append([q[1], v])
print("Yes")
print(*ans[1:], sep="\n")


Measured memory_bytes: 56696
a,b=map(int,input().split())
ab=0
ba=0
for i in range(b):
    ab+=a*(10**i)
for i in range(a):
    ba+=b*(10**i)
if a<b:
    print(ab)
elif b<a:
    print(ba)
else:
    print(min(ab,ba))

Measured memory_bytes: 3064
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

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

	cin >> H >> W;
	vector<string>s(H);
	for (auto &i : s)cin >> i;
	bitset<300>v[300];
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			v[i][j] = s[i][j] == '#';
		}
	}
	long long int ans = 0;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (!v[i][j])continue;
			for (int k = i + 1, l = j + 1, cnt = 2; k < H&&l < W; k++, l++, cnt += 2) {
				if (!v[k][l])continue;
				for (int m = k - cnt-min(0,k-cnt), n = l-min(0,k-cnt); m <= i&&n < W; m++, n++) {
					if (v[m][n])ans++;
				}
				for (int m = k-min(0,l-cnt), n = l - cnt-min(0,l-cnt); m < H&&n <= j; m++, n++) {
					if (v[m][n])ans++;
				}
			}
			for (int k = i - 1, l = j + 1, cnt = 2; k >= 0 &&l < W; k--, l++, cnt += 2) {
				if (!v[k][l])continue;
				for (int m = k + cnt-1-max(0,k+cnt-(int)H), n = l+1+ max(0, k + cnt - (int)H); m > i&&n < W; m--, n++) {
					if (v[m][n])ans++;
				}
				for (int m = k - 1+ min(l - cnt + 1, 0), n = l - cnt + 1-min(l-cnt+1,0); m >= 0 && n < j; m--, n++) {
					if (v[m][n])ans++;
				}
			}
		}
	}
	cout << ans << endl;
	return 0;

}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
const int N=2e2+5,mod=1e9+7;
ll n,m,k,dp[N][N],num[N][N];
int main(){
	cin>>n>>m>>k;
	for(int s=0;s<(1<<(m-1));s++){
		bool ok=true;
		for(int j=0;j<m-1;j++){
			int b1=(s>>j)&1;
			int b2=(s>>(j+1))&1;
			if(b1==b2&&b1)	ok=false;
		}
		if(!ok)	continue;
		for(int j=0;j<m;){
			if((s>>j)&1){
				num[j][j+1]++,num[j+1][j]++;
				j+=2;
			}
			else{
				num[j][j]++;
				j++;
			}
		}		
	}
	dp[0][0]=1;
	for(int i=0;i<n;i++)
		for(int j=0;j<m;j++)
			for(int p=0;p<m;p++)	dp[i+1][p]=(dp[i+1][p]+(dp[i][j]*num[j][p])%mod)%mod;
	cout<<dp[n][k-1]<<'\n';
	return 0;
}


Measured memory_bytes: 384
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sn = new Scanner(System.in);
        int n = sn.nextInt();
        int m = sn.nextInt();
        int c = sn.nextInt();
        
        List<Integer> blist = new ArrayList<>();
        for (int i = 0; i < m; i++){
            blist.add(sn.nextInt());
        }
        
        int resultCount = 0;
        for (int j = 1; j <= n; j++){
            int correct = 0;
            for (int i = 0; i < m; i++){
                int a = sn.nextInt();
                correct = correct + blist.get(i) * a;
            }
            correct += c;
            if(correct > 0) {
                resultCount++;
            }
        }
        System.out.println(resultCount);
    }
}

Measured memory_bytes: 21844
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int main()
{
    int n, a, b;
    cin >> n;
    ll x = 1, y = 1;
    ll r, l, mid;
    for (int i = 0; i < n; i++) {
        cin >> a >> b;
        mid = max(x / a, y / b);
        while (mid * a < x || mid * b < y) mid++;
        x = mid * a;
        y = mid * b;
    }
    cout << x + y << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.util.Map.Entry;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long dp[] = new long[N+1];
        
        dp[0] = 2;
        dp[1] = 1;
        
        if( N >= 2 ) {
            for(int i = 2; i < N+1; i++ ) {
                dp[i] = dp[i-1] + dp[i-2];
            }
        }

        System.out.println( dp[N] );
    }
}


Measured memory_bytes: 35720
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/
const ll MOD = 1e9 + 7;

void add(ll &a, ll b) {
	a += b;
	a %= MOD;
}

int a[120];
ll dp[120][120];
ll dp2[120][120];
vector<pair<int, int> > vv;

int n;
int go[120];
int gg[120];

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> n;
	for (int i = 0; i < 2 * n - 1; ++i)
		cin >> a[i];
	sort(a, a + 2 * n - 1);
	int cnt = 0;
	for (int i = 0; i < 2 * n - 1; ++i) {
		++cnt;
		if (i == 2 * n - 2 || a[i] != a[i + 1]) {
			vv.push_back(make_pair(a[i], cnt));
			cnt = 0;
		}
	}
	int gl = 0;
	for (int i = 0; i < vv.size(); ++i) {
		int l = gl;
		int r = 2 * n - 1 - gl - vv[i].second;
		int m = vv[i].second;
		while (m > 1) {
			if (l < r)
				++l;
			else
				++r;
			--m;
		}
		go[i] = n - 1 - min(l, r);
		if (l < r)
			gg[i] = 0;
		else
			gg[i] = 1;
		gl += vv[i].second;
	}
	dp[1][0] = 1;
	for (int i = 0; i < n - 1; ++i) {
		for (int x = 0; x <= 2 * n - 1; ++x)
			for (int y = 0; y <= 2 * n - 1; ++y)
				dp2[x][y] = 0;
		int l = 0;
		int r = 0;
		for (int j = 0; j < vv.size(); ++j)
			if (go[j] == i + 1) {
				if (gg[j] == 0)
					++l;
				else
					++r;
			}
		for (int x = 0; x <= 2 * n - 1; ++x)
			for (int y = 0; y < x; ++y) {
				if (!dp[x][y])
					continue;
				int nx = x + l + r;
				int ny = y + l;
				add(dp2[nx][ny], dp[x][y]);
				for (int j = 0; j < ny; ++j)
					add(dp2[nx - (ny - j - 1)][j], dp[x][y]);
				for (int j = ny + 1; j < nx; ++j)
					add(dp2[nx - (j - ny - 1)][ny + 1], dp[x][y]);
			}
		for (int x = 0; x <= 2 * n - 1; ++x)
			for (int y = 0; y <= 2 * n - 1; ++y)
				dp[x][y] = dp2[x][y];
	}
	ll ans = 0;
	for (int i = 0; i <= 2 * n - 1; ++i)
		for (int j = 0; j < i; ++j)
			add(ans, dp[i][j]);
	cout << ans << "\n";
	return 0;
}




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

public class Main {

    public static void main(String[] args) {
        FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = 1;
        while (t --> 0) solver.solve(1, scan, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, FastReader scan, PrintWriter out) {
            int n = scan.nextInt();
            for(int i = 1; i <= 9; i++) {
                for(int j = 1; j <= 9; j++) {
                    if(i * j == n) {
                        out.println("Yes");
                        return;
                    }
                }
            }
            out.println("No");
        }
    }

    static void shuffle(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffle(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

Measured memory_bytes: 24788
import java.util.Scanner;

public class Main {
    public static boolean debug = true;

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

        long result = 0;
        for(int i=1;i<=n-1;i++){
            result += i;
        }

        System.out.println(result);



    }

    public static void d(String message){
        if(debug){
            System.out.println(message);
        }
    }


}


Measured memory_bytes: 23892
N = int(input())

ans =[0]*(N+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            s = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if s <= N:
                ans[s] += 1

for i in range(1, N+1):
    print(ans[i])

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

import sys
import copy

sys.setrecursionlimit(1000000)

# input = sys.stdin.readline

# ~~~~~~~~~~~~~~~~~~~~~_(＾～＾ ｣ ∠)_~~~~~~~~~~~~~~~~~~~~~

W, H, x, y = map(int, input().split())

ans = (W * H) / 2.0

if W % 2 == 0 and H % 2 == 0 and W // 2 == x and H // 2 == y:
    print(ans, 1, sep=" ")
else:
    print(ans, 0, sep=" ")


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

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORd(i, a, b) for (int i = (a) ; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define sp system("pause")
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
const int N = (int) 1e5 + 10;
void TimeExecution() {
    cout << "\n\n===>> Time Execution: " << clock() / (double)1000 << " sec(s).";
}
int t, n, d;
int x[11][11];
int sqr(int a)
{
    return a * a;
}
bool is_round(double a)
{
    return (ceil(a) == floor(a));
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    /*
    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif
    */
    cin >> n >> d;
    FOR(i, 1, n)
        FOR(j, 1, d)
             cin >> x[i][j];
    int ans = 0;
    FOR(i, 1, n)
    {

        FOR(j, i + 1, n)
        {
            int s1 = 0;
            FOR(k, 1, d) s1 += sqr(x[i][k] - x[j][k]);
            if(is_round(sqrt(s1))) ans++;
        }
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
n,m,x=map(int,input().split())
c=[list(map(int,input().split())) for i in range(n)]
ans=10**10
for i in range(1<<n):
    a=[0]*m
    res=0
    for j in range(n):
        if i>>j&1:
            res+=c[j][0]
            for k in range(m):
                a[k]+=c[j][k+1]
    f=1
    for i in a:
        if i<x:
            f=0
            break
    if f:
        ans=min(ans,res)
print(ans if ans<10**10 else -1)

Measured memory_bytes: 9216
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;

int main(){
  int n;
  cin>>n;
  double p[n];
  rep(i,0,n) cin>>p[i];
  double dp[n+1][n+1];
  rep(i,0,n+1) dp[0][i]=0;
  dp[0][0]=1;
  rep(i,0,n){
    rep(j,0,n+1){
      if(j==0) dp[i+1][j]=dp[i][j]*(1-p[i]);
      else dp[i+1][j]=dp[i][j]*(1-p[i])+dp[i][j-1]*p[i];
    }
  }
  double ans=0;
  rep(i,n/2+1,n+1){
    ans+=dp[n][i];
  }
  cout<<fixed<<setprecision(15);
  cout<<ans<<endl;
}

Measured memory_bytes: 70528
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include<map>
#include<cmath>
#include<deque>
using namespace std;

using ll = long long;
const int INF = 1001001001;

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

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

  ll result = 0;
  for (int i = 1; i <= n; i++) {
      if (i % 3 != 0 && i % 5 != 0) {
         result += i;
      }
  }
  cout << result << endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define pb push_back
#define ers erase
#define ins insert
#define F first
#define S second
#define debug(x)  cerr << #x << " = " << x << endl
#define kill(x) return cout << x, 0;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;


const ld Pi = 3.14159265359;
const ll MOD = 1000 * 1000 * 1000 + 7;
const ll MAXN = 2e5 + 10;
const ll INF = 1e18;
ll n;

int main(){
	IOS;
	cin >> n;
	ll Cnt = 0;
	while (n != 0){
		Cnt += (n % 10 == 2);
		n /= 10;
	}
	cout << Cnt;
	
	
	
	
	
	
	return 0;
}






/*
     ,---,           ___                 ,--,
    '  .' \        ,--.'|_             ,--.'|                             ,--,
   /  ;    '.      |  | :,'            |  | :                           ,--.'|    ,---.        ,---,
  :  :       \     :  : ' :            :  : '                 .--.--.   |  |,    '   ,'\   ,-+-. /  |
  :  |   /\   \  .;__,'  /    ,--.--.  |  ' |     ,--.--.    /  /    '  `--'_   /   /   | ,--.'|'   |
  |  :  ' ;.   : |  |   |    /       \ '  | |    /       \  |  :  /`./  ,' ,'| .   ; ,. :|   |  ,"' |
  |  |  ;/  \   \:__,'| :   .--.  .-. ||  | :   .--.  .-. | |  :  ;_    '  | | '   | |: :|   | /  | |
  '  :  | \  \ ,'  '  : |__  \__\/: . .'  : |__  \__\/: . .  \  \    `. |  | : '   | .; :|   | |  | |
  |  |  '  '--'    |  | '.'| ," .--.; ||  | '.'| ," .--.; |   `----.   \'  : |_|   :    ||   | |  |/
  |  :  :          ;  :    ;/  /  ,.  |;  :    ;/  /  ,.  |  /  /`--'  /|  | '.'\   \  / |   | |--'
  |  | ,'          |  ,   /;  :   .'   \  ,   /;  :   .'   \'--'.     / ;  :    ;`----'  |   |/
  `--''             ---`-' |  ,     .-./---`-' |  ,     .-./  `--'---'  |  ,   /         '---'
                            `--`---'            `--`---'                 ---`-'
*/




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

int main() {
    int n, d;
    cin >> n >> d;
    vector<vector<double>> x(n, vector<double>(d));
    rep(i, n) rep(j, d) cin >> x[i][j];
    int ans = 0;
    rep(j, n) rep(i, j) {
        // distance
        double dist = 0;
        rep(k, d) {
            dist += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
        }
        dist = sqrt(dist);
        if (ceil(dist) == floor(dist)) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3792
//#define _GLIBCXX_DEBUG
#include <iostream>
#include <bits/stdc++.h>


using namespace std;
#define ll long long
#define ld long double
#define  P pair<ll,ll>
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,m,n) for(ll i=n; i>=(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cout(n) cout<<fixed<<setprecision(n)

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m;
    cin>>n>>m;
    ll ans = 0;
    FOR(j,1,n+1){
      FOR(i,1,m+1){
        ll a = i/10;
        ll b = i%10;
        if(a>=2 && b>=2 && j == a*b){
          ans++;
        }
      }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <bitset>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <queue>

#define mp make_pair
#define pb push_back


typedef long long ll;
typedef long double ld;

using namespace std;

int h, w, n;
set<pair<int, int> > ss;
set<pair<int, int> > bl;
ll ans[120];

int main() {
	scanf("%d%d%d", &h, &w, &n);
	for (int i = 0; i < n; ++i) {
		int x, y;
		scanf("%d%d", &x, &y);
		--x, --y;
		bl.insert(make_pair(x, y));
		for (int dx = 0; dx >= -2; --dx)
			for (int dy = 0; dy >= -2; --dy) {
				if (x + dx < 0 || y + dy < 0 || x + dx + 3 > h || y + dy + 3 > w)
					continue;
				ss.insert(make_pair(x + dx, y + dy));
			}
	}
	for (auto p: ss) {
		int x, y;
		tie(x, y) = p;
		int cc = 0;
		for (int i = 0; i < 3; ++i)
			for (int j = 0; j < 3; ++j)
				cc += bl.count(make_pair(x + i, y + j));
		ans[cc] += 1;
	}
	ans[0] += (ll)(h - 2) * (ll)(w - 2) - ss.size();
	for (int i = 0; i < 10; ++i)
		cout << ans[i] << "\n";
	return 0;
}




Measured memory_bytes: 47104
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];

signed main(){
 	// #ifndef ONLINE_JUDGE
 	// freopen("input.txt","r",stdin);
 	// freopen("output.txt","w",stdout);
 	// #endif
	SaveTime;
	int T=1;
	// cin >> T;
	while(T--){
		int n ;cin>>n;
		string s;
		cin >>s;
		string alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		for(int i =0 ; i < s.size();i++){
			cout << alp[(s[i]-'A'+n)%26];
		}
	
	}
	
    cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main()
{
	string rock;
	cin >> rock;

	int l = rock.length();
	int count = 0;

	for (int i = 0; i < l - 1; ++i)
	{
		if (rock[i] != rock[i + 1]) ++count;
	}

	cout << count << endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() {
	int n;
	cin >> n;
	string s[100];
	int a[100];
	int size[100];
	string S;
	int SIZE;
	int i;
	for (i = 0; i < n; i++) {
		cin >> s[i] >> a[i];
		size[i] = s[i].length();
	}
	cin >> S;
	SIZE = S.length();
	int Cheak;
	for (i = 0; i < n; i++) {
		if (size[i] != SIZE) continue;
		bool flag = true;
		for (int j = 0; j < SIZE; j++) {
			if (s[i] != S) flag = false; break;
		}
		if (flag) {
			Cheak = i + 1;
			break;
		}
	}
	int ans = 0;
	for (i = Cheak; i < n; i++) {
		ans += a[i];
	}
	cout << ans;
	return(0);
}

Measured memory_bytes: 256
import math
def make_divisors(n):
    divisors = []
    for i in range(1, int(math.sqrt(n))+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
def main():
    N, K = map(int, input().split())
    mod = 10**9 + 7
    d = {}
    r = 0
    for i in range(K, 0, -1):
        l = make_divisors(i)
        x = K // i
        t = pow(x, N, mod)
        if i in d:
            t -= d[i]
        for j in l:
            if j not in d:
                d[j] = t
            else:
                d[j] += t
        r += t * i
        r %= mod
    return r % mod
print(main())


Measured memory_bytes: 80292
import java.util.*;
  public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        double D = sc.nextDouble();
        int cnt = 0;
        double[] X = new double[N];
        double[] Y = new double[N];
        for(int i=0; i<N; i++){
          X[i] = sc.nextDouble();
          Y[i] = sc.nextDouble();
          double d = Math.sqrt(X[i]*X[i]+Y[i]*Y[i]);
          if(d<=D){
            cnt++;
          } else if(N==0 || d>D){
            continue;
          }
        }
      System.out.println(cnt);
    }
  }

Measured memory_bytes: 68080
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define uu unsigned
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define pi pair<int,int>
#define pl pair<ll,ll>
#define mkp make_pair
#define ss second
#define ff first
#define all(x) x.begin(),x.end()
#define vi vector<int>
#define vl vector<ll>
#define vb vector<bool>
#define pb push_back
#define pf push_front
#define printcas cout<<"Case "<<cas<<": "
#define _ continue;
#define endl '\n'
#define __ cout<<endl;continue;
#define vc4d(nam,type,a,b,c,d,fix) vector<vector<vector<vector<type>>>> nam(a,vector<vector<vector<type>>>(b,vector<vector<type>>(c,vector<type>(d,fix))))
const ll oo=(1ll<<60);
int gg(){
    int x=0,w=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
    if(ch=='-')w=0,ch=getchar();
    while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
    return w?x:-x;
}
ll ceil(ll a,ll div)
{
    if(a*div>=0)
        return (a+div-1)/div;
    return a/div;
}
int main()
{
     io;
    int T=1;
    //T=gg();
    //cin>>T;
    //for(int cas=1;cas<=T;cas++)
    while(T--)
    {
       ll n,x,t;
       cin>>n>>x>>t;
       cout<<ceil(n,x)*t;
    }
    return 0;
}


Measured memory_bytes: 3652
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <math.h>
#include <cmath>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cassert>
#include <random>
#include <deque>
#include <bitset>
#include <string>
#include <queue>
#include <complex>

//#define int long long

#define mp(a, b) make_pair(a, b)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

#define endl '\n'

using namespace std;
typedef long long ll;
typedef long double ld;

mt19937 mrand(random_device{}());

double PI = acos((double)-1);
const ld eps = 1e-7;
const ll inf0 = 1023 * 1024 * 1024;
const ll inf = inf0 * inf0;
//const ll mod = 1e9 + 9;
const ll mod = 998244353;

void solve();
void scan();

signed main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
	cout << fixed; cout.precision(15);
	solve();
	return 0;
}

void solve() {
	int k, n; cin >> k >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	sort(all(a));
	int mini = a[0] + k - a.back();
	for (int i = 1; i < n; i++) {
		mini = max(mini, a[i] - a[i - 1]);
	}
	cout << k - mini << endl;
	return;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF INT_MAX
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define sec second
#define fir first
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
typedef vector<int> Vec;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



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

	int n, m;
	cin >> n >> m;
	string a = "1";
	rep(i, n-1) a += "0";
	if(n == 1) a = "0";

	int fix[n] = {};
	rep(i, m) {
		int s;
		char c;
		cin >> s >> c;
		s--;
		if(n > 1 && s == 0 && c == '0') {
			puts("-1");
			return 0;
		}
		if(fix[s] && a[s] != c) {
			puts("-1");
			return 0;
		}
		a[s] = c;
		fix[s] = 1;
	}
	cout << a << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] ary = sc.next().toCharArray();
		Set set = new HashSet<>();
		for (char c : ary) {
			set.add(c);
		}

		boolean beau = true;
		for (Object o : set) {
			int count = 0;
			for (char c : ary) {
				if(c == (char)o) {
					count++;
				}
			}
			if(count%2 != 0) {
				beau = false;
			}
		}
		if(beau) System.out.println("Yes");
		else System.out.println("No");
	}
}

Measured memory_bytes: 21716
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce



sys.setrecursionlimit(2147483647)
INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n = I()
L = IR(n)
IS = deque([L[0]])
for i in range(1, n):
    if L[i] <= IS[0]:
        IS.appendleft(L[i])
    else:
        IS[bisect_left(IS, L[i]) - 1] = L[i]



print(len(IS))

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

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


Measured memory_bytes: 3160
#include<bits/stdc++.h>
#define N 500005
using namespace std;
int n,m,x,y,kk,q[N],fa[N],ru[N],head[N];
struct node{int nxt,to;}e[N];
inline void link(int x,int y){e[++kk].nxt=head[x];e[kk].to=y;head[x]=kk;}
int main(){
	scanf("%d%d",&n,&m);
	for (int i=1;i<n+m;i++){
		scanf("%d%d",&x,&y);
		link(x,y);ru[y]++;
	}
	int left1=1,right1=1;
	for (int i=1;i<=n;i++) if (!ru[i]) q[1]=i;
	while (left1<=right1){
		int u=q[left1++];
		for (int i=head[u];i;i=e[i].nxt){
			int v=e[i].to;
			if (ru[v]==1){fa[v]=u;q[++right1]=v;}
			ru[v]--;
		}
	}
	for (int i=1;i<=n;i++) printf("%d\n",fa[i]);
	return 0;
}

Measured memory_bytes: 9856
#include <bits/stdc++.h>
using namespace std;
int main(){
  vector<int> x(5);
  for (int i = 0; i < 5; i++){
    cin >> x[i];
  }
  for (int i = 0; i < 5; i++){
    if (x[i] == 0){
      cout << i + 1 << endl;
    }
  }
}

Measured memory_bytes: 3548
#include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(a) ((a).begin(), (a).end())
typedef long long ll;
// const long long INF = 1LL << 60;
const int INF = 1010101010;
// using Graph = vector<vector<int>>;
const int MOD = 1000000007;

int main() {
  int k;
  cin >> k;
  int s[] = {1, 1, 1, 2, 1, 2, 1, 5,  2, 2, 1, 5, 1, 2, 1, 14,
             1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  cout << s[k - 1] << endl;
}


Measured memory_bytes: 256
M=10**9+7;*I=r=j=1;eval"N,*Z="+`dd`.split*?,;Z.map{|k|$*[k]&&X=$*[k]+N+$.;$*[k]=-$.-=1}.map{|i|I<<s=i<2?1:M/i*-I[M%i];p (-j+r=r*(N+2-i)*s%M)%M;j=j*(X-i)*s%M}

Measured memory_bytes: 46472
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <utility>
using ll = long long;
#define MOD 1000000007
using namespace std;

// dp[len][c3][c2][c1]:=長さlenの末尾がc3c2c1の条件を満たす文字列の個数
int dp[101][4][4][4];

int main(){
    int N;
    cin >> N;
    dp[0][3][3][3] = 1;
    for(int len = 0; len < N; len++)
    {
        for(int c3 = 0; c3 < 4; c3++)
        {
            for(int c2 = 0; c2 < 4; c2++)
            {
                for(int c1 = 0; c1 < 4; c1++)
                {
                    if (dp[len][c3][c2][c1] == 0) continue;
                    for(int a = 0; a < 4; a++)
                    {
                        if (c3 == 0 && c2 == 2 && a == 1) continue;
                        if (c3 == 0 && c1 == 2 && a == 1) continue;
                        if (c2 == 0 && c1 == 2 && a == 1) continue;
                        if (c2 == 2 && c1 == 0 && a == 1) continue;
                        if (c2 == 0 && c1 == 1 && a == 2) continue;
                        dp[len + 1][c2][c1][a] += dp[len][c3][c2][c1] % MOD;
                        dp[len + 1][c2][c1][a] %= MOD;
                    }
                }
            }
        }
    }
    ll ans = 0;
    for(int c3 = 0; c3 < 4; c3++)
    {
        for(int c2 = 0; c2 < 4; c2++)
        {
            for(int c1 = 0; c1 < 4; c1++)
            {
                ans += dp[N][c3][c2][c1];
                ans %= MOD;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
<?php



fscanf(STDIN, "%d %d %d %d", $a, $b, $div[], $div[]);

$div[] = (int)lcm($div[0] , $div[1]);
$maxnumber = $b - $a + 1;

$delete = [];
foreach($div as $number => $value){
    if($a%$value == 0){
        $start = intdiv($a,$value);
    }else{
        $start = intdiv($a, $value)+1;
    }
    $end = intdiv($b , $value);
    $delete[$number] = (int)($end - $start + 1);

}


$ans =  ($maxnumber - ($delete[0] + $delete[1] - $delete[2]));
echo $ans;
function gcd($m, $n){
    if($n > $m) list($m, $n) = array($n, $m);

    while($n !== 0){
        $tmp_n = $n;
        $n = $m % $n;
        $m = $tmp_n;
    }
    return $m;
}
function lcm($m, $n){
    return $m * $n / gcd($m, $n);
}

Measured memory_bytes: 4856
require 'openssl'
N,*X = $<.read.split.map &:to_i
M = (10**9+7).to_bn
m = 0.to_bn
F = (1...N).inject(m+1) {|s,i| s.mod_mul(i.to_bn,M)}
p (1...N).inject(m) {|s,i|
	m += F * i.to_bn.mod_inverse(M)
	((m%=M) * (X[i]-X[i-1]).to_bn + s) % M
  }.to_i

Measured memory_bytes: 17652
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <tuple>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <deque>
#include <iomanip>
#include <list>
using namespace std;
#define pi pair<int32,int32>
#define pl pair<int64,int64>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define en cout << endl //セミコロンつけろ
//#define MM 1000000000
//#define MOD MM+7
const int MM = 1e9;
const int MOD = MM+7;
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
// 'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122
template<typename T>
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T>
T LCM(T x,T y){
    T gc = GCD(x,y);
    return x*y/gc;
}


int main(){
    string s; cin >> s;
    int ans = 0;
    for(int i = 1; i < s.size(); i++){    
        if (s[i] == s[i-1]){
            ans++;
            if (s[i] == '1'){
                s[i] = '0';
            } else {
                s[i] = '1';
            }
        }
    }
    cout << ans << endl;
}



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

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int dy[] = { 0, 0, 1, -1 };
const int dx[] = { 1, -1, 0, 0 };
const long double PI = 3.141592653589793238462643383279502884197;

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

	int N, K;
	cin >> N >> K;

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

	sort(arr.begin(), arr.end());

	int sum = 0;
	for (int i = 0; i < K; i++)
		sum += arr[i];

	cout << sum;

	return 0;
}

Measured memory_bytes: 3560
import std.stdio, std.conv, std.string, std.algorithm, std.math, std.functional;

void main() {
    auto N = readln.chomp.to!int;
    int cx = 0, cy = 0;
    int ct = 0;
    bool ok = true;
    foreach (i; 0..N) {
        auto tmp = readln.split.to!(int[]);
        if (!ok) continue;
        auto t = tmp[0];
        auto x = tmp[1];
        auto y = tmp[2];
        auto dt = t - ct;
        auto dx = x - cx;
        auto dy = y - cy;
        auto d = abs(dx) + abs(dy);
        if (d > dt) ok = false;
        if ((dt - d) % 2 == 1) ok = false;
        cx = x;
        cy = y;
        ct = t;
    }
    writeln(ok ? "Yes" : "No");
}


Measured memory_bytes: 1276
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include "bits/stdc++.h"
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()

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

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

int main() {

    int a, b, c;
    cin >> a >> b >> c;

    int ans = c - (a - b);
    if (ans >= 0) cout << ans << endl;
    else cout << 0 << endl;
    
    return 0;
}

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

int main() {
    int h, w;
    cin >> h >> w;
    vector<vector<char>> s(h+2, vector<char>(w+2, '.'));
    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            cin >> s[i][j];
        }
    }

    vector<int> dxy { 0, -1, 1, 1, 0, 1, -1, -1, 0 };
    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            if (s[i][j] == '#') {
                cout << '#';
            } else {
                char b = '0';
                for (int d = 0; d < 8; d++) {
                    if (s[i+dxy[d]][j+dxy[d+1]] == '#') b++;
                }
                cout << b;
            }
        }
        cout << endl;
    }
}


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

using namespace std;
using LL = long long;
using P = pair<int, int>;

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

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e19;
const int MOD = 1e9 + 7;

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n, m;
    cin >> n >>m;
    vector<int> l(m), r(m);
    REP(i, m) cin >> l[i] >> r[i];

    vector<int> imos(n+1, 0);
    REP(i, m){
        imos[l[i]-1]++;
        imos[r[i]-1+1]--;
    }
    REP(i, n)
    {
        imos[i+1] += imos[i];
    }
    int ans= 0;
    REP(i, n) if(imos[i] == m) ans++;
    cout << ans << endl;
    
}

Measured memory_bytes: 1408