akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#include <functional>
//#include <numeric>
#pragma warning(disable:4996) 
 
typedef long long ll;
typedef unsigned long long ull;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF  9223300000000000000
#define LINF2 1223300000000000000
#define INF 2140000000
//const long long MOD = 1000000007;
const long long MOD = 998244353;

using namespace std;

char str[105];
void solve()
{
    int K;
    scanf("%d%s", &K, str);
    int n = strlen(str);
    if (n <= K) {
        printf("%s\n", str);
    }
    else {
        str[K] = '.';
        str[K + 1] = '.';
        str[K + 2] = '.';
        str[K + 3] = '\0';
        printf("%s\n", str);
    }

    return;
}


int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T;
    scanf("%d", &T);
    int t;
    for(t=0; t<T; t++) {
        //printf("Case #%d: ", t+1);
        solve();
    }
#endif
    return 0;
}


Measured memory_bytes: 1644
from itertools import product

N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for _ in range(N)]

ans = 10**10
for l in product([False, True], repeat=N):
    for i in range(M):
        if sum(ca[i+1] for j, ca in enumerate(CA) if l[j]) < X:
            break
    else:
        s = sum(ca[0] for j, ca in enumerate(CA) if l[j])
        ans = min(ans, s)
print(-1 if ans == 10**10 else ans)


Measured memory_bytes: 70564
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int long long
#define inf 1000000007
#define LINF 100000000000000007LL
#define ll long long
using namespace std;
int dp[10][1000];
vector<int> nex[10];
int dfs(int pos,int vis){
	if( dp[pos][vis] != -1 )return dp[pos][vis];
	int res = 0;
	for(int i=0;i<nex[pos].size();i++){
		int nx = nex[pos][i];
		if( (vis>>(nx-1))%2 == 1){
			res += dfs( nx, vis-(1<<(nx-1)) );
		}
	}
	dp[pos][vis]=res;
	return res;
}
signed main(){
	int n,m;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int x,y;
		cin>>x>>y;
		nex[x].pb(y);
		nex[y].pb(x);
	}
	for(int i=0;i<9;i++){
		for(int j=0;j<999;j++){
			dp[i][j] = -1;
		}
	}
	dp[1][0]=1;
	int ans = 0;
	int mx = (1<<n)-1;
	for(int i=2;i<=n;i++){
		ans += dfs(i,mx-(1<<(i-1)));
	}
	cout<<ans<<endl;
	return 0;
}

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

using llong = long long;

static const int IINF = 1 << 30;
static const long long LINF = 1LL << 60;
static const long long MOD = 1.0e+9 + 7;

template <typename T> std::vector<T> vectors(std::size_t n, T val) {
  return std::vector<T>(n, val);
}

template <typename T, typename... Args>
auto vectors(std::size_t n, Args... args) {
  return std::vector<decltype(vectors<T>(args...))>(n, vectors<T>(args...));
}

template <class T> inline bool chmax(T &a, const T &b) {
  return (a < b) ? a = b, true : false;
}

template <class T> inline bool chmin(T &a, const T &b) {
  return (a > b) ? a = b, true : false;
}

template <class T> inline void chadd(T &a, const T &b) { a += b, a &= MOD; }

int main() {
  // Input
  int numArray;
  std::cin >> numArray;
  assert(1 <= numArray and numArray <= 3000);
  std::vector<llong> gain(1 + numArray);
  for (int i = 1; i <= numArray; ++i) {
    std::cin >> gain[i];
    assert(1 <= gain[i] and gain[i] <= 1.0e+9);
  }

  // Initialization
  auto dp = vectors<llong>(1 + numArray, 1 + numArray, -LINF);

  // Initial condition
  for (int i = 1; i <= numArray; ++i)
    dp[i][i] = gain[i];

  // DP main
  for (int k = 0; k < numArray; ++k) {
    for (int i = 1; i <= numArray - k; ++i) {
      int j = i + k;
      assert(1 <= i and i <= j and j <= numArray);
      if (j + 1 <= numArray)
        chmax(dp[i][j + 1], gain[j + 1] - dp[i][j]);
      if (i - 1 >= 1)
        chmax(dp[i - 1][j], gain[i - 1] - dp[i][j]);
    }
  }

  // Output
  std::cout << dp[1][numArray] << std::endl;

  return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<ll> Vec;
typedef vector<Vec> DVec;
typedef vector<DVec> TVec;
typedef priority_queue<P, vector<P>, greater<P>> PQ;

#define fi                first
#define se                second
#define pb                push_back
#define INF               LLONG_MAX/3
#define MOD               1000000007
#define bcnt              __builtin_popcount
#define all(x)            (x).begin(),(x).end()
#define srt(x)            sort(all(x))
#define rvs(x)            reverse(all(x))
#define uni(x)            x.erase(unique(all(x)),x.end())
#define ub(x,y)           (upper_bound(all(x),y)-x.begin())
#define lb(x,y)           (lower_bound(all(x),y)-x.begin())
#define rep(i,n)          repl(i,0,n-1)
#define mkp(x,y)          make_pair(x,y)
#define mmax(x,y)         (x>y?x:y)
#define mmin(x,y)         (x<y?x:y)
#define maxch(x,y)        x=mmax(x,y)
#define minch(x,y)        x=mmin(x,y)
#define exist(x,y)        (find(all(x),y)!=x.end())
#define each(itr,v)       for(auto itr:v)
#define repl(i,a,b)       for(ll i=(ll)(a);i<=(ll)(b);i++)
#define dvec(n1,n2,i)     DVec(n1,Vec(n2,i))
#define tvec(n1,n2,n3,i)  TVec(n1,dvec(n2,n3,i))

ll n,m,w,h,r,l;
Vec v(100005), x(100005);
Vec rv(100005), lv(100005);
Vec frv(100005), dnum(100005);
ll mv=0,c,suma=0,sumb=0;

int main(){
  cin.sync_with_stdio(false);
  cin >> n >> c;
  x[0]=0;
  x[n+1]=c;
  repl(i,1,n) cin >> x[i] >> v[i];
  rv[0]=0;
  lv[0]=0;
  frv[0]=0;
  dnum[0]=0;
  repl(i,1,n){
    suma+=v[i];
    sumb+=v[n+1-i];
    rv[i]=suma-x[i];
    if(rv[i]>frv[i-1]){
      frv[i]=rv[i];
      dnum[i]=i;
    }
    else{
      frv[i]=frv[i-1];
      dnum[i]=dnum[i-1];
    }
    lv[i]=max(lv[i-1],sumb-c+x[n+1-i]);
  }
  rep(i,n+1)mv=mmax(mv,lv[i]+frv[n-i]-mmin(c-x[n+1-i],x[dnum[n-i]]));
  cout << mv << endl;

  return 0;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,wt;
    cin>>n>>wt;
    ll w[n],v[n];
    for(int i=0;i<n;i++)
    {
        cin>>w[i]>>v[i];
    }
    ll dp[n+1][wt+1];
    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=wt;j++)
        {
            if(i==0 || j==0)
            {
                dp[i][j]=0;
            }
            else if(w[i-1]<=j)
            {
                dp[i][j]=max(v[i-1]+dp[i-1][j-w[i-1]],dp[i-1][j]);
            }
            else
            {
                dp[i][j]=dp[i-1][j];
            }
        }
    }
    cout<<dp[n][wt];
    /*for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=wt;j++)
        {
            cout<<dp[i][j]<<"\t";
        }
        cout<<endl;
    }*/
    return 0;
}









Measured memory_bytes: 79232
#include <stdio.h>

char S[200100];

int main()
{
	int b = 0; long long ans = 0;
	scanf ("%s",S);
	for (int i=0;S[i];i++){
		if (S[i] == 'B') b++;
		else ans += b;
	}
	printf ("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>

using namespace std;

int main()
{
  vector<int> distance(5);
  int k;
  for (int i = 0; i < 5; ++i) cin >> distance[i];
  cin >> k;

  for (int i = 0; i < 5; ++i)
  {
    if (k < distance[i]-distance[0])
    {
      cout << ":(" << endl;
      return 0;
    }
  }
  cout << "Yay!" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <fstream>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

ll gcd(ll a, ll b) {
    while (b) {
        ll c = a % b;
        a = b;
        b = c;
    }
    return a;
}

ll po(ll a, ll b) {
    ll c = 1;
    while (b) {
        if (b % 2) c = c * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return c;
}

ll f[2000006], g[2000006];

void comb() {
    f[0] = 1;
    for (int i = 1; i <= 2000000; i++) f[i] = f[i - 1] * i % mod;
    g[2000000] = 407182070;
    for (int i = 1999999; i >= 0; i--) g[i] = g[i + 1] * (i + 1) % mod;
}

int p[200005];

int root(int x) {return p[x] < 0 ? x : p[x] = root(p[x]);}

void mer(int x, int y) {
    if ((x = root(x)) == (y = root(y))) return;
    if (p[x] > p[y]) swap(x, y);
    p[x] += p[y];
    p[y] = x;
}

int main() {
    ios::sync_with_stdio(false);
    int n, a[128] = {}, z = 0;
    cin >> n;
    for (int i = 1; i < n; i++) cin >> a[i];
    z = a[1] + a[n - 1];
    for (int i = 1; i < n; i++) z += min(a[i], a[i + 1]);
    cout << z;
}


Measured memory_bytes: 3660
#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, m; cin >> n >> m;
  vector<vector<int>> s(m);
  rep(i, m)
  {
    int k; cin >> k;
    s[i].resize(k);
    rep(j, k)
    {
      cin >> s[i][j];
      s[i][j]--;
    }
  }
  vector<int> p(m);
  rep(i, m)
    cin >> p[i];
  int ans = 0;
  rep(i, 1<<n)
  {
    bool all = true;
    rep(j, m)
    {
      int count = 0;
      for (int k : s[j])
        if ((i>>k)&1)
          count++;
      if (count % 2 != p[j])
      {
        all = false;
        break;
      }
    }
    if (all)
      ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>

using namespace std;

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

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

  int ans = ceil( static_cast<float>( N - 1 ) / ( K - 1 ) );

  cout << ans << endl;

  return 0;
}


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

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

int w, h;
char tile[20][20];
bool vis[20][20];
int dd[] = {-1, 0, 1, 0, -1};

bool range(int y, int x) {
  return 0 <= y && y < h && 0 <= x && x < w;
}

int dfs(int y, int x) {
  if (tile[y][x] == '#') return 0;
  // cout << y << " " << x << endl;
  vis[y][x] = true;
  int cnt = 1;
  rep(i, 4) {
    int ni = y + dd[i], nj = x + dd[i + 1];
    if(range(ni, nj) && tile[ni][nj] == '.' && !vis[ni][nj]) {
      cnt += dfs(ni, nj);
    }
  }
  return cnt;
}


int main(int argc, char const *argv[])
{
  while(cin >> w >> h, w | h) {
    int x, y;
    memset(vis, 0, sizeof(vis));
    rep(i, h)rep(j, w) {
      cin >> tile[i][j];
      if(tile[i][j] == '@') x = j, y = i;
    }

    cout << dfs(y, x) <<endl;

  }
  return 0;
}

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

ll dp[100100];
bool vis[100100];
ll n, k, h[100100];

ll func( int pos ) {
    if (pos == n) return 0;
    if (vis[pos]) return dp[pos];
    vis[pos] = 1;

    ll res = 2e9;
    for (int j = pos + 1; j <= n && j <= pos + k; ++j) {
        res = min(
            res,
            abs(h[pos] - h[j]) + func(j)
        );
    }   

    return dp[pos] = res;
}


int main() {
    ios::sync_with_stdio(false);
    cin >> n >> k;
    for (int i = 1; i <= n; ++i) cin >> h[i];

    cout << func( 1 ) << endl;
    return 0;
}


Measured memory_bytes: 6656
N, A, B, K = map(int, input().split())
maxAB = max(A, B)
minAB = min(A, B)
ans = 0


def cmb(n, r):
    if (r < 0 or r > n):
        return 0
    r = min(r, n-r)
    return fac[n] * finv[r] * finv[n-r] % mod


mod = 998244353  # 問題によって変える、ここは素数でないとうまく動かない
N_cmb = 0
N_cmb += N  # 入力の制約によって変えるところ、nCrの計算で欲しいnの最大値
fac = [1, 1]  # 階乗テーブル
finv = [1, 1]  # 逆元テーブル
inverse = [0, 1]  # 逆元テーブル計算用テーブル

for ZZZ in range(2, N_cmb + 1):
    fac.append((fac[-1] * ZZZ) % mod)
    inverse.append(mod-inverse[mod % ZZZ]*(mod//ZZZ) % mod)
    finv.append((finv[-1] * inverse[-1]) % mod)

for i in range(min(N+1, K//maxAB+1)):
    j = (K - maxAB * i) // minAB
    if (K - maxAB * i) % minAB == 0 and 0 <= j <= N:
        #print(i, j)
        ans += cmb(N, i) * cmb(N, j) % mod
        ans %= mod
print(ans)


Measured memory_bytes: 39144
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>

using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
int table[100][1000];
int x,y,s;
int ans;
int ss(int num,int tax)
{
	int k=num*(100+tax);
	return k/100;
}
int main()
{
	rep2(i,1,100)
	{
		rep2(j,1,1000)
		{
			if(ss(j,i)<1000)table[i][ss(j,i)]=j;
		}
	}
	while(1)
	{
		ans=0;
		cin>>x>>y>>s;
		if(x==0)break;
		rep2(i,1,s)
		{
			ans=max(ans,ss(table[x][i],y)+ss(table[x][s-i],y));
		}
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 1548
#include<bits/stdc++.h>
using namespace std;  
int main(){
	int n;
	cin>>n;
	unordered_map<int,int> seen;
	int *a=new int[n-1];
	for(int i=0;i<n-1;i++)
		cin>>a[i];
	for(int i=0;i<n-1;i++){
		seen[a[i]]+=1;
	}
	for(int i=1;i<=n;i++)
		cout<<seen[i]<<endl;
		
	return 0;
}


Measured memory_bytes: 12220
#include <bits/stdc++.h>
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) {if(a<b) a=b;}
#define chmin(a, b) {if(a>b) a=b;}
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;





int main(void) {
  ll N;
  cin >> N;
  ll a[MAX], b[MAX], c[MAX];
  ll i, j;
  ll sa=0, sb=0;
  
  for(i=0; i<N; i++) cin >> a[i];
  for(i=0; i<N; i++) cin >> b[i];
  
  for(i=0; i<N; i++) c[i]=a[i]-b[i];
  sort(c, c+N);
  
  ll s=0;
  ll ans=0;
  for(i=0; i<N; i++) {
    if(c[i]>=0) break;
    s+=c[i];
    ans++;
  }
  
  for(i=N-1; i>=0; i--) {
    if(s>=0) {
      pt(ans);
      return 0;
    }
    
    s+=c[i];
    ans++;
  }
  
  pt(-1);
  
}





Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>

int main() {
	int n, max_weight; std::cin >> n >> max_weight;
	std::vector<long long int> memo(1000 * n + 1, LLONG_MAX);
	memo[0] = 0;
	int max_value = 0;
	for (auto i = 0; i < n; ++i) {
		int w, v; std::cin >> w >> v;
		for (int j = memo.size() - v; j >= 0; --j) if (memo[j] <= max_weight - w) {
			memo[j + v] = std::min(memo[j + v], memo[j] + w);
			max_value = std::max(max_value, j + v);
		}
	}
	std::cout << max_value << std::endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
#define mod 1000000007
 
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
 
int lcm(int a, int b) { return a * b / gcd(a, b); }
 
int main(){
    ll n, m;
    cin >> n >> m;
    vector<ll> a(n);
    
    for(ll i = 0; i < m; i++){
        ll k = 0; 
        cin >> k;
        for(ll j = 0; j < k; j++){
            ll s;
            cin >> s;
            s--;
            a[s] |= 1 << i; 
        }
    }

    ll p = 0;
    for(ll i = 0; i < m; i++){
        int x;
        cin >> x;
        p |= x << i;
    }

    ll ans = 0;
    for(ll s = 0; s < (1 << n); s++){
        ll t = 0;
        for(ll i = 0; i < n; i++){
            if(s >> i & 1){
                t ^= a[i];
            }
        }
        if(t == p){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const int INF = 1e9;
const int EPS = 1e-9; 
const int SEARCH_MAX = 6e3;

int main() {
  double L;
  cin >> L;
  double x, y, z, V;
  
  x = L/3.0;
  y = L/3.0;
  z = L/3.0; 
  V = x * y * z;
  printf("%.12f\n",V);
}

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

using namespace std;
using ll = long long;


int N, K;

int solve(int x) {
    int cnt = 1;
    while (x * 2 < K) {
        x *= 2;
        ++cnt;
    }
    return cnt;
}

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

    double ans = N >= K ? double(N - K + 1) / N : 0;
    for (int i = 1; i <= min(K - 1, N); ++i) {
        int score = i;
        double p = 1.0 / N;
        while(score < K){
            score *= 2;
            p /= 2;
        }
        ans += p;
    }
    printf("%.10f\n", ans);
}


Measured memory_bytes: 256
N,X = [int(x) for x in input().split()]
L = [int(x) for x in input().split()]
cnt = 0
x = 0
for ind,i in enumerate(L):
    cnt+=1
    x+=i
    if(x>X):
        break
    if(ind==N-1):
        cnt+=1
print(cnt)


Measured memory_bytes: 2940
def main():
    N = int(input())
    d = [0] * 100
    
    for i in range(N+1):
        s = str(i)
        d[int(s[0])*10+int(s[-1])] += 1
    
    ans = 0
    for i in range(1,10):
        for j in range(1,10):
            ans += d[i*10+j] *d[j*10+i]

    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 67900
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<iomanip>
#include <math.h>
using namespace std;
int main(){
    vector<long long int>a(200000);
    long long int n,c=-1,ans=0;
    cin>>n;
    for(long long int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a.begin(),a.end(),greater<>());
    for(long long int i=0;i<n;i++){
        if(a[i]!=a[i+1]){
            if(a[i]>i-c){
                ans+=(i-c);
            }
            else{
                ans+=(i-c-a[i]);
            }
            c=i;
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

int main()
{
  long long goukei = 0;
  int data[10000];
  int min = 0,max = 0;
  int n;
  
  cin >> n;

  for(int i = 0 ; i < n ; i++){
    cin >> data[i];
    goukei += data[i];
  }
      max = data[0];
      min = data[0];

  for(int k = 0;k < n;k++)
    {

      if(max < data[k]){
	max = data[k];
      }
      if(min > data[k]){
	 min = data[k];
      }
    }
  cout << min << " " << max << " " << goukei << endl;
}



Measured memory_bytes: 3136
#pragma GCC optimize ("O2")
#include<bits/stdc++.h>
#include <queue>
#include <cstring>

#define mp make_pair
#define pb push_back
#define p push

#define FOR(a, c) for(int a = 0;a<c;a++)
#define ll long long int

#define getI(a) scanf("%d",&a)
#define getII(a, b) scanf("%d%d",&a,&b)
#define getIII(a, b, c) scanf("%d%d%d",&a,&b,&c)
#define getL(a) scanf("%lld",&a)
#define getLL(a, b) scanf("%lld%lld",&a,&b)
#define getLLL(a, b, c) scanf("%lld%lld%lld",&a,&b,&c)
#define BEND(c) (c).begin(),(c).end()
#define BEND2(c) (c).rbegin(),(c).rend()
#define fi first
#define se second
#define pi 3.1415926535897932384626
#define getS(a) scanf("%s",a)
#define pfi(a) printf("%d",a);
#define pfii(a, b) printf("%d%d",a,b);
#define pfl(a) printf("%lld",a);
#define pfll(a, b) printf("%lld%lld",a,b);
#define pfd(a) printf("%lf",a);
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);

#define sag (sol|1)
#define sol (root<<1)
#define ort (bas+son)/2
#define SIZE  ( int)(1e9 + 7)
#define MAXN (ll) (2*(1e5+5))
#define K 25
#define mylog(n) (int)(log(n))

using namespace std;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector <vector<int>> vvi;
typedef vector<long long> vl;
typedef vector <pair<int, int>> vpi;
typedef vector <pair<long long, long long>> vpl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector <vi> graph;






int main (){
    IOS;
    char c;
    cin >>c;
    int a = c;
    a++;
    c = a;
    cout << c;

    return 0;
}

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

using namespace std;

int main(){
  int ans=0;
  string S; cin>>S;
  int num=0;
  for(int i=0;i<S.size();i++){
    if((S[i]=='A'||S[i]=='C'||S[i]=='G'||S[i]=='T')&&(i==S.size()-1)){
      if(i+1-num>=ans) ans=i+1-num;
    } 
    if((S[i]!='A'&&S[i]!='C'&&S[i]!='G'&&S[i]!='T')){
      if(i-num>=ans)ans=i-num;
      num=i+1;
    }
  }

  cout<<ans<<endl;

  return 0;
}


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

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef long double ld;

const ll mod = (ll)1e9 + 7;
const ll mxN = 200200;



void solve(){
	string s,t;
	cin>>s>>t;
	s=s+s;
	puts(s.find(t)!=string::npos?"Yes":"No");


}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(20);
	cout << fixed;

	//ll t;cin>>t;while(t--)
	solve();

}


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

int main() {
  int N,A,B;
    cin >> N >> A >> B;
  
  if((N * A) >= B){
    cout << B << endl;
  }
  
  if((N * A) < B){
    cout << N * A << endl;
  }
}


Measured memory_bytes: 3628
#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>

int main(){
	double a, b, c, d, e, f, x, y, det;
	while (scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){
		det = b * d - a * e;
		y = (c * d - a * f) / det;
		x = (c - b * y) / a;
		printf("%.3f %.3f\n", x, y);
	}
	return 0;
}

Measured memory_bytes: 1080
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define rREP(i,m,n) for(ll i = (m); i >= (n); i--)
#define ALL(c) (c).begin(), (c).end()
#define print(x) cout << (x) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int h,a;
    cin >> h >> a;
    if (h%a==0)
    {
        cout << h/a << endl;
    }
    else
    cout << h/a +1 << endl;
    
    
}




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

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	int c4 = 0, nc2 = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
			if (a[i] % 4 == 0)
				c4++;
			if (a[i] % 2 != 0)
				nc2++;
		}
		if (n % 2 == 1)
			cout << (c4 + 1 < nc2 ? "No" : "Yes") << endl;
		else
			cout << (c4 < nc2 ? "No" : "Yes") << endl;
	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <string>
using namespace std; typedef long long ll; const int INF=100; typedef pair<int,int> P;
const int ld=10;

int main() {
  string s; cin>>s; int n=s.size(), an=n;
  for(char i='a';i<='z';i++) {
    int sm=0;
    string s2=s;
    bool in=false;
    for(char ch:s2) {
      if (ch==i) in=true;
    }
    if (!in) continue;
    while(true) {
      bool end=true;
      for(int j=0;j<n-sm;j++) {
        if (s2[j] != i) {end=false; break;}
      }
      if (end) break;
      for(int j=0;j<n-sm-1;j++) {
        if (s2[j]==i || s2[j+1]==i) s2[j]=i;
      }
      //cout<<s2<<endl;
      sm++;
    }
    //cout<<i<<" "<<sm<<endl;
    an=min(an,sm);
  }
  cout<<an<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>

#define Sort(a) sort(a.begin(), a.end())
#define Reverse(a) reverse(a.begin(), a.end())

#define fs first
#define sc second

using namespace std;

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

int main()
{
  ll H, W;

  cin >> H >> W;

  string str[H];
  for (int i = 0; i < H; i++)
  {
    cin >> str[i];
  } // i

  int markx[W];
  int marky[H];
  for (int i = 0; i < H; i++)
  {
    bool comp = true;
    for (int j = 0; j < W; j++)
    {
      if (str[i][j] == '#')
      {
        comp = false;
        break;
      }
    }
    if (comp)
      marky[i] = 1;
    else
      marky[i] = 0;
  } // i

  for (int j = 0; j < W; j++)
  {
    bool comp = true;
    for (int i = 0; i < H; i++)
    {
      if (str[i][j] == '#')
      {
        comp = false;
        break;
      }
    }
    if (comp)
      markx[j] = 1;
    else
      markx[j] = 0;
  } // i

  for (int i = 0; i < H; i++)
  {
    if (marky[i] == 1)
      continue;
    for (int j = 0; j < W; j++)
    {
      if (markx[j] == 1)
        continue;
      cout << str[i][j];
    } // i
    cout << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>

using namespace std;

int main()
{
    string s;
    int gcnt = 0, pcnt = 0;
    int ans = 0;

    cin >> s;

    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'p') {
            pcnt++;
        }
    }

    cout << ((int)s.size()/2)-pcnt << endl;
}


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

int main(void) {
    int N;
    cin>>N;
    for (int i = 0; i < N; i++) {
        int A;
        cin>>A;
        if (A % 2 == 0) {
            if (A % 3 != 0 && A % 5 != 0) {
                cout << "DENIED" << endl;
                return 0;
            }
        }
    }
    cout << "APPROVED" << endl;
    return 0;
}

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

using namespace std;

#define REP(i,n) for (int i=0;i<(n);i++)
#define PB push_back
#define CLR(a) memset(a,0,sizeof a)
#define VI vector<int>
#define INT(x) int x; scanf("%d",&x);
#define SZ(a) ((int)(a.size()))

#define MAX_V 100000

int V;
VI graph[MAX_V];
bool vis[MAX_V];
VI mlist;
int indeg[MAX_V];

void topologicalsort() {
  CLR(indeg);
  REP(i, V) {
    REP (j, SZ(graph[i])) {
      int p = graph[i][j];
      indeg[p]++;
    }
  }

  REP(i, V) {
    if (indeg[i] == 0 && !vis[i]) {
      queue<int> que;
      que.push(i);
      mlist.PB(i);
      vis[i] = true;
      while (!que.empty()) {
	int p = que.front(); que.pop();

	REP(j , SZ(graph[p])) {
	  int np = graph[p][j];
	  indeg[np]--;
	  if (vis[np]) continue;
	  if (indeg[np] == 0) {
	    vis[np] = true;
	    que.push(np);
	    mlist.PB(np);
	  }
	}
      }
    }
  }
}

int main() {
  cin >> V;
  INT(E);
  REP(i, E) {
    INT(s); INT(t);
    graph[s].PB(t);
  }
  topologicalsort();

  REP(i, SZ(mlist)) {
    cout << mlist[i] << endl;
  }
}

Measured memory_bytes: 6424
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>
#include <bitset>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

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

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

class mint {
public:
    long long x;
    mint(long long x=0) : x((x%MOD+MOD)%MOD) {}
    //mint operator-() const{ return mint(-x);}
    mint operator-() const {
      return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += MOD-a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(MOD-2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }

};

vector<P> prime_factorize(ll N){
  vector<P> res;
  for (ll a = 2; a * a <= N; ++a){
    if (N % a != 0) continue;
    ll ex = 0; //指数
    while (N % a == 0){
      ++ex;
      N /= a;
    }
    res.push_back({a, ex});
  }
  if (N != 1) res.push_back({N, 1});
  return res;
}

int main(){
  int N; cin >> N;
  map<ll, ll> mp;
  for (int i = 2; i <= N; ++i){
    vector<P> prime = prime_factorize(i);
    for (auto p: prime){
      mp[p.first] += p.second;
    }
  }
  mint ans = 1;
  for (auto p: mp){
    ans *= p.second + 1;
  }
  cout << ans.x << endl;
}


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

int main() {
  int S,S1,S2,S3;
  cin >> S;
  S1=S/100;
  S2=(S-S1*100)/10;
  S3=S-S1*100-S2*10;
  cout << S1+S2+S3 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define RFOR(i,a,b) for(int i=(b-1); i>=(a); i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pb push_back
using ll = long long;
using D = double;
using LD = long double;
using P = pair<int, int>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
    int n,m,q; cin >> n >> m >> q;
    vector<int> a(q), b(q), c(q), d(q);
    rep(i,q){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        a[i]--; b[i]--;
    }
    vector<int> v(n, 1);
    int ans = 0;
    rep(i,q){
        if(v[b[i]] - v[a[i]] == c[i]) ans += d[i];
    }
    auto next = [&]{
        if(v[0] == m) return false;
        int num = 0,counter = n;
        rrep(i,n){
            if(v[i] < m) {
                num = v[i] + 1;
                counter = i;
                break;
            }
        }
        FOR(i,counter, n){
            v[i] = num;
        }
        return true;
    };

    while(next()){
        int tmp = 0;
        rep(i,q){
            if(v[b[i]] - v[a[i]] == c[i]) tmp += d[i];
        }
        chmax(ans, tmp);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int lli;

int main(){
	int n,m;
	cin >> n >> m;
	vector<int> ans(n, m);
	for(int i=0; i<n; i++){
		if(n%2 == 0){
			if(i <= n/2) ans[i] = 0;
		}else{
			if(i < n/2 +1) ans[i] = 0;
		}
	}
	for(int i=0; i<n-1; i++) cout << ans[i] << " ";
	cout << ans[n-1] << endl;
    return 0;
}


Measured memory_bytes: 3080
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main()
{
int x;
cin>>x;
if(x<1200) cout<<"ABC"<<endl;
else cout<<"ARC"<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		double denom = 0;
		int n = scanner.nextInt();
		for (int i = 0, a; i < n; i++) {
			a = scanner.nextInt();
			denom += (double) 1 / a;
		}
		System.out.println(1 / denom);

	}
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

int main()
{
	boost;
	int n, m, k, i;
	cin >> n >> m >> k;
	int a[n], b[m];
	fo(i, 0, n)
	cin >> a[i];
	fo(i, 0, m)
	cin >> b[i];
	
	ll pre[m];
	pre[0] = b[0];
	fo(i, 1, m)
	pre[i] = pre[i - 1] + b[i];

	int ans = upper_bound(pre, pre + m, k) - pre;
	fo(i, 0, n) {
		k -= a[i];
		if(k < 0) break;
		int x = upper_bound(pre, pre + m, k) - pre;
		ans = max(ans, i + 1 + x);
	}
	cout << ans;
}



Measured memory_bytes: 6772
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <vector>
#include <string>
using namespace std;

#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)
#pragma GCC optimize("unroll-loops")

#define DEBUG(x) cout << ">> " << #x << ": " << x << endl;
#define _ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define f first
#define s second

const int MOD = 1000000007;
typedef long long ll;
typedef long double ld;

void setIO(string s) {
  freopen((s+".in").c_str(),"r",stdin);
  freopen((s+".out").c_str(),"w",stdout);
}

int main() { _
  int n, k; cin >> n >> k;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  int ans = 0;
  for (int i = 0; i <= min(n, k); i++) {
    for (int a = 0; a <= i; a++) {
      int b = i-a;
      int sum = 0;
      priority_queue<int> neg;
      for (int ok = 0; ok < a; ok++) {
        sum += v[ok];
        if (v[ok] < 0) neg.push(-v[ok]);
      }
      for (int ok = 0; ok < b; ok++) {
        sum += v[v.size()-ok-1];
        if (v[v.size()-ok-1] < 0) neg.push(-v[v.size()-ok-1]);
      }
      for (int rest = k-a-b; rest > 0; rest--) {
        if (neg.empty()) break;
        sum += neg.top();
        neg.pop();
      }
      ans = max(ans, sum);
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#define ll long long
#define MOD 1000000007
#define MAX 10000000
using namespace std;
ll dp[110][4][4][4];

int main(){
    string s,t;
    cin >> s >> t;
    int ans = 0;
    for(int i=0;i<3;i++){
        if(s[i] == t[i]) ans++;
    }
    cout << ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
  #define pb push_back
  #define f first
  #define s second

  using namespace std;

  #define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

  void err(istream_iterator<string> it) {}
  template<typename T, typename... Args>
  void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
  }

  int main(){
    string A,B;
    cin >> A >> B;

    if(A.size() >= B.size()){
      cout << "No\n";
      return 0;
    }

    for(int i = 0; i < A.size(); i++){
      if(A[i] != B[i]){
        cout << "No\n";
        return 0;
      }
    }

    cout << "Yes\n";
    return 0;
  }

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define repp(i,l,r)for(long long i=(l);i<(r);i++)
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define per(i,n) for (long long i = (n); i >= 0; --i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
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; }
//ミョ(-ω- ?)
int main() {
    ll n;
    cin >> n;
    vector<ll> a(n,0);
    map<ll,ll> m;
    rep(i,n){
        cin >> a[i];
        m[a[i]]++;
    }
    ll res = 0;
    for(auto a : m){
        if(a.first == a.second)continue;
        else if(a.first > a.second)res += a.second;
        else if(a.first < a.second)res += a.second - a.first;
    }
    cout << res << endl;
    return 0;
}

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

#define MAX 2000001
#define VMAX 10000

int main(){
  unsigned short *A, *B;
  int i, j;
  int C[VMAX+1];
  int n;

  scanf("%d", &n);

  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);

  /* your code */
  for(i=0;i<n;i++)scanf("%hu",&A[i+1]);


  for(i=0;i<=VMAX;i++)C[i] = 0;
  for(j=1;j<=n;j++) C[A[j]]++;
  for(i=1;i<=VMAX;i++)C[i] = C[i] + C[i-1];
  for(j=n;j>=1;j--){
    B[C[A[j]]] = A[j];
        C[A[j]]--;
  }

  for(i=1;i<n;i++)printf("%d ",B[i]);
  printf("%d\n",B[n]);


  return 0;
}



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

using namespace std;

int gcd(int x, int y) {
  return y == 0 ? x : gcd(y, x % y);
}

void Run() {
  int x;
  cin >> x;
  cout << 360 / gcd(360, x) << '\n';
}

int main() {
  srand(time(0));
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  Run();
  return 0;
}

Measured memory_bytes: 3588
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <regex>
#include <map>
#include <set>
#include <iomanip>

using namespace std;
using ll = long long;

int main() {
    ll N,K,Q;
    cin >> N >> K >> Q;
    
    ll A[100001];
    for(ll i=0;i<Q;i++){
        cin >> A[i];
    }
    
    int zougen[100001];
    for(ll i=0;i<Q;i++){
        zougen[A[i]-1]++;
    }
    for(ll i=0;i<N;i++){
        if(K-Q+zougen[i]>0){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,res=0;
  cin>>n;
  vector<int> p(n);
  for(int i=0;i<n;++i)cin>>p[i];
  map<int,int> m;
  for(int i=0;i<n;++i){
    if(p[i]==1)m[1]=1;
    else m[p[i]]=m[p[i]-1]+1;
    res=max(res,m[p[i]]);
  }
  cout<<n-res;
  return 0;
}

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

using namespace std;

int board[4][4];

bool inField(int x,int y){
  return (0 <= x && x < 4 && 0 <= y && y < 4);
}

int solve(int idx,int *x,int *y){
  if(idx == 8){ return 1; }
  int sx,sy;
  for(int i = 0 ; i < 4 ; i++){
    bool found = false;
    for(int j = 0 ; j < 4 ; j++){
      if(board[i][j] == -1){
        sx = j; sy = i;
        found = true;
        break;
      }
    }
    if(found){ break; }
  }
  int res = 0;
  for(int i = 0 ; i < 4 ; i++){
    int tx = sx+x[i],ty = sy+y[i];
    if(!inField(tx,ty) || board[ty][tx] != -1){
      continue;
    }
    board[sy][sx] = board[ty][tx] = idx;
    res += solve(idx+1,x,y);
    board[sy][sx] = board[ty][tx] = -1;
  }
  return res;
}

int main(){
  int x[4],y[4];
  while(cin >> x[0] >> y[0], x[0] < 4){
    for(int i = 1 ; i < 4 ; i++){
      cin >> x[i] >> y[i];
    }
    memset(board,-1,sizeof(board));
    cout << solve(0,x,y) << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    long long int a , b , x  ;
    cin >> a >> b >> x ;

    long long int an , bn ;
    an = a / x ; 
    if((a % x) != 0 ){
        an = an + 1 ;
    }
    bn = b / x ;
    cout << bn - an +1 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  string s;
  cin >> s;
  int a = 1;
  for(int i = 0; s[i] != 'A'; i++){
    a++;
  }
  int z = s.length();
  for(int i = s.length() - 1; s[i] != 'Z'; i--){
    z--;
  }
  cout << z-a+1 << endl;
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using lint128 = __int128_t;
const lint mod = 998244353;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountll((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
inline void YES(bool condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
inline void Yes(bool condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
inline void assert_NO(bool condition){ if(!condition){ cout << "NO" << endl; exit(0); } }
inline void assert_No(bool condition){ if(!condition){ cout << "No" << endl; exit(0); } }
inline void assert_minus_1(bool condition){ if(!condition){ cout << -1 << endl; exit(0); } }
lint power(lint base, lint exponent, lint module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ lint root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class T> T gcd_calc(T a, T b){ if(b){ return gcd_calc(b, a % b); }else{ return a; }}
template<class T> T gcd(T a, T b){ if(a < b) swap(a, b); return gcd_calc(a, b); }
template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<lint> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } lint C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };
template<class itr> bool next_sequence(itr first, itr last, int max_bound){ itr now = last; while(now != first){ now--; (*now)++; if((*now) == max_bound){ (*now) = 0; }else{ return true; } } return false; }
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; }
inline int at(lint x, int k){ return (x >> k) & 1; }
random_device rnd;
#define rep(i, n) for(int i = 0; i < n; i++)

int main(){
    string S;
    cin >> S;
    Yes(S[2] == S[3] && S[4] == S[5]);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
const int MOD = 1000000007;
#define rep(i,n) for (ll i=0; i < (n); i++)
using namespace std;
int get_gcd(int a, int b) {
  while(1) {
    if (a < b) swap(a, b);
    if (b == 0) return a;
    a %= b;
  }
}
int get_lcm(int a, int b){return a * b / get_gcd(a, b);}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

main () {
  char s[4];
  char t[4];
  scanf("%s %s", s, t);

  int ans = 0;
  rep(i,3) if (s[i]==t[i]) ans++;

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

  return 0;
}


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

const int MAX_N = 100;

int main() {
  int N;
  int G[MAX_N][MAX_N];
  cin >> N;
  for (int i=0; i<N; i++) {
    for (int j=0; j<N; j++) {
      G[i][j] = 0;
    }
  }
  for (int i=0; i<N; i++) {
    int tmp, n;
    cin >> tmp >> n;
    for (int j=0; j<n; j++) {
      int t;
      cin >> t; t--;
      G[i][t] = 1;
    }
  }

  for (int i=0; i<N; i++) {
    for (int j=0; j<N-1; j++) {
      cout << G[i][j] << " ";
    }
    cout << G[i][N-1] << endl;
  }

  return 0;
}

Measured memory_bytes: 3120
import numpy as np
def factorize(N):
    up = int(np.sqrt(N))+2
    out = {}

    for i in range(2,up):
        if N%i == 0:
            temp = N
            count = 0
            while(True):
                N = N//i
                count += 1
                if N%i != 0:
                    break
            out[i] = count
        else:
            continue
    if N != 1:
        out[N] = 1
    return out

n = int(input())
ans = 0
for i in range(1,n+1,2):
    d = factorize(i)
    temp = 1
    for k in d:
        temp*=(d[k]+1)
    if temp == 8:
        ans += 1
    # 
    # print(d)
    # print(len(d)+1)
print(ans)


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

//macro-----------------------------------------------------------------------------------------
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i=a;i>b;i--)
#define int long long

//constant--------------------------------------------------------------------------------------
const int inf = 100100100100000;
const int mod = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//general_method--------------------------------------------------------------------------------
vector<int> cs(vector<int> arr){vector<int> ret = arr;rep(i,1,arr.size()){ret[i] += ret[i-1];}return ret;}
int ceil(int a, int b){if(a%b == 0) return a/b;else return a/b + 1;}
int digitlen(int i){int t = i;int count = 0;while(t){count += 1;t /= 10;}return count;}
int gcd(int m, int n){if((0== m)||(0 == n))return 0;while(m != n){if(m > n)m = m - n;else n = n - m;}return m;}
int lcm(int n, int m){return n*m/gcd(n,m);}

//io_method-------------------------------------------------------------------------------------
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
void print(int n){cout << n << endl;}
void print(vector<int> arr){cout << arr[0];rep(i,1,arr.size()) cout << " " << arr[i];cout << endl;}
void print(string s){cout << s << endl;}
void print(pair<int, int> p){cout << p.first << " " << p.second;}
void print(vector<vector<int>> arr){rep(i,0,arr.size()){print(arr[i]);}}
void print(double n){cout << n << endl;}

//main------------------------------------------------------------------------------------------


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

    string s = raw_input();

    set<char> t;

    for(char e : s){
        if(t.find(e) == t.end()){
            t.insert(e);
        }else{
            print("no");
            return 0;
        }
    }
    print("yes");
    
}

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

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//        int n = Integer.parseInt(br.readLine());
        String[] str = br.readLine().split(" ");

        int[] t = new int[101];
        int a = Integer.parseInt(str[0]);
        int b = Integer.parseInt(str[1]);
        int c = Integer.parseInt(str[2]);
        int d = Integer.parseInt(str[3]);

        t[a] += 1;
        t[b] -= 1;
        t[c] += 1;
        t[d] -= 1;

        for (int i = 1; i < 101; i++) {
            t[i] += t[i - 1];
        }

        int cnt = 0;
        for (int i = 0; i < 101; i++) {
            if (t[i] == 2) cnt++;
        }
        System.out.println(cnt);

    }
}

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

int main() {
  long long n, d;
  cin >> n >> d;
  vector<long long> x(n);
  vector<long long> y(n);
  for (long long i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
  }
  long long ans = 0;
  for (long long i = 0; i < n; ++i) {
    if (d * d >= x[i] * x[i] + y[i] * y[i]) {
      ++ans;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 6424