akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define fs first
#define sc second
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001


int main() {
    ll N, M; cin >> N >> M;
    priority_queue<ll> Q;
    for(int i=0; i<N; i++){
        ll a; cin >> a;
        Q.push(a);
    }
    
    for(int i=0; i<M; i++){
        ll t = Q.top();
        Q.pop();
        t /= 2;
        Q.push(t);
    }

    ll ans = 0;
    for(int i=0; i<N; i++){
        ans += Q.top();
        Q.pop();
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1400
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);

	int N;
	cin>>N;
	
	if(N<=999)
	cout<<"ABC"<<endl;
	else
	cout<<"ABD"<<endl;
	
	return 0;
}

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

int main() {
  int n; cin >> n;
  int cnt = 0;
  int ans = 0;
  if (n < 105) ans = 0;
  else {
    for (int i = 105; i < n+1; i++) {
      if (i%2 ==0) continue;
      for (int j = 1; j < i+1; j++) {
        if (i%j == 0) cnt ++;
      }
      if (cnt == 8) ans++;
      cnt = 0;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|s| s.parse().ok().unwrap())
        .collect()
}

fn main() {
    let input = read_vec::<i64>();
    let (n, k, q) = (input[0], input[1], input[2]);
    let mut points = vec![0; n as usize];

    let need = q - k + 1;

    for _ in 0..q {
        let a = read::<usize>() - 1;
        points[a] += 1;
    }

    for point in points {
        if point >= need {
            println!("Yes");
        } else {
            println!("No");
        }
    }
}

Measured memory_bytes: 4732
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>

#include <bits/stdc++.h>
#include <cmath>
#include <limits>

using namespace std;

long long H, W;
vector<long long> v;

int main(int argc, char* argv[]){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	cin >> H >> W ;
	long long S, s, ans;

	if((H % 3) == 0 || (W % 3) == 0){
		ans = 0;
		printf("%lld\n", ans);
		return 0;
	}

	long long w, h;
	v.clear();

	//左1/3、残りの右を上下に分割
	w = W / 3;
	h = H / 2;
	// H*w, h*(W-w), (H-h)*(W-w)
	for(long long i = -2; i <= 2; i++){
		if(w+i<1 || w+i>=W) continue;
		for(long long j = -2; j <= 2; j++){
			if(h+j<1 || h+j>=H) continue;
			long long a = H * (w+i);
			long long b = (h+j)*(W-(w+i));
			long long c = (H-(h+j))*(W-(w+i));
			if(a <= 0 || b <= 0 || c <= 0) continue;
			S = max( a, max( b, c ) );
			s = min( a, min( b, c ) );
			if(S >= s && S > 0 && s > 0){
				v.push_back(S - s);
			}
		}
	}
	
	//上1/3、残りの下を左右に分割
	h = H / 3;
	w = W / 2;
	// h*W, (H-h)*w, (H-h)*(W-w) 
	for(long long i = -2; i <= 2; i++){
		if(h+i<1 || h+i>=H) continue;
		for(long long j = -2; j <= 2; j++){
			if(w+j<1 || w+j>=W) continue;
			long long a = (h+i) * W;
			long long b = (H-(h+i))*(w+j);
			long long c = (H-(h+i))*(W-(w+j));
			if(a <= 0 || b <= 0 || c <= 0) continue;
			S = max( a, max( b, c ) );
			s = min( a, min( b, c ) );
			if(S >= s && S > 0 && s > 0){
				v.push_back(S - s);
			}
		}
	}

	//縦方向に3分割
	h = H / 3;
	for(int i = -2; i <= 2; i++){
		for(int j= -2; j <= 2; j++){
			long long a = (h + i) * W;
			long long b = (h + j) * W;
			long long c = (H - (h+i) - (h+j)) * W;
			if(a <= 0 || b <= 0 || c <= 0) continue;
			S = max(a, max(b, c));
			s = min(a, min(b, c));
			if(S >= s && S > 0 && s > 0){
				v.push_back(S - s);
			}
		}
	}

	//横方向に3分割
	w = W / 3;
	for(int i = -2; i <= 2; i++){
		for(int j= -2; j <= 2; j++){
			long long a = (w + i) * H;
			long long b = (w + j) * H;
			long long c = (W - (w+i) - (w+j)) * H;
			if(a <= 0 || b <= 0 || c <= 0) continue;
			S = max(a, max(b, c));
			s = min(a, min(b, c));
			if(S >= s && S > 0 && s > 0){
				v.push_back(S - s);
			}
		}
	}

	sort(v.begin(), v.end());
	ans = v[0];
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 3768
#include <stdio.h>
int main(void)
{
  int s,m,h;
  int A = 60;

  scanf("%d",&s);
  m = s / A;
  s = s % A;
  h = m / A;
  m = m % A;

  printf("%d:%d:%d\n",h,m,s);
  return(0);
}

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

int main()
{
    // 入力
    int N;
    cin >> N;

    vector<string> S(N);
    rep (i, N) {
        string s;
        cin >> s;

        vector<string> s_v;
        s_v.push_back(s);

        sort(s.begin(), s.end());
        S[i] = s;
    }
    sort(S.begin(), S.end());

    ll count = 0;
    rep (i, N) {
        if (S[i] == "") {
            continue;
        }

        int count_inner = 0;
        for (int j = i + 1; j < N; j++) {
            if (S[i] == S[j]) {
                count_inner++;
                count += count_inner;

                S[j] = "";
            } else {
                break;
            }
        }
    }

    // 出力
    cout << count << endl;
    return 0;
}


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

#define ll long long
#define ld long double
#define F first
#define S second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define ppb pop_back
#define vll vector<ll>
#define vi vector<int>
#define endl "\n"

const ll INF = 1000000007;

/*
const int max_size = 100001;
int parent[max_size];
int Size[max_size];

int root(int x){
	while(x!=parent[x]){
		parent[x] = parent[parent[x]];
		x = parent[x];
	}
	return x;
}

void sunion(int x,int y){
	int rx = root(x);
	int ry = root(y);
	if(rx != ry){
		if(Size[rx] > Size[ry]){
			parent[ry] = parent[rx];
			Size[rx] += Size[ry];
		}
		else{
			parent[rx] = parent[ry];
			Size[ry] += Size[rx];
		}
	}
}
*/

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t=1;
	//cin >> t;
	while(t--){
		int k;
		cin >> k;
		if (k%7 == 0) k /= 7;
		if (__gcd(10,k) != 1) cout << "-1" << endl;
		else {
			ll v = 1%k;
			int len = 1;
			while (v != 0) {
				v = (10*v + 1) % k;
				len++;
			}
			cout << len << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+10;
ll a[maxn];
ll k;
int n;
bool check(ll x){
    ll cnt=0;
    for(int i=1;i<=n;i++){
        if(a[i]<0){
            int l=i+1,r=n,ans=-1;
            while(l<=r){
                int mid=(l+r)>>1;
                if(a[mid]*a[i]<x){
                    r=mid-1;
                    ans=mid;
                }else l=mid+1;
            }
            if(ans!=-1)
            cnt+=n-ans+1;
        }else{
            int l=i+1,r=n,ans=-1;
            while(l<=r){
                int mid=(l+r)>>1;
                if(a[mid]*a[i]<x){
                    l=mid+1;
                    ans=mid;
                }else r=mid-1;
            }
            if(ans!=-1)
            cnt+=ans-i;
        }
    }
    //cout<<cnt<<' '<<x<<endl;
    return cnt<k;
}
int main(){
    scanf("%d %lld",&n,&k);
    for(int i=1;i<=n;i++)scanf("%lld",&a[i]);
    sort(a+1,a+n+1);
    ll l=-1e18,r=1e18,ans;
    while(l<=r){
        ll mid=(l+r)>>1;
        if(check(mid)){
            l=mid+1;
            ans=mid;
        }else r=mid-1;
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pi 3.141592653589793238
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MOD 1000000007
int main()
{
	fast;
	ll a,b,c;
	cin>>a>>b>>c;
	cout<<a+b+c-max({a,b,c});
	return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
struct edge
{
	LL u,v;
}e[400010];
LL fir[200010],nex[400010],vis[200010],edgenum=0;
inline void connect(LL a,LL b)
{
	e[edgenum].u=a;	e[edgenum].v=b;
	if(fir[a]!=-1)	nex[edgenum]=fir[a];
	fir[a]=edgenum;
	edgenum++;
}
int main()
{
	memset(fir,-1,sizeof(fir));
	memset(nex,-1,sizeof(nex));
	memset(vis,0,sizeof(vis));
	LL n,m,i,j,k,l,a,b;
	cin>>n>>m;
	for(i=0;i<m;i++)
	{
		cin>>a>>b;
		connect(a,b);
		connect(b,a);
	}
	queue<LL>bfs,deep;
	bfs.push(1);	deep.push(0);	vis[1]=1;
	while(!bfs.empty()&&!vis[n])
	{
		k=-1;i=bfs.front();	bfs.pop();
		j=deep.front();	deep.pop();
		if(j==2)	continue;
		if(i!=-1)
		{
			edge &g=e[fir[i]];
			if(!vis[g.v])
			{
				vis[g.v]=1;
				bfs.push(g.v);
				deep.push(j+1);
			}
			k=nex[fir[i]];
		}
		while(k!=-1)
		{
			edge &g=e[k];
			if(!vis[g.v])
			{
				vis[g.v]=1;
				bfs.push(g.v);
				deep.push(j+1);
			}
			k=nex[k];
		}
	}
	if(vis[n])	puts("POSSIBLE");
	else puts("IMPOSSIBLE");
	return 0;
}

Measured memory_bytes: 14336
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define FOR(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v),end(v)
#define debug(x) std::cerr<<#x<<": "<<x<<"\n"
#define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
#define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"

using ll=long long;
using vi=std::vector<int>;
using vvi=std::vector<vi>;
using vll=std::vector<ll>;
using vvll=std::vector<vll>;
template<typename T> using vvec=std::vector<std::vector<T>>;
template<typename T>
auto make_v(size_t sz){return std::vector<T>(sz);}
template<typename T,typename... Ts>
auto make_v(size_t sz,Ts...ts){return std::vector<decltype(make_v<T>(ts...))>(sz,make_v<T>(ts...));}
template<typename T>
void fill_v(T&var,const T&x){var=x;}
template<typename V,typename T>
void fill_v(V&v,const T&x){for(auto&& w:v){fill_v(w,x);}}

template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<std::vector<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<std::deque<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s, const std::set<T>&v){
  s<<"\n";for(auto&& elm:v){s<<elm<<"\t";}s<<"\n";return s;}

inline void scan(int&a){scanf("%d",&a);}
inline void scan(ll&a){scanf("%lld",&a);}
inline void scan(char&a){scanf(" %c",&a);}
inline void scan(double&a){scanf("%lf",&a);}
template<typename T>
inline void scan(std::vector<T>&v){for(auto&& sv:v){scan(sv);}}
template<typename First,typename...Args>
inline void scan(First&f,Args&...args){scan(f);scan(args...);}
inline void scan(std::string&s){char BUF[3000000];scanf(" %s",BUF);s=std::string(BUF);}
inline void print(int a){printf("%d\n",a);}
inline void print(ll a){printf("%lld\n",a);}
inline void print(double a){printf("%.12f\n",a);}
inline void print(std::string s){std::cout<<s<<"\n";}

using namespace std;

void print_(vi& ans) {
  rep (i, 3) {
    printf("%d%c", ans[i], " \n"[i == 2]);
  }
}

int main() {
  int n, y; scan(n, y);
  y /= 1000;
  vi ans(3, -1);
  rep (i, n+1) {
    int sum_10 = 10 * i;
    if (sum_10 > y) { continue; }
    rep (j, n+1 - i) {
      int k = n - i - j;
      int sum_all = sum_10 + 5 * j + k;
      if (sum_all == y) {
        ans = {i, j, k};
        print_(ans);
        return 0;
      }
    }
  }
  print_(ans);

  return 0;
}


Measured memory_bytes: 504
// Created by Kshitij Anand NSIT
#include <bits/stdc++.h>
//#include <ext/numeric>
//using namespace __gnu_cxx;


using namespace std;


#define int long long
#define pb push_back
#define P pair<int,int>
#define F first
#define S second
#define vi vector<int>
#define vc vector<char>
#define vb vector<bool>
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define mp(a, b) make_pair(a, b)
#define min3(a, b, c) min(min(a, b), c)
#define min4(a, b, c, d) min(min(a, b), min(c, d))
#define max3(a, b, c) max(max(a, b), c)
#define max4(a, b, c, d) max(max(a, b), max(c, d))
#define fill(arr,val) memset(arr,val,sizeof(arr))
#define inf 1e18
#define ps(x,y) fixed<<setprecision(y)<<x
#define db(x)  cout<<#x<<" : "<<x<<endl


const int N = 1000000007;
vi *adjlist;
bool *visited;

int dfs(int root){

    visited[root] = true;

    int ans = 0;

    for(auto neighbor : adjlist[root]){

        if(!visited[neighbor]){
            ans += dfs(neighbor);

        }
    }

    return ans + 1;
}

void solve(){

    int n , e , a,b,c, ans=0, count=0, sum=0;
    cin>>n>>e;
    adjlist = new vi[n];

    for(int i=0; i<e; i++) {

        cin>>a>>b;
        adjlist[a - 1].pb(b - 1);
        adjlist[b - 1].pb(a - 1);
    }

    visited = new bool[n]();


    for(int i = 0 ;i<n ; i++){

        if(!visited[i]){

            sum = dfs(i);

            ans = max(ans , sum);
        }
    }

    cout<<ans<<endl;


}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
    
  //  int t; cin>>t; while(t--)
    {     
      solve();
    }

  return 0;
}


Measured memory_bytes: 20996
package main

import "fmt"

func main() {
	// Code for A - Move and Win
	var N, A, B int
	fmt.Scanf("%d %d %d", &N, &A, &B)

	if (B-A)%2 == 0 {
		fmt.Println("Alice")
	} else {
		fmt.Println("Borys")
	}
}


Measured memory_bytes: 1836
#define rep(i,n) for(i=0;i<(n);++i)
#include<iostream>
#include<fstream>
#include<vector>
#include<array>
#include<utility>
#include<string>
#include<algorithm>
#include<bitset>
#include<queue>
#include<cmath>
#include<iomanip>
using ll = unsigned long long int;
using namespace std;

const int MAX = 700000;
const int MOD = 1000000007;

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 src(){
    int x,y;
    cin>>x>>y;
    int n,r;
    if((x+y)%3!=0){cout<< 0;
    }else{
    n=(x+y)/3;
    r=x-n;
    // 前処理
    COMinit();
    // 計算例
    cout << COM(n, r) << endl;
    }

    return 0;
}

int main(int argc,char* argv[]){
    //ifstream in( argv[1] );
    //cin.rdbuf(in.rdbuf());
    src();    
    return 0;
}

Measured memory_bytes: 16640
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(void) {
	int N;
	cin >> N;
	string P = string(N, ' ');
	string Q = string(N, ' ');
	for (int i = 0; i < N; ++i)
		cin >> P[i];
	for (int i = 0; i < N; ++i)
		cin >> Q[i];

	int ans = 0;
	if (P != Q) {
		if (P > Q)
			swap(P, Q);
		while (next_permutation(P.begin(), P.end())) {
			++ans;
			if (P == Q)
				break;
		}
	}

	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        int bai = (int)Math.pow(2,k)-1;
        int max = Math.max(a,Math.max(b,c));

        System.out.println(a+b+c+(max*bai));
    }
}

Measured memory_bytes: 21588
#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <deque>
#include <bitset>
#include <regex>
#include <cassert>
#include <set>
#include <map>
using namespace std;
#define inf 2000000000
#define mod 1000000007
map<long long, bool> dict;
vector<long long> arr;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	long a, b, n, x = 1;
	cin >> a >> b >> n;
	arr.push_back(0);
	x = min(b - 1, n);
	cout << floor((a * x) / b);
}

Measured memory_bytes: 3792
import bisect
n = int(input())
l = sorted(list(map(int, input().split())))
ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        idx = bisect.bisect_left(l, l[i]+l[j])
        ans += max(0, idx - 1 - j)        
#print(l)
#while i+2 < n:
#    if l[i] < l[i+1] + l[i+2]:
#        ans+=1
#        i+=3
#    else: i+=1
print(ans)

Measured memory_bytes: 45188
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

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

	vector<int64_t> v(51, 0);
	vector<int64_t> v2(51, 0);

	for(int i = 0; i < N; i++) cin >> v[i];
	for(int i = 0; i < N; i++) v2[i] = i+1;

	int64_t cnt = 0;

	for(int i = 0; i < N; i++)
	{
		if(v[i] != v2[i]) cnt++;
	}

	if(cnt == 0 or cnt == 2) cout << "YES" << endl;
	else cout << "NO" << endl;

	return 0;
}


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

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

using namespace std;

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

    ll N;
    cin >> N;
    vector<ll> b(N);
    Rep (i, N) {
        cin >> b[i];
    }

    vector<ll> ans;
    vector<bool> ins(N, true);
    while (ans.size() < N) {
        ll now = 0;
        ll target = -1;
        Rep (i, N) {
            if (ins[i]) {
                now++;
                if (b[i] == now) {
                    target = i;
                }
            }
        }
        if (target == -1) {
            cout << -1 << endl;
            return 0;
        }

        ans.push_back(b[target]);
        ins[target] = false;
    }

    reverse(ans.begin(), ans.end());
    for (ll e : ans) {
        cout << e << "\n";
    }
}

Measured memory_bytes: 256
import numpy as np

n = int(input())
ab = [list(map(int, input().split())) for _ in range(n)]
sorted_ab = sorted(ab, key=lambda x: x[1])
arr = np.array(sorted_ab)
if np.any((arr[:, 1] - np.cumsum(arr[:, 0])) < 0):
  print('No')
else:
  print('Yes')

Measured memory_bytes: 67160
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from heapq import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def f(flag):
	if(flag):
		return 'Yes'
	else:
		return 'No'

def solve(l):
	l = list(str(l))
	ff = 0
	if('7' in l):
		ff = 1
	return (f(ff))

N = int(stdin.readline())
print(solve(N))


Measured memory_bytes: 76576
#include <iostream>
#include <algorithm>
#include <numeric>

int n,m,r;
int c[10];
long long d[210][210];
constexpr long long inf=10000000000000;
int main(){
  std::cin>>n>>m>>r;
  
  for(int i=0;i<n;++i)
    std::fill(d[i],d[i]+n,inf);
  for(int i=0;i<n;++i)
    d[i][i]=0;
  
  for(int i=0;i<r;++i){
    std::cin>>c[i];
    --c[i];
  }
  for(int i=0;i<m;++i){
    int x,y;
    long long z;
    std::cin>>x>>y>>z;
    --x,--y;
    d[x][y]=z;
    d[y][x]=z;
  }
  
  for(int i=0;i<n;++i)
    for(int j=0;j<n;++j)
      for(int k=0;k<n;++k)
        d[j][k]=std::min(d[j][k],d[j][i]+d[i][k]);
  
  long long ans=inf;
  int l[10];
  std::iota(l,l+r,0);
  do{
    long long res=0;
    for(int i=0;i<r-1;++i)
      res+=d[c[l[i]]][c[l[i+1]]];
    ans=std::min(ans,res);
  }while(std::next_permutation(l,l+r));
  std::cout<<ans<<std::endl;
  return 0;
}


Measured memory_bytes: 640
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = std::numeric_limits<long long>::max();
const double PI = acos(-1);
#define fir first
#define sec second
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Mfor(i,mf) for(LL i=mf-1;i>=0;i--)
LL h, w, n, m, k, s, t, q, ans, sum, last, cnt,d[1000000],c[1000000];
struct Edge { LL to,cost; };
Pll a[1000000];
vector<Edge>vec[100000];
string str;
bool f=0;
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
int main() {
	cin >> n;
	cout << n * 800 - n / 15 * 200 << endl;
	return 0;
}

Measured memory_bytes: 4352
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>

#define MOD (1000000007)

using namespace std;

typedef long long int Int;

constexpr Int TEN(int n) { return n == 0 ? 1 : 10 * TEN(n-1); }

const int max_n = 2000+10;
Int dp[max_n][max_n];
int N;

int main(void) {
    cin>>N;

    vector<pair<Int,int>> A;
    for(int i = 0;i < N;i++) {
        Int a;
        cin>>a;
        A.push_back({a,i});
    }

    sort(A.begin(),A.end(),greater<pair<Int,int>>());

    for(int i = 0;i < N;i++) {
        for(int j = 0;j < i+1;j++) {
            Int a = A[i].first;
            int p = A[i].second;
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j]+(p-j)*a);
            dp[i+1][j] = max(dp[i+1][j], dp[i][j]+((N-(i-j)-1)-p)*a);
        }
    }

    Int sum = 0;
    for(int i = 0;i <= N;i++) 
        sum = max(dp[N][i],sum);

    cout<<sum<<endl;

    return 0;
}


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

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

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

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 30;

string in[1010];

int main(void){
	int n;
	while(cin >> n){
		if(n==0)
			break;
		int cmin=-inf,cmax=inf;
		bool ok=true;
		rep(i,n) cin >> in[i];

		rep(i,n-1){
			if(in[i]=="x"&&in[i+1]=="x"){
				ok=false;
				continue;
			}
			if(in[i]=="x"){
				int cur=stoi(in[i+1]);
				if(i&1)
					cmin=max(cmin,cur+1);
				else
					cmax=min(cmax,cur-1);
				continue;
			}
			if(in[i+1]=="x"){
				int cur=stoi(in[i]);
				if(i&1)
					cmax=min(cmax,cur-1);
				else
					cmin=max(cmin,cur+1);
				continue;
			}
			int cur1=stoi(in[i]);
			int cur2=stoi(in[i+1]);
			if(i&1){
				if(cur1<cur2) ok=false;
			}else{
				if(cur1>cur2) ok=false;
			}
 		}

		if(!ok)
			puts("none");
		else if(cmin==cmax)
			cout << cmin << endl;
		else if(cmin<cmax)
			puts("ambiguous");
		else
			puts("none");
	}
	return 0;
}

Measured memory_bytes: 1296
class Array
  def swap(x, y)
    self[x], self[y] = self[y], self[x]
  end
end

def selectionSort(n, a)
  c = 0
  (n-1).times{|i|
    min = i
    (i+1..n-1).each{|j|
      a[j]<a[min]&&min=j
    }
    i!=min&&a.swap(i,min)&&c+=1
  }
  return a, c
end

a, c = selectionSort(gets.to_i, gets.split.map(&:to_i))
puts a.join(" ")
puts c

Measured memory_bytes: 8640
#include <bits/stdc++.h>
#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; cin>>N;
	vector<int> L(N);
	if(N<3){
		cout << 0 << endl;
		return 0;
	}
	rep(i,N) cin>>L[i];
	sort(L.begin(),L.end());

	int ans=0;
	for(int i=0; i<L.size()-2; i++){
		for(int j=i+1; j<L.size()-1; j++){
			if(L[i]==L[j]) continue;
			for(int k=j+1; k<L.size(); k++){
				if(L[j]==L[k]) continue;
				if(L[k] < L[i]+L[j]) ans++;	
			}
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 3648
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
typedef long double lb;
using namespace std;

ll gcd(ll P, ll Q){
  return Q ? gcd(Q,P % Q):P;
}

ll lcm(ll P, ll Q){
  return P / gcd(P,Q) * Q;
}

string change_big(string str){
  transform(str.begin(), str.end(), str.begin(), ::toupper);
}

string change_small(string str){
  transform(str.begin(), str.end(), str.begin(), ::tolower);
}

bool is_prime(int x){
  if(x<=1) return false;
  for(int i=2;i*i<=x;i++)
    if(x%i==0) return false;
  return true;
}

ll sum_of_num(ll num){
  ll dig;
  ll sum = 0;
  while(num){
    dig = num % 10;
    sum = sum + dig;
    num = num / 10;
  }
  return sum;
}

ll how_many_break(ll n, ll m){
  ll counter = 0;
  while (n % m == 0){
    n = n / m;
    counter++;
  }
  return counter;
}
/*------------------------------------------------------------------------------------*/

int main(){
	int n, m, ans;
	int a[100], b[100], c[100], d[100];
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
	}
	for (int j = 0; j < m; j++) {
		cin >> c[j] >> d[j];
	}
	for (int i = 0; i < n; i++) {
		int min = 1000000007;
		for (int j = m - 1; j >= 0; j--) {
			int co = abs(a[i] - c[j]) + abs(b[i] - d[j]);
			if (co <= min) {
				ans = j + 1;
				min = co;
			}
		}
		cout << ans << endl;
	}
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define forr(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */

int main() {
    int ans;
    rep(i, 5) {
        int a;
        cin >> a;
        if(a == 0) ans = i + 1;
    }
    cout << ans << endl;
    
    return 0;
}

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

int main(){
	int n;
	cin>>n;
	int a[n+5];

	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a,a+n);
	ll count=0;
	for(int i=0;i<n-2;i++){
		for(int k=i+1;k<n-1;k++){
		for(int j=n-1;j>k;j--){
			if(a[j]<a[k]+a[i]){
				count=count+(j-k);
				break;
			}
		}
	}
	}
	cout<<count<<endl;
	return 0;
}


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

const int MAX_N = 1e+5 + 10;
const ll INF = 1LL << 50;

ll A[MAX_N], X[MAX_N];
ll sum[MAX_N], even_sum[MAX_N];

int main() {
    int N, Q;
    cin >> N >> Q;
    for (int i = 1; i <= N; i++) {
        cin >> A[i];
        sum[i] = A[i] + sum[i - 1];
        even_sum[i] = even_sum[i - 1];
        if (i % 2 == 0) even_sum[i] += A[i];
    }
    A[N + 1] = INF;
    for (int i = 0; i < Q; i++) cin >> X[i];
    for (int i = 0; i < Q; i++) {
        int ng = 0, ok = N;
        while (ok - ng > 1) {
            int mid = (ng + ok) / 2;
            if (A[mid] < X[i]) ng = mid;
            else {
                int takahashi = N - mid + 1;
                int aoki = mid - (lower_bound(A + 1, A + N + 2, X[i] - (A[mid] - X[i])) - A) + 1;
                if (takahashi <= aoki) ok = mid;
                else ng = mid;
            }
        }
        int cnt = N - ok + 1;
        int idx = ok - cnt;
        ll ans = sum[N] - sum[ok - 1];
        if ((idx - 1) % 2 == 0) ans += even_sum[idx - 1];
        else ans += sum[idx - 1] - even_sum[idx - 1];
        cout << ans << endl;
    }
    return 0;
}

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

int main() {

	int n; cin >> n;
	double d; cin >> d;
	int ans = 0;
	for (int i = 0; i < n; i++) {
	double x, y; cin >> x >> y;
		double tmp = sqrt(x * x + y * y);
		if (tmp <= d) ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3860
import sys
n, x = map(int, input().split())
kids = list(map(int, input().split()))
kids.sort()
joy = 0
for k in kids:
  if (x >= k):
    x -= k
    joy += 1
  else:
    print(joy)
    sys.exit()
if (x > 0):
  joy -= 1
print(joy)

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

int main() {
    int n;
    cin >> n;
    vector<int> s(n);
    for (int i = 0; i < n; ++i) {
        cin >> s[i];
    }
    s.erase(unique(s.begin(), s.end()), s.end());
    int q;
    cin >> q;
    vector<int> t(q);
    for (int j = 0; j < q; ++j) {
        cin >> t[j];
    }
    sort(t.begin(), t.end());
    int ans = 0;
    for (int i : s) ans += binary_search(t.begin(), t.end(), i);
    cout << ans << endl;
}



Measured memory_bytes: 3408
#include <iostream>
#include <vector>
#include <string>

using namespace std;


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

    long long answer = 0;

    vector<long long> counter(3, 0);

    for (int i = 0; i < n; i++) {
        if (s.substr(i, 1) == "R") counter[0]++;
        if (s.substr(i, 1) == "G") counter[1]++;
        if (s.substr(i, 1) == "B") counter[2]++;
    }
    answer = counter[0] * counter[1] * counter[2];



    for (int k = 1; k + k < n; k++) {
        for (int i = 0; i + k + k < n; i++) {
            if ((s.substr(i, 1) != s.substr(i + k, 1)) && (s.substr(i, 1) != s.substr(i + k + k, 1)) && (s.substr(i + k, 1) != s.substr(i + k + k, 1))) {
                answer--;
            }
        }
    }

    cout << answer << endl;

}

Measured memory_bytes: 3628
import math
import cmath

#def angle(center, left, right):
#	bunshi = (left[0] - center[0]) * (right[0] - center[0]) + (left[1] - center[1]) * (right[1] - center[1]) ** 2
#	bunbo = math.sqrt(((left[0] - center[0]) ** 2 + (right[0] - center[0]) ** 2) * ((left[1] - center[1]) ** 2 + (right[1] - center[1]) ** 2))
#	theta = bunshi / bunbo
#	return 1 - math.acos(theta) / 2 * (math.pi)

def arg(center, point):
	return cmath.phase(complex(point[0] - center[0], point[1] - center[1]))


n = int(input())
dots = [list(map(int, input().split())) for _ in range(n)]

if n == 2:
	print(0.5)
	print(0.5)
else:
	ans = []
	for d in dots:
		arg_list = []
		for e in dots:
			if d == e:
				continue
			else:
				arg_list.append(arg(d, e))
		arg_list.sort()
		convex = False
		if arg_list[-1] - arg_list[0] <= math.pi:
			convex = True
			theta = arg_list[-1] - arg_list[0]
			ans.append(0.5 - theta / (2 * math.pi))
		else:
			for i in range(len(arg_list) - 1):
				if arg_list[i + 1] - arg_list[i] >= math.pi:
					convex = True
					theta = arg_list[i + 1] - arg_list[i]
					ans.append(theta / (2 * math.pi) - 0.5)
			if convex == False:
				ans.append(0)

	for a in ans:
		print(a)

Measured memory_bytes: 3440
#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(){
	int n, k;
	string s;
	cin >> n >> k >> s;

	s.at(k-1) += 32;
	cout << s << endl;

	return 0;
}

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

using namespace std;

#define eps 1e-12
#define pi 3.14159265358979323846
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define bgn begin
#define ll long long
#define ld long double
#define ull unsigned long long
#define ii pair<ll,ll>











string s;



void solve()
{
	cin >> s;
	cout << s.substr(0, 3) << "\n";
}

int main()
{
	std::ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef localProject
	freopen("in.txt","r",stdin);
#endif
	solve();
	return 0;
}

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

using namespace std;
int main(){
  int n,y;
  cin >> n >> y;
  for(int mai_1k=0; mai_1k<=n; mai_1k++){
    for(int mai_5k=0; mai_5k<=n-mai_1k; mai_5k++){
      int mai_10k = n-mai_1k-mai_5k;
      int sum = 1000*mai_1k + 5000*mai_5k + 10000*mai_10k;
      if(sum == y){
        cout << mai_10k << " " << mai_5k << " " << mai_1k << endl;
        return 0;
        }
    }
  }

  cout << -1 << " " << -1 << " " << -1 << endl; 

}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
 int n, i, sum = 100000, count;
 cin >> n;
 for(i = 0;i < n;i++){
  sum = sum * 1.05;
  if(sum % 1000 != 0){
  sum = sum / 1000;
  sum = sum + 1;
  sum = sum * 1000;
  }
 }
 
 cout << sum << endl;

 return 0; 
}

Measured memory_bytes: 1156
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
	string str1, str2;
	cin >> str1 >> str2;
	int ans = 0;
	if (str1[0] == str2[0])
	{
		ans++;
	}
	if (str1[1] == str2[1])
	{
		ans++;
	}
	if (str1[2] == str2[2])
	{
		ans++;
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
    using namespace std;
    size_t n;
    cin >> n;
    set<string> s;
    string q, S;
    for(size_t i = 0; i < n; ++i){
        cin >> q >> S;
        if(q[0] == 'i')s.insert(S);
        if(q[0] == 'f')puts(s.count(S) ? "yes" : "no");
    }
}


Measured memory_bytes: 32520
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <numeric>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
using ll=long long;
#define int ll
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define SZ(x) ((int)x.size())
#define fi first
#define se second
const int INF = 1e15;
using namespace std;

template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;

using pi=pair<int,int>;
using vi=vc<int>;

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

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

    int A,B,N; cin >> A >> B >> N;
    if(N<B) cout << (A*N)/B-A*(N/B) << endl;
    else cout << (A*(B-1))/B-A*((B-1)/B) << endl;
}

Measured memory_bytes: 3608
import std.stdio, std.conv, std.string, std.range, std.algorithm, std.array,
  std.functional, std.container, std.typecons;

alias Work = Tuple!(int, int);

void main() {
  int N = readln.chomp.to!int;
  Work[] W = new Work[N];
  foreach(i; 0..N) {
    auto input = readln.split.to!(int[]);
    W[i] = tuple(input[0], input[1]);
  }

  W.sort!"a[1] != b[1] ? a[1]<b[1] : a[0]>b[0]"();

  ulong t = 0;
  foreach(i, w; W) {
    t += w[0];
    if(t > w[1]) {
      writeln("No");
      return;
    }
  }
  writeln("Yes");
}


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

#define debug(x) cerr << x << " = "(x) << endl;
#define ll long long
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    int x[5];
    int cnt=0;
    rep(i,0,5){
        cin >> x[i];
        if(x[i]==0) cnt=i+1;
    }
    cout << cnt << endl;

}

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

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

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

    int ans = 0;
    vector<int> v;
    for(int i = 1 ; i <= n ; ++i){
        if(a[i - 1] < a[i]){
            ++ans;
        }else if(a[i - 1] > a[i]){
            auto it = lower_bound(v.begin(), v.end(), a[i]);
            if(*it != a[i]){
                ++ans;
            }
            v.resize(it - v.begin());
        }
        v.emplace_back(a[i]);
    }

    cout << ans << endl;
}


Measured memory_bytes: 4644
s = gets.to_i
n = gets.chomp
str = []
n.length.times do |a|
  str_n = n[a].ord+s
  if str_n<=90
  	str[a] = (n[a].ord+s).chr
  else
    str[a] = (64+(str_n-90)).chr
  end
end
puts str.join

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

int main() {
	string s1, s2, s3;
	cin >> s1 >> s2 >> s3;
	char c1, c2, c3;
	c1 = toupper(s1[0]);
	c2 = toupper(s2[0]);
	c3 = toupper(s3[0]);
	cout << c1 << c2 <<c3;
	return 0;
}

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

typedef complex<double> P;

#define x real()
#define y imag()

double isIntersect(P p1, P p2,P p3,P p4 ){
  return (((p1.x - p2.x)*(p3.y - p1.y)+(p1.y-p2.y)*(p1.x-p3.x))*((p1.x - p2.x)*(p4.y - p1.y)+(p1.y-p2.y)*(p1.x-p4.x)));
}

int main(){
  double xa,ya,xb,yb,xc,yc,xd,yd;
  char e;
  while( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != EOF ){

    P a(xa , ya);
    P b(xb , yb);
    P c(xc , yc);
    P d(xd , yd);

    if(isIntersect(a,c,b,d) > 0 || isIntersect(b,d,a,c) > 0){
      cout << "NO" <<endl;
    }else cout << "YES" << endl; 


}
  return 0;
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define rep11(i, n) for (int i = 1; i < (int)(n); ++i)
#define repo(i, o, n) for (int i = o; i < (int)(n); ++i)
#define repm(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1002000007
#define INF LONG_LONG_MAX

typedef pair<int, int> P;
int main(){
    long long n,k;
    cin>>n>>k;
    vector<int> v;
    vector<int> w(n-(k-1));
    rep(i,n){
        long long h;
        cin>>h;
        v.push_back(h);
    }
    sort(v.begin(),v.end());
    rep(i,n-(k-1)){
        w[i]=v[i+(k-1)]-v[i];
    }
    sort(w.begin(),w.end());
    cout<<w[0]<<endl;
}


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

//----------------------------------------------------------------------------------
#define pb insert//                                                                 |
#define eb emplace_back//                                                           |
#define ff first//                                                                  |
#define ss second//                                                                 |
typedef long long int ll;//                                                         |
typedef long double ld;//                                                           |
#define all(a) a.begin(), a.end()//                                                 |
#define show(x) cerr << #x << " is " << x << "\n"//                                 |
#define show2(x, y) cerr << #x << " " << #y << " " << x << " " << y << "\n"//       |
typedef vector<ll> vl;//                                                            |
typedef vector<vl> vvl;//                                                           |
typedef pair<ll, ll> pp;//                                                          |
typedef vector<pp> vp;//                                                            |
typedef map<pp, ll> ipi;//                                                          |
typedef map<pp, char> ipc;//                                                        |
typedef map<ll, ll> ii;//                                                           |
typedef set<ll> sl;//                                                               |
typedef multiset<ll> msl;//                                                         |
typedef map<char, ll> ci;//                                                         |
typedef set<pair<ll, ll>> sp;//                                                     |
const ll mod = 1e9 + 7;//                                                           |
const ll N = 2e5 + 1;//                                                             |
//----------------------------------------------------------------------------------


ll fast_expo(ll x, ll y){
    if(y==0) return 1;
    ll res=1;
    while(y>0){
        if(y&1){
            res*=x;
        }
        x*=x;
        y>>=1;
    }
    return res;
}


//main func
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

    ll n;cin>>n;
    ll ans=0;
    for(int i=2;i<=sqrt(n);i++){
        if(n%i==0){
            ll k=0;
            while(n%i==0){
                n/=i;
                k++;
            }
            for(int i=1;i<50;i++){
                if(((i*(i+1))/2)==k){
                    ans+=i;
                    break;
                }
                else if((i*(i+1))/2>k){
                    ans+=i-1;
                    break;
                }
            }
        }
    }
    if(n>1) ans++;
    cout<<ans<<"\n";

    
	return 0;
}

Measured memory_bytes: 3696
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

typedef long long ll;
const int INF = 1000000;

int main(){
    ll N;
    cin >> N;
    
    int ans = INF;
    for(ll A = 1; A * A <= N; A++){
        if(N % A != 0)      continue;
        
        ll a = A;
        ll b = N / a;
        int a_digit = 0, b_digit = 0;
        
        while(a > 0){
            a /= 10;
            a_digit++;
        }
        while(b > 0){
            b /= 10;
            b_digit++;
        }
        
        int temp = max(a_digit, b_digit);
        ans = min(ans, temp);
    }
    
    cout << ans << endl;
}

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

using namespace std;

int main()
{
    long long a, b, c, x, y;

    cin >> a >> b >> c >> x >> y;

    long long mx = max(x, y) * 2 * c;

    long long mn = min(x, y)*2*c;
    if(x > y)
    {
        mx = min(mx, mn + (x-y)*a);
    }

    else
    {
        mx = min(mx, mn + (y - x) * b);
    }

    mx = min(mx, a * x + b * y);

    cout << mx << endl;
    

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n;
    cin >> n;
    long long mn=1e12;
    for(long long i=1;i<=sqrt(n);i++){
        if(n%i==0){
            mn=min(mn,n/i+i-2);
        }
    }
    cout <<mn;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
string data[]={
  "",
  "',.!?",
  "abcABC",
  "defDEF",
  "ghiGHI",
  "jklJKL",
  "mnoMNO",
  "pqrsPQRS",
  "tuvTUV",
  "wxyzWXYZ"
};
int main()
{
  string s;
  for(;cin>>s;)
    {
      char out=-1;
      int old=-1;
      int cnt=-1;
      bool flag=true;
      for(int i=0;i<s.size();i++)
	{
	  int tmp=s[i]-'0';
	  if(tmp==0)
	    {
	      if(out==-1)
		{
		  out=' ';
		  continue;
		}
	      cout<<out;
	      out=' ';
	      old=-1;
	      cnt=-1;
	    }
	  else
	    {
	      if(old!=-1&&old!=tmp)
		{
		  cout<<out;
		  cnt=-1;
		}
	      cnt++;
	      if(cnt>=data[tmp].size())
		cnt=0;
	      out=data[tmp][cnt];
	      old=tmp;
	    }	
	}

      if(out!=-1)
	{
	  cout<<out;
	}
      cout<<endl;
    }

}

Measured memory_bytes: 1192
// In His Name

#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define gcd __gcd
#define int long long
#define ull unsigned long long

using namespace std;

typedef pair <int, int> pii;

const int MAX_H = 1e3 + 10 , MOD = 1e9 + 7;
int h, w, dp[MAX_H][MAX_H];
char c[MAX_H][MAX_H];

main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> h >> w;
	for (int i = 0 ; i < h ; i++){
		for (int j = 0 ; j < w ; j++){
			cin >> c[i][j];
		}
	}
	dp[0][0] = 1;
	for (int i = 1 ; i < w ; i++){
		if (c[0][i] == '#' || dp[0][i - 1] == 0){
			dp[0][i] = 0;
			continue;
		}
		dp[0][i] = 1;
	}
	for (int i = 1 ; i < h ; i++){
		if (c[i][0] == '#' || dp[i - 1][0] == 0){
			dp[i][0] = 0;
			continue;
		}
		dp[i][0] = 1;
	}
	for (int i = 1 ; i < h ; i++){
		for (int j = 1 ; j < w ; j++){
			if (c[i][j] == '#'){
				continue;
			}
			dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % MOD;
		}
	}
	cout << dp[h - 1][w - 1];
}

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

void fastio() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
}
#define int long long
#define MAX 3001
int dp[MAX][MAX];
int play(vector<int> &game, int i, int j) {
	if (i > j) return 0;
	if (i == j)
		dp[i][j] = game[i];
	else if (dp[i][j] == -1) {
		// if the current player wants to win, he can win in 2 ways
		// take i
		int sum1 = 0;
		{
			// second player take i+1
			int a = game[i] + play(game, i + 2, j);
			// second player take j
			int b = game[i] + play(game, i + 1, j - 1);
			sum1 = min(a, b);
		}
		// take j
		int sum2 = 0;
		{
			// second player takes i
			int a = game[j] + play(game, i + 1, j - 1);
			// second player takes j - 1
			int b = game[j] + play(game, i, j - 2);
			sum2 = min(a, b);
		}
		dp[i][j] = max(sum1, sum2);
	}
	return dp[i][j];
}


#undef int
int main(int argc, char const *argv[])
{
	#define int long long
	int n;
	cin >> n;
	for (int i = 0; i < MAX; ++i)
		for (int j = 0; j < MAX; ++j)
			dp[i][j] = -1;
	vector<int> game(n);
	int total = 0;
	for(int i = 0; i < n; ++i) {
		cin >> game[i];
		total += game[i];
	}
	int X = play(game, 0, n - 1);
	int Y = total - X;
	cout << X - Y << endl;
	return 0;
}

Measured memory_bytes: 70784