akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <cmath>
#include <stdlib.h>
#include <algorithm>
#include <functional>
#include <array>
#include <vector>

int main()
{
    int towns[4] = {0,0,0,0};
    for(int i = 0;i < 3;i++)
    {
        int a,b;
        scanf("%d",&a);
        scanf("%d",&b);
        towns[a-1]++;
        towns[b-1]++;
    }

    for(int i = 0;i < 4;i++)
    {
        if(towns[i] == 3)
        {
            printf("NO");
            return 0;
        }
    }
    printf("YES");
    
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <vector>
#include <numeric>
#define PI 3.14159265358979323846
#define MAXINF 1e18L
#define INF 1e9L
#define EPS 1e-9
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define pb push_back
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
typedef long long ll;
typedef pair<int, int> pii;

int main(void)
{
    int a,b;
    cin >> a >> b;
    pr((a-1)+(b>=a?1:0));
}

Measured memory_bytes: 256
def main():
    n, k = map(int, input().split())
    sushi = [list(map(int, input().split())) for _ in range(n)]
    sushi.sort(key=lambda x: x[1], reverse=True)
    ans = 0
    t = [0]*(n+1)
    tmp = 0
    cnt = 0
    for i in range(k):
        ans += sushi[i][1]
        if t[sushi[i][0]] == 0:
            cnt += 1
        tmp += sushi[i][1]
        t[sushi[i][0]] += 1
    ans = tmp + cnt*cnt
    p = k
    for i in range(k, n):
        f = False
        if t[sushi[i][0]] == 0:
            f = True
            for j in reversed(range(p)):
                if 1 < t[sushi[j][0]]:
                    t[sushi[j][0]] -= 1
                    t[sushi[i][0]] += 1
                    tmp -= sushi[j][1]
                    tmp += sushi[i][1]
                    p = j
                    cnt += 1
                    ans = max(ans, tmp+cnt*cnt)
                    f = False
                    break
        if f:
            break
    print(ans)


if __name__ == "__main__":
    main()

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

long long N,A[87];
long long dp[87];

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

    dp[1] = 1000;
    for ( int i = 2; i<=N; i++){
        dp[i] = dp[i-1];
        for ( int j = 1; j <= i -1; j++){
            long long V = dp[j] / A[j];
            long long W = dp[j] + (A[i] - A[j]) * V;
            dp[i] = max(dp[i],W);

        }
    }
    cout << dp[N] << endl;


}

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

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int x,a,b; cin>>x>>a>>b;
	if (abs(x-a)>abs(x-b))cout<<"B\n";
	else cout<<"A\n";
	return 0;
}


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

namespace AtCoder.A
{
    public class Program
    {
        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var (A, B, C, D) = Read4Longs();
            var left = A + B;
            var right = C + D;
            if(left > right)
            {
                return "Left";
            }
            else if(left == right)
            {
                return "Balanced";
            }
            else
            {
                return "Right";
            }
        }

        #region Console.Read

        public static string ReadText() { return Console.ReadLine(); }
        public static List<string> ReadTexts() { return Console.ReadLine().Split(' ').ToList(); }
        public static long ReadLong() { return long.Parse(Console.ReadLine()); }
        public static (long, long) Read2Longs() { var ls = ReadLongs(); return (ls[0], ls[1]); }
        public static (long, long, long) Read3Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2]); }
        public static (long, long, long, long) Read4Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3]); }
        public static (long, long, long, long, long) Read5Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3], ls[4]); }
        public static List<long> ReadLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }

        #endregion
    }
}


Measured memory_bytes: 28124
#include <cstdio>
#include <cstdlib>//mallocにいる
#include <string>
#include <iostream>
using namespace std;

struct Node {
    int key;
    Node *parent, *left, *right;
};

//NILは行き場がなくなったものを全て連結する何かという認識で良い？
Node *root, *NIL;

void insert(int k) {
    Node *y = NIL;
    Node *x = root;
    Node *z;

    z = (Node *)malloc(sizeof(Node));
    z->key = k;
    z->left = NIL;
    z->right = NIL;
    while(x!=NIL) {
        y = x;
        if(z->key<x->key) {
            x = x->left;
        }
        else {
            x = x->right;
        }
    }
    z->parent = y;
    if(y==NIL) {
        root = z;
    }
    else {
        if(z->key<y->key) {
            y->left = z;
        }
        else {
            y->right = z;
        }
    }
}

string find(int k) {
    Node *x = root;
    while(x!=NIL) {
        if(x->key==k) {
            return "yes";
        }
        else if(x->key<k) {
            x = x->right;
        }
        else {
            x = x->left;
        }
    }

    return "no";
}

void inorder(Node *u) {
    if(u==NIL) {
        return;
    }
    inorder(u->left);
    printf(" %d", u->key);
    inorder(u->right);
}

void preorder(Node *u) {
    if(u==NIL) {
        return;
    }
    printf(" %d", u->key);
    preorder(u->left);
    preorder(u->right);
}

int main() {
    int n, x;
    string com;

    cin >> n;

    for(int i=0; i<n; i++) {
        cin >> com;
        if(com=="insert") {
            cin >> x;
            insert(x);
        }
        else if(com=="print") {
            inorder(root);
            cout << endl;
            preorder(root);
            cout << endl;
        }
        else if(com=="find") {
            cin >> x;
            cout << find(x);
            cout << endl;
        }
    }

    return 0;
}


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

using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define pii pair<ll,pi >
#define ppi pair<pi,ll>
#define ppp pair<pi,pi >
#define ex(str,a,b) str.substr((int)(a),min((int)str.size()-a,(int)(b-a+1))) 
#define all(X) X.begin(),X.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   __builtin_popcount(n) : no. of set bits in n.
*/

const int M = (1<<20)+5;
const int md = 1e9+7;

priority_queue<ll,vector<ll >,greater<ll > > pq;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n,x,c;
	cin >> n >> x >> c;
	cout << c*((n+x-1)/x) << "\n";
}

Measured memory_bytes: 3612
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int a, b, k;
	cin >> a >> b >> k;

	int c = 0;
	for (int i = min(a, b); i >= 1; --i) {
		if (a % i == 0 && b % i == 0) {
			++c;
		}

		if (c == k) {
			cout << i << "\n";
			return 0;
		}
	}

	return 0;

}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int st[10000][1261] = {0};
int main() {
	int N, M;
	while ( cin >> N >> M, N || M ) {
		fill(&st[0][0], &st[0][0]+10000*1261, 0);
		int r; cin >> r;
		for (int i = 0; i < r; ++i) {
			int t, n, m, s; cin >> t >> n >> m >> s; --n, --m;
			if (s == 0) { // logout
				st[m][t]--;
			}
			else {
				st[m][t]++;
			}
		}
		for (int i = 0; i < M; ++i) {
			for (int j = 1; j <= 1260; ++j) {
				st[i][j] += st[i][j-1];
			}
		}
		for (int i = 0; i < M; ++i) {
			for (int j = 0; j <= 1260; ++j) {
				st[i][j] = st[i][j] ? 1 : 0;
			}
		}
		for (int i = 0; i < M; ++i) {
			for (int j = 1; j <= 1260; ++j) {
				st[i][j] += st[i][j-1];
			}
		}
		int q; cin >> q;
		for (int t = 0; t < q; ++t) {
			int s, e, m; cin >> s >> e >> m; --m;
			cout << st[m][e-1]-st[m][s-1] << endl;
		}
	}
}

Measured memory_bytes: 50416
import static java.lang.System.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(in);

        int n = sc.nextInt();
		int q = sc.nextInt();
		
		String s = sc.next();
		int[] count = new int[n];
		Arrays.fill(count, 0);
		for(int i=1; i<n; i++) {
			if(s.charAt(i-1) == 'A' && s.charAt(i) == 'C') count[i] = count[i-1] + 1;
			else count[i] = count[i-1];
		}
		
		for(int i=0; i<q; i++) {
			int l = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			
			out.println(count[r]-count[l]);
		}
	}
}


Measured memory_bytes: 65556
#include <iostream>

using ll = long long;
int main(int argc, char ** argv)
{
  //
  int a, b, c, tmp;
  std::cin >> a >> b >> c;
  tmp = b;
  b = a;
  a = tmp;

  tmp = c;
  c = a;
  a = tmp;
  std::printf("%d %d %d", a, b, c);
  return 0;
}


Measured memory_bytes: 888
h, w = gets.split.map(&:to_i)
a = []
h.times do |i|
  s = gets.chomp
  a.push(s) if s.index('#')
end
(w - 1).downto(0) do |i|
  if a.all?{|x| x[i] == '.'}
    a.each do |x|
      x[i] = ''
    end
  end
end
puts a

Measured memory_bytes: 1788
#include<iostream>
#include<vector>
#include<cmath>

bool is_prime(int a);

int main(){
    int n;
    int cnt = 0;
    std::cin >> n;
    std::vector<int> a(n);
    for(int i=0;i<n;i++){
        std::cin >> a[i];
    }
    for(int i=0;i<n;i++){
        bool flag = is_prime(a[i]);
        if(flag) cnt++; 
    }
    std::cout << cnt << '\n';
    return 0;
}

bool is_prime(int a){
    if(a==2){
        return true;
    }else if(a == 0 || a == 1){
        return false;
    }
    for(int i=2;i<=std::sqrt(a);i++){
        if(a % i == 0) return false;
    }
    return true;
}




Measured memory_bytes: 3092
#include<bits/stdc++.h>
 
using namespace std;
 
#define pb push_back
#define ll long long
#define endl '\n'
#define vi vector<int>
#define rep(i, n) for (i = 0; i < n; i++)
#define rep1(i, n) for (i = 1; i <=n; i++)
#define rep2(i, n) for (i = 0; i < n-1; i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend() //Sort in reverse,Vector.
#define present(v,x) (v.find(x)!=v.end()) //set/map etc.


int main()
{  ios_base::sync_with_stdio(false);cin.tie(NULL);
   #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
   #endif
   
   int i,t=0;

   string str;

   cin>>str;

   int count=0;

   for(i=0;i<3;i++)
   {
     if(str[i]=='R')
     	count++;

     else
     {
       t=max(count,t);
       count=0;

     }

   }

   t=max(count,t);

   cout<<t;
      
   
}   


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#include <ext/rope>
#define VALHALLA cin.tie(0);ios_base::sync_with_stdio(false);cout<<fixed<<setprecision(13);
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define debug(x) std::cerr << #x << ": " << (x) << '\n';
#define sz(x) (int)x.size()
#define fast(map_name) map_name.reserve(1024);map_name.max_load_factor(0.25);
using namespace std;
using namespace __gnu_cxx;
typedef long long int ll;
typedef pair<int,int> ii;
typedef complex<double> point;
const double epsilon=1e-9;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int mod=1e9+7;
/* VARIABLE DECLARATION START */
/*  FUCNTION TEMPLATE STARTS  HERE */

double dot(point a,point b){ return (conj(a)*b).real() ; }
double cross(point a,point b){ return (conj(a)*b).imag() ; }
double dist(point a, point b){ return abs(a-b); }
struct neal {
static uint64_t splitmix64(uint64_t x)
 {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const
 {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
}
};
struct HASH{
  size_t operator()(const pair<int,int>&x)const{
    return (size_t) x.first * 37U + (size_t) x.second;
  }
};
bool isprime(ll n) {
    if (n == 2 || n == 3) return true;
    if (n < 2 || n % 2 == 0 || n % 3 == 0) return false;
    for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) {
        if (n % (i - 1) == 0 || n % (i + 1) == 0) {
            return false;
        }
    }
    return true;
}
inline ll exp(ll a, ll b, ll mod) {
    ll n = 1;
    ll p = a;
    while (b > 0) {
        if (b % 2 == 1) {
            n *= p;
            n %= mod;
        }
        p *= p;
        p %= mod;
        b /= 2;
    }
    return n;
}

inline bool comp(double a,double b)
{
  return (fabs(a-b)<epsilon);
}
ll gcd(ll u, ll v) {
  ll r;
  while (0 != v) {
    r = u % v; u = v; v = r;
  }
  return u;
}


/*  FUCNTION TEMPLATE ENDS HERE */
int main()
{
   VALHALLA
   string s;
   cin>>s;
   int n=sz(s);
   int rock=n;
   int paper=0;
   int score=0;
   for(auto x:s)if(x=='p')score++;
    int ans=INT_MAX;
   while(paper<=rock)
   {
     ans=min(ans,score);
     paper++;
     rock--;
     score--;
   }
   cout<<-ans<<endl;


}


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

int main()
{
    int K;
    std::string S;
    std::cin >> K;
    std::cin >> S;
    if(S.size() <= K) {
        std::cout << S << std::endl;
    }
    else {
        std::cout << S.substr(0, K) << "..." << std::endl;
    }
    return 0;
}

Measured memory_bytes: 3628
#include <cstdio>
#define repeat(i,n) for (int i = 0; (i) < int(n); ++(i))
using ll = long long;
using namespace std;
int main() {
    int n, k; scanf("%d%d", &n, &k);
    auto pred = [&](ll m) {
        repeat (i, n-1) {
            m -= (m - 1) / k + 1;
            if (m <= 0) return true;
        }
        return false;
    };
    ll l = 0, r = ll(1e18)+9;
    while (l + 1 < r) {
        ll m = (l + r) / 2;
        (pred(m) ? l : r) = m;
    }
    printf("%lld\n", l);
    return 0;
}

Measured memory_bytes: 2756
module Main where

import qualified Data.ByteString.Char8 as BS
import Data.List
import Data.Char
import Data.Function

main :: IO ()
main = do
  [n] <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
  as <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
  putStrLn . unwords . map show $ map fst . sortBy (compare `on` snd) $ zip [1..] as


Measured memory_bytes: 28284
#include<stdio.h>
int main(){
  int h,w,i,j,k,l;
  while(scanf("%d %d",&h,&w)){
    if(h==0 && w==0)break;
    for(i=1;i<h-1;i++){
      if(i==1){
	for(k=0;k<w-1;k++)printf("#");
	printf("#\n");
      }
      for(j=1;j<w-1;j++){
	if(j==1)printf("#");
	printf(".");
	if(j==w-2)printf("#\n");
      }
    }
     for(l=0;l<w-1;l++)printf("#");
     printf("#\n");
     printf("\n");
  }
  return 0;
}

Measured memory_bytes: 588
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  string A,B;
  cin>>A>>B;
  A+=B;
  int N=stoi(A);
  int n=sqrt(N);
  string ans="No";
  if(n*n==N)
    ans="Yes";
  cout<<ans;
  }


Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
"""
n,k,x,y = IR(4)
print(min(k,n)*x+max(n-k,0)*y)
"""
#B
w = S()
d = defaultdict(int)
for i in w:
    d[i] += 1
for i in d.values():
    if i%2:
        print("No")
        quit()
print("Yes")
#C
"""
n,a = LI()
x = LI()
s = sum(x)
dp = [[[0 for i in range(s+1)] for j in range(n+1)] for k in range(n+1)]
for i in range(n+1):
    dp[i][0][0] = 1
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(s+1):
            if k >= x[i-1]:
                dp[i][j][k] = dp[i-1][j][k]+dp[i-1][j-1][k-x[i-1]]
            else:
                dp[i][j][k] = dp[i-1][j][k]
ans = 0
for i in range(1,n+1):
    if a*i <= s:
        ans += dp[n][i][a*i]
print(ans)
"""

#D
"""
def f(b,n):
    m = n
    res = 0
    while m > 0:
        res += m%b
        m //= b
    return res
n,s = IR(2)
if n == s:
    print(n+1)
    quit()
if n == 1:
    print(-1)
    quit()
k = int(n**0.5)
for b in range(2,k+1):
    if f(b,n) == s:
        print(b)
        quit()
for p in range(1,k+1)[::-1]:
    if (n-s)%p == 0:
        b = (n-s)//p+1
        if b != 0:
            if f(b,n) == s:
                print(b)
                quit()
print(-1)
"""
#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T


Measured memory_bytes: 38640
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define pb push_back
#define mp make_pair
bool isPrime(ll n) 
{ 
    
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
   
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (ll i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
} 
ll minthis(ll a, ll b){
if(a < b){
return a;
}
return b;
}
ll maxthis(ll a, ll b){
if(a > b){
return a;
}
return b;
}
int gcd(int a, int b){
    if( a<0 ) a = -a;
    if( b<0 ) b = -b;
    while( b!=0 ){
        a %= b;
        if( a==0 ) return b;
        b %= a;
    }
    return a;
}
ll lcm(ll a, ll b) {  
    return (a*b)/gcd(a, b);  
 }  
ll largestDivisor(ll n){
	int max = 1;
for(int i = 2 ; i*i <= n ; i++){
			if(n%i == 0) {
				max = n/i;break;
			}
		}
	return max;
}
 
 
ll power(ll x, ll y)  
{  
    ll temp;  
    if(y == 0)  
        return 1;  
    temp = power(x, y / 2);  
    if (y % 2 == 0)  
        return temp * temp;  
    else
    {  
        if(y > 0)  
            return x * temp * temp;  
        else
            return (temp * temp) / x;  
    }  
}  
bool sortbysec(const pair<int, int>& a, 
               const pair<int, int>& b) 
{ 
    return (a.second < b.second); 
} 
 
 
 
void solve(){	
	
	int l, r, d;
	cin >> l >> r >> d;
	int ans = 0;
	for(int i = l ; i <= r ; i++){
		if(i%d == 0){
			ans++;
		}
	}
	cout << ans << "\n";
	
}
  
int main(){ 
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t = 1;    
    //cin >> t;
    while(t--){
		solve();
	}
    return 0; 
}


Measured memory_bytes: 3640
///AJoy Sarker ,CSE JAHANGIRNAGAR UNIVERSITY 48 Batch
#include<bits/stdc++.h>
using namespace std;
#define SORT(c) sort((c).begin(),(c).end());
#define inf INT_MAX/3
#define pb push_back
#define MP make_pair
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define pi 3.141592653589793
#define in scanf
#define out printf
#define ll long long
#define ull unsigned long long
#define w(x) int x;cin>>x;while(x--)
#define fast ios_base::sync_with_stdio(0)
#define FOR(i,a,b) for( int i=(a),_b=(b);i<=_b;i++)
#define DOW(i,b,a) for( int i=(b),_a=(a);i>=_a;i--)
#define sz size()
typedef unsigned long long UL;
template<typename T>inline T  S(T a)
{
    return a*a;
}
template<class T>inline string tostring(T a)
{
    ostringstream os("");
    os << a;
    return os.str();
}
template<typename T>inline ll tolong(T a)
{
    ll res;
    istringstream os(a);
    os>>res;
    return res;
}
template<typename T>inline T gcd(T a, T b)
{
    if (b == 0)return a;
    else return gcd(b, a % b);
}
template<typename T>inline T bigmod(T a, T b, T m)
{
    if (b == 0)return 1;
    else if (b % 2 == 0)return S(bigmod(a, b / 2, m)) % m;
    else return (a % m*bigmod(a, b - 1, m)) % m;
}
#define N 20000009
bool prime[N];
vector<ll> prm;
void seive ()
{

    memset(prime, true, sizeof(prime));

    for( ll i=2; i*i<=N; i++)
    {
        if (prime[i] == true)
        {
            prm.pb(i);
            for (ll j=i*i; j<=N; j += i)
                prime[j] = false;
        }
    }
}
void pr (int f)
{
    if(f==1)
        cout<<"YES\n";
    else
        cout<<"NO\n";
}
map<int,int>mp;
set<int> s;
int main()
{
    fast;
   ll a, b,z=0;
    cin >> a >> b;
    cout << max(z, a-2*b) << endl;
    return 0;

}



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

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

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

int main() {
    string c;
    getline(cin,c);

    if ((c == "a")||(c == "i")||(c == "u")||(c == "e")||(c == "o")){
      cout << "vowel" << endl;
    }
    else {
      cout << "consonant" << endl;
    }
}

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

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF (1LL << 55)
#define MOD (1000 * 1000 * 1000 + 7)
#define maxn 200111

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

vector<pii> v;
int ans[maxn];

int main(){
	int n;
	scanf("%d", &n);
	for(int i = 1; i <= n; i++){
		int a;
		scanf("%d", &a);
		v.pb(mp(a, i));
	}

	sort(v.begin(), v.end());
	int l = v[n / 2 - 1].fi;
	int d = v[n / 2].fi;

	for(int i = 0; i < n / 2; i++)
		ans[v[i].se] = d;

	for(int i = n / 2; i < n; i++)
		ans[v[i].se] = l;

	for(int i = 1; i <= n; i++)
		printf("%d\n", ans[i]);
	
	return 0;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> mat;
#define FOR(i,a,b) for(int i=(a);i<(int)(b);++i)
#define rep(i,n) FOR(i,0,n)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define mset(a,x) memset(a,x,sizeof(a))
#define OUT(x) cout<<(x)<<"\n"
#define SZ(x) (int)(x).size()
#define FASTIO cin.tie(0),ios::sync_with_stdio(0)



int main() {
    deque<int> q;
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) scanf("%d", &a[i]);

    rep(i, n) {
        if(i % 2 == 0) {
            q.push_back(a[i]);
        }
        else {
            q.push_front(a[i]);
        }
    }

    if(n % 2 == 1) reverse(ALL(q));

    rep(i, n) {
        cout << q[i];
        cout << (i == n - 1 ? "\n" : " ");
    }
    return 0;
}

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

struct UnionFind {
    vector<int> par; 
    vector<int> size;

    UnionFind(int N) : par(N + 1), size(N + 1, 1) {
        for(int i = 0; i <= N; i++) 
          par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    int siz(int x){
      return size[root(x)];
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        if(size[rx] < size[ry]){
          size[ry] += size[rx];
          par[rx] = ry;
        } else{
          size[rx] += size[ry];
          par[ry] = rx;
        }
    }

    bool is_same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main() {
  int n, m, k;
  cin >> n >> m >> k;

  UnionFind tree(n + 1);

  vector<int> friends(n + 1);
  for(int i = 0; i < m; i++){
    int a, b;
    cin >> a >> b;

    tree.unite(a, b);
    friends[a]++;
    friends[b]++;
  }

  vector<vector<int>> block(n + 1);
  for(int i = 0; i < k; i++){
    int a, b;
    cin >> a >> b;

    if(tree.is_same(a,b)){
    block[a].push_back(b);
    block[b].push_back(a);
    }
  }

  for(int i = 1; i <= n; i++){
    int num = tree.siz(i) - friends[i]- block[i].size() - 1;
    cout << num;
    if(i < n) cout << " ";
  }
  cout << endl;
  
}

Measured memory_bytes: 10240
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
S=input()

a=[S[::2].count(l) for l in "01"]
b=[S[1:][::2].count(k) for k in "01"]

print(min(a[0]+b[1],a[1]+b[0]))

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



int main()
{
	int n,c;
	cin >> n >> c;
	vector<vector<int>> D(c,vector<int>(c));
	for(int i = 0;i<c;i++)
	{
		for(int j = 0;j<c;j++)
		{
			cin >> D[i][j];
		}
	}

	vector<vector<int>> C(n,vector<int>(n));
	for(int i = 0;i<n;i++)
	{
		for(int j = 0;j < n;j++)
		{
			cin >> C[i][j];
			C[i][j]--;
		}
	}
	vector<vector<int>> V(3);

	for(int i = 0;i<n;i++)
	{
		for(int j = 0 ;j<n;j++)
		{
			V[((i+1)+(j+1))%3].push_back(C[i][j]);
		}
	}
	 vector<vector<ll>> VV(3,vector<ll>(c,-1));
	ll ans = LLONG_MAX;
	for(int i = 0;i<c;i++)
	{
		for(int j = 0;j<c;j++)
		{
			if(i==j)continue;
			for(int k = 0;k<c;k++)
			{
				if(k==i||j==k)continue;
				ll now = 0;
				if(VV[0][i]==-1)
				{
					ll AA = 0;
					for(auto m:V[0])AA+=D[m][i];
					VV[0][i] =AA;
				}
				if(VV[1][j]==-1)
				{
					ll AA = 0;
					for(auto m:V[1])AA+=D[m][j];
					VV[1][j] =AA;
				}
				if(VV[2][k]==-1)
				{
					ll AA = 0;
					for(auto m:V[2])AA+=D[m][k];
					VV[2][k] =AA;
				}
				now += VV[0][i]+VV[1][j]+VV[2][k];
				ans = min(now,ans);
				
			}
		}
	}
	cout<<ans<<endl;
}

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

long long calc_dp(int i, int j, vector<vector<long long>>& dp, vector<long long>& a){
  int N = dp.size();
  if(dp[i][j] != 1e15){
    return dp[i][j];
  }

  calc_dp(i + 1, j, dp, a);
  calc_dp(i, j - 1, dp, a);
  if(N % 2 == (j - i) % 2){
    // jiro
    dp[i][j] = min(dp[i + 1][j] - a[i], dp[i][j - 1] - a[j]);
  }else{
    // taro
    dp[i][j] = max(dp[i + 1][j] + a[i], dp[i][j - 1] + a[j]);
  }
  return dp[i][j];
}

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

  vector<long long> a(N);
  for(auto& aa: a){
    cin >> aa;
  }

  // dp[i][j] := [i, j]
  vector<vector<long long>> dp(N, vector<long long>(N, 1e15));
  for(int i = 0; i < N; i++){
    dp[i][i] = a[i];
    if(N % 2 == 0){
      dp[i][i] *= -1;
    }
  }
  
  cout << calc_dp(0, N - 1, dp, a) << endl;
  

}


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

using namespace std;

map<int,bool> mp;

int main(){

	int N;
	cin >> N;
	bool ans = true;
	while(N--){
		int X;
		cin >> X;
		if(mp[X]){
			ans = false;
			break;
		}
		mp[X] = true;
	}

	cout << (ans ? "YES\n" : "NO\n");

}

Measured memory_bytes: 9600
#include <iostream>
#include <cstring>

using namespace std;

int H,puz[10][5];

int solve(){
  int res = 0;
  bool update = true;
  while(update){
    update = false;
    for(int i = 0 ; i < H ; i++){
      bool c[5] = {false},ok = false;
      int num = puz[i][0],cnt = 1;
      c[0] = true;
      for(int j = 1 ; j < 5 ; j++){
        if(num == puz[i][j] && puz[i][j] > 0){
          cnt++;
          c[j] = true;
          if(cnt >= 3) ok = true;
        }else if(puz[i][j] > 0){
          if(ok) break;
          num = puz[i][j];
          cnt = 1;
          memset(c,false,sizeof(c));
          c[j] = true;
        }else{
          cnt = 0;
        }
      }
      if(cnt >= 3){
        res += cnt*num;
        update = true;
        for(int j = 0 ; j < 5 ; j++){
          if(c[j]) puz[i][j] = -1;
        }
      }
    }
    if(update){
      int tmp[10][5];
      memset(tmp,0,sizeof(tmp));
      for(int j = 0 ; j < 5 ; j++){
        int idx = H-1;
        for(int i = H-1 ; i >= 0 ; i--){
          if(puz[i][j] == -1) continue;
          tmp[idx--][j] = puz[i][j];
        }
      }
      for(int i = 0 ; i < H ; i++){
        for(int j = 0 ; j < 5 ; j++){
          puz[i][j] = tmp[i][j];
        }
      }
    }
  }
  return res;
}

int main(){
  while(cin >> H,H){
    for(int i = 0 ; i < H ; i++){
      for(int j = 0 ; j < 5 ; j++){
        cin >> puz[i][j];
      }
    }
    cout << solve() << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#define ll long long
using namespace std;

int main() {
    ll a, b, c = 1, d;
    cin >> a >> b;
    d = a;
    while(d < b) {
        d += a-1;
        c++;
    }
    if(b == 1) c = 0;
    cout << c << endl;
    return 0;
}

Measured memory_bytes: 256
/**
 * File    : A.cpp
 * Author  : Kazune Takahashi
 * Created : 2018-2-24 20:50:09
 * Powered by Visual Studio Code
 */

#include <iostream>
#include <iomanip>   // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple>
#include <queue>
#include <stack>
#include <map> // if (M.find(key) != M.end()) { }
#include <set>
#include <random> // random_device rd; mt19937 mt(rd());
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;

#define DEBUG 0 // change 0 -> 1 if we need debug.

typedef long long ll;

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

// const int C = 1e6+10;
// const ll M = 1000000007;

ll N;

int main()
{
  cin >> N;
  string X = to_string(N);
  bool all_nine = true;
  for (auto x : X)
  {
    if (x != '9')
    {
      all_nine = false;
      break;
    }
  }
  int ans = 0;
  for (auto x : X)
  {
    ans += x - '0';
  }
  int tans = 0;
  if (all_nine)
  {
    for (auto x : X)
    {
      tans += 9;
    }
  } else {
    int s = X.size();
    for (auto i = 0; i < s; i++)
    {
      if (i == 0)
      {
        tans += X[i] - '0' - 1;
      } else {
        tans += 9;
      }
    }
  }
  cout << max(ans, tans) << endl;
  return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O0")
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
const ll mod = 1e9+7;
const ll INF = 1e18;
#define All(a) (a).begin(),(a).end()
#define Pi acos(-1)

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << setprecision(15) << fixed;
  chrono::system_clock::time_point start,end;
  start = chrono::system_clock::now();

  ll n;
  cin >> n;
  vector<ll> a(n+1);
  rep(i,n) cin >> a[i];
  a[n] = 1000000001;
  sort(All(a));
  ll ans = 0;
  ll cnt = 1;
  rep(i,n) {
    if (a[i] == a[i+1]) {
      ++cnt;
    }
    else {
      if (cnt >= a[i]) {
        ans += cnt - a[i];
      }
      else {
        ans += cnt;
      }
      cnt = 1;
    }
  }
  cout << ans << '\n';

  end = chrono::system_clock::now();
  auto elapsed = chrono::duration_cast< chrono::milliseconds >(end - start).count();
  cerr << elapsed << "ms" << '\n';
}

Measured memory_bytes: 3996
class UnionFind
  attr_accessor(:table)

  def initialize(n)
    @table = Array.new(n, -1)
  end

  def root(x)
    st = []
    tb = @table
    while tb[x] >= 0
      st.push(x)
      x = tb[x]
    end
    
    st.each do |y|
      @table[y] = x
    end
    
    return x
  end
  
  def find(x, y)
    return root(x) == root(y)
  end

  def union(x, y)
    r1 = root(x)
    r2 = root(y)
    return if r1 == r2
    
    d1 = @table[r1]
    d2 = @table[r2]
    if d1 <= d2
      @table[r2] = r1
      @table[r1] += d2
    else
      @table[r1] = r2
      @table[r2] += d1
    end
  end
end

n, q = gets.chomp.split.map(&:to_i)
uf = UnionFind.new(n)
q.times do
  t, u, v = gets.chomp.split.map(&:to_i)
  if t == 0
    uf.union(u, v)
  elsif t == 1
    puts (uf.find(u, v))? "1" : "0"
  end
end

Measured memory_bytes: 15608
#include <bits/stdc++.h>
using namespace std;
#pragma optimize("-O3")
#define int long long int
#define f first
#define s second
#define pb push_back
#define endl '\n'

main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	string st;
	cin>>st;
	if(st[st.size()-1]=='s'){
		cout<<st;
		cout<<"es";
	}
	else{
		cout<<st;
		cout<<"s";
	}
	return 0;
}

Measured memory_bytes: 3648
h, w = map(int,input().split())
masu = []
for _ in range(h):
    masu.append(list(input()))

# 行から見る
row = []
column = []
for i in range(h):
    if not masu[i] == ['.'] * w:
        row.append(i)

column = []
for i in range(w):
    flg = 0
    for j in range(h):
        if masu[j][i] == '#':
            flg = 1
    if flg == 1:
        column.append(i)

for i in row:
    l = masu[i]
    for j in column:
        print(masu[i][j],end='')
    print()

Measured memory_bytes: 9180
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

int main()
{
    double L;
    cin >> L;
    double ans = pow(L/3,3);
    printf("%.16f\n", ans);
}

Measured memory_bytes: 256
//2734　吉原直樹　問0279
import java.util.Scanner;
public class Main{
    int n;
    int k;
    int g=0;
    int m=1;
    public void solve(){
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        while(n!=0){
            for(int s=0;s<n;s++){
                k = sc.nextInt();
                if(k>=2){
                    m++;
                }else if(k==1){
                 g++;
                }
            }
            if(m>=2){
                System.out.println(m+g);
            }else{
                System.out.println("NA");
            }
            g=0;
            m=1;
            n=sc.nextInt();
        }
    }
    
    public static void main(String[] args){
        Main obj = new Main();
        obj.solve();
    }
}

Measured memory_bytes: 158412
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define PN cout << endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (n-1); i >= (int)(m); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - (a)) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - (a)) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return


ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }


/*
vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}
*/

/*
ll ncr[100][100];
ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

ll npr[100][100]={};
ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

ll nHr(int n,int r){ret nCr(n+r-1,r);}
*/

///////////////////////////////////////////////////////////////////////////

int main(){
   
    int n;
    cin >> n;
    ll a[n];
    map<ll,ll> m;
    
    rep(i,0,n){
	cin >> a[i];
	m[a[i]]++;
    }

    ll ans = 0;
  
    for(auto j:m){
	ans +=  j.sd * (j.sd-1) / 2;
    }
    
    rep(i,0,n){
	P(ans - (m[a[i]]-1));
    }
    return  0;
}


Measured memory_bytes: 11008
package main

import (
	"bufio"
	"fmt"
	"os"
	"reflect"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

var a int
var b int
var c int
var k int

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */
	a, b, c, k = nextInt(), nextInt(), nextInt(), nextInt()
	if k < a {
		fmt.Println(k)
		return
	}
	k = k - a
	if k < b {
		fmt.Println(a)
		return
	}

	k = k - b
	fmt.Println(a - k)
}

// -*-*-*-*-*-*-*-*-
// * I/O utilities *
// -*-*-*-*-*-*-*-*-

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInt64() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func split(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}

func PrintOut(src interface{}, joinner string) {
	switch reflect.TypeOf(src).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(src)
		for idx := 0; idx < s.Len(); idx++ {
			fmt.Fprintf(out, "%v", s.Index(idx))
			if idx < s.Len()-1 {
				fmt.Fprintf(out, "%s", joinner)
			} else {
				fmt.Fprintln(out)
			}
		}
	default:
		fmt.Fprintln(out, "fuck")
	}
}

// -*-*-*-*-*-*-*-*-
// * tool snippets *
// -*-*-*-*-*-*-*-*-
func duplicate2Int(base [][]int) (ret [][]int) {
	ret = make([][]int, len(base))
	for i, v := range base {
		ret[i] = append([]int{}, v...)
	}
	return
}

// -*-*-*-*-*-*-*-*-*-*-*-*-*-
// * Algorithms Utility Zone *
// -*-*-*-*-*-*-*-*-*-*-*-*-*-

// -*-*-*-*-*-*-*-
// * 1. nibutan  *
// -*-*-*-*-*-*-*-
func lower_bound(arr []int, target int) int {
	l, r := 0, len(arr)
	for l < r {
		mid := (l + r) / 2
		if arr[mid] < target {
			l = mid + 1
		} else {
			r = mid
		}
	}
	return l
}

func upper_bound(arr []int, target int) int {
	l, r := 0, len(arr)
	for l < r {
		mid := (l + r) / 2
		if target < arr[mid] {
			r = mid
		} else {
			l = mid + 1
		}
	}
	return l
}

// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
// * math flavor typical theories *
// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
func gcd(a, b int) int {
	if a > b {
		return gcd(b, a)
	}
	for a != 0 {
		a, b = b%a, a
	}
	return b
}

func pow(a, b int) (ret int) {
	ret = a
	// 10^2 = 100ってことは10に10を1回掛けることだね
	// なので初期値を含めると上限b-1未満
	for i := 0; i < b-1; i++ {
		ret *= a
	}
	return
}

func powMod(n, m, mod int) (ret int) {
	ret = 1
	for m > 0 {
		if m&1 == 1 {
			ret *= n
			ret %= mod
		}
		n *= n
		n %= mod
		m >>= 1
	}
	return ret
}


Measured memory_bytes: 1756
import java.util.Scanner;
 
class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
        double sum = 0.0;
        for(int i = 0;i < n;i++){
            int a = sc.nextInt();
            sum += 1.0 / a;
        }
        System.out.println(1.0 / sum);
    }
}

Measured memory_bytes: 22864
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s,s1;
    int k,l;
    cin>>s>>s1;
    k = s.size();
    l = s1.size();

        if(k==l)
        {
            if(s[0]-'0' > s1[0]-'0')
            {
                cout<<"GREATER\n";
            }
            else if(s[0]-'0' < s1[0]-'0')
            {
                cout<<"LESS\n";
            }
            if(s[0]-'0' == s1[0]-'0')
            {
                cout<<"EQUAL\n";
            }


        }
       else  if(k < l)
        {

            cout<<"LESS\n";

        }
       else if(k > l)
        {

            cout<<"GREATER\n";
        }


}


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

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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

int main() {
    string s;
    cin >> s;
    int n = s.length() - 1;

    ll ans = 0;
    rep(i, pow(2,n)) {
        vector<ll> split_vec;
        int first = 0;
        rep(j, n) {
            if((int)pow(2,j) & i) {
                split_vec.push_back(stoll(s.substr(first, j + 1 - first)));
                first = j + 1;
            }
        }
        split_vec.push_back(stoll(s.substr(first, n + 1)));
        ll sum = 0;
        for (auto v : split_vec) {
            sum += v;
        }
        ans += sum;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define all(V) V.begin(),V.end()
#define ll long long
#define MOD 1000000007

int main() {
	int K, X;
	cin >> K >> X;
	if (K * 500 >= X) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <stdio.h>
using namespace std;

int main(void){
	char s[5];
	int i = 0;
	scanf("%s", s);
	if (s[0] == 'o')i++;
	if (s[1] == 'o')i++;
	if (s[2] == 'o')i++;
	printf("%d\n", 700 + 100 * i);
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
const int INF=1e+9;
const ll INFLL=1e+17;
int main(){
  int n;
  cin>>n;
  cout<<"ABC"<<n<<"\n";

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int INF = 1000000;
template <typename T>
struct range_chmin{
  int N;
  vector<T> ST;
  range_chmin(vector<T> A){
    N = 1;
    int n = A.size();
    while (N < n){
      N *= 2;
    }
    ST = vector<T>(N * 2 - 1, INF);
    for (int i = 0; i < n; i++){
      ST[N - 1 + i] = A[i];
    }
  }
  T operator [](int k){
    k += N - 1;
    T ans = ST[k];
    while (k > 0){
      k = (k - 1) / 2;
      ans = min(ans, ST[k]);
    }
    return ans;
  }
  void chmin(int L, int R, T x, int i, int l, int r){
    if (r <= L || R <= l){
      return;
    } else if (L <= l && r <= R){
      ST[i] = min(ST[i], x);
    } else {
      int m = (l + r) / 2;
      chmin(L, R, x, i * 2 + 1, l, m);
      chmin(L, R, x, i * 2 + 2, m, r);
    }
  }
  void chmin(int L, int R, T x){
    chmin(L, R, x, 0, 0, N);
  }
};
template <typename T>
struct range_chmax{
  int N;
  vector<T> ST;
  range_chmax(vector<int> A){
    N = 1;
    int n = A.size();
    while (N < n){
      N *= 2;
    }
    ST = vector<T>(N * 2 - 1, -INF);
    for (int i = 0; i < n; i++){
      ST[N - 1 + i] = A[i];
    }
  }
  T operator [](int k){
    k += N - 1;
    T ans = ST[k];
    while (k > 0){
      k = (k - 1) / 2;
      ans = max(ans, ST[k]);
    }
    return ans;
  }
  void chmax(int L, int R, T x, int i, int l, int r){
    if (r <= L || R <= l){
      return;
    } else if (L <= l && r <= R){
      ST[i] = max(ST[i], x);
    } else {
      int m = (l + r) / 2;
      chmax(L, R, x, i * 2 + 1, l, m);
      chmax(L, R, x, i * 2 + 2, m, r);
    }
  }
  void chmax(int L, int R, T x){
    chmax(L, R, x, 0, 0, N);
  }
};
int main(){
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> p(m);
  for (int i = 0; i < m; i++){
    int x, y;
    cin >> x >> y;
    y--;
    p[i] = make_pair(x, y);
  }
  sort(p.begin(), p.end());
  vector<int> pos(n);
  for (int i = 0; i < n; i++){
    pos[i] = i;
  }
  range_chmin<int> L(pos);
  range_chmax<int> R(pos);
  for (int i = 0; i < m; i++){
    int y = p[i].second;
    int tv1 = -1;
    int fv1 = n;
    while (fv1 - tv1 > 1){
      int mid = (tv1 + fv1) / 2;
      if (L[mid] <= y + 1){
        tv1 = mid;
      } else {
        fv1 = mid;
      }
    }
    L.chmin(0, fv1, y);
    int tv2 = n;
    int fv2 = -1;
    while (tv2 - fv2 > 1){
      int mid = (tv2 + fv2) / 2;
      if (R[mid] >= y){
        tv2 = mid;
      } else {
        fv2 = mid;
      }
    }
    R.chmax(tv2, n, y + 1);
  }
  vector<int> d(n + 1, 0);
  for (int i = 0; i < n; i++){
    d[L[i]]++;
    d[R[i] + 1]--;
  }
  for (int i = 0; i < n; i++){
    d[i + 1] += d[i];
  }
  for (int i = 0; i < n; i++){
    cout << d[i];
    if (i < n - 1){
      cout << ' ';
    }
  }
  cout << endl;
}


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

int main(){
  int n=0,c0=0,c1=0,c2=0,c3=0;
  cin >> n;
  vector<string>s(n+1);
  for(int i=0;i<n;i++){
    cin >> s.at(i);
    if(s.at(i) == "AC")c0++;
    if(s.at(i) == "WA")c1++;
    if(s.at(i) == "TLE")c2++;
    if(s.at(i) == "RE")c3++;
  }
  cout << "AC x " << c0 << endl;
  cout << "WA x " << c1 << endl;
  cout << "TLE x " << c2 << endl;
  cout << "RE x " << c3 << endl;
}


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

int main(){
 int n;
 cin >> n;
  
 vector<int> a(n);
 rep(i,n) cin >> a[i];
 set<int> s;
 rep(i,n) s.insert(a[i]);
 if(s.size() == n) cout << "YES" << endl;
  else cout << "NO" << endl;
}


Measured memory_bytes: 10368