akhauriyash/Code-Regression huggingface dataset:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    k = int(readline())
    cur = 0

    for i in range(1, 10000001):
        cur *= 10
        cur += 7
        cur %= k
        if cur == 0:
            return print(i)

    print(-1)


if __name__ == '__main__':
    main()


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

int main(){
  int N;
  cin >> N;
  long long count=0;
  for(int i=0;i<N;i++){
    int A;
    cin >> A;
    while(A%2==0){
      count++;
      A/=2;
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 3572
# include <bits/stdc++.h>
using namespace std; 
const int mod=1e5+1;
long long int visited[mod]={0};
vector < int> adj[mod];
 long long int dfs(int n){
   if(visited[n]!=0){
     return visited[n];
   }
  if(adj[n].size()==0){
    return 1;
    visited[n]=1;
  }
 long long int maxx=0;
  for(auto i:adj[n]){
      maxx=max(maxx,dfs(i));
      
  }
  visited[n]=maxx+1; 
  return visited[n];
}
int main(){
  int n, i, x, y,  m; 
  long long int ans; 
  cin>>n>>m; 
  while(m--){
    cin>>x>>y; 
    adj[x].push_back(y);
  }
  ans=0;
  for(i=1;i<=n;i++){
      ans=max(ans,dfs(i));
  }
  cout<<ans-1;
  return 0;
}

Measured memory_bytes: 11848
#include<bits/stdc++.h>
using namespace std;
int main() {
    double n;
    cin >> n;
    while(n > 0) {
        double a[int(n)];
        double m=0;
        for(int i=0;i<n;i++) {
            cin >> a[i];
            m+=a[i];
        }
        m=m/n;
        double s=0;
        for(int i=0;i<n;i++) {
            double b=a[i]-m;
            s+=b*b;
        }
        s = sqrt(s/n);
        cout << s << endl;
        cin >> n;
    }
}


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

using namespace std;

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<(b);i++)
#define repr(i,b,a) for(int i=int(b);i>=(a);i--)
#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool valid(int lx,int ux,int ly,int uy,int x,int y){
	return lx<=x&&x<ux&&ly<=y&&y<uy; 
}
ll power(ll x,ll p){
	if(p==0)return 1;
	ll res=power(x*x%mod,p/2);
	if(p%2==1)res=res*x%mod;
	return res;
}

int f(int z){
	if(z==1)return 300000;
	if(z==2)return 200000;
	if(z==3)return 100000;

	return 0;
}

int main()
{
	int x,y;
	cin>>x>>y;
	int ans=0;
	ans+=f(x);
	ans+=f(y);
	if(x==1&&y==1)ans+=400000;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto nmxy = readln.split.to!(int[]);
    auto X = nmxy[2];
    auto Y = nmxy[3];
    auto xs = readln.split.to!(int[]);
    auto ys = readln.split.to!(int[]);

    int xmax = int.min, ymin = int.max;
    foreach (x; xs) xmax = max(xmax, x);
    foreach (y; ys) ymin = min(ymin, y);

    foreach (z; X..Y) {
        ++z;
        if (xmax < z && ymin >= z) {
            writeln("No War");
            return;
        }
    }
    writeln("War");
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int n, a, c;
    
    while(true)
    {
        cin >> n;
        
        if(n == 0) { break; }
        
        c = 0;
        
        for(int i = 0; i < n / 4; i++)
        {
            cin >> a; c += a;
        }
        
        cout << c << endl;
    }
    
    return 0;
}

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

using namespace std;
ll val[101], wt[101], dp[110][int(1e5+10)];
     
ll solve(int ith, int cwt, int n) {
    if(ith == n) return 0;
    
    if(dp[ith][cwt] != 0) return dp[ith][cwt];
    
    ll sml = 0;
    
    if(cwt - wt[ith] >= 0) sml = solve(ith + 1, cwt - wt[ith], n) + val[ith];
    
    ll sml1 = solve(ith + 1, cwt, n);
    
    return dp[ith][cwt] = max(sml, sml1);
}
int main() {
    int n, w; cin >> n >> w;
    for(int i=0; i<n; ++i) {
        cin >> wt[i] >> val[i];
    }
    cout << solve(0, w, n);
    return 0;
}

Measured memory_bytes: 78080
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int main()
{
   ll n,m;
   cin>>n>>m;
   char ma[n+1][m+1];
   for(ll i=1;i<=n;i++)
   {
       for(ll j=1;j<=m;j++)
       {
           cin>>ma[i][j];
       }
   }
   ll dp[n+1][m+1];
   for(ll i=0;i<=n;i++)
   {
       for(ll j=0;j<=m;j++)
       dp[i][j]=0;
   }
   dp[1][1]=1;
   ll p=1000000007;
   for(ll i=1;i<=n;i++)
   {
       for(ll j=1;j<=m;j++)
       {
       if(ma[i][j]!='#' && i*j!=1)
       dp[i][j]=(dp[i-1][j]+dp[i][j-1])%p;
      // cout<<dp[i][j]<<" ";
  
       }
      // cout<<endl;
   }
   cout<<dp[n][m]<<endl;
   return 0;
}

Measured memory_bytes: 9088
N, K = map(int, input().split())
x = list(map(int, input().split()))

ans = float("inf")
for i in range(N-K+1):
    temp = min(abs(x[i]) + abs(x[i+K-1]-x[i]), abs(x[i+K-1]) + abs(x[i]-x[i+K-1]))
    if ans > temp:
        ans = temp

print(ans)


Measured memory_bytes: 14224
import sys
n=int(input())
lineas=sys.stdin.readline()
arr=[]
arr=lineas.split()
arr=list(map(int,arr))
arr.insert(0,0)
m=int(input())
suma=0
lineas2=sys.stdin.readlines()
for i in range(m):
  arr2=lineas2[i].split()
  p=int(arr2[0])
  x=int(arr2[1])
  arr3=arr[:]
  arr3[p]=x
  for i in arr3:
    suma=suma+i
  print(suma)
  suma=0


Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define F first
#define S second
#define endl '\n'
#define MP make_pair
#define pb push_back

using namespace std;

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

static const int INF = INT_MAX;
static const int MIN = INT_MIN;
static const LL L_INF = LLONG_MAX;
static const int MOD = 1000000000 + 7;
static const int SIZE = 100005;

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

    int n, q;
    cin >> n >> q;
    string s;
    cin >> s;
    int sum[SIZE] = {};
    for( int i = 1; i < s.size(); ++i ) {
        if( s[i - 1] == 'A' && s[i] == 'C' ) sum[i] += sum[i - 1] + 1;
        else sum[i] += sum[i - 1];
    }

    for( int i = 0; i < q; ++i ) {
        int l, r;
        cin >> l >> r;
        cout << sum[r - 1] - sum[l - 1] << endl;

    }

    return 0;
}



Measured memory_bytes: 1488
/*
    AUTHOR:hruday pabbisetty
    NIT ROURKElA
    I am too dumb to realize that i am too dumb.
*/
#include <bits/stdc++.h>
#include <tr1/unordered_map>
using namespace std;
using namespace std::tr1;
#define opt ios_base::sync_with_stdio(0)
#define lli long long int
#define ulli unsigned long long int
#define I int
#define S string
#define D double
#define rep(i,a,b) for(i=a;i<b;i++)
#define repr(i,a,b) for(i=a;i>b;i--)
#define in(n) scanf("%lld",&n)
#define in2(a,b) scanf("%lld %lld",&a,&b)
#define in3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define out(n) printf("%lld\n",n)
#define inu(a) scanf("%lld",&a)
#define outu(a) printf("%llu",a)
#define ins(s) scanf("%s",&s)
#define outs(s) printf("%s",s)
#define mod 1000000007
#define inf 100000000000000
typedef long long       ll;
typedef pair<lli,lli>  plli;
typedef vector<lli>     vlli;
typedef vector<ulli>    vulli;
typedef vector<ll>      vll;
typedef vector<string>  vs;
typedef vector<plli>     vplli;
#define MM(a,x)  memset(a,x,sizeof(a));
#define ALL(x)   (x).begin(), (x).end()
#define P(x)       cerr<<"{"#x<<" = "<<(x)<<"}"<<endl;
#define P2(x,y)       cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<"}"<<endl;
#define P3(x,y,z)  cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<", "#z" = "<<(z)<<"}"<<endl;
#define P4(x,y,z,w)cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<", "#z" = "<<(z)<<", "#w" = "<<(w)<<"}"<<endl;
#define PP(x,i)     cerr<<"{"#x"["<<i<<"] = "<<x[i]<<"}"<<endl;
#define TM(a,b)     cerr<<"{"#a" -> "#b": "<<1000*(b-a)/CLOCKS_PER_SEC<<"ms}\n";
#define UN(v)    sort(ALL(v)), v.resize(unique(ALL(v))-v.begin())
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define sz() size()
#define nl cout<<"\n"
#define MX1 100005
#define MX2 1000005
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
lli dx[]={0,0,-1,1,-1,-1,1,1};
lli dy[]={1,-1,0,0,1,-1,-1,1};
lli power(lli a,lli b)
    {
    lli value;
    if(b==0)
        {
        return 1;
    }
    else if(b%2==0)
        {
        value=power(a,b/2)%mod;
        return(value*value)%mod;
    }
    else
        {
        value=power(a,b/2)%mod;
        return ((a*value)%mod*(value))%mod;
    }
}
int main()
{
      /*  #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
        #endif*/
    opt;
    lli n,a,b,ans=0,i,k;
    cin>>n>>k;
    /*if(k==0)
    {
        cout<<n*n;
        exit(0);
    }*/
    rep(i,0,1+n)
    {
        if(i<=k)
        {

        }
        else
        {
            ans+=(i-k)*(n/i);
            lli temp=n%i;
            ans+=(k)?max(0LL,temp-k+1):temp;
//            cout<<i<<" "<<(i-k)*(n/i)+max(0LL,temp-k)<<endl;
        }
    }
    cout<<ans;
}


Measured memory_bytes: 256
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで

#include <bits/stdc++.h>
#define mod 1000000007
#define INF LLONG_MAX
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};
vector< ll > divisor(ll n) {
  vector< ll > ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

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

    ll  a,b,c,d,e,n,k,maxi=0,f=0,mini=INF,sum=0,q;
	string str,stra,straa;
    ll x,y,z;
    char ca,cb,cc;
    cin>>a>>b>>c;
    if(b/a>=c) cout<<c<<endl;
    else cout<<b/a<<endl;

    

    return 0;
}


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

 int main() {
   string s;
   cin >> s;
   if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) cout << "Yes" << endl;
   else cout << "No" << endl;
 }


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        ProblemH.main();
    }
}

class ProblemH {
    private static int H;
    private static int W;
    private static int[][] dp;
    private static int m = (int) Math.pow(10,9) + 7;

    static void main() {
        Scanner sc = new Scanner(System.in);
        H = sc.nextInt();
        W = sc.nextInt();
        sc.nextLine();

        char[][] grid = new char[H][W];
        dp = new int[H][W];
        for (int i = 0; i < H; i++) {
            grid[i] = sc.nextLine().toCharArray();
        }
        // initial assertion
        for (int j = W-1; j>=0; j--) {
            if (grid[H-1][j] == '#') {
                break;
            } else {
                dp[H - 1][j] = 1;
            }
        }
        for (int i = H-2; i>=0; i--) {
            if (grid[i][W-1] == '#') {
                break;
            } else {
                dp[i][W - 1] = 1;
            }
        }
        // compute dp
        for (int i = H-2; i >= 0; i--) {
            for (int j = W-2; j >= 0; j--) {
                if (grid[i][j] == '.') {
                    dp[i][j] = dp[i+1][j] +  dp[i][j+1];
                    dp[i][j] %= m;
                } else {
                    continue;
                }
            }
        }
        // compute modulus
        int ans = dp[0][0] % m;
        System.out.println(ans);
    }
}


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

/*------------------------------------------------------------------*/

#define ll long long int
#define mp make_pair
#define pb push_back
#define MOD 1000000007

bool isvowel(char c)
{
    if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u')
        return true;
        return false;
}
ll isprime(ll n)
{
    ll ans=1;
    for(ll i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
            ans = i;
    }
    return ans;
}
ll power(ll a,ll b,ll m)
{
    if(b==0)
        return 1;
    if(b==1)
        return a%m;
    ll temp=power(a,b/2,m);
    if(b%2==0)
        return ((temp%m)*(temp%m))%m;
    else
        return ((((temp%m)*(temp%m))%m)*a%m)%m;
}

/*-----------------------------------------------------------------------------*/

ll c(ll n, ll k)
{
    ll C[n + 1][k + 1];
    ll i, j;

    for (i = 0; i <= n; i++)
    {
        for (j = 0; j <= min(i, k); j++)
        {

            if (j == 0 || j == i)
                C[i][j] = 1;

            else
                C[i][j] = (C[i - 1][j - 1]%MOD +
                          C[i - 1][j])%MOD;
        }
    }
    return C[n][k]%MOD;
}
ll modInverse(ll a, ll m)
{
    ll m0 = m;
    ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {

        ll q = a / m;
        ll t = m;
        m = a % m, a = t;
        t = y;


        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;

    return x;
}
ll func(ll n)
{
    ll ans=0;
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            if(i/10==0)
                ans+=1+func(i)*func(n/i);
            else
                ans+=func(i)*func(n/i);
        }
    }
    return ans;
}
ll dp[205][205][205];
ll check(ll red[],ll gre[],ll blu[],ll r,ll g,ll b,ll i,ll j,ll k)
{
   if(dp[i][j][k]!=-1)
    return dp[i][j][k]; 
   if(i<r&&j<g&&k<b)
   {
       return dp[i][j][k]=max(red[i]*gre[j]+check(red,gre,blu,r,g,b,i+1,j+1,k),max(gre[j]*blu[k]+check(red,gre,blu,r,g,b,i,j+1,k+1),blu[k]*red[i]+check(red,gre,blu,r,g,b,i+1,j,k+1)));
   }
   else if(i<r&&j<g) 
   {
       return dp[i][j][k]=red[i]*gre[j]+check(red,gre,blu,r,g,b,i+1,j+1,k);
   }
   else if(j<g&&k<b)
   {
       return dp[i][j][k]=gre[j]*blu[k]+check(red,gre,blu,r,g,b,i,j+1,k+1);
   }
   else if(i<r&&k<b)
   {
       return dp[i][j][k]=red[i]*blu[k]+check(red,gre,blu,r,g,b,i+1,j,k+1);
   }
   else
   {
       return 0;
   }
}
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);

    //freopen("1.txt","rt",stdin);
    //freopen("output.txt","wwt",stdout);

    ll t;
    t=1;
    //cin>>t;
    //ll t1=0;
    while(t--)
    {
        ll n;
        cin>>n;
        if(n%10==3)
         cout<<"bon";
        else if(n%10==0||n%10==1||n%10==6||n%10==8)
         cout<<"pon";
        else
        {
             cout<<"hon";
        }     
    }
}


Measured memory_bytes: 3700
package main

import (
	"fmt"
)

func main() {
	var s string
	fmt.Scan(&s)

	n := make([]int, 4)
	for i := range n {
		n[i] = int(s[i] - '0')
	}
	op := []string{"+++", "-++", "+-+", "--+", "++-", "-+-", "+--", "---"}
	for _, o := range op {
		ans := n[0]
		for i, r := range o {
			if r == '+' {
				ans += n[i+1]
			} else {
				ans += -n[i+1]
			}
		}
		if ans == 7 {
			fmt.Printf("%d%s%d%s%d%s%d=7\n", n[0], o[0:1], n[1], o[1:2], n[2], o[2:3], n[3])
			return
		}
	}
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
int main(){
    int k,n,m;
    cin>>k >> n>>m;
    int check=0;
    for(int i=n;i<=m;i++){
        if(i%k==0){
            check=1;
            break;
        }
    }
    if(check==1){
        cout<<"OK"<<endl;
    }else{
        cout<<"NG"<<endl;
    }
  return 0;
}

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

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

	int h; cin >> h;
	int n; cin >> n;
	vector<int> a(n); for(int &i : a) cin >> i;
	int s = accumulate(a.begin(), a.end(), 0);
	cout << (s >= h ? "Yes" : "No") << '\n';

	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)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 2147483600

class SCC {
private:
  vector<vector<int>> &G;
  vector<vector<int>> &rG;
  vector<bool> used;
  vector<int> vs;
  vector<int> cmp;
  int n;
  void dfs(int v){
    used[v] = true;
    for(auto to : G[v]) if(!used[to]) dfs(to);
    vs.pb(v);
  }
  void rdfs(int v, int k){
    used[v] = true;
    cmp[v] = k;
    for(auto to : rG[v]) if(!used[to]) rdfs(to, k);
  }
public:
  SCC(vector<vector<int>> &g, vector<vector<int>> &r) : G(g), rG(r){
    n = G.size();
    used = vector<bool>(n,false);
    vs.clear();
    cmp.resize(n);
  }
  int exec(){ // ?????£?????????????????°?????????
    rep(i,n) if(!used[i]) dfs(i);
    fill(all(used), false);
    int k=0;
    for(int i = vs.size()-1; i>=0; i--) if(!used[vs[i]]) rdfs(vs[i], k++);
    return k;
  }
  inline bool same(int i, int j){ return cmp[i]==cmp[j]; }
  inline int operator[](int i){ return cmp[i]; }
};


int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>> vec(n);
  vector<vector<int>> rev(n);
  rep(i,m){
    int s,t;
    cin>>s>>t;
    vec[s].pb(t);
    rev[t].pb(s);
  }

  SCC scc(vec, rev);
  scc.exec();

  int q;
  cin>>q;
  rep(i,q){
    int a,b;
    cin>>a>>b;
    if(scc.same(a,b)) cout<<1<<endl;
    else cout<<0<<endl;
  }


  return 0;
}

Measured memory_bytes: 4428
import itertools
n=int(input())
ans=0
l=[3,5,7,11,13]
c=list(itertools.combinations(l,3))
for i in c:
    if i[0]*i[1]*i[2]<=n:ans+=1
p=list(itertools.permutations(l,2))
for i in p:
    if i[0]**3*i[1]<=n:ans+=1
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <regex>
#include <numeric>
using namespace std;

/*--- Macro ---*/
#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 mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

/*---  Type ---*/
typedef long long ll;

/*--- Constants ---*/
template <typename T> const T INF = numeric_limits<T>::max() / 10;
const int MOD = (int)1e9 + 7;

// Floating
const double EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(x, y) (abs(a-b) < EPS)

// Util
int max(int a, int b, int c) {return max(a, max(b, c));}
int min(int a, int b, int c) {return min(a, min(b, c));}
ll max(ll x, ll y) {return x > y ? x : y;}
ll min(ll x, ll y) {return x < y ? x : y;}
ll max(ll a, ll b, ll c) {return max(a, max(b, c));}
ll min(ll a, ll b, ll c) {return min(a, min(b, c));}

// -------------------------------------------------------------------------------------



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

  int ans = 100000;
  rep(i, n) {
    int a;
    cin >> a;
    int cnt = 0;
    while(a % 2 == 0) {
      a /= 2;
      cnt++;
    }
    ans = min(ans, cnt);
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
import sys

input = sys.stdin.readline


def main():
    M1, D1 = map(int, input().split())
    M2, D2 = map(int, input().split())

    if M1 == M2:
        ans = 0
    else:
        ans = 1

    print(ans)


if __name__ == "__main__":
    main()


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

using namespace std;
#define ll long long
#define ld long double
#define rep(i,h) for(int i = 0; i < h; ++i)
#define rep1(i,h) for(int i = 0; i <= h; ++i)
#define rep2(i,k,h) for(int i = k; i < h; ++i)
#define rep3(i,k,h) for(int i = k; i <= h; ++i)
#define INF LLong_MAX // long long INF
#define inf INT_MAX // int inf

typedef pair<int,int> int_pair;
typedef pair<string,string> string_pair;

int main(){
    int n;
    cin >> n;
    vector<int> k(n);
    rep(i,n) {
        cin >> k.at(i);
    }
    int len = k.size();
    sort(k.begin(), k.end());
    k.erase(std::unique(k.begin(), k.end()), k.end());
    int length = k.size();
    if(len == length) {
        cout << "YES" << endl;
        return 0;
    }
    cout << "NO" << endl;
}



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

int main() {
  
  string S;
  
  cin >> S;
    
  if(S=="abc" || S=="acb" || S=="bac" || S=="bca" || S=="cab" || S=="cba") {
    
    cout << "Yes" << endl;
    
  } else {
    
    cout << "No" << endl;
    
  }
  
  return 0;
  
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security.Cryptography.X509Certificates;
using System.Xml;

namespace hello_world
{
	class Program
	{

		static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			string[] s = Console.ReadLine().Split(" ");
			int[] y = new int[n-1];
			for (int i = 0; i < n-1; i++)
				y[i] = int.Parse(s[i]);
			int[] ans = new int[n];
			for(int i = 0; i < n-1; i++)
			{
				ans[y[i]-1]++;
			}
			ans[n-1] = 0;
			for (int i = 0; i < n; i++)
				Console.WriteLine(ans[i]);




		}
	}
}



Measured memory_bytes: 42604
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
int main(){
    int n,ans=0;
    string s;
    cin>>n>>s;
    int dp[5001][5001];
    rep(i,s.size())rep(j,s.size()){
        if(s[i]==s[j]&&i!=j){
            if(i==0||j==0) dp[i][j]=1;
            else dp[i][j]=dp[i-1][j-1]+1;
            if(dp[i][j]>abs(j-i)) dp[i][j]=1;
        }
        else dp[i][j]=0;
    }
    rep(i,s.size())rep(j,s.size()) ans=max(ans,dp[i][j]);
    cout<<ans;
}

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

using namespace std;

const int maxi=1e6;

long long a[maxi],b[maxi];

int size(long long x, long long y)
{
    int ans=0,ans1=0;
    while(x>0)
    {
        x/=10;
        ans++;
    }

    while(y>0)
    {
        y/=10;
        ans1++;
    }

    if (ans!=ans1) return 1; else return 0;
}

int main()
{


  b[0]=1;
  int cnt=0;

    for (int i=1;i<=10;i++)
        {
            a[i]=a[i-1]*10+9;
            b[i]=b[i-1]*10;
        }

   long long cur=0;
   long long ask=0;
   long long ser=1;
   char ch;

    for (int k=1;k<=10;k++)
    {

        long long l=0;
        long long r=9;

        while(r-l>=2){
         ask=(cur*10+(l+r+1)/2)*b[10-ser]+a[10-ser];

         printf("? %lld\n",ask);
         cnt++;
         fflush(stdout);
         scanf(" %c",&ch);

         if (ch=='Y')
           r=(l+r+1)/2;
         else
            l=(l+r+1)/2 +1;

        }

        if (ser==1 && l==0) l++;

        int rez=r;

        for (int i=l;i<=r;i++){
        ask=(cur*10+i)*b[10-ser]+a[10-ser];

         printf("? %lld\n",ask);
         cnt++;
         fflush(stdout);
         scanf(" %c",&ch);
         if (ch=='Y') { rez=i; break;}
        }

         cur=cur*10+rez;
         ser++;
    }

     int tip=0;

    while(1==1)
    {
        if (cur%10!=0) break;

        cur+=1;

        printf("? %lld\n",cur);
        fflush(stdout);
        cnt++;
         scanf(" %c",&ch);

         if (ch=='N'){
          tip=1;
          break;
         }
          cur/=10;
    }


   if (tip==1) { printf("! %lld\n",(cur-1)*10); fflush(stdout); } else {

   cur*=10;
   cur--;
   printf("? %lld\n",cur);
   cnt++;
   fflush(stdout);

   scanf(" %c",&ch);
   if (ch=='N' && cur==9) printf("! %lld\n",10); else
    if (cur==9) printf("! %lld\n",1); else
   if (ch=='N') {printf("! %lld\n",(cur+1)/10);} else
   printf("! %lld\n",cur+1);
   }
   fflush(stdout);
   //cout<<cnt<<"\n";
   return 0;
}


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

int main(){
  int n;
  cin>>n;
  vector<int> a(n+1);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  vector<int> dp(n,INT_MAX);
  dp[0]=0;
  for(int i=0;i<n;i++){
      for(int j:{i+1,i+2}){
          if(j<n) dp[j]= min(dp[j],dp[i]+abs(a[i]-a[j]));
      }
  }
  cout<<dp[n-1]<<endl;
}

Measured memory_bytes: 3980
def make(n,x):
    if n==0:
        return 1
    elif x==1:
        return 0
    elif x==b_memo[n-1]+2:
        return p_memo[n-1]+1
    elif x>b_memo[n-1]+1:
        return p_memo[n-1]+1+make(n-1,x-b_memo[n-1]-2)
    else:
        return make(n-1,x-1)
  
n,k=map(int,input().split())
b_memo=[0]*51
p_memo=[0]*51
b_memo[0]=1
p_memo[0]=1
for i in range(50):
    b_memo[i+1]=2*b_memo[i]+3
for i in range(50):
    p_memo[i+1]=2*p_memo[i]+1

print(make(n,k))

Measured memory_bytes: 3064
import java.util.Scanner;

class Main {

  public static final long INF = Long.MAX_VALUE / 4;

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    String S = scanner.next();
    int[] sum = new int[N + 1];
    for (int i = 0; i < N; i++) {
      if (S.charAt(i) == '#') {
        sum[i + 1] = sum[i] + 1;
      } else {
        sum[i + 1] = sum[i];
      }
    }
    int ans = sum[N];
    for (int i = 0; i < N; i++) {
      if (S.charAt(i) == '#') {
        ans = Math.min(ans, sum[i] + N - i - 1 - (sum[N] - sum[i + 1]));
      }
    }
    System.out.println(ans);
  }
}


Measured memory_bytes: 28732
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long int
#define oo 1000000000000000000
#define forr(i,n) for(ll i=0;i<n;i++)
#define fastio ios_base::sync_with_stdio(false); cin.tie(0) ; cout.tie(0);
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define pb push_back
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
 
using namespace __gnu_pbds; 
using namespace std;

const ll MOD = 1e9 + 7;

ll valueOfIndex(ordered_set&s , ll i){ return *(s.find_by_order(i)); }
ll indexOfValue(ordered_set&s , ll x){ return s.order_of_key(x); }

ll add(ll a, ll b,ll p=MOD) { a%=p; b%=p; return (a+b + p)%p;}
ll mul(ll a, ll b,ll p=MOD) { a%=p; b%=p; return (a*b + p)%p;} // __int128

ll power(ll x,ll n,ll p=MOD){ if(x==0) return 0; if(n==0 || x==1) return 1LL;
    ll r = (power(x,n/2,p))%p; if(n&1) return mul(mul(r,r,p) , x,p); else return mul(r,r,p);
}



void __sol(){
    ll n; cin >> n;
    vector<pair<ll,ll>> v;
    forr(i,n){
        ll x,y; cin >> x >> y;
        v.eb(x,y);
    }
    sort(all(v));
    ll a=oo , b=oo , ans = -oo;
    for(auto &i: v){
        ans = max(ans , i.first+i.second - a);
        ans = max(ans , i.first-i.second - b);
        a = min( a , i.first + i.second );
        b = min(b , i.first - i.second);
    }
    cout << ans;
    return;
}


int main(){
    fastio
    ll tc=1;// cin >> tc;
    while(tc--) __sol();
    return 0;
}

Measured memory_bytes: 7408
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define int ll
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int gcd(int n,int m){
    if(m==0)return n;
    return gcd(m,n%m);
}

signed main(void) {
    int i,j;
    int n;
    cin >> n;
    rep(i,n){
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        bool ans = true;
        if(a<b) ans = false;
        else if(b>d) ans = false;
        else if(b-1<=c) ans = true;
        else{
            int l = ((c+1-a)%b+b)%b;
            int r = ((b-1-a)%b+b)%b;
            int g = gcd(b,d);
            if(l<=r && (l/g != r/g || l%g==0)) ans = false;
            if(l>r) ans = false;
        }
        if(ans) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}


Measured memory_bytes: 256
import java.util.*;
 
class Main {
  public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
    
    int S = scanner.nextInt(); //next(文字列), nextDouble, nextLine(1行)とか   
    int k = 0;
    int X = S; //Sの桁数を求めるパート
    while (X > 0){
      k++;
      X /= 10;
    }                  
    int[] A = new int[4]; //Sの各桁を配列に入れる
    if (k == 3){
      A[3] = 0;
        for (int i = 0; i < A.length-1; i++){
        A[i] = S % 10;
        S /= 10;
    	}
    }else{
    for (int i = 0; i < A.length; i++){
      A[i] = S % 10;
      S /= 10;
    }
    }
    
    for (int bit = 0; bit < (1<<(A.length-1));bit++){      
      int ans = 0;
      int[] B = new int[3];
      for (int j = 0; j < A.length-1; j++){
        if ((bit & (1 << j)) == 0){
          ans += A[j];
          B[j] = 0;
        }else{
          ans -= A[j];
          B[j] = 1;
        }     
       }
       ans += A[3];
       if (ans == 7){       
        System.out.print(A[3]);
        for (int h = 0; h < 3; h++){
          if (B[2-h]==0){
          	System.out.print("+");
          }else{
            System.out.print("-");
          }
          System.out.print(A[2-h]);
        }
        System.out.println("=7");
        break;
      }
    }     
  }
}


Measured memory_bytes: 22996
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	N := ReadInt()
	As := ReadInts(N)

	dp := make([][2]int, N)

	dp[0][0] = As[0]
	dp[0][1] = -As[0]
	for i := 1; i < N; i++ {
		dp[i][0] = Max(
			dp[i-1][0]+As[i],
			dp[i-1][1]-As[i],
		)
		dp[i][1] = Max(
			dp[i-1][0]-As[i],
			dp[i-1][1]+As[i],
		)
	}
	fmt.Println(Max(dp[N-1][0]))
}

func Max(xs ...int) int {
	max := xs[0]
	for _, x := range xs[1:] {
		if max < x {
			max = x
		}
	}
	return max
}

func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int) { Scan(&i); return }


Measured memory_bytes: 5984
#include <bits/stdc++.h>
#define dum(x) cout<<#x<<'='<<x<<endl
#define ll long long
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v.at(i);
  }

  vector<int> odd(100010, 0);
  vector<int> even(100010, 0);

  for (int i = 0; i < n; ++i) {
    if (i % 2 == 0) {
      even.at(v.at(i))++;
    } else {
      odd.at(v.at(i))++;
    }
  }

  int max_e = 0, num_e = 0;
  for (int i = 0; i < even.size(); ++i) {
    if (even.at(i) > max_e) {
      max_e = even.at(i);
      num_e = i;
    }
  }

  int max_o = 0, num_o = 0;
  for (int i = 0; i < odd.size(); ++i) {
    if (odd.at(i) > max_o) {
      max_o = odd.at(i);
      num_o = i;
    }
  }

  sort(odd.begin(), odd.end(), greater<int>());
  sort(even.begin(), even.end(), greater<int>());

  if (num_e != num_o) {
    cout << n - max_e - max_o << endl;
  } else {
    int res = min(n - max_e - odd.at(1), n - max_o - even.at(1));
    cout << res << endl;
  }
}

Measured memory_bytes: 1408
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC136
{
    class C
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] h = Console.ReadLine().Split().Select(int.Parse).ToArray();
            string ans = "Yes";
            h[0]--;
            for (int i = 1; i < n; i++)
            {
                if (h[i] > h[i - 1]) { h[i]--; }
                else if (h[i] == h[i - 1]) { }
                else { ans = "No"; }
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 27996
#include <iostream>

using namespace std;

int main() {
  char arr[3][3];
  for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) cin >> arr[i][j];
  for (int i = 0; i < 3; ++i) cout << arr[i][i];
  cout << '\n';
  return 0;
}

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

#define ll long long

using namespace std;
bool fn(const pair<int,int>&x, const pair<int,int>& y)
{
	if (x.second != y.second)
		return x.second < y.second;

	return x.first < y.first;
}


int main()
{
    ll n,w;

    cin>>n>>w;

    // int weight[n];
    // int values[n];

    vector<pair <ll,ll>> wv;


    ll a,b;

    for(int i=0;i<n;i++)
        {
            cin>>a>>b;
            //cout<<a<<b;
            wv.push_back(make_pair(a,b));

            
        }


    sort(wv.begin(),wv.end(),fn);

    
    a=wv[0].first;
    for(int i=1;i<n;i++)
    {
        if(a==wv[i].first)
        {
            wv[i].first+=wv[i-1].first;
            wv[i].second+=wv[i-1].second;

        }else{
            a=wv[i].first;
        }
        
    }


    // for(int i=0;i<n;i++)
    // {
    // cout<<wv[i].first<<" "<<wv[i].second<<endl;
    // }
    
    ll dp[n+1][w+1];


    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=w;j++)
        {
            if(i==0||j==0)
                dp[i][j]=0;
            else if((wv[i-1].first)<=j)
            {
                
                dp[i][j]=max((wv[i-1].second)+dp[i-1][j-(wv[i-1].first)],dp[i-1][j]);
                // cout<<"reached2"<<dp[i][j]<<" ";
            }
            else
            {
                dp[i][j]=dp[i-1][j];
            }
            
        }
    }

    // for(int i=0;i<=n;i++)
    // {
    //     for(int j=0;j<=w;j++)
    //     {
    //         cout<<dp[i][j]<<"  ";
    //     }
    //     cout<<endl;
        
    // }

    cout<<dp[n][w];


    return 0;

}

Measured memory_bytes: 79104
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'

int main(int argc, char const *argv[]) {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    set<int>s;
    for(int i=0;i<3;i++) {
        int x;
        cin>>x;
        s.insert(x);
    }
    cout<<(s.size()==2?"Yes":"No")<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int solve(int ,int );

int n,A[20];

int main(){
  int q,m,i;

  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&A[i]);

 scanf("%d",&q);
 for(i=0;i<q;i++){
    scanf("%d",&m);
    if(solve(0,m))printf("yes\n");
    else printf("no\n");
 }
  return 0;
}

int solve(int i,int m){
  int res;

  if(m==0)return 1;
  else if(i>=n)return 0;
  res=solve(i+1,m) || solve(i+1,m-A[i]);
  return res;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
typedef long long ll;
typedef vector<ll> vl;
#define rp(i, f, t) for (int i = f; i < t; i++)
#define pr(i, f, t) for (int i = t - 1; i >= f; i--)
#define ca(n, a) rp(ca_i, 0, n) cout << a[ca_i] << ((ca_i == n - 1) ? "\n" : " ")
#define za(n, a) rp(za_i, 0, n) a[za_i] = 0
#define be(a) a.begin(), a.end()
int main()
{
	string s,t,u;
	ll a,b;
	cin>>s>>t>>a>>b>>u;
	if(s==u){
		cout<<a-1<<" "<<b<<endl;
	}
		else
		{
				cout<<a<<" "<<b-1<<endl;
		}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define lli long long int
#define REP(i,s,l) for(lli i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)
#define MOD 1000000007

map<lli,vector<lli>> v;
signed main(){

	lli n,m;
	cin>>n>>m;

	for(lli i=0;i<n;i++){
		lli a,b;
		cin>>a>>b;
		v[a].push_back(b);
	}
	lli sum=0;

	priority_queue<lli> q;

	for(lli i=0;i<=m;i++){
		for(lli j=0;j<v[i].size();j++){
			q.push(v[i].at(j));
			if(DEBUG)cout<<v[i].at(j)<<endl;
		}

		if(q.size()==0)continue;
		sum += q.top();
		if(DEBUG)cout<<q.top()<<endl;
		q.pop();
	}

	cout<<sum<<endl;

	return 0;
}

Measured memory_bytes: 10880
// #include <bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#include<stack>
#include<sstream>
#include<utility>
#include<iomanip>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<queue>
// FIFO First in first out.
#include<deque>
// Either end of the line.
#include<cctype>
#include<list>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define debug(x) cout<<"[" << #x << " is: " << x << "] "<<endl;
#define rep(a,b,c) for(int i=a; i<b ;i++)
#define sora(v) sort(v.begin(), v.end())
#define sord(v) sort(v.rbegin(), v.rend())
#define rev(v) reverse(v.begin(), v.end())
#define print(p) cout << p <<endl
#define yes puts("YES")
#define no puts("NO")
#define line cout <<endl;
//#define sizev(s) long long SIZE;  SIZE = s.size();
using namespace std;
int T;
double pi = acos(-1.0);
typedef long long ll;
int mod = 1e9 + 7;
vector<long long>v;
long long factorial(long long x) {
	long long total = 1;
	for (int i = 2; i <= x; i++)
		total *= i;
	return total;
}
//sieve algorithm. nlog(log(n)).
bool isprime(long long x) {
	vector<bool>prime(x + 1, 1);
	prime[0] = prime[1] = 0;
	for (long long i = 2; i * i <= x; i++)
		if (prime[i])
			for (long long j = i * i; j <= x; j += i)
				prime[j] = 0;
	return prime[x];

}
long long gcd(long long a, long long b) {
	if (b == 0)
		return a;
	else return gcd(b, a % b);
}
long long lcm(long long a, long long b)
{

	return (a * b) / gcd(a, b);
	//int lar = max(a, b);
	//int small = min(a, b);
	//for (int i = lar; ; i += lar) {
	//	if (i % small == 0)
		//	return i;
	//}
}
ll temp = 1;
ll fastpow(ll base, ll exponent) {

	if (exponent == 0) return 1;
	if (exponent == 1) return (temp * base);
	if (exponent % 2 == 0)
		return fastpow(base * base, exponent / 2);
	else {
		temp *= base;
		fastpow(base * base, exponent / 2);
	}
}
void fill(long long f) {
	v.clear();
	long long x;
	for (long long i = 0; i < f; i++) {
		cin >> x;
		v.push_back(x);
	}
}
void printv() {
	int size = v.size() - 1;
	for (int i = 0; i <= size; i++) {
		cout << v[i] << " ";
	}
	cout << endl;
}
inline void solve() {
//******************************************************************************
	ll a, b; cin >> a >> b;
	print(a*b);
	
////////////////////////////////////////////////////////////////////////////////
}int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	//cin >> T; while (T--)
	{
		solve();
	}
	return 0;
}

Measured memory_bytes: 3192
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define yes(n) cout << ((n) ? "yes" : "no"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!": ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define VSUM(V) accumulate(ALL(V), 0)
#define MID(a,b,c) (a) < (b) && (b) < (c)
#define MIDe(a,b,c) (a) <= (b) && (b) <= (c)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define IN4(a,b,c,d) cin >> a >> b >> c >> d
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;
#define FIX cout << fixed << setprecision(15)

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define VVi vector<vector<ll>>
#define Vd vector<double>
#define Vb vector<bool>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<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;}

using ll = long long;
using Graph = vector<vector<int>>;

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int gcd(int a,int b){return b != 0 ? gcd(b, a % b) : a;} //最大公約数
int lcm(int a, int b){return a * b / gcd(a, b);}
string toStrUp(string str){char diff = 'A'-'a';REP(i,str.size()) str[i] += diff;return str;}
string gCh(string str, int key){return str.substr(key,1);}

signed main() {
  RAPID;
  // デフォルト変数定義
  int n=0,m=0,a=0,b=0,c=0,d=0,x=0,y=0,z=0;
  string s="",t="";
  //

  // ここから
  IN2(n,x);
  Vi A(n);
  VIN(A)
  SORT(A);
  int minE = A[0];
  int index = 1;
  while(A[index] == minE){
    index++;
  }
  if(index == n-1) {
    OUT(0);
    return 0;
  }
  n -= index;
  n -= x;
  z = 1;
  while(n >= 0){
    n -= x-1;
    z++;
  }
  OUT(z);
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
using namespace std;
int main()
{
    int N;
    cin >> N;
    constexpr int MAX = 100000;
    vector<int> num(MAX + 1, 0);
    for (int i = 0; i < N; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        num[a]++;
        if (b + 1 <= MAX) {
            num[b + 1]--;
        }
    }
    for (int i = 1; i <= MAX; i++) {
        num[i] += num[i - 1];
    }

    for (int i = MAX; i >= 0; i--) {
        if (num[i] >= i) {
            cout << i << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main () {
    int N;
    cin >> N;
    vector<int> v;
    for (int i = 0; i < N; i++) {
        int a, b;
        cin >> a >> b;
        if (a == b) v.push_back(i);
    }
    for (int i = 2; i < v.size(); i++) {
        if (v[i]-1 == v[i-1] && v[i-1]-1 == v[i-2]) {
            puts("Yes");
            return 0;
        }
    }
    puts("No");
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    string s,t;
    cin >> s >> t;
    t+=t;
    if (t.find(s) != string::npos) {
        cout << "Yes" << endl;
    } else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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 void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 400010;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a,b;
    cin >> n >> a >> b;
    PRINT(min(n*a,b));
}


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

using namespace std;

int main() {
    int N;
    string x[10], u[10];
    cin >> N;
    double money = 0.0;
    for(int i = 0; i < N; ++i) {
        cin >> x[i] >> u[i];
        if(u[i]=="JPY"){
            money += atoi(x[i].c_str());
        } else{
            money += atof(x[i].c_str())*380000.0;
        }
    }
    cout << money << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
public class Main {
 
  public static void main(String[] args) { 
        solve();
      out.close();
  }

  private static void solve() {
      int n = sc.nextInt();
      int[] arr = sc.readArray(n);
      List<int[]> list = new ArrayList<>();
      int left = 0;
      for(int i = 1; i < n; i++) {
        if(arr[i] >= arr[i-1]) continue;
        if(left < i - 1) {
          list.add(new int[]{arr[left], arr[i-1]});
        }
        left = i;
      }
      if(left < n - 1)
        list.add(new int[]{arr[left], arr[n-1]});


      long res = 1000;
      for(int[] r : list) {
        long cnt = res / r[0];
        long diff = r[1] - r[0];
        res += cnt * diff;
      }
      out.println(res);
  }

  public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
 
  public static FastScanner sc = new FastScanner();

  static class FastScanner {
      BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st=new StringTokenizer("");
      String next() {
        while (!st.hasMoreTokens())
          try {
            st=new StringTokenizer(br.readLine());
          } catch (IOException e) {
            e.printStackTrace();
          }
        return st.nextToken();
      }
      
      int nextInt() {
        return Integer.parseInt(next());
      }
      int[] readArray(int n) {
        int[] a=new int[n];
        for (int i=0; i<n; i++) a[i]=nextInt();
        return a;
      }
      long nextLong() {
        return Long.parseLong(next());
      }
  }
}

Measured memory_bytes: 32928
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace std;
using namespace __gnu_pbds; 
  
#define ll long long
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
	enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
	ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
	*this << "[";
	for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

const int mod = (int)1e9 + 7;
const int MX = (int)1e5 + 10;

void add_self(int &x, int y){x += y; if(x >= mod) x -= mod;}
void sub_self(int &x, int y){x -= y; if(x < 0) x += mod;}
void mul(int &x, int y){x = x * 1LL * y % mod;}

int main(){

	cin.tie(0); cout.tie(0);
	ios_base::sync_with_stdio(0);

	int k, a, b;
	cin >> k >> a >> b;
	puts((a - 1) / k != b / k ? "OK" : "NG");	

	return 0;
}

Measured memory_bytes: 3692
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) ((x).begin()),((x).end())
#define usecppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main()
{
    int n; 
    cin >> n; 
    int u = n/2;
    if (n % 2)
        printf("%lf",(1.0*u+1) / (1.0*n));
    else printf("%lf",u*1.0/n);
}

Measured memory_bytes: 256