akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
#include <vector>
#include <functional>
using namespace std;

int n;
vector<int> v;
int main(){
	cin >> n;

	for (int i = 0; i < n; ++i){
		int buf;
		cin >> buf;
		v.push_back(buf);
	}

	//sort(v.begin(), v.end(), greater<int>());

	vector<int>::reverse_iterator it, end;
	for (it = v.rbegin(), end = v.rend(); it != end;++it){
		if (it == v.rbegin())
			cout << (*it);
		else
			cout << " " << (*it);
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 1216
import java.io.*;
//import javafx.util.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
{
	public static void main (String[] args)
	 {
	 //code
	 Scanner sc =new Scanner(System.in);
	 int n=sc.nextInt();
	 int a[]=new int[n];
	 int dp[]=new int[n];
	 for(int i=0;i<n;i++) {
		 a[i]=sc.nextInt();
	 }
	 dp[0]=0;
	 dp[1]=Math.abs(a[1]-a[0]);
	 for(int i=2;i<n;i++) {
		 dp[i]=Math.min(Math.abs(a[i]-a[i-2])+dp[i-2],Math.abs(a[i]-a[i-1])+dp[i-1] );
	 }
	 System.out.println(dp[n-1]);
	}
}

Measured memory_bytes: 50732
#include<stdio.h>
int main(void)
{
    int n;
    char DICE[10];
    while(1){
        scanf("%d",&n);
        if(n == 0) break;
        int dice[6] = {4,1,3,2,6,5};
        int i,temp;
        int sum = 1;
        for(i = 0; i < n; i++){
            scanf("%s",DICE);
            if(DICE[0] == 'N'){
                temp = dice[1];
                dice[1] = dice[3];
                dice[3] = dice[4];
                dice[4] = dice[5];
                dice[5] = temp;
            }
            if(DICE[0] == 'E'){
                temp = dice[1];
                dice[1] = dice[0];
                dice[0] = dice[4];
                dice[4] = dice[2];
                dice[2] = temp;
            }
            if(DICE[0] == 'W'){
                temp = dice[1];
                dice[1] = dice[2];
                dice[2] = dice[4];
                dice[4] = dice[0];
                dice[0] = temp;
            }
            if(DICE[0] == 'S'){
                temp = dice[1];
                dice[1] = dice[5];
                dice[5] = dice[4];
                dice[4] = dice[3];
                dice[3] = temp;
            }
            if(DICE[0] == 'R'){
                temp = dice[0];
                dice[0] = dice[3];
                dice[3] = dice[2];
                dice[2] = dice[5];
                dice[5] = temp;
            }
            if(DICE[0] == 'L'){
                temp = dice[0];
                dice[0] = dice[5];
                dice[5] = dice[2];
                dice[2] = dice[3];
                dice[3] = temp;
            }
            sum += dice[1];
        }
        printf("%d\n",sum);
    }

    return 0;
}

Measured memory_bytes: 604
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
#define rep(i, a, b) for(int i = a; i < b; i++)

const double EPS = 1e-10;

double add(double a, double b){
    if( abs(a + b) < EPS * (abs(a) + abs(b))) return 0;
    return a + b;
}

// 二次元ベクトル構造体
struct P{
    double x, y;
    P(){}
    P(double x, double y) : x(x), y(y){
    }
    P operator + (P p){
        return P(add(x, p.x), add(y, p.y));
    }
    P operator - (P p){
        return P(add(x, -p.x), add(y, -p.y));
    }
    P operator * (double d){
        return P(x * d, y * d);
    }
    P operator / (double d){
        return P(x / d, y / d);
    }
    double dot(P p){ // 内積
        return add(x * p.x, y * p.y);
    }
    double det(P p){ // 外積
        return add(x * p.y, -y * p.x);
    }
};

// 2点間の長さ
double dist(P a, P b){
    return sqrt((b-a).dot(b-a));
}
double dist2(P a, P b){
    return (b-a).dot(b-a);
}

//　線分p1-p2上に点qがあるか判定
bool on_seg(P p1, P p2, P q){
    return (p1 - q).det(p2 - q) == 0 && (p1 - q).dot(p2 - q) <= 0;
}

// 直線p1-p2と直線q1-q2の交点
P intersection(P p1, P p2, P q1, P q2){
    return p1 + (p2 - p1) * ((q2 - q1).det(q1 - p1) / (q2 - q1).det(p2 - p1));
}

int N;
vector<P> p;
bool Cis(P circle, double r){
    rep(i, 0, N){
        if(dist(circle, p[i]) > r + EPS) return false;
    }
    return true;
}

int main(){
    cin >> N;
    p.resize(N);
    rep(i, 0, N) cin >> p[i].x >> p[i].y;
    double ans = 1e9;

    rep(i, 0, N){
        rep(j, 0, N) if(i != j){
            P mid = (p[i] + p[j] ) * 0.5;
            double r = dist(p[i], mid);
            if(Cis(mid, r)) ans =  min(ans, r);
        }
    }
    //cout << ans << endl;

    rep(i, 0, N){
        rep(j, 0, N) if(i != j){
            rep(k, 0, N) if(i != k && j != k){
                P mid;
                double A = dist2(p[j], p[k]), B = dist2(p[i], p[k]), C = dist2(p[i], p[j]),
                S = fabs((p[j]-p[i]).det(p[k]-p[i]));
                mid = p[i] * A * (B + C - A)  + p[j] * B * (C + A - B) + p[k] * C * (A + B - C);
                mid = mid / (4 * S * S);
                double r = dist(p[i], mid);
                if(Cis(mid, r)) ans =  min(ans, r);
            }
        }
    }
    cout << fixed << setprecision(10) <<  ans << endl;


}

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


int main(){
    int n;
    cin >> n;
    vector<ll> a(n), b(n), c(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    rep(i, n) cin >> c[i];
    sort(a.begin(), a.end());
    sort(c.begin(), c.end());
    ll ans = 0;
    
    rep(i, n){
        auto itr_a = lower_bound(a.begin(), a.end(), b[i]);
        auto itr_c = upper_bound(c.begin(), c.end(), b[i]);
        ll an = distance(a.begin(), itr_a);
        ll cn = distance(c.begin(), itr_c);
        ans += an * (n - cn);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

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

typedef tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"

template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) 
{
    os << "{ ";
    for(auto& y : x) 
    {
        os << y << " ";
    }
    return os << "}";
}

template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) 
{
    return os << "[" << p.ff << ", " << p.ss << "]";
}

ll gcd(ll a, ll b)
{
    if(b==0)
    {
        return a;
    }

    return gcd(b, a%b);
}

ll modexp(ll a, ll b, ll c)
{   
    a%=c;

    ll ans = 1;

    while(b)
    {
        if(b&1)
        {
            ans = (ans*a)%c;
        }

        a = (a*a)%c;
        b >>= 1;
    }

    return ans;
}

ll nxt()
{
    ll x;
    cin >> x;
    return x;
}

const ll L = 1e5+5;

void solve()
{
    ll l = nxt();

    double s = (double)l/(double)3;

    cout << fixed << setprecision(10) << (double)(s*s*s) << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
    ll T = 1;
    // T = nxt();

    while(T--)
    {
        solve();
    }

    return 0;
}

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

    public class P
    {
        public int area { get; set; }
        public int id { get; set; }
    }

public class Hello
{
    public static void Main()
    {
        var s = Console.ReadLine().Trim();
        getAns(s);
    }
    public static void print(Stack<P> st)
    {
        var n = st.Count();
        if (n == 0) { Console.WriteLine(0); Console.WriteLine(0); return; }
        var asum = st.Pop().area;
        var sb = new StringBuilder();
        sb.Append(asum);
        for (int i = 1; i < n; i++)
        {
            var w = st.Pop();
            sb.Insert(0, " ");
            sb.Insert(0, w.area);
            asum += w.area;
        }
        sb.Insert(0, " "); sb.Insert(0, n);
        Console.WriteLine(asum);
        Console.WriteLine(sb.ToString());
    }
    public static void getAns(string s)
    {
        var st1 = new Stack<int>();
        var st2 = new Stack<P>();
        for (int i = 0; i < s.Length; i++)
            if (s[i] == '\\') st1.Push(i);
            else if (s[i] == '/' && st1.Count() > 0)
            {
                var id = st1.Pop();
                var area = i - id;
                while (st2.Count() > 0 && id <= st2.Peek().id)
                {
                    area += st2.Peek().area;
                    st2.Pop();
                }
                st2.Push(new P { id = id, area = area });
            }
        print(st2);
    }
}



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

namespace ABC094_B_Toll_Gates
{
	internal class Program
	{
		public static void Main(string[] args)
		{
			string[] input = Console.ReadLine().Split(' ');
			int n = int.Parse(input[0]);
			int m = int.Parse(input[1]);
			int x = int.Parse(input[2]);
			input = Console.ReadLine().Split(' ');
			List<int> aArr = new List<int>();
			
			for (int i = 0; i < m; i++) {
				aArr.Add(int.Parse(input[i]));
			}

			int zeroCost = 0;
			int nCost = 0;

			for (int i = x; i > 0; i--) {
				if (aArr.Any(j => j == i))
				{
					zeroCost++;
					//Console.WriteLine(zeroCost);
				}
			}

			for (int i = x; i < n; i++) {
				if (aArr.Any(j => j == i))
				{
					nCost++;
					//Console.WriteLine(nCost);
				}
			}

			if (zeroCost >= nCost)
			{
				Console.WriteLine(nCost);
			}
			else
			{
				Console.WriteLine(zeroCost);
			}
		}
	}
}

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

int main(void) {
  int N;
  int K;
  cin >> N;
  cin >> K;
  long int h[100000];
  for (int i = 0; i < N; i++) {
    cin >> h[i];
  }

  sort(h, h+N);

  long int tmp_diff = 0;
  long int diff_min = 1000000000;
  for (int i = 0 ; i <= N-K; i++) {
    tmp_diff = h[i+K-1] - h[i];
    if (diff_min > tmp_diff)
      diff_min = tmp_diff;
  }

  cout << diff_min << endl;

}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;
int n, p1, p2, res, cl;
int tcl[101];

int main()
{
  while(cin>>n && n){
    cin >> p1 >> p2 >> cl;
    for(int i = 0; i < n; ++i) cin >> tcl[i];
    res = cl/p1;
    sort(tcl, tcl+n, greater<int>());

    for(int i = 0; i < n; ++i){
      cl += tcl[i];
      p1 += p2;
      if(res > cl/p1) break;
      res = cl/p1;
    }

    cout << res << endl;
  }

  return 0;
}

Measured memory_bytes: 0
package main

import "fmt"

func GCD(a, b int) int {
	for b != 0 {
		t := b
		b = a % b
		a = t
	}
	return a
}

func LCM(a, b int, integers ...int) int {
	result := a * b / GCD(a, b)
	for i := 0; i < len(integers); i++ {
		result = LCM(result, integers[i])
	}
	return result
}

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	fmt.Println(LCM(a, b))
}


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

int N;
int x[10], y[10];

double dist(int i, int j) {
    double dx = x[i] - x[j];
    double dy = y[i] - y[j];
    return pow(dx * dx + dy * dy, 0.5);
}

void solve() {
    cin >> N;
    for(int i = 1; i <= N; i++) cin >> x[i] >> y[i];
    double sum = 0.0;
    vector<int> v(N);
    for(int i = 0; i < N; i++) v[i] = i + 1;
    do {
        for(int i = 0; i < N - 1; i++) sum += dist(v[i], v[i+1]);
    } while(next_permutation(v.begin(), v.end()));
    int Factorial = 1;
    for(int i = 2; i <= N; i++) Factorial *= i;
    cout << fixed << setprecision(10) << sum / Factorial << endl;
    return;
}

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


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

int main() {
	int n,m0;long long a,b;
	cin>>n>>m0;
	map<long long,long long> m;
	for(int i=0;i<n;i++)
	{
	    cin>>a;
	    if(m.count(a))
	    m[a]++;
	    else
	    m[a]=1;
	}
	for(int i=0;i<m0;i++)
	{
	    cin>>a>>b;
	    if(m.count(b))
	    m[b]+=a;
	    else
	    m[b]=a;
	}
	vector<pair<long long,long long>> v;
	for(auto x:m)
	{
	    v.push_back({x.first,x.second});
	}
	sort(v.rbegin(),v.rend());
	int l=v.size();long long su=0;
	for(int i=0;i<l;i++)
	{
	    if(v[i].second<=n)
	    {
	        su+=v[i].first*v[i].second;
	        n-=v[i].second;
	    }
	    else
	    {
	        su+=v[i].first*n;
	        break;
	    }
	}
	cout<<su<<endl;
	return 0;
}

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

int main()
{
    int n;
    cin >> n;
    vector<pair<int,int> > v;
    for(int i=0;i<n;++i){
        int a,b;
        cin >> a >> b;
        v.push_back(make_pair(b,a));//入れ替えてる
    }
    sort(v.begin(),v.end());
    int time=0;
    bool flag = true;
    for(int i=0;i<n;++i){
        time += v[i].second;
        if(time>v[i].first){
            flag = false;
            break;
        }
    }
    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
const lint mod=1e9+7;

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

    int deg = 0;
    while(1){
        deg++;
        if(n < pow(k,deg)) break;
    }

    cout << deg << "\n";
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import java.math.*;
import java.util.Collections;

class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        int N = sc.nextInt();
        int[] A = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        int d1 = A[0] +  K - A[N - 1];

        long sum = 0;
        int longest = 0;
        for (int i = 0; i < N - 1; i++) {
            int d = (A[i + 1] - A[i]);
            if (longest < d) {
                longest = d;
            }
            sum += d;
            //System.out.println(String.format("sum,d= %d %d", sum, d));
        }
        sum += d1;
        //System.out.println(String.format("sum,d1=%d %d", sum, d1));
        if (longest < d1) {
            longest = d1;
        }

        System.out.println(sum - longest);
    }

}


Measured memory_bytes: 76432
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>

#define pv(val) cerr << #val << '=' << (val) << endl
#define pvn(name, val) cerr << name << '=' << (val) << endl
#define pl cerr << '@' << __LINE__ << endl

using namespace std;

using ll = int64_t;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

template <class T>
ostream &operator<<(ostream &os, vector<T> const &vec) {
    if (vec.empty()) {
        os << "{}";
    } else {
        os << '{';
        for (size_t i = 0; i < vec.size() - 1; i++) os << vec[i] << ", ";
        os << vec.back() << '}';
    }
    return os;
}

template <class T, size_t S>
ostream &operator<<(ostream &os, array<T, S> const &arr) {
    if (arr.empty()) {
        os << "{}";
    } else {
        os << '{';
        for (size_t i = 0; i < arr.size() - 1; i++) os << arr[i] << ", ";
        os << arr.back() << '}';
    }
    return os;
}

template <class T, class U>
ostream &operator<<(ostream &os, pair<T, U> const &p) {
    os << '(' << p.first << ", " << p.second << ')';
    return os;
}

namespace math {
ll gcd(ll u, ll v) {
    while (v != 0) {
        ll r = u % v;
        u = v;
        v = r;
    }
    return u;
}
ll lcm(ll m, ll n) {
    if ((0 == m) || (0 == n)) return 0;

    return ((m / math::gcd(m, n)) * n);
}
}  // namespace math

struct UnionFind {
    vector<ll> data;
    UnionFind(ll size) : data(size, -1) {}
    bool unionSet(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x != y) {
            if (data[y] < data[x]) swap(x, y);
            data[x] += data[y];
            data[y] = x;
        }
        return x != y;
    }
    bool findSet(ll x, ll y) { return root(x) == root(y); }
    ll root(ll x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
    ll size(ll x) { return -data[root(x)]; }
};

template <class T, class U>
pair<T, U> operator+(pair<T, U> const &a, pair<T, U> const &b) {
    return pair<T, U>(a.first + b.first, a.second + b.second);
}

template <class T, class U>
pair<T, U> operator-(pair<T, U> const &a, pair<T, U> const &b) {
    return pair<T, U>(a.first - b.first, a.second - b.second);
}

ll bound(function<bool(ll)> f, ll ng, ll ok) {
    while (abs(ng - ok) > 1) {
        ll mid = (ng + ok) / 2;
        if (f(mid))
            ok = mid;
        else
            ng = mid;
    }

    return ok;
}

bool month(ll a) {
    return a >= 1 && a <= 12;
}

bool year(ll a) {
    return true;
}

int main(void) {
    string S;
    cin >> S;

    ll const a = stoi(S.substr(0, 2));
    ll const b = stoi(S.substr(2, 2));
    pv(a);
    pv(b);
    if (month(a) && !month(b))
        cout << "MMYY" << endl;
    else if (!month(a) && month(b))
        cout << "YYMM" << endl;
    else if (month(a) && month(b))
        cout << "AMBIGUOUS" << endl;
    else
        cout << "NA" << endl;

    return 0;
}


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

#define INF (long long)1000000000
#define MOD 1000000007
#define EPS 1e-8

#define REP(i, m) for(long long i = 0; i < m; ++i)
#define FOR(i, n, m) for(long long i = n; i < m; ++i)
#define ALL(v) v.begin(), v.end()
#define pb push_back

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

enum FACE{TOP, BOTTOM, FRONT, BACK, LEFT, RIGHT};
class Dice {
public:
	Dice() {
		id[TOP] = 0; id[BOTTOM] = 1; id[FRONT] = 2;
		id[BACK] = 3; id[LEFT] = 4; id[RIGHT] = 5;
	}
	Dice(int top,int bottom, int front, int back, int left, int right) {
		id[TOP] = top; id[BOTTOM] = bottom; id[FRONT] = front;
		id[BACK] = back; id[LEFT] = left; id[RIGHT] = right;
	}
	int& operator[] (FACE f) { return id[f]; }
	void rotX(int c) {
		for(int i = 0; i < c; ++i) {
			int top = id[BACK], front = id[TOP], bottom = id[FRONT], back = id[BOTTOM];
			id[TOP] = top; id[FRONT] = front;
			id[BOTTOM] = bottom; id[BACK] = back;
		}
	}
	void rotY(int c) {
		for(int i = 0; i < c; ++i) {
			int top = id[LEFT], right = id[TOP], bottom = id[RIGHT], left = id[BOTTOM];
			id[TOP] = top; id[RIGHT] = right;
			id[BOTTOM] = bottom; id[LEFT] = left;
		}
	}
	void rotZ(int c) {
		for(int i = 0; i < c; ++i) {
			int front = id[RIGHT], left = id[FRONT], back = id[LEFT], right = id[BACK];
			id[FRONT] = front; id[LEFT] = left;
			id[BACK] = back; id[RIGHT] = right;
		}
	}
	vector<vector<int> > all() {
		vector<vector<int> > vs;
		for(int i = 0; i < 4; ++i) {
			for(int j = 0; j < 4; ++j) {
				vector<int> v(6);
				v[TOP] = id[TOP]; v[BOTTOM] = id[BOTTOM];
				v[FRONT] = id[FRONT]; v[BACK] = id[BACK];
				v[RIGHT] = id[RIGHT]; v[LEFT] = id[LEFT];
				vs.pb(v);
				rotZ(1);
			}
			rotX(1);
		}
		for(int i = 0; i < 4; ++i) {
			for(int j = 0; j < 4; ++j) {
				vector<int> v(6);
				v[TOP] = id[TOP]; v[BOTTOM] = id[BOTTOM];
				v[FRONT] = id[FRONT]; v[BACK] = id[BACK];
				v[RIGHT] = id[RIGHT]; v[LEFT] = id[LEFT];
				vs.pb(v);
				rotZ(1);
			}
			rotY(1);
		}
		return vs;
	}
private:
	int id[6];
};

int main() {
	Dice d1,d2;
	int top,right,front,back,left,bottom;
	cin>>top>>right>>front>>back>>left>>bottom;
	d1[TOP]=top;
	d1[RIGHT]=right;
	d1[FRONT]=front;
	d1[BACK]=back;
	d1[LEFT]=left;
	d1[BOTTOM]=bottom;
	cin>>top>>right>>front>>back>>left>>bottom;
	d2[TOP]=top;
	d2[RIGHT]=right;
	d2[FRONT]=front;
	d2[BACK]=back;
	d2[LEFT]=left;
	d2[BOTTOM]=bottom;
	vector<vector<int> > a = d1.all();
	bool d = false;
	REP(i,a.size()) {
		if(d2[TOP]==a[i][TOP]&&d2[FRONT]==a[i][FRONT]&&d2[RIGHT]==a[i][RIGHT]&&d2[BOTTOM]==a[i][BOTTOM]&&d2[BACK]==a[i][BACK]&&d2[LEFT]==a[i][LEFT]) d = true;
	}
	if(d) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

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

typedef long long ll;
typedef long double ld;

#define pb push_back
#define sort(s) sort(s.begin(),s.end())
#define reverse(s) reverse(s.begin(),s.end())
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)

const ll mod = 1e9+7;

//最大公約数
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;
}

//素数判定
bool isPrime(ll x){
    ll i;
    if(x < 2)return 0;
    else if(x == 2) return 1;
    if(x%2 == 0) return 0;
    for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0;
    return 1;
}

//桁和
int digsum(ll n) {
    int res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

//桁数
int dignum(ll n) {
    int res = 0;
    while(n > 0) {
        res++;
        n /= 10;
    }
    return res;
}

//文字列中の特定の文字カウント
ll stringcount(string s,char c){
    return count(s.cbegin(),s.cend(),c);
}

//階乗
ll ka(ll i){
    ll res=1;
    while(i>0){
        res=res*i;
        i--;
    }
    return res;
}
 
//ncr
ll ncr(ll x,ll y){
    ll a = x;
    ll b = 1;
    if(y>(x/2)){
        y=x-y;
    }
    for(ll i=1;i<y;i++){
        a*=x-i;
        b*=i+1;
    }
    return a/b;
}

//フィボナッチ数列
ll f(ll x){
    ll dp[x+1];
    dp[1]=1;
    dp[2]=1;
    for(ll i=3;i<=x;i++){
        dp[i]=dp[i-1]+dp[i-2];
    }
    return dp[x];
}

//char->int
int ctoi(char c){
    return c-'0';
}



int main(){
    ll a,b,c,x,y;
    cin >> a >> b >> c >> x >> y;

    ll ans = 0;

    if(a+b<c*2){
        ans = a*x+b*y;
    }else{
        if(x>y){
            ans = 2*c*y;
            ans+=(x-y)*a;
        }else if(y>x){
            ans = 2*c*x;
            ans+=(y-x)*b;
        }else{
            ans = 2*c*x;
        }

        ans = min(ans,2*c*max(x,y));
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define FOR(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
using namespace std;

void _main() {
    int N, M;
    cin >> N >> M;
    int p = 1, q = N, cnt = 0;
    for (int i = M; i >= 1; --i) {
        if (cnt % 2 == 0) {
            cout << p << " " << p + i << endl;
            p++;
        } else {
            cout << q << " " << q - i << endl;
            q--;
        }
        cnt++;
    }
}

signed main(signed argc, char **argv) {
    if (argc > 1) {
        if (strchr(argv[1], 'i')) freopen("in.txt", "r", stdin);
        if (strchr(argv[1], 'o')) freopen("out.txt", "w", stdout);
    }
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

Measured memory_bytes: 3664
A,B,K=map(int,input().split())
Key=[]
for i in range(K):
	Key.append(A+i)
	Key.append(B-i)
Key=list(set(Key))
Key.sort()
for i in Key:
	if A<=i and i<=B:
		print(i)
	if B<i:
		break

Measured memory_bytes: 3060
import sys

H, W = map(int, sys.stdin.readline().split())

def minimize(H, W):
    if H % 3 == 0:
        return 0
    res1 = W
    h = round(H / 3)
    w = W // 2
    block = [h * W, (H - h) * w, (H - h) * (W - w)]
    block.sort()
    res2 = block[-1] - block[0]
    return min(res1, res2)
    
def main():
    return min(minimize(H, W), minimize(W, H))

if __name__ == '__main__':
    ans = main()
    print(ans)

Measured memory_bytes: 3316
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif

#define _USE_MATH_DEFINES

#include <stdio.h>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <stack>
#include <list>
#include <math.h>
#include <map>
#include <iomanip>
#include <functional>
#include <string>
#include <algorithm>
#include <queue>
#include <random>
#include <set>

using namespace std;

template<class T> ostream& operator<<(ostream& os, const vector<T>& v) {
	for (auto i = begin(v); i != end(v); i++) os << *i << (i == end(v) - 1 ? "" : " "); return os;
}
template<class T> istream& operator>>(istream& is, vector<T>& v) {
	for (auto i = begin(v); i != end(v); i++) is >> *i; return is;
}

#define MOD 1000000007
#define inf 2000000000



int main() {

#if defined(_DEBUG) 
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	int n, k;
	cin >> n >> k;
	cout << (n-1 + k -2) / (k-1);

	return 0;
}


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

int main() {
	int N;
	cin >> N;
	vector<int> A(N + 1);
	vector<int> B(N);
	for (int i = 0; i < N+1; i++) cin >> A[i];
	for (int i = 0; i < N; i++) cin >> B[i];
	long long ans = 0;
	for (int i = N-1; i >= 0; i--) {
		int first = B[i];
		int C = min(A[i+1], B[i]);
		A[i+1] -= C;
		B[i] -= C;
		C = min(A[i], B[i]);
		A[i] -= C;
		B[i] -= C;
		ans += first - B[i];
	}
	cout << ans << endl;
}


Measured memory_bytes: 1024
import java.util.Scanner;
class Main {
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
     System.out.println((A + B)%2 == 0 ? (A + B)/2 : "IMPOSSIBLE"); 
  }
}

Measured memory_bytes: 21716
#include<stdio.h>
typedef struct{
  int left,right,parent;
}node;
int main(){
  int id,n,i,j,d,t,x,c;
  node A[100000];
  scanf("%d",&n);
  for(i=0;i<n;i++)
    A[i].parent = A[i].right = A[i].left = -1;
  for(i=0;i<n;i++){
    scanf("%d %d",&id,&t);
    for(j=0;j<t;j++){
      scanf("%d",&c);
      A[c].parent = id;
      if(j == 0)A[id].left = c;
      else A[x].right = c;
      x = c;
    }
  }
  for(i=0;i<n;i++){  
    x = A[i].parent;
    d = 0;
    while(x != -1){
      x = A[x].parent;
      d++;
    }
    printf("node %d: parent = %d, depth = %d, ",i,A[i].parent,d);
    if(A[i].parent == -1)printf("root, [");
    else if(A[i].left == -1)printf("leaf, [");
    else printf("internal node, [");
    x = A[i].left;
    if(x != -1){
      printf("%d",A[i].left);
      while(A[x].right != -1){
    printf(", %d",A[x].right);
    x = A[x].right;
      }
    }
    printf("]\n");
  }
    return 0;
}





Measured memory_bytes: 2912
#include <bits/stdc++.h>
#define cout16 cout << setprecision(16) 
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define SORT(A) sort(A.begin(),A.end())
#define REV(A) reverse(A.begin(),A.end())
typedef long long int ll;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vll = std::vector<ll>;
using vvll = std::vector<std::vector<ll>>;
using P = std::pair<int,int>;
using vp = std::vector<P>;
using namespace std;
#define INF 1001001001
#define LL_INF 1001001001001001001
#define fi first
#define se second

int main(void) {
	int n,x; cin >> n >> x;
	vi a(n); rep(i,n) cin >> a[i];
	ll ans = 0;
	rep(i,n-1){
		int b = max(0,a[i]+a[i+1]-x);
		int c = max(0,b-a[i+1]);		
		a[i+1] = max(0,a[i+1]-b);
		a[i] = max(0,a[i]-c);
		ans += b;
	}
	cout << ans << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;

typedef int64_t ll;

template <class T1, class T2>
using dict = std::unordered_map<T1, T2>;

int main(){
    int H,W,A,B;
    cin >> H >> W >> A >> B;
    REP(i,H){
        REP(j,W){
            if ((i<B && j<A)||(i>=B && j>=A)) cout << 1;
            else cout << 0;
        }
        cout << endl;
    }

} 

Measured memory_bytes: 1280
a, b, c = map(int, input().split())
ans = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a == b == c:
        ans = -1
        break
    ans += 1
    a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
print(ans)

Measured memory_bytes: 3060
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)


void zAlgorithm(char s[], ll n, ll z[], ll ans[]){
    ll L = 0, R = 0;
    for(int i = 1; i < n; i++){
        if(i > R){
            L = R = i;
            while(R < n && s[R - L] == s[R]) 
            {
                R++;
            }
            z[i] = R - L;
            R--;
        }else{
            ll k = i - L;
            if(z[k] < R - i + 1){
                z[i] = z[k];
            }else{
                L = i;
                while(R < n && s[R - L] == s[R]){
                    R++;
                }
                z[i] = R - L; 
                R--;
            }
        }
    }
    for(ll i = 1; i < n; i++){
        if(z[i] > i){
            ans[i] = i;
        }else{
            ans[i] = z[i];
        }
    }
}

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

    char s[N];
    cin >> s;

    ll z[N];
    ll ansA[N];
    ll ans = 0;
    rep(j, N){
        zAlgorithm(s + j, N - j, z, ansA);
        REP(i, N - 1){//cout << "j: " << j << ", i: " << i << ", z[i]: " << z[i] << ", ansA[i]" << ansA[i] << endl;
            if(ans < ansA[i]){
                ans = ansA[i];
            }
        }
    }

    cout << ans << endl;

    return 0;
}




Measured memory_bytes: 3620
package main

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

// 挿入ソート
func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	n := nextInt(sc)
	ary := make([]int, n)
	for i := 0; i < n; i++ {
		ary[i] = nextInt(sc)
	}
	print(ary)
	insertionSort(ary, n)
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	num, _ := strconv.Atoi(sc.Text())
	return num
}

func print(ary []int) {
	fmt.Printf("%v\n", strings.Trim(fmt.Sprint(ary), "[]"))
}

func insertionSort(ary []int, n int) {
	for i := 1; i < n; i++ {
		v := ary[i]
		j := i - 1
		for 0 <= j && v < ary[j] {
			ary[j+1] = ary[j]
			j--
		}
		ary[j+1] = v
		print(ary)
	}
}



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

int main(){
  int N;
  cin >> N;
  int amari = N%10;
  
  if(amari == 2 || amari == 4 || amari == 5 || amari == 7 || amari == 9){
    cout << "hon" << endl;
  }
  else if(amari == 0 || amari == 1 || amari == 6 || amari == 8){
    cout << "pon" << endl;
  }
  else{
    cout << "bon" << endl;
  }
}

Measured memory_bytes: 3652
#include <stdio.h>
#include <stdbool.h>
int main() {
	char w[100],a;
	bool bf = 0;
	int c = 0;
	scanf("%s", w, 100);

	//アルファベット順
	for (int i = 0;w[i] != '\0';i++) {
		for (int ii = i + 1;w[ii] != '\0';ii++) {
			if (w[i] > w[ii]) {
				a = w[i];
				w[i] = w[ii];
				w[ii] = a;
			}
		}
	}
	//カウント 
	for (int i = 0;w[i] != '\0';i++) {
		for (int ii = 0;w[ii] != '\0';ii++) {
			if (w[i] == w[ii]) c++;
		}
		if (c % 2 == 0) bf = 1;
		else {
			bf = 0;
			break;
		}
		c = 0;
	}
	if (bf == 1) printf("Yes\n");
	else printf("No\n");
}

Measured memory_bytes: 128
from collections import defaultdict


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


def main():
    N = int(input())

    if N == 1:
        print(0)
        exit()

    a = prime_factorize(N)

    l = [1, 3, 6, 10, 15, 21, 28, 36, 45]

    dic = defaultdict(int)
    for aa in a:
        dic[aa] += 1

    ans = 0
    for d in dic:
        tmp = dic[d]
        count = 0
        for ll in l:
            if ll > tmp:
                break
            count += 1
        ans += count

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 9484
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
const ll LL_MAX=LLONG_MAX;
struct In{
    template<typename T>
    operator T(){
        T x;
        cin >> x;
        return x;
    }
};

template <typename T,typename U>
void forin(T* x,U n){
    for (U i=0;i<n;i++) cin >> x[i];
}

template <typename T>
int div1(T x) {
    return x%1000000007;
}

template <typename T>
void out(T x){
    cout << x << endl;
}

int main(){
    In in;
    int n=in,a[n];
    forin(a,n);
    deque<int> ans;
    bool m=true;
    for (int i=0;i<n;i++){
        if (m){
            ans.push_back(a[i]);
            m=false;
        }
        else{
            ans.push_front(a[i]);
            m=true;
        }
    }
    if (n%2!=0) reverse(ans.begin(),ans.end());
    for (int i=0;i<n;i++){
        cout << ans[i] << ' ';
    }
    cout << endl;
}


Measured memory_bytes: 3840
#include <cstdio>
int n, a[101], b[100];
int main() {
	while(~scanf("%d", &n)) {
		if(!n) break;
		for(int i = 0; i <= n; i++) scanf("%d", &a[i]);
		for(int i = 0; i <= n; i++) {
			for(int j = 0; j <= n; j++) {
				if(j < i) b[j] = a[j];
				if(j > i) b[j - 1] = a[j];
			}
			bool flag = false;
			for(int j = 2; j < n; j++) {
				if(b[j - 2] - b[j - 1] != b[j - 1] - b[j]) {
					flag = true; break;
				}
			}
			if(!flag) {
				printf("%d\n", a[i]); break;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 2724
N=int(input())
A=[int(i) for i in input().split()]
S=sum(A)
def gcd(x,y):
  if x<y:
    x,y=y,x
  if x%y==0:
    return y
  return gcd(y,x%y)
if (S-N)%2:
  print("First")
else:
  First=False
  while True:
    odd=-1
    for i in range(N):
      if A[i]%2:
        if odd>=0 or A[i]==1:
          if First:
            print("First")
          else:
            print("Second")
          exit()
        A[i]-=1
        odd=i
      if i==0:
        g=A[0]
      else:
        g=gcd(g,A[i])
    S=0
    for i in range(N):
      A[i]=A[i]//g
      S+=A[i]
    if (S-N)%2==0:
      if First:
        First=False
      else:
        First=True
    else:
      if First:
        print("First")
      else:
        print("Second")
      exit()
  

Measured memory_bytes: 62960
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)

    val a = sc.nextInt()
    val b = sc.nextInt()

    val sub = b - a: Int
    var sum = 0

    for (i <- 1 to sub) {
      sum += i
    }

    println(sum - b)
  }
}

Measured memory_bytes: 25632
n = gets.chomp.to_i
a = gets.chomp.split().map(&:to_i)
b = []
i = 1
j = 0
count = 0
check_one = false
for j in 0..(n-1)
    if a[j] == 1
        check_one = true
    end
    if  a[j] == i
        i += 1
        count += 1
    end
end
print check_one ? a.size - count : '-1'


Measured memory_bytes: 28728
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define mp make_pair
#define PI pair<int,int>
#define lowbit(i) i&-i
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
#define pb push_back
#define fi first
#define se second
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(ll a){
    if(a<0){
    	a=-a; putchar('-');
	}
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(ll a){write(a); puts("");}
inline void wri(ll a){write(a); putchar(' ');}
inline ull rnd(){
	ull ans=0; For(i,0,5)ans=ans<<15^rand(); return ans;
}
const int N=405;
int a[N][4],ycl[4];
ll yc[N];
unordered_map<ll,int> to,t;
ll chu(int a[4]){
	ll ans=0; 
	vector<int> v;
	For(i,0,3)v.pb(a[i]);
	For(i,1,3){
		vector<int> b;
		For(j,0,3)b.pb(a[(i+j)%4]);
		if(b<v)v=b;
	}
	//For(i,0,3)cout<<a[i]<<" "; puts(""); for(auto i:v)wri(i); puts("fjz");
	For(i,0,3)ans+=(ll)v[i]*ycl[i];
	return ans;
}
ll c(int a,int b){
	ll ans=1; 
	for(int i=a;i>a-b;i--)ans*=i;
	//For(i,2,b)ans/=i;
	return ans;
}
int get(ll x){
	auto it=to.find(x);
	if(it!=to.end())return it->second; else return 0;
}
void add(int i,int y){
	to[yc[i]]+=y;
}
int main(){
	int n=read();
	For(i,ycl[0]=1,3)ycl[i]=ycl[i-1]*1000;
	For(i,1,n){
		For(j,0,3){a[i][j]=read();} yc[i]=chu(a[i]); add(i,1);
	}
	ll ans=0;
	For(i,1,n){
		add(i,-1);
		For(j,i+1,n){
			add(j,-1);
			For(k,0,3){
				int q[4],B[4];
				For(l,0,3)B[l]=a[j][3^((l+k)%4)];
				t.clear();
				ll sum=1;
				For(l,0,3){
					q[3]=a[i][l]; q[2]=a[i][(l+1)%4];
					q[0]=B[l]; q[1]=B[(l+1)%4];
					/*if(i==1&&j==5&&k==2){
						For(o,0,3)wri(q[o]); puts("");
					}*/
					if(q[0]==q[2]&&q[1]==q[3]){sum*=2;
					if(q[0]==q[1])sum*=2;}
					//cerr<<sum<<endl;
					t[chu(q)]++;
				}
				for(auto i:t){
					sum=sum*c(get(i.fi),i.se);
				}
				//if(i==1&&j==8&&k==0)cout<<sum<<" "<<t.size()<<endl;
				ans+=sum;
			}
			add(j,1);
		}
		add(i,1);
	}
	cout<<ans/3<<endl;
}

Measured memory_bytes: 384
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
	
	int count = 1;
	
	void run() throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] dataSet = br.readLine().split(" ");
		int W = Integer.parseInt(dataSet[0]);
		int H = Integer.parseInt(dataSet[1]);
		
		List<Integer> result = new ArrayList<Integer>();
		
		while (W != 0 || H != 0) {
			int startW = 0;
			int startH = 0;
			char[][] tile = new char[H][W];
			for (int i = 0; i < H; i++) {
				String line = br.readLine();
				for (int j = 0; j < W; j++) {
					tile[i][j] = line.charAt(j);
					if (line.charAt(j) == '@') {
						startW = i; 
						startH = j;
					}
				}
			}
			trace(startW, startH, tile, H, W);
			result.add(count);
			count = 1;
			dataSet = br.readLine().split(" ");
			W = Integer.parseInt(dataSet[0]);
			H = Integer.parseInt(dataSet[1]);
		}
		for (int i = 0; i < result.size(); i++) {
			System.out.println(result.get(i));
		}
	}
	
	void trace(int i, int j, char tile[][], int H, int W) {
		int up = 0;
		int down = 0;
		int right = 0;
		int left = 0;
		
		// ??????????????¢?´¢
		if (i - 1 >= 0) {
			if (tile[i - 1][j] == '.') {
				count++;
				tile[i - 1][j] = '%';
				up = i - 1;
				trace(up, j, tile, H, W);
			}
		}
		// ??????????????¢?´¢
		if (j + 1 < W) {
			if (tile[i][j + 1] == '.') {
				count++;
				tile[i][j + 1] = '%';
				right = j + 1;
				trace(i, right, tile, H, W);
			}
		}
		// ??????????????¢?´¢
		if (i + 1 < H) {
			if (tile[i + 1][j] == '.') {
				count++;
				tile[i + 1][j] = '%';
				down = i + 1;
				trace(down, j, tile, H, W);
			}
		}
		// ??????????????¢?´¢
		if (j - 1 >= 0) {
			if (tile[i][j - 1] == '.') {
				count++;
				tile[i][j - 1] = '%';
				left = j - 1;
				trace(i, left, tile, H, W);
			}
		}
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		new Main().run();
	}

}

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

int main(){
  int n;
  string s;
  cin >> n >> s;
  bool ans=true;
  if(n%2==0){
    for(int i=0;i<n/2;i++){
      if(s.at(i)!=s.at(i+n/2))
        ans=false;
    }
  }else{
    ans=false;
  }
  cout << (ans?"Yes":"No") << endl;
  return 0;
}

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

int main(){
  int N;
  cin >> N;
  vector<int> D(N);
  for(int i=0; i<N; i++){
    cin >> D.at(i);
  }
  map<int, int> R;
  for(int i=0; i<N; i++){
    R[D.at(i)]++;
  }
  int M;
  cin >> M;
  vector<int> T(M);
  for(int i=0; i<M; i++){
    cin >> T.at(i);
  }
  vector<int> P(N, 0);
  int K=1;
  for(int i=0; i<M; i++){
    if(R[T.at(i)]>0){
      R[T.at(i)]--;
    }
    else{
      K=0;
      break;
    }
  }
  if(K==1){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 12032
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define max3(a,b,c) ((a>b)?(a>c)?a:c:(b>c)?b:c)
#define min3(a,b,c) ((a<b)?(a<c)?a:c:(b<c)?b:c)
#define testcase int t;cin>>t;while(t--)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
//typedef pair<int, int> pii;
//typedef pair<long long int,long long int> pll;
typedef long long int ll;
typedef unsigned long long int ull;
#define M 1000000007
using namespace std;
int main()
{
    fast
int a,b,c;
cin>>a>>b>>c;
if(a==b)
{
	if(a!=c)
	cout<<"Yes";
	else
	cout<<"No";
}
else
{
	if(b==c||a==c)
	cout<<"Yes";
	else
	cout<<"No";
}
return 0;
}






Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}

ll N , A, B ;
vector<ll> h;

bool cal(ll n ){
    ll num = 0;
    rep(i,h.size()){
        if(h[i] <= B*n) continue;
        num += ((h[i]-B*n)/(A-B));
        if((h[i]-B*n)%(A-B) != 0) num++;
    }
    if(num <= n) return true;
    else return false;
}



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin >> N >> A >> B ;
    rep(i,N){
        ll inp;cin >> inp;
        h.pb(inp);
    }
    
    ll l = 0;
    ll r = 1e9;
    
    while(l+1 < r){
        ll m = (l+r)/2;
        if(cal(m))r = m;
        else l = m;
    }
    
    cout << r << endl;
    
    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 1400
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<utility>
#include<algorithm>
#include<cstdio>
#include<iomanip>
#include<queue>
#include<stack>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)

using namespace std;


const int MAX = 510000;
const int MOD = 1000000007;

ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM (int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

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

    COMinit();

    ll N, M, K;
    cin >> N >> M >> K;

    ll ans = 0;
    for (ll a = 1; a < M; a++) {
        ans += a * (M - a) % MOD * N % MOD * N % MOD * COM(M*N-2, K-2) % MOD;
        ans %= MOD;
    }
    for (ll a = 1; a < N; a++) {
        ans += a * (N-a) % MOD * M % MOD * M % MOD * COM(M*N-2, K-2) % MOD;
        ans %= MOD;
    }

    cout << ans << "\n";
}

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

using namespace std;

int main() {
  int n, source_len, sign_len, count = 0, suffix;
  string source, sign;

  cin >> n >> source;
  source_len = source.length();

  while (n--) {
	cin >> sign;
	sign_len = sign.length();
	for (int j = 0; j < sign_len; j++) { //先頭文字のループ
	  for (int k = 0; k <= sign_len / 2; k++) { //間隔のループ
		for (int l = 0, suffix = j; l < source_len; l++) { //文字のループ
		  if (source[l] != sign[suffix]) break; //一文字単位で比較
		  if (l == source_len - 1) { count++; goto end; } //すべて一致
		  if ((suffix += k + 1) >= sign_len) break; //添字があふれるのを防ぐ
		}
	  }
	}
  end:;
  }

  cout << count << endl;

  return 0;
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	double long  a,b;
    cin>>a>>b;
    if(a>b)
       cout<<"GREATER"<<endl;
    else if(b>a)
       cout<<"LESS"<<endl;
    else
       cout<<"EQUAL"<<endl;
	return 0;
}

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

int main() {
	string s,t;
	cin >> s >> t;
	cout << t << s << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 7;
int main(){
	int n;
	scanf("%d",&n);
	int t,a;
	scanf("%d %d",&t,&a);
	double h;
	scanf("%lf",&h);
	int idx = 1;
	double minx = fabs(a - (t - h*0.006));
	for(int i = 1;i < n;i++){
		scanf("%lf",&h);
		double x = t - h*0.006;
		x = fabs(a - x);
		if(x < minx){
			idx = i + 1;
			minx = x;
		}
	}
	cout << idx << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <functional>
typedef long long ll;
using namespace std;
#define int long long

//素数判定
inline bool IsPrime(int p) {
	if (p == 1) return false;
	for (int i = 2; i <= sqrt(p); i++) {
		if (p%i == 0) return false;
	}
	return true;
}

//10進数の自然数の桁数を返す
inline int GetDigit(int num) {
	return (int)log10(num) + 1;
}

//各位の和を返す
int GetDigitsSum(int num) {
	int N = 0;
	while (num > 0) {
		N += num % 10;
		num /= 10;
	}
	return N;
}

//互除法
ll gcd(ll a, ll b) {
	if (a < b) {
		return gcd(b, a);
	}
	else if (a%b) {
		return gcd(b, a%b);
	}
	else {
		return b;
	}
}

//異なるn個からr個の整数を取り出す組合せの数を求める
int combination(int n, int r) {
	if (r == 0 || n == r) {
		return 1;
	}
	else if (r == 1) {
		return n;
	}
	else {
		return combination(n - 1, r - 1) + combination(n - 1, r);
	}

}

//Ｏ(√n)
//素因数分解
map<int, int> prime_factor(int n) {
	map<int, int> res; // map[i]:=ｎを素因数分解したときiは何乗か。
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) {
				res[i]++;
				n /= i;
			}
		}
	}
	if (n != 1)
		res[n] = 1;
	return res;
}

signed main() {
	int N, p;

	cin >> N >> p;
	if (N == 1) {
		cout << p << endl;
		return 0;
	}

	map<int, int> mp = prime_factor(p);

	int ans = 1;

	for (int i = 2; i * i <= p; i++) {
		if (mp[i] >= N) {
			ans *= pow(i,(mp[i]/N));
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 62720
#include <iostream>
using namespace std;
#define INF 1e9
int N, a[100005];

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

  cin >> N;
  for (int i = 0; i < N; i++) cin >> a[i];

  for (int i = 0; i < N; i++) {
    if(a[i] == INF) continue;
    if(i == a[a[i]-1]-1) {
      pcount++;
      a[a[i]-1] = INF;
      a[i] = INF;
    }
  }

  cout << pcount << "\n";
  return 0;
}


Measured memory_bytes: 640
A,B,C=map(int,input().split())

if A==5:
  if B==5:
    if C==7:
      print("YES")
    else:
      print("NO")
  elif B==7:
    if C==5:
      print("YES")
    else:
      print("NO")
  else:
    print("NO")
elif A==7:
  if B==5 and C==5:
    print("YES")
  else:
    print("NO")
else:
  print("NO")

Measured memory_bytes: 3060