akhauriyash/Code-Regression huggingface dataset:
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in a:
   if i%2==0:
       b.append(i)

ans=True       
for i in b:
    if i%3==0 or i%5==0:
        ans=True
    else:
        ans=False
        break
        
if ans:
    print('APPROVED')
else:
    print('DENIED')

Measured memory_bytes: 3060
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
struct Node {
	int key;
	Node *l, *r, *p;
};
Node *root, *NIL; 
inline void pre(Node *u) {

	cout << " " << u->key;
	if (u->l != NIL) pre(u->l);
	if (u->r != NIL) pre(u->r);
}
inline void in(Node* u) {
	if(u->l != NIL)in(u->l);
	cout << " " << u->key;
	if (u->r != NIL) in(u->r);

}
inline Node* find(int k) {
	Node *r = root;
	//Node *f = NIL;
	Node *f;
	f = (Node *)malloc(sizeof(Node));
	f->key = k;
	while (r != NIL) {
		if (k < r->key)
			r = r->l;
		else if(k > r->key) r = r->r;
		else return r;
	}
	return r;
}
inline void insert(int k) {
	Node *x = root;
	Node *y = NIL;
	Node *z;
	int cnt = 0;
	z = (Node *)malloc(sizeof(Node));
	z->key = k;
	z->l = NIL;
	z->r = NIL;
	while (x != NIL) {
		y = x;
		if (x->key > z->key)
			x = x->l;
		else
			x = x->r;
	}
	z->p = y;
	if (y == NIL) {
		root = z;
	}
	else if (y->key > z->key) {
		y->l = z;
	}
	else if (y->key < z->key) {
		y->r = z;
	}
}
inline void deleteNode(int k) {
	Node *t = find(k);
	Node *y;
	if (t->l == NIL && t->r == NIL) {
		if (t->p == NIL)
			root = NIL;
		else if (t == t->p->l) {
			t->p->l = NIL;
		}
		else {
			t->p->r = NIL;
		}
		free(t);
	}
	else if (t->l != NIL && t->r == NIL) {
		if (t->p == NIL) {
			t->l->p = t->p;
			root = t->l;
		}
		else if (t == t->p->l) {
			t->p->l = t->l;
			t->l->p = t->p;
		}
		else {
			t->p->r = t->l;
			t->l->p = t->p;
		}
		free(t);
	}
	else if (t->r != NIL && t->l == NIL) {
		if (t->p == NIL) {
			t->r->p = t->p;
			root = t->r;
		}
		else if (t == t->p->l) {
			t->p->l = t->r;
			t->r->p = t->p;
		}
		else {
			t->p->r = t->r;
			t->r->p = t->p;
		}
		free(t);
	}
	else {
		y = t->r;

		if (y->l == NIL) {
			t->key = y->key;
			if (y->r != NIL) {
				y->p->r = y->r;
				y->r->p = y->p;
			}
			else {
				y->p->r = NIL;
			}
			free(y);
		}
		else {

			while (y->l != NIL) {
				y = y->l;
			}
			t->key = y->key;
			if (y->r != NIL) {
				y->p->l = y->r;
				y->r->p = y->p;
			}
			else {
				y->p->l = NIL;
			}
			free(y);
		}
	}
}



int main() {
		int m;
		cin >> m;
		string com;
		int n;
		for (int i = 0; i < m; i++) {
			cin >> com;
			if (com == "insert") {
				scanf("%d", &n);
				insert(n);
			}
			else if (com == "print") {
				in(root);
				cout << endl;
				pre(root);
				cout << endl;
			}
			else if (com == "find") {
				scanf("%d", &n);
				if (find(n) != NIL) cout << "yes" << endl;
				else cout << "no" << endl;
			}
			else {
				scanf("%d", &n);
				deleteNode(n);
			}

		}
		return 0;
}

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

#define rep(i, m, n) for(int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for(int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9 + 7;
//constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;

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

struct Edge {
    ll to, rev;
    long double cap;
    Edge(ll _to, long double _cap, ll _rev) {
        to = _to;
        cap = _cap;
        rev = _rev;
    }
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph &G, ll from, ll to, long double cap, bool revFlag,
              long double revCap) {
    G[from].push_back(Edge(to, cap, (ll)G[to].size()));
    if(revFlag)
        G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve() {
    string s, t;
    cin >> s >> t;
    ll n = s.size();
    ll m = t.size();

    Matrix dp(n + 1, Array(m + 1, 0));

    REP(i, n + 1) {
        REP(j, m + 1) {
            if(i < n)
                chmax(dp[i + 1][j], dp[i][j]);
            if(j < m)
                chmax(dp[i][j + 1], dp[i][j]);
            if(i < n and j < m and s[i] == t[j])
                chmax(dp[i + 1][j + 1], dp[i][j] + 1);
        }
    }
    cout << dp[n][m] << en;
}

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

    //solve();

    ll t;
    cin >> t;
    REP(i, t) { solve(); }

    return 0;
}



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

using namespace std;

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

int main(){
	long long x, y;
	cin >> x >> y;
	cout << gcd(x, y) << endl;
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long
#define ull unsigned long long
#define si(X) scanf("%d", &(X))
#define sll(X) scanf("%lld",&(X))
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int mod = 1e9+7;
ll gcd(ll a,ll b){
    if(b==0)
    return a;return gcd(b,a%b);
}
ll expo(ll base,ll pow){
    ll ans = 1;
    while(pow!=0){
        if(pow&1==1){
            ans = ans*base;
            ans = ans%mod;
        }
        base *= base;base%=mod;
        pow/=2;
    }return ans;
}
ll inv(ll x){
    return expo(x,mod-2);
}
 
const int M = 2e5 + 5;


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

    n %= 1000;
    if(n) n = 1000 - n;
    cout << n;
  
}


Measured memory_bytes: 3628
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;
using vi = vector<int>;

#define in(v) v; cin >> v;
void ins() {}
template<class T,class... Rest>void ins(T& v,Rest&... rest){cin>>v;ins(rest...);}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define all(f,c,...) (([&](decltype((c)) cccc) { return (f)(begin(cccc), end(cccc), ## __VA_ARGS__); })(c))
#define rrep(i,n) for(long long i=(n);i>=0;--i)


// debug
template<class T>ostream& operator<<(ostream& os,const vector<T>& vec){os<<"{";for(size_t i=0;i<vec.size();++i)os<<(i?", ":"")<<vec[i];os<<"}";return os;}
ostream& operator<<(ostream& os,const vector<char>&v){for(size_t i=0;i<v.size();++i)os<<v[i];return os;}
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>& rhs){os<<"("<<rhs.first<<", "<<rhs.second<<")";return os;}

#ifdef LOCAL
void debug() {cerr << "\n";}
template<class First> void debug(const First& first) {cerr<<first<<"\n";}
template<class First, class... Rest> void debug(const First& first, const Rest&... rest) {cerr<<first<<",";debug(rest...);}
void debug2() {cerr << "\n";}
template<class First> void debug2(const First& first) {cerr<<first<<" ";}
template<class First, class... Rest> void debug2(const First& first, const Rest&... rest) {cerr<<first<<" ";debug2(rest...);}
#else
#define debug(...) 42
#define debug2(...) 42
#endif

int main() {
  int in(N);
  int in(M);

  if (M % 2 == 0) {
    rep(i, (M+1)/2)
      cout << N - i << " " << N - (M-i) << endl;
    rep(i, M/2)
      cout << i+1 << " " << M-i << endl;
  } else {
    rep(i, (M+1)/2)
      cout << N - i << " " << N - (M-i) << endl;
    rep(i, M/2)
      cout << i+1 << " " << M-i << endl;
  }
  return 0;
}



Measured memory_bytes: 3656
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
const int INF=1e5+5;
long long n,x,m,ans,sum;
bool vis[INF];
vector<long long> v;
signed main()
{
        scanf("%lld %lld %lld",&n,&x,&m);
        for (int i=1; i<=n; i++) {
                // cout<<i<<" "<<x<<endl;
                v.push_back(x%m); sum++;
                x=(x*x)%m;
                // cout<<i<<" "<<x<<endl;
                if (vis[x]) break;
                vis[x]=true;
        } int flag=0,len=v.size();
        for (int i=0; i<len; i++) {if ((long long)v[i]==x) {flag=i; break;}}
        for (int i=flag; i<len; i++)
                ans+=v[i];
        ans=ans*((n-flag)/(len-flag));
        n=(n-flag)%(len-flag)+flag;
        for (int i=0; i<n; i++) ans+=v[i];
        cout<<ans<<"\n";
        return 0;
}


Measured memory_bytes: 4056
#include <bits/stdc++.h>
using namespace std;
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(),greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG true
// sort(a.begin(), a.end(), std::greater<int>());

/*
std::vector<std::string> split(const std::string &input, char delimiter)
{
    std::istringstream stream(input);

    std::string field;
    std::vector<std::string> result;
    while (std::getline(stream, field, delimiter))
    {
        result.push_back(field);
    }
    return result;
}
*/

int main()
{
    string a,b,c;
    cin>>a>>b>>c;
    if(a[a.length()-1]==b[0] && b[b.length()-1]==c[0]){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
const int MAXN=1e5+5;
int read()
{
    int s=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}
    return s*f;
}
int main()
{
    string s;
    int len;
    while(cin>>len>>s)
    {
        int i=0,j=len/2;
        bool flag=true;
        if(len%2)
        {
            cout<<"No"<<endl;
        }
        else
        {
            while(i<len/2)
            {
                if(s[i]!=s[j])
                {
                    flag=false;
                    break;
                }
                i++;j++;
            }
            if(flag)cout<<"Yes"<<endl;
            else cout<<"No"<<endl;
        }
    }
    return 0;
}


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

#define REP(i,a,b) for(int i=a,i##_end_=b;i<=i##_end_;++i)
#define DREP(i,a,b) for(int i=a,i##_end_=b;i>=i##_end_;--i)
#define MREP(i,x) for(int i=beg[x],v;v=to[i],i;i=las[i])
#define debug(x) cout<<#x<<"="<<x<<endl
#define fi first
#define se second
#define mk make_pair
#define pb push_back
#define y1 asdasd
typedef long long ll;

using namespace std;

void File(){
	freopen("haner.in","r",stdin);
	freopen("haner.out","w",stdout);
}

template<typename T>void read(T &_){
	T __=0,mul=1; char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-')mul=-1;
		ch=getchar();
	}
	while(isdigit(ch))__=(__<<1)+(__<<3)+(ch^'0'),ch=getchar();
	_=__*mul;
}

const int maxn=40+10;
const int inf=0x3f3f3f3f;
int n,m,px,py,dp[maxn][maxn][maxn][maxn],sum[maxn][maxn],ans=inf;
char s[maxn][maxn];

int S(int x1,int y1,int x2,int y2){
	return sum[x2][y2]-sum[x1-1][y2]-sum[x2][y1-1]+sum[x1-1][y1-1];
}

template<typename T>void chkmin(T &_,T __){_=_<__ ? _ : __;}

int main(){
	//File();
	read(n); read(m);
	REP(i,1,n)scanf("%s",s[i]+1);
	REP(i,1,n){
		REP(j,1,m){
			if(s[i][j]=='P'){
				px=i; py=j; s[i][j]='+';
			}
			sum[i][j]=sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1]+(s[i][j]=='#');
			//cout<<sum[i][j]<<" ";
		}
		//cout<<endl;
	}
	memset(dp,63,sizeof(dp));
	dp[1][1][n][m]=0;//代表将(1,1,n,m)这个矩形独立的最小代价为0。
	REP(x1,1,n)REP(y1,1,m)
		DREP(x2,n,x1)DREP(y2,m,y1){
			if(x1<=px && x2>=px && y1<=py && y2>=py){
				int w=dp[x1][y1][x2][y2];
				REP(x,x1,x2)REP(y,y1,y2){
					int cost1=S(x1,y1,x,y)+S(x+1,y+1,x2,y2);
					int cost2=S(x1,y+1,x,y2)+S(x+1,y1,x2,y);
					chkmin(dp[x1][y+1][x][y2],cost1+w);
					chkmin(dp[x+1][y1][x2][y],cost1+w);
					chkmin(dp[x1][y1][x][y],cost2+w);
					chkmin(dp[x+1][y+1][x2][y2],cost2+w);
				}
				//cout<<x1<<" "<<y1<<" "<<x2<<" "<<y2<<" "<<w<<endl;
				chkmin(ans,w+S(x1,y1,px,py));
				chkmin(ans,w+S(px,py,x2,y2));
				chkmin(ans,w+S(px,y1,x2,py));
				chkmin(ans,w+S(x1,py,px,y2));
			}
		}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 24704
n,m,k = map(int,input().split())
#１回押すと変わるマス　= N * M -1
#２回目押すと黒に変わるマス N * M -1 -2
# 3 = N * M -1 -4

cnt = 0
for i in range(n+1):
    for j in range(m + 1):
        cnt = i * m + j * n -2 * i * j
        if cnt == k:
            print("Yes")
            exit()
print("No")


Measured memory_bytes: 3060
#include<stdio.h>
int main()
{
	int n,i,a[110]={0},num=0,j;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&a[i]); 
	}
	for(i=1;i<=n;i++)
	{
		for(j=i+1;j<=n;j++)
		{
			num+=a[i]*a[j];
		}
	}
	printf("%d\n",num);
	return 0;
}

Measured memory_bytes: 128
fun main(args: Array<String>) {
    val N = nextInt()
    val A = next().map { it - '0' - 1 }
    if (A.all { it == A[0] }) return println(0)
    fun solve(a: List<Int>): Int {
        var two = 0
        var res = 0
        val n = a.size - 1
        a.forEachIndexed { i, v ->
            if (two == 0) res = res xor v
            two += Integer.numberOfTrailingZeros(n - i) - Integer.numberOfTrailingZeros(i + 1)
        }
        return res
    }
    val ans = if (A.contains(1)) solve(A.map { it % 2 }) else solve(A.map { it / 2 }) * 2
    println(ans)
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())


Measured memory_bytes: 45856
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int main(void) {
    int i,j;
    int n;
    cin>>n;
    string s;
    cin >> s;
    vi e(n+2,0),w(n+2,0);
    rep(i,n)
        if(s[i] == 'E')e[i+1]++;
        else w[i+1]++;
    rep(i,n+1)e[i+1]+=e[i],w[i+1]+=w[i];

    int ans = INF;
    loop(i,1,n+1){
        ans=min(ans,w[i-1]+e[n+1]-e[i]);

    }
    cout << ans << endl;

}


Measured memory_bytes: 3076
#include <bits/stdc++.h>
#include <boost/range.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/algorithm_ext.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>
using namespace std;
constexpr char nl = '\n';
using ll = long long;
using boost::irange;
namespace rng {
    using namespace boost;
    using namespace boost::range;
    using namespace boost::adaptors;
}

struct init_ { init_(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); } } init_;

template<class C> auto operator>>(istream& in, C& c) -> typename enable_if<!is_void<decltype(c.begin())>::value && !is_same<C, string>::value, istream&>::type {
    for (auto& v : c) { in >> v; } return in; }
template<class C> auto operator<<(ostream& out, const C& c) -> typename enable_if<!is_void<decltype(c.begin())>::value && !is_same<C, string>::value, ostream&>::type {
    int i = 0; for (const auto& v : c) { if (i++) { out << ' '; } out << v; } return out; }
template<size_t N, class T, class R> using when_last = typename enable_if<N == tuple_size<remove_reference_t<T>>::value - 1, R>::type;
template<size_t N, class T, class R> using when_init = typename enable_if<N != tuple_size<remove_reference_t<T>>::value - 1, R>::type;
template<size_t N = 0, class T> auto operator>>(istream& in, T&& t) -> when_last<N, T, istream&> { return in >> get<N>(t); }
template<size_t N = 0, class T> auto operator>>(istream& in, T&& t) -> when_init<N, T, istream&> { return operator>><N + 1>(in >> get<N>(t), forward<T>(t)); }
template<size_t N = 0, class T> auto operator<<(ostream& out, const T& t) -> when_last<N, T, ostream&> { return out << get<N>(t); }
template<size_t N = 0, class T> auto operator<<(ostream& out, const T& t) -> when_init<N, T, ostream&> { return operator<<<N + 1>(out << get<N>(t) << ' ', t); }

#ifdef LOCAL
constexpr auto color_s_ = "\033[2m\033[33m", color_e_ = "\033[0m";
template<class T> void trace_(const T& v) { cerr << v; }
template<class T> void trace_(const vector<vector<T>>& m) { cerr << "\n"; for (const auto& v : m) { trace_(v); cerr << "\n"; } }
template<class T> void trace_(const char* s, const T& v) { cerr << color_s_ << s << "="; trace_(v); cerr << color_e_ << "\n"; cerr.flush(); }
template<class T, class... Ts> void trace_(const char* s, const T& v, const Ts&... vs) { cerr << color_s_; for (; *s != ','; ++s) { cerr << *s; } cerr << "="; trace_(v); cerr << ","; trace_(++s, vs...); }
#define TRACE(...) trace_(#__VA_ARGS__, __VA_ARGS__)
#else
#define TRACE(...)
#endif

constexpr ll mod = 1000000007;

int main() {
    int n;
    ll k;
    cin >> n >> k;
    vector<int> a(n);
    cin >> a;
    ll t = 0;
    for (int j : irange(1, n)) {
        for (int i : irange(0, j)) {
            if (a[i] > a[j]) {
                t++;
            }
        }
    }
    rng::sort(a);
    ll fn1 = 0, lowers = 0;
    for (int i : irange(1, n)) {
        if (a[i-1] < a[i]) {
            lowers = i;
        }
        fn1 = (fn1 + lowers) % mod;
    }
    TRACE(fn1);
    ll ans = ((k * t) % mod + ((k * (k - 1) / 2 % mod) * fn1) % mod) % mod;
    cout << ans << nl;
}


Measured memory_bytes: 256
#include <stdio.h>
#define MAX 100
void insertionSort(int *,int);
int main(){
  int a[MAX];
  int n,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  insertionSort(a,n);

  
  return 0;
}


void insertionSort(int *a,int n){
  int i,j,s,key=0;
  for(i=0;i<n;i++){
 
    
    key = a[i];
    j = i-1;
    while(j >= 0 && a[j] > key){
      a[j+1]=a[j];
      j--;
      a[j+1] = key;
    }
    for(s=0;s<n;s++){
      if(s>0)printf(" ");
      printf("%d",a[s]);
    }
    printf("\n");
    
  }
}



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

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

    for (int i = 1; i <= n; i++) {
        int ans = 0;
        for (int x = 1; x*(x+2)+3 <= i; x++) {
            for (int y = 1; x*(x+y+1)+y*(y+1)+1 <= i; y++) {
                for (int z = 1; 1; z++) {
                    int tmp = x*(x+y+z)+y*(y+z)+z*z;
                    if (tmp == i) {
                        ans++;
                        break;
                    } else if (tmp > i)
                        break;
                }
            }
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 3548
#include <iostream>

using namespace std;
typedef long long ll;
ll x,k,d;
int main()
{
    scanf("%lld %lld %lld",&x,&k,&d);
    x=abs(x);

        ll cnt=x/d;
        if(k<=cnt) x-=k*d;
        else
        {
            x-=cnt*d;
            k-=cnt;
            ll y;
            if(k&1) y=min(x+d,x-d),x=y;

        }
        cout<<abs(x)<<endl;
    return 0;
}


Measured memory_bytes: 3640
import math
def dis(x,i,j,d):
    count = 0
    for y in range(d):
        count = count + (x[i][y] - x[j][y])**2
    m = math.sqrt(count)
    if m - int(m) == 0:
        return 1
    else:
        return 0
n,d = map(int,input().split())
x = []
for i in range(n):
    x1 = list(map(int,input().split()))
    x.append(x1)
count1 = 0
for i in range(n):
    for j in range(i+1,n):
        count1 = count1 + dis(x,i,j,d)
print(count1)

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

int main() {
  string s;
  cin >> s;
  
  int n=s.size(), a=(n-1)/2-1, b=(n+3)/2-1;
  
  rep(i,n){
    if(s[i]!=s[n-1-i]){
      cout << "No" << endl;
      return 0;
    }
  }
  
  rep(i,n/4){
    if(s[0+i]!=s[a-i] || s[b+i]!=s[n-1-i]){
      cout << "No" << endl;
      return 0;
    }
  }
    cout << "Yes" << endl;
  return 0;  
}

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

int main() {
    cin.tie(0)->sync_with_stdio(false);

    int t; cin >> t;
    while (t--) {
        int n; cin >> n;
        vector<ll> a(n); REP(i, n) cin >> a[i];
        string s; cin >> s;

        int ans = 0;
        vector<ll> dp;
        for (int i = n; i--;) {
            for (ll j : dp) a[i] = min(a[i], a[i]^j);
            if (a[i]) {
                if (s[i] == '0') dp.push_back(a[i]);
                else {
                    ans = 1;
                    break ;
                }
            }
        }
        cout << ans << '\n';
    }
    return 0;
}


Measured memory_bytes: 3628
import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto s = readln.chomp;

  auto hi = new int[](s.length + 1);
  foreach (i, c; s)
    hi[i + 1] = hi[i] + c.predSwitch('\\', -1, '_', 0, '/', 1);
  auto maxH = hi.reduce!(max);

  auto fs1 = hi.findSplitBefore([maxH]), hiL = fs1[0], hiMR = fs1[1];

  hiMR.reverse();
  auto fs2 = hiMR.findSplitBefore([maxH]), hiR = fs2[0], hiM = fs2[1];

  auto aiL = hiL.calcAreas;
  auto aiM = hiM.calcAreas; aiM.reverse();
  auto aiR = hiR.calcAreas; aiR.reverse();
  auto ai = aiL ~ aiM ~ aiR;

  writeln(ai.sum);
  write(ai.length);
  ai.each!(a => write(" ", a));
  writeln;
}

int[] calcAreas(int[] hi)
{
  int[] areas;
  int maxH = int.min, area = 0;
  foreach (i, h; hi) {
    if (h < maxH) {
      area += 2 * (maxH - h) + hi[i - 1] - h;
    } else if (h == maxH) {
      if (area > 0) {
        areas ~= area / 2;
        area = 0;
      }
    } else {
      maxH = h;
    }
  }
  return areas;
}

Measured memory_bytes: 2556
#include <algorithm>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <thread>
#include <tuple>
#include <type_traits>
#include <vector>

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(false);
    int n, q;
    ll ans = 0;
    cin >> n;
    ll a, b, c;
    vector<int> v(100001); // v[2] -> count of 2

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

    cin >> q;
    for (int i = 0; i < q; i++) {
        cin >> b >> c;
        // printf("b:%lld, c:%lld, v[b]=%d, v[c]=%d\n", b, c, v[b], v[c]);
        ll diff = (c - b) * v[b];
        ans += diff;
        v[c] += v[b];
        v[b] = 0;
        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 3180
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

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

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const int INF = 1 << 30;
const long long INFL = 1LL << 62;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100;

int main() {
	long long x,y;cin>>x>>y;
	int ans=1;
	while(y-x>=x) {ans++;x*=2;}
	cout<<ans<<endl;
}


Measured memory_bytes: 256
n=int(input())
s=input()
res= 0
for i in range(n-1):
    tres= 0
    x = s[:i+1]
    y = s[i+1:]
    l=[]
    for c in x:
        if not (c in l) and (c in y):
            l.append(c)
            tres += 1
    res = max(res,tres)

print(res)

Measured memory_bytes: 39024
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		long a = sc.nextLong();
		long b = sc.nextLong();
		long x = sc.nextLong();
		long ans;
		if (a == 0) {
			ans = b / x + 1;
		} else {
			ans = b / x - (a - 1) / x;
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 21844
#include <stdio.h>

#define M_MAX         10000
#define N_MAX         1000
#define r_MAX         1000
#define q_MAX         50
#define DATASET_MAX   10
#define TS_MIN        540
#define TE_MAX        1260
#define USETIME_MAX   TE_MAX-TS_MIN

struct LogInfo{
    int PCNum;
    int LogInTime;
    int LogOutTime;
};

int LogInCnt[M_MAX];
struct LogInfo LogInfoData[M_MAX][r_MAX];
int UsePCTime[DATASET_MAX];

void VarInit( void ){
    int i;
    int j;
    
    for( i=0; i<M_MAX; i++ ){
        LogInCnt[i] = 0;
        for( j=0; j<r_MAX; j++ ){
            LogInfoData[i][j].PCNum = 0;
            LogInfoData[i][j].LogInTime = 0;
            LogInfoData[i][j].LogOutTime = 0;
        }
    }
}


void RecLogInInfo( int t, int n, int m ){
    LogInfoData[m][LogInCnt[m]].PCNum = n;
    LogInfoData[m][LogInCnt[m]].LogInTime = t;
    LogInCnt[m]++;
}

void RecLogOutInfo( int t, int n, int m ){
    int i;
    
    for( i=0; i<LogInCnt[m]; i++ ){
        if( (LogInfoData[m][i].PCNum == n) && (LogInfoData[m][i].LogOutTime == 0)){
            LogInfoData[m][i].LogOutTime = t;
        }
    }
}

int CalcUsePCTime( int ts, int te, int m ){
    int i,j,t1,t2,Time;
    int Work[USETIME_MAX+1];
    Time = 0;
    
    for( i=0; i<USETIME_MAX+1; i++){
        Work[i] = 0;
    }
    
    for( i=0; i<LogInCnt[m]; i++ ){
        t1 = LogInfoData[m][i].LogInTime-TS_MIN;
        t2 = LogInfoData[m][i].LogOutTime-TS_MIN;
        for( j=t1; j<t2; j++){
            Work[j] = 1;
        }
    }
    
    for( i=ts; i<te; i++){
        if(Work[i-TS_MIN] == 1){
        Time++;
        }
    }
    
    return Time;
}


int main( void ){
    int i,N,M,r,q,t,n,m,s,ts,te;
    int qNum;
    int UseTime;
    
    qNum = 0;
    for( i=0; i<DATASET_MAX; i++ ){
        UsePCTime[i] = 0;
    }
    while( 1 ){
        scanf( " %d %d", &N, &M );
        if( N == 0 ){
            break;
        }
        VarInit();
        scanf( " %d", &r );
        for( i=0; i<r; i++ ){
            scanf( " %d %d %d %d", &t, &n, &m, &s );
            if( s == 1 ){
                RecLogInInfo( t, n, m );
            }else{
                RecLogOutInfo( t, n, m );
            }
        }
        
        scanf( " %d", &q );
        for( i=0; i<q; i++ ){
            scanf( " %d %d %d", &ts, &te, &m );
            UseTime = CalcUsePCTime( ts, te, m );
            printf("%d\n",UseTime);
        }
    }
}




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

using namespace std;

int n, m;
int ans[3];
int ok = true;

int main()
{
  	std::ios_base::sync_with_stdio(false);
	std::cin.tie(NULL);

	cin >> n >> m;

	ans[0] = -1;
	ans[1] = -1;
	ans[2] = -1;

	for (int i = 0; i < m; i++)
    {
        int s, c;
        cin >> s >> c;
        if (ans[s - 1] < 0 || ans[s - 1] == c)
            ans[s - 1] = c;
        else
            ok = false;
    }

    if (ans[0] == 0 && n != 1)
        ok = false;

    if (ans[0] == -1)
    {
        if (n != 1)
            ans[0] = 1;
        else
            ans[0] = 0;
    }

    if (ans[1] == -1)
        ans[1] = 0;
    if (ans[2] == -1)
        ans[2] = 0;

    if (ok)
    {
        for (int i = 0; i < n; i++)
            cout << ans[i];
    }
    else
        cout << -1;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip> //fixed << setprecision(10)

using namespace std;

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

typedef long long ll;
typedef vector<int> vi;

int main(){
    double n, m;
    cin >> n >> m;
    vector<double> a(n);
    rep(i, n){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    double sum = 0;
    rep(i, n){
        sum += a[i];
    }
    for(int i = 0; i < m; i++){
        if(a[i] < (sum/(4*m))){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 256
use proconio::marker::*;
use proconio::*;

use std::collections::VecDeque;

#[fastout]
#[allow(non_snake_case)]
fn main() {
    input! {
        N: usize, M: usize,
        mut AB: [(Usize1, Usize1); M],
    }
    let mut edges: Vec<Vec<usize>> = vec![vec![]; N];
    for &(A, B) in AB.iter() {
        edges[A].push(B);
        edges[B].push(A);
    }
    let mut q = VecDeque::new();
    q.push_front(0usize);
    let mut numbers = vec![std::usize::MAX; N];
    while q.len() != 0 {
        let room = q.pop_back().unwrap();
        for &each in edges[room].iter() {
            if numbers[each] == std::usize::MAX {
                numbers[each] = room;
                q.push_front(each);
            }
        }
    }
    println!("Yes");
    for &number in numbers[1..].iter() {
        println!("{}", number + 1);
    }
}


Measured memory_bytes: 17256
#include <stdio.h>
#include <string.h>

int main(void) {
	
	char s[100];
	char p[100];
	char s2[200];
	
	scanf("%s", s);
	scanf("%s", p);

	for (int i = 0; i < strlen(s); i++) {
		s2[i] = s[i];
		s2[i + strlen(s)] = s[i];
	}
	
	if (strstr(s2, p)) {
		puts("Yes");
	}
	else {
		puts("No");
	}

	return 0;
}




Measured memory_bytes: 2092
#include <bits/stdc++.h>
#ifdef JLOCAL
#include "stress.h"
#endif
using namespace std;

#define rep(i, z, n) for (int i = (z); i < int(n); ++i)
#define repr(i, n, z) for (int i = int(n) - 1; i >= (z); --i)
#define shl(n) (1 << (n))
#define hbit(n, i) (((n) >> (i)) & 1)

#define STRESS 0
using lint = long long;

int a[111111];

void solve(istream& cin, ostream& cout) {
    int n, k;
    cin >> n >> k;
    rep(i, 0, n) {
        cin >> a[i];
    }
    int g = a[0];
    rep(i, 1, n) {
        g = __gcd(g, a[i]);
    }
    rep(i, 0, n) {
        if (a[i] >= k && (a[i] - k) % g == 0) {
            cout << "POSSIBLE";
            return;
        }
    }
    cout << "IMPOSSIBLE";
}

int main() {
#if !defined(JLOCAL) || !STRESS
#ifdef JLOCAL
    freopen("input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    solve(cin, cout);
#else
    srand();
    for (int ti = 0; ti < 100; ti++) {
        stress::gen();
        stress::stupid();
        ifstream in("input.txt");
        ofstream out("output.txt");
        solve(in, out);
        out.flush();
        stress::check();
    }
    cout << "ok" << endl;
#endif
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <climits>
#include <functional>

class MinSegment {
	std::vector<std::vector<int>> mArray;
public:
	MinSegment(const std::vector<int> &init) :mArray(std::ceil(std::log2(init.size()) + 1), std::vector<int>()) {
		mArray[0] = init;
		auto size = init.size();
		for (auto i = 1; i < mArray.size(); ++i) {
			size = (size + 1) >> 1;
			mArray[i] = std::vector<int>(size, INT_MAX);
			for (auto j = 0; j < mArray[i - 1].size(); ++j) {
				if (mArray[i][j >> 1] > mArray[i - 1][j]) mArray[i][j >> 1] = mArray[i - 1][j];
			}
		}
	}
	long long int min(int from, int to) const {
		int res = INT_MAX;
		for (auto i = 0; i < mArray.size() && from <= to; ++i) {
			if (from % 2 == 1 && res > mArray[i][from]) {
				res = mArray[i][from];
			}
			if (to % 2 == 0 && res > mArray[i][to]) {
				res = mArray[i][to];
			}
			from = (from + 1) >> 1;
			to = (to - 1) >> 1;
		}
		return res;
	}
};
class MaxSegment {
	std::vector<std::vector<int>> mArray;
public:
	MaxSegment(const std::vector<int> &init) :mArray(std::ceil(std::log2(init.size()) + 1), std::vector<int>()) {
		mArray[0] = init;
		auto size = init.size();
		for (auto i = 1; i < mArray.size(); ++i) {
			size = (size + 1) >> 1;
			mArray[i] = std::vector<int>(size, INT_MIN);
			for (auto j = 0; j < mArray[i - 1].size(); ++j) {
				if (mArray[i][j >> 1] < mArray[i - 1][j]) mArray[i][j >> 1] = mArray[i - 1][j];
			}
		}
	}
	long long int max(int from, int to) const {
		int res = INT_MIN;
		for (auto i = 0; i < mArray.size() && from <= to; ++i) {
			if (from % 2 == 1 && res < mArray[i][from]) {
				res = mArray[i][from];
			}
			if (to % 2 == 0 && res < mArray[i][to]) {
				res = mArray[i][to];
			}
			from = (from + 1) >> 1;
			to = (to - 1) >> 1;
		}
		return res;
	}
};
struct Star {
	int x, y, brightness;
};
int main() {
	int n, d;
	std::cin >> n >> d;
	std::vector<Star> stars(n);
	for (auto &star : stars) std::cin >> star.x >> star.y >> star.brightness;
	std::sort(stars.begin(), stars.end(), [](const Star a, const Star b) {return a.brightness < b.brightness; });
	std::vector<int> b(n);
	std::vector<int> x(n);
	std::vector<int> y(n);
	for (auto i = 0; i < n; ++i) {
		b[i] = stars[i].brightness;
		x[i] = stars[i].x;
		y[i] = stars[i].y;
	}
	MaxSegment maxX(x);
	MinSegment minX(x);
	MaxSegment maxY(y);
	MinSegment minY(y);
	long long int max = 0;
	for (auto left = 0; left < n; ++left) {
		auto right = std::upper_bound(b.begin() + left, b.end(), b[left] + d) - 1 - b.begin();
		auto temp = (maxX.max(left, right) - minX.min(left, right)) * (maxY.max(left, right) - minY.min(left, right));
		if (max < temp) max = temp;
	}
	std::cout << max << std::endl;
}


Measured memory_bytes: 14152
import java.util.*;

public class Main {
		static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int A = sc.nextInt();
		int B = sc.nextInt();
		if(A == B) {
			System.out.println("Draw");
			return;
		}
		if(A >= 2 && B >= 2 && A > B) {
			System.out.println("Alice");
			return;
		}
		if(A>=2 && B >= 2 && A < B) {
			System.out.println("Bob");
			return;
		}
		if(A == 1) {
			System.out.println("Alice");
			return;
		}
		if(B == 1) {
			System.out.println("Bob");
		}
	}

}


Measured memory_bytes: 21844
#合成数xはp<=x**0.5を満たす素因子pを持つ
def prime_number(x):
    if x == 2:
        return True
    if x < 2 or x % 2 == 0:
        return False
    for i in range(3,int(x**0.5)+1,2):
        if x % i == 0:
            return False
    return True

N = int(input())
count = 0
for _ in range(N):
    i = int(input())
    count += prime_number(i)
print(count)


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

	int main(){
		int k;
		cin>>k;
		
		int genap;
		int ganjil;
		
		if(k % 2 == 1){
			genap = (k-1)/2;
			ganjil = (k-1)/2 + 1;
		}
		else{
			genap = k/2;
			ganjil = k/2;
		}
		
		cout<<genap*ganjil;
		
		return 0;
		
	}


Measured memory_bytes: 256
import numpy as np
import math as m

def main(**kwargs):
    if h == 1 or w == 1:
        res = 1
    elif h % 2 == 1 and w % 2 == 1:
        res = (h * w + 1) // 2
    else:
        res = h * w // 2

    return res

if __name__ == "__main__":
    cin = np.array(input().split(" ")).astype("int")
    h, w, *_ = cin

    cout = main(h=h, w=w)
    print(cout)

Measured memory_bytes: 21292
<?php
fscanf(STDIN, "%d", $N);

if(substr($N,0,1) == 7){
    echo 'Yes';
}else if (substr($N,1,1) == 7){
    echo 'Yes';
}else if (substr($N,2,1) == 7){
    echo 'Yes';
}else{
    echo 'No';
}

?>


Measured memory_bytes: 16060
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
 
public class Main implements Runnable {
	
    public static void main(String[] args) {
    	new Thread(null, new Main(), "", 16 * 1024 * 1024).start();
    }
    
    public void run() {
        FastScanner sc = new FastScanner();
        
        int n = sc.nextInt();
        
        System.out.println(phi(n));
    }
    
	//Eulerのφ関数
	static int phi(int n){
		int ans = n;
		
		int i = 3;
		boolean isChecked = false;

		while(n%2==0) {
			if(!isChecked){
				ans /= 2;
				isChecked = true;
			}
			n /= 2;
		}
		
		isChecked = false;

		while (n != 1) {
			if (n % i == 0) {
				if(!isChecked){
					ans /= i;
					ans *= (i-1);
					isChecked = true;
				}
				n /= i;
			}
			else {
				i += 2;
				isChecked = false;
			}
		}
		return ans;
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}
	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}
	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}
	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}
	public int[] nextIntArray(int n){
		int[] a = new int[n];
		for(int i=0;i<n;i++){
			a[i] = nextInt();
		}
		return a;
	}
	public Integer[] nextIntegerArray(int n){
		Integer[] a = new Integer[n];
		for(int i=0;i<n;i++){
			a[i] = nextInt();
		}
		return a;
	}
	public double nextDouble() {
		return Double.parseDouble(next());
	}
}


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

int main() {
  int N;
  cin >> N;
  vector<string> blue(N);
  for (int i = 0; i < N; i++) {
    cin >> blue.at(i);
  }
  
  int M;
  cin >> M;
  vector<string> red(M);
  for (int j = 0; j < M; j++) {
    cin >> red.at(j);
  }
  int max_count = 0;
  
  for (int k = 0; k < blue.size(); k++) {
    int count = 0;
    string keyword = blue.at(k);
    for (int b = 0; b < blue.size(); b++) {
      if (blue.at(b) == keyword) {
        count++;
      }
    }
    for (int r = 0; r < red.size(); r++) {
      if (red.at(r) == keyword) {
        count--;
      }
    }
    if (count > max_count) {
      max_count = count;
    }
  }
  
  cout << max_count << endl;
}

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

struct P
{
    int x,y;
    bool operator<(const P &a)const{
        if(y!=a.y) return y>a.y;
        return x>a.x;
    }
};

vector<P> v;
//bitset<4001000> b;
int i,n,d,m,k,a,b,c;
int e;
int o[1];
int l[1];
int j[1];

int dx[10]={0,1,0,-1,1,1,-1,-1},dy[10]={1,0,-1,0,1,-1,1,-1},dz[10]={0,0,0,0,1,-1};
int px[10]={-1,1,1,-1,1,1,-1,-1},py[10]={1,1,-1,-1,1,-1,1,-1};
long long mod=1000000007,mod2=1000000009,mod3=2017;
long long x,z,y;
double pi=3.14159265;
P u[1];
stack<int> s;
//set<int> se[33],s1;

//priority_queue<P> q;
queue<int> q;
string r;

char r1[1],r2[1];
//2147483647
//'1'==49;
//'A'==65;
//'a'==97;
//unordered_
//map<int,int> p;
//v.resize(unique(v.begin(),v.end())-v.begin());

bool as(P a,P b)
{
    if(a.x!=b.x)
    //return a.y>b.y;
    return a.x<b.x;
    return a.y<b.y;
}

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//rng();



int main()
{
    scanf("%d %d %d %d",&a,&b,&c,&d);
    for(int t=0;t<=d;t++)
        for(int w=0;w<=d;w++)
        if(d>=t*a+w*b&&(d-t*a-w*b)%c==0) k++;
    printf("%d",k);
}


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

int main() {
    vector<int> vec (3);
  
  for (int i = 0; i < vec.size(); i++) {
        cin >>  vec.at(i);
    }
  
  
    sort(vec.begin(), vec.end());
  
   if(vec.at(0)==5&&vec.at(1)==5&&vec.at(2)==7){
      cout << "YES" << endl;
   }
  
   else{
    cout << "NO"<< endl; 
   }
  
 // cout << vec.at(0) <<vec.at(1) <<vec.at(2)<< endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

	public static final double EPS = 1e-8;

	public static class P implements Comparable<P>{
		public double x;
		public double y;
		public P(double x, double y) {
			this.x = x;
			this.y = y;
		}
		//ÀWª¶ºÉ éÙÇ\[gñÉ¨¢ÄOÉé
		public int compareTo(P o) {
			if(equals(o))return 0;
			if(Math.abs(x-o.x)<EPS){
				return y-o.y<0?1:y-o.y>0?-1:0;
			}
			return x-o.x<0?1:x-o.x>0?-1:0;
		}
		public boolean equals(P o){
			return Math.abs(x-o.x)<EPS && Math.abs(y-o.y)<EPS;
		}
		@Override
		public String toString() {
			return "("+x+","+y+")";
		}
	}

	/**
	 * s->txNg
	 */
	public static class Vec{
		public P s;
		public P t;
		public double dx;
		public double dy;
		public Vec(P t){
			this.s = new P(0, 0);
			this.t = t;
			dx = t.x-s.x;
			dy = t.y-s.y;
		}
		public Vec(P s, P t) {
			this.s = s;
			this.t = t;
			dx = t.x-s.x;
			dy = t.y-s.y;
		}
		public Vec reverse(){
			return new Vec(t, s);
		}
		/**
		 * xNgÌå«³
		 */
		public double norm(){
			return Math.sqrt(dx*dx+dy*dy);
		}
		/**
		 * àÏ
		 */
		public double dotProduct(Vec o){
			return dx*o.dx + dy*o.dy;
		}
		/**
		 * OÏ
		 */
		public double crossProduct(Vec o){
			return dx*o.dy - dy*o.dx;
		}
		/**
		 * xNg o Æ¼ðµÄ¢é©
		 * ð_ðÁÄ¢éKvÍÈ¢
		 * Verify: AOJ0058
		 */
		public boolean isOrthogonal(Vec o){
			return dotProduct(o)==0;
		}
		/**
		 * xNg o Æ½s©
		 */
		public boolean isParallel(Vec o){
			return crossProduct(o)==0;
		}
		/**
		 * CCW
		 */
		public int ccw_(P p){
			return ccw(s, t, p);
		}
		/**
		 * xNg o Æðíé©
		 */
		public boolean isCross(Vec o){
			return ccw_(o.s)*ccw_(o.t) < EPS && o.ccw_(s)*o.ccw_(t) < EPS ||
			ccw_(o.s)*ccw_(o.t) < EPS && o.ccw_(s)*o.ccw_(t) < EPS;
		}
		/**
		 * _p ©çxNg·üãÖüðø¢½Æ«Ì·³
		 */
		public double distanceFromPoint(P p){
			Vec o = new Vec(s, p);
			return Math.abs(crossProduct(o))/norm();
		}
		@Override
		public String toString() {
			return s+"->"+t;
		}
	}

	/**
	 * CCW: counter clock wise
	 * 1 : clock wise
	 * -1: counter clock wise
	 * 2 : c--a--b on line
	 * -2: a--b--c on line
	 * 0 : a--c--b or a--c=b on line
	 */
	public static int ccw(P p1, P p2, P p3){
		Vec a = new Vec(p1, p2);
		Vec b = new Vec(p1, p3);
		if(a.crossProduct(b)<0)return 1;
		if(a.crossProduct(b)>0)return -1;
		//if program run here, three points on line because AxB = 0 shows parallel
		if(a.dotProduct(b)<0)return 2;
		if(a.norm() < b.norm())return -2;
		return 0;
	}

	public static double area(P[] p){
		int n = p.length;
		double a = 0;
		for(int i=0;i<n;i++){
			a += p[i].x*p[(i+1)%n].y-p[i].y*p[(i+1)%n].x;
		}
		return Math.abs(a/2);
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = 1;
		while(true){
			int n = sc.nextInt();
			if(n==0)break;
			P[] p = new P[n];
			for(int i=0;i<n;i++)p[i]=new P(sc.nextDouble(), sc.nextDouble());
			System.out.println(t++ + " " + area(p));
		}
	}
}

Measured memory_bytes: 12000
n = int(input())
a = list(map(int,input().split()))
s = 1
f = 1
if 0 in a:
    print(0)
else:
    for i in a:
        s *= i
        if s > 10**18:
            print(-1)
            break
            
    if s <= 10**18:
        print(s)

Measured memory_bytes: 21608
#include <iostream>
using namespace std;
long long ans[] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800, 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000};
int main() {
    int n; cin >> n;
    cout << ans[n] << endl;
    return 0;
}

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

int main(){
    int n = 0;
    string str;
    cin >> str;
    for(int i = 0;i < 4;i++){
        if(str[i]=='+'){
            n++;
        }else{
            n--;
        }
    }
    cout << n << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){

  int m,f,r,p;

  for(;;){
    cin >> m >> f >> r;
    p = m + f;
    if (m == -1&&f == -1&& r ==-1)break;

    if (m == -1|| f == -1){
        cout << 'F';
    }else if (  p >= 80){
        cout << 'A';
    }else if (p >= 65 && p < 80){
        cout << 'B';
    }else if (p >= 50 && p < 65 ){
        cout << 'C';
    }else if (p >= 30 && p < 50 && r < 50){ 
        cout << 'D';
    }else if (30 > p){
        cout << 'F';
    }else if (p >= 30 && p < 50 && r >= 50){
        cout << 'C';
    }
    
    cout << endl;
  }
    return 0;
} 

 

Measured memory_bytes: 3084
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO.Compression;
using System.Linq;
using System.Text;

namespace Atcoder
{
    class Program
    {
        private const long COMDIV = 1000000007;
        static void Main(string[] args)
        {
            var N = Console.ReadLine();
            foreach (var item in N)
            {
                if (item == '7')
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            Console.WriteLine("No");
        }
    }
}

Measured memory_bytes: 25796
import copy as c
n=int(input())
a=list(map(int,input().split()))
b=c.deepcopy(a)
m=int(input())
for s in range(m):
  d,f=map(int,input().split())
  a[d-1]=f
  print(sum(a))
  a=c.deepcopy(b)

Measured memory_bytes: 3444
N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x
    
q = [(1,0)]
while q:
    x,parent = q.pop()
    value[x] += value[parent]
    for y in graph[x]:
        if y == parent:
            continue
        q.append((y,x))

answer = ' '.join(map(str,value[1:]))
print(answer)


Measured memory_bytes: 124236
n,k=map(int,input().split())
l=input()
b=True
if l[0]=="1":
  b=True
else:
  b=False
l1=[]
c=1
l11=l[0]
for i in range(1,len(l)):
  if l[i]!=l[i-1]:
    l1.append(c)
    c=1
  else:
    c+=1
l1.append(c)
if b:
  if k>=len(l1)//2:
    print(n)
  else:
    l2=[]
    c1=0
    for i in range(0,(len(l1)//2)):
      c1+=l1[i*2+1]+l1[i*2]
      l2.append(c1)
    if len(l1)%2==1:
      c2=l2[k-1]+l1[2*k]
      for j in range(k,len(l2)):
        c3=l2[j]-l2[j-k]+l1[2*(j+1)]
        if c3>c2:
          c2=c3
      print(c2)
    else:
      c2=l2[k-1]+l1[2*k]
      for j in range(k,len(l2)-1):
        c3=l2[j]-l2[j-k]+l1[2*(j+1)]
        if c3>c2:
          c2=c3
      c3=l2[-1]-l2[-1-k]
      if c3>c2:
        c2=c3
      print(c2)
else:
  if k>=(len(l1)//2)+1:
    print(n)
  else:
    l2=[l1[0]]
    c1=l1[0]
    if len(l1)%2==1:
      for i in range(1,(len(l1)//2)+1):
        c1+=l1[2*i]+l1[2*i-1]
        l2.append(c1)
      c2=l2[k-1]+l1[2*k-1]
      for i in range(k,len(l2)-1):
        c3=l2[i]-l2[i-k]+l1[i*2+1]
        if c3>c2:
          c2=c3
      c3=l2[len(l2)-1]-l2[len(l2)-1-k]
      if c3>c2:
        c2=c3
      print(c2)
    else:
      for i in range(1,(len(l1)//2)):
        c1+=l1[2*i]+l1[2*i-1]
        l2.append(c1)
      c2=l2[k-1]+l1[2*k-1]
      for i in range(k,len(l2)):
        c3=l2[i]-l2[i-k]+l1[i*2+1]
        if c3>c2:
          c2=c3
      print(c2) 

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

int main () {
  int a ;
  cin >> a ;
  
  if ( (a/10)%9 == 0 || (a%10) == 9 ) {
    cout << "Yes" << endl ;
  } else {
    cout << "No" << endl ;
  }
}


Measured memory_bytes: 256