akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long
#define INT_MAX INT64_MAX
#define INT_MIN INT64_MIN
#define CLK clock_t clk = clock();//Start of main
#define OCLK cerr << "Time (in ms): " << (double)(clock() - clk) * 1000.0 / CLOCKS_PER_SEC << '\n';//End of main
#define MOD 1000000007
/* DEFINE cout */
#define pln cout << "===============================\n"
#define on cout<<"\n"
#define os cout<<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define bitcount __builtin_popcount
/* DEFINE cout */
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);//fastio
using namespace std;
struct hash_pair { // use pair as key in unordered_map<pair<int,int>,int,hash_pair>;
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const
    {
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        return hash1 ^ hash2;
    }
};
bool prime[10000001];
int P=MOD-2;
int factorial[10000001]={0};
int powerFunction(int x,int y){
    int res = 1;
    int p = MOD;
    x = x % p;
    while (y > 0){
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
void sieveFunction(int maxLimit){
    memset(prime, true, sizeof(prime));
    prime[0] = prime[1]=false;
    for(int i=2; maxLimit >= i ; i++){
        if(prime[i]){
            for(int j=2*i ; maxLimit >= j ; j+=i)
                prime[j]=false;
        }
    }
}
void factorialFunction(int maxLimit){
    factorial[0]=1;
    for(int i=1 ; i <= maxLimit ; i++)
        factorial[i]=(factorial[i-1]*i)%MOD;
    return;
}
int gcd(int a, int b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
signed main(){
    int x;
    cin >> x;
    int temp = x/500;
    int ans = 1000*temp;
    x %= 500;
    ans += (5 * (x/5));
    cout << ans << endl;
}






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

const double PI = acos(-1);

int main(){
    double a, b, x ;
    cin >> a >> b >> x;
    long double ans;
    if(a * a * b / 2.0 <= x) {
        ans = atan(2 * (a * a * b - x) / (a * a * a));
    } else {
        ans = PI / 2 - atan(2 * x / (a * b * b));
    }
    cout << setprecision(16) << ans * 180 / PI << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define pb push_back
#define x first
#define y second
#define all(a) a.begin(), a.end()
#define sz(a) (int)a.size()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int>pii;
const int maxn = 1e5 + 100;
const int mod = 1e9 + 7;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int main()
{
    ios_base::sync_with_stdio(false), cin.tie(0);
    ll r, d, x;
    cin >> r >> d >> x;
    for(int i = 0; i < 10; i++)
        cout << (x = r * x - d) << endl;
    return 0;
}


Measured memory_bytes: 256
/*
First solve the problem,then write the code.
Author-Manas Singh(@manassingh557)
*/

// #pragma GCC optimize ("Ofast")
// #pragma GCC optimization("O3")
// #pragma GCC optimization("unroll-loops")
// #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma,tune=native")
// #pragma GCC optimize ("-ffloat-store")

#include<bits/stdc++.h>

#define ll long long
#define ld long double

#define mod 1000000007
#define f first
#define s second
#define pb push_back
#define mp make_pair

#define endl "\n"

#define mii map<int,int>
#define mll map<ll,ll>
#define pii pair<int,int>
#define pll pair<<ll,ll>
#define vii vector<int>
#define vll vector<ll>

#define rep(i,end) for(int i=0;i<end;i++)
#define repi(i,start,end) for(int i=start;i<=end;i++)
#define repd(i,start,end) for(int i=start;i>=end;i--)

#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

using namespace std;

int main()
{
	fast;
	int n;
	cin>>n;
	string s;
	cin>>s;
	int x=0,max=0;
	rep(i,n)
	{
	    if(s[i]=='I')
	    {
	        x++;
	        if(x>max)
	            max=x;
	    }
	    else
	        x--;
	}
	cout<<max<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(){
  int x,stack[100],i=0,ans=1;
  char s[100];

  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
      stack[i-2] += stack[i-1];
      i--;
    } else if ( s[0] == '-' ){
      stack[i-2] -= stack[i-1];
      i--;
    } else if ( s[0] == '*' ){
      stack[i-2] *= stack[i-1];
      i--;
    } else {
      stack[i++] = atoi(s);
    }
  }
  printf("%d\n",stack[0]);
  return 0;
}

Measured memory_bytes: 548
#include <bits/stdc++.h>
const int mod=1e9+7;
using LL=long long;
using namespace std;
namespace ndifix{
template<class T>void rsort(T &v){std::sort(v.rbegin(),v.rend());}
}//end of namespace ndifix


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

  for(int i=n;i>=1;i--){
    int buf=0;
    for(int j=i+i;j<=n;j+=i)buf+=ball[j-1];
    if((buf%2) != a[i-1])ball[i-1]=1;
  }
  vector<int> ans;
  for(int i=0;i<n;i++)if(ball[i]!=0)ans.push_back(i+1);
  
  cout<<ans.size()<<endl;
  for(int i=0;i<ans.size();i++)cout<<ans[i]<<endl;
  return 0;
}


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

int main()
{
	int n, w; cin >> n >> w;
	vector<vector<char>> a(n, vector<char>(w));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < w; j++) {
			cin >> a[i][j];
		}
	}

	vector<bool> rowBlackExist(n, false);
	vector<bool> columnBlackExist(w, false);

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < w; j++) {
			if (a[i][j] == '#') {
				rowBlackExist[i] = true;
				columnBlackExist[j] = true;
			}
		}
	}
	
	for (int i = 0; i < n; i++) {
		if (rowBlackExist[i]) {
			for (int j = 0; j < w; j++) {
				if (columnBlackExist[j]) cout << a[i][j];
			}
			cout << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
typedef vector<int> vec;
typedef vector<vec> mat;
typedef long long lint;

int N;
const int MAX_N = 100005;
lint a[MAX_N],out[MAX_N];
int deg[MAX_N];
bool chk[MAX_N];

mat path,ind;

bool f(int v){
	lint sum = 0;
	for(int u:ind[v]){
		sum += out[u];
	}
	if(a[v] > sum || 2*a[v] < sum)return false;
	out[v] = 2*a[v] - sum;

	for(int u:ind[v]){
		if(out[u]>sum/2){
			if(out[v] < 2*out[u]-sum)return false;
		}
	}
	return true;
}

bool solve(){
	queue<int> Q;
	for(int i=1;i<=N;i++){
		if(deg[i]==1){
			chk[i] = 1;
			out[i] = a[i];
			Q.push(i);
		}
	}

	while(!Q.empty()){
		int v = Q.front();
		Q.pop();
		sort(ind[v].begin(),ind[v].end());

		for(int u:path[v]){
			if(chk[u]){
				auto it = lower_bound(ind[v].begin(),ind[v].end(),u);
				if(it==ind[v].end() || *it!=u)return out[v]==out[u];
				continue;
			}
			ind[u].push_back(v);
			deg[u]--;

			if(deg[u]==1){
				chk[u] = 1;
				if(!f(u))return false;
				Q.push(u);
			}
		}
	}
	return true;
}

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

	cin >> N;
	for(int i=1;i<=N;i++){
		cin >> a[i];
	}

	path.assign(N+1,vec());
	ind.assign(N+1,vec());
	for(int i=0,x,y;i<N-1;i++){
		cin >> x >> y;
		path[x].push_back(y);
		path[y].push_back(x);
		deg[x]++;
		deg[y]++;
	}

	if(solve()){
		puts("YES");
	}else{
		puts("NO");
	}

	return 0;
}

Measured memory_bytes: 13312
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
 
#include <stdio.h>
#include <bits/stdc++.h>
 
using namespace std;
 
#include <x86intrin.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <typename T> using ordered_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>;
  
#define pb push_back
#define mp make_pair
#define in insert
#define f first
#define s second
#define ll long long
#define dd double
  
const int mod = 1e9 + 7;
const int N = 2e5 + 7;
const int inf = 2e9;
const ll INF = 1e18;

int cnt[N];

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	// freopen("*.in", "r", stdin);freopen("*.out", "w", stdout);
	int n, x, y;
	cin >> n >> x >> y;

	for (int i = 1; i <= n; i++) {
		for (int j = i + 1; j <= n; j++) {
			int ans = min(j - i, abs(y - j) + abs(x - i) + 1);
			cnt[ans]++;
		}
	}

	for (int i = 1; i < n; i++) {
		cout << cnt[i] << "\n";
	}
}

Measured memory_bytes: 256
let n, h, d = Scanf.scanf "%d %d %d" (fun x y z -> x, y, z);;

let md = 1000000007L;;
let ( +: ) x y = Int64.add x y;;
let ( -: ) x y = Int64.sub x y;;
let ( *: ) x y = Int64.mul x y;;
let ( +++ ) (x : int) (y : int) : int = Int64.to_int @@ let z = Int64.of_int x +: Int64.of_int y in
                                  if z < md then z else z -: md;;
let ( --- ) (x : int) (y : int) : int = Int64.to_int @@ let z = Int64.of_int x -: Int64.of_int y in
                                  if z >= 0L then z else z +: md;;
let ( *** ) (x : int) (y : int) : int = Int64.to_int @@ Int64.rem (Int64.of_int x *: Int64.of_int y) md;;
      
let f = ref 1 and s = ref 0;;
for i = 1 to n do
  f := !f *** i;
  s := !s +++ !f;
done;;
let f = !f and s = !s;;

let dp = Array.make (h+2) 0;;
dp.(1) <- dp.(1) +++ 1;;
dp.(d+1) <- dp.(d+1) --- 1;;
for i = 1 to h-1 do
  dp.(i+1) <- dp.(i+1) +++ dp.(i);
  let l = i + 1 in
  let r = min (h+1) (i+d+1) in
  dp.(l) <- dp.(l) +++ dp.(i) *** s;
  dp.(r) <- dp.(r) --- dp.(i) *** s;
done;;
let ans = dp.(h) *** f;;
Printf.printf "%d\n" ans;;





Measured memory_bytes: 12544
K=10**10
import sys
N,L=map(int,input().split())
T=list(map(int,input().split()))
for i in range(N-1):
  if T[i]+T[i+1]>=L:
    K=i
    print("Possible")
    break
if K==10**10:
  print("Impossible")
  sys.exit()
K=K+1
R=list(range(1,K))
M=list(range(K+1,N))
M.reverse()
R.extend(M)
R.append(K)
for i in range(N-1):
  print(R[i])

Measured memory_bytes: 14484
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#include<bits/stdc++.h>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define vvc vector<vector<char> >
#define vvs vector<vector<string> >
#define P 1000000007
using namespace std;
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 LLINF=1LL<<60;
//set<int>::iterator it;


int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
	/*
	int n,i,a,b;
	cin>>n;
	vector<int> a(n,0),b(n,0);
	rep(i,n)cin>>a[i]>>b[i];
	*/
	ll i,k,n;
	cin>>n>>k;
	vector<pair<ll,ll> > a(n,make_pair(0,0));
	ll s,t;
	vector<ll> dsum;
	rep(i,n){
		cin>>s>>t;
		a[i]=make_pair(s,t);
	}
	ll sum=0;
	sort(a.begin(),a.end());
	rep(i,n){
		if(i==0)dsum.push_back(a[i].second);
		else dsum.push_back(a[i].second+dsum[i-1]);
	
	}
	
	rep(i,n+1){
		
		
		if(k<=dsum[i]){
			cout<<a[i].first<<endl;
			return 0;
		}
	}
	
	
	
	
	
	
	
	
//////////////////////////////////////////////////////
return 0;}











Measured memory_bytes: 2936
<?php
ini_set('error_reporting', E_ALL & ~E_NOTICE);
fscanf(STDIN, "%d %d", $H, $W);
for ($y = 0; $y < $H; $y++) {
	fscanf(STDIN, "%s", $S);
	$a[$y] = str_split($S);
	for ($x = 0; $x < count($a[$y]); $x++) {
		if ($a[$y][$x] == "#") {
			$sumX[$x]++;
			$sumY[$y]++;
		}
	}
}
for ($y = 0; $y < $H; $y++) {
	if ($sumY[$y] == 0) {
		continue;
	}
	for ($x = 0; $x < $W; $x++) {
		if ($sumX[$x] == 0) {
			continue;
		}
		echo $a[$y][$x];
	}
	echo "\n";
}

Measured memory_bytes: 4604
import java.util.*;
public class Main {
  public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int y = sc.nextInt();
    int[] aGroup = {1,3,5,7,8,10,12};
    int[] bGroup = {4,6,9,11};
    int[] cGroup = {2};
    String xGroup = "x";
    String yGroup = "y";

    for (int i = 0; i < 7; i++) {
      if (aGroup[i] == x) {
        xGroup = "a";
      }
      if (aGroup[i] == y) {
        yGroup = "a";
      }
    }

    for (int i = 0; i < 4; i++) {
      if (bGroup[i] == x) {
        xGroup = "b";
      }
      if (bGroup[i] == y) {
        yGroup = "b";
      }
    }

    if ((x == 2) && (y == 2)) {
      xGroup = "c";
      yGroup = "c";
    }

    if (xGroup.equals(yGroup)) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }

  }
}

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

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

int N,M,R;
int r[10];
vector<P> G[300];

struct dat{
	int cost, flag, node;
	bool operator<(const dat& another) const {
		return cost > another.cost;
	}
};

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

	cin >> N >> M >> R;

	for (int i = 0;i < R;i++){
		cin >> r[i];
	}

	for (int i = 0;i < M;i++){
		int A,B,C; cin >> A >> B >> C;
		G[A].push_back(P(B,C));
		G[B].push_back(P(A,C));
	}

	int dist[(1<<9)][200];
	for (int i = 0;i < (1<<R);i++){
		for (int j = 0;j <= N;j++){
			dist[i][j] = INT_MAX;
		}
	}

	int ans = INT_MAX;
	
	for (int start = 0;start < R;start++){
		for (int goal = start+1;goal < R;goal++){
			priority_queue<dat > que; que.push({0,(1<<start),r[start]});
			dist[(1 << start)][r[start]] = 0;
			while(que.size()){
				dat D = que.top(); que.pop();
				//cout << D.cost << " " << D.flag << " " << D.node << endl;
	   			if(dist[D.flag][D.node] < D.cost) continue;
				for (int i = 0;i < G[D.node].size();i++){
					int to = G[D.node][i].first;
					int cos = G[D.node][i].second;
					int nf = D.flag;
		    		for (int j = 0;j < R;j++){
						if(to == r[j]) nf = (nf | (1<<j));
		    		}
					if(dist[nf][to] > D.cost+cos){
						dist[nf][to] = D.cost+cos;
						que.push({dist[nf][to],nf,to});
					}	
				}
				ans = min(dist[(1<<R)-1][r[goal]], ans);	
			}
		}
	} 
	cout << ans << endl;

	return 0;

}


Measured memory_bytes: 2556
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REP(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define rep1(i,x,n) for(int (i)=(x);(i)<(int)(n);(i)++)
#define REP1(i,x,n) for(int (i)=(x);(i)<=(int)(n);(i)++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using Int = long long;

//INT_MAX = 2147483647;
//LLONG_MAX = 9223372036854775807;
//ULLONG_MAX = 18446744073709551615;
const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;
typedef pair<int,int> P;
typedef std::priority_queue<int> IntPrioQueue;
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue;

//少数点表示
//cout << std::fixed << std::setprecision(14) << 値

int main(){
    cin.tie( 0 ); ios::sync_with_stdio( false );
    int k;
    int a,b;
    cin >> k >> a >> b;
    bool flag=false;
    REP1(i,a,b){
        if(i%k==0) flag=true;
    }

    if(flag) cout << "OK";
    else cout << "NG";

    
    return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
	char s[1001];
	int a,i;
	scanf("%s",s);
	a=strlen(s);
	if(s[a-1]=='s'){
		printf("%ses\n",s);
	}
	else printf("%ss\n",s);
	return 0;
}

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

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

const int N = 1000;

#define F first
#define S second

vi dx = { 1, 0,-1, 0};
vi dy = { 0,-1, 0, 1};

int main(void){
    vvi cave(N + 1, vi(N + 1)); 

    pii pos = mp(N / 2, N / 2);
    cave[N / 2][N / 2] = 1;

    int limit = 1, cnt = 0, dir = 0, inc = false;
    range(i, 2, N * N + 1){
        if(cnt++ == limit){
            (++dir) %= dx.size();

            if(inc) limit++;
            cnt = 0;

            inc = !inc;

            i--;
            continue;
        }

        pos.F += dy[dir];
        pos.S += dx[dir];

        cave[pos.F][pos.S] = i;
    }

	const int MAX_N = (int)1e6 + 1;
	vector<bool> isP(MAX_N, true);
    isP[0] = isP[1] = false;
	for(int i = 2; i * i < MAX_N; i++) if(isP[i]) for(int j = i; i * j < MAX_N; j++) isP[i * j] = false;

    for(int m, n; cin >> m >> n, m; ){
        
        //(集めた個数, 最後に通った素数)
        vector<vector<pii>> dp(N + 1, vector<pii>(N + 1, mp(-1, -1)));

        rep(y, N + 1) rep(x, N + 1) if(cave[y][x] == n) dp[y][x] = isP[cave[y][x]] ? mp(1, cave[y][x]):mp(0, 0);

        pii res = mp(-1, -1);
        rep(y, N + 1){
            rep(x, N + 1){
                if(cave[y][x] > m || dp[y][x].F == -1) continue;

                res = max(res, dp[y][x]);

                rep(i, 3){
                    int xx = x + dx[i];
                    int yy = y + 1;

                    if(xx < 0 || N < xx ||
                       yy < 0 || N < yy) continue;

                    dp[yy][xx] = max(dp[yy][xx], mp(dp[y][x].F + (isP[cave[yy][xx]] ? 1:0), isP[cave[yy][xx]] ? cave[yy][xx]:dp[y][x].S));
                }
            }
        }

        cout << res.F << " " << res.S << endl;
    }

    return 0;
}

Measured memory_bytes: 13144
def main():
    n = int(input())
    p = [0] * (n + 1)
    m = [[0] * (n + 1) for _ in range(n + 1)]
    for i in range(n):
        p[i], p[i + 1] = map(int, input().split())
    for l in range(2, n + 1):
        for i in range(1, n - l + 2):
            j = i + l - 1
            m[i][j] = float('inf')
            for k in range(i, j):
                p_prod = p[i - 1] * p[k] * p[j]
                m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p_prod)
    print(m[1][n])


if __name__ == '__main__':
    main()



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

using namespace std;

int main( ) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t,n,i;
    double a;
    t = 1;
    while(t--) {
     a = 0;
     cin >> n;
     int arr[n];
     for(i = 0; i < n; i++)
      cin >> arr[i];
     for(i = 0; i < n; i++) {
      a = a + (double) 1 / arr[i];
	 }
	 a = 1 / a;
	 cout << fixed << setprecision(16);
     cout << a << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int b = sc.nextInt();
		if (a < b) {
			System.out.println("a < b");
		} else if (a > b) {

			System.out.println("a > b");

		} else {
			System.out.println("a == b");

		}
	}

}

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

int main() {
  int N; cin >> N;
  string c; cin >> c;
  int red =0; int white =0;
  for (int i =0; i<N; i++) {
    if (c.at(i) =='R') red++;
    if (c.at(i) =='W') white++;
  }
  
  bool check0 = false;
  int wr =0;
  if (c.at(N-2) == 'W' && c.at(N-1) == 'R') wr++;
  for (int i =0; i<N-1; i++) {
    if (c.at(i) == 'W' && c.at(i+1) == 'R') wr++;
  }
  if (wr ==0) check0 = true;
  
  int count =0;
  for (int i =0; i<N; i++) {
    if (i <= red -1 && c.at(i) =='W') count++;
    if (i > red -1 && c.at(i) =='R') count++;
  }
    
  int ans = count / 2 + count % 2;
  if (check0) {
    cout << 0 << endl;
  } else {
    cout << ans << endl;
  }
}

Measured memory_bytes: 3692
#include <iostream>
#include <map>
#include <utility>
#include <queue>

using namespace std;

int main() {
    priority_queue<pair<string, pair<int, int>>, vector<pair<string, pair<int, int>>>, greater<pair<string, pair<int, int>>>>que;

    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        string s;
        int p;
        cin >> s >> p;
        pair<string, pair<int, int>> value = {s, {100 - p, i + 1}};
        que.push(value);
    }
    while(!que.empty()){
        cout << que.top().second.second << endl;
        que.pop();
    }
}


Measured memory_bytes: 256
/*
ID: espr1t
TASK: 
KEYWORDS: 
*/

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;
FILE* in = stdin; FILE* out = stdout;

const int MAX = 200002;

int n;
char a[MAX];
int dyn[MAX][2];

int recurse(int idx, int prev) {
    if (idx >= n)
        return 0;
    if (dyn[idx][prev] != -1)
        return dyn[idx][prev];
    
    int ans = MAX;
    // If previous is white
    if (prev == 0) {
        ans = min(ans, recurse(idx + 1, a[idx] == '#'));
        ans = min(ans, recurse(idx + 1, 0) + 1);
    }
    // If previous is black
    if (prev == 1) {
        // Current is black
        if (a[idx] == '#') {
            ans = min(ans, recurse(idx + 1, 1));
        }
        // Current is white
        if (a[idx] == '.') {
            ans = min(ans, recurse(idx + 1, 1) + 1);
        }
    }
    
    return dyn[idx][prev] = ans;
}

int main(void) {
//	in = fopen("C.in", "rt");
	
	fscanf(in, "%d", &n);
	fscanf(in, "%s", a);
	
	memset(dyn, -1, sizeof(dyn));
	fprintf(out, "%d\n", recurse(0, 0));
	
	return 0;
}

Measured memory_bytes: 11264
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>
#include <cmath>
#include <numeric>

using namespace std;

#define int long long
#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define rrep(i, n) for (int i=(int)n-1;i>=0;--i)
#define rrep1(i, n) for (int i=n;i>=1;--i)
#define range(i, l, r) for (int i=l;i<(int)r;++i)
#define rrange(i, l, r) for (int i=(int)r-1;i>=(int)l;--i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using vi=vector<int>;
using pii=pair<int, int>;

bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
int read(){int a;scanf("%lld",&a);return a;}
constexpr int TEN(int n){return n==0?1:10*TEN(n-1);}

const int inf = TEN(9) + 10;

int N, K;

signed main()
{
	cin >> N >> K;

	int counter = (N - 1) * (N - 2) / 2;

	if (counter < K) {
		cout << -1 << endl;
		return 0;
	}

	vector<pii> edges;

	for (int i = 2; i <= N; ++i) {
		edges.PB(1, i);
	}

	int cur = 2;

	while (counter != K) {
		for (int i = cur; i + 1 <= N; ++i) {
			edges.PB(cur, i + 1);
			counter--;
			if (counter == K) break;
		}
		cur++;
	}

	cout << edges.size() << endl;
	for (auto &&e : edges) {
		printf("%lld %lld\n", e.fst, e.scd);
	}
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define ll long long
#define ls rt << 1
#define rs rt << 1 | 1
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define X first
#define Y second
using namespace std;
const int N = 1e5 + 10;
const ll mod = 1e9 + 7;

inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
	return x * f;
}

int id[N];
ll jc[N], ny[N];

ll qpow(ll a, ll x)
{
	if(x == 1) return a % mod;
	ll now = (qpow(a, x / 2) % mod);
	if(x % 2 == 1) return ((now * a % mod) * now % mod);
	else return (now * now % mod);
}

ll C(int a, int b)
{
	if(a < b) return 0;
	return (((jc[a] * ny[b] % mod) * ny[a - b]) % mod);
}

int main()
{
	jc[0] = 1;
	jc[1] = 1;
	for(int i = 2; i <= 1e5 + 5; i ++)
		jc[i] = jc[i - 1] * i, jc[i] = jc[i] % mod;
	ny[0] = 1;
	ny[1] = 1;
	for(int i = 2; i <= 1e5 + 5; i ++)
		ny[i] = qpow(jc[i], mod - 2);
	//for(int i = 1; i <= 10; i ++)
		//cout << jc[i] << " " << ny[i] << endl;
	int n = read();
	memset(id, -1, sizeof(id));
	int s, t;
	for(int i = 0; i <= n; i ++)
	{
		int x = read();
		x --;
		if(id[x] == -1) id[x] = i;
		else s = id[x], t = i;
	}
	//cout << s << " " << t << endl;
	//cout << C(5, 3) << " ";
	for(int i = 1; i <= n + 1; i ++)
	{
		ll ret = C(n + 1, i) % mod;
		ret = ret - C(s + (n - t), i - 1);
		ret %= mod;
		if(ret < 0) ret += mod;
		printf("%lld\n",ret);
	}
	
	return 0;
}

Measured memory_bytes: 3200
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>

#define REP(i,a,b) for(int i=int(a);i<int(b);i++)

using namespace std;

typedef long long int lli;

int main () {
    int r, n;
    while (cin >> r >> n, r + n) {
        int base = 20;
        vector<int> v(base * 3, 0);
        REP (i, 0, n) {
            int xl, xr, h;
            cin >> xl >> xr >> h;
            REP (t, xl, xr) v[t + base] = max(v[t + base], h);
        }

        double le = -r, ri = 100;
        double eps = 1e-9;
        while (abs(le - ri) > eps) {
            double mid = (le + ri) / 2;
            bool check = true;
            REP (i, 0, v.size()) {
                int t = i - base;
                if (r * r > t * t) {
                    double y = mid + sqrt(r * r - t * t);
                    if (y > v[i]) check = false;
                }
                t++;
                if (r * r > t * t) {
                    double y = mid + sqrt(r * r - t * t);
                    if (y > v[i]) check = false;
                }
            }
            if (check) {
                le = mid;
            } else {
                ri = mid;
            }
        }
        cout << fixed << setprecision(10) << (le + ri) / 2 + r << endl;
    }
    return 0;
}

Measured memory_bytes: 3280
#include<stdio.h>

int width, height;
int circle_x, circle_y, circle_r;

int main() {
	scanf("%d %d %d %d %d", &width, &height, &circle_x, &circle_y, &circle_r);
	
	if (width - circle_r >= circle_x && circle_r <= circle_x &&
		height - circle_r >= circle_y && circle_r <= circle_y)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}


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

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b, a % b);
}

using Graph = vector<vector<int>>;

ll calc(ll a, ll b, ll p){//aのb乗をpで割った余り
  if(b == 0) return 1;

  else if(b%2 == 0){
    ll d = calc(a,b/2,p);
    return (d*d)%p;
  }
  else if(b%2 == 1){
    return (a * calc(a,b-1,p))%p;
  }
}

typedef pair<int,int> P;

bool is_prime(int n){//nが素数であるかどうか判定 iで割り切れると素数でない
    if(n == 1) return false;//1は例外
    for(int i = 2;i*i <= n;i++){
        if(n%i == 0) return false;
    }
    
    return true;
}
int factorial(int a){
  int res = 1;
  while(a){
    res *= a;
    a--;
  }
  return res;
}

int main(){
  ll A,B,C,D;
  cin >> A >> B >> C >> D;
  cout << max(A*B,C*D) << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>

int main() 
{
	char s[10002];
	scanf("%s", s);
	int len = strlen(s);
	if (s[len - 1] == 's') {
		s[len] = 'e';
		s[len + 1] = 's';
		len += 2;
	}
	else {
		s[len++] = 's';

	}
	for (int i = 0; i < len; i++) {
		printf("%c", s[i]);
	}
	printf("\n");
	return 0;
}

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

using namespace std;

string replicate(string s, int n) {
  string ret = "";
  for (int i = 0; i < n; i++) {
    ret += s;
  }
  return ret;
}

int main() {
  int a, b; cin >> a >> b;
  string s = replicate(to_string(a), b);
  string t = replicate(to_string(b), a);
  cout << (s < t ? s : t) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using P = pair<char, char>;

void leave(string message) {
    cout << message << endl;
    exit(0);
}

int main() {
    lint n, q;
    string s;
    cin >> n >> q >> s;

    vector<P> td(q);
    for(int i=0; i<q; i++) cin >> td[i].first >> td[i].second;

    // -1: NG_LEFT, 0: NG_RIGHT, 1: OK
    auto simulate = [&](int idx) {
        for(auto e : td) {
            char t = e.first, d = e.second;
            if(s[idx] == t) {
                idx += (d == 'L' ? -1 : +1);
                if(idx < 0) return -1;
                if(idx > n-1) return 0;
            }
        }
        return 1;
    };

    if(simulate(0) == 0) leave("0");
    if(simulate(n-1) == -1) leave("0");

    int ng, ok;
    ng = -1, ok = n;
    while(ok - ng > 1) {
        int mid = (ok + ng) / 2;
        (simulate(mid) == -1 ? ng : ok) = mid;
    }
    int left = ok;

    if(simulate(left) == 0) leave("0");
    ng = n;
    while(ng - ok > 1) {
        int mid = (ok + ng) / 2;
        (simulate(mid) == 1? ok : ng) = mid;
    }
    int right = ng;

    cout << right - left << endl;
}

Measured memory_bytes: 900
// A - Rounding

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const int MOD = 1e9 + 7;

int main(){
	int X, A;
	cin >> X >> A;

	int ans;
	if (X < A) ans = 0;
	else ans = 10;

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
X,Y=map(int,input().split())

def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod

Z=((X+Y)//3)

if (X+Y)%3==0 and abs(X-Y)<=Z:
  ans=(comb(Z, X-Z,(10**9+7)))
  print(ans)
else:
  print(0)

Measured memory_bytes: 3064
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define fo(i,l,r) for(int i=l;i<=r;i++)
#define of(i,l,r) for(int i=l;i>=r;i--)
#define fe(i,u) for(int i=head[u];i;i=e[i].next)
using namespace std;
typedef long long ll;
inline void open(const char *s)
{
	#ifndef ONLINE_JUDGE
	char str[20];
	sprintf(str,"in%s.txt",s);
	freopen(str,"r",stdin);
//	sprintf(str,"out%s.txt",s);
//	freopen(str,"w",stdout);
	#endif
}
inline int rd()
{
	static int x,f;
	x=0;f=1;
	char ch=getchar();
	for(;ch<'0'||ch>'9';ch=getchar())if(ch=='-')f=-1;
	for(;ch>='0'&&ch<='9';ch=getchar())x=x*10+ch-'0';
	return f>0?x:-x;
}
const int N=110;
int n,m,a[N],b[N],t=0;

int main()
{
	n=rd();m=rd();
	fo(i,1,m)a[i]=rd(),t+=(a[i]&1);
	if(m==1){
		if(a[1]==1)puts("1\n1\n1");
		else printf("%d\n2\n%d %d",a[1],1,a[1]-1);
		return 0;
	}
	if(t>2){puts("Impossible");return 0;}
	fo(i,2,m)if(a[i]&1)a[1]&1?swap(a[m],a[i]):swap(a[1],a[i]);
	t=0;
	if(a[1]>1)b[t=1]=a[1]-1;
	fo(i,2,m)b[++t]=a[i];b[t]++;
	fo(i,1,m)cout<<a[i]<<' ';cout<<endl;
	cout<<t<<endl;
	fo(i,1,t)cout<<b[i]<<' ';cout<<endl;
	return 0;
}


Measured memory_bytes: 764
#include <iostream>
#include <array>
#include <vector>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <map>
#include <set>

using namespace std;

typedef  pair<int,int> P;
typedef long long LL;

const LL INF=1<<30;
const LL MOD=1000000007;

LL gcd(LL a,LL b){
    if(b==0)return a;

    return gcd(b,a%b);
}

LL kaijo(LL n){
    LL ans=1;
    for(LL i=1;i<=n;++i){
        (ans*=i)%=MOD;
    }
    return ans;
}


int main(){
    LL n,m;
    cin>>n>>m;
    if(abs(n-m)>=2)cout<<0<<endl;
    else if(n==m)cout<<2*(kaijo(n)*kaijo(m))%MOD<<endl;
    else cout<<kaijo(n)*kaijo(m)%MOD<<endl;


}

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

int main() {
  int inf = INT_MAX;
  string S;
  cin >> S;
  int ans = inf;
  for (int i = 0; i < S.size() - 2; ++i) {
    string str = S.substr(i, 3);
    int X = stoi(str);
    ans = min(ans, abs(X - 753));
  }
  cout << ans << endl;
}


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

int main(){
    string s;
    cin >> s;
    int len = s.size();

    if(s.at(len-1) == 's'){
        cout << s << "es" << endl;
    }else{
        cout << s << "s" << endl;
    }

}

Measured memory_bytes: 3628
import std.stdio, std.string, std.conv, std.range;
import std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, std.random, core.bitop;

enum inf = 1_001_001_001;
enum infl = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;

void main() {
    int N;
    scan(N);
    auto x = new int[](N);
    auto y = new int[](N);
    iota(N).each!(i => scan(x[i], y[i]));

    auto p = iota(N).array;

    double ans = 0;

    do {
        double d = 0;
        foreach (i ; 0 .. N - 1) {
            d += hypot(x[p[i + 1]] - x[p[i]], y[p[i + 1]] - y[p[i]]);
        }
        ans += d;
    } while (nextPermutation(p));

    foreach (i ; 1 .. N + 1) {
        ans /= i;
    }

    writefln("%.12f", ans);
}









void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int64_t N;
  cin >> N;
  vector<int64_t> plus(0);
  vector<int64_t> minus(0);
  for(int i=0; i<N; i++){
    int64_t x;
    cin >> x;
    if(x > 0){
      plus.push_back(x);
    }
    else{
      minus.push_back(x);
    }
  }
  
  sort(plus.begin(),plus.end());
  sort(minus.begin(),minus.end());
  
  int64_t num = 0;
  vector<pair<int64_t,int64_t>> ans(0);
  pair<int64_t,int64_t> P;
  
  if(plus.size() > 0 && minus.size() > 0){
    int64_t a = minus.at(0);
    for(int i=0; i<plus.size()-1; i++){
      P = make_pair(a,plus.at(i));
      ans.push_back(P);
      a -= plus.at(i);
    }
    int64_t b = plus.at(plus.size()-1);
    for(int i=1; i<minus.size(); i++){
      P = make_pair(b,minus.at(i));
      ans.push_back(P);
      b -= minus.at(i);
    }
    P = make_pair(b,a);
    ans.push_back(P);
    num = b-a;
  }
  else if(plus.size() > 1){
    int64_t a = plus.at(0);
    for(int i=1; i<plus.size()-1; i++){
      P = make_pair(a,plus.at(i));
      ans.push_back(P);
      a -= plus.at(i);
    }
    P = make_pair(plus.at(plus.size()-1),a);
    ans.push_back(P);
    num = plus.at(plus.size()-1)-a;
  }
  else if(minus.size() > 1){
    int64_t a = minus.at(minus.size()-1);
    for(int i=minus.size()-2; i>=0; i--){
      P = make_pair(a,minus.at(i));
      ans.push_back(P);
      a -= minus.at(i);
    }
    num = a;
  }
  else if(plus.size() == 1){
    num = plus.at(0);
  }
  else if(minus.size() == 1){
    num = minus.at(0);
  }

  
  cout << num << endl;
  for(int i=0; i<ans.size(); i++){
    P = ans.at(i);
    int64_t p = P.first;
    int64_t q = P.second;
    cout << p << " " << q << endl;
  }
    
}   

Measured memory_bytes: 5104
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
using ll=long long;
#define int ll
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define SZ(x) ((int)x.size())
#define fi first
#define se second
const int INF = 1e15;
using namespace std;

template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;

using pi=pair<int,int>;
using vi=vc<int>;

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);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(20);

    string S,T; cin >> S >> T;
    per(i,SZ(S)-SZ(T)+1){
        bool can=true;
        rep(j,SZ(T)){
            if(S[i+j]=='?') continue;
            if(S[i+j]!=T[j]) can=false;
        }
        if(can){
            rep(j,SZ(T)){
                S[i+j]=T[j];
            }
            rep(j,SZ(S)){
                if(S[j]=='?') S[j]='a';
            }
            cout << S << endl;
            return 0;
        }
    }
    cout << "UNRESTORABLE" << endl;
}

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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
const int NIL = -1;
const ld PI = acosl(-1);

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) n.begin(),n.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; }

int main()
{
	ios::sync_with_stdio(false); cin.tie(nullptr);
	//cout << fixed << setprecision(6);
	int n, d, x;
	cin >> n >> d >> x;
	vi a(n);
	rep(i, n) cin >> a[i];

	int ans = x;
	rep(i, n)
	{
		int cnt = (d - 1) / a[i] + 1;
		ans += cnt;
	}

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

Measured memory_bytes: 256
n=int(input())
ans=1
if(n==1 or n==2 or n==3):
    ans=1
else:
    for i in range(n):
        i=n-i
        for j in range(3):
            j+=int(i**0.5)-1
            if(i//j==j and i%j==0):
                ans=i
                break
        if(ans!=1):
            break
        
print(ans)


Measured memory_bytes: 3060
package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)
	ans, cnt := 0, 0
	for i := 0; i < len(s); i++ {
		if s[i] == 'B' {
			cnt++
		}
		if s[i] == 'W' {
			ans += cnt
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1920
import math
n, m, d = map(int, input().split())
num = 0

if d > n - 1:
    num = 0
elif d == 0:
    num = (n - d)
else:
    num = (n - d) * 2


ans = num*  (m-1)/(n*n)
print(ans)


# elif d == n - 1:
#     num = m - 1
# elif 2 * d > n - 1:
#     num = (n - d) * (m - 1)


# n, m, s, t = map(int, input().split())
# u = []
# v = []
# a = []
# b = []
#
# for i in range(m):
#     in1, in2, in3, in4 = map(int, input().split())
#
#     u.append(in1)
#     v.append(in2)
#     a.append(in3)
#     b.append(in4)
#
# print(u,v,a,b)




Measured memory_bytes: 3060
#include<stdio.h>
int main()
{
	int k,a,b;
	int i;
	int sum=0;
	scanf("%d%d%d",&k,&a,&b);
	for(i=0;i<1000;i++)
	{
		sum+=k;
		//printf("sum=%d\n",sum);
		if(sum>=a&&sum<=b)
		{
			printf("OK\n");
			break;
		}
		if(sum>b)
		{
			printf("NG\n");
			break;
		}
	}
	
	
	return 0;
}

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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define LB(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define UB(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef unsigned long long ull;
typedef long double ld; 

ll mod = 1e9 + 7;

#define each(a,x) for( auto &a:(x))
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rep2(i, l, r) for (ll i = (l); i < (r); i++)
#define rep2r(i, l, r) for (ll i = (r) - 1; i >= (l); i--)
#define range(a) a.begin(), a.end()

int main()
{
	fastio();
	ll n;
	cin>>n;
	if(n > 2000)
		cout<<1<<endl;
	else 
	{
		ll k = n / 100;
		if(k * 5 >= n%100)
			cout<<1<<endl;
		else
			cout<<0<<endl;
	}
}

Measured memory_bytes: 256
H, W = map(int, input().split())
N = int(input())
*a, = map(int, input().split())
m = [[-1]*(W+2) for _ in range(H+2)]

for i in range(1, H+1):
    for j in range(1, W+1):
        m[i][j] = 0

d = [0, 1]
c = [1, 0]
for i in range(N):
    for j in range(a[i]):
        if m[c[0]+d[0]][c[1]+d[1]] != 0:
            if d == [0, 1]:
                d = [1, 0]
            elif d == [1, 0]:
                d = [0, -1]
            elif d == [0, -1]:
                d = [-1, 0]
            else:
                d = [0, 1]
        c = [c[0]+d[0], c[1]+d[1]]
        m[c[0]][c[1]] = i+1

for i in range(H):
    print(*m[i+1][1:W+1])


Measured memory_bytes: 42480
N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)]
Point = [K-Q] * N
for c in A:
    Point[c-1] += 1
for p in Point:
    if p > 0:
        print('Yes')
    else:
        print('No')
    #if A.count(i) > (Q-K):
    #    print('Yes')
    #else:
    #    print('No')


Measured memory_bytes: 10448
# 入力
N = int(input())
# 初期値(l_0, l_1)
L = [2, 1]
# 計算
if N == 1:
    print("1")
else:
    for i in range(N-1):
        L.append(L[i+1] + L[i])
    print(L[-1])


Measured memory_bytes: 2940
# import math
# import statistics
# import itertools
a=int(input())
# b=input()
# c=[]
# for i in a:
#     c.append(int(i))
# N,S,T= map(int,input().split())
f = list(map(int,input().split()))
# g = [int(input()) for _ in range(N)]
# h = []
# for i in range(a):
#     h.append(list(map(int,input().split())))
# a = [[0] for _ in range(H)]#nizigen
count=1
ans=0
for i in range(a-1):
    if f[i]==f[i+1]:
        count+=1
    elif f[i]!=f[i+1]:
        count=1
    if count==2 :
        ans+=1
        count=0

print(ans)


Measured memory_bytes: 9020
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define int long long
#define all(a) a.begin(), a.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

struct CumulativeSum{
    vector<int> data;
    CumulativeSum(int sz) : data(sz, 0) {};
    void add(int k, int x){
        data[k] += x;
    }
    void build(){
        for(int i = 1; i < data.size(); i++){
            data[i] += data[i - 1];
        }
    }
    //区間[0,k]の和
    int query(int k){
        if(k < 0) return 0;
        return (data[min(k, (int)data.size() - 1)]);
    }
    //区間[l.r)の和
    int query(int l, int r){
        return query(r - 1) - query(l - 1);
    }
};

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, q;
    string s;
    cin >> n >> s >> q;
    CumulativeSum cs1(n), cs2(n);
    rep(i, 0, n){
        if(s[i] == 'D') cs1.add(i, 1);
        if(s[i] == 'C') cs2.add(i, 1);
    }
    cs1.build(); cs2.build();
    rep(it, 0, q){
        int k, ans = 0;
        cin >> k;
        vector<int> a(n);
        rep(i, 0, n){
            a[i] += (i == 0 ? 0 : a[i - 1]);
            if(s[i] == 'D'){
                int tmp = cs2.query(i, min(i + k, n));
                a[i] += tmp;
            }else if(s[i] == 'M'){
                ans += a[i];
            }else if(s[i] == 'C'){
                int tmp = cs1.query(max(0LL, i - k + 1), i);
                a[i] -= tmp;
            }
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 24860
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e18;
const ll MOD = 1e9 + 7;


int main(){
    int n;
    cin >> n;
    vector<int> v(n);
    rep(i, n) cin >> v[i];

    vector<ll> sum(n);
    sum[0] = v[0];
    for(int i=1; i<n; i++) sum[i] = sum[i-1] + v[i];

    ll ans = INF;
    for(int m=1; m<=n-2; m++){
        ll l = sum[m];
        auto iter = lower_bound(all(sum), (double)l / 2.0);
        int pos = distance(sum.begin(), iter);
        ll P = sum[pos];
        ll Q = l - P;
        if(abs(P-Q) > abs((P - v[pos]) - (Q + v[pos]))){
            P -= v[pos];
            Q += v[pos];
        }

        ll r = sum[n-1] - sum[m];
        iter = lower_bound(all(sum), l + (double)r / 2.0);
        pos = distance(sum.begin(), iter);
        ll R = sum[pos] - l;
        ll S = r - R;
        if(abs(R-S) > abs((R-v[pos]) - (S+v[pos]))){
            R -= v[pos];
            S += v[pos];
        }

        chmin(ans, max({P, Q, R, S}) - min({P, Q, R, S}));
    }

    cout << ans << endl;
}

Measured memory_bytes: 2560
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using ull=unsigned long long int;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
int n,m,c;
cin>>n>>m>>c;
string s;
cin>>s;
V<int> l(n,0),r(n,0);
int now=1;
for(int i=0;i<n;i++){
  if(s[i]=='o'){
    l[i]=now++;
    if(now==m+1)break;
    i+=c;
  }
}
now=m;
for(int i=n-1;i>=0;i--){
  if(s[i]=='o'){
    r[i]=now--;
    if(now==0)break;
    i-=c;
  }
}
ll ans=0;
for(int i=0;i<n;i++){
  if(s[i]=='o'){
  if(l[i]==r[i]&&l[i]!=0)cout<<i+1<<"\n";
  }
}
}

Measured memory_bytes: 3348
#include <iostream>
#include <queue>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <math.h>
#include <stdlib.h>
#include <numeric>


int main(){
	int n, input, sum[100]={};
	std::cin >> n;
	for(int i = 0; i < n; i++){
		std::cin >> input;
		if(i != 0){
			sum[i] = sum[i - 1] + input;
		}else{
			sum[i] = input;
		}
	}
	for(int i = 0; i < n; i++){
		sum[i] = std::abs(sum[n - 1] - sum[i] * 2);
	}
	int min = sum[0];
	for(int i = 0; i < n; i++){
		min = std::min(min, sum[i]);
	}
	std::cout << min << std::endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
ll dp[2010][2010] = {};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,M;
    cin >> N >> M;
    ll S[2010], T[2010];
    rep(i,0,N) cin >> S[i];
    rep(i,0,M) cin >> T[i];
    rep(i,0,N+1){
        dp[i][0] = 1;
    }
    rep(i,0,M+1){
        dp[0][i] = 1;
    }
    rep(i,0,N){
        rep(j,0,M){
            if(S[i] == T[j]){
                dp[i+1][j+1] = (dp[i+1][j] + dp[i][j+1]) % MOD;
            }else{
                dp[i+1][j+1] = (dp[i+1][j] + dp[i][j+1] - dp[i][j] + MOD) % MOD;
            }
        }
    }
    print(dp[N][M]);


    
    

}

Measured memory_bytes: 31744