akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i,n) for (int i = (int)(n)-1; i>=0; --i)
#define For(i,a,b) for(auto i=(a);i<=(b);++i)
#define rFor(i,a,b) for(auto i=(b);i>=(a);--i)
#define call(var) cerr<<#var<<"="<<var<<"\n";
#define dup(x,y) (((x)+(y)-1)/(y))
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using Graph = vector<vi>;
using P = pair<int,int>;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;
const double pi = acos(-1);
template<class t,class u> inline bool chmax(t&a,u b){if(a<b){a=b;return true;}return false;}
template<class t,class u> inline bool chmin(t&a,u b){if(b<a){a=b;return true;}return false;}


void cerrall(const vector<bool>& a){rep(i,a.size()) cerr << i << " " << (a[i]? "True" : "False") << "\n"; cerr << "\n";}
template<class T> void cerrall(const vector<T>& a){for(auto& t : a) cerr << t << " "; cerr << "\n";}
template<class T> void cerrall(const set<T>& a){for(auto& t : a) cerr << t << " "; cerr << "\n";}
template<class T> void cerrall(const multiset<T>& a){for(auto& t : a) cerr << t << " "; cerr << "\n";}
template<class T, class U> void cerrall(const vector<pair<T,U>>& a){rep(i,a.size()) cerr << i << " : " << a[i].first << " " << a[i].second << "\n";}
template<class T, class U> void cerrall(const map<T,U>& a){for(auto& t : a) cerr << t.first << " " << t.second << "\n";}
template<class T, class U> void cerrall(const unordered_map<T,U>& a){for(auto& t : a) cerr << t.first << " " << t.second << "\n";}

template<class T> istream& operator>>(istream& is, vector<T>& a){rep(i,a.size()) is >> a[i]; return is;}
template<class T> ostream& operator<<(ostream& os, vector<T>& a){rep(i,a.size()) os << a[i] << " "; return os;}

template<class T, class U> istream& operator>>(istream& is, pair<T,U>& p){is >> p.first >> p.second; return is;}
template<class T, class U> ostream& operator<<(ostream& os, const pair<T,U>& p){os << "("<< p.first << "," << p.second << ")"; return os;}
template<class T, class U> ostream& operator<<(ostream& os, const map<T,U>& mp){for(auto& t : mp) os << t.first << " " << t.second << "\n"; return os;}

map<ll,ll> prime(ll n){  
    map<ll,ll> mp;
    for(ll i=2;i*i<=n;i++){
        while(n%i==0){
            mp[i]++;
            n/=i;
        }
    }
    if(n!=1)mp[n]++;
    return mp;
}

int main(){
    ll n;cin >> n;
    int ans = 0;
    auto v = prime(n);
    for(auto t : v){
        int cnt = 0;
        int tar = 1;
        while(t.second){
            cnt++;
            if(cnt == tar){
                ++ans;
                ++tar;
                cnt = 0;
            }
            --t.second;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define pa pair<int,int>
const int Maxn=100010;
const int inf=2147483647;
const int mod=1000000007;
int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return x*f;
}
int f=0,g=0,b,w;
void upd(int&x,int y){x+=y;if(x>=mod)x-=mod;}
int fac[Maxn<<1],fin[Maxn<<1],inv[Maxn<<1];
void pre()
{
	int n=b+w;
	fac[0]=1;for(int i=1;i<=n;i++)fac[i]=(LL)fac[i-1]*i%mod;
	inv[0]=inv[1]=1;for(int i=2;i<=n;i++)inv[i]=(LL)(mod-mod/i)*inv[mod%i]%mod;
	fin[0]=1;for(int i=1;i<=n;i++)fin[i]=(LL)fin[i-1]*inv[i]%mod;
}
int C(int n,int m)
{
	if(n<m)return 0;
	return(LL)fac[n]*fin[m]%mod*fin[n-m]%mod;
}
int Pow(int x,int y)
{
	if(!y)return 1;
	int t=Pow(x,y>>1),re=(LL)t*t%mod;
	if(y&1)re=(LL)re*x%mod;
	return re;
}
int main()
{
	b=read(),w=read();
	pre();
	for(int i=1;i<=b+w;i++)
	{
		int t=g;upd(t,(LL)((1-f-g)%mod+mod)%mod*inv[2]%mod);
		printf("%d\n",t);
		upd(f,(LL)C(i-1,b-1)*Pow(inv[2],i)%mod);
		upd(g,(LL)C(i-1,w-1)*Pow(inv[2],i)%mod);
	}
}

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

const int max_n = 2005;
ll dp[max_n][max_n];
inline void chmax(ll& a, ll b){
	a = max(a, b);
}

int main(){
	int n;

	cin >> n;

	vector<int> a(n);
	for(int i=0; i<n; i++){
		cin >> a[i];
	}

	for(int i=0; i<n+1; i++){
		for(int j=0; j<n+1; j++){
			dp[i][j] = -1;
		}
	}
	dp[0][0] = 0;

	vector<P> p;
	for(int i=0; i<n; i++){
		p.emplace_back(a[i], i);
	}
	sort(p.rbegin(), p.rend());

	for(int i=0; i<n; i++){
		int pi = p[i].second;
		for(int l=0; l<i+1; l++){
			int r = i - l;
			chmax(dp[i+1][l+1], dp[i][l]+ll(pi-l)*a[pi]);
			chmax(dp[i+1][l], dp[i][l]+ll((n-r-1)-pi)*a[pi]);
		}
	}

	ll ans = 0;
	for(int i=0; i<n+1; i++){
		chmax(ans, dp[n][i]);
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 35020
import sys
input = lambda: sys.stdin.readline().rstrip()

n = int(input())
a = list(map(int, input().split()))

ans = 0
minstep = a[0]

for i in a[1:]:
    if i < minstep:
        ans += minstep - i
    else:
        minstep = i

print(ans)


Measured memory_bytes: 32180
#include<iostream>
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define vi vector<int>
#define lvi vector<long long>
#define pi pair<int,int>
#define lpi pair<long long ,long long>
#define mp make_pair
#define pb push_back
#define ll long long 
#define faltu ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mod 1000000007
#define mod1 1000000000000000007
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>multiordered_set;
ll int pw(ll int a, ll int b,ll md) {
    if (b == 0) return 1;
    ll int t = pw(a, b / 2,md);
    if (b % 2 == 0) return (t * t)%mod;
    else return ((t * t)%mod * a)%mod;
}
vector<int> pm;
void prm(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
              prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p]) pm.push_back(p);
}
bool cmp(const pair<ll int,ll int> &a,const pair<ll int,ll int> &b)
{
    if(a.first==b.first)return a.second<b.second;
    return a.first>b.first;
}
ll int gcd(ll int a,ll int b)
{
    if(!a)return b;
    return gcd(b%a,a);
}
bool isPrime(int n) 
{ 
    if (n <= 1) 
        return false; 
    for (int i = 2; i < n; i++) 
        if (n % i == 0) 
            return false; 
    return true; 
} 
map<int,int>pa;
int find(int i){
    if(pa[i]==i)return i;
    return pa[i]=find(pa[i]);
}     
void join(int i,int j){
    int a=find(i);
    int b=find(j);
    if(b>=a)pa[b]=a;
    else pa[a]=b;
}               
int ddx[]={-1,-1,-1,0,1,1,1,0};
int ddy[]={-1,0,1,1,1,0,-1,-1};
int dx[]={-1,0,1,0};
int dy[]={0,-1,0,1};
int main()
{
    faltu;
    int t=1;
    //cin>>t;
    while(t--)
    {
        int a,b,c;
        cin>>a>>b>>c;
        if(b*c>=a)cout<<"Yes\n";
        else cout<<"No\n";
    }
}

Measured memory_bytes: 3652
import java.io.*;
import java.util.*;

class Main{
	public static void main(String[] args){
		BufferedReader sc=new BufferedReader(new InputStreamReader(System.in));
		try{
			int n = Integer.valueOf(sc.readLine());
			StringBuilder sb = new StringBuilder();
			for(int i=0; i<n-1; i++){
				String st = sc.readLine().replaceAll("Hoshino","Hoshina");
				sb.append(st+"\n");		
			}
			String st = sc.readLine().replaceAll("Hoshino","Hoshina");
			sb.append(st);
			System.out.println(sb.toString());
		}catch(Exception e){
			System.out.println("Error");
			}
		}
}

Measured memory_bytes: 9564
#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;
int main(){
    int a, b, c;
    double d, s, l, h;
    cin >> a >> b >> c;
    
    double PI = acos(-1);

    d = c * 2;
    d = d * PI;
    d = d / 360;
    
    s = a * b * 1/2 * sin(d);
    l = a + b + sqrt(pow(a, 2) + pow(b, 2) - 2 * a * b * cos(d));
    h = b * sin(d);
    
    cout << fixed;
    cout << setprecision(6) << s << endl;
    cout << setprecision(6) << l << endl;
    cout << setprecision(6) << h << endl;

}



Measured memory_bytes: 3612
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

BCDE = [b,c,d,e]
CDE = [c,d,e]
DE = [c,d]

l = 0

Yay = True

for later_point in BCDE:
    l = later_point - a
    if l > k:
        Yay = False

for later_point in CDE:
    l = later_point -b
    if l > k:
        Yay = False

for later_point in DE:
    l = later_point - c
    if l > k:
        Yay = False

if e - d > k :
    Yay = False

if Yay :
    print("Yay!")
else:
    print(":(")

Measured memory_bytes: 3064
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MultiWayIf #-}


import Control.Arrow
import Control.Concurrent
import Control.Monad
import qualified Data.ByteString.Char8 as C
import Data.Function
import Data.Function.HT
import qualified Data.IntMap.Strict as IM
import qualified Data.IntSet as IS
import Data.List
import Data.Ord
import qualified Data.Sequence as Sq
import Data.Vector.Algorithms.Search
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.Mutable as UM
import Debug.Trace


------------------
-- #   Read   # --
------------------

r :: Int -> IO (U.Vector Int)
r n = U.unfoldrN n (C.readInt . C.dropWhile (==' ')) <$> C.getLine

r' :: IO [Int]
r'  =   unfoldr    (C.readInt . C.dropWhile (==' ')) <$> C.getLine



main :: IO ()
main = do
    [h1,m1,h2,m2,k] <- r'
    print $ max 0 $ ((h2 * 60 + m2) - k) - (h1 * 60 + m1)



Measured memory_bytes: 3772
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define ANS cout << ans << endl
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define REVERSE(a) reverse(all(a))
#define int long long
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define VIin(a) for(int i=0; i<a.size(); i++) cin >> a[i]
#define OUT(a) cout << a << endl
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
/*最大公約数*/int gcd(int x, int y) { return y ? gcd(y,x%y) : x;}
/*最小公倍数*/int lcm(int a, int b) { int g = gcd(a, b); return a / g * b; }
/*素数判定*/int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*約数列挙*/vector<int> getDivisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------------------------------------
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int a; cin >> a;
  	FOR(i,1,10){
    	FOR(j,1,10){
        	if(i*j == a){
            	Yes;
            	return 0;
            } 
        }
    }
  	No;
  	
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>
#include <bitset>
#include<stack>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;
const long long ll_max = 9223372036854775807;
const long long ll_min = -9223372036854775807;
const int int_max = 2147483647;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T>
map<T, T> getPrimeFactor(T n) {
	map<T, T> res;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			res[i] ++;
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return true;
}

long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

// 繰り返し二乗法
ll pow2(ll n, ll p, ll mod) {
	if (p == 0 || n == 1) {
		return 1;
	}
	else {
		ll ret = pow2(n * n % mod, p / 2, mod);
		if (p % 2 == 1) {
			ret *= n;
		}
		return ret % mod;
	}
}


#define rep(i,s,e) for(ll i=s;i<e;i++)
#define repeq(i,s,e) for(ll i=s;i<=e;i++)


vector<vll> G;
vll t;

ll func(ll pos) {
	ll ret = t[pos];

	if(ret > -1) {
		return ret;
	}

	for (auto x : G[pos]) {
		ret=max(ret,func(x));
	}
	ret++;
	t[pos] = ret;
	return ret;
}


int main() {
	ll N, M;
	cin >> N >> M;
	G.resize(N);
	t.resize(N, -1);
	rep(i, 0, M) {
		ll x, y;
		cin >> x >> y;
		x--; y--;
		G[x].push_back(y);
	}

	ll ans = 0;
	rep(i, 0, N) {
		ans = max(ans, func(i));
	}

	cout << ans << endl;

	return 0;

}


Measured memory_bytes: 11332
#include<stdio.h>
#include<stdlib.h>
typedef struct node{
  int key;
  struct node *p, *l, *r;
}T_node;
int main(){
  int n;
  scanf("%d", &n);
  T_node *heap[n + 1];
  int i;
  for(i = 1; i <= n; i++){
    heap[i] = (T_node *)malloc(sizeof(T_node));
    heap[i]->p = heap[i]->l = heap[i]->r = NULL;
    scanf("%d", &(heap[i]->key));
    if(i /2){
      heap[i]->p = heap[i / 2];
      if(i % 2)
	heap[i / 2]->r = heap[i];
      else
	heap[i / 2]->l = heap[i];
    }
  }
  for(i = 1; i <= n; i++){
    printf("node %d: key = %d, ", i, heap[i]->key);
    if(heap[i]->p != NULL)
      printf("parent key = %d, ", heap[i]->p->key);
    if(heap[i]->l != NULL)
      printf("left key = %d, ", heap[i]->l->key);
    if(heap[i]->r != NULL)
      printf("right key = %d, ", heap[i]->r->key);
    printf("\n");
  }
  for(i = n; i > 0; i--)
    free(heap[i]);
  return 0;
}

Measured memory_bytes: 608
#include <iostream>
#include <algorithm>
#include <string>

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

using namespace std;

int main(void){
    int a; cin >> a;
    string s; cin >> s;

    if(a >= 3200) cout << s << endl;
    else cout << "red" << endl;
    return 0;
}

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

int main(){
	int p[50], c[50], n, r, pos, i;
	for( ; cin >> n >> r, n; ){
		for( i = 0; i < r; ++i ){
			cin >> p[i] >> c[i];
		}

		pos = 0;
		for( i = r; i--; ){
			if( pos < c[i] ){
				pos += p[i] - 1;
			}
			else if( pos < c[i] + p[i] - 1 ){
				pos -= c[i];
			}
		}
		cout << n - pos << endl;
	}
}

Measured memory_bytes: 0
#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <cassert>
 
using namespace std;
 
const int N = 10000;
 
int ten[6] = {1, 10, 100, 1000, 10000, 100000};
 
int getDigits(int a){
  if(a == 0) return 1;
  int res = 0;
  while(a != 0){
    res++;
    a /= 10;
  }
  return res;
}
 
int calc(int a, int b){
  int d = getDigits(b);
  return a * ten[d] + b;
}
 
main(){
  int n;
  int data[N+1];
  fill(data, data+N+1, 0);
  cin >> n;
  vector<int> vec;
  for(int i=0;i<n;i++){
    int in;
    cin >> in;
    //assert(in <= ten[4]);
    //assert(data[in] == 0);
    data[in]++;
    //vec.push_back(in);
  }
  int cnt = 0;
  for(int i=0;cnt<n&&cnt<4&&i<=N;i++){
    for(int j=0;cnt<n&&cnt<4&&j<data[i];j++){
      vec.push_back(i); cnt++;
    }
    }
  //for(int i=0;i<vec.size();i++) cout << vec[i] << ' '; cout << endl;
  vector<int> ans;
  int m[3] = {200000000, 200000000, 200000000};
  for(int i=0;i<vec.size();i++){
    for(int j=0;j<vec.size();j++){
      if(i == j) continue;
      ans.push_back(calc(vec[i], vec[j]));
      /*int t = calc(vec[i], vec[j]);
      if(t < m[0]){ m[2] = m[1]; m[1] = m[0]; m[0] = t; }
      else if(t < m[1]){ m[2] = m[1]; m[1] = t; }
      else if(t < m[2]){ m[2] = t; }*/
    }
  }
  //for(int i=0;i<ans.size();i++) cout << ans[i] << ' '; cout << endl;
  sort(ans.begin(), ans.end());
  cout << ans[2] << endl;
  //cout << m[2] << endl;
}

Measured memory_bytes: 1256
# -*- coding: utf-8 -*-
import sys

def main():
	tmp = input()
	tmp2 = list(tmp)
	num = [int(s) for s in tmp2]
	
	op1 = ""
	op2 = ""
	op3 = ""
	if num[0] + num[1] + num[2] + num[3] == 7:
		op1 = "+"
		op2 = "+"
		op3 = "+"
	if num[0] + num[1] + num[2] - num[3] == 7:
		op1 = "+"
		op2 = "+"
		op3 = "-"
	if num[0] + num[1] - num[2] - num[3] == 7:
		op1 = "+"
		op2 = "-"
		op3 = "-"
	if num[0] - num[1] + num[2] - num[3] == 7:
		op1 = "-"
		op2 = "+"
		op3 = "-"
	if num[0] - num[1] - num[2] + num[3] == 7:
		op1 = "-"
		op2 = "-"
		op3 = "+"
	if num[0] - num[1] - num[2] - num[3] == 7:
		op1 = "-"
		op2 = "-"
		op3 = "-"
	if num[0] + num[1] - num[2] + num[3] == 7:
		op1 = "+"
		op2 = "-"
		op3 = "+"
	if num[0] - num[1] + num[2] + num[3] == 7:
		op1 = "-"
		op2 = "+"
		op3 = "+"
	print("{}{}{}{}{}{}{}=7".format(num[0], op1, num[1], op2, num[2], op3, num[3]))
		
if __name__ == "__main__":
	main()
	

Measured memory_bytes: 3064
//b
#include <iostream>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <memory>
#include <functional>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>

#define REP(i,b,n) for(int i=b;i<n;i++)
#define REPR(i,b,n) for(int i=n-1;i>=b;i--)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PB push_back
#define MP make_pair

using namespace std;

static const double PI = acos(-1.0);
static const double EPS = 1e-9;
typedef long long ll;
typedef pair<int, int> pii;


int main(){
	
	bool first = true;
	int pay;
	int c[4];
	int used[4] = {0};
	const int pr[4] = {10, 50, 100, 500};
	
	while(cin >> pay, pay){
		
		if(!first){
			cout << endl;
		}
		
		first = false;
		
		int mn = 1<<10;
		int purse = 0;
		
		for(int i=0; i<4; ++i){
			cin >> c[i];
			purse += c[i];
		}
		
		CLR(used);
		
		for(int p = 0; p <= c[0]; ++p){
			for(int q = 0; q <= c[1]; ++q){
				for(int r = 0; r <= c[2]; ++r){
					for(int s = 0; s <= c[3]; ++s){		
						
						int utmp[4] = {p, q, r, s};
						int tmp = purse - p - q - r - s;
						int cha = p*pr[0] + q*pr[1] + r*pr[2] + s*pr[3] - pay;
						
						if(cha < 0){
							continue;
						}
						
						if( cha > 0){
							
							for(int i=3; i>=0; --i){
								
								if(cha >= pr[i]){
								
									tmp += cha/pr[i];
									cha %= pr[i];
								}
							}
						}
						
						if(mn > tmp){
							
							mn = tmp;
							
							for(int i=0; i<4; ++i){
								used[i] = utmp[i];
							}
						}
						
					}}}}
		
		for(int i=0; i<4; ++i){
			
			if(used[i] > 0){
				cout << pr[i] << " " << used[i] << endl;
			}
		}
					
	}
	
	return 0;
}

Measured memory_bytes: 1160
import java.text.DecimalFormat;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		DecimalFormat df1 = new DecimalFormat("0.########");
		double x1 = sc.nextDouble();
		double y1 = sc.nextDouble();
		double x2 = sc.nextDouble();
		double y2 = sc.nextDouble();
		double p;
		
		p = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
		System.out.println(df1.format(p));
	}
}


Measured memory_bytes: 27984
/******************************************
* AUTHOR : GURUTEJA *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define N 100005
#define MOD 1000000007
#define dd double
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,b) for(int i=1;i<=b;i++)
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define F first
#define S second

void debug(){
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif 

}

  int main() {
    debug();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;


    	long long int count=0;
    	for (int i =1; i<n; ++i)
    	{
    		if(n%i==0){
    			count--;
    		}
    		count+=(n/i);
    	}
    	cout<<count<<endl;
    return 0;
  }

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

int main(){
 int K,X,i;
  cin >> K >> X;
  for(i=0;i<2*K-1;i++){
	printf("%d",X-K+1+i);
    if(i != 2*K){
    printf(" ");
    }else{
        printf("\n");
    }
  }
    return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
s, l = sum(a), 0
for i in range(n):
  l += a[i]
  if l>= s/2:
    ans = min([abs(l-a[i]-sum(a[i:])),abs(l-sum(a[i+1:]))])
    print(round(ans))
    break

Measured memory_bytes: 31428
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(long long i=0;i<n;++i)
#define REPP(i,m,n) for(long long i=m;i<n;++i)
#define de cout << "line : " << __LINE__ << " debug" << endl;

struct UnionFind{
    vector<long long> par,r;

    //はじめに全てが根であるとしておく
    UnionFind(long long N):par(N),r(N,1){iota(par.begin(),par.end(),0);}

    long long root(long long x){//根に当たるまで再帰で探す
        if(par[x] == x) return x;
        else return par[x] = root(par[x]);
    }

    bool same(long long x,long long y){//つながっているかどうか判定
        return root(x) == root(y);
    }

    long long size(long long x){ //根の大きさを判定する
        return r[root(x)];
    }

    void unite(long long x, long long y){//根が同じでなかったらつなげる
        x = root(x), y = root(y);
        if(x == y) return;
        if(r[x] < r[y]) swap(x,y); //値を小さいほうを根にする
        r[x] += r[y];
        par[y] = x;
        return;
    }
};


signed main() {
    cin.tie(0);
	ios::sync_with_stdio(false);
    long long N,M;cin >> N >> M;
    UnionFind UF(2*N);
    long long A,B;
    REP(i,M){
        cin >> A >> B;A--;B--;
        UF.unite(A,B + N);
        UF.unite(A + N,B);
    }

    REP(i,N){
        if(UF.same(i,i + N)){
            cout << (long long)(N-1)*N/2 - M << endl;
            return 0;
        }
    }
    long long b = 0,w = 0;
    REP(i,N){
        if(UF.same(0,i)) b++;
        else w++;
    }
    cout << (long long)b*w - M << endl;
}


Measured memory_bytes: 3456
#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <vector>
#include <list>

using namespace std;



int main() {
	int w, h, n, p[100][3];
	cin >> w >> h >> n;
	for (int i = 0; i < n; i++) {
		cin >> p[i][0] >> p[i][1] >> p[i][2];
	}
	int xleft = 0, xright = w, ytop = h, ybottom = 0;
	for (int i = 0; i < n; i++) {
		if (p[i][2] == 1 && p[i][0] > xleft) {
			xleft = p[i][0];
		}
		if (p[i][2] == 2 && p[i][0] < xright) {
			xright = p[i][0];
		}
		if (p[i][2] == 3 && p[i][1] > ybottom) {
			ybottom = p[i][1];
		}
		if (p[i][2] == 4 && p[i][1] < ytop) {
			ytop = p[i][1];
		}
	}
	int s = (xright - xleft) * (ytop - ybottom);
	if (xright-xleft>0&&ytop-ybottom>0)cout << s << endl;
	else cout << 0 << endl;
	return 0;
}



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

#define N 100005

vector <int> v[N];

int n, m;

int main() {
	scanf("%d %d", &n, &m);
	int x, y;
    for (int i = 1; i <= m; i ++) {
        scanf("%d %d", &x, &y);
        v[x].push_back(y);
        v[y].push_back(x);
    }
    int mx = 0, G = 0;
    bool flag = 0;
    for (int i = 1; i <= n; i ++) {
		int d = v[i].size();
		mx = max(mx, d);
        if (d&1) flag = 1;
        if (v[i].size() == 4) G ++;
    }
    if (flag || mx <= 2) puts("No");
    else if (mx >= 6 || G >= 3) puts("Yes");
    else if (G == 1) puts("No");
    else {
        queue <int> Q;
        bool f = 0;
        function <void(int, int)> pop = [&](int id, int x) {
            for (int i = 0; i < v[id].size(); i ++) {
				if (v[id][i] == x) {
					swap(v[id][i], v[id].back());
					v[id].pop_back();
				}
            }
            return;
        };
        function <void(int, int)> push = [&](int id, int x) {
            v[id].push_back(x);
            return;
        };
        for (int i = 1; i <= n; i ++) if (v[i].size() == 2) {
            int x = v[i][0], y = v[i][1];
            if (x == y) f = 1;
            else {
                pop(v[i][0], i);
                pop(v[i][1], i);
                push(v[i][0], v[i][1]);
                push(v[i][1], v[i][0]);
            }
        }
        if (f) puts("Yes");
        else puts("No");
    }
	return 0;
}


Measured memory_bytes: 5760
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

import math
def dist(pa,pb):
    return math.sqrt((pa[0]-pb[0])**2+(pa[1]-pb[1])**2)

def theta(h,m):
    return math.pi * (h+m/60.0) / 6.0

def phi(m):
    return math.pi * m / 30.0

def pos(r,th):
    return (r*math.cos(th), r*math.sin(th))

a,b,h,m = inm()
pa = pos(a,theta(h,m))
pb = pos(b,phi(m))
print(dist(pa,pb))


Measured memory_bytes: 62592
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[3];
  rep(i,n){
    rep(j,3){
      cin >> a[j];
    }
    sort(a,a+3);
    //rep(i,3) cout << a[i] << " ";
    if(a[2]*a[2] == a[0]*a[0] + a[1]*a[1]) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}



Measured memory_bytes: 3044
#include <iostream>
using namespace std;
typedef long long ll;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,x,y;
    cin >> n >> x >> y;
    int ans[n-1] = {};
    x--;y--;

    int a;
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++){
        a = abs(i-j);
        a = min(a,abs(i-x)+abs(j-y)+1);
        a = min(a,abs(i-y)+abs(j-x)+1);
        if (a > 0) ans[a-1]++;
    }
    for (int ai:ans) cout << ai/2 << "\n";
}

Measured memory_bytes: 3680
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define erep(i,a,n) for(int i = a;i<=n;i++)
typedef long long ll;
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<string>
#define vdouble vector<double>
#define vll vector<ll>:
#define vbool vector<bool>
#define INF 1101010101010101010
#define MOD 1000000007
#define 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; }

signed main(){
  int n;
  cin >> n;
  int k = 0;
  int sum = 0;
  for(int i = 1;i <= 100000;i++){
    sum += i;
    if(n < sum){
      cout << "No" << endl;
      return 0;
    }
    else if(sum == n){
      k = i;
      break;
    }
  }
  // cout << n << k << endl;
  int kk = k;
  vvint ans(k+1);
  int now = 0;
  int i = 1;
  while(i <= n){
    rep(j,1,k+1){
      // cout << i << endl;
      ans[now].push_back(i);
      ans[now+j].push_back(i);
      i++;
    }
    k--;
    now++;
  }
  cout << "Yes" << endl; 
  cout << kk+1 << endl;
  rep(i,0,kk+1){
    cout << kk << " ";
    for(auto p:ans[i]) cout << p << " ";
    cout << endl;
  }
}

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

using namespace std;
using LL = long long;
using P = pair<int, int>;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e18;
const int MOD = (int)1e9 + 7;

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

    int n, m;
    cin >> n >> m;

    vector<int> a(m), b(m);
    REP(i, m) cin >> a[i] >> b[i];

    int ans = 0;
    REP(i, m){
        vector<vector<int>> graph(n);
        REP(j, m){
            if(i != j) {
                graph[a[j] - 1].pb(b[j] - 1);
                graph[b[j] - 1].pb(a[j] - 1);
            }
        }
        queue<int> que;
        vector<bool> closed(n, false);

        que.push(0);
        closed[0] = true;
        while(!que.empty()){
            int cur = que.front();
            que.pop();
            for(auto nextEdge : graph[cur]){
                if(!closed[nextEdge]) {
                    que.push(nextEdge);
                    closed[nextEdge] = true;
                }
            }
        }

        bool flag = true;
        REP(i, n) if(!closed[i]) {
            flag = false;
        }

        if(!flag) ans++;
    }
    cout << ans << endl;
}

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

typedef long long           ll;
typedef vector < int >      vi;
typedef vector < ll >       vll;
typedef pair < int, int >   pii;
typedef pair < ll, ll >     pll;
typedef set<int>            sset;
typedef multiset<ll>        mset;

#define gcd(a,b)            __gcd(a,b)
#define lcm(a,b)            a/gcd(a,b)*b
#define pb                  push_back
#define mp                  make_pair
#define endl                "\n"
#define optimize            ios::sync_with_stdio(0); cin.tie(0)

void solve()
{
  string s,s1;cin>>s>>s1;int c=0;
  for(int i=0;i<s.size();i++){
    if(s[i]!=s1[i])
        c++;
  }
  cout<<c<<endl;
}

int main() {
  //int t;cin>>t;while(t--)
    solve();

    return 0;
}




Measured memory_bytes: 3832
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second

using namespace std;

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


int main(){
    int r;
    cin >> r;
    cout << r * r << endl;
    
    return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define oo 1e9
#define fi first
#define se second
#define sp(iiii) setprecision(iiii)
#define IO ios_base::sync_with_stdio(false); cin.tie(0)
#define ms(aaaa,xxxx) memset(aaaa,xxxx,sizeof(aaaa))
#define cntbit(xxxx) __builtin_popcount(xxxx)
#define getbit(xxxx,aaaa) ((xxxx>>(aaaa-1))&1)
#define _cos(xxxx) cos(xxxx*acos(-1)/180)
#define _sin(xxxx) sin(xxxx*acos(-1)/180)
#define _tan(xxxx) tan(xxxx*acos(-1)/180)
#define PE cout<<fixed
 
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pair<int,int>,int> piii;
typedef pair<long long,long long> pll;
typedef pair<pair<long long,long long>,long long> plll;
 
const ld pi=acos(-1);

string s;
ll res,i;

int main() {
    IO;
    cin>>s;
    for (i=0;i<s.length();i++) {
        res+=s[i]-'0';
    }
    if (res%9==0) {
        cout<<"Yes\n";
    }
    else {
        cout<<"No\n";
    }
}
    

Measured memory_bytes: 3712
#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
#include <vector>
#include <complex>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <iterator>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <regex>
#include <limits>
#include <time.h>
#include <cstdint>
using namespace std;
using pii  = pair<int,int>;
using ll=long long;
using ld=long double;
#define pb push_back
#define mp make_pair
#define sc second
#define fr first
#define stpr setprecision
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define rep(i,n) for(ll i=0;i<(n);++i)
#define Rep(i,a,b) for(ll i=(a);i<(b);++i)
#define rrep(i,n) for(ll i=n-1;i>=0;i--)
#define rRep(i,a,b) for(ll i=a;i>=b;i--)
#define crep(i) for(char i='a';i<='z';++i)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define ALL(x) (x).begin(),(x).end()
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define endl '\n'
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
ll gcd(ll a,ll b){return (b == 0 ? a : gcd(b, a%b));}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll MOD=1000000007;
constexpr ll INF=1000000011;
constexpr ll MOD2=998244353;
constexpr ll LINF = 1001002003004005006ll;
constexpr ld EPS=10e-8;
template <class T, class U> inline bool chmax(T& lhs, const U& rhs) { if (lhs < rhs) { lhs = rhs; return 1; } return 0; }
template <class T, class U> inline bool chmin(T& lhs, const U& rhs) { if (lhs > rhs) { lhs = rhs; return 1; } return 0; }
template<typename T> istream& operator>>(istream& is,vector<T>& v){for(auto&& x:v)is >> x;return is;}
template<typename T,typename U> istream& operator>>(istream& is, pair<T,U>& p){ is >> p.first; is >> p.second; return is;}
template<typename T,typename U> ostream& operator>>(ostream& os, const pair<T,U>& p){ os << p.first << ' ' << p.second; return os;}
template<class T> ostream& operator<<(ostream& os, vector<T>& v){
  for(auto i=begin(v); i != end(v); ++i){
    if(i !=begin(v)) os << ' ';
    os << *i;
  }
  return os;
}

pair<ll,ll> A[1007];
ll C[10007];

int main(){
  ll H,N;
  cin >> H >> N;
  rep(i,N){
    cin >> A[i].fr >> A[i].sc;
  }
  C[0]=0;
  Rep(i,1,H+1){
    C[i]=LINF;
    rep(j,N){
      ll K=max(0ll,i-A[j].fr);
      ll X=C[K]+A[j].sc;
      C[i]=min(C[i],X);
    }
  }
  cout << C[H] << endl;
}

Measured memory_bytes: 3684
#include<bits/stdc++.h>
using namespace std;
int64_t N,K;
int main(){
  cin>>N>>K;
  vector<int64_t>A(N);
  for(int i=0;i<N;i++)
    cin>>A.at(i);
  int64_t left=0;int64_t right=1000000001;
  while(1<right-left){
  int64_t mid=left+(right-left)/2;
   int64_t c=0;
    for(int i=0;i<N;i++){
      c+=((A.at(i)-1)/mid);
     }if(c<=K)
    right=mid;
  else
    left=mid;
}cout<<right<<endl;
 
  return 0;
}

Measured memory_bytes: 4756
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <cassert>
#include <random>


int main() {
    std::vector<long long> cnt(2020);
    std::string s; std::cin >> s;
    int cur = 0, b = 1;
    int n = s.size();
    cnt[0]++;
    for (int i = n - 1; i >= 0; i--) {
        cur += b*(s[i] - '0');
        cur %= 2019;
        cnt[cur]++;
        b *= 10;
        b %= 2019;
    }
    long long ans = 0;
    for (int i = 0; i < 2019; i++) {
        ans += cnt[i] * (cnt[i] - 1) / 2;
    }
    std::cout << ans << std::endl;
    return 0;
}

Measured memory_bytes: 3772
#include <stdio.h>

#define MAX_N 100


int main()
{
    int n;
    int a1[MAX_N + 1];
    int a2[MAX_N + 1];
    int maxScore;
    
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
    {
	scanf("%d", &a1[i]);
    }
    for (int i = 1; i <= n; i++)
    {
	scanf("%d", &a2[i]);
    }

    maxScore = 0;
    for (int i = 1; i <= n; i++)  // iの時に下に移動する
    {
	int tempScore = 0;
	for (int j = 1; j <= n; j++)
	{
	    if (j < i)
	    {   // 右に移動する
		tempScore = tempScore + a1[j];
	    }
	    else
	    {   // 下の段
		tempScore = tempScore + a2[j];
	    }
	}
	tempScore = tempScore + a1[i]; // 下に移動する直前の上の段の値
	if (tempScore > maxScore)
	{
	    maxScore = tempScore;
	}
    }
    printf("%d\n", maxScore);

    return 0;
}


Measured memory_bytes: 128
a = []
a = gets.chomp.split("").map(&:to_i)
#p a[0].class
t = 0
for i in 1..a.length-1
    if a[i] != 9
        t = 1 
    end
end
#p t
if t==0
    puts (a[0] + 9 * (a.length-1)).to_i
    exit
end
puts (a[0] + 9 * (a.length-1) - 1).to_i

Measured memory_bytes: 1788
fn main() {
    let mut today = String::new();
    std::io::stdin().read_line(&mut today).unwrap();
    let tommorow = match today.trim() {
        "Sunny" => "Cloudy",
        "Cloudy" => "Rainy",
        "Rainy" => "Sunny",
        _ => panic!()
    };
    println!("{}", tommorow);
}

Measured memory_bytes: 4352
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

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

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func check(x, y int, a, next [3]int) ([3]int, int, bool) {
	if a[x] == 0 && a[y] == 0 {
		return a, 0, false
	}
	if a[x] == 0 {
		a[x]++
		a[y]--
		return a, x, true
	}
	if a[y] == 0 {
		a[x]--
		a[y]++
		return a, y, true
	}
	if next[x] == 1 {
		a[x]++
		a[y]--
		return a, x, true
	}
	a[x]--
	a[y]++
	return a, y, true
}

func main() {
	sc.Split(bufio.ScanWords)
	N := getInt()
	a := [3]int{}
	for i := 0; i < 3; i++ {
		a[i] = getInt()
	}
	p := make([][3]int, N+1)
	for i := 0; i < N; i++ {
		s := getString()
		switch s {
		case "AB":
			p[i][0] = 1
			p[i][1] = 1
		case "BC":
			p[i][1] = 1
			p[i][2] = 1
		case "AC":
			p[i][0] = 1
			p[i][2] = 1
		}
	}

	// out(a, p)

	ans := make([]int, N)
	for i := 0; i < N; i++ {
		var flg bool
		var num int
		if p[i][0] == 1 && p[i][1] == 1 { // AB
			a, num, flg = check(0, 1, a, p[i+1])
		} else if p[i][1] == 1 && p[i][2] == 1 { // BC
			a, num, flg = check(1, 2, a, p[i+1])
		} else { // AC
			a, num, flg = check(0, 2, a, p[i+1])
		}
		if flg == false {
			out("No")
			return
		}
		ans[i] = num
		// out(a)
	}

	out("Yes")

	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	for i := 0; i < N; i++ {
		fmt.Println(string('A' + ans[i]))
	}
}


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

int main() {
  int N,M,X,Y;
  cin >> N >> M >> X >> Y;
  int x_max = -101;
  int y_min = 101;
  for (int i=0; i<N; ++i) {
    int x;
    cin >> x;
    if (x > x_max) x_max = x;
  }
  for (int i=0; i<M; ++i) {
    int y;
    cin >> y;
    if (y < y_min) y_min = y;
  }

  if (x_max >= Y-1  || y_min <= X) {
    cout << "War";
    return 0;
  }

  if (x_max >= y_min) {
    cout << "War";
  } else {
    cout << "No War";
  }

  return 0;
}


Measured memory_bytes: 384
//競技プログラミング用のテンプレート
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <math.h>
#include <stack>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repr(i, n) for(int i = n - 1; i >= 0; i--)

using namespace std;
using ll = long long int;
using p = pair<int, int>;
using pl = pair<ll, ll>;
using v = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vl = vector<ll>;

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


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int N;
			N = Integer.parseInt(scanner.nextLine());
			Map<String, Long> map = new HashMap<String, Long>();

			long ans = 0;
			for (int i = 0; i < N; i++) {
				char[] tmp = scanner.nextLine().toCharArray();
				Arrays.sort(tmp);

				String key = new String(tmp);
				if (map.containsKey(key)) {
					map.put(key, map.get(key) + 1L);
				} else {
					map.put(key, 1L);
				}
			}
			for (long l : map.values()) {
				ans += (l * (l - 1L)) / 2L;
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 103680
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  int a, b;
  cin >> a >> b;

  if(a+b == 15) cout << "+" << endl;
  else if(a*b == 15) cout << "*" << endl;
  else cout << "x" << endl;
  
  return 0;
}



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

int count(int i,int N,vector<int> &B){
  int sum = 0;
  for(int j=i;j<=N;j+=i){
    if(B.at(j-1) == 1) sum++;
  }
  return sum;
}

int main(){
  int N,in=0;
  cin >> N;
  vector<int> A(N),B(N);
  for(int i=0;i<N;i++) cin >> A.at(i);
  
  for(int i=N;i>=1;i--){
    if(count(i,N,B) % 2 != A.at(i-1)){
      B.at(i-1) = 1;
      in++;
    }
    else B.at(i-1) = 0;
  }
  
  cout << in << endl;
  for(int i=0;i<N;i++){
    if(B.at(i)) cout << i+1 << " ";
  }
  return 0;
}


Measured memory_bytes: 2432
#include<stdio.h>
#include<stdlib.h>
int main()
{
    int x,a,b,ans;
    scanf("%d",&x);
    a=x/500;
    x=x%500;
    b=x/5;
    ans=a*1000+b*5;
    printf("%d",ans);
    return 0;
}


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

int divceil(int a, int b) {
	return (a + b - 1) / b;
}

int main() {
	int k, q;
	cin >> k >> q;
	vector<int> d(k);
	rep(i, k) cin >> d[i];
	rep(qi, q) {
		int n, x, m;
		cin >> n >> x >> m;
		ll last = x, eq = 0;
		//diが何回出されるかを計算
		rep(i, k) {
			ll num = divceil(n - 1 - i, k);
			last += (d[i] % m) * num;
			if (d[i] % m == 0) eq += num;
			//ここで最終的な答えが分かります。
		}
		ll ans = n - 1 - (last / m - x / m) - eq;
		cout << ans << endl;
	}
	return 0;
}


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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  int count = 3;
  if(a==b&&b==c) count=1;
  else if(a==c) count=2;
  else if(b==c) count=2;
  else if(a==b) count=2;
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func scanNums(len int) (nums []int) {
	for i := 0; i < len; i++ {
		nums = append(nums, nextInt())
	}
	return
}

func main() {
	sc.Split(bufio.ScanWords)
	N := nextInt()
	satisfactionLevel := 0

	A := scanNums(N)
	B := scanNums(N)
	C := scanNums(N - 1)

	for i := 1; i <= N; i++ {
		satisfactionLevel += B[A[i-1]-1]

		if i != 1 {
			if A[i-2] == A[i-1]-1 {
				satisfactionLevel += C[A[i-2]-1]
			}
		}

	}

	fmt.Println(satisfactionLevel)
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
#define all(obj) (obj).begin(), (obj).end()
static const int dx[4] = {0, 1, 0, -1};
static const int dy[4] = {1, 0, -1, 0};
static const char dir[4] = {'u', 'r', 'd', 'l'};
static const ll INF = 1ll << 60;
static const ll MOD = 1e9 + 7;
int N;

signed main() {
  cin >> N;
  vector<ll> P(N);
  rep(i, N) { cin >> P[i]; }
  ll minv = P[0];
  ll res = 0;
  rep(i, N) {
    if (P[i] <= minv) {
      res++;
      minv = P[i];
    }
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 1792
import java.util.*;
import java.io.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("TaskABeg144.out");
        int n = sc.nextInt();
        boolean done = false;
        for(int i = 1; i<=9; i++){
            if(n%i == 0 && (n/i) <= 9){
                System.out.println("Yes");
                done = true;
                break;
            }
        }
        if(!done){
            System.out.println("No");
        }
    }
}

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

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

using II = pair<int, int>;

int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
int extgcd(int a, int b, int &x, int &y) { int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; }

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

signed main()
{
  int N; cin >> N;
  string S; cin >> S;
  REP(n,S.size()) {
    S[n] = (char)((S[n] - 'A' + N) % 26 + 'A');
  }
  cout << S << endl;
  return 0;
}


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


def dfs(s):
    if int(s) > N:
        return 0
    if all(s.count(c) > 0 for c in '753'):
        ret = 1
    else:
        ret = 0
    for c in '753':
        ret += dfs(s + c)
    return ret


print(dfs('0'))

Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
using ll = long long; 
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
template<class T> using pq = priority_queue<T>;
template<class T> using P = pair<T, T>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define REP(i,k,n) for(int i=(k);i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << endl;
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; }
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; }
const ll MOD = 1e9 + 7;
const ll BetsuMOD = 998244353;
ll upper = MOD + MOD;
ll under = -upper;
ll UPPER = MOD * MOD;
ll UNDER = -MOD * MOD;
const long double pi = 3.141592653589793;
int digitsum(ll x) {
	int res = 0;
	while (x) {
		res += x % 10;
		x /= 10;
	}
	return res;
}
int main() { // 問題文はしっかり読め!!!
	ll n;
	cin >> n;
	int choku = digitsum(n);
	string s = to_string(n);
	int dec = 9 * (s.size() - 1) + s[0] - '0' - 1;
	cout << max(choku, dec) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
void init(int n);
int find(int n);
void unite(int x,int y);
bool same(int x, int y);
ll bpow(ll,ll,ll);
typedef vector<int> vec;
typedef vector<vec> mat;
mat mul(mat &A,mat &B);
mat pow(mat A,ll n);
int dx[4] = {1,0,0,-1};
int dy[4] = {0,1,-1,0};
const int MOD = 1000000007;

bool sosu[55588];
void erast(){
  REP(i,55588)sosu[i] = true;
  sosu[0] = sosu[1] = false;
  for(int i=2;i<55588;i++){
    if(sosu[i]){
      for(int j=i+i;j<55588;j+=i){
        sosu[j] = false;
      }
    }
  }
}

int main()
{
  int N,cnt=0;
  cin >> N;
  erast();
  for(int i=2;cnt<N;i++){
    if(i%5==1 && sosu[i]){
      cout << i << endl;
      cnt++;
    }
 
  }
  return 0;
}



Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int M, D;
    cin >> M >> D;

    long long ans = 0;
    bool F = true;
    for(int d_10 = 2; d_10 <= 9; d_10++){
        for(int d_1 = 2; d_1 <= 9; d_1++){
            if(d_10 * 10 + d_1 > D){
                F = false;
                break;
            }

            if(d_10 * d_1 <= M){
                // cout << d_10 << d_1 << endl;
                ans++;
            }
        }

        if(F = false){
            break;
        }
    }

    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 256