akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#define MAX 100000
using namespace std;

/*
コンテスト日程: D日 = 365日
s d,i: d日にタイプiのコンテストを行った時の満足度
c i:1日のタイプiのコンテストの満足度の下がりやすさ
*/

/*
M回 日程変更クエリ
d[i] d日目を
q[i] コンテストタイプqに変更
*/

int z[] =
{
    72882,
56634,
38425,
27930,
42884

};

int D;
int c[26],cc[26] = {0};
int s[365][26];
int t[365];
bool x[26] = {0};
int m;
int d[MAX],q[MAX];


/**/

int main(){
    cin >> D;
    int csum = 0;
    for(int i = 0;i < 26;i++){
        cin >> c[i];
        //cc[i] = c[i];
        csum += c[i];
    }
    for(int i = 0;i < D;i++){
        for(int j = 0;j < 26;j++){
            cin >> s[i][j];
        }
    }
    for(int i = 0;i < D;i++){
        cin >> t[i];
    }
    /**/

    cin >> m;
    for(int i = 0;i < m;i++){
        cin >> d[i] >> q[i];
    }

    /*満足度 + */
    
    for(int k = 0;k < m;k++){
        int pans = 0,nans = 0;
        int tmp;
        tmp = t[d[k] - 1];
        t[d[k] - 1] =   q[k];
        for(int i = 0;i < D;i++){
            pans += s[i][t[i] - 1];
            for(int j = 0;j < 26;j++){
            
                cc[j]++;
                if(t[i] - 1 == j){
                    cc[j] = 0;
                } 
                nans += c[j]*cc[j];
            }
        
        //cout << pans - nans << endl;
        }
        cout << pans - nans << endl;
        //t[d[k] - 1] = tmp;
        for(int l = 0;l < 26;l++){
            cc[l] = 0;
        }
    }


    
    return 0;
}

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

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

Measured memory_bytes: 3096
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const long Mod = 1000000007;
    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
        //MyDebugger.Test(process, "../TextFile2.txt");
        //MyDebugger.MakeTestCase("../TextFile2.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static object process(TextReader input) {
        var s = input.ReadLine();

        s = s.Replace(s[0].ToString(), "");

        return s.Length==2 && s[0]==s[1] ? Yes : No;
    }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
int n;
int a[100005];
int megh[100005];
int extra[100005];
int main()
{   
      scanf("%d",&n);
      for(int i=1;i<=n;i++)
     {  scanf("%d",&a[i]);
        megh[i]=a[i];
    }
    long long int meghans=0;
    for(int i=1;i<n;i++)
    {   if(megh[i]<=megh[i+1])
       {   meghans+=(megh[i]);
           megh[i+1]-=megh[i];
           megh[i]=0;
	   }
	   else if(megh[i]>megh[i+1])
	   {   meghans+=(megh[i]/2);
	       megh[i]=megh[i]%2;
	       if(megh[i])
	       {   if(megh[i+1])
	           {  meghans++;
	              megh[i+1]-=1;
			   }
		   }
	   }
	}
     meghans+=(megh[n]/2);
	printf("%lld\n",meghans);
return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using intl = long long;
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define repd(i, n) for(intl i = (intl)((n) - 1); i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define INF = 1e9;
#define debug(x) cout << #x << ":" << x << endl
using namespace std;
void fp(bool flag){
    if(flag)cout << "Yes" << endl;
    else cout << "No" << endl;
}
int main(){
    intl a;
    cin >> a;
    intl b;
    cin >> b;
    intl c = -1;
    repi(i, 1,10001){
        if(((intl)(i * 0.08) == a) && ((intl)(i * 0.1) == b)){
            c = i;
            break;
        }
    }
    cout << c << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int N = 3009;
const ll MOD = 1e9+7;

int n;
string s;
ll dp[N][N];
ll sum[N];

ll mod(ll n) {
    n %= MOD;
    if(n < 0)  n += MOD;
    return n;
}

ll modadd(ll &a, ll b) {
    return a = mod( mod(a) + mod(b) );
}

void init() {
    fill(dp[0], dp[1], 1LL);
}

void receive(int i, int r) {
    if(s[i-1] == '<')  modadd(dp[i][r], sum[r]);
    if(s[i-1] == '>')  modadd(dp[i][r], sum[n-i] - sum[r]);
}

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

    for(int i = 1; i < n; i++) {
        fill(sum, sum + N, 0LL);
        sum[0] = dp[i-1][0];
        for(int r = 1; r < n; r++) {
            modadd(sum[r], sum[r-1] + dp[i-1][r]);
        }

        for(int r = 0; r < n; r++) {
            receive(i, r);
        }
    }

    cout << dp[n-1][0] << endl;
}


Measured memory_bytes: 70784
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; ll W; cin >> n >> W;
    V<int> w(n); vll v(n);
    for (int i = 0; i < n; i++) cin >> w[i] >> v[i];
    vvll dp(2, vll(100005, HIGHINF));
    dp[0][0] = 0;
    for (int i = 0; i < n; i++) {
        dp[1] = vll(100005, HIGHINF);
        for (int j = 0; j < 100005; j++) {
            chmin(dp[1][j], dp[0][j]);
            chmin(dp[1][j + v[i]], dp[0][j] + w[i]);
        }
        swap(dp[0], dp[1]);
    }
    int ans = 0;
    for (int i = 0; i < 100005; i++) if (dp[0][i] <= W) ans = i;
    cout << ans << '\n';
    return 0;
}


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

#define TYPE(c)   remove_reference_t<decltype(c)>
#define REP(i, n) for(TYPE(n) i = 0; i < n; i++)
#define FOR(v, c) for(TYPE(c.begin()) v = c.begin(); v != c.end(); v++)
#define ALL(c)    c.begin(), c.end()
#define SORT(c)   sort(ALL(c))
#define RSORT(c)  sort(ALL(c), greater<TYPE(c)::value_type>())
#define UNIQUE(c) c.erase(unique(ALL(c)), c.end())

using namespace std;
using ll = long long;

constexpr int MOD  = (int)1e9 + 7;
constexpr int INF  = (int)1e9 + 1;
constexpr ll  LINF = (ll)1e18 + 1;
template<typename T> constexpr bool chmax(T& a, const T& b)
{ if(a < b) { a = b; return true; } else { return false; } }
template<typename T> constexpr bool chmin(T& a, const T& b)
{ if(b < a) { a = b; return true; } else { return false; } }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T>& p)
{ return os << "(" << p.first << "," << p.second << ")"; }
template<typename T> auto operator<<(ostream& os, const T& t)
    -> typename conditional<true, ostream&, decltype(*t.begin())>::type
{ os << "["; FOR(v, t) { if(v != t.begin()) os << ","; os << *v; } os << "]"; return os; }
ostream& operator<<(ostream &os, const string& s)
{ FOR(v, s) os << *v; return os; }

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

    int N;
    std::cin >> N;

    int min_cnt = N;
    for(int i = 0; i <= N ; i ++) {
        int cnt = 0;
        auto exec = [&](const int& num, int t) { while(t > 0) cnt += t % num, t /= num; };
        exec(6, i);
        exec(9, N - i);
        chmin(min_cnt, cnt);
    }

    std::cout << min_cnt << std::endl;

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<string>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<map>
#include<set>
#include<limits>
#include<bitset>
#include<array>
#include<numeric>
#include<iomanip>

using namespace std;
typedef long long int ll;

int n,m,a,b,g,r;
bool ft[10][10];
vector<vector<int>> q={},qb;
vector<int> qm;

int main(){
    scanf("%d %d",&n,&m);
    for(int i=0;i<m;i++){
        scanf("%d %d",&a,&b);
        ft[a][b]=true;
        ft[b][a]=true;
    }

    q.push_back({1,1,0,0,0,0,0,0,0,0,0});
    //place , bit
    
    while(q.size()!=0){
        qb={};
        for(auto itr:q){
            for(int i=1;i<=n;i++){
                if(ft[itr[0]][i] and itr[i]==0){
                    qm={i};
                    for(int j=1;j<=n;j++)qm.push_back(itr[j]);
                    qm[i]=1;
                    g=0;
                    for(int j=1;j<=n;j++){
                        g+=qm[j];
                    }
                    if(g==n)r++;
                    else{
                        qb.push_back(qm);
                    }
                    //for(int j=0;j<=n;j++)printf("%d ",qm[j]);
                    //cout<<" ";
                    
                }
            }
        }
        q=qb;
        //cout<<endl;
    }
    printf("%d\n",r);
    
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
vector<ll> u,ny,d,l,nx,r;
int main(){
  ll n;
  cin>>n;
  for(int i=0;i<n;i++){
    ll x,y;
    char c;
    cin>>x>>y>>c;
    if(c=='U'){
      u.push_back(y);
      nx.push_back(x);
    }
    else if(c=='D'){
      d.push_back(y);
      nx.push_back(x);
    }
    else if(c=='L'){
      ny.push_back(y);
      l.push_back(x);
    }
    else{
      ny.push_back(y);
      r.push_back(x);
    }
  }
  sort(u.begin(),u.end());
  sort(ny.begin(),ny.end());
  sort(d.begin(),d.end());
  sort(l.begin(),l.end());
  sort(nx.begin(),nx.end());
  sort(r.begin(),r.end());

  vector<ll> times;
  times.push_back(0);

  bool fd=(d.size()!=0),fy=(ny.size()!=0),fu=(u.size()!=0);

  if(fu&&fy) if(u[0]<ny[0]) times.push_back((ny[0]-u[0])*2);
  if(fu&&fd) if(u[0]<d[0]) times.push_back(d[0]-u[0]);
  if(fy&&fd) if(ny[0]<d[0]) times.push_back((d[0]-ny[0])*2);

  ll us=u.size()-1,nys=ny.size()-1,ds=d.size()-1;
  if(fd&&fy) if(d[ds]>ny[nys]) times.push_back((d[ds]-ny[nys])*2);
  if(fd&&fu) if(d[ds]>u[us]) times.push_back(d[ds]-u[us]);
  if(fy&&fu) if(ny[nys]>u[us]) times.push_back((ny[nys]-u[us])*2);

  bool fl=(l.size()!=0),fx=(nx.size()!=0),fr=(r.size()!=0);

  if(fr&&fx) if(r[0]<nx[0]) times.push_back((nx[0]-r[0])*2);
  if(fr&&fl) if(r[0]<l[0]) times.push_back(l[0]-r[0]);
  if(fx&&fl) if(nx[0]<l[0]) times.push_back((l[0]-nx[0])*2);

  ll ls=l.size()-1,nxs=nx.size()-1,rs=r.size()-1;
  if(fl&&fx) if(l[ls]>nx[nxs]) times.push_back((l[ls]-nx[nxs])*2);
  if(fl&&fr) if(l[ls]>r[rs]) times.push_back(l[ls]-r[rs]);
  if(fx&&fr) if(nx[nxs]>r[rs]) times.push_back((nx[nxs]-r[rs])*2);

  sort(times.begin(),times.end());
  ll ans=174417441744174417;
  times.erase(unique(times.begin(),times.end()),times.end());
  for(int i=0;i<times.size();i++){
    ll lx=1744174417;
    if(fl) lx=min(lx,l[0]*2-times[i]);
    if(fx) lx=min(lx,nx[0]*2);
    if(fr) lx=min(lx,r[0]*2+times[i]);

    ll rx=-1744174417;
    if(fl) rx=max(rx,l[ls]*2-times[i]);
    if(fx) rx=max(rx,nx[nxs]*2);
    if(fr) rx=max(rx,r[rs]*2+times[i]);

    ll dy=1744174417;
    if(fd) dy=min(dy,d[0]*2-times[i]);
    if(fy) dy=min(dy,ny[0]*2);
    if(fu) dy=min(dy,u[0]*2+times[i]);

    ll uy=-1744174417;
    if(fd) uy=max(uy,d[ds]*2-times[i]);
    if(fy) uy=max(uy,ny[nys]*2);
    if(fu) uy=max(uy,u[us]*2+times[i]);
    if(lx==1744174417||rx==-1744174417||dy==1744174417||uy==-1744174417) continue;
    ans=min(ans,(rx-lx)*(uy-dy));
  }
  cout<<fixed<<setprecision(4)<<(ld)ans/4<<endl;

}


Measured memory_bytes: 2288
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store") // to restrict undesirable precision
#pragma GCC optimize ("-fno-defer-pop")// to pop argument of function as soon as it returns
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ps push_back
#define fs first
#define sc second
#define takeline cin.ignore();
#define iactive cout.flush();
#define N 3000005
#define endl "\n"
#define mod 1000000007
//((1.0l)*BIG MULTIPLY MAGIC?)
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
//-----------------------------------------------
int main(){

    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    
    ll i,j,k,l,n;
    cin>>n>>k;
    ll fl[n+1]={0},d;
    for(i=1;i<=k;i++){
        cin>>d;
        for(j=1;j<=d;j++){
            cin>>l;
            fl[l]=1;
        }
    }

    ll an=0;
    for(i=1;i<=n;i++){
        if(fl[i]==0) an++;
    }
    cout<<an;
    return 0;
}

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

B.append(0)
punitives = []

for i in range(1, N+1):
    v = 0
    if A[-i] >= B[-i]:
        A[-i] = A[-i]-B[-i]
        punitives.append(B[-i])
        B[-i] = 0
    else:
        punitives.append(A[-i])
        A[-i] = 0
        B[-i] = B[-i]-A[-i]

    if B[-i-1] >= A[-i]:
        v = A[-i]
        A[-i] = 0
        B[-i-1] = B[-i-1]-v
    else:
        v = B[-i-1]
        A[-i] = A[-i]-v
        B[-i-1] = 0
    punitives.append(v)

if A[0] >= B[0]:
    w = B[0]
else:
    w = A[0]

punitives.append(w)
print(sum(punitives))

Measured memory_bytes: 94692
#include<cmath>
#include<iomanip>
#include<iostream>
#define A(a,b) S[a]*S[b]*S[n-a-b]*2
#define db long double
using namespace std;
typedef long long ll;
ll n,k,tot;
int lim,l,r,mid;
db S[200005],L,R,Mid,st;

int main()
{
	cout<<setprecision(50);
	cin>>n>>k;lim=n/3;st=3.14159265358979/n;
	if (n%3==0 && n*(n-1)*(n-2)/6<k+n/3)
	{
		cout<<"1.29903810568";
		return 0;
	}
	for (int i=1;i<=n;i++) S[i]=sin(i*st);
	for (L=0,R=1.29903810568,Mid=(L+R)/2;L+0.0000000000001<R;Mid=(L+R)/2,tot=0)
	{
		for (int i=1;i<=lim;i++) if (A(i,i)<Mid)
	  	{
	  	 	for (l=i,r=n-i>>1,mid=l+r+1>>1;l<r;mid=l+r+1>>1) (A(i,mid)<Mid)?l=mid:r=mid-1;
			tot+=(l+1-i<<1)-(i+l+l==n?(i==l?3:2):1);
	  	}
	  	if (k<=tot*n) R=Mid;else L=Mid;
	}
	cout<<L;
}

Measured memory_bytes: 1152
#include <iostream>

using namespace std;

int main()
{
    int x,y,z;
    cin>>x>>y>>z;
    int temp;
    temp=x;
    x=y;
    y=temp;
    temp=z;
    z=x;
    x=temp;
    cout<<x<<" "<<y<<" "<<z<<endl;
}


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

typedef long long int ll;
#define rep(i,n) for (int i = 0; i < (n); i++)
const ll mod = 1000000007;

int main() {
    int n,m; cin >> n >> m;
    int a,b;
    priority_queue<int, vector<int>, less<int>> pq;
    vector<pair<int, int>> t;
    rep(i,n) {
        cin >> a >> b;
        t.push_back({m-a,b});
    }
    sort(t.begin(), t.end());
    //rep(i,n) cout << t[i].first << " " << t[i].second << endl;
    ll ans = 0;
    int pqlen = 0;
    for (int i = m-1; i >= 0; i--) {
        while (n > 0 && i == t[n-1].first) {
            pq.push(t[n-1].second);
            t.pop_back();
            n--;
            pqlen++;
        }
        if (pqlen > 0) {
            ans += pq.top();
            pq.pop();
            pqlen--;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4728
#include<bits/stdc++.h>
#define REP(i,first,last) for(int i=first;i<=last;++i)
#define DOW(i,first,last) for(int i=first;i>=last;--i)
using namespace std;
const int MAXN=1e7+7;
const long long mod=1e9+7;
int N,M;
int K;
long long fac[MAXN];
long long inv[MAXN];
long long Inv(long long a,long long b=mod-2)
{
	long long result=1;
	while(b)
	{
		if(b&1)
		{
			result*=a;
			result%=mod;
		}
		a*=a;
		a%=mod;
		b/=2;
	}
	return result;
}
long long C(int N,int M)
{
	if(M>N)
	{
		return 0;
	}
	if(N==M)
	{
		return 1;
	}
	long long result=fac[N];
	result=(result*inv[N-M])%mod*inv[M];
	return result%mod;
}
int main()
{
	scanf("%d%d",&N,&K);
	fac[1]=1;
	REP(i,2,N+1)
	{
		fac[i]=fac[i-1]*i;
		fac[i]%=mod;
	}
	inv[N+1]=Inv(fac[N+1]);
	DOW(i,N,0)
	{
		inv[i]=1ll*inv[i+1]*(i+1);
		inv[i]%=mod;
	}
	N=N-K;
	M=K;
	REP(i,1,K)
	{
		long long answer=C(N+1,i)*C(M-1,i-1);
		printf("%lld\n",answer%mod);
	}
	return 0;
}

Measured memory_bytes: 2304
#include<iostream>
#include<climits>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
using namespace std;
typedef pair<int ,int> ipair;
typedef long long ll;
int main(){

	int n;
	cin >> n;
	vector< ll > xpos(n);
	vector< ll > ypos(n);
	vector< ll > h(n);

	
	bool flag = false;
	int a,b,c;
	for(int i = 0; i < n; i++)
	{
		cin >> xpos[i] >> ypos[i] >> h[i];
		if(h[i] != 0 and flag == false){
			flag = true;
			a = xpos[i];
			b = ypos[i];
			c = h[i];
		}
	}

	flag = true;
	for(int x = 0; x < 101; x++)
	{
		
		for(int y = 0; y < 101; y++)
		{
			int tmp = abs(a-x) + abs(b-y) + c;
			
			flag = true;
			for(int i = 0; i < n; i++)
			{
				if(h[i]>0){
					if(tmp != abs(x-xpos[i]) + abs(y-ypos[i]) + h[i]){
						flag = false;
						break;
					}
				}else{
					if(tmp > abs(x-xpos[i]) + abs(y-ypos[i])){
						flag = false;
						break;

					}
				}
			}
			if (flag==true){
				cout << x << " " << y << " " << tmp << endl;
			}
		}
		
	}
	
	
	return 0;
}

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

using namespace std;
int n;

int x;
struct can{
	string name;
	int s;
	int num;
}a[104];;
bool cmp(can m,can b){
	return m.name<b.name;
}
bool cmp2(can m,can  b){
	return m.s<b.s;
}
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i].name;
		cin>>a[i].s;
		a[i].s=100-a[i].s;
		a[i].num=i;
	}

	sort(a+1,a+n+1,cmp);
		
	int t=1;
	for(int i=2;i<=n;i++)
	{
		if(a[i].name!=a[i-1].name){
			sort(a+t,a+i,cmp2);
			t=i;
		
		}
	}
	sort(a+t,a+n+1,cmp2);
	for(int i=1;i<=n;i++){
		cout<<a[i].num<<endl;
	}
	return 0;
} 

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans=0;

		if (A > B) {
			ans = A + (A -1);
			}
			else if (B > A ) {
			ans = B + (B -1);
			}
			else {
			ans = A + B ;
			}
		System.out.println(ans);
	}
}


Measured memory_bytes: 21712
#include <stdio.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int cnt[64];

int main() {
    rep (a, 10) rep (b, 10) rep (c, 10) rep (d, 10) cnt[a+b+c+d]++;
    int n;
    while (scanf("%d", &n) != EOF) printf("%d\n", cnt[n]);
    return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define x first
#define pb push_back
#define y second
const int NMAX=100666;
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;

int mark[NMAX];
int sz[NMAX];
int rs;
int a,b,n,m;

int main()
{
    //freopen("input.in", "rt", stdin);
    cin>>n>>m;

    for(int i=1; i<=n; ++i)
        sz[i]=1;
    mark[1]=1;
    for(int i=1; i<=m; ++i)
    {
        cin>>a>>b;
        if(mark[a])
            mark[b]=1;
        sz[a]--;
        sz[b]++;
        if(sz[a]==0)
            mark[a]=0;
    }

    for(int i=1; i<=n; ++i)
        rs+=mark[i];
    cout<<rs;


    return 0;
}


Measured memory_bytes: 1024
#include <unistd.h>

int main(int argc,char **argv){
	char outbuf[544];
	int outptr=0;
	for(int i=1;i<=9;++i){
		for(int j=1;j<=9;++j){
			outbuf[outptr++]=(char)(i+48);
			outbuf[outptr++]=(char)120;
			outbuf[outptr++]=(char)(j+48);
			outbuf[outptr++]=(char)61;
			{
				char outtmpbuf[10];
				int outtmpptr=0,outtmpval=i*j,outtmpdiv;
				do{
					outtmpdiv=outtmpval/10;
					outtmpbuf[outtmpptr++]=(char)(outtmpval-outtmpdiv*10+48);
					outtmpval=outtmpdiv;
				}while(outtmpval);
				while(outtmpptr--) outbuf[outptr++]=outtmpbuf[outtmpptr];
			}
			outbuf[outptr++]=(char)10;
		}
	}
	(void)write(1,(void *)outbuf,(unsigned int)outptr);
	return 0;
}



Measured memory_bytes: 2064
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall

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

edge = [[int(x) for x in input().split()] for _ in range(M)]

graph = [[0] * N for _ in range(N)]
for a,b,c in edge:
  graph[a-1][b-1] = c
  
graph = csgraph_from_dense(graph)

dist = floyd_warshall(graph,directed=False).astype(int)

answer = 0
for a,b,c in edge:
  if c != dist[a-1,b-1]:
    answer += 1
print(answer)


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

using ll = long long;
// #define int long long

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, r, n) for(int i = (n); i >= (r); --i) // from n to r
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))

bool IsPrime(int);

/***** MAIN *****/
signed main() {
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  int tmpDistanceFromA;
  REP(i, s.length()) {
    tmpDistanceFromA = (s[i] - 'A' + n) % 26;
    putchar('A'+tmpDistanceFromA);
  }
  cout << "\n";
  return 0;
}
/***** MAIN *****/

bool IsPrime(int a) {
  if(a <= 1) return false;
  if(a == 2) return true;
  if(a%2 == 0) return false;
  for(int i = 3; i*i <= a; i+=2) {
    if(a%i==0) return false;
  }
  return true;
}

Measured memory_bytes: 256
n = int(input())

pre_list=[1, 6, 9, 36, 81, 216, 729, 1296, 6561, 7776, 46656, 59049]
dp = [-1]*(n+1)
dp[0] = 0
dp[1] = 1

for i in range(2,n+1):
    a = []
    a.append(dp[i-1]+1)
    for j in pre_list:
        if i-j >= 0:
            a.append(dp[i-j]+1)
        else:
            break

    dp[i] = min(a)

print(dp[-1])


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

using ll = long long;
using namespace std;
const int INFint = 2e9+1;
const ll INFll = 2e18+1;
ll MOD=1e9+7;

int main(){
  int N,K;
  cin>>N>>K;
  ll ans(K);
  for(int i(0);i<N-1;i++){
    ans*=(K-1);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define M 1000005
#define P 1000000007
#define LL long long
using namespace std;
int A[M],B[M],n;
char str[M];
int main(){  
	int n,x;
	double res=0;
	cin>>n;
	while(n--){
		scanf("%d",&x);
		res+=1.0/x;
	}
	printf("%.10f",1/res);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <map>
using namespace std;
typedef pair<int,int> P;

int main(){
     int N;
     while(cin>>N,N){
     multimap<int,int> s;
     int tsum=0;
     for(int i=0;i<N;i++){
	  int t,b;
	  cin>>t>>b;
	  tsum+=t;
	  s.insert(P(b,t));
     }
     map<int,int>::reverse_iterator ritr=s.rbegin();
     while(ritr!=s.rend()){
	  if(ritr->first<tsum)break;
	  tsum-=(ritr->second);
	  ritr++;
     }
     
     if(tsum==0)cout<<"Yes"<<endl;
     else cout<<"No"<<endl;
     }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
//#include <fstream>
#include <vector>
#include <bitset>
#include <unordered_map>
#include <algorithm>
#include <queue>
#include <math.h>
#include <iomanip>
#include <cstring>
#include <stack>

using namespace std;

/********** TEMPLATE STARTS HERE ***********/

#define IOS ios::sync_with_stdio(false), cin.tie(0);
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define pb push_back

template <typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template <typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }

/*********** TEMPLATE ENDS HERE *************/

main()
{
	IOS
	
	long long n, p;
	cin >> n >> p;
	
	if(n == 1)
	{
		cout << p;
		return 0;
	}
	
	int k = 1;
	
	int t = sqrt(p);
	
	int i = 2;
	
	while(i <= t && p > 1)
	{
		int nr = 0;
		
		while(p % i == 0)
		{
			p /= i;
			nr++;
		}
		
		while(nr >= n)
		{
			nr -= n;
			k *= i;
		}
		i++;
	}
	
	cout << k;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		char[] cs = new Scanner(System.in).next().toCharArray();
		int count = 0;
		int size = cs.length;
		for (int i = 0; i < size; i++) {
			char r = cs[size - 1 - i];
			char l = cs[i];
			if (!(r == '(' && l == ')' || r == ')' && l == '(' || r == 'i' && l == 'i' || r == 'w' && l == 'w')) {
				count++;
			}
		}
		System.out.println((int) (count / 2.0d + .5));
	}
}

Measured memory_bytes: 12000
N=int(input())

X = int(str(N)[0])
Y = int(str(N)[-1])
L = len(str(N))
if L==1:
    print(N)
else:
    M = N//10 - X*(10**(L-2)) + 1
    D = [[0]*10 for i in range(10)]
    for i in range(1,10):
        for j in range(1,10):
            if i==j:
                D[i][j]+=1
            for k in range(2,L):
                D[i][j]+=10**(k-2)
            if i<X:
                D[i][j]+=10**(L-2)
            elif i==X:
                if j<=Y:
                    D[i][j]+=M
                else:
                    D[i][j]+=M-1
    ans=0
    for i in range(1,10):
        for j in range(1,10):    
            ans+=D[i][j]*D[j][i]
    #print(D[1][2])
    print(ans)

Measured memory_bytes: 38460
while True:
    a, op, b = input().split()       
    a =int(a)                   
    b = int(b)                   

    if op=='?': 
        break
    else:    
        if op=='+':
            print(a+b)
        elif op=='-':
            print(a-b)
        elif op=='*':
            print(a*b)
        elif op=='/':
            print(a//b)


Measured memory_bytes: 5596
n = int(input())
a_list = [0 for _ in range(n)]
for i in range(n):    
    a_list[int(input()) - 1] = i
length = 1
ans = 0
prev = a_list[0]
for i in range(n - 1):
    if (a_list[i + 1] - prev) >= 1:
        length += 1
    else:
        ans = max(length, ans)
        length = 1
    prev = a_list[i + 1]
ans = max(length, ans)
print(n - ans)

Measured memory_bytes: 11052
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  double a,b;
  cin >> a >> b;
  int sum = a+b;
  double ave = (a+b)/2;
  if(sum%2!=0){
    ave = ave + 0.5;
  }
  cout << ave << endl;
}

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

int main() {
    int n, k;
    cin >> n >> k;
    int l[n];
    for (int i = 0; i < n; i++) {
        cin >> l[i];
    }
    sort(l, l + n);
    reverse(l, l + n);
    int res = 0;
    for (int i = 0; i < k; i++) {
        res += l[i];
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#define ll long long
#define maxn 500010
inline ll read()
{
    ll x=0; char c=getchar(),f=1;
    for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
    for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
    return x*f;
}
inline void write(ll x)
{
    static int buf[20],len; len=0;
    if(x<0)x=-x,putchar('-');
    for(;x;x/=10)buf[len++]=x%10;
    if(!len)putchar('0');
    else while(len)putchar(buf[--len]+'0');
}
inline void writeln(ll x){write(x); putchar('\n');}
inline void writesp(ll x){write(x); putchar(' ');}
char s[maxn];
int main()
{
	scanf("%s",s);
	putchar(s[0]); putchar(s[1]); putchar(s[2]);
	return 0;
}

Measured memory_bytes: 1624
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;
bool isPrime(int n)
{
	if (n < 2)return false;
	for (int i = 2; i < n; i++)
	{
		if (n % i == 0)return false;
	}
}
int gcd(int a, int b)
{
	for (int i = min(a, b); i >= 2; i--)
	{
		if (a % i == 0 && b % i == 0) return i;
	}
	return 1;
}
int main()
{
	int X;
	cin >> X;
	int ans = 1;
	for (int b = X; b > 1; b--)
	{
		for (int p = 2; p <= X; p++)
		{
			int t = pow(b, p);
			if (t <= X)
			{
				ans = max(t, ans);
			}
			else {
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#pragma region Debug
template <typename T>
void view(const std::vector<T> &v)
{
    for (const auto &e : v)
    {
        std::cout << e << " ";
    }
    std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T>> &vv)
{
    for (const auto &v : vv)
    {
        view(v);
    }
}
#pragma endregion

int main()
{
    int k, n;
    cin >> k >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<int> b(n + 1);
    for (int i = 0; i < n; ++i)
    {
        int j = (i + 1) % n;
        b[i] = max(0, a[j] - a[i]);
    }
    b[n] = k - a[n - 1] + a[0];
    sort(b.begin(), b.end());
    ll ans = 0;
    rep(i, n) ans += b[i];
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define lb(x) (x&-(x))
const int N = 101010;
char s1[200],s2[200];
int s1len,s2len;
int judge()
{
	
	int minlen=min(s1len,s2len);
	for(int i=0;i<minlen;i++)
	{
		if(s1[i]<s2[i])
		{
			return 1;
		}
		else if(s1[i]==s2[i])
		continue;
		else return 0;	
	}
	if(s1len<s2len)
	return 1;
	else return 0;
}

bool cmp1(char a,char b)
{
	return a<b;
}

bool cmp2(char a,char b)
{
	return a>b;
}
int main(){
	scanf("%s",s1);
	scanf("%s",s2);	
	s1len=strlen(s1);
	s2len=strlen(s2);	
	sort(s1,s1+s1len,cmp1);
	sort(s2,s2+s2len,cmp2);
//	printf("%s\n",s1);
//	printf("%s\n",s2);
	if(judge()) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;

    return 0;
}


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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)
#define mp make_pair

vector<int32> par;
vector<vector<int32>> children;
vector<int32> cntProgeny;

int32 dfs(int32 x){
    if(children[x].empty()){
        return cntProgeny[x] = 0;
    }
    int32 cnt = 0;
    for(int32 y : children[x]){
        cnt = max(dfs(y), cnt);
    }
    return cntProgeny[x] = cnt + 1;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int32 n, u, v;
    cin >> n >> u >> v;
    u--;v--;
    vector<vector<int32>> adj(n);
    REP(i,n-1){
        int32 a,b;
        cin >> a >> b;
        a--;b--;
        adj[a].pb(b);
        adj[b].pb(a);
    }
    par.resize(n,-1);
    children.resize(n); 
    par[v] = v;
    queue<int32> que;
    que.push(v);
    while(!que.empty()){
        int32 s = que.front();que.pop();
        for(int32 t : adj[s]){
            if(t == par[s])continue;
            children[s].pb(t);
            par[t] = s;
            que.push(t);
        }
    }
    cntProgeny.resize(n);
    dfs(v);
    int64 ans = 0;
    int32 deg = 1;
    int32 w = u;
    while(par[w] != w){
        w = par[w];
        deg++;
    }
    ans += max<int32>(0, deg - 2) / 2;
    REP(i,ans){
        u = par[u];
    }
    ans += cntProgeny[u];
    if(deg % 2 == 1){
        ans++;
    }
    ANS(ans);
    return 0;
}

Measured memory_bytes: 16512
def check_change(a, c):
    if a >= c:
        return False
    else:
        return True

def change(A, point, c):
    A[point] = c
    return A
    

N, M = map(int, input().split(' '))
A = list(map(int, input().split(' ')))
A.sort()
card = []
for i in range(M):
    B, C = map(int, input().split(' '))
    card.append([C, B])
card.sort(reverse=True)
point = 0
flag = 0
for (c, b) in card:
    if flag == 1:
        break
    for i in range(b):
        if check_change(A[point], c):
            change(A, point, c)
            point += 1
        
        
        else:
            flag = 1
            break
        if point == N:
            flag = 1
            break
            
print(sum(A))

Measured memory_bytes: 24008
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<string>
#include<math.h>


using namespace std;

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

#define INF 1050000000




int main() {

	int r;

	cin >> r;

	cout << 3 * r * r << endl;


	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <functional>
#include <math.h>
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 1100000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<Pi> > vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
template <class T>
using vec = vector<T>;
template<class T>
using pql = priority_queue<T, vector<T>, greater<T>>;
string debug_show(Pi a) {
	return "(" + to_string(a.first) + "," + to_string(a.second) + ")";
}

template<class T>
struct augEdge {
	T from, to;
	int cost;
	bool operator<(augEdge e) { return cost < e.cost; }
	bool operator>(augEdge e) { return cost > e.cost; }
};
template<class T>
using augGraph = vector<augEdge<T>>;


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

	string n;
	cin >> n;
	string ans = "ABC" + n;
	cout << ans << endl;

	return 0;
}


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

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

    vector<int> a(N + 1), b(N + 1);
    for (int i = 1; i <= N; ++i) a[i] = b[i] = N;

    ll black = ll(N - 2) * (N - 2);

    int H = N, W = N;

    while (Q--) {
        int t, x;
        cin >> t >> x;
        if (t == 1) {
            if (x < W) {
                for (int i = x; i < W; ++i) {
                    b[i] = H;
                }
                W = x;
            }
            black -= b[x] - 2;

        } else {
            if (x < H) {
                for (int i = x; i < H; ++i) {
                    a[i] = W;
                }
                H = x;
            }
            black -= a[x] - 2;
        }
    }
    cout << black << endl;

    return 0;
}


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

int main(){
  int N;
  cin>>N;
 vector<int> B(N-1);
  for(int i=0;i<N-1;i++){
    cin>>B.at(i);
  }
  int sum=0;
  for(int i=0;i<N-1;i++){
    if(i==0){
      sum+=B.at(0);
    }else if(B.at(i)<=B.at(i-1)){
      sum+=B.at(i);
    }else{
      sum+=B.at(i-1);
    }
  }
  sum+=B.at(N-2);
  cout<<sum<<endl;
}

Measured memory_bytes: 3612
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

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

int main() {
    string s;
    cin >> s;
    string ans = (s[2] == s[3] && s[4] == s[5]) ? "Yes" : "No";
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    // Aの最小値から変えるか判定
    int N, M;
    cin >> N >> M;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    sort(A.begin(), A.end());
    vector<P> BC;
    rep(i, M) {
        int b, c;
        cin >> b >> c;
        BC.emplace_back(c, b);
    }
    sort(BC.rbegin(), BC.rend());
    vector<int> X;
    for (auto p : BC) {
        int b = p.second, c = p.first;
        rep(i, b) {
            X.push_back(c);
            if (sz(X) == N) break;
        }
        if (sz(X) == N) break;
    }
    int length = min(N, sz(X));
    rep(i, length) A[i] = max(A[i], X[i]);
    ll ans = accumulate(A.begin(), A.end(), 0L);
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 5224
#include <iostream>

using namespace std;

int main()
{
	string S;
	bool easy2tap = true;

	cin >> S;
	for (int i = 0; i < S.length(); i++) {

		if (i % 2) {
			if (S[i] == 'R') {
				easy2tap = false;
				break;
			}
		}
		else {
			if (S[i] == 'L') {
				easy2tap = false;
				break;
			}
		}
	}
	
	if (easy2tap) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <ctype.h>
#include <map>
#include <vector>
#include <stdlib.h>
#define REP(i,n) for(int i=0;i<(int)n;i++)
#define REP1(j,n) for(int j=0;j<(int)n;j++)
#define REPD(i,n) for(int i=n;i>=0;i--)
#define REPD1(j,n) for(int j=n;j=>0;j--)
#define REPS(i,n) for(int i=1;i<=(int)n;i++)
#define REPS1(j,n) for(int j=1;j<=(int)n;j++)
#define rep(i,a,n) for(int i=a;i<=(int)n;i++)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define DescSort(a) sort(a.begin(),a.end(),std::greater<int>())

using namespace std;
typedef long long ll;

int main(void) {
	double t,x;
	cin >> t >> x;

	cout<<t/x<<endl;
	return 0;
}



Measured memory_bytes: 256
// Etavioxy
#include<cstdio>
#include<cctype>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#define il inline
#define ll long long
#define rep(i,s,t) for(register int i=(s);i<=(t);i++)
#define rev_rep(i,s,t) for(register int i=(s);i>=(t);i--)
#define each(i,u) for(int i=head[u];i;i=bow[i].nxt)
#define file(s) freopen(s".in" ,"r",stdin),freopen(s".out","w",stdout)
#define pt(x) putchar(x)
using namespace std;
il int ci(){
	register char ch;int f=1;
	while(!isdigit(ch=getchar()))f=ch=='-'?-1:1;
	register int x=ch^'0';
	while(isdigit(ch=getchar()))x=(x*10)+(ch^'0');
	return f*x;
}

enum{H=103,N=10023};

struct Edge{ int nxt,to,len; } bow[N*4];
int head[N],tot_e;
il void add(int x,int y,int z){
	bow[++tot_e]=(Edge){head[x],y,z};
	head[x] = tot_e;
}

struct que{
	int num; ll dis;
	bool operator<(const que&e)const{
		return dis>e.dis;
	}
};
bool vis[N];
ll dis[N];
ll dijkstra(int s,int t,int n){
	priority_queue<que> pq;
	memset(vis+1,0,sizeof(bool)*n);
	memset(dis+1,0x3f,sizeof(ll)*n);
	dis[s]= 0;
	pq.push((que){s,dis[s]});
	while( !pq.empty() ){
		int u= pq.top().num;
		pq.pop();
		if( vis[u] )continue;
		vis[u]= 1;
		if( u==t ) return dis[t];
		each(i,u){
			int v= bow[i].to;
			if( dis[v] > dis[u]+bow[i].len ){
				dis[v] = dis[u]+bow[i].len;
				pq.push((que){v,dis[v]});
			}
		}
	}
	return dis[t];
}

char G[H][H];
int num[H][H];

int main(){
	int n=ci(), m=ci();
	rep(i,1,n){
		scanf("%s",G[i]+1);
	}
	int tot = 0;
	int s=++tot, t=++tot;
	rep(i,1,n) rep(j,1,m) num[i][j]=++tot;
	rep(i,1,n) rep(j,1,m){
		if( G[i][j]=='.' ){
			if( i!=n ) add(num[i][j],num[i+1][j],G[i+1][j]=='#');
			if( j!=m ) add(num[i][j],num[i][j+1],G[i][j+1]=='#');
		}else{
			if( i!=n ) add(num[i][j],num[i+1][j],0);
			if( j!=m ) add(num[i][j],num[i][j+1],0);
		}
	}
	add(s,num[1][1],G[1][1]=='#');
	add(num[n][m],t,0);
	printf("%lld\n",dijkstra(s,t,tot));
	return 0;
}


Measured memory_bytes: 640
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	N = II()
	X = LI()
	m = round(sum(X) / N)
	ans = 0
	for x in X:
		ans += ((x-m)**2)
	print(ans)

if __name__ == '__main__':
	main()

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m; i<n; i++)
#define co(n) cout << n << endl
using namespace std;
int main(){
  long e=1e9+10, f, g, h, m, n;
  cin >> n >> m;
  int a[n], b[n], c[m], d[m];
  rep(i,0,n) cin >> a[i] >> b[i];
  rep(i,0,m) cin >> c[i] >> d[i];
  
  long man[m];
  rep(i,0,n){
    rep(j,0,m){
      man[j]=abs(a[i]-c[j])+abs(b[i]-d[j]);
    }
    rep(j,0,m){
      if(man[j]<e){
        e=man[j];
        f=j;
      }
    }
    co(f+1);
    e=1e9+10;
  }
    
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define rFORe(i, a, n) for(int (i) = (int)(n); (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 1, (n))
#define REPo(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rREPe(i, n) rFORe((i), 1, (n))
#define rREPo(i, n) rFORe((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define dup(x, y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using P = pair<int,int>;
using T = tuple<int,int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using vp = vector<P>;
using vt = vector<T>;

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

const int mod = 2019;

int main() {
  string s;
  cin >> s;
  int n = s.size();
  reverse(all(s));
  int x = 1, tot = 0;
  vi cnt(mod);
  ll ans = 0;
  REP(i, n) {
    cnt[tot]++;
    tot += (s[i]-'0')*x;
    tot %= mod;
    ans += cnt[tot];
    x = x*10%mod;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3724
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long
#define ld long double
#define mk make_pair
#define f first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define sz(v) (v).size()
#define inf 1e18
#define md 1000000007
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define tel(a){cout<<a<<"\n";}
#define tell(a,b){cout<<a<<" | "<<b<<"\n";}
#define telll(a,b,c){cout<<a<<" | "<<b<<" | "<<c<<"\n";}
#define teln(v,n){cout<<"v- ";rep(i,0,n)cout<<v[i]<<" ";cout<<"\n";}
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using o_set=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define M 3000010

ll f[M],iv[M];
ll ex(ll a,ll b){
	ll ans=1;a%=md;
	while(b){
		if(b&1)ans=(ans*a)%md;
		a=(a*a)%md;b/=2;
	}
	return ans;
}
ll C(ll n,ll r){
	if(n<r)return 0;
	ll ans=(f[n]*iv[r])%md;
	ans=(ans*iv[n-r])%md;
	return ans;
}
int main(){
	IOS;
	f[0]=1,iv[0]=1;
	rep(i,1,M)f[i]=(i*f[i-1])%md;
	iv[M-1]=ex(f[M-1],md-2);
	for(ll i=M-2;i>=0;--i)iv[i]=(iv[i+1]*(i+1))%md;
	ll r1,c1,r2,c2;
	cin>>r1>>c1>>r2>>c2;
	ll ans = (C(r2+c2+2,c2+1)+C(r1+c1,c1))%md;
	ll ans1 = (C(r1+c2+1,c2+1)+C(r2+c1+1,c1))%md;
	ans=(ans-ans1+md)%md;
	cout<<ans;
	return 0;
}



Measured memory_bytes: 47104
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var x int
	fmt.Scan(&x)
	h, r := d_q(x, 3600)
	m, s := d_q(r, 60)
	fmt.Println(strconv.Itoa(h) + ":" + strconv.Itoa(m) + ":" + strconv.Itoa(s))
}

func d_q(x int, y int) (d int, q int) {
	d = x / y
	q = x % y
	return
}

Measured memory_bytes: 1116
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<vector>
#define inf 2147483647
#define cin1(x) scanf("%d",&x)
#define cin2(x,y) scanf("%d%d",&x,&y)
#define cin3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repb(i,a,b) for(int i=a;i<=b;i++)
#define rr read()
#define ll long long
#define CloseIo ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
const int N = 1e5 + 5;
int m[N];
int h[N];
int main(){
	CloseIo;
	int n;
	cin>>n;
	long long ans=0;
	rep(i,0,n+1)
		cin>>m[i];
	rep(i,0,n){
		cin>>h[i];
		if(h[i]<=m[i])
			ans+=h[i];
		else if(h[i]<=m[i]+m[i+1]){
			ans+=h[i];
			m[i+1]=m[i+1]-h[i]+m[i];
		}else{
			ans+=m[i]+m[i+1];
			m[i+1]=0;
		}
	}
	cout<<ans<<"\n";
	return 0;
}

Measured memory_bytes: 1024