akhauriyash/Code-Regression huggingface dataset:
local function gcd(a,b)
	return b>0 and gcd(b,a%b) or a
end

----------

local n=io.read("n")
local a={io.read("n")}
for i=2,n do
	a[i]=io.read("n")
end

local t={1}
for i=2,1000000 do
	if not t[i] then
		for j=1,math.floor(1000000/i) do
			t[i*j]=i
		end
	end
end

local s={}
local pw=true
for i=1,n do
	local A=a[i]
	local T={}
	while A>1 do
		if not T[t[A]] then 
			T[t[A]]=true
		end
		A=math.floor(A/t[A])
	end
	for p in pairs(T) do
		if not s[p] then
			s[p]=true
		else
			pw=false
		end
	end
end

if pw then
	print("pairwise coprime")
else
	local sw=a[1]
	for i=2,n do
		sw=gcd(sw,a[i])
	end
	if sw==1 then
		print("setwise coprime")
	else
		print("not coprime")
	end
end


Measured memory_bytes: 44960
while True:

    l = [str(i) for i in input().split()]

    a = int(l[0])
    b = int(l[2])
    op = l[1]

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

Measured memory_bytes: 7784
#include <iostream>
#include <string>
using namespace std;
int main()
{
 int i,j,k,n;
  k=0;
 string s;
 cin >> n;
 string a[n];
 int b[n];
 for(i=0;i<n;i++)
 cin >> a[i] >> b[i];
 cin >> s;
 for(i=0;i<n;i++)
 {
  if(a[i]==s)
  {
   for(j=(i+1);j<n;j++)
   k+=b[j];
   cout << k;
   break;
  }
 }
 return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <bitset>
#include <set>
#include <complex>
#include <cmath>
#include <cstring>
#include <map>
using namespace std;
using ll = long long;
using ppp = pair<pair<int, int>, pair<int, int>>;
#define MOD 1000000007
#define INF 1LL << 59
const int MAX = 510000;
const long long mod = 917120411LL;

long long 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;
    }
}

// 二項係数計算
long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int sieve[1000010];
void make_sieve()
{
    for (int i = 0; i < 1000010; ++i)
        sieve[i] = true;
    sieve[0] = sieve[1] = false;
    for (int i = 0; i * i < 1000010; ++i)
    {
        if (sieve[i])
        {
            for (int j = 2; j * i < 1000010; ++j)
            {
                sieve[i * j] = false;
            }
        }
    }
}

ll GCD(ll a, ll b)
{
    if (a < b)
        swap(a, b);
    if (b == 0)
        return a;
    else
        return GCD(b, a % b);
}
ll pow_mod(ll x, ll n)
{
    ll res = 1;
    while (n)
    {
        if (n & 1)
        {
            res = res * x;
        }
        x = x * x;
        n >>= 1;
    }
    return res;
}

const int inf = 99999999;
#define index_of(as, x) \
    distance(as.begin(), lower_bound(as.begin(), as.end(), x))
vector<int> lis_fast(const vector<int> &a)
{
    const int n = a.size();
    vector<int> A(n, inf);
    vector<int> id(n);
    for (int i = 0; i < n; ++i)
    {
        id[i] = index_of(A, a[i]);
        A[id[i]] = a[i];
    }
    int m = *max_element(id.begin(), id.end());
    vector<int> b(m + 1);
    for (int i = n - 1; i >= 0; --i)
        if (id[i] == m)
            b[m--] = a[i];
    return b;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;

    vector<int> v;
    for (int i = 0; i < N; ++i)
    {
        int a;
        cin >> a;
        v.push_back(a);
    }

    multiset<int> ms;

    int ans = 0;
    for (int i = 0; i < N; ++i)
    {
        auto itr = ms.lower_bound(v[i]);
        if (itr == ms.begin())
        {
            ms.insert(v[i]);
            ans++;
        }
        else
        {
            itr--;
            ms.erase(itr);
            ms.insert(v[i]);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 5368
#pragma GCC optimize("O3")

#define _GLIBCXX_DEBUG
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
using namespace std;

/*----------macros----------*/

//output================
#define endl '\n'
#define fcout cout << fixed << setprecision(15)

//typedef===============
typedef long long       ll;
typedef long double     ld;
typedef pair<int, int>  Pii;
typedef pair<ll, ll>    Pll;

//const number==========
constexpr ll INF9   = (ll)1e9 + 1;
constexpr ll INF18  = (ll)1e18 + 1;
constexpr ll MOD    = 1000000007;
constexpr ld PI     = 3.141592653589793L;

//member================
#define pb push_back
#define eb emplace_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second

//others================
#define all(x)          (x).begin(), (x).end()
#define rall(x)         (x).rbegin(), (x).rend()
#define rep(i, n)       for(int i = 0; (i) < (n); ++(i))
#define rrep(i, n)      for(int i = n - 1; (i) >= 0 ; --(i))
#define For(i, a, b)    for(int i = (a); (i) < (b) ; ++(i))
#define CtoI(c)         int((c)) - int('0')

//functions=============
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
//vector<int> dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };

/*--------additional--------*/



/*----------main------------*/

int main() {
/*----------fastio----------*/
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);
/*----------solve-----------*/

    ll a, b, x; cin >> a >> b >> x;
    if(a%x == 0)
        cout << b/x - a/x + 1 << endl;
    else cout << b/x - a/x << endl;
    
return 0;
}

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

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

#define ALL(c)   c.begin(), c.end()
#define SORT(c)  std::sort(ALL(c))
#define RSORT(c) std::sort(ALL(c), std::greater<decltype(c)::value_type>())

using namespace std;
using ll = long long;

const int MOD  = (int)1e9 + 7;
const int INF  = (int)1e9 + 1;
const ll  LINF = (ll)1e18 + 1;


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

    int N;
    std::cin >> N;
    std::cout << N * N * N << std::endl;

    return 0;
}


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

using namespace std;

int main(){
  for(int h,l;cin>>h>>l,h|l;){
    if(h<l){
      swap(h,l);
    }
    int i;
    for(i=1;;i++){
      h=h%l;
      swap(h,l);
      if(l==0)break;
    }
    cout<<h<<' '<<i<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define P pair<int,int>
#define f(x) x.first
#define s(x) x.second
P a[100100];
P stark[100100];
int n,m,x,y,ans,cnt,p;
int f[100100];
bool cmp(P a,P b){
	if(f(a)<f(b))
	  return 1;
	if(f(a)==f(b))
		return s(a)<s(b);
	return 0;
}
int main(){
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		cin>>f(a[i])>>s(a[i]);
	}
	sort(a+1,a+m+1,cmp);
//	for(int i=1;i<=m;i++){
//		if(s(a[i])>stark[cnt].second){
//			stark[++cnt]=a[i];
//		}
//	}
	p=n+1;
	for(int i=1;i<=m;i++){
		if(f(a[i])>=p)
			p=n+1,ans++;
		if(s(a[i])<=p)
			p=s(a[i]);
	}
	cout<<ans+1;
	return 0;
}

Measured memory_bytes: 1792
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	/**
	 * 1 ??\??? 1000 ??\?????????????????£?????´??°?????\?????????????????????????????????????????¨??????????§???¢?????´?§?????§???¢??§????????´????????? YES ??????????????´????????? NO ??¨????????????????????????????????°?????????????????????????????????
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		// ???????????????????????°
		int num = sc.nextInt();

		for (int i = 0; i < num; i++) {
			int[] inputNumList = new int[3];
			inputNumList[0] = sc.nextInt();
			inputNumList[1] = sc.nextInt();
			inputNumList[2] = sc.nextInt();

			// ?????????????????????inputNumList[2]?????§?????????????????£?????????
			Arrays.sort(inputNumList);
			if (inputNumList[0] * inputNumList[0] + inputNumList[1]
					* inputNumList[1] == inputNumList[2] * inputNumList[2]) {
				System.out.println("YES");

			} else {
				System.out.println("NO");
			}
		}

	}

}

Measured memory_bytes: 23380
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int X[3];
int ans,ans1,ans2,ans3;
int C;
int main()
{
	while(true){
		for(int i=0;i<3;i++)scanf("%d",&X[i]);
		sort(X,X+3);
		if(X[0]+X[1]<=X[2])break;
		ans++;
		C=X[0]*X[0]+X[1]*X[1]-X[2]*X[2];
		if(C>0)ans1++;
		else if(C==0)ans2++;
		else ans3++;
	}
	printf("%d %d %d %d\n",ans,ans2,ans1,ans3);
	return 0;
}

Measured memory_bytes: 1204
#include <iostream>
#include <vector>
#include <assert.h>

using namespace std;

const int MAX = 1e5+9;

vector<int> edge[(int)1e5+5];
bool visited[MAX];
int dist[MAX];
int in_degree[MAX];

void dfs(int a) {
    assert(!visited[a]);
    visited[a] = true;

    for (int b : edge[a]) {
        dist[b] = max(dist[b], dist[a] + 1);
        --in_degree[b];
        if (in_degree[b] == 0)
            dfs(b);
    }
}

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

    while (m--) {
        int x, y;
        cin >> x >> y;
        x--; y--;
        edge[x].push_back(y);
        ++in_degree[y];
    }

    for (int i=0; i < n; i++) {
        if (!visited[i] && in_degree[i] == 0)
            dfs(i);
    }
    int ans = 0;
    for (int i=0; i < n; i++)
        ans = max(ans, dist[i]);
    cout << ans << endl;
}


Measured memory_bytes: 14424
import math
a, b, h, m = map(int, input().split())
# mazuha 角度から
mins = m / 60.0 * 360
hour = (h / 12.0 * 360) + 30 * (m / 60.0)

# print(mins)
#RH = math.radians(hour)
#MH = math.radians(mins)

tar = abs(hour - mins)
if (tar == 0):
    ans = abs(a - b)
elif (tar == 180):
    ans = a + b
else:
    if (0 < tar < 180):
        pass
    else:
        tar = 360 - tar
    TR = math.radians(tar)
    # print(TR)
    co = math.cos(TR)
    cc = a ** 2 + b ** 2 - 2 * b * a * co
    ans = float(cc ** 0.5)

print(ans)


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

class Program {
	int[,] dp = new int[50, 2501];
    static void Main(string[] args) {
        new Calc().calc();
        return;
    }

    public class Calc {
        public void calc() {
			string s = ReadLine<string>();
			Stack<char> ans = new Stack<char>();
			foreach (var item in s) {
				if (item == 'B') {
					if (ans.Count > 0) {
						ans.Pop();
					}
				} else {
					ans.Push(item);
				}
			}
			ans.Reverse().Docking().WL();
            return;
        }
    }
	

    public static T[] ReadLine<T>(params char[] separators) {
        return Console.ReadLine()
            .Split(separators)
            .Where(_ => _.Length > 0)
            .Select(_ => (T)Convert.ChangeType(_, typeof(T)))
            .ToArray();
    }
	public static T ReadLine<T>() {
		return (T)Convert.ChangeType(Console.ReadLine(), typeof(T));
	}
    public static List<T> ReadLines<T>(int N) {
        List<T> rt = new List<T>();
        for (int i = 0; i < N; i++) {
            T item = (T)Convert.ChangeType(Console.ReadLine(), typeof(T));
            rt.Add(item);
        }
        return rt;
    }
}
public static class Utils {
    public static void WL(this object obj) {
        Console.WriteLine(obj);
    }
	public static string Docking<T>(this IEnumerable<T> collection,Func<T,string> filter = null) {
		StringBuilder sb = new StringBuilder();
		foreach (var item in collection) {
			string str = filter != null ? filter(item) : item.ToString();
			sb.Append(str);
		}
		return sb.ToString();
	}
	public static string RangeDocking<T>(this IEnumerable<T> collection,
		int start,int end,Func<T,string> filter = null) {
		if (start > collection.Count()) throw new IndexOutOfRangeException();
		if (end < 0) throw new IndexOutOfRangeException();
		StringBuilder sb = new StringBuilder();
		for (int i = start; i < end; i++) {
			string str = filter != null ? filter(collection.ElementAt(i)) : collection.ElementAt(i).ToString();
			sb.Append(str);
		}
		return sb.ToString();
	}
	public static void WriteLineAll<T>(this IEnumerable<T> collection) {
		foreach (var item in collection) {
			item.WL();
		}
	}
}


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

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  int h,w;
  cin>>h>>w;
  vector<vector<int> > a(h,vector<int>(w));
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
      cin>>a[i][j];

  int x=a[0][0],y=a[0][0];
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      chmin(x,a[i][j]);
      chmax(y,a[i][j]);
    }
  }
  
  auto check2=
    [&](int z)->int{      
      int k=h;      
      for(int j=0;j<w;j++){
	int i=0;
	while(i<k&&a[i][j]<=x+z) i++;
	for(int t=i;t<h;t++) if(a[t][j]<y-z) return 0;
	k=i;
      }
      return 1;
    };

  auto check=
    [&](int z)->int{
      for(int p=0;p<2;p++){
	for(int q=0;q<2;q++){
	  if(check2(z)) return 1;
	  for(int i=0;i<h;i++) reverse(a[i].begin(),a[i].end());	
	}
	reverse(a.begin(),a.end());
      }
      return 0;
    };
  
  int l=-1,r=y-x+1;
  while(l+1<r){
    int m=(l+r)>>1;
    if(check(m)) r=m;
    else l=m;
  }
  
  cout<<r<<endl;
  return 0;
}



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

int N; 
vector<deque<int>> A(1010);

vector<P> match;

// kさんが試合をできればmatchに代入する
void check(int i){
    if(A[i].size() == 0) return;

    int j = A[i].front();
    if(A[j].front() == i){
        if(i > j) swap(i,j);
        match.push_back(P(i,j));
    }
}
 
int main(){
    cin >> N;
 
    rep(i, N) rep(j, N-1){
        int a; cin >> a; a--;
        A[i].push_back(a);
    }

    rep(i, N) check(i);

    int ans = 0;
    while(!match.empty()){
        ans++;
        
        sort(match.begin(), match.end());
        match.erase(unique(match.begin(),match.end()),match.end());

        vector<P> prev_match; swap(prev_match, match);

        for(P p : prev_match){
            int i = p.first, j = p.second;
            A[i].pop_front(); A[j].pop_front();
        }

        for(P p : prev_match){
            int i = p.first, j = p.second;
            check(i); check(j);
        }
    }

    rep(i, N){
        if(A[i].size() != 0){
            cout << -1 << endl; return 0;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 4736
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
# define ll int64_t
# define rep(i,n) for(ll i=0;i<n;i++)
# define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007
# define PI 3.141592653589793
# define vec vector
#define dump(x) cerr<<#x<<"="<<x<<endl
using namespace std;

bool compare_by_b(pair<string,ll> a,pair<string,ll> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

bool my_compare(pair<string,ll> a,pair<string,ll> b){
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

ll factorial(ll n){
    ll x=1;
    rrep(i,n) (x*=i)%=mod;
    return x;
}

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

ll lcm(ll a,ll b){
   return a/gcd(a,b)*b;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll x;
    cin>>x;
    ll res=x/100;
    cout<<(res*105>=x ? "1":"0")<<endl;
    
    return 0;
}


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

int main(){
    ll n;
    cin >> n;
    vector<vector<ll>> path(n),cost(n);
    for(ll i=0;i<n-1;i++){
        ll v,u,w;
        cin >> v >> u >> w;
        v--,u--;
        path[v].push_back(u),cost[v].push_back(w);
        path[u].push_back(v),cost[u].push_back(w);
    }
    queue<ll> q;
    vector<int> ans(n);
    for(int i=0;i<n;i++)    ans[i] = -1;
    q.push(0);
    ans[0] = 0;
    while(!q.empty()){
        ll v = q.front();
        q.pop();
        for(ll i=0;i<path[v].size();i++){
            ll now = path[v][i];
            ll c = cost[v][i]%2;
            if(ans[now]==-1){
                q.push(now);
                if(c==0)    ans[now] = ans[v];
                else{
                    if(ans[v]==0)   ans[now] = 1;
                    else    ans[now] = 0;
                }
            }
        }
    }
    for(ll i=0;i<n;i++) cout << ans[i] << endl;
}

Measured memory_bytes: 12800
using System;

namespace _7_C
{
    class Program
    {
        static void Main(string[] args)
        {
            var nm = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            var n = nm[0];
            var m = nm[1];
            var ex = new int[n + 1, m + 1];
            for (var i = 0; i < n; i++)
            {
                var s = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
                for (var j = 0; j < m; j++)
                {
                    ex[i, j] = s[j];
                }
            }
            for (var i = 0; i < n; i++)
            {
                var sumC = 0;
                for (var j = 0; j < m; j++)
                {
                    sumC += ex[i, j];
                }
                ex[i, m] = sumC;
            }
            for (var j = 0; j < m+1; j++)
            {
                var sumR = 0;
                for (var i = 0; i < n; i++)
                {
                    sumR += ex[i, j];
                }
                ex[n, j] = sumR;
            }
            for (var i = 0; i < n + 1; i++)
            {
                for (var j = 0; j < m + 1; j++)
                {
                    if (j == 0) Console.Write(ex[i, j]);
                    else Console.Write(" " + ex[i, j]);
                }
                Console.WriteLine();
            }
        }
    }
}



Measured memory_bytes: 15880
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void){
    int count;
    int win=0;
    char s[200];
    scanf("%s",s);
    printf("%c%d%c\n",s[0],strlen(s)-2,s[strlen(s)-1]);
    return 0;
}

int min(int a,int b){
    int ans;
    if(a>b){return b;}
    else {return a;}
}

int max(int a,int b){
    int ans;
    if(a>b){return a;}
    else {return b;}
}

Measured memory_bytes: 128
// 2:55
#include <iostream>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <tuple>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using pll = pair<ll,ll>;
using tll = tuple<ll,ll,ll>;
#define pb push_back
#define all(v) v.begin(),v.end()
#define for1(i,n) for (ll i=0;i<(n);i++)
#define for2(i,m,n) for (ll i=(m);i<(n);i++)
#define for3(i,m,n,d) for (ll i=(m);i<(n);i+=(d))
#define INF (1LL << 60)
#define DEBUG 0
#if DEBUG
    #define dump(v1) dump_1(#v1, v1)
    #define dump2(v1,v2) dump_2(#v1, v1, #v2, v2)
    #define dump3(v1,v2,v3) dump_3(#v1, v1, #v2, v2, #v3, v3)
#else
    #define dump(v1)
    #define dump2(v1,v2)
    #define dump3(v1,v2,v3)
#endif
#if DEBUG
template <typename T>
void dump_1(const string& n1, const T& v1)
{
    cerr << n1 << ": " << v1 << endl;
}
template <typename T1, typename T2>
void dump_2(const string& n1, const T1& v1, const string& n2, const T2& v2)
{
    cerr << n1 << ": " << v1 << "  " << n2 << ": " << v2 << endl;
}
template <typename T1, typename T2, typename T3>
void dump_3(const string& n1, const T1& v1, const string& n2, const T2& v2, const string& n3, const T3& v3)
{
    cerr << n1 << ": " << v1 << "  " << n2 << ": " << v2 << "  " << n3 << ": " << v3 << endl;
}
template <typename T1,typename T2>
ostream& operator << (ostream& os, const pair<T1,T2>& v)
{
    os << "(" << v.first << ", " << v.second << ")";
    return os;
}
template <typename T1,typename T2, typename T3>
ostream& operator << (ostream& os, const tuple<T1,T2,T3>& v)
{
    os << "(" << get<0>(v) << ", " << get<1>(v) << ", " << get<2>(v) << ")";
    return os;
}
template <typename T>
ostream& operator << (ostream& os, const vector<T>& v)
{
    os << "[";
    for (auto it = v.begin(); it != v.end(); it++) {
        if (it != v.begin()) {
            os << ", ";
        }
        os << *it;
    }
    os << "]";
    return os;
}
template <typename T>
ostream& operator << (ostream& os, const set<T>& v)
{
    os << "{";
    for (auto it = v.begin(); it != v.end(); it++) {
        if (it != v.begin()) {
            os << ", ";
        }
        os << *it;
    }
    os << "}";
    return os;
}
template <typename T1, typename T2>
ostream& operator << (ostream& os, const map<T1,T2>& v)
{
    os << "{";
    for (auto it = v.begin(); it != v.end(); it++) {
        if (it != v.begin()) {
            os << ", ";
        }
        os << it->first << ":" << it->second;
    }
    os << "}";
    return os;
}
#endif // DEBUG
void Yes(void) { cout << "Yes" << endl; }
void No(void) { cout << "No" << endl; }
void YES(void) { cout << "YES" << endl; }
void NO(void) { cout << "NO" << endl; }
template <typename T>
void print(const T& v)
{
    cout << v << endl;
}
//---------------------------------------------------------

void solve()
{
    vll s(3);
    for1(i,3) {
        cin >> s[i];
    }
    sort(all(s));
    if (s[0] + s[1] == s[2]) {
        Yes();
    } else {
        No();
    }
}

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


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
from collections import Counter, defaultdict
buff_readline = sys.stdin.buffer.readline
readline = sys.stdin.readline


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


class RollingHash():
    """
    Original code is https://tjkendev.github.io/procon-library/python/string/rolling_hash.html
    """
    class RH():
        def __init__(self, s, base, mod):
            self.base = base
            self.mod = mod
            self.rev = pow(base, mod-2, mod)

            l = len(s)
            self.h = h = [0]*(l+1)
            tmp = 0
            for i in range(l):
                num = s[i]
                tmp = (tmp*base + num) % mod
                h[i+1] = tmp

            self.pw = pw = [1]*(len(s)+1)
            v = 1
            for i in range(l):
                pw[i+1] = v = v * base % mod

        def calc(self, l, r):
            return (self.h[r] - self.h[l] * self.pw[r-l]) % self.mod

    @staticmethod
    def gen(a, b, num):
        result = set()
        while 1:
            import random
            import math
            random.seed()
            while 1:
                v = random.randint(a, b)//2*2+1
                if v not in result:
                    break
            for x in range(3, int(math.sqrt(v))+1, 2):
                if v % x == 0:
                    break
            else:
                result.add(v)
                if len(result) == num:
                    break
        return result

    def __init__(self, s, rand=False, num=5):
        if rand:
            bases = RollingHash.gen(2, 10**3, num)
        else:
            assert num <= 10
            bases = [641, 103, 661, 293, 547, 311, 29, 457, 613, 599][:num]

        MOD = 10**9+7
        self.rhs = [self.RH(s, b, MOD) for b in bases]

    def calc(self, l, r):
        return tuple(rh.calc(l, r) for rh in self.rhs)


def slv(N, A, B):
    a = []
    for i in range(N):
        a.append(A[i]^A[i-1])
    b = []
    for i in range(N):
        b.append(B[i]^B[i-1])
    b = b[:] + b[:]

    ah = RollingHash(a, num=1)
    bh = RollingHash(b, num=1)

    h = ah.calc(0, N)
    ans = []
    for k in range(N):
        if bh.calc(N-k, N-k+N) == h:
            ans.append('%d %d' % (k, A[0]^B[(N-k)%N]))


    return ans


def main():
    N = read_int()
    A = read_int_n()
    B = read_int_n()
    print(*slv(N, A, B), sep='\n')


if __name__ == '__main__':
    main()


Measured memory_bytes: 126352
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main(void){
    // Here your code !
    double PI = 3.141592653589793;
    int a, b;
    double c;
    cin >> a >> b >> c;
    c = c * PI / 180;
    double s, l, h;
    s = a*b/2 * sin(c);
    l = a + b + sqrt(a*a + b*b - 2*a*b*cos(c));
    h = s * 2 / a;
    cout << fixed
         << setprecision(5)
         << s << endl
         << l << endl
         << h << endl;
}

Measured memory_bytes: 3544
import sys
s = input()
t = input()

dic = {}
dic2 = {}

# for i in range(len(s)):
#     if s[i] in dic:
#         if dic[s[i]] != t[i]:
#             print("No")
#             sys.exit()
#     else:
#         dic[s[i]] = t[i]

# print("Yes")


# dic = {}
# for i in range(len(s)):
#     if t[i] in dic:
#         if dic[t[i]] != s[i]:
#             print("No")
#             sys.exit()
#     else:
#         dic[t[i]] = s[i]

# print("Yes")

for i in range(len(s)):
    if s[i] in dic:
        if dic[s[i]] != t[i]:
            print("No")
            sys.exit()
    else:
        dic[s[i]] = t[i]

    if t[i] in dic2:
        if dic2[t[i]] != s[i]:
            print("No")
            sys.exit()
    else:
        dic2[t[i]] = s[i]

print("Yes")


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

int main() {
  
  string S; cin >> S;
  
  string alp = "abcdefghijklmnopqrstuvwxyz";
  
  for (int i = 0; i < alp.size(); i++) {
    
    for (int j = 0; j < S.size(); j++) {
      
      if (alp.at(i) == S.at(j)) break;
      
      if (j == S.size() - 1) {
        cout << alp.at(i) << endl;
        return 0;
      }
      
    }
    
  }
  
  cout << "None" << endl;
  
}

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

#define li long long int
#define rep(i, to) for (li i = 0; i < ((li)(to)); i++)
#define repp(i, start, to) for (li i = (li)(start); i < ((li)(to)); i++)
#define allof(v) (v).begin(), (v).end()


#define MOD 1000000007

li n;
li t[222];
li v[111];

li lb_left[111];
li lb_right[111];

inline double calc(li idx) {
	li haba_left = v[idx] - lb_left[idx];
	li haba_right = v[idx] - lb_right[idx];
	double res = 0.0;
	if (haba_left + haba_right <= t[idx]) {
		// 道中で上限にぶつかる
		res += v[idx] * (t[idx] - (haba_left + haba_right));
		res += (lb_left[idx] + v[idx]) * haba_left / 2.0;
		res += (lb_right[idx] + v[idx]) * haba_right / 2.0;
	} else {
		// どこかでカックンする
		li ma = max(lb_left[idx], lb_right[idx]);
		li mi = min(lb_left[idx], lb_right[idx]);
		res += (ma - mi) * (ma + mi) / 2.0;
		li rest = t[idx] - (ma - mi);
		double rest2 = rest / 2.0;
		res += (ma + ma + rest2) * rest2;
	}
	return res;
}

int main(void)
{
	cin >> n;
	rep(i, n) {
		cin >> t[i];
	}
	rep(i, n) {
		cin >> v[i];
		lb_left[i] = v[i];
		lb_right[i] = v[i];
	}
	lb_left[0] = 0;
	lb_right[n - 1] = 0;

	for (li i = 0; i < n - 1; ++i) {
		lb_right[i] = min(lb_left[i + 1], min(lb_left[i] + t[i], lb_right[i]));
		lb_left[i + 1] = min(lb_right[i], lb_left[i + 1]);
	}

	for (li i = n - 1; i > 0; i--) {
		lb_left[i] = min(lb_right[i - 1], min(lb_right[i] + t[i], lb_left[i]));
		lb_right[i - 1] = min(lb_right[i - 1], lb_left[i]);
	}
	double res = 0.0;
	rep(i, n) {
		res += calc(i);
	}
	printf("%.14f\n", res);



	return 0;
}

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

long long int N, A, B, d[100000], x, y, a, i;

int main(){
    scanf("%lld%lld%lld%lld", &N, &A, &B, &x);
    for(; i < N - 1; ++i){
        scanf("%lld", &y);
        d[i] = y - x;
        swap(x, y);
    }
    for(i = 0; i < N - 1; ++i){
        a += min(d[i] * A, B);
    }
    cout << a << endl;
    return 0;
}


Measured memory_bytes: 1024
import sys
from heapq import heappop, heappush
from operator import itemgetter
from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect_right
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10**9 + 7
INF = float('inf')

def sol():
    _, K = map(int, input().split())
    A = list(map(int, input().split()))
    F = list(map(int, input().split()))

    A.sort()
    F.sort(reverse=True)

    def isOk(t):
        cnt = 0
        for a, f in zip(A, F):
            ness = t // f
            if a <= ness:
                continue
            cnt += a - ness

        if cnt > K:
            return False
        else:
            return True

    ng = -1
    ok = max(A) * max(F) + 10

    while ok - ng > 1:
        mid = (ok + ng) // 2
        if isOk(mid):
            ok = mid
        else:
            ng = mid
    print(ok)


sol()

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

int main(){
while(1){
	int n,c,a[100000+2],b[100000+2],k=0,ans=0;
	scanf("%d",&n);
	if(n==0)break;
	scanf("%d",&a[0]);
	b[0]=1;
	for(int i=2;i<=n;i++){
		scanf("%d",&c);
		if(i%2!=0){
			if(c==a[k])b[k]++;
			else {a[k+1]=c; b[k+1]=1; k++;}
		}
		else {
			if(c==a[k])b[k]++;
			else {
				if(k==0){a[0]=c; b[0]+=1;}
				else {b[k-1]+=b[k]+1; k--;}
			}
		}
	}
	for(int i=0;i<=k;i++){
		if(a[i]==0)ans+=b[i];
	}
	printf("%d\n",ans);
}
}

Measured memory_bytes: 1184
S = input()
T = input()

N = len(S)

d_s = {}
d_t = {}

S_i = []
T_i = []
for s, t in zip(S, T):
    if s in d_s.keys():
        S_i += [d_s[s]]
    else:
        d_s[s] = len(d_s)
        S_i += [d_s[s]]

    if t in d_t.keys():
        T_i += [d_t[t]]
    else:
        d_t[t] = len(d_t)
        T_i += [d_t[t]]

if S_i == T_i:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 6720
N, Y = map(int,input().split())
y = Y/1000
ans_a = -1
ans_b = -1
for i in range(N+1):
    for j in range(N-i+1):
        if i*9 + j*4 + N == y:
            ans_a = i
            ans_b = j
if ans_a == -1:
    N = -3
print(str(ans_a)+' '+str(ans_b)+' '+str(N-ans_a-ans_b))

Measured memory_bytes: 3064
#include <iostream>
#include <climits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <deque>
#define INF_INT (INT_MAX / 2)
#define INF_LONG (LONG_MAX / 2)
//#define DEBUG true
#define DEBUG false
using namespace std;

const int MAX = 100001;
const int MOD = 1000000007;

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef pair< ll, int > pli;
typedef pair< int, ll > pil;

int ceil(int x, int y){
  return (x % y == 0) ? x / y : x / y + 1;
}

int gcd(int x, int y){
  return y ? gcd(y, x % y) : x;
}

int lcm(int x, int y){
  return x / gcd(x, y) * y;
}

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

  int a, b, t;
  cin >> a >> b >> t;

  int ans = b * (int)((t + 0.5) / a);

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
typedef std::pair<int, int> P;

int main(){
    int N, M;
    std::cin >> N;
    P tim[200];
    for(int i = 0; i < N; ++i){
        int h,m;
        std::cin >> h >> m;
        tim[i]=P(h,m);
    }
    std::cin >> M;
    for(int i = 0; i < M; ++i){
        int h,m;
        std::cin >> h >> m;
        tim[i+N]=P(h,m);
    }
    std::sort(tim, tim+N+M);
    std::vector<P> ans;
    for(int i = 0; i < N+M; ++i){
        if(i==0 || tim[i-1] != tim[i])ans.push_back(tim[i]);
    }
    
    
    for(int i = 0; i < (int)ans.size() ; ++i){
        P p=ans[i];
        if(i)std::cout<<' ';
        printf("%d:%02d",p.first,p.second);
    }
     std::cout << std::endl;   
    return 0;
}

Measured memory_bytes: 1236
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define print(n) cout<<n<<endl
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
const int M=100111;
const int inf=1000000007;
const long long INF=1e18;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};

int W,H;
char c[77][77];
string s[77][77]={};
string dfs(int h,int w){
	int now=c[h][w]-'0';
	if(now>9)return "";
	if(s[h][w+1].size()<s[h+1][w].size())s[h][w]=c[h][w]+s[h+1][w];
	else if(s[h][w+1].size()>s[h+1][w].size())s[h][w]=c[h][w]+s[h][w+1];
	else s[h][w]=c[h][w]+max(s[h+1][w],s[h][w+1]);
	return s[h][w];
}	

int main(){
	while(1){
		rep(i,0,77)rep(j,0,77)s[i][j]="";
		string ans;
		cin>>W>>H;
		if(W==0&&H==0)break;
		rep(i,1,H+1)rep(j,1,W+1)cin>>c[i][j];
		for(int i=H;i>=0;i--)for(int j=W;j>=0;j--)
			dfs(i,j);
		int num=0;
		rep(i,1,H+1)rep(j,1,W+1){
			int zero=0;
			rep(k,0,s[i][j].size()){
				if(s[i][j][k]!='0')break;
				zero++;
			}
			num=max(num,(int)s[i][j].size()-zero);
		}
		rep(i,1,H+1)rep(j,1,W+1){
			if(s[i][j].size()==num)
				ans=max(ans,s[i][j]);
		}
		print(ans);
	}
}


Measured memory_bytes: 3348
/**
 * author:    Ziel
 * created:   23.04.2020 20:19:46
**/

// ~zaletaet~

//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>

#define fi first
#define se second
#define sz(x) int(x.size())
#define all(x) x.begin(), x.end()
#define pb push_back

using namespace std;

using ll = long long;
using ull = unsigned long long;
// using big = __int128_t; // -10^38...10^38
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;

const ll N = 1e5 + 123, MOD = 1e9 + 7, oo = 1e9 + 9, INF = 1e18 + 9;
const double EPS = 1e-9, PI = acos(-1); // 3.14159265358979323846
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1}, dy[] = {0, 0, 1, -1, 1, -1, -1, 1};

main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	
	int s, w;
	cin >> s >> w;

	if (w >= s) cout << "unsafe";
	else cout << "safe";

	return 0;
}

/*
	Raise your standard.
*/

Measured memory_bytes: 3648
N = input()
if (N[-1] == "2") or (N[-1] == "4") or (N[-1] == "5") or (N[-1] == "7") or (N[-1] == "9"):
    print("hon")
elif (N[-1] == "0") or (N[-1] == "1") or (N[-1] == "6") or (N[-1] == "8"):
    print("pon")
else:
    print("bon")

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007

typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li next_[2][100100];

li cnt[100100];

int main() {
    string s;
    cin >> s;
    li n = sz(s);

    rin{
        next_[0][i] = (s[i] == 'L' ? i - 1 : i + 1);
    }

    rep(i, 60) {
        rep(j, n) {
            next_[(i + 1) % 2][j] = next_[i % 2][next_[i % 2][j]];
        }
    }
    rin{
        cnt[next_[0][i]]++;
    }
    rin{
        cout << cnt[i] << " ";
    }
    cout << endl;


    return 0;
}


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

const int64_t MOD= 998244353;
/* 剰余環 Z/nZ */
struct mint{ // Z/nZ に関する演算(n:素数の場合は除算も)をサポートする構造体
  int64_t rep; // 出力すべき代表元 rep \in {0,1,..,MOD- 1}
  mint(int64_t x=0): rep(((x%MOD)+ MOD)% MOD){}
  mint operator-() const { return mint(-rep);}
  mint& operator+=(const mint& x){
    rep+= x.rep; 
    if(rep>= MOD) rep-= MOD;
    return *this;
  }
  mint& operator-=(const mint& x){
    rep-= x.rep;
    if(rep< 0) rep+= MOD;
    return *this;
  }
  mint& operator*=(const mint& x){
    rep*= x.rep; rep%= MOD;
    return *this;
  }
  mint operator+(const mint x) const {
    mint ans(*this);
    ans+= x;
    return ans;
  }
  mint operator-(const mint x) const {
    mint ans(*this);
    ans-= x;
    return ans;
  }
  mint operator*(const mint x) const {
    mint ans(*this);
    ans*= x;
    return ans;
  }

  mint pow(int64_t d) const{ // d \geq 0
    if(d==0) return 1;
    else{
      mint ans= pow(d>>1);
      ans*= ans;
      if(d&1){ ans*= *this; }

      return ans;
    }
  }

  friend istream& operator >> (istream &is, mint& x) noexcept{
    return is >> x.rep;
  }
  friend ostream& operator << (ostream &os, const mint& x) noexcept{
    return os << x.rep;
  }
  // MOD が素数(<=> Z/nZ が体)のとき
  mint inv() const{
    return pow(MOD-2);
  }
  mint& operator/=(const mint& x){
    *this *= x.inv();
    return *this;
  }
  mint operator/(const mint x) const {
    mint ans(*this);
    ans/= x;
    return ans;
  }
};

int main(){ 
// g(R):= \sum_{L in [1,R]} f(L,R) とおくと,
// ans  = \sum_{R in [1,N]} g(R).
// よってg(R) を順次求めればいい。まず、
// f(L,R)=  [x^S] \prod_{i in [L,R]} (1+ x^{A_i})
//       =: [x^S] F_{L,R} とおく. このとき、
// g(R)=  \sum_{L in [1,R]} [x^S] F_{L,R}
//     =  [x^S] \sum_{L in [1,R]} F_{L,R}
//     =: [x^S] G_R
//     =  [x^S] G_{R-1}(1+ x^{A_R})+ (1+ x^{A_R})
//     =  [x^S] (1+ G_{R-1}) (1+ x^{A_R}).
// まとめると、G_R= (1+ G_{R-1}) (1+ x^{A_R}), G_0= 0 の各係数をDPで順次求めていけばいい。
  int N,S;
  cin >> N >> S;

  vector<int> data(N);
  for(int i=0; i<N; i++){
    cin >> data.at(i);
  }

  vector<mint> dp(S+1);
  vector<mint> buf(S+1);
  mint ans= 0;
  for(int i=0; i<N; i++){
    dp.at(0)+= 1;
    for(int s=0; s<=S; s++){
      buf.at(s)= (s >= data.at(i)) ? dp.at(s)+ dp.at(s- data.at(i))
                                   : dp.at(s);
    }

    for(int s=0; s<=S; s++){
      dp.at(s)= buf.at(s);
    }
    ans+= buf.at(S);
  }

  cout << ans << endl; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  string S;

  cin >> S ;

  if(S.at(0)==S.at(1)&&S.at(2)==S.at(1)) cout << "Yes" << endl;

  else if(S.at(2)==S.at(1)&&S.at(2)==S.at(3)) cout << "Yes" << endl;

  else cout << "No" << endl;
  
  return 0;
}

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

int main() {
 vector<int> x(3);
  cin>> x[0]>>x[1]>>x[2];
  sort(x.begin(),x.end());
  if(x[0]==5&& x[1]==5 && x[2]==7){
    cout<<"YES"<<endl;
  }
    else{
      cout<<"NO"<<endl;
    }
}

Measured memory_bytes: 256
import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
cnt, a, b = 0, 0, 0
for i in itertools.permutations(range(1, N+1)):
    if P == i:
        a = cnt
        if b != 0:
            break
    if Q == i:
        b = cnt
        if a != 0:
            break
    cnt += 1
print(abs(a-b))

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll A, B, T; cin >> A >> B >> T;
    ll amax = T / A;
    cout << amax * B << endl;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3608
using System;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var s = Console.ReadLine().Split(' ');
        var d = new int[n];
        for (int i = 0; i < n; i++)
        {
            d[i] = int.Parse(s[i]);
        }

        var ans = new int[n];
        for (int i = n - 1, j = 0; 0 <= i; i -= 2, j++)
        {
            ans[j] = d[i];
        }

        if (n % 2 == 0)
        {
            for (int i = 0, j = n / 2; i < n; i += 2, j++)
            {
                ans[j] = d[i];
            }
        }
        else
        {
            for (int i = 1, j = n / 2 + 1; i < n; i += 2, j++)
            {
                ans[j] = d[i];
            }
        }

        Console.Write(ans[0]);
        for (int i = 1; i < n; i++)
        {
            Console.Write($" {ans[i]}");
        }
        Console.WriteLine();
    }
}


Measured memory_bytes: 35760
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES

#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <functional>
#include <utility>
#include <tuple>
#include <vector>
#include <string>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <iterator>
#include <bitset>
#include <complex>
#include <limits>
#include <random>


using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;

const double EPS = 1e-9;

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

	int N;
	string S;
	cin >> N >> S;

	int sum = 0;
	int ans = 0;
	rep(i, 0, N)if (S[i] == 'R')sum++;
	rep(i, 0, sum)if (S[i] == 'W')ans++;
	
	cout << ans << endl;

	return 0;
}

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

using namespace std;

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

const long long INF = 1LL<<60;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int H, W;
vector<string> field;
vector<pair<int, int>> points;

int bfs(int sy, int sx, int gy, int gx){
    int dist[H][W];
    REP(i,H){
        REP(j,W) dist[i][j] = -1;
    }
    queue<pair<int, int>> que;

    dist[sy][sx] = 0;
    que.push(pair<int, int> (sy,sx));
    
    while(!que.empty()){
        pair<int, int> p = que.front();
        que.pop();

        REP(d,4){
            int ny = p.first + dy[d];
            int nx = p.second + dx[d];
            if(nx < 0 || ny < 0 || nx >= W || ny >= H) continue;
            if(field.at(ny)[nx] == '#') continue;
            if(dist[ny][nx] != -1) continue;

            que.push(pair<int, int> (ny,nx));
            dist[ny][nx] = dist[p.first][p.second] + 1;

        }
    }
    return dist[gy][gx];
}

int main(){
    int N;
    cin >> H >> W;
    field.resize(H);

    REP(i,H){
        cin >> field[i];
    }
    int black = 0;
    REP(i,H){
        REP(j,W){
            if(field.at(i)[j] == '#') black++;
        }
    }

    int ans = H * W - bfs(0,0,H-1,W-1) - black - 1;
    if(bfs(0,0,H-1,W-1) == -1){
        cout << -1 << endl;
    }
    else cout << ans << endl;
}

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

int main() {
    ios_base::sync_with_stdio(false);
    string s;
    cin >> s;
    for(int i = 0; i < (int)s.length() - 1; ++i){
        if(s.substr(i, 2) == "AC"){
            cout << "Yes\n";
            return 0;
        }
    }
    cout << "No\n";
    return 0;
}

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

    l/=3;

    cout << fixed << setprecision(12);
    cout << l*l*l <<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>
#include <ios>
#include <cctype>
#include <cstdio>

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define FORR(i,a,b) for(int i = (b) - 1;i >=a;--i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).size()
#define MAX(list) std::max(list)
#define MIN(list) std::min(list)
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())

using namespace std;

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())is >> v[i];
    return is;
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
    REP(i, (int)v.size())os << v[i] << endl;
    return os;
}


using ll = long long;
ll mod = 1'000'000'007;

const int INF = 1'050'000'000;

int clamp(int n, int a, int b) {
    if (n < a)n = a;
    if (n > b)n = b;
    return n;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << fixed << setprecision(20);

    int N;
    cin >> N;
    vector<int>d(N);
    cin >> d;

    SORT(d);
    int d1 = d[N / 2 - 1];
    int d2 = d[N / 2];
    if (d1 == d2) {
        cout << 0 << endl;
        return 0;
    }
    int ans = 0;
    ans += d2 - d1;
    cout << ans << endl;
    return 0;

}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++)
    cin >> a.at(i);
  int count = 0;
  for(int i = 1; i < n-1; i++){
    if((a.at(i) > a.at(i-1) && a.at(i) < a.at(i+1))||(a.at(i) < a.at(i-1) && a.at(i) > a.at(i+1)))
      count++;
  }
  cout << count << endl;
}

Measured memory_bytes: 256