akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == 1)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T> void DEBUG(string str, T e){if(DEBUG_OUT == false)return;std::cout <<str<<" ";DEBUG(e);};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> void SORT_(vector<int>& v,bool GREATER = 0){if(GREATER == 0)sort(v.begin(),v.end());else{sort(v.begin(),v.end(),std::greater<T>());}}

//CODE
void solve(void)
{
  int N;
  cin>>N;
  vector<int> data(N+2,0);
  for (int i = 0; i < N; i++)
  {
    cin>>data[i+1];
    }
    data[N+1] = 0;
  vector<int> dist(N+2,0);
  int SUM = 0;
  for (int i = 0; i < N+1; i++)
  {
    dist[i+1] = abs(data[i+1] - data[i]);
    SUM += dist[i+1];
  }
  for (int q = 0; q < N; q++)
  {
    int i = q;
    cout<<SUM + min(dist[q+1] + dist[q+2] , abs(data[q+2] - data[q])) - dist[q+1] - dist[q+2] <<endl;;
  }
  
  
  
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Measured memory_bytes: 2816
M=10**9+7
def extended_gcd(a, b)
  last_remainder, remainder = a.abs, b.abs
  x, last_x, y, last_y = 0, 1, 1, 0
  while remainder != 0
    last_remainder, (quotient, remainder) = remainder, last_remainder.divmod(remainder)
    x, last_x = last_x - quotient*x, x
    y, last_y = last_y - quotient*y, y
  end
  return last_remainder, last_x * (a < 0 ? -1 : 1)
end

def invmod(e)
  g, x = extended_gcd(e, M)
  x % M
end

k=gets.to_i
n=gets.chomp.size
z=zinv=invmod(26)
q=invmod((2..k).reduce(1){|s,e| s*e%M })
qs=[]
k.downto(0){|i|
  qs[i]=q
  q=q*i%M
  z=z*26%M
}
puts (0..k).reduce(0){|s,i|
  s=(s+z*qs[i])%M
  z=z*25*(n+i)*zinv%M
  s
}

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

const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

template<class Monoid> struct SegTree {
    using Func = function<Monoid(Monoid, Monoid)>;
    const Func F;
    const Monoid UNITY;
    int SIZE_R;
    vector<Monoid> dat;
    
    SegTree(int n, const Func f, const Monoid &unity): F(f), UNITY(unity) { init(n); }
    void init(int n) {
        SIZE_R = 1;
        while (SIZE_R < n) SIZE_R *= 2;
        dat.assign(SIZE_R * 2, UNITY);
    }
    
    /* set, a is 0-indexed */
    void set(int a, const Monoid &v) { dat[a + SIZE_R] = v; }
    void build() {
        for (int k = SIZE_R - 1; k > 0; --k)
            dat[k] = F(dat[k*2], dat[k*2+1]);
    }
    
    /* update a, a is 0-indexed */
    void update(int a, const Monoid &v) {
        int k = a + SIZE_R;
        dat[k] = v;
        while (k >>= 1) dat[k] = F(dat[k*2], dat[k*2+1]);
    }
    
    /* get [a, b), a and b are 0-indexed */
    Monoid get(int a, int b) {
        Monoid vleft = UNITY, vright = UNITY;
        for (int left = a + SIZE_R, right = b + SIZE_R; left < right; left >>= 1, right >>= 1) {
            if (left & 1) vleft = F(vleft, dat[left++]);
            if (right & 1) vright = F(dat[--right], vright);
        }                                                                                                              
        return F(vleft, vright);
    }
    inline Monoid operator [] (int a) { return dat[a + SIZE_R]; }
    
    /* debug */
    void print() {
        for (int i = 0; i < SIZE_R; ++i) {
            cout << (*this)[i];
            if (i != SIZE_R-1) cout << ",";
        }
        cout << endl;
    }
};

int main(){
     int n;cin >>n;
     vector<ll> a(n), h(n);
     for(int i = 0; i < n; ++i){cin >>h[i];--h[i];}
     for(int i = 0; i < n; ++i){cin >>a[i];}
     static SegTree<ll> seg(n, [](ll a, ll b){ return max(a, b); }, 0);
    
    for(int i = 0; i < n; ++i){
        ll tmp = seg.get(0, h[i]);
        seg.update(h[i], tmp+a[i]);
    }
    ll ans = seg.get(0, n);
    cout << ans << endl;
}

Measured memory_bytes: 7424
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;

int32_t N,K;
int32_t num[200001];
int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N>>K;
	for (size_t i = 0; i < N; i++)
	{
		int32_t a;
		in >> a;
		num[a]++;
	}
	std::sort(num, num + 200001);

	int32_t sum = 0;
	for (size_t i = 0; i <= 200000-K; i++)
	{
		sum += num[i];
	}

	out << sum << endl;


	return 0;
}
#endif


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define PI acos(-1)
#define sz 100010
#define RUN_FAST ios::sync_with_stdio(false);
using namespace std;

bool chk[sz];

int main()
{
    RUN_FAST; cin.tie(nullptr);
    string s;
    cin >> s;
    if (s[1]=='S') {
        if (s[0]=='R' || s[2]=='R') cout << 1 << endl;
        else cout << 0 << endl;
    }
    else {
        if (s[0]=='R' && s[2]=='R') cout << 3 << endl;
        else if (s[0]=='R' || s[2]=='R') cout << 2 << endl;
        else cout << 1 << endl;
    }
    return 0;
}
//1
//VISIT http://uva.onlinejudge.org/
//VISIT http://topcoder.com/
//BACK
//BACK
//BACK
//FORWARD
//VISIT http://acm.sgu.ru/
//BACK
//BACK
//FORWARD
//FORWARD
//FORWARD
//QUIT


Measured memory_bytes: 3540
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<array>
#include<vector>
#include<functional>
#include<unordered_map>
#include<map>
#include<numeric>
#include<limits>
#include<utility>
#include<queue>
#include<random>
using namespace std;

int main(void) {
	int m,n,x;
	cin >> m >> n ;

	x = (m - 1)*(n - 1);


	cout << x << endl;

	return 0;
}

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

using namespace std;

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (abs(C - A) <= D || (abs(B - A) <= D && abs(C - B) <= D)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
typedef int ll;
typedef unsigned long long int sll;
typedef long double ld;
#define A 1000000007
#define D 100000000000000ll
#define B 998244353ll
#define C 1000000000000000000ll
#define M 4000
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define oset tree<pair<ll,ll>, null_type,less_equal<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> 
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define br break
#define PI acos(-1)
#define subt cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n" 

int main() 
{
    FAST;
    ll x,y;
    cin>>x>>y;
    if(y>=(2*x) && y<=(4*x) && y%2==0)
        cout<<"Yes";
    else
        cout<<"No";
    subt;
    return 0;
}


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

int main(){
	int n;
	cin>>n;
	int a[n],b[100000];
	for(int i=0; i<n; i++)cin>>a[i];
	fill(b,b+100000,0);
	for(int i=0; i<n; i++)b[a[i]]++;
	int max=b[0];
	for(int i=2; i<100000; i++){
		if(max<b[i-2]+b[i-1]+b[i]){
			max=b[i-2]+b[i-1]+b[i];
		}
	}
	cout<<max<<endl;
}

Measured memory_bytes: 1024
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def is_tasai(S):
    appare_set = set([])
    for s in S:
        if s in appare_set:
            return False
        appare_set.add(s)
    return True

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    S = input_raw[0]
    appare_set = set([])
    z_pos = 0
    for i in range(len(S)):
        if S[i] == "z":
            z_pos = i
        appare_set.add(S[i])

    not_appare = -1
    for s in range(ord("a"), ord("z") + 1):
        if chr(s) not in appare_set:
            print S + chr(s)
            return
    for i in range(len(S) - 1, -1, -1):
        new_s = chr(ord(S[i]) + 1)
        while new_s <= "z":
            S = S[:i]
            S += new_s
            if is_tasai(S) == True:
                print S
                return
            new_s = chr(ord(new_s) + 1)
        S = S[:i]
    print -1



if __name__ == '__main__':
    main()


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

int main() {
  int count=0;
  string str;
  cin >> str;
  for(int i = 0; i < (int)str.size(); ++i){
      if(str[i]=='1') count++;
  }
  cout << count << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi vector<vector<int> >
#define vvl vector<vector<ll> >
#define MODs 1000000007;
typedef long double ll;
using namespace std;

///////////////////////////
#define INF 10000000000000000
#define MAX_V 1000000
typedef pair<ll, ll> p;
struct edge{ll to, cost;};
vector<vector<edge> > G(MAX_V);
vector<ll> pre(MAX_V,-1);
priority_queue<p, std::vector<p>, greater<p> > que; //class, inner, compair
vector<ll> d(MAX_V+1, INF);
void dijkstra(int start){
  d[start]=0;
  que.push(p(0, start));
  while(!que.empty()){
    p p_now=que.top(); que.pop();
    ll v = p_now.second;
    if(d[v]<p_now.first) continue;
    for(int i=0;i<G[v].size();i++){
      edge e = G[v][i];
      if(d[e.to]>d[v]+e.cost){
        d[e.to]=d[v]+e.cost;
        pre[e.to] = v;
        que.push(p(d[e.to], e.to));
      }
    }
  }
}
ll get_d(ll x1, ll y1, ll r1, ll x2, ll y2, ll r2){
  ll tmp = sqrt(((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))) - (r1+r2);
  return (tmp<0?0:tmp);
}
/////////////////////////////////////////////
int main(int argc, char const *argv[]) {
  ll xs, ys, xt, yt, N;
  std::cin >> xs >> ys >> xt >> yt;
  std::cin >> N;
  vvl sp = vv(N+2, 3, 0, ll);
  sp[0][0] = xs, sp[0][1] = ys, sp[0][2] = 0, sp[N+1][0] = xt, sp[N+1][1] = yt, sp[N+1][2] = 0;
  for(ll i=1;i<=N;i++) std::cin >> sp[i][0] >> sp[i][1] >> sp[i][2];
  for(ll i=0;i<=N+1;i++) for(ll j=0;j<i;j++){
    ll D = get_d(sp[i][0], sp[i][1], sp[i][2], sp[j][0], sp[j][1], sp[j][2]);
    G[i].push_back(edge{j, D});
    G[j].push_back(edge{i, D});
  }
  dijkstra(0);
  std::cout << fixed << setprecision(8) << d[N+1] << '\n';
  return 0;
}


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

int main(void){
	int n;
	while(cin>>n){
		vector<int> s;
		for(int i=512;i>0;i>>=1){
			if(n>=i){
				n-=i;
				s.push_back(i);
			}
		}
		for(int it=s.size()-1;it>=0;it--){
			if(it!=0)cout<<s[it]<<" ";
			else cout<<s[it];
		}
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 3152
import math
n = int(input())
city = []
for i in range(n):
  x,y = map(int, input().split())
  city.append((x,y))

def dist(p1, p2):
  return math.sqrt(math.pow(p1[0]-p2[0],2) + math.pow(p1[1]-p2[1], 2))

ans = 0
for i in range(n):
  for j in range(i+1,n):
    d = dist(city[i], city[j])
    ans += d
print(ans / n / (n-1) * 2 * (n-1))

Measured memory_bytes: 38384
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#define PI 3.14159265358979323846

int main(void){
	float d , r , x = 0 , y = 0 , r_now = 90;
	while(1){
		scanf("%f,%f" , &d , &r);
		if(d==0&&r==0) break;
		x += d * cos(r_now * PI / 180);
		y += d * sin(r_now * PI / 180);
		r_now -= r;
	}
	printf("%d\n%d\n" , (int)x , (int)y);
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(long long (i)=0;(i)<(n);(i)++)
#define ll long long
#define pr_qu priority_queue
#define vec(name,size,common) vector<ll> (name)((size),(common))
 
 
 
 
 
int main(){
  string s;
  cin>>s;

  for(int i=0;i<s.size();i++){
    if(s.at(i)==','){
      s.at(i) = ' ';
    }
  }

  cout<<s<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,x,n) for(int i=x;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
#define sp(p) cout<<setprecision(16)<<fixed<<p<<endl;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(a))
#define UNIQ(a) unique(all(a))
#define UNIQNUM(a) UNIQ(a)-a.begin()
#define UNIQIT(a) a.erase(UNIQ(a), a.end());
#define VOUT(v,i) rep(i,v.size())cout<<v[i]<<(i==v.size()-1?"\n":" ");
#define vout(v) VOUT(v,z);
#define vdbg(v,i) cout<<#v<<": ";for(int i=0;i<(int)v.size();i++){cout<<v[i]<<" ";}cout<<"\n";
#define vmin(v) *min_element(all(v))
#define vmax(v) *max_element(all(v))
#define vsum(v) accumulate(all(v), 0LL)
#define MOUT(m,r,c) rep(i,r){rep(j,c){cout<<m[i][j]<<" ";}cout<<endl;}
#define mout(m) MOUT(m,m.size(),m[0].size())
#define debg(a) cout<<#a<<": "<<a<<endl;
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
#define digit(a) to_string(a).length();
template<class T>inline int out(const T &t){ print(t); putchar('\n'); return 0; }
// template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
// template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
bool is_palindrome(string s){return s == string(s.rbegin(),s.rend());}
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef vector<ll> V;
typedef vector<vector<ll>> VV;
// const long long MOD=1000000007;
const long long INF = 1e18;
#define EPS (1e-7)
#define PI (acos(-1))
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;
}



int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }

    unsigned long long prd;
    ll upp=pow(10,18);
    SORT(A);
    if(A[0]==0){
        cout << 0 << endl;
        return 0;
    }
    prd=A[0];
    for (long long i = 1; i < N; i++) {
        // if(prd<0 || prd>upp){
        if(!(prd < LONG_LONG_MAX / A[i])){
            cout << -1 << endl;
            return 0;
        }
        prd*=A[i];
        if(prd<0 || prd>upp){
            cout << -1 << endl;
            return 0;
        }
    }
    // if(prd<0 || prd>upp){
    //     cout << -1 << endl;
    //     return 0;
    // }
    cout << prd << endl;
    return 0;
}


Measured memory_bytes: 4060
#include<string>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>


using namespace std;


int main()
{
    int n,x=0,y=0;
    cin>>n;
    string s;
    cin>>s;
    for(int i=0;i<n;i++)
    {if(s[i]=='D')
    x--;
    else
    x++;
    y=max(x,y);}
    cout<<y;                    
     return 0;
}     
                        

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
maxa = max(A)
mina = min(A)
print(2*N-1)
if abs(maxa) > abs(mina):
  k = A.index(maxa)
  for i in range(N):
    print(k+1,i+1)
    A[i] += A[k]
  for i in range(1,N):
    A[i] += A[i-1]
    print(i,i+1)
else:
  k = A.index(mina)
  for i in range(N):
    print(k+1,i+1)
    A[i] += A[k]
  for i in range(N,1,-1):
    print(i,i-1)
    A[i-2] += A[i-1]



Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <set>
#include <cctype>
#include <vector>
#include <map>
#include <queue>
#include <list>
#include <algorithm>
#include <ctime>
#include <cstdio>
#include <cstring>
#include <limits>
#include <cmath>
#include <typeinfo>


using namespace std;

int main() {
	string s;
	cin >> s;
	string t = s;
	bool isYYMM = s.substr(2,2) <= "12" and s.substr(2,2) >= "01";
	bool isMMYY = s.substr(0,2) <= "12" and s.substr(0,2) >= "01";
	if(isYYMM and isMMYY) {
		cout << "AMBIGUOUS" << endl;
	}
	else if(isMMYY) {
		cout << "MMYY" << endl;
	}
	else if(isYYMM) {
		cout << "YYMM" << endl;
	}
	else {
		cout << "NA" << endl;
	}

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
long long int a[55][6005];
int main(){
	int n,s;
	int i,j,k;
	int c[52];
	cin>>n>>s;
	for(i=0;i<n;i++){
		cin>>c[i];
		c[i]-=s;
	}
	a[0][3000]=1;
	for(i=0;i<n;i++){
		for(j=0;j<6000;j++){
			if(j-c[i]<0 || j-c[i]>=6000){
				a[i+1][j]=a[i][j];
			}else{
				a[i+1][j]=a[i][j]+a[i][j-c[i]];
			}
		}
	}
	cout<<(a[n][3000]-1)<<endl;
	return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;

int main()
{
    char op[2] = {'+', '-'};
    int arr[4];
    int a;
    
    for (int i = 0; i < 4; i++) {
        scanf("%1d", &arr[i]);
    }

    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 2; j++) {
            for (int k = 0; k < 2; k++) {
                a = arr[0];

                if (i == 0) a = a + arr[1];
                else a = a - arr[1];

                if (j == 0) a = a + arr[2];
                else a = a - arr[2];

                if (k == 0) a = a + arr[3];
                else a = a - arr[3];

                if (a == 7) {
                    printf("%d%c%d%c%d%c%d=%d\n", arr[0], op[i],
                           arr[1], op[j],
                           arr[2], op[k],
                           arr[3],
                           7);
                    
                    exit(0);
                }
                                                              
            }
        }
    }

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define vi vector<int>
#define ii pair<int, int>
#define ll long long int
#define MAX 200010
#define MOD 1000000007
#define oo 0x7fffffff
#define endl '\n'
using namespace std;

int N, M;

class UFDS{
private: vi p, size;
public:
	UFDS(int N){
		size.assign(N+1, 1);p.assign(N+1, 0);
		iota(p.begin(), p.end(), 0);
	}
	int find_set(int i) {
		return (p[i] == i) ? i : find_set(p[i]);
	}
	bool same_set(int i, int j) { 
		return find_set(i) == find_set(j);
	}
	void union_set(int i, int j) {
		if(same_set(i, j))
			return;

		int x = find_set(i), y = find_set(j);
		
		if(size[x] < size[y])
			swap(x, y);
		p[y] = x;
		size[x] += size[y];
	}
	int get_size(int i){
		return size[find_set(i)];
	}
};

int main()
{
   
	fastio;
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);

	cin >> N >> M;
	UFDS udfs(N);
	REP(i, 0, M){
		int a, b;
		cin >> a >> b;
		udfs.union_set(a, b);
	}
	int ans = 0;
	REP(i, 1, N+1){
		// cout << udfs.find_set(i) << endl;
		ans = max(ans, udfs.get_size(i));
	}
	cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4756
#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
  int h,n;
  cin>>h>>n;

 int a[h];
  for(int i=0;i<h;i++)
  {
    cin>>a[i];
    
  }
  
 sort(a,a+h);
 
 if(h<=n)
 cout<<0<<endl;
 else
 {
     int s=0;
     for(int i=0;i<h-n;i++)
     {
         
         s+=a[i];
     }
     cout<<s<<endl;
 }
  
  
  
}


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

#define ll long long int
#define rep(i, a, n) for (ll i = a; i < n; i++)
#define repm(i, a, n) for (ll i = a; i >= n; i--)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define mod (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vd vector<double>
#define vb vector<bool>
#define vs vector<string>
#define vii vector<vector<int>>
#define vllll vector<vector<ll>>
#define ALL(a) (a).begin(), (a).end()

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

void print(bool f)
{
    cout << (f ? "Yes" : "No") << endl;
}

void Print(bool f)
{
    cout << (f ? "YES" : "NO") << endl;
}

struct mint
{
    ll x;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint &operator+=(const mint a)
    {
        if ((x += a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator-=(const mint a)
    {
        if ((x += mod - a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator*=(const mint a)
    {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const
    {
        if (!t)
            return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint &operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream &operator>>(istream &is, const mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }

mint RepeatSquaring(mint N, ll P, ll M) //N^P mod M
{
    if (P == 0)
        return 1;
    if (P % 2 == 0)
    {
        mint t = RepeatSquaring(N, P / 2, M);
        return t * t;
    }
    return N * RepeatSquaring(N, P - 1, M);
}

mint c(ll n, ll a)
{
    mint x = 1, y = 1;
    repm(i, n, n - a + 1) x *= i;
    repm(i, a, 1) y *= i;
    y = RepeatSquaring(y, MOD - 2, MOD);
    return x * y;
}

int main(void)
{
    ll n, a, b;
    cin >> n >> a >> b;

    mint ans = RepeatSquaring(2, n, MOD);
    ans -= 1;
    ans -= c(n, a);
    ans -= c(n, b);
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <string.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<ld> vd;
typedef vector<char> vc;
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define F(ii,a,n) for(ii=a;ii<n;ii++)
#define read(array,n) for(ll i=0;i<n;i++) cin>>array[i];
#define inf 1000000007;
// function to transform string to lowercase --> transform(s.begin(),s.end(),s.begin(),::tolower)
//(a + b ) % m = (a % m + b % m ) %m
//(a - b ) % m = ( ((//(//(a - b ) % m = ( (a % m - b % m ) + m ) %m
// a % m - b % m ) + m ) %m
//(a * b ) % m = (a % m * b % m ) %m
//(a / b ) % m = (a % m * inv(b) ) %m where inv(b) = pow(b,m,m-2)



ll power(ll i,ll j){
	ll prod=1;
	while(j>0){
		if(j&1){
			prod=prod*i;
		}
		j=j>>1;
		i=i*i;
	}
	return prod;
}

void solve(){
	ll i,j,n,k;
	string s,t;
	cin>>s>>t;
	ll ans=0;
	for(i=0;i<s.size();i++){
		if(s[i]!=t[i]){
			ans++;
		}
	}
	cout<<ans<<endl;
}
int main(){
	// freopen("filename.txt","r",stdin);
	solve();
	// ll t;
	// cin>>t;
	// while(t--){
	// 	solve();
	// }
}

Measured memory_bytes: 3852
from math import ceil

D, G = [int(t) for t in input().split()]
p = []
c = []
for i in range(D):
    p_, c_ = [int(t) for t in input().split()]
    p.append(p_)
    c.append(c_)


def minsolve(G, i):
    """100i点以下の問題だけでGを達成する最小問題数"""
    if i <= 0:
        return float('inf')
    n = min(ceil(G / (100 * i)), p[i-1])
    s = 100 * i * n
    if n == p[i-1]:
        s += c[i-1]
    m = n if s >= G else n + minsolve(G - s, i-1)
    return min(m, minsolve(G, i-1))


print(minsolve(G, D))


Measured memory_bytes: 3064
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n, k) for (int i = n; i < k; i++)
#define P(p) cout << (p) << endl;
#define sP(p) cout << setprecision(15) << fixed << p << endl;
#define vi vector<int>
#define printv(v)                      \
    for (int i = 0; i < v.size(); i++) \
        P(v[i]);
#define printt(a, b) cout << a << " " << b << endl;
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int dx8[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int MOD = 1e9 + 7;

void solve()
{
    map<int, int> m;
    int n;
    cin >> n;
    rep(i, n)
    {
        int a;
        cin >> a;
        m[a]++;
    }
    int count = 0;
    for (auto it = m.begin(); it != m.end(); ++it)
    {
        if (it->second % 2 == 1)
            count++;
    }
    P(count);
}

int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 4864
#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(a)     (a).begin(),(a).end()
#define VI         vector<int>
#define MOD 1000000007

using ll = long long int;
using P = pair<int,int>;

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

const ll INF=(ll)1e19;
//const int INF=(1<<30);
//const int INF=(1<<29);

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

  bool ok=true;
  REP(i,N){
    int a;
    cin >> a;
    if(a%2==1)ok=false;
  }

  cout << (ok ? "second" : "first") << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#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 sp(n) cout << fixed << setprecision(n)
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; }
typedef long long ll;
using namespace std;
int main(void){
    string s,t;cin>>s>>t;
    rep(i,s.size()){
        string ns="";
        ns.push_back(s[s.size()-1]);
        ns+=s.substr(0,s.size()-1);
        if(ns==t){
            cout<<"Yes"<<endl;
            return 0;
        }
        //cout<<ns<<endl;
        s=ns;
    }
    cout<<"No"<<endl;
}

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}

int main() {
  int n,a,ans=0;
  cin>>n;
  rep(i,n){
    cin>>a;
    if(a%2==1){
      ans++;
    }
  }
  if(ans%2==0){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
#define INF 1e8
typedef long long ll;
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int main() {
    int n, t; cin >> n >> t;
    vector<int> v(t);
    rep(i,t){
        cin >> v[i];
    }
    sort(RALL(v));
    int ans = v[0];
    REP(i,1,t){
        ans = abs(ans-v[i]);
    }
    cout << max(0,ans-1) << endl;


    return 0;
}

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

using namespace std;
#define ll long long 

int main() 
{
   ll x;
   cin>>x;

    ll p=100;
    ll c=0;
   while(p<x)
   {
       p+=p*1/100;
       c++;
   }
   cout<<c<<endl;
   
}

Measured memory_bytes: 3632
from collections import deque
from bisect import bisect_left
N=int(input())
li=[]
ans=0
for i in range(N):
    a=-int(input())
    b=bisect_left(li,a+1)
    if b==len(li):
        li.append(a)
        ans+=1
    else:
        li[b]=a
print(ans)

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

namespace AOJ
{
  class Program
  {
    public static void Main(string[] args)
    {
      foreach (var ss in ReadNumbers())
        Console.WriteLine(ss.Sum().ToString().Length);
    }

    static IEnumerable<IEnumerable<int>> ReadNumbers()
    {
      string line;
      while ((line = Console.ReadLine()) != null)
        yield return line.Split(' ').Select(s => int.Parse(s));
    }
  }
}

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

ll A,B,C;

int main(){
  cin >>  A>> B >> C;

  if( ( A & 1 ) && (B &1 ) && (C&1 ) ){
    cout << min( A*B, min( B*C , A*C ) ) << endl;
  } else {
    cout << 0 << endl;
  }
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
	"unsafe"
)

func main() {
	// var N int
	// fmt.Scan(&N)
	N := sc.nextInt()
	// a := make([]int, N)
	a := sc.nextInts()

	for i := 0; i < N; i++ {
		fmt.Scan(&a[i])
	}

	first := a[0]
	cnt := 1
	for i := 0; i < N; i++ {
		if a[i] < first {
			cnt++
			first = a[i]
		}

	}
	fmt.Println(cnt)
}

/* template functions */
var (
	sc scanner
)

func init() {
	sc = scanner{
		buf: make([]string, 0, 0),
		cur: 0,
		r:   bufio.NewReader(os.Stdin),
	}
}

type scanner struct {
	buf []string
	cur int
	r   *bufio.Reader
}

func (s *scanner) readln() {
	rbuf := make([]byte, 0, 0)
	for {
		line, prefix, err := s.r.ReadLine()
		if err != nil {
			panic(err)
		}
		rbuf = append(rbuf, line...)
		if prefix == false {
			break
		}
	}
	s.cur = 0
	s.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), " ")
}

func (s *scanner) isFull() bool {
	if s.cur == len(s.buf) {
		return true
	}
	return false
}

func (s *scanner) resetCur() {
	s.cur = 0
}

func (s *scanner) next() string {
	if s.cur == 0 {
		s.readln()
	}
	res := s.buf[s.cur]
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}

func (s *scanner) nexts() []string {
	s.readln()
	s.resetCur()
	return s.buf
}

func (s *scanner) nextInt() int {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.Atoi(s.buf[s.cur])
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}

func (s *scanner) nextInts() []int {
	s.readln()
	res := make([]int, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.Atoi(s.buf[i])
	}
	s.resetCur()
	return res
}

func (s *scanner) nextFloat() float64 {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.ParseFloat(s.buf[s.cur], 64)
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}

func (s *scanner) nextFloats() []float64 {
	s.readln()
	res := make([]float64, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.ParseFloat(s.buf[i], 64)
	}
	s.resetCur()
	return res
}

func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}

func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}

func abs(x int) int {
	return int(math.Abs(float64(x)))
}

func varDump(value ...interface{}) {
	for _, v := range value {
		fmt.Fprintf(os.Stderr, "%#v\n", v)
	}
}

func yes() {
	fmt.Println("Yes")
}

func no() {
	fmt.Println("No")
}


Measured memory_bytes: 13056
import java.util.*;
public class Main
{
  public static void main(String args[])
  {
    Scanner sc = new Scanner(System.in);
    int n =sc.nextInt();
    int s = sc.nextInt();
    int sum=0;
    if( s > 0)
    {
        for(int i=2;i<=n;i++)
        {
            sum =sum + (s + i -1);
        }
    }
    else if(s == 0)
    {
        n=n-1;
        sum = (n*(n+1)) / 2; 
    }
    else
    {
        if(n+s > 0)
        {
            for(int i=1;i<=n;i++)
            {
                sum =sum + (s + i -1);
            }
        }
        else 
        {
            for(int i=1;i<=n-1;i++)
            {
                sum =sum + (s + i -1);
            }
        }
    }
    
    System.out.println(sum);
    
  }
}

Measured memory_bytes: 21844
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
#include <random>

using namespace std;

const int MOD = 1000000007;
typedef long long ll;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N,M;
  cin>>N>>M;
  vector<int> x(N+1),y(M+1);
  cin>>x[0]>>y[0];
  for(int i=1;i<=N;i++){
    cin>>x[i];
  }
  for(int i=1;i<=M;i++){
    cin>>y[i];
  }

  sort(x.rbegin(),x.rend());
  sort(y.begin(),y.end());

  if(x[0]<y[0]){
    cout<<"No War"<<endl;
  }else{
    cout<<"War"<<endl;
  }
}


Measured memory_bytes: 256
R,G,B,N = gets.chomp.split(" ").map(&:to_i)

max_r = N/R + 1
max_g = N/G + 1

count = 0
max_r.times do |i|
    max_g.times do |j|
        if ((N - R*i  - G*j) >= 0)
            if ((N - R*i  - G*j)%B == 0)
                count += 1
            end
        end
    end
end
puts count


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,n) for(int i=0; i < n; i++)
#define ALL(n) begin(n), end(n)

const int INF = 1001001001;
int dp[1000005][2];

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

  reverse(n.begin(), n.end());
  n += "0";
  REP(i, n.size()+1)REP(j, 2) dp[i][j] = INF;
  dp[0][0] = 0;
  REP(i, n.size())REP(j, 2){
    int x = n[i]-'0';
    x += j;
    REP(a, 10){
      int ni = i+1, nj = 0;
      int b = a-x;
      if(b < 0){
        nj = 1;
        b += 10;
      }
      dp[ni][nj] = min(dp[ni][nj], dp[i][j]+a+b);
    }
  }

  int ans = dp[n.size()][0];
  cout << ans << endl;
  return 0;
}

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

typedef long long int lli;
typedef vector<lli> vlli;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define IO freopen("in.txt","r",stdin); freopen("out.txt","w",stdout)
#define pb push_back  
#define pf push_front
#define ub upper_bound 
#define lb lower_bound
#define bs binary_search
#define mp make_pair
#define F first
#define S second
#define plli pair<lli,lli>
#define all(a) (a).begin(),(a).end() 
#define PI 3.141592653589793238
#define mod 1000000007
char nn = '\n';

lli temp,arr[1000005],fk,sk,k;

lli firstdig(lli a)
{
	lli x=log(a)/log(10);
	lli y=a/pow(10,x);
	return y;
}

lli findsize(lli a)
{
	lli x=log(a)/log(10)+1;
	return x;
}

lli findnum(lli a,lli b)
{
	lli x;
	x=a*pow(10,b)+arr[b];
	return x;
}

lli finddig(lli a)
{
	lli c;
	if(a!=0)
	{
		lli fa=firstdig(a),sa=findsize(a); 
		if(fa>fk) c=sk-sa;
		else c=sk-sa+1;
	}
	else
	{
		if(7>=fk) c=sk;
		else c=sk+1;
	}
	temp=findnum(a,c);
	if(temp<k) temp=findnum(temp,1);
	return c;
}

int main()	 	
{	
	IOS;		
	#ifndef  ONLINE_JUDGE
	IO;
	#endif
	lli t=1,i,h,n;
	bool f=true;
	string str;

	arr[1]=7;
	for(i=2;i<1000005;i++) arr[i]=arr[i-1]*10+7;
	lli c=0,rem=-1;
	set<lli> s;
	cin>>k;
	fk=firstdig(k);
	sk=findsize(k);
	//cout<<fk<<" "<<sk<<nn;
	lli p=finddig(0);
	//cout<<p<<" "<<temp<<nn;
	while(rem!=0 && s.find(rem)==s.end())
	{
		c+=p;
		s.insert(rem);
		rem=temp%k;
		p=finddig(rem);
		//cout<<temp<<" "<<rem<<nn;
	}
	if(rem!=0) cout<<-1<<nn;
	else cout<<c<<nn;
	return 0;	
}

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

using namespace std;
using ll = long long int;

int main(){
    int A,B,C;
    cin>>A>>B>>C;
    
    bool ok=false;;
    if(A==B){
        if(B!=C) ok=true;
        else ok=false;
    }
    if(B==C){
        if(A!=C) ok=true;
        else ok=false;
    }
    if(A==C){
        if(A!=B) ok=true;
        else ok=false;
    }
    
    if(ok) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    return 0;
}



Measured memory_bytes: 256
import Data.List
primes = [2,3,5,7,11]

decomp :: [Int] -> Int -> [Int]
decomp _ 1 = []
decomp p@(ph:pt) n = 
    if (n `mod` ph) == 0
    then ph:(decomp p (n `div` ph) )
    else decomp pt n
f :: [Int] -> [Int] -> Int
f _ [] = 1
f (p:ps) (v:ds) = p^(v-1) * (f ps ds)

idx n = idx' n
    where
        idx' 1 = map (\i -> [i]) [1..n]
        idx' k = 
            let t = idx' (k-1)
            in
                concat $ map (\i -> map (\s -> i:s) t) [1..n]

divide s =
    let i = idx l
        d = map (\j -> zip j s) i
    in
        map (\a -> filter (/= []) a) $ nub $ map f d
    where
        l = length s
        f d = sort $ map (\ i -> map snd $ filter (\(j,v) -> i==j) d) [1..l]

cal :: [[Int]] -> Int
cal l =
    let p = reverse $ sort $ map (\l0 -> foldl (\p a -> p * a) 1 l0) l
    in
        f primes p 

-- |
-- >>> ans 1
-- 1
-- >>> ans 2
-- 2
-- >>> ans 3
-- 4
-- >>> ans 4
-- 6
-- >>> ans 5
-- 16
-- >>> ans 6
-- 12
-- >>> ans 7
-- 64
-- >>> ans 8
-- 24

--ans 1 = 1
ans n = 
    let d = reverse $ decomp primes n
        s = divide d
        a = map cal s
    in
        if a == [] then 1 else (minimum a)

main = do
  l <- getLine
  let i = read l :: Int
      o = ans i
  print o


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

int main()
{
    int c[3][3];
    for(int i = 0; i < 3; ++i) 
        for(int j = 0; j < 3; ++j) 
            cin >> c[i][j];

    for(int i = 0; i < 3; ++i) {
        int tmp = c[i][0];
        for(int j = 0; j < 3; ++j) c[i][j] -= tmp;
    }

    for(int i = 0; i < 3; ++i) {
        int tmp = c[0][i];
        for(int j = 0; j < 3; ++j) c[j][i] -= tmp;
    }

    bool flg = true;
    for(int i = 0; i < 3; ++i) 
        for(int j = 0; j < 3; ++j)
            if(c[i][j] != 0) flg = false;
    
    if(flg) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>	
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(2e9);
const int mod = inf + 7;
using namespace std;

const int N = 100000;

void solve(){
	long double t, x;
	cin >> t >> x;
	cout << fixed << setprecision(3) << t / x;
}

int main() {
	Red;
	solve();
	return 0;
}

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

int main(){
 
    int a;
  	cin >> a;
    (a%2==0?a=(a/2)*(a/2):a=(a/2)*((a/2)+1));
    cout<<a<<endl;

}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    int ans = 1;
    int h_max;
    cin >> h_max;
    for (int i=0; i<n-1; i++) {
        int h;
        cin >> h;
        if (h_max <= h) {
            ans++;
            h_max = h;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};
#[allow(unused_imports)]
use std::io::{stdout, stdin, BufWriter, Write};

fn main() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }

    input!{
      n: usize,
      k: usize,
      aa: [usize; n],
    }

    let mut s = vec![0; n+1];
    for i in 0..n {
        s[i+1] = (s[i] + k + aa[i] - 1) % k;
    }

    use std::collections::HashMap;
    let mut map = HashMap::new();
    let mut ans: usize = 0;
    for i in 0..n+1 {
        if i >= k {
            *map.entry(s[i-k]).or_insert(0) -= 1;
        }

        if map.contains_key(&s[i]) {
            ans += map[&s[i]];
        }
        *map.entry(s[i]).or_insert(0) += 1;
    }
    puts!("{}\n", ans);
}


Measured memory_bytes: 19208
import java.util.*;
class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    final int N = sc.nextInt();
    int[] a = new int[N];
    long sumb = 0;
    for (int i = 0; i < N; i++) {
      a[i] = sc.nextInt();
      sumb += a[i];
    }

    long suma = a[0];
    sumb -= a[0];
    long mindiff = Math.abs(sumb - suma);
    for (int i = 1; i < N-1; i++) {
      suma += a[i];
      sumb -= a[i];
      if (Math.abs(suma - sumb) < mindiff)
        mindiff = Math.abs(suma - sumb);
    }
    System.out.println(mindiff);
  }
}

Measured memory_bytes: 73024
import sys
from collections import Counter

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    w = readline().strip()
    c = Counter(w)

    ok = True
    for v in c.values():
        if v % 2:
            ok = False
            break

    if ok:
        print('Yes')
    else:
        print('No')

    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9272
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <cmath>
#include <stdlib.h>

using namespace std;

#define int long long
#define endl "\n"
#define all(v)  v.begin(),v.end()
#define fir first
#define sec second
#define m_p make_pair
#define m_t make_tuple
#define rep(i,n)  for(int i=0; i<(int) (n); i++)


const double pai = 3.1415926535897;
const int mod = 1000000007;
const int INF = 2000000015;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];


int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}
int krag(double xx) {
	return INF - (int)(INF - xx);
}
//x未満の要素数を返す二分探索関数
int b_s(vector<int>& vec, int xx) {
	int t = -1;
	int f = vec.size();
	while (f - t > 1) {
		int m = (t + f) / 2;
		if (vec[m] < xx) {
			t = m;
		}
		else {
			f = m;
		}
	}
	return f;
}
template<typename T>
void vecout(vector<T>& vec) { for (T t : vec) cout << t << " "; cout << endl; }
template<typename TT>
void vecin(vector<TT>& vec) { 
	for (int i = 0; i < vec.size(); i++) {
		cin >> vec[i];
	}
}


// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}
//n個を1個以上のx組のグループに分ける重複組み合わせはcom(n-1,x-1)
//グループが0個でもいいときはnにxを足す
// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	if (xx == 1) {
		return 0;
	}
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}




signed main() {
	int a = 0;
	string s, t;
	cin >> s >> t;
	rep(i, s.size()) {
		if (s[i] != t[i]) {
			a++;
		}
	}
	cout << a << endl;
}


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

  #define lp(start,finish) for(int i=start; i<finish; i++)
  #define read freopen("input.txt","r",stdin);
  #define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);

int main(){
	//read
	int n,k;
	cin >> n >> k;
	int gap = 0;
	lp(1,n+1){
		gap++;
		i++;
	}
	if(gap>=k) cout << "YES\n";
	else cout << "NO\n";
	return 0;
}

Measured memory_bytes: 256