akhauriyash/Code-Regression huggingface dataset:
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

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

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#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 EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define loop(n) FOR(i,0,n)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

const int maxN = 100010;
bool primes[maxN];

void hurui() {

	for (int i = 0; i < maxN; i++) {
		primes[i] = true;
	}

	primes[0] = false;
	primes[1] = false;

	for (int i = 2; i < maxN; i++) {

		if (primes[i] == false)continue;

		for (int j =2 ; i*j < maxN; j++) {
			primes[i*j] = false;
		}
	}

}


int range[maxN];

int main() {

	hurui();

	for (int i = 3; i < 101010; i += 2) {
		if (primes[i] && primes[(i + 2) / 2]) {
			range[i]++;
		}
	}

	//0～iまでの2017likenumの数を記録しておいて、
	//区間クエリに対しては0～r から0～l-1を引いて求める。
	for (int i = 3; i < 101010; i++) {
		range[i] += range[i - 1];
	}

	int q; cin >> q;
	
	//0------- l-1 l ----r
	//************ l ----r

	for (int i = 0; i < q; i++) {
		int l, r; cin >> l >> r;

		cout << range[r] - range[l - 1] << endl;
	}

	return 0;
}

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

X -= 1
Y -= 1
distances = [0]*N
for i in range(N):
    for j in range(i+1,N):
        # d = min(abs(j-i), abs(X-i)+1+abs(j-Y), abs(Y-i)+1+abs(j-X))
        d = min(abs(j-i), abs(X-i)+1+abs(j-Y))
        distances[d] += 1

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

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

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

class Data{
public:
	int C,S,F;
};

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int N=in();
	vector<Data> D(N-1);
	REP(i,N-1){
		D[i].C=in();
		D[i].S=in();
		D[i].F=in();
	}
	
	REP(i,N-1){
		int S=D[i].S;
		for(int j=i;j<N-1;j++){
			int M = (D[j].F-(S%D[j].F))%D[j].F;
			S = max(S+M,D[j].S);
			S += D[j].C;
		}
		out(S);
	}
	
	out(0);
	return 0;
}


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

const int MAX_N=100;
int n,p[MAX_N]={},ma=0,c=0;

int main(){
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> p[i];
	}
	
	for(int i=0;i<101;i++){
		c=0;
		for(int j=0;j<n;j++){
			 if(i<=p[j]) c++;
			 if(c==i) ma=c;
		 }
	 }
	 
	 cout << ma << endl;
	return 0;
}

Measured memory_bytes: 3080
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//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; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
*/

int c[550][550], x[550][550];


int main(){
    int N, M, Q; cin >> N >> M >> Q;
    int p, q;
    for(int i=0; i<M; i++){
        int l, r; cin >> l >> r;
        x[l][r]++;
    }

    for(int i=1; i<=N; i++){
        for(int j=1; j<=N; j++){
            c[i][j] = c[i][j-1] + x[i][j];
        }
    }

    vector<int> ans(Q);
    for(int i=0; i<Q; i++){
        cin >> p >> q;
        int res = 0;
        for(int j=p; j<=q; j++) res += c[j][q];
        ans[i] = res;
    }

    for(int i=0; i<Q; i++) cout << ans[i] << endl;

}

Measured memory_bytes: 3456
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional> // for less 
#define MAX 5002
#define pb push_back
#define For(i,s,e) for (ll i=(s); i<(e); i++)
#define Debug_array(a,n) for (ll i=(0); i<(n); i++) cout<<a[i]<<" "
#define Foe(i,s,e) for (ll i=(s); i<=(e); i++)
#define Fod(i,s,e) for (ll i=(s)-1; i>=(e); i--)
#define Mod 1000000007
#define pii pair<ll,ll>
#define fi first
#define se second
#define endl "\n"
#define mp make_pair
#define big_prime 15486277
#define bigger_prime 179424697
#define biggest_prime 32416188691
//#define random_shuffle(indices.begin(), indices.end());
//std::random_device rd;
//std::mt19937 g(rd());
//std::shuffle(v.begin(), v.end(), g);
using namespace __gnu_pbds; 
using namespace std;

typedef long long ll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,tree_order_statistics_node_update> new_data_set; 

int main(){
	ll a[4]={0};
	For(i,0,3){
		ll x,y;cin>>x>>y;x--;y--;
		a[x]++;
		a[y]++;
	}
	ll even=0;
	For(i,0,3) if(a[i]%2==0) even++;
	if(4-even==2){
		cout<<"YES"<<endl;
	}else {
		cout<<"NO"<<endl;
	}
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        
        String symbol = "#";
        String dot = ".";
        
        while (true) {
            String[] ary = br.readLine().split(" ");
            int numH = Integer.parseInt(ary[0]);
            int numW = Integer.parseInt(ary[1]);
            
            if(numH == 0 && numW == 0){
                break;
            }
            
            for (int i = 0; i < numH; i++) {
                for (int j = 0; j < numW; j++) {
                    if (i == 0 || i == (numH - 1)) {
                        sb.append(symbol);
                    } else if (j == 0 || j == (numW - 1)) {
                        sb.append(symbol);
                    } else if (numW > 2 && numH > 2){
                        sb.append(dot);
                    } else {
                        sb.append(symbol);
                    }
                }
                sb.append("\n");
            }
            sb.append("\n");
        }
        
        System.out.print(sb);
    }
}

Measured memory_bytes: 25380
S = input()
K = int(input())
if S[0] != "1":
    print(S[0])
else:
    ind = 0
    while S[ind] == "1" and ind < len(S) - 1:
        ind += 1
    if ind < K:
        print(S[ind])
    else:
        print("1")


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

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Solver2 {
 public:
  LL n, a, b;
  Solver2(LL n, LL a, LL b) : n(n), a(a), b(b){};

  void solve() {
    if (a % 2 == b % 2) {
      cout << (b - a) / 2 << endl;
    } else {
      LL ans = LINF;
      //a
      //1 , b-a
      ans = min(ans, a + (b - a - 1) / 2);

      //n-b+1
      //a+n-b+1, n
      ans = min(ans, n - b + 1 + (b - a - 1) / 2);
      cout << ans << endl;
    }
  }
};
}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(12);
  long long n = 0, a, b;
  std::cin >> n >> a >> b;

  Problem::Solver2 sol(n, a, b);
  sol.solve();
  return 0;
}


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

using namespace std;

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

	int mx = a[0] + k - a[n - 1];
	for (int i = 0; i < n - 1; i++) {
		mx = max(mx, a[i + 1] - a[i]);
	}
	cout << k - mx << endl;

	return 0;
}

Measured memory_bytes: 1024
#pragma GCC optimze("Ofast")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 1000000007
#define md 998244353
#define trace(...)
#define ll long long int
#define ld long double
#define fi first
#define se second
#define fr(i,a,b) for(ll i=a;i<=b;i++)
#define frr(i,b,a) for(ll i=b;i>=a;i--)
#define mem(a) memset(a, 0, sizeof(a))
#define vpi std::vector<pair<int,int>>
#define pii pair<int,int>
#define pb push_back
#define sall(v) sort(v.begin(),v.end())
#define all(v) (v.begin(),v.end())
#define minf -10000000
#define vi vector<int>
const ll infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
auto clk=clock();
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
    uniform_int_distribution<int> uid(0,lim-1);
    return uid(rang);
}
ll power(ll x, ll y,ll p) { 
    ll res = 1;      
    x = x % p;  
    while (y > 0) {  
        if (y & 1){  
            res = (res*x) % p;  
        }
        y = y>>1;
        x = (x*x) % p;   
    } 
    return res; 
}
ll power(ll x, ll y) { 
    ll res = 1;       
    while (y > 0) {    
        if (y & 1) 
            res = (res*x) ;  
        y = y>>1; 
        x = (x*x);   
    } 
    return res; 
}
 
ll max3(ll a,ll b,ll c){
    return max(a,max(b,c));
}
ll min3(ll a,ll b,ll c){
    return min(a,min(b,c));
}
bool isPrime(ll n) { // Corner cases 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
    for (ll i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
    return true; 
}
const int nax=2e5+5;

void solve(){
    ll n,d;cin>>n>>d;
    ll a,b;
    ll cnt=0;
    fr(i,1,n){
        cin>>a>>b;
        if((a*a+b*b)<=d*d)cnt++;
    }
    cout<<cnt<<endl;
    return;
}

int main(){
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout<<fixed<<setprecision(8);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    #endif
    int t;
    // cin>>t;
    t=1;
    while(t--){
        solve();
    }
    #ifndef ONLINE_JUDGE
    cout<<endl<<endl<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
    #endif
    return 0;
}

Measured memory_bytes: 3544
#include <bits/stdc++.h>
 
using namespace std;
 
#define repr(i,a,b) for (int i=a; i<b; i++)
#define rep(i,n) for (int i=0; i<  n; i++)
 
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
 
const long long INF = 1LL << 60;
#define PI 3.14159265359 
 
template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}
 
int gcd(int a, int b){
    if(b == 0) return a;
    else return gcd(b, a%b);
}
 
long long lcm (int a, int b){
    return  (long long) a*b /gcd(a,b);
}


int main(){
int y, m, d;
char c1, c2;
cin >> y >> c1 >> m >> c2 >> d;
cout << (m <= 4 ? "Heisei" : "TBD") << endl;

}



Measured memory_bytes: 3556
#include"bits/stdc++.h"
using namespace std;

//define
#define ALL(a) a.begin(),a.end()
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define debug(x) if(1)cout<<#x<<":"<<x<<endl;
#define DEBUG(x) if(1)cout<<#x<<":"<<x<<endl;
#define ll long long

//constant
const int MOD = 1000000007;

//typedef
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

int main() 
{
	int h, w;
	cin >> h >> w;
	vector<string> a(h);
	REP(i, h)
		cin >> a[i];
	int cnt = 0;
	for(int i=0;i<h;i++)
		for (int j = 0; j < w; j++) {
			if (a[i][j] == '#')
				cnt++;
		}
	if (cnt == w + h - 1)
		cout << "Possible" << endl;
	else
		cout << "Impossible" << endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i ,n) for(int i = 0 ; i < (n) ; i ++ )
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using vll=vector<ll>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

int main() {
  int a,b;
  cin>>a>>b;
  if(a>9||b>9) cout<<-1<<endl;
  else cout<<a*b<<endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define lson root<<1
#define rson root<<1|1
using namespace std;

int a[100010],n,cnt=1;

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	sort(a+1,a+n+1);
	for(int i=1;i<n;i++)
	{
		if(a[i]!=a[i+1])
		{
			cnt++;
		}
	}
	if(cnt&1)
	{
		printf("%d\n",cnt);
	}
	else
	{
		printf("%d\n",cnt-1);
	}
}

Measured memory_bytes: 640
open Printf
open Scanf

let () =
	let a, b = scanf "%d %d" (fun a b -> (a, b)) in
	(if (a mod 3 = 0 || b mod 3 = 0 || (a + b) mod 3 = 0) then
	 "Possible" else "Impossible") |> printf "%s\n"


Measured memory_bytes: 384
#include <bits/stdc++.h> 
using namespace std; 
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
const long long int m=pow(10,9)+7;

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    vector<ll>a;
    for(ll i=0;i<n;i++)
    {
        ll x;
        cin>>x;
        a.push_back(x);
    }
    ll res=0;
    for(ll i=0;i<n;i++)
    {
        while(i+1<n&&a[i+1]==a[i])
            i++;
        if(a[i+1]>a[i])
        {
            while(i+1<n&&a[i+1]>=a[i])
                i++;
        }
        else
        {
            while(i+1<n&&a[i+1]<=a[i])
                i++;
        }
        res++;
    }
    cout<<res<<endl;
    return 0;
}


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

#define ll             long long
#define LL             long long
#define pii            pair<int, int>
#define pll            pair<ll, ll>
#define pil            pair<int, ll>
#define pli            pair<ll, int>
#define vi             vector<int>
#define vl             vector<ll>
#define vii            vector<pii>
#define vll            vector<pll>
#define vil            vector<pil>
#define vli            vector<pli>
#define pb             push_back
#define ppb            pop_back
#define mp             make_pair
#define ff             first
#define ss             second
#define sz(x)          (int)x.size()
#define TN             typename
#define all(v)         v.begin(), v.end()
#define fill(a, b)     memset(a, b, sizeof(a))
#define endl           '\n'

template <TN T> T gcd(T a, T b) {return !b ? a : gcd(b, a % b);}
template <TN T> T lcm(T a, T b) {return a * (b / gcd(a, b));}
template <TN T> T sqr(T a) {return a * a;}
template <TN T> T cube(T a) {return a * a * a;}
template <TN T> inline void smin(T &a, T b) {a = a < b ? a : b;}
template <TN T> inline void smax(T &a, T b) {a = a > b ? a : b;}

template <TN T> inline void Int(T &n) {
	n = 0; int f = 1; register int ch = getchar();
	for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
	for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
	n = n * f;
}

#define error(args...) {vector <string> _v = split(#args, ','); err(_v.begin(), args); cout << endl;}
vector <string> split(const string &s, char c) {
	vector <string> v;
	stringstream ss(s); string x;
	while (getline(ss, x, c)) v.emplace_back(x);
	return move(v);
}
void err(vector <string> :: iterator it) {}
template <typename T, typename... Args>
void err(vector <string> :: iterator it, T a, Args... args) {
	cout << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << ", ";
	err(++it, args...);
}

inline int in() {int n; scanf("%d", &n); return n;}
inline ll Lin() {ll n; scanf("%lld", &n); return n;}
inline double Din() {double n; scanf("%lf", &n); return n;}

inline int add(int a, int b, int mod) {a += b; return a >= mod ? a - mod : a;}
inline int sub(int a, int b, int mod) {a -= b; return a < 0 ? a + mod : a;}
inline int mul(int a, int b, int mod) {return (ll)a * b % mod;}

const int N          = 2e5 + 5;
const ll  Mod        = (ll)1e9 + 7;
const int inf        = (int)2e9;
const ll  Inf        = (ll)1e18;
const int mod        = (int)1e9 + 7;


int solve() {
	int n = in(), w = in();
	vl dp(w + 1, 0);
	for (int item = 1; item <= n; item++) {
		int weight = in(), value = in();
		for (int i = w - weight; i >= 0; i--) {
			smax(dp[i + weight], dp[i] + value);
		}
	}
	ll ans = 0;
	for (int i = 0; i <= w; i++) {
		smax(ans, dp[i]);
	}
	printf("%lld\n", ans);
	return 0;
}

int main() {
	int test = 1, tc = 0;
	//scanf("%d", &test);
	while (test--) {
		//printf("Case %d: ", ++tc);
		solve();
	}
	return 0;
}





Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

int N, K;
int S;
int ans[MAX_N];

void solve() {
	cin >> N >> K >> S;
	rep(i, 0, N) {
		if(i < K) ans[i] = S;
		else {
			if(S == 1000000000) ans[i] = 1;
			else ans[i] = S + 1;
		}
	}
	rep(i, 0, N) {
		cout << ans[i] << " ";
	}
	cout << "\n";
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



Measured memory_bytes: 1792
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
#define INF 114514
using namespace std;




int main(){
	int m;
	m = 39;
	int candy;
	while (cin >> candy) {
		if(candy%m>=10)cout <<"3C"<< candy%m << endl;
		else if (candy%m == 0) cout << "3C39" << endl;
		else cout << "3C0" << candy%m << endl;
	}
	return 0;
}

Measured memory_bytes: 3008
# あなたは、電車とバスを乗り継いで旅行をする計画を立てました。
# 電車は旅程に沿って通常のきっぷを買うと A 円かかり、乗り放題きっぷを買うと B 円かかります。
# バスは旅程に沿って通常のきっぷを買うと C 円かかり、乗り放題きっぷを買うと D 円かかります。 
# 電車およびバスについて通常の切符を買うか乗り放題きっぷを買うかをうまく選んだときの、運賃の合計の最小値を求めてください。

A = int(input())
B = int(input())
C = int(input())
D = int(input())

x = min(A, B)
y = min(C, D)

print(x + y)

Measured memory_bytes: 9112
n = list(map(int,input()))
su = n[0]
for i in range(2):
    if i == 0:
        suu = n[0]+n[1]
        a = '+'
    else:
        suu = n[0]-n[1]
        a = '-'
    for j in range(2):
        if j == 0:
            suuu = suu + n[2]
            aa = '+'
        else:
            suuu = suu - n[2]
            aa = '-'
        for k in range(2):
            if k == 0:
                suuuu = suuu + n[3]
                aaa = '+'
            else:
                suuuu = suuu - n[3]
                aaa = '-'
            if suuuu == 7:
                break
        if suuuu == 7:
            break
    if suuuu == 7:
        break
print(str(n[0])+a+str(n[1])+aa+str(n[2])+aaa+str(n[3])+"=7")

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
template<class T,class U> inline bool chmin(T&x,U y){T Y=static_cast<T>(y);if(x>Y){x=Y;return true;}return false;}
template<class T,class U> inline bool chmax(T&x,U y){T Y=static_cast<T>(y);if(x<Y){x=Y;return true;}return false;}
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int LCS(string s,string t){
    int n=s.length(),m=t.length();
    vector<vector<int>> dp(n+1,vector<int>(m+1));
    fr(i,n) fr(j,m){
        if(s[i]==t[j]) dp[i+1][j+1]=dp[i][j]+1;
        else dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j]);
    }
    return dp[n][m];
}

unsigned char dp[301][301][301]={};
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    int k;
    cin>>s>>k;
    int n=s.length(),ans{1};
    Fr(i,n) Fr(j,n-i) fr(l,k+1){
        if(s[i-1]==s[n-j]) chmax(dp[i][j][l],dp[i-1][j-1][l]+1);
        else{
            chmax(dp[i][j][l],max(dp[i-1][j][l],dp[i][j-1][l]));
            if(l) chmax(dp[i][j][l],dp[i-1][j-1][l-1]+1);
        }
        if(i+j<n) chmax(ans,dp[i][j][l]*2+1);
        else chmax(ans,dp[i][j][l]*2);
    }
    cout<<ans<<endl;
}

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

using namespace std;

int gcd(int a, int b) {
    return b == 0 ? a : gcd(b, a % b);
}

const int N = (int) 1e6 + 7;

int devisors_cnt[N];

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    int g = 0;
    for (int i = 0; i < n; ++i) {
        g = gcd(g, a[i]);
    }
    if (g != 1) {
        cout << "not coprime" << endl;
        return 0;
    }
    for (int i = 0; i < n; ++i) {
        devisors_cnt[a[i]]++;
        if (devisors_cnt[a[i]] > 1 && a[i] != 1) {
            cout << "setwise coprime" << endl;
            return 0;
        }
        for (int j = 2; j * j <= a[i]; ++j) {
            if (a[i] % j == 0) {
                devisors_cnt[j]++;
                if (devisors_cnt[j] > 1) {
                    cout << "setwise coprime" << endl;
                    return 0;
                }
                if (j * j != a[i]) {
                    devisors_cnt[a[i] / j]++;
                    if (devisors_cnt[a[i] / j] > 1) {
                        cout << "setwise coprime" << endl;
                        return 0;
                    }
                }
            }
        }
    }
    cout << "pairwise coprime" << endl;
    return 0;
}


Measured memory_bytes: 7536
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <decimal/decimal>
using namespace std;
using namespace __gnu_pbds;

#define rep(i, s, t) for (int i = s; i < int(t); ++i)

#define sc	scanf
#define pr	printf
#define ff	first
#define ss	second
#define mp	make_pair
#define pb	push_back
#define eb	emplace_back
#define range(c)	c.begin(), c.end()
#define lowbit(x)	((x) & -(x))
#define pop_count	__builtin_popcount
#define pop_count_64	__builtin_popcountll
#define tail_count	__builtin_ctz
#define tail_count_64	__builtin_ctzll
#define lead_count	__builtin_clz
#define lead_count_64	__builtin_clzll

#define TEMP template<typename
#define CONST(type) constexpr type const

TEMP... Ts> struct is_con { static CONST(bool) value = false; };
TEMP... Ts> struct is_con<vector<Ts...>> { static CONST(bool) value = true; };
TEMP... Ts> struct is_con<list<Ts...>> { static CONST(bool) value = true; };
TEMP... Ts> struct is_con<deque<Ts...>> { static CONST(bool) value = true; };
TEMP... Ts> struct is_con<set<Ts...>> { static CONST(bool) value = true; };
TEMP... Ts> struct is_con<unordered_set<Ts...>> { static CONST(bool) value = true; };
TEMP... Ts> struct is_con<map<Ts...>> { static CONST(bool) value = true; };
TEMP... Ts> struct is_con<unordered_map<Ts...>> { static CONST(bool) value = true; };

TEMP T1, typename T2> ostream& operator<<(ostream& os, pair<T1, T2> const& p) { return os << "<" << p.ff << "," << p.ss << ">"; }
TEMP T> typename enable_if<is_con<T>::value, ostream>::type& operator<<(ostream& os, T const& c) {
	os << "{";
	bool first = true;
	for (auto const& x : c) {
		if (first) first = false;
		else os << ",";
		os << " " << x;
	}
	return os << " }";
}

TEMP T, typename... Ts> void dbg(T h, Ts... t) { cerr << " " << h; dbg<Ts...>(t...); }
template<> void dbg<int>(int x) { cerr << endl; }

#ifdef LOCAL
#define debug(...) cerr << "[ "#__VA_ARGS__" ] :", dbg(__VA_ARGS__, 0)
#else
#define debug(...) 0
#endif

TEMP T, typename U> using ordered_map = tree<T, U, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
TEMP T> using ordered_set = ordered_map<T, null_type>;

typedef long long i64;
typedef decimal::decimal128 i99;
typedef unsigned int u32;
typedef unsigned long long u64;
typedef float f32;
typedef double f64;
typedef long double f80;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<i64> vl;

TEMP T> T& minn(T& lhs, T const& rhs) { return lhs = min(lhs, rhs); }
TEMP T> T& maxx(T& lhs, T const& rhs) { return lhs = max(lhs, rhs); }

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n;
	cin >> n;
	i64 ans = 1LL * n * (n + 1) * (n + 2) / 6;
	rep(i, 1, n) {
		int u, v;
		cin >> u >> v;
		if (u < v) {
			swap(u, v);
		}
		ans -= 1LL * (n - u + 1) * v;
	}
	cout << ans << endl;
}


Measured memory_bytes: 3632
//#include <bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>


#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979
#define MAXI 7500000

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


int main(void) {
	
	while (1) {
		int n, m;
		int h, w;
		int count = 0;
		vector<int> dph(1550000, 0), dpw(1550000, 0);
		vector<int> hi(1501, 0), we(1501, 0);

		cin >> n >> m;
		if (n == 0) {
			break;
		}
		FOR(i, 1, n) {
			cin >> h;
			hi[i] = hi[i - 1] + h;
		}
		FOR(i, 1, m) {
			cin >> w;
			we[i] = we[i - 1] + w;
		}
		FOR(i, 1, n) {
			FOR(j, 0, i - 1) {
				dph[hi[i] - hi[j]]++;
			}
		}
		FOR(i, 1, m) {
			FOR(j, 0, i - 1) {
				dpw[we[i] - we[j]]++;
			}
		}
		
		/*FOR(i, 1, 50) {
			cout << i << " " << dph[i] << " " << dpw[i] << endl;
		}*/

		FOR(i, 1, 1540000) {
			count += dph[i] * dpw[i];
		}
		cout << count << endl;
	}

	return 0;
}


Measured memory_bytes: 14972
import java.util.*;
import java.lang.*;
import java.math.*;

public class Main {
	Scanner sc = new Scanner(System.in);

	void run() {
		for (;;) {
			if (!sc.hasNext())
				break;
			String str = sc.nextLine();
			String str2 = "";
			for (;;) {
				str2 = "";
				for (char c : str.toCharArray()) {

					if (c >= 'a' && c < 'z') {
						c++;
					} else if (c == 'z') {
						c = 'a';
					}
					str2 += c;
				}
				str = new String(str2);
				if (str.contains("this") || str.contains("the")
						|| str.contains("that")) {
					break;
				}
			}
			System.out.println(str);
		}
	}

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

Measured memory_bytes: 12000
n = int(input())
s = list(input())
ans = s.count('R') * s.count('G') * s.count('B')

for i in range(n - 1):
    for j in range(i+1, n):
        if 0 <= (2 * j - i) < n:
            if s[i] != s[j] and s[i] != s[2 * j - i] and s[2 * j - i] != s[j]:
                ans -= 1

print(ans)


Measured memory_bytes: 68400
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
 
int main() {
  string s;
  cin >> s;
  if(s == "SUN") cout << 7 << endl;
  if(s == "MON") cout << 6 << endl;
  if(s == "TUE") cout << 5 << endl;
  if(s == "WED") cout << 4 << endl;
  if(s == "THU") cout << 3 << endl;
  if(s == "FRI") cout << 2 << endl;
  if(s == "SAT") cout << 1 << endl;
}

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

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep2(i,s,n) for(int i = (s); i < (n); ++i)
#define ll long long
#define ld long double
#define P pair<ll,ll>
#define all(v) v.begin(),v.end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1.0);

ll f(ll n)
{
    ll r=n%4;
    if(n<0) return 0;
    if(r==0) return n;
    else if(r==1) return 1;
    else if(r==2) return n+1;
    return 0;
}

int main(void)
{
    
    ll n; cin>>n;
    vector<double> x(n),y(n);
    rep(i,n) cin>>x[i];
    rep(i,n) cin>>y[i];
    double p1=0,p2=0,p3=0,m=0;
    rep(i,n){
        p1+=abs(x[i]-y[i]);
        p2+=(x[i]-y[i])*(x[i]-y[i]);
        p3+=abs(x[i]-y[i])*abs(x[i]-y[i])*abs(x[i]-y[i]);
        m=max(m,abs(x[i]-y[i]));
    }
    p2=sqrt(p2);
    p3=pow(p3,1/3.0);
    printf("%lf\n",p1);
    printf("%lf\n",p2);
    printf("%lf\n",p3);
    printf("%lf\n",m);
    return 0;
}


Measured memory_bytes: 3412
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] v = new int[N];
            for (int i = 0; i < N; i++) {
                v[i] = in.nextInt();
            }
            Arrays.sort(v);
            double ret = v[0];
            for (int i = 1; i < N; i++) {
                ret = (ret + v[i]) / 2.0;
            }
            out.println(ret);
        }

    }
}



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

signed main() {
	ios_base::sync_with_stdio(0); cin.tie(0);

	int n; cin >> n;
	if (n % 2) {
		cout << n/2;
	} else {
		cout << n/2 - 1;
	}

	return 0;
}


Measured memory_bytes: 256
aN = int(input())
A = list(map(int, input().split()))
mN = int(input())
M = list(map(int, input().split()))

def memorize(f) :
    cache = {}
    def helper(*args) :
        if args not in cache :
            cache[args] = f(*args)
        return cache[args]
    return helper

@memorize
def solve(i, m):
    if m == 0:
        return True
    if i >= aN:
        return False
    
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res

for m in M:
    print("yes" if solve(0, m) else "no")


Measured memory_bytes: 9580
//NAME-ADITYYA OJHA
                                               /*
                                                      GURU(MENTOR)-AARADHYA
                                               */
/*
 *     Heart beats fast
 *         Colors and promises
 *             How to be brave
 *                 How can I love when I am afraid to fall...
                                             (courtesy-amnesiac_dusk)
 */

#include <bits/stdc++.h>
#define ll long long int
#define forin for(int i=0;i<n;i++)
#define pb push_back
#define vx vector<ll> x
#define vy  vector<ll> y
#define fast  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define  f   first
#define  s   second
#define mod 1000000007
using namespace std;

/*
check for corner cases(for n==1)
 check for int overflow
 run on some sample cases before submitting
*/

/*FERMAT THEOREM

       pow(x,m-1)%m=1 (x and m are co-prime)
*/
/*MODULAR INVERSE

        pow(x,-1)=pow(x,m-2) (x and m are co-prime)
*/

/*
ll  mode(ll x,ll n,ll mod)
{
    if(n==0)return 1%mod;

    ll u=mode(x,n/2,mod);
    u=(u*u)%mod;
    if(n & 1)u=(u*x)%mod;
}
*/


int main()
{


   string s,t;
   cin>>s>>t;
   ll cnt=0;
   for(int i=0;i<int(s.size());i++)
   {
       if(s[i]!=t[i])cnt++;
   }
cout<<cnt<<endl;











}


Measured memory_bytes: 3852
#include <iostream>
#include <vector>
#include <string>

using namespace std;
typedef long long ll;

int main() {
    int n;  cin >> n;   ll mod = 1e9+7;
    vector<string> s(2);
    cin >> s[0] >> s[1];
    ll ans = 1;
    int i = 0;
    if (s[0][0] == s[1][0]) {
        ans *= 3;
        i++;
    }
    else {
        ans *= 6;
        i += 2;
    }

    for (; i < n; ) {
        if (s[0][i] == s[1][i]) {
            if (s[0][i-1] == s[1][i-1])
                ans = ans * 2 % mod;
            i++;
        }
        else {
            if (s[0][i-1] == s[1][i-1])
                ans = ans * 2 % mod;
            else 
                ans = ans * 3 % mod;
            i += 2;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]
typedef complex<double> P;

typedef vector<P> G;

double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}

double area(const G &P) {
  double A = 0.0;
  for (int i = 0; i < P.size(); ++i)
    A += cross(curr(P, i), next(P, i));
  return A / 2.0;
}

int main() {
  int t = 1, N;
  while(cin >>N && N){
    G g(N);
    REP(i, N){
      double x, y; cin >>x >>y;
      g[i] = P(x, y);
    }
    printf("%d %.1lf\n", t++, fabs(area(g)));
  }
  return 0;
}

Measured memory_bytes: 1252
#define _CRT_SECURE_NO_WARNINGS


#include <stdio.h>
#include <cstdio>
#include <string>
#include <math.h>
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

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

std::vector<int> Data;




int main()
{

	int N, M;
	int ans;
	int buf;

	scanf("%d%d", &N, &M);

	ans = (N - M) * 100 + 1900 * M;

	for (int a = 0; a < M; ++a)
	{
		ans *= 2;
	}

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

	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using static MyIO;


public class B
{
	public static void Main()	
	{
		string w = GetString();
		int isEven = 0;
		for(int i = 0; i < w.Length; i++)
			isEven ^= (1 << (int)(w[i] - 'a'));
		Console.WriteLine((isEven == 0) ? "Yes" : "No");
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}


Measured memory_bytes: 13140
#include<iostream>
#include <algorithm>
#include<queue>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<map>
#include<set>
using LL = long long;
using namespace std;

const int M = 2e5 + 100;
const int mod = 1e9 + 7;

vector<int> e[M];
int n, sz[M], ans[M];
int fac[M], inv[M], inv2[M];

LL mul(LL a, LL b) {
	return a * b % mod;
}

void init() 
{
	fac[0] = 1;
	for (int i = 1; i <= n; i++) 
		fac[i] = mul(fac[i - 1], i);
	inv[1] = 1;
	for (int i = 2; i <= n; i++) 
		//常规公式为inv[i] = mul((- mod / i), inv[mod % i])，为使得逆元为整数，分子加上mod仍有i*inv[i] = 1(mod p)
		inv[i] = mul((mod - mod / i), inv[mod % i]);

}

void dfs(int u, int fa) 
{
	sz[u] = 1;
	for (int v : e[u]) 
	{
		if (v != fa) 
		{
			dfs(v, u);
			sz[u] += sz[v];
		}
	}
}

void reroot(int u, int fa) 
{
	ans[u] = mul(mul(ans[fa], sz[u]), inv[n - sz[u]]);
	for (int v : e[u]) 
	{
		if (v != fa) 
		{
			reroot(v, u);
		}
	}
}

int main() {
	cin >> n;
 	init();
	for (int i = 0; i < n - 1; i++) 
	{
		int u, v; 
		cin >> u >> v;
		e[u].push_back(v);
		e[v].push_back(u);
	}
	dfs(1, 0);
	ans[1] = fac[n];
	for (int i = 1; i <= n; i++) 
		ans[1] = mul(ans[1], inv[sz[i]]);
	for (int v : e[1]) 
		reroot(v, 1);
	for (int i = 1; i <= n; i++) 
		cout << ans[i] << "\n";
}

Measured memory_bytes: 17012
#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
#define fil(x) memset(x, 0, sizeof(x))
#define fillb(x) memset(x,false,sizeof(x))
#define fillm(x) memset(x, -1, sizeof(x))
#define mp make_pair
#define pll pair<int, int>
#define pf printf
#define sf scanf
#define all(x) x.begin(),x.end()
#define pb push_back
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define np std::string::npos
#define fo(i,n) for(int i=0;i<n;i++)
#define fo1(i,n) for(int i=1;i<n;i++)
#define fof(i,a,b) for(int i=a;i<=b;i++)
#define off(i,a,b) for(int i=a;i>=b;i--)
#define of(i,n) for(int i=n-1;i>=0;i--)
#define stl(i,x) for(auto i=x.begin(); i!=x.end();i++)
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define cases(cs,t) for(int cs=1;cs<=t;cs++)
#define PI acos(-1)
#define nl endl

typedef unsigned long long lll;
typedef long long ll;
int knigtx8[] = {2, 2, -2, -2, 1, 1, -1, -1}; ///knight move in chess
int knigty8[] = {1, -1, 1, -1, 2, -2, 2, -2}; ///knight move in chess
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}; ///for 8 directions
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1}; ///for 8 directions
int dx4[] = {0, 0, 1, -1}; ///for 4 directions
int dy4[] = {1, -1, 0, 0}; ///for 4 directions
const int maxx=100005;

//this fuction sorts vector pair according to first element in descending order.
bool sortinrev(const pair<int,int> &a,const pair<int,int> &b)
{
    return a.first>b.first;
}
ll pw(ll a, ll b)
{
    ll ans = 1;
    for(ll i = 1; i <= b; ++i)
        ans = (ans * a);
    return ans;
}
template<typename T>inline T Bigmod(T base, T power, T MOD){
    T ret=1;
    while(power)
    {
        if(power & 1)ret=(ret*base)%MOD;
        base=(base*base)%MOD;
        power>>=1;
    }
    return ret;
}

int main()
{
    IOS;
    int n;
    cin>>n;
    int a[n],b[n],cnt=0;bool ok=0;
    fo(i,n)
    {

        cin>>a[i]>>b[i];
        if(a[i]==b[i] and cnt==0){
            ok=1;
            cnt++;
        }
        else if(a[i]==b[i] and a[i-1]==b[i-1] and ok){
            cnt++;
        }
        else{
            ok=0;
            cnt=0;
        }
        if(cnt>=3){
            ok=1;
            break;
        }
    }
    if(ok and cnt>=3)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

///Alhamdulillah


Measured memory_bytes: 3636
def dfs(v,children,checked):
  if len(checked)==len(children):
    return 1
  ans = 0
  for child in children[v]:
    if child in checked:
      continue
    ncheck = set(checked)
    ncheck.add(child)
    ans += dfs(child,children,ncheck)
  return ans

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

children = [[]for _ in range(n)]
for i in range(m):
  a,b = tuple(map(int,input().split()))
  children[a-1].append(b-1)
  children[b-1].append(a-1)

ans = dfs(0,children,set([0]))

print(ans)
  


Measured memory_bytes: 9172
import java.util.*;
class Main{
	
    public static void main(String args[]){
    	Scanner sc=new Scanner(System.in);
    	String a=sc.next();
    	System.out.println(a.charAt(1)!=a.charAt(2)?"No":a.charAt(1)==a.charAt(0)||a.charAt(1)==a.charAt(3)?"Yes":"No");
    }
}

Measured memory_bytes: 23764
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int N;
	cin >> N;
	vector<int>v(N);
	for (int i = 0; i < N; i++)


	{
		int x;
		cin >> x;
		 v[i]=x;
	}
	vector<int>count(N, 0);
	for (int i = 0; i < N; i++)
	{
		while (v[i] % 2 == 0)
		{
			v[i] = v[i] / 2;
			count[i] += 1;
			
		}


	}
	sort(count.begin(),count.end());
	//cout << v[0] << endl;
	cout << count[0] << endl;
}

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

const int maxn = 1e5 + 10;

struct node
{
	int l,r;
}nodes[maxn];

bool cmp1(node &a, node &b)
{
	if(a.l == b.l) return a.r > b.r;
	else return a.l > b.l;
}

bool cmp2(node &a, node &b)
{
	if(a.r == b.r) return a.l < b.l;
	else return a.r < b.r;
}

int n;

int main()
{
	scanf("%d", &n);
	for(int i = 0; i < n; ++i){
		int x,l;
		scanf("%d%d",&x,&l);
		nodes[i].l = x - l;
		nodes[i].r = x + l;
	}
	sort(nodes,nodes + n,cmp2);
	int nr = nodes[0].r;
	int cnt1 = n;
	for(int i = 1;i < n; i++){
		int nl = nodes[i].l;
		if(nl < nr) cnt1--;
		else nr = nodes[i].r;
	}
	sort(nodes,nodes + n, cmp1);
	int nl = nodes[0].l;
	int cnt2 = n;
	for(int i = 1;i < n; i++){
		nr = nodes[i].r;
		if(nl < nr) cnt2--;
		else nl = nodes[i].l;
	}
	//cout << cnt1 << " " << cnt2 << endl;
	cout << max(cnt1,cnt2) << endl;
	return 0;
}

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

using namespace std;

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

  int N, K;
  vector<int> v;

  std::cin >> N >> K;
  v.resize(N);
  vector<bool> dp(K+1, false);

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

  for (int sum = 0; sum <= K; ++sum)
  {
    for (int i = 0; i < v.size(); ++i)
    {   
      if (sum >= v[i] && !dp[sum - v[i]])
      {   
        dp[sum] = true;
        break;
      }   
    }   
  }

  if (dp[K]) std::cout << "First";
  else std::cout << "Second";

  return 0;
}

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

int main()
{
	int nNum = 0;
	int nArrIn[100] = { 0 };
	cin >> nNum;
	for (int i = 0; i < nNum; ++i)
	{
		cin >> nArrIn[i];
	}
	int nMin = 0, nCount = 0;
	for (int i = 0; i < nNum - 1; ++i)
	{
		nMin = i;
		for (int j = i + 1; j < nNum; ++j)
		{
			if (nArrIn[j] < nArrIn[nMin])
			{
				nMin = j;
			}
		}
		if (i != nMin)
		{
			swap(nArrIn[i], nArrIn[nMin]);
			++nCount;
		}
	}
	for (int i = 0; i < nNum - 1; ++i)
	{
		cout << nArrIn[i] << " ";
	}
	cout << nArrIn[nNum - 1] << endl;
	cout << nCount << endl;
	return 0;
}


Measured memory_bytes: 3084
// includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for(int i=((int)(n)-1);i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
typedef pair<double, double> Pd;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;
const int mod = 1e9 + 7;

// solve
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 argc, char const* argv[])
{
  vector<ll> a;
  int q;
  cin >> q;
  rep(i, q){
    int x;
    cin >> x;
    if(x == 0){
      ll y;
      cin >> y;
      a.pb(y);
    }else if(x == 1){
      int y;
      cin >> y;
      cout << a[y] << endl;
    }else{
      a.pop_back();
    }
  }
	return 0;
}



Measured memory_bytes: 4892
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010


int main(){
  char s[SIZE];
  int counter[500] = {};
  
  scanf("%s",s);

  int n = strlen(s);
  
  for(int i=0;i<n;i++){
    counter[s[i]-'a']++;
  }

  bool flag = true;

  for(int i=0;i<3;i++)
    flag &= counter[i] - n/3 == 0 || counter[i] - n/3 == 1; 

  if(flag)
    puts("YES");
  else
    puts("NO");
  
  return 0;
}



Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main()
{
   int n; cin>>n;
   double sum=0;
   for(int i=0;i<n;i++)
   {
      double y; cin>>y;
      y=1/y;
     sum+=y;
   }
  sum=1/sum;
  cout<<sum;
}

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int T = sc.nextInt();
		int[] A = new int[N];
		for(int i=0; i<N; i++)
			A[i] = sc.nextInt();

		int maxDiff = 0;
		int max = 0;
		for(int i=N-1; i>=0; i--) {
			max = Math.max(max, A[i]);
			maxDiff = Math.max(maxDiff, max-A[i]);
		}

		int ans = 0;
		HashSet<Integer> set = new HashSet<>();
		for(int i=N-1; i>=0; i--) {
			set.add(A[i]);
			if(set.contains(A[i]+maxDiff))
				ans++;
		}
		System.out.println(ans);

		sc.close();
	}

}

Measured memory_bytes: 41428