akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  
  for(int i= 0; i<N;i++){
    cin >> S.at(i);
  }
  
       int c =0;
     for(int i= 0; i<N-1;i++){  
       if(S.at(i).at(S.at(i).size()-1) == S.at(i+1).at(0)){
         c++;
       }
     }
  
   sort(S.begin(), S.end());
       
   int flag = true;
   for(int i= 0; i<N-1;i++){
     if(S.at(i) == S.at(i+1)){
       flag = false;
       break;
     }
   }
       if(flag == true && c == N-1) cout << "Yes" <<endl;
       else cout << "No" << endl;
        
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main() 
{
  int a,b,c;
  cin >> a >> b >>c;
  int count = 0;
  int i;
  for(i = a;i <= b;i++){
    if(c % i == 0){
      count++;
    }
  }
  cout << count << endl;
  return 0;
}


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

int sum[2][101010];

int main(){
  string S,T; cin>>S>>T;
  rep(i,S.length()) sum[0][i+1]=sum[0][i]+(S[i]=='A'?1:2);
  rep(i,T.length()) sum[1][i+1]=sum[1][i]+(T[i]=='A'?1:2);
  int q; cin>>q;
  rep(i,q){
    int a,b,c,d; cin>>a>>b>>c>>d;
    int s=(sum[0][b]-sum[0][a-1])%3;
    int t=(sum[1][d]-sum[1][c-1])%3;
    if(s==t) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}


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

#define ll long long
#define ull unsigned long long

using namespace std;

int main() {
	ll N;
	cin >> N;
	vector <ll> A(N, 0);
	for (ll ii = 0; ii < N; ++ii){
		ll tmp;
		cin >> tmp;
		A[ii] = -tmp;
	}

	vector <ll> ans;
	for (ll ii = 0; ii < N; ++ii){
		auto itr = upper_bound(ans.begin(), ans.end(), A[ii]);
		if (itr == ans.end()) {
			ans.push_back(A[ii]);
		} else {
			*itr = A[ii];
		}
	}

	cout << ans.size() << endl;
	

	return 0;
}


Measured memory_bytes: 2168
#include<bits/stdc++.h>
#include <cctype>
#include <iostream>
#define ll          long long int
#define ld          long double
#define PB          push_back
#define GO          ll t; cin>>t; while(t--)
#define G(t)        cin>>t; while(t--)
#define ALLR(x)     x.rbegin(), x.rend()
#define PII         pair<ll ,ll >
#define VI          vector<ll >
#define ALL(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define PI          3.141592653589793238
#define SZ(x)       (ll )x.size()
#define hell9        998244353
#define hell        1000000007
#define FO(i,a,b)    for(i=a;i<b;i++)
#define FOREV(i,a,b)    for(i=a;i>=b;i--)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define BS          binary_search
#define MP          make_pair
#define LIM         100005
#define ARR(n,i,a)    ll n,i;cin>>n;ll a[n];FO(i,0,n)cin>>a[i];
#define ARRK(k,n,i,a) int n,k,i;scanf("%d%d",&n,&k);ll a[n];FO(i,0,n)scanf("%lld",&a[i]);
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);
/*ll powM(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 POW(ll x, ll y)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x);
        y = y >> 1;
        x = (x * x);
    }
    return res;
}/*
int LIS(std::vector<int>& v)
{
    if (v.size() == 0)
        return 0;
    std::vector<int> tail(v.size(), 0);
    int length = 1;
    tail[0] = v[0];
    for (int i = 1; i < v.size(); i++)
    {
        auto b = tail.begin(), e = tail.begin() + length;
        auto it = lower_bound(b, e, v[i]);
        if (it == tail.begin() + length)
            tail[length++] = v[i];
        else
            *it = v[i];
    }
    return length;
}
ll modInverse(ll n, ll p)
{
    return powM(n, p - 2, p);
}
ll fac[500000] = {0};
ll done = 1;
ncrModP(ll n, ll r, ll p)
{
    if (r == 0)
        return 1;
 
    fac[0] = 1;
    if (n > done)
    {    for (ll i = done ; i <= n; i++)
            fac[i] = (fac[i - 1] * i) % p;
    }
    done = max(done, n);
 
    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) % p;
 
}
ll ncrM(ll n, ll r)
{
    if (r > n - r)
        r = n - r;
    ll C[r + 1];
    memset(C, 0, sizeof(C));
    C[0] = 1;
    for (ll i = 1; i <= n; i++) {
        for (ll j = min(i, r); j > 0; j--)
            C[j] = (C[j] + C[j - 1]);
    }
    return C[r];
}
map<ll, ll>f;
ll fib(ll k)
{
    ll i; f[0] = 1; f[1] = 1; f[2] = 2;
    if (k <= done)return f[k];
    for (i = done; i <= k; i++)f[i] = (f[i - 1] % hell + f[i - 2] % hell) % hell;
    done = k;
    return f[k] % hell;
}void sieve(int n)
{
     bool prime[5*LIM];
     memset(prime, true, sizeof(prime));
      int rootn = (int)sqrt(n);
     for (int p = 2; p <= rootn; p++)
          if (prime[p] == true)
               for (int i = p*p; i <= n; i += p)
                    prime[i] = false;
     prime[1] = 0;
 
}*/

int t;
int main()
{
fio
char a;
cin>>a;
if(a<92)cout<<"A";else cout<<"a";
return 0;
}


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

#define debug(...)   printf( __VA_ARGS__ )
//#define debug(...)   /****nothing****/

#define ll long long
#define ull unsigned long long
#define pb push_back
#define mem(arr,val)    memset(arr,val,sizeof(arr))
#define mp make_pair
#define pii pair<int,int>
#define F first
#define S second
#define sz(x) (int)(x).size()
#define nopos string::npos
#define fr(i,a,b) for(i=a;i<=b;i++)
#define frn(i,a,b) for(i=a;i>=b;i--)

int a,b;
int main()
{
    //freopen("d://i.txt","r",stdin);
    //freopen("d://o.txt","w",stdout);
    cin>>a>>b;
    if((a+b)%24==0)
        cout<<0<<'\n';
    else
        cout<<(a+b)%24<<'\n';


    return 0;
}





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

typedef long long ll;

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


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

    int n; cin >> n;

    int ans = 0;
    for(int i = 1; i <= n; i++) {
        int cnt = 0;
        if(i&1) {
            for(int j = 1; j <= i; j++) {
                if(i%j == 0) cnt++;
            }
        }
        if(cnt == 8) ans++;
    }

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

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;

public class Coder
{

    public static int[] ReadArray()
    {
        return Array.ConvertAll(Console.ReadLine().Split(' '), m => Convert.ToInt32(m));
    }

    public static int ReadInt()
    {
        return Convert.ToInt32(Console.ReadLine());
    }

    public static string ReadStr()
    {
        return Console.ReadLine();
    }

    public static long ReadLong()
    {
        return Convert.ToInt64(Console.ReadLine());
    }

    public static long[] ReadLongArray()
    {
        return Array.ConvertAll(Console.ReadLine().Split(' '), m => Convert.ToInt64(m));

    }

    public static void Main()
    {

        int[] A = ReadArray();

        Console.WriteLine($"{A[2]} {A[0]} {A[1]}");
    

    }

}

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

#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<(DUMP(),__VA_ARGS__).str()<<endl)
struct DUMP : stringstream {
    template<class T>
    DUMP &operator,(const T &t) {
        if(this->tellp()) *this << ", ";
        *this << t;
        return *this;
    }
};

class BIT {
private:
    int size;
    vector<long long> bit;

public:
    BIT(int n = 0):size(n), bit(n + 1, 0) {}

    void add(int i, long long x) {
        while(i <= size) {
            bit[i] += x;
            i += i & -i;
        }
    }

    long long sum(int i) const {
        long long s = 0;
        while(i > 0) {
            s += bit[i];
            i -= i & -i;
        }
        return s;
    }
};

const int MAX_N = 2000;
const int MAX_LOG_N = 12;

int n;
int parent[MAX_LOG_N][MAX_N];
int depth[MAX_N];

long long cost[MAX_N];
vector<int> edges[MAX_N];

int pos_plus[MAX_N];
int pos_minus[MAX_N];

BIT bit(MAX_N * 2);

void dfs(int v, int p, int d, int &index) {
    parent[0][v] = p;
    depth[v] = d;

    pos_plus[v] = index;
    bit.add(index++, cost[v]);

    for(const auto &to : edges[v]) {
        if(to != p) dfs(to, v, d + 1, index);
    }

    pos_minus[v] = index;
    bit.add(index++, -cost[v]);
}

void calc() {
    int index = 1;
    dfs(0, -1, 0, index);
	assert(index == 2 * n + 1);
    for(int k = 0; k < MAX_LOG_N - 1; ++k) {
        for(int v = 0; v < n; ++v) {
            parent[k + 1][v] = (parent[k][v] == -1 ? -1 : parent[k][parent[k][v]]);
        }
    }
}

int lca(int u, int v) {
    if(depth[u] > depth[v]) swap(u, v);
    for(int k = 0; k < MAX_LOG_N; ++k) {
        if((depth[v] - depth[u]) >> k & 1) v = parent[k][v];
    }
    if(u == v) return u;
    for(int k = MAX_LOG_N - 1; k >= 0; --k) {
        if(parent[k][u] != parent[k][v]) {
            u = parent[k][u];
            v = parent[k][v];
        }
    }
    return parent[0][u];
}

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

    cin >> n;

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

    for(int i = 0; i < n - 1; ++i) {
        int a, b;
        cin >> a >> b;
        --a; --b;
        edges[a].emplace_back(b);
        edges[b].emplace_back(a);
    }

    calc();

    int q;
    cin >> q;
	while(q--) {
        int x;
        cin >> x;

        if(x) {
            int a;
			long long c;
            cin >> a >> c;
            --a;
            cost[a] += c;
            bit.add(pos_plus[a], c);
            bit.add(pos_minus[a], -c);
        }
        else {
            int a, b;
            cin >> a >> b;
            --a; --b;
            if(pos_plus[a] > pos_plus[b]) swap(a, b);
            const int l = lca(a, b);
            cout << (bit.sum(pos_plus[a]) - bit.sum(pos_plus[l])) - (bit.sum(pos_minus[l]) - bit.sum(pos_minus[b] - 1)) << endl;
        }
    }

    return 0;
}


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

int main() {
	ll	a, b;
	cin >> a >> b;
	bitset<32>	bsa(a), bsb(b);

	cout << (bsa & bsb) << endl;
	cout << (bsa | bsb) << endl;
	cout << (bsa ^ bsb) << endl;
}



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


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

    int n, m;
    cin >> n >> m;
    vector<int> v;
    int max = 0;
    for(int i = 0; i < m; i++) {
        int gh;
        cin >> gh;
        max += gh;
    }

    if(max >= n)
        cout << "Yes";
    else
        cout << "No";

    

    return 0;
}




Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
typedef long long ll;

using namespace std;

int main()
{
	string s,t;
	int ans=0;
	
	cin>>s;
	cin>>t;
	sort(s.begin(),s.end());
	sort(t.begin(),t.end());
	reverse(t.begin(),t.end());
	if(t.compare(s)<=0)
	{
		cout<<"No"<<endl;
	}else{
		cout<<"Yes"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a > b){
    printf("a > b\n");
}else if(a < b){
    printf("a < b\n");
}else if(a == b){
    printf("a == b\n");
}
return 0;

}


Measured memory_bytes: 2600
#include <iostream>
#include <string>
using namespace std;
using ll = long long;

int main() {
    // input
    ll N;
    cin >> N;
    string ans = "";
    
    // calculation
    while(N != 0) {
        if (N%2 != 0) {
            --N;
            ans = "1" + ans;
        } else {
            ans = "0" + ans;
        }
        N /= -2;
    }
    if (ans == "") ans = "0";
    
    cout << ans << "\n";
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

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

using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1e9;
const long long LINF = 1LL << 50;
#define int long long

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int a, b; cin >> a >> b;
	int ans = a - 2* b;
	if (ans < 0)cout << 0 << endl;
	else cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cmath>
#include <climits>
#include <map>
#include <queue>
#include <functional>
using namespace std;
typedef long long ll;
#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 all(v) v.begin(),v.end()
const ll mod = 1e9+7;

int main() {
    vector<int> a(5),b = {1,2,3,4,5};
    rep(i,5) {
        cin >> a[i];
        if (a[i] != b[i]) {
            cout << i+1 << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 3632
import java.util.*;
import java.io.*;
 
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
 
public class Main{
    static final long mod=1000000007;
    
    public  static void main(String[] args)   throws Exception, IOException{
        Reader sc = new Reader(System.in);
        PrintWriter out=new PrintWriter(System.out);
        // int n=sc.nextInt();
        // char c[][] = new char[h][w];
        // char c[]=sc.nextString().toCharArray();
        // int d[]=new int[n];
        // for(int i=0; i<n; i++) {d[i]=sc.nextInt();}

        int n=sc.nextInt();
        int a[]=new int[n];
        int b[]=new int[n];
        long v=(long)n*(n+1)/2;
        v=(v+1)/2;

        for(int i=0; i<n; i++) {
            a[i]=sc.nextInt();
            b[i]=a[i];
        }
        sort(b);

        int low=0,high=n,mid=0;
        int d[]=new int[n+1];

        for(int i=0; i<80; i++) {
            mid = low+high>>1;
            bit bt=new bit(n*2+2);
            long s=0;
            bt.add(n+2,1);
            for (int t=1; t<=n; t++) {
                if(b[mid]<=a[t-1])d[t]=d[t-1]+1;                
                else d[t]=d[t-1]-1;
                s+=bt.sum(d[t]+n+2);
                bt.add(d[t]+n+2,1);
            }
            if(v<=s){ low=mid; }
            else {high=mid;}
        }


        out.println(b[mid]);
        out.flush();
    }


    static void db(Object... os){
        System.err.println(Arrays.deepToString(os));
    }  
}

class bit {
    int b[],n;
    bit(int n){
        this.n = n;
        b = new int[n+1];
    }
    int sum(int i){
        int s = 0;
        while(i > 0){
            s += b[i];
            i -= i&-i;
        }
        return s;   
    }
    void add(int i, int x){
        while(i <= n){
            b[i] += x;
            i += i&-i;
        }
    }
}


class P implements Comparable<P>{
    int id, d;
    P(int  id, int d) {
        this.id=id;
        this.d=d;
    }
    public int compareTo(P p){
        return d-p.d; //des
    }
}

class Reader
{ 
    private BufferedReader x;
    private StringTokenizer st;
    
    public Reader(InputStream in)
    {
        x = new BufferedReader(new InputStreamReader(in));
        st = null;
    }
    public String nextString() throws IOException
    {
        while( st==null || !st.hasMoreTokens() )
            st = new StringTokenizer(x.readLine());
        return st.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(nextString());
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(nextString());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(nextString());
    }
}

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

#define INF 1e18
#define REP(i, n) for (int i=0; i<n; i++)
#define print(x) cout << x << endl
#define debug(x) cout << #x << " = "<< x << endl

const double PI=3.141592653589793238462643383279502884197169399375105820974944;

typedef long long ll;

using namespace std;

void solve() {
    int N, i;
    cin >> N >> i;
    print(N + 1 - i);
}

signed main() {
    solve();
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <climits>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
using namespace std;
typedef struct {double x;double y;}Point;

void calcKoch(int n, Point p1, Point p2){
  Point n1;			// p1,p2を1:2で内分した点
  Point n2;			// p1,p2を2:1で内分した点
  Point t;			// n1,n2からなされる正三角形の頂点
  if (n == 0) {
    return;
  }
  n1.x = (p1.x*2 + p2.x*1)/(1+2);
  n1.y = (p1.y*2 + p2.y*1)/(1+2);
  n2.x = (p2.x*2 + p1.x*1)/(1+2);
  n2.y = (p2.y*2 + p1.y*1)/(1+2);

  t.x = (n2.x - n1.x)*cos((M_PI*1)/3) - (n2.y-n1.y)*sin((M_PI*1)/3) + n1.x;
  t.y = (n2.x - n1.x)*sin((M_PI*1)/3) + (n2.y-n1.y)*cos((M_PI*1)/3) + n1.y;

  calcKoch(n-1, p1, n1);
  cout << n1.x << " " << n1.y << "\n";
  calcKoch(n-1, n1, t);
  cout << t.x << " " << t.y << "\n";
  calcKoch(n-1, t, n2);
  cout << n2.x << " " << n2.y << "\n";
  calcKoch(n-1, n2, p2);


  
}

int main(int argc, char *argv[])
{
  int n = 0;
  cin >> n;
  Point p1;
  Point p2;
  p1.x = 0;
  p1.y = 0;
  p2.x = 100;
  p2.y = 0;
  cout << p1.x << " " << p1.y << "\n";
  calcKoch(n,p1, p2);
  cout << p2.x << " " << p2.y << "\n";
  return 0;
}



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

int main() {
	int a,b,c;
	cin >> a >> b >> c;
	int k = 0;
	if(b >= a * c)
	{
		k = c;
	}
	else
	{
		k = b / a;
	}
	cout << k << endl;
	return 0;
}


Measured memory_bytes: 384
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long x = sc.nextLong();
    long sum = 0;
    int cnt = 0;
    while(sum < x){
      cnt++;
      sum += cnt;
    }
    System.out.println(cnt);
  }
}

Measured memory_bytes: 23892
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        String a = "NG";
        
        for(int i=A;i<=B;i++){
            if(i%K == 0){
                a = "OK";
                break;
            }
        }
        System.out.println(a);
    }
}


Measured memory_bytes: 35644
n = int(input())
abc = [list(map(int, input().split())) for _ in range(n)]
dp = [[0] * 3 for _ in range(n)]
# print(dp)
for i in range(3):
  dp[0][i] = abc[0][i]

for j in range(1, n):
  dp[j][0] = max(dp[j - 1][1], dp[j - 1][2]) + abc[j][0]
  dp[j][1] = max(dp[j - 1][2], dp[j - 1][0]) + abc[j][1]
  dp[j][2] = max(dp[j - 1][0], dp[j - 1][1]) + abc[j][2]
# print(dp)  
print(max(dp[-1]))

Measured memory_bytes: 74584
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define all(x) x.begin(), x.end()
using ll = long long;
using pii = pair<int, int>;
const int mod = 1e9+7;

int main() {
    int n, T;
    cin >> n >> T;
    int t[n];
    rep(i, n) {
        cin >> t[i];
    }
    ll ans = 0;
    rep(i, n) {
        if (i > 0) {
            if (t[i] - t[i-1] < T) {
                ans += t[i] - t[i-1];
            } else {
                ans += T;
            }
        }
        if (i == n-1) {
            ans += T;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 4328
import math
a,b,C = map(float,input().split())
C = math.radians(C)
sinC = math.sin(C)
cosC = math.cos(C)
h = b*sinC
d = math.sqrt(h**2 + (a-b*cosC)**2)
S = 1/2*a*b*sinC
L = a + b + d


print(S)
print(L)
print(h)


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

MOD = 1000000007  # type: int


def solve(N: int):
    if N == 1:
        print(0)
        return
    if N == 2:
        print(2)
        return
    ans = (10 ** N) - ((9 ** N )* 2) + (8 ** N)
    print(ans % MOD)



    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


Measured memory_bytes: 84044
#include <iostream>

int main(){
    int n;
    std::cin >> n;
    for (int i = 1; i <= n; i++){
        int x = i;
        if (x % 3 == 0){
            std::cout << " " << i;
        } else {
            while(x){
                if (x % 10 == 3){
                    std::cout << " " << i;
                    break;
                }
                x /= 10;
            }
        }
    }
    std::cout << '\n';
}



Measured memory_bytes: 3100
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

cnt = 0
flag = False
for i in range(n) :
  if a[i] > b[i] :
    a[i] -= b[i]
    cnt += b[i]
    b[i] = 0
  elif a[i] == b[i]:
    cnt += b[i]
    b[i] = 0
    a[i] = 0
  else :
    b[i] -= a[i]
    cnt += a[i]
    a[i] = 0
    flag = True

  if flag :
    if a[i+1] > b[i] :
      a[i+1] -= b[i]
      cnt += b[i]
      b[i] = 0
    elif a[i+1] == b[i]:
      cnt += b[i]
      b[i] = 0
      a[i+1] = 0
    else :
      b[i] -= a[i+1]
      cnt += a[i+1]
      a[i+1] = 0
    flag = False

print(cnt)

Measured memory_bytes: 18752
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

using ll = long long;
using VI = vector<int>;
using PI = pair<int, int>;

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()

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

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main()
{
    int N;
    cin >> N;
    cout << (float)(N - N / 2) / (float)N << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int a[100001],b[100001];
int ans;

int max(int x,int y){
	if(x>y)return x;
	return y;
}

int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int v;
		scanf("%d",&v);
		if(i%2==0)a[v]++;
		else b[v]++;
	}
	
	int a1=0,a2=0,b1=0,b2=0;
	for(int i=1;i<=100000;i++){
		if(a[a1]<a[i]){
			a2=a1;
			a1=i;
		}
		else if(a[a2]<a[i])a2=i;
		if(b[b1]<b[i]){
			b2=b1;
			b1=i;
		}
		else if(b[b2]<b[i])b2=i;
	}
	if(a1==b1)ans=n-max(a[a1]+b[b2],a[a2]+b[b1]);
	else ans=n-(a[a1]+b[b1]);
	
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 896
import numpy as np
N=int(input())
A=np.array(list(map(int, input().split())))
B=np.array(list(map(int, input().split())))
C=np.array(list(map(int, input().split())))

a=0
for i in range(N-1):
    if A[i]==A[i+1]-1:
        a+=C[A[i]-1]
print(np.sum(B)+a)

Measured memory_bytes: 21664
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589793238;
const double EPS = 1e-10;
ll a[16][16];
ll dp[1 << 16];
ll sum[1 << 16];
int main() {
	int N;
	cin >> N;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) cin >> a[i][j];
	}
	for (int bit = 0; bit < (1 << N); bit++) {
		for (int i = 0; i < N; i++) {
			for (int j = i + 1; j < N; j++) {
				if ((bit&(1 << i)) && (bit&(1 << j))) {
					sum[bit] += a[i][j];
				}
			}
		}
	}
	fill(dp, dp + (1 << 16), -(1LL << 60));
	dp[0] = 0;
	for (int bit = 1; bit < (1 << N); bit++) {
		for (int sub = bit; sub; sub = (sub - 1)&bit) {
			dp[bit] = max(dp[bit], dp[bit^sub] + sum[sub]);
		}
	}
	cout << dp[(1 << N) - 1] << endl;
}

Measured memory_bytes: 1280
#include<stdio.h>
#include<stdlib.h>

#define MAX(x,y) (((x)>(y))?(x):(y))

const unsigned long long modnum=1E9+7;
unsigned long long invdiv(unsigned long long p);

int main(void){
  unsigned long long H,W,A,B;
  unsigned long long *up,*down;
  unsigned long long maxnum;
  unsigned long long ans,tmp;
  int i,j,k;

  scanf("%llu%llu%llu%llu",&H,&W,&A,&B);
  maxnum=H+W;
  up=(unsigned long long *)calloc(maxnum+1,sizeof(unsigned long long));
  down=(unsigned long long *)calloc(maxnum+1,sizeof(unsigned long long));
  up[0]=up[1]=down[0]=down[1]=1;

  for(i=2;i<maxnum;i++){
    up[i]=(up[i-1]*i)%modnum;
    down[i]=(down[i-1]*invdiv(i))%modnum;
  }

  ans=0;
  for(i=0;i<H-A;i++){
    ans+=up[i+B-1]*down[i]%modnum*up[W-1-B+H-1-i]%modnum*down[H-1-i]%modnum;
    ans%=modnum;
  }
  ans*=down[B-1];
  ans%=modnum;
  ans*=down[W-1-B];
  ans%=modnum;
  printf("%llu\n",ans);
  return 0;
}

unsigned long long invdiv(unsigned long long p) {
	unsigned long long r[3], q;
	unsigned long long x[3];
	div_t clc;

	r[0] = p;
	r[1] = modnum;

	x[0] = 1;
	x[1] = 0;

	do {
		clc = div(r[0], r[1]);
		q = clc.quot;
		r[2] = clc.rem;
		while(x[0] < q * x[1]) x[0] += modnum;
		x[2] = (x[0] - q * x[1]) % modnum;

		r[0] = r[1];
		r[1] = r[2];

		x[0] = x[1];
		x[1] = x[2];
	} while(r[2] > 1);
	return x[2];
}


Measured memory_bytes: 3328
// 2_abc130_b
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

using namespace std;
#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 SZ(x) ((int)(x).size())
#define INF (1e16)
#define MOD (1000000007)
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n ,x;
    cin >> n >> x;
    int d = 0;
    int ans = 1;
    rep(i, n){
        int l;
        cin >> l;
        d += l;
        if(d > x) break;
        ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string str; cin >> str;
    int q; cin >> q;
    for (int i = 0; i < q; i++) {
        string func, repl; int a, b;
        cin >> func >> a >> b;
        if (func == "replace") cin >> repl;
        if (func == "print") {
            cout << str.substr(a, b - a + 1) << endl;
        } else if (func == "reverse") {
            reverse(str.begin() + a, str.begin() + b + 1);
        } else {
            str = str.substr(0, a) + repl + str.substr(b + 1);
        }
    }
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  REP(i, N) cin >> a[i];
  vector<ll> sum(N + 1);
  sum[0] = 0;
  REP(i, N) sum[i + 1] = sum[i] + a[i];
  ll ans = 1e9 * 10;
  REP1(i, N - 1) ans = min(ans, abs(sum[i] - (sum[N] - sum[i])));
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#define limit(x, l, r) max(l, min(x, r))
#define lims(x, l, r) (x = max(l, min(x, r)))
#define isin(x, l, r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)), x.end())
#define show(x) cout << #x << " = " << x << endl;
#define print(x) cout << x << endl;
#define PQ(T) priority_queue<T, v(T), greater<T> >
#define bn(x) ((1 << x) - 1)
#define dup(x, y) (((x) + (y)-1) / (y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

int main() {
  int n, k;
  cin >> n >> k;
  vl a(n);
  rep(i, n) cin >> a[i];

  ll left = 0, right = 1000000001LL;
  ll ans = right;
  while (right - left > 1) {
    ll mid = left + (right - left) / 2;
    ll cnt = 0;
    long double mx = 0;
    rep(i, n) {
      ll c;
      if((long double)a[i]/2 <= mid) c=1;
      else c = ceil(a[i]/mid);
      if(mid<a[i]){
        cnt += c;
        mx = max(mx,(long double)a[i]/(c+1));
      }
      else mx = max(mx,(long double)a[i]);
    }
    if (cnt <= k){
      right = mid;
      mins(ans, (ll)ceil(mx));
    }
    else
      left = mid; 
  }

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

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

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    vector<ll> A;
    REP(i, N) {
        ll a;
        cin >> a;
        A.push_back(a);
    }
    ll M;
    cin >> M;
    REP(i, M) {
        ll b;
        cin >> b;
        A.push_back(b);
    }

    sort(A.begin(), A.end());
    A.erase(unique(A.begin(), A.end()), A.end());
    REP(i, A.size()) {
        cout << A[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 7088
s = input()[::-1] + '0'*7
words = ['maerd', 'remaerd', 'esare', 'resare']
i =0
while True:
    if s[i] == 'm':
        if s[i:i+5] == words[0]:
            i += 5
        else:break
    elif s[i] == 'r':
        if s[i:i+7] == words[1]:
            i += 7
        elif s[i:i+6] == words[3]:
            if s[i+6] == 's':
                i += 5
            else:
                i += 6
        else:break
    elif s[i] == 'e':
        if s[i:i+5] == words[2]:
            if s[i+5] == 's':
                i += 4
            else:
                i += 5
        else:
            break
    else:
        break
#print(s[i:])
if s[i:] == '0'*7:
    print('YES')
else:
    print('NO')


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

int main () {

    string N;
    cin >> N;

    bool ans = false;
    for (int i = 0; i < N.size(); i++) {
        if (N[i] == '7') {
            ans = true;
        }
    }
    cout << ((ans)? "Yes": "No") << endl;

    return 0;
}

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

int main(){
    int n;
    int x, y, z;
    cin >> n;
    
    x = n / 1.08;
    y = x * 1.08;
    z = (x + 1) * 1.08;

    if (y == n) cout << x << endl;
    else if (z == n) cout << x + 1 << endl;
    else cout << ":(" << endl;

    return 0;
}

Measured memory_bytes: 256
'use strict'

const main = (INPUT) => {
  const input = INPUT.split('\n')
  const [N, D] = input[0].split(' ')
  let ans = 0
  for (let i = 1; i < input.length; i++) {
    const [X, Y] = input[i].split(' ')
    if (Math.sqrt(X ** 2 + Y ** 2) <= D) {
      ans++
    }
  }
  console.log(ans)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


Measured memory_bytes: 63152
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String S = sc.next();
        int K = sc.nextInt();
        
        StringBuilder sb = new StringBuilder(N);
        char C = S.charAt(K - 1);
        for(int i = 0; i < N; i++){
            char tmp = S.charAt(i);
            if(tmp == C){
                sb.append(tmp);
            }else{
                sb.append("*");
            }
        }
        System.out.println(sb.toString());
    }
}


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

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

#define sq(x)   (x)*(x)
#define PI      acos(-1.0)
#define nl      '\n'

typedef long long int ll;
typedef unsigned long long int  llu;

int main()
{
    int t;
    int a,b;
    cin>>a>>b;
   if(a>b)
       swap(a,b);
    if(a==1 && b==2)
        t=3;
    else if(a==2 && b==3)
        t=1;
    else if(a==1 && b==3)
        t=2;
    cout<<t<<nl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<cstring>
#include <iomanip>

using namespace std;

#ifdef LDEBUG
#define debug(x) cout << #x << ":" << x << endl
#else
#define debug(...)
#endif

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

typedef unsigned long long u64;
typedef long long i64;


int a[100005];
int n, m;

int par(int p) {
        if (a[p] == p) return p;
        a[p] = par(a[p]);
        return a[p];
}

void merge(int p, int q){
        p = par(p);
        q = par(q);
        a[p] = q;
}


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

        cin >> n >> m;

        REP(i,n)
                a[i] = i;

        REP(i,m) {
                int x,y,z;
                cin >> x >> y >> z;
                x--;y--;

                merge(x,y);
        }

        int c = 0;
        REP(i,n)
                if (par(i) == i)
                        c++;

        cout << c << endl;

        return 0;
}


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


int main()
{
  int n;
  cin >> n;
  vector<pair<int, int>> s;
  rep(i, n)
  {
    int a;
    cin >> a;
    s.emplace_back(a, i + 1);
  }
  sort(s.begin(), s.end());
  rep(i, n)
    printf("%d%c", s[i].second, i == n - 1 ? '\n' : ' ');
  return 0;
}

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

int main(){
  int i = 0, n, a;
  long min = 1000000, max = -1000000, total = 0;

  cin >> n;

  while(i < n){
    cin >> a;

    if (min > a) min = a;
    if (max < a) max = a;
    total += a;
    i++;
  }
  cout << min << " " << max << " " << total << endl;

  return 0;
}

Measured memory_bytes: 1168
import sys
input = lambda: sys.stdin.readline().rstrip()

N,M,X = map(int, input().split())


text = []
for i in range(N):
    tmp = list(map(int, input().split()))
    text.append(tmp)

ans = float("inf")
for i in range(1 << N):
    tmp = [0] * (M+1)  
    flg = 0
    for j in range(N):
        if (i>>j) & 1:
            for k in range(M+1):
                tmp[k] += text[j][k]
    for l in range(1, M+1):
        if tmp[l] < X:
            flg = 1
            break
    if tmp[0] != 0 and not flg:   
        ans = min(ans, tmp[0])    

print(ans if ans != float("inf") else -1)

Measured memory_bytes: 68524
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0
for i in range(N):
    tmp_l = min(A[i], B[i])
    ans += tmp_l
    A[i] -= tmp_l
    B[i] -= tmp_l
    tmp_r = min(A[i + 1], B[i])
    ans += tmp_r
    A[i + 1] -= tmp_r
    B[i] -= tmp_r
print(ans)


Measured memory_bytes: 24036
a,b,c=map(int,input().split())
if a==1 and c==0:
    if b==0:
        print("Close")
    else:
        print("Open")
elif a==0:
    if b==1 and c==0:
        print("Close")
    elif b==0 and c==1:
        print("Open")
    else:
        print("Close")


Measured memory_bytes: 5596
UP = 'U'
DOWN = 'D'
LEFT = 'L'
RIGHT = 'R'

START_CELL = 'S'
TARGET_CELL = 'T'

def main():
    sx, sy, tx, ty = list(map(int, input().split()))
    moves = [
        {'dir': RIGHT, 'dis': tx - sx},
        {'dir': UP, 'dis': ty - sy},

        {'dir': LEFT, 'dis': tx - sx},
        {'dir': DOWN, 'dis': ty - sy},

        {'dir': DOWN, 'dis': 1},
        {'dir': RIGHT, 'dis': tx - sx + 1},
        {'dir': UP, 'dis': ty - sy + 1},
        {'dir': LEFT, 'dis': 1},

        {'dir': UP, 'dis': 1},
        {'dir': LEFT, 'dis': tx - sx + 1},
        {'dir': DOWN, 'dis': ty - sy + 1},
        {'dir': RIGHT, 'dis': 1},
    ]

    for move in moves:
        print(move['dir'] * move['dis'], end='')


main()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
ll lank(ll a){//1下げする桁数を調べる
  ll cnt=0, tmp=a, b=tmp%10;
  tmp/=10; cnt++;
  ll c=tmp%10;
  while(b==0 || b>c+1 || b<c){
    b=c; tmp/=10; cnt++;
    if(tmp==0) break;
    c=tmp%10;
  }
  return cnt;
}

int main(){
  ll K; cin>>K;
  if(K<=9){
    cout<<K<<endl;
    return 0;
  }
  ll a=3234566667, n=100000-K;
  for(int i=0; i<n; i++){
    ll cnt=lank(a), tmp=cnt;
    while(tmp>1){
      a/=10; tmp--;
    }
    a--;
    if(a==0) a=9,cnt--;
    while(cnt>1){
      ll b=min(a%10+1,9LL);
      a=a*10+b; cnt--;      
    }
  }
  cout<<a<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
const double pi = 3.141592653589793238462643383279;
 
 
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
 
 
//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 SQ(a) ((a)*(a))
#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 SORT(c) sort((c).begin(),(c).end())
 
 
//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
 
 
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
 
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const double EPS = 1E-10;
 
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)


//ここから編集

 
ll modPow(ll x, ll n, ll mod = MOD){
    ll res = 1;
    while(n){
        if(n&1) res = (res * x)%mod;
 
        res %= mod;
        x = x * x %mod;
        n >>= 1;
    }
    return res;
}
 
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  string s; cin >> s;
  string t="";
  for(int i=0; i<s.size(); i++) t += 'x';
  cout << t << endl;
  return 0;
}

Measured memory_bytes: 3640
#include<iostream>
#define MAX_N 10001

using namespace std;

int data[MAX_N];

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  int ans = 0;
  for(int i=a;i <= b;i++){
    if(c % i == 0) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3132
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a=n/1000;
		int b=n%1000;
		int c=0;
		if(b==0) {
			System.out.println(c);
		}
		else {
			System.out.println(1000-b);
		}
	}
	
}

Measured memory_bytes: 35700
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
 
int main() {
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  
  while(1){
    c -= b;
    if(c<=0){
      cout << "Yes" << endl;
      return 0;
    }
    a -= d;
    if(a<=0){
      cout << "No" << endl;
      return 0;
    }
  }
  
}

Measured memory_bytes: 3636
#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
	int n,res;
	cin >> n;
	
	int count = 1;
	while(true){
		if(count * count > n)break;
		res = count * count;
		count++;
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
from math import factorial as fact
import math
import fractions
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

def combinations(n,r):
	return list(itertools.combinations(n,r))

def all_sets(num_list):
	subsets=[]
	for i in range(2,len(num_list) + 1):
		for c in combinations(num_list, i):
			subsets.append(c) 
	return subsets

#公約数の列挙
def ch(x1):
	cf=[]
	for i in range(2,math.sqrt(x1)+1):
		if x1 % i==0:
			cf.append(i)
	return cf

def CountOneRoots(x,y):
	#x:縦，y:横
	return fact(x+y)/fact(x)/fact(y)

# 素因数分解
def factorization(n):
	tmp=n
	count=0
	for i in range(2,int(n**0.5)+2):
		if tmp%i==0:
			cnt=0
			while tmp%i==0:
				cnt+=1
				tmp//=i
			count+=1
	if tmp!=1:
		count+=1

	return count
			


A,B=input2()
gcd=fractions.gcd(A,B)
# ch=ch(gcd)
print(factorization(int(gcd))+1)







Measured memory_bytes: 14388
n,m,x = map(int,input().split())
c = []
a = []
for i in range(n):
    a1 = [int(i) for i in input().split()]
    c1 = a1.pop(0)
    a.append(a1)
    c.append(c1)
ans = []
for bit in range(1<<n):
    d = [0]*m
    price = 0
    for i in range(n):
        mask = 1<<i
        if mask&bit:
            price += c[i]
            for j in range(m):
                d[j] +=  a[i][j]
    flag = True
    for j in d:
        if j<x:
            flag = False
    if flag:
        ans.append(price)
print(min(ans) if len(ans)>0 else -1)

Measured memory_bytes: 68288
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>

using namespace std;

int main()
{
  int N;
  cin >> N;
  vector<int> D(N);
  for_each(D.begin(), D.end(), [](int& e) { cin >> e; });
  for_each(D.begin(), D.end(), [](int& e) {
      int c;
      cin >> c;
      e -= c;
  });
  vector<int> v; 
  copy_if(D.begin(), D.end(), back_inserter(v), [](int& e) { return e > 0; });
  cout << accumulate(v.begin(), v.end(), 0) << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int r,g,b;

    scanf("%d %d %d",&r,&g,&b);
    r=(r*100)+(g*10)+b;
    if(r%4==0){
        printf("YES");

    }
    else {
        printf("NO");
    }
    return 0;

}


Measured memory_bytes: 128
n = int(input())
X = list(map(int, input().split()))
X_sort = sorted(X)
xm1 = X_sort[n//2-1]
xm2 = X_sort[n//2]
xm = (xm1+xm2)/2
for i in range(n):
    if X[i]<xm:
        print(xm2)
    else:
        print(xm1)

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

int main() {
	int a, b, k;
	cin >> a >> b >> k;

	if (b - a + 1 > k * 2) {
		for (int i = a; i < a + k; i++) {
			cout << i << endl;
		}
		for (int i = b - k + 1; i <= b; i++) {
			cout << i << endl;
		}
	}
	else {
		for (int i = a; i <= b; i++) {
			cout << i << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
# import bisect
# from collections import Counter, deque
# import copy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

def resolve():
    N,M=map(int,input().split())
    P=[]
    city_count=[0]*N
    city_end=[1]*N
    for i in range(M):
        p,y=map(int,input().split())
        city_count[p-1]+=1
        P.append([p,y])

    P1 = sorted(P, key=lambda x: x[1])
    P1=sorted(P1)
    for i in P1:
        i.append(city_end[i[0]-1])
        city_end[i[0] - 1]+=1


    for i in P:
        print(str(i[0]).zfill(6)+str(i[2]).zfill(6))


    #P = dict(sorted(P.items()))

resolve()

Measured memory_bytes: 78296
#include <bits/stdc++.h>
#define N 200005
#define ll long long
using namespace std;
ifstream in("in.txt");
int main(){
    ll n, k,p,mx=(1<<30),f;
    cin>>k>>n>>f;
    p=f;
    for(ll i=2; i<=n; ++i){
        ll x;
        cin>>x;
        mx=min(k-x+p, mx);
        p=x;
    }
    cout<<min(mx, p-f);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
    string s;
    cin >> s;
    int h=0;
    int g=s.size()/2;
    for(int i=0;i<g;i++){
        if(s.at(i)!=s.at(s.size()-1-i))h++;
    }
    cout << h << endl;
    return 0;
}

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

int main(){
    int N;
    cin >> N;
    map<string, int > num;
    int ctr = 0;
    for(int i = 0; i < N;i++){
        string S;
        cin >> S;
            num[S] += 1;
    }
    cout << num.size() << endl;

    return 0;
}

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

int main(){
  int N;
  cin >> N;
  
  vector<int> p(N);
  for(int i=0; i<N; i++){
    cin >> p.at(i);
  }
  
  sort(p.begin(), p.end());
  
  int ans=0;
  for(int i=0; i<N; i++){
    ans += p.at(i);
  }
  
  ans -= p.at(N-1)/2;
  
  cout << ans << endl;
}

Measured memory_bytes: 256