akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
using namespace std;
int p[10][10];
int check_digit(int G) {
	if (G < 10000) {
		int a = G / 1000, b = (G / 100) % 10, c = (G / 10) % 10, d = G % 10;
		int F = p[p[p[p[0][a]][b]][c]][d]; return F;
	}
	int a = G / 10000, b = (G / 1000) % 10, c = (G / 100) % 10, d = (G / 10) % 10, e = G % 10;
	int F = p[p[p[p[p[0][a]][b]][c]][d]][e]; return F;
}
int main() {
	int cnt = 0;
	for (int i = 0; i < 100; i++)cin >> p[i / 10][i % 10];
	for (int i = 0; i < 10000; i++) {
		string S = to_string(i); while (S.size() < 4)S = '0' + S;
		S += (char)('0' + check_digit(stoi(S)));
		bool OK = true;
		for (int j = 0; j < 5; j++) {
			for (int k = 0; k < 10; k++) {
				if (S[j] == ('0' + k))continue;
				string T = S; T[j] = '0' + k;
				if (check_digit(stoi(T)) == 0)OK = false;
			}
		}
		for (int j = 0; j < 4; j++) {
			if (S[j] == S[j + 1])continue;
			string T = S; swap(T[j], T[j + 1]);
			if (check_digit(stoi(T)) == 0)OK = false;
		}
		if (OK == false)cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 3264
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,ans=0;
	long long d,x,y;
	scanf("%d%lld",&n,&d);
	d=d*d;
	for(int i=1;i<=n;i++)
	{
		scanf("%lld%lld",&x,&y);
		if(x*x+y*y<=d) ans++;
	}
	printf("%d",ans);
}

Measured memory_bytes: 3828
import java.io.InputStream;
import java.util.Scanner;

/**
 * AtCoder Beginner Contest 055<br>
 * B - Training Camp<br>
 * <br>
 * <a href=
 * "https://atcoder.jp/contests/abc055/tasks/abc055_b">AtCoderへのリンク</a><br>
 */
public class Main {

    /**
     * エントリポイント
     */
    public static void main(String[] args) {
        // 入力
        int N = input(System.in);
        // 演算
        long power = proc(N);
        // 出力
        System.out.println(power);
    }

    /**
     * 入力値を取得
     */
    static int input(InputStream in) {
        int result = 0;
        try (Scanner sc = new Scanner(in)) {
            result = sc.nextInt();
        }
        return result;
    }

    /**
     *  演算を行う
     */
    static long proc(int N) {
        long unit = (long)(Math.pow(10, 9)) + 7;
        long power = 1;
        
        for (int i = 1; i <= N; i++) {
            power = power * i % unit;
        }
        return power;
    }
}


Measured memory_bytes: 21844
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <iomanip>
#include <map>
#include <set>
#include <tuple>
#include <unordered_map>

using namespace std;

using P = pair<int, int>;
using i64 = int64_t;
i64 mod = 1000000007;
int int_max = 2147483647;
int max_n = 1e5;


int main(int argc, char **argv) {
    int n, m;
    priority_queue<P, std::vector<P>, greater<>> p;
    priority_queue<int> q;

    cin >> n >> m;
    for (int i=0; i<n; ++i) {
        int a, b;
        cin >> a >> b;
        p.push(make_pair(a, b));
    }

    i64 ans{0};
    for (int i=1; i<m+1; ++i) {
        while (true) {
            if (p.empty()) {
                if (!q.empty())
                    ans += q.top(); q.pop();
                break;
            }
            P tp = p.top();
            if (tp.first <= i) {
                //cout << tp.first<< tp.second << endl;
                q.push(tp.second);
                p.pop();
            } else {
                if (!q.empty()) {
                    int tmp = q.top();
                    ans += tmp;
                    q.pop();
                }
                break;
            }
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1908
use std::io;

fn is_lunlun_num(target_num: i64) -> bool {
    let mut is_lunlun_num: bool = true;
    let str_num: String = target_num.to_string();
    let str_num_vec: Vec<char> = str_num.chars().collect();
    let digit_num = str_num_vec.len();
    for i in 0..(digit_num - 1) {
        let now_num = str_num_vec[i] as i64;
        let next_num = str_num_vec[i + 1] as i64;
        if (now_num - next_num).abs() > 1 {
            is_lunlun_num = false;
            break;
        }
    }
    is_lunlun_num
}

fn main() {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    let k: i64 = buf.trim().parse().unwrap();

    let mut previous_digit_lunlun_nums: Vec<i64> = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];
    let mut lunlun_num_count: i64 = 9; //これがkになったらprint

    if k <= 9 {
        println!("{}", &previous_digit_lunlun_nums[k as usize - 1]);
    } else {
        let mut now_digit_lunlun_nums: Vec<i64> = vec![]; //10,11,12,21,22,23

        loop {
            for i in &previous_digit_lunlun_nums {
                let basic_digit: i64 = i * 10; //10,20
                for f in 0..10 {
                    let now_num: i64 = basic_digit + f; //10,11,12,13
                    if is_lunlun_num(now_num) {
                        lunlun_num_count += 1;

                        if lunlun_num_count == k {
                            println!("{}", now_num);
                            return;
                        }
                        &now_digit_lunlun_nums.push(now_num);
                    }
                }
            }
            // 桁の更新
            previous_digit_lunlun_nums = now_digit_lunlun_nums.clone();
            now_digit_lunlun_nums = vec![];
        }
    }
}


Measured memory_bytes: 4352
using System;
using static System.Console;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Xml;
using System.Diagnostics;
using System.IO;
using System.Threading;

namespace ConsoleApplication1
{
    internal class Program
    {
        static readonly int MAX_N = 205;
        private static readonly int INF = 1 << 29;
        private static List<int>[] G;
        private static int[,] d;
        private static int[] color;
        
        public static void Main(string[] args)
        {
            G = new List<int>[MAX_N];
            d = new int[MAX_N, MAX_N];
            color = new int[MAX_N];
            int N = int.Parse(ReadLine());
            for (int i = 0; i < N; i++)
            {
              	G[i] = new List<int>();
                for (int j = 0; j < N; j++)
                {
                    d[i,j] = i==j ? 0 : INF;
                }
            }
            
            for (int i=0; i < N; i++)
            {
                var list = ReadLine().ToCharArray().Select(x => x - '0').ToList(); 
                for (int j = 0; j < N; j++)
                {
                    if (list[j] == 1)
                    {
                        G[i].Add(j);
                        d[i, j] = 1;
                    }
                }
            }
        
        
            //２部判定
            if (! dfs(0, 1))
            {
                WriteLine(-1);
                return;
            }
            
            // ワーシャル・フロイド法
            for(int k=0;k<N;k++)
             for(int i=0;i<N;i++)
               for (int j=0;j<N;j++)
                 d[i,j] = Math.Min(d[i,j], d[i,k] + d[k,j]);
            int ans = 0;
            for (int i=0;i<N;i++)
              for (int j=0;j<N;j++)
                ans = Math.Max(ans, d[i,j]);
            WriteLine(ans+1);
        }
        
        public static bool dfs(int node, int c)
        {
            color[node] = c;
            foreach (int v in G[node])
            {
                if (color[v] == c) return false;
                if (color[v] == 0 && !dfs(v, -c)) return false;
            }
            
            return true;
        }
    }
    
    
}

Measured memory_bytes: 13652
#include <bits/stdc++.h>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
int friendid[100000]={0};


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int l;
	l=s.size();
	int st,f,ans;
	st = 0;f= l-1;ans=0;
	while(st<f){
		if(s[st]==s[f]){
			st++;f--;
		}else if(s[st]=='x'){
			ans++;
			st++;
		}else if(s[f]=='x'){
			ans++;
			f--;
		}else{
			cout << -1 << endl;
			return 0;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 512
#include <cstdio>
#include <map>
#include <vector>
#include <algorithm>
#include <functional>

int main()
{
  int n;
  scanf("%d", &n);
  std::map<long long, long long> m;
  for (int i = 0; i < n; ++i)
  {
    int a;
    scanf("%d", &a);
    m[a]++;
  }
  std::vector<std::pair<long long, long long>> v;
  for (auto &p : m)
  {
    v.emplace_back(p);
  }
  std::sort(v.begin(), v.end(), [](auto a, auto b){ return a.first > b.first; });
  long long A[2] = {0, 0}; int index = 0;
  for (int i = 0; i < v.size();)
  {
    if (v[i].second >= 2 && v[i].first > A[index])
    {
      A[index] = v[i].first;
      v[i].second -= 2;
      if (++index == 2) break;
      continue;
    }
    ++i;
  }
  printf("%lld\n", A[0] * A[1]);
  return 0;
}


Measured memory_bytes: 8696
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
 
#pragma region 定義
#define i_cin(X) scanf("%d", &X)
#define i_cin2(X,Y) scanf("%d %d",&X,&Y)
#define i_cin4(X,Y,Z,W) scanf("%d %d %d %d",&X,&Y,&Z,&W)
#define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z)
#define l_cin(X) scanf("%ld",&X)
#define f_cin(X) scanf("%f",&X)
#define l_cin2(X,Y) scanf("%ld %ld",&X,&Y)
#define s_cin(X) scanf("%s",&X)
#define ll_cin(X) scanf("%lld", &X)
 
#define  i_cout(X) printf("%d\n",X)
#define  f_cout(X) printf("%g\n",X)
#define  i_cout2(X,Y) printf("%d %d\n",X,Y)
#define  l_cout(X) printf("%ld\n",X)
#define  s_cout(X) printf("%s\n",X)
#define  ll_cout(X) printf("%lld\n",X)
 
typedef long long  ll;
#define rept(x, s, n) for (int x = s; x < n; x++)
 
#define S_RTN(S)  s_cout(S);return 0
 
 
#define _itoa(A,N) sprintf(A, "%d", N);
 
int i_cins(int n, int* A);
int l_cins2(int n, long* A, long* B);
int s_dsort(const void* a, const void* b);
int s_asort(const void* a, const void* b);
 
int  _gcd(int a, int b);
int  _swp(int* a, int* b);
int _cknum(char* a, int n);
int _atoi(char* s, int len);
 
 
int s_asorts(const void* a, const void* b);
 
//昇順
int s_asorts(const void* a, const void* b) {
    return(strcmp((char*)a, (char*)b));
}
int s_dsort(const void* a, const void* b) {
    return(*(int*)b - *(int*)a);
}
int s_asort(const void* a, const void* b) {
    return(*(int*)a - *(int*)b);
}
int l_cins2(int n, long* a, long* b) {
    int i;
    rept(i, 0, n) {
        l_cin2(*(a + i), *(b + i));
    }
    return 0;
}
int i_cins(int n, int* a) {
    int i;
    for (i = 0; i < n; i++) {
        i_cin(*(a + i));
    }
 
    return 0;
}
int _gcd(int a, int b) {
    int r, tmp;
    if (a < b) { tmp = a; a = b; b = tmp; }
    r = a % b;
    while (r) {
        if (!r) break;
        a = b; b = r;
        r = a % b;
    }
    return(b);
}
 
long _max(long a, long b) {
    return a > b ? a : b;
}
long _min(long a, long b) {
    return a < b ? a : b;
}
int _swp(int* a, int* b)
{
    int tmp;
    tmp = *b; *b = *a; *a = tmp;
    return 0;
}

//小さい順
int compare_int(const void *a, const void *b)
{
    return *(int*)b - *(int*)a;
}





int main(){
    int X;
    int temp=0;
    i_cin(X);
    while(1){
        int cnt=0;
        rept(i,2,X+1){
            temp=X%i;
            if(temp==0){
                cnt++;
            }
        }
        if(cnt==1){
            printf("%d",X);
            return 0;
        }
        X++;
    }
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define orta ((bas+son)/2)
#define N 1000005
using namespace std;

typedef long long ll;

ll i, o, t, j, l, s, z, ans, bas, son;

ll bul(ll kac){
	ll ans = 0;
	ans += o;
	ans += kac*3;
	ans += (i - kac)/2*2;
	ans += (j - kac)/2*2;
	ans += (l - kac)/2*2;
	return ans;
}

int main() {
	// freopen("in.txt", "r", stdin);
	// freopen("out.txt", "w", stdout);
	scanf("%lld %lld %lld %lld %lld %lld %lld",&i ,&o ,&t ,&j ,&l ,&s ,&z);
	son = min(i, min(l, j));
	while(bas < son){
		if(bul(orta) < bul(orta + 1))
			bas = orta + 1;
		else
			son = orta;
	}
	printf("%lld\n", bul(orta));
	return 0;
}

Measured memory_bytes: 256
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <functional>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <cassert>
using namespace std;

#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll> 
#define VVI vector<vector<ll> >
#define REP(i,n) for(int i=0,_n=(n);(i)<(int)_n;++i)
#define RANGE(i,a,b) for(int i=(int)a,_b=(int)(b);(i)<_b;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define PRINT1(table, D0) REP(d0, D0) cout<<table[d0]<<" "; cout<<"\n";
#define PRINT2(table, D0, D1) REP(d0, D0) { REP(d1, D1) cout<<table[d0][d1]<<" "; cout<<"\n"; }
#define PRINT3(table, D0, D1, D2) REP(d0, D0) { REP(d1, D1) { REP(d2, D2) cout<<table[d0][d1][d2]<<" "; cout<<"\n"; } cout<<"\n"; }
#define UNIFORM_DOUBLE(a, b) (((b-a)*(double)rand()/RAND_MAX)+a) // [a, b) 
#define UNIFORM_LL(a, b) (ll)UNIFORM_DOUBLE(a, b) // [a, b) 
#define IN(v, lo, hi) ((lo)<=(v) && (v)<(hi))
#define DD(v) cout<<#v<<": "<<v<<endl
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const map<T0, T1>& v) { for( typename map<T0, T1>::const_iterator p = v.begin(); p!=v.end(); p++ ){os << p->first << ": " << p->second << " ";} return os; }
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const pair<T0, T1>& v) { os << v.first << ": " << v.second << " "; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << " "; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<vector<T> >& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << endl; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const set<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const deque<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }

#define MOD 1000000007LL
#define INF (1LL<<60)

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll N;
	while(cin>>N) {
		VI w(N+1);
		w[0]=2;
		w[1]=1;
		REP(i, N-1) {
			w[i+2]=w[i+1]+w[i];
		}
//		DD(w);
		
		cout<<w[N]<<endl;
	}
	
	return 0;
}


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

	using namespace std;

	#define ll long long

	const int MAXN = 210;

	int N, K;
	ll w[MAXN], v[MAXN], dp[112345];

	int main () {

		scanf("%d %d", &N, &K);

		for (int i = 0; i < N; ++i) scanf("%lld %lld", &w[i], &v[i]);

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

			for (int j = K; j >= w[i]; j--) {

				dp[j] = max ( dp[j], v[i] + dp[j - w[i]] );
			}

		}

		printf("%lld\n", dp[K]);

		return 0;
	}


Measured memory_bytes: 1024
H, W, K = map(int, input().split())

result = list()

l = list()
kk = 0
nls = list()
for hh in range(H):
    ll = input()
    s = [i+1 for i, x in enumerate(ll) if x == '#']
    ln = len(s)
    nl = list()
    if ln == 0:
        nls.append(hh)
    elif ln == 1:
        kk += 1
        nl = [kk] * W
    else:
        pre = 0
        for i, p in enumerate(s):
            kk += 1
            pp = p - (s[i-1] if i > 0 else 0)
            nl.extend([kk] * (1 if pp == 0 else pp))
            pre = p
    if len(nl) < W:
        nl.extend([kk] * (W - len(nl)))
    l.append(nl)

for i in nls:
    if i > 0 and l[i-1] not in nls:
        l[i] = l[i-1]
    else:
        for j in range(i + 1, H):
            if j in nls:
                continue
            l[i] = l[j]
            break

for h in l:
    print(' '.join(map(str, h)))

Measured memory_bytes: 7156
#include <bits/stdc++.h>
typedef long long int LL;
typedef unsigned long long int ULL;
using namespace std;

// 插入此處

int a[200005];
int ind[200005];

int main() {
    LL n, k;
    cin >> n >> k;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    memset(ind, -1, sizeof(ind));
    int cur = 1;
    ind[cur] = 0;
    vector<int> circle = { 1 };
    LL l = -1;
    LL len = -1;
    while (true) {
        int nxt = a[cur];
        if (ind[nxt] != -1) {
            l = ind[nxt];
            len = circle.size() - l;
            break;
        } else {
            ind[nxt] = circle.size();
            circle.push_back(nxt);
            cur = nxt;
        }
    }
    // for (auto i : circle) {
    //     cout << i << " ";
    // }
    // cout << endl;
    // cout << "l = " << l << endl;
    // cout << "len = " << len << endl;
    if (k <= l) {
        cout << circle[k] << endl;
    } else {
        cout << circle[l + ((k - l) % len)] << endl;
    }
}


Measured memory_bytes: 5888
import statistics

N = int(input())
A = []
B = []
for i in range(N):
    ab = list(map(int, input().split()))
    A.append(ab[0])
    B.append(ab[1])
if N % 2 == 0:
    o = int((statistics.median(B) - statistics.median(A)) * 2 + 1)
else:
    o = int(statistics.median(B) - statistics.median(A) + 1)
print(o)

Measured memory_bytes: 28720
#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<ll,ll>;

int main() {
    ll a; long double b;
    cin >> a >> b;
    cout << (ll)(a*b) << endl;
}


Measured memory_bytes: 3696
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<tuple>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define Per(i,sta,n) for(int i=n-1;i>=sta;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;

int n,m;
int dp[1010][5000];

void solve(){
    cin >> n >> m;
    int N=(1 << n);
    rep(i,m+1){
        rep(j,N){
            dp[i][j]=mod;
        }
    }
    dp[0][0]=0;
    rep(i,m){
        int a,b;
        cin >> a >> b;
        int c=0,k;
        rep(i,b) {
            cin >> k;
            c|=(1 << (k-1));
        }
        //cout << a << " " << bitset<12>(c) << endl;
        rep(j,N){
            //cout << i << " " << bitset<12>(j)  << " " << dp[i][j] << endl;
            dp[i+1][j]=min(dp[i][j],dp[i+1][j]);
            dp[i+1][j|c]=min(dp[i][j]+a,dp[i+1][j|c]);
        }
    }
    if (dp[m][N-1]==mod) cout << -1 << endl;
    else cout << dp[m][N-1] << endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(50);
    solve();
}

Measured memory_bytes: 19840
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace abc152_b
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ab = Console.ReadLine().Split(' ');
            int a = Convert.ToInt32(ab[0]);
            int b = Convert.ToInt32(ab[1]);
            string ansa = "";
            string ansb = "";


            for (int i = 0; i < b; i++)
            {
                ansa += Convert.ToString(a);
            }

            for (int i = 0; i < a; i++)
                {
                    ansb += Convert.ToString(b);
                }

            if (Convert.ToInt32(ansa.Substring(0, 1)) >= Convert.ToInt32(ansb.Substring(0, 1)))
            {
                Console.WriteLine(ansb);
            }
            else
            {
                Console.WriteLine(ansa);
            }
            Console.ReadLine();
        }
    }
}


Measured memory_bytes: 11220
import math
from copy import deepcopy
import sys
input = sys.stdin.readline

class Vec:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __str__(self):
        return '({}, {})'.format(self.x, self.y)

    def __add__(self, other):
        return Vec(self.x+other.x, self.y+other.y)

    def __sub__(self, other):
        return Vec(self.x-other.x, self.y-other.y)

    def __mul__(self, k):
        return Vec(self.x*k, self.y*k)

    def __truediv__(self, k):
        return Vec(self.x/k, self.y/k)

    def __neg__(self):
        return Vec(-self.x, -self.y)

    def __eq__(self, other):
        return self.x == other.x and self.y == other.y

    def __ne__(self, other):
        return not (self == other)

    def abs(self):
        return (self.x**2 + self.y**2)**.5

    def dot(self, other):
        return self.x*other.x + self.y*other.y

    def cross(self, other):
        return self.x*other.y - self.y*other.x

    def rot(self, ang):
        c = math.cos(ang)
        s = math.sin(ang)
        return Vec(c*self.x-s*self.y, s*self.x+c*self.y)

    def arg(self):
        return math.atan2(self.y, self.x)


def convex_hull(points, eps=1e-12):
    n = len(points)
    points.sort(key=lambda p: (p.x, p.y))
    k = 0  # # of vertices in the convex hull
    ch = [None] * (2*n)
    # bottom
    for i in range(n):
        while k > 1 and (ch[k-1]-ch[k-2]).cross(points[i]-ch[k-1]) < eps:
            k -= 1
        ch[k] = points[i]
        k += 1
    t = k
    # top
    for i in range(0, n-1)[::-1]:
        while k > t and (ch[k-1]-ch[k-2]).cross(points[i]-ch[k-1]) < eps:
            k -= 1
        ch[k] = points[i]
        k += 1
    return ch[:k-1]


N = int(input())
points = [Vec(*map(int, input().split())) for _ in range(N)]
tmp = deepcopy(points)
ch = convex_hull(tmp)
ch.sort(key=lambda v: v.arg())
ans = [0] * N
for i in range(len(ch)):
    p0 = ch[(i-1) % len(ch)]
    p1 = ch[i]
    p2 = ch[(i+1) % len(ch)]
    a = (p2 - p1).arg() - (p1 - p0).arg()
    if a < 0:
        a += 2 * math.pi
    for j in range(N):
        if p1 == points[j]:
            ans[j] = a / (2 * math.pi)
print(*ans, sep='\n')

Measured memory_bytes: 74800
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s,t;
	cin>>s>>t;
	int x=s.size(),y=t.size();
    sort(s.begin(),s.end());
    sort(t.begin(),t.end());
	reverse(t.begin(),t.end());
    if(s<t)cout<<"Yes"<<endl;
    else cout << "No" << endl;
	return 0;
}

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

int main(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if((c-a<=d&&a-c<=d)||((b-a<=d&&a-b<=d)&&(c-b<=d&&b-c<=d))){
        cout<<"Yes";
    }else{
        cout<<"No";
    }
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
typedef long long int ll;
using namespace std;
#define P 1000000007
#define rep(i,n) for(i=0;i<n;++i)
#define repp(i,a,n) for(i=a;i<n;++i)
#define repr(i,a,n) for(i=a;i>n;--i)

ll binpowmod(ll a, ll b, ll m) {
    a %= m;
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}

ll binpow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

ll modInverse(ll n, ll p)
{
    return binpowmod(n, p-2, p);
}

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t,n,i,max=0;
    cin >> n ;
    string a[n];
    map<string,ll> s;
    rep(i,n)
    {
        cin >> a[i];
        if(s.find(a[i])!=s.end())
        {
            s.find(a[i])->second++;
        }
        else s.insert(pair<string,ll>(a[i],1));
    }
    map<string,ll>::iterator itr;
    for(itr=s.begin();itr!=s.end();++itr)
    {
        if(itr->second>max) max=itr->second;
    }
    for(itr=s.begin();itr!=s.end();++itr)
    {
        if(itr->second==max)
        {
            cout << itr->first << endl ;
        }
    }
	return 0;
}

Measured memory_bytes: 25472
/****************************
/////  Shubham Singhal
/////  LNMIIT
*****************************/
#include <bits/stdc++.h>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define eb emplace_back
#define lwr lower_bound
#define upr upper_bound
#define pq priority_queue
#define umap unordered_mp1
#define rep(i,n) for(i=0; i<n;i++)
#define repp(i,a,n) for(i=a; i<n;i++)
#define precise(x) cout<<fixed<<setprecision(x)
#define lcm(a,b) (a*b)/__gcd(a,b)
#define prn(x) cout<<x<<"\n"
#define prn2(x, y) cout<<x<<" "<<y<<"\n"
#define prn3(x, y, z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define prn4(x, y, z, a) cout<<x<<" "<<y<<" "<<z<<" "<<a<<"\n"
#define prnv(x) for(auto i:x) cout<<i<<" "; cout<<"\n"
#define MOD 1000000007
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd; 
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<pil> vpil;
typedef vector<pli> vpli;
typedef vector<pll> vpll;
const long long INF64 = 1'000'000'000'000'000'000ll;
void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
}
int main()
{
    ll a,b;
    cin>>a>>b;
    if(b%a==0)
        cout<<b+a;
    else
        cout<<b-a;
    
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<iostream>
#include <fstream>
#include<iostream>
#include <sstream>
#include<string>
#include <list>

using namespace std;
const int M = 1003;
const int INIT = (M*M + 1);
int C[M][M];// = { 0 };

int countmatchstring(const char* p1, const char*p2, int length1, int length2,int x, int y, int i, int j,int cost)
{
	int w = (i - 1 > j - 1) ? i - 1 : j - 1;
	if (p1[x + i] == p2[y + j])
	{
		x = x + i;
		y = y + j;
		if (x == length1 - 1 && y == length2 - 1)
		{
			C[x][y] = 0;
			return w;
		}
		if (x == length1 - 1 || y == length2 - 1)
		{
			while (1);
		}
		C[x][y] = countmatchstring(p1, p2, length1, length2, x, y, 1, 1, w + cost);
		return w + C[x][y];

	}
	if (C[x + i][y + j] == INIT)
	{
		int c1 = INIT, c2 = INIT,c3 = INIT;
		if (x + i + 1 < length1)
		{
			for (int p = 1; x + i + p < length1; ++p)
			{
				if (p1[x + i + p] == p2[y + j])
				{
					c1 = countmatchstring(p1, p2, length1, length2, x, y, i + p, j, cost);
					break;
				}
			}
		}
		if (y + j + 1 < length2)
		{
			for (int q = 1; y + j + q < length2; ++q)
			{
				if (p1[x + i] == p2[y + j + q])
				{
					c2 = countmatchstring(p1, p2, length1, length2, x, y, i, j + q, cost);
					break;
				}
			}
		}
		if ((x + i + 1 < length1) && (y + j + 1 < length2))
		{
			c3 = countmatchstring(p1, p2, length1, length2, x, y, i + 1, j + 1, cost);
		}
		int c = (c1 < c2 ? c1 : c2);
		c = (c < c3 ? c : c3);
		C[x + i][y + j] = c;
	}
	return C[x + i][y + j];
}

int main(){
	std::istream & c_in = cin;
	for (int i = 0; i < M; ++i){
		for (int j = 0; j < M; ++j){
			C[i][j] = INIT;
		}
	}
	string s1, s2;
	getline(c_in, s1);
	getline(c_in, s2);
	s1 = "A" + s1 + "B";
	s2 = "A" + s2 + "B";
	const char* p1 = s1.c_str();
	const char* p2 = s2.c_str();
	countmatchstring(p1, p2, s1.length(), s2.length(),0, 0, 1,1,0);
	printf("%d\n", C[1][1]);
	return 0;
}

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

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

int main(){
    int n; cin >> n;
    vector<vector<int>> d(n,vector<int>(3));
    rep(i,n){
        rep(j,2){
            cin >> d[i][j];
        }
        if(d[i][0] == d[i][1]) d[i][2] = 1;
        else d[i][2] = 0;
    }
    string ans = "No";
    int count = 0;
    rep(i,n){
        if(d[i][2]){
            count ++;
            if(count == 3){
                ans = "Yes";
                break;
            }
        }
        else count = 0;
    }
    cout << ans << endl;
}

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


int main()
{
    string s;
    char s_[50001] = {0};
    cin >> s;
    int j = 0;
    for (int i = 0; i < s.size(); i += 2)
    {
        s_[j++] = s[i];
    }
    cout << s_ << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define forr(i, a, b) for(int i = (a); i < (int) (b); i++)
#define forn(i, n) forr(i, 0, n)
#define dforr(i, a, b) for(int i = (int)(b-1); i >= (a); i--)
#define dforn(i, n) dforr(i, 0, n)
#define db(v) cerr << #v << " = " << v << endl
#define pb push_back
#define sz(x) ((int)x.size())
#define fst first
#define snd second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
const int MAXN = 300500;

int n, t;
ll L;
int Z[MAXN], O[MAXN];

void addme(string &S){
    int p = 0;
    for(char c : S){
        if(c == '0' && Z[p] == -1) Z[p] = t++;
        if(c == '1' && O[p] == -1) O[p] = t++;
        p = (c == '0' ? Z[p] : O[p]);
    }
}

vector<ll> T;

int dist[MAXN];
void bfs(int src){
    queue<int> Q;
    Q.push(src); dist[src] = 0;
    while(sz(Q)){
        int p = Q.front(); Q.pop();
        if(((Z[p] > -1)^(O[p] > -1))) T.pb(L-dist[p]);
        if(Z[p] > -1){
            dist[Z[p]] = dist[p]+1;
            Q.push(Z[p]);
        }
        if(O[p] > -1){
            dist[O[p]] = dist[p]+1;
            Q.push(O[p]);
        }
    }
}


//void dfs(int p, int d){
//    if(((Z[p] > -1)^(O[p] > -1))) T.pb(L-d);
//
//    if(Z[p] > -1){
////        printf("Voy de %d a %d por 0\n", p, Z[p]);
//        dfs(Z[p], d+1);
//    }
//    if(O[p] > -1){
////        printf("Voy de %d a %d por 1\n", p, O[p]);
//        dfs(O[p], d+1);
//    }
//}

ll grundy(ll n){
    assert(n);
    ll ans = 1;
    while(n%2 == 0)ans <<= 1, n >>= 1;
    return ans;
}

int main(){
//	freopen("input.txt", "r", stdin);
	ios :: sync_with_stdio(false);
	while(cin >> n >> L){
        t = 1; forn(i, MAXN)Z[i] = O[i] = -1;
        T.clear();

        forn(i, n){
            string S; cin >> S;
            addme(S);
        }
//        ll xxx = 0;
//        dfs(0, 0);
        bfs(0);
//        printf("Arboles restantes:\n");
//        for(ll t : T)printf("%lld ", t); puts("");
        ll xxx = 0;
        for(ll t : T)xxx ^= grundy(t);
        cout << (xxx ? "Alice" : "Bob") << endl;
	}
	return 0;
}


Measured memory_bytes: 4080
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt();
		DSU set = new DSU(n);
		
		for(int i = 0; i < m; i++) {
			set.union(sc.nextInt() - 1, sc.nextInt() - 1);
			sc.nextInt();
		}
		
		System.out.println(set.getSets());
	}
	
	public static class DSU {
		
		public int sets;
		public int[] parent, rank, setSize;
		
		public DSU(int size) {
			this.parent = new int[size];
			this.rank = new int[size];
			this.setSize = new int[size];
			
			this.sets = size;
			
			for(int i = 0; i < this.parent.length; i++) {
				this.parent[i] = i;
				setSize[i] = 1;
			}
		}
		
		public int findSet(int i) {
			return parent[i] == i ? i : (parent[i] = findSet(parent[i]));
		}
		
		public boolean isSameSet(int i, int j) {
			return findSet(i) == findSet(j);
		}
		
		public void union(int i, int j) {
			int x = findSet(i);
			int y = findSet(j);
			
			if(x == y)
				return;
			
			if(rank[x] > rank[y]) {
				parent[y] = x;
				setSize[x] += setSize[y];
			}
			else {
				parent[x] = y;
				
				if(rank[x] == rank[y])
					rank[y]++;
				
				setSize[y] += setSize[x];
			}
			
			sets--;
		}
		
		public int getSets() {
			return this.sets;
		}
		
		public int sizeOfSet(int i) {
			return this.setSize[this.findSet(i)];
		}
		
	}
}


Measured memory_bytes: 92996
#define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define rep(i,n) for(int i=0;i<(lint)(n);i++)
#define REP(i,n) for(int i=1;i<=(lint)(n);i++)
#define all(V) V.begin(),V.end()
#define stackReplaceBegin(size)\
	void* p=malloc(size);\
	esp_new=(lint)p+size-1;\
	void * stack_extend_memory_ = malloc(size);\
	void * stack_extend_origin_memory_;\
	char * stack_extend_dummy_memory_ = (char*)alloca((1+(int)(((long long)stack_extend_memory_)&127))*16);\
	*stack_extend_dummy_memory_ = 0;\
	asm volatile("mov %%rsp, %%rbx\nmov %%rax, %%rsp":"=b"(stack_extend_origin_memory_):"a"((char*)stack_extend_memory_+(size)-1024));
typedef long long lint;
typedef unsigned long long ulint;
typedef std::pair<lint, lint> P;
constexpr int INF = INT_MAX/2;
constexpr lint LINF = LLONG_MAX/2;
constexpr double eps = DBL_EPSILON;
constexpr double PI=3.141592653589793238462643383279;
lint esp_new;
template<class T>
class prique :public std::priority_queue<T, std::vector<T>, std::greater<T>> {};
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
	if (lhs < rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
	if (lhs > rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
inline lint gcd(lint a, lint b) {
	while (b) {
		lint c = a;
		a = b; b = c % b;
	}
	return a;
}
inline lint lcm(lint a, lint b) {
	return a / gcd(a, b) * b;
}
bool isprime(lint n) {
	if (n == 1)return false;
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0)return false;
	}
	return true;
}
template<typename T>
T mypow(T a, unsigned int b) {
	if (!b)return T(1);
	if (b & 1)return mypow(a, b - 1) * a;
	T memo = mypow(a, b >> 1);
	return memo * memo;
}
lint modpow(lint a, lint b, lint m) {
	if (!b)return 1;
	if (b & 1)return modpow(a, b - 1, m) * a % m;
	lint memo = modpow(a, b >> 1, m);
	return memo * memo % m;
}
template<typename T>
void printArray(std::vector<T>& vec) {
	rep(i, vec.size() - 1)std::cout << vec[i] << " ";
	std::cout << vec.back() << std::endl;
}
template<typename T>
void printArray(T l, T r) {
	T rprev = r;
	rprev--;
	for (T i = l; i != rprev; i++) {
		std::cout << *i << " ";
	}
	std::cout << *rprev << std::endl;
}
int n,q,a[100010];
std::map<int,int> mp;
int main(){
	std::cin>>n;
	lint sum=0;
	rep(i,n){
		std::cin>>a[i];
		mp[a[i]]++;
		sum+=a[i];
	}
	std::cin>>q;
	rep(i,q){
		lint b,c;
		std::cin>>b>>c;
		sum-=b*mp[b];
		sum+=c*mp[b];
		mp[c]+=mp[b];
		mp[b]=0;
		std::cout<<sum<<std::endl;
	}
	return 0;
}


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

using namespace std;
using ll = long long;

int gcd(int a, int b, int& x, int& y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    int x1, y1;
    int d = gcd(b, a % b, x1, y1);
    x = y1;
    y = x1 - y1 * (a / b);
    return d;
}

vector<long long> trial_division1(long long n) {
    vector<long long> factorization;
    for (long long d = 2; d * d <= n; d++) {
        while (n % d == 0) {
            factorization.push_back(d);
            n /= d;
        }
    }
    if (n > 1)
        factorization.push_back(n);
    return factorization;
}

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

	int n;
	cin >> n;

	ll cnt = 0;
	for(int a = 1;a < n;a++){
		for(int b = 1;b < n;b++){
			ll res = n - a*b;
			if (res > 0)
				cnt++;
			else
				break;
		}
	}
	cout << cnt << "\n";

	return 0;
}


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

typedef long long ll;
typedef pair<int,int> pii;

long long MOD = 1000000000 + 7;
long long MAX = 1000000000000000000;

int main(){
  int N;
  cin >> N;
  map<ll,int> stock;
  for(int i =0; i < N; i++){
    ll tmp;
    cin >> tmp;
    stock[tmp]++;
  }
  int M;
  cin >> M;
  map<ll,int> need;

  for(int i = 0; i < M; i++){
    ll tmp;
    cin >> tmp;
    need[tmp]++;
  }
  
  bool flg = true;
  for(auto x: need){
    // stock に x.firstがx.second以上あればOK
    if(stock.count(x.first) == 0){
      flg = false;
      break;
    } else {
      if(x.second <= stock[x.first]){
        continue;
      } else {
        flg = false;
        break;
      }
    }
  }
  cout << (flg ? "YES" : "NO") << endl;
}



Measured memory_bytes: 25216
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define loop(i,n) for(int i = 0;i < (n);i++)
#define range(i,a,b) for(int i = (a);i <= (b);i++)
#define all(A) A.begin(),A.end()
#define pb push_back
#define mp make_pair
#define sz(A) ((int)A.size())
#define vi vector<int>
#define vl vector<long long>
#define vd vector<double>
#define vp vector<pair<int,int> >
#define ll long long
#define pi pair<int,int>
#define popcnt(x) __builtin_popcountll(x)
#define LSOne(x) ((x) & (-(x)))
#define xx first
#define yy second
#define PQ priority_queue
#define print(A,t) cerr << #A << ": "; copy(all(A),ostream_iterator<t>(cerr," " )); cerr << endl
#define prp(p) cerr << "(" << (p).first << " ," << (p).second << ")";
#define prArr(A,n,t)  cerr << #A << ": "; copy(A,A + n,ostream_iterator<t>(cerr," " )); cerr << endl
#define PRESTDIO() cin.tie(0),cerr.tie(0),ios_base::sync_with_stdio(0)
#define what_is(x) cerr << #x << " is " << x << endl
#define bit_lg(x) (assert(x > 0),__builtin_ffsll(x) - 1)
const double PI = acos(-1);
using namespace std;


int N,Q;
ll cnt,pref,len;
vl L;
ll BIT[1 << 20];
unordered_map<ll,unordered_map<int,ll > > dp;

void add(int pos,ll val) {
	for(;pos <= N;pos += LSOne(pos)) BIT[pos] += val;
}

ll get(int pos) {
	ll ret = 0;
	for(;pos;pos ^= LSOne(pos)) ret += BIT[pos];
	return ret;
}

unordered_map<int,ll> solve(ll len) {
	if(len == 0) return unordered_map<int,ll>();
	if(dp.find(len) != dp.end()) return dp[len];
	auto p = lower_bound(all(L),len) - L.begin();
	assert(p > 0);
	--p;
	unordered_map<int,ll> ret;
	if(p != 0) {
		ret = solve(len%L[p]);
		ret[-p] += len/L[p];
	}
	else ret[len] = 1;
	dp[len] = ret;
	return ret;
}


void recon(ll len,ll coef) {
	map<ll,ll> M;
	M[len] = 1;
	while(!M.empty()){
		len = M.rbegin()->xx;
		coef = M[len];
		M.erase(len);
		for(auto p : solve(len))
			if(p.xx < 0)
				M[L[-p.xx]] += coef*p.yy;
			else {
				add(1,coef*p.yy);
				add(p.xx+1,-coef*p.yy);
			}
	}
}
int main(){
	#ifdef HOME
		freopen("in.in", "r", stdin);
	#endif
	scanf("%d %d",&N,&Q);
	L.pb(0);
	L.pb(N);
	while(Q--) {
		ll q; scanf("%lld",&q);
		while(!L.empty() && L.back() >= q) L.pop_back();
		L.pb(q);
	}

	ll len = L.back();
	recon(len,1);
	range(i,1,N) printf("%lld\n",get(i));
	return 0;
}


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

typedef long long ll;
const int maxn=2e5+10;
ll n,f,x[maxn],ans;
ll sum[maxn];

int main(){
	cin>>n>>f;
	for(int i=1;i<=n;++i){
		cin>>x[i];
		sum[i]=sum[i-1]+x[i];
	}
	ans=1e18;
	for(int i=1;i<=n;++i){
		ll res=f*(n+i)+(sum[n]-sum[n-i])*5;
		for(int j=n-i,k=5;j>0&&res<ans;j-=i,k+=2)
			res+=(sum[j]-sum[max(0,j-i)])*k;
		ans=min(ans,res);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3328
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <cstring>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;


#define ld long double
#define F first
#define S second
//
#define int long long
#define ll long long
#define db(x)                cerr<<#x<<": "<<x<<endl
#define db2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define db3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define db4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define db5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define db6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
//
#define mem(x,y) memset(x,y,sizeof(x))
#define bitcount    __builtin_popcount
//
#define pii pair<int, int>
#define all(v) v.begin(),v.end()
//
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)
#define vi vector<int>
#define vvi vector< vector<int> >
#define si set<int>
#define pb push_back
#define lp(i,a,b) for(int i=a;i<b;i++)
#define rloop(i,a,b) for(int i=a;i>=b;i--)
#define mk make_pair
const int N=50;
const int mod=1e9+7;
const int mod1=998244353;
const int inf=1e16+7;
using namespace std;

void solve(){
    int n;
    cin>>n;
    bool f=0;
    while(n){
        if(n%10==7) f=1;
        n/=10;
    }
    if(f) cout<<"Yes";
    else cout<<"No";
   
}


int32_t main() {
    IOS;
    int t;
//    cin>>t;
    t=1;
    for(int i=1;i<=t;i++){
        solve();
       // cout<<endl;
    }
   
}

















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

using namespace std;

int N, K;
vector<vector<int> > BookInfo;
int DpMoney[10][2001];

int solve(int curSum, int genreId) {
	int sizeOfBook, curTotalMoney, res;

	if (curSum == K || genreId > 9) {
		return 0;
	}

	if (DpMoney[genreId][curSum] != -1) {
		return DpMoney[genreId][curSum];
	}

	res = 0;
	res = solve(curSum, genreId + 1);
	
	curTotalMoney = 0;
	sizeOfBook = min((int)BookInfo[genreId].size(), K - curSum);
	for (int i = 1; i <= sizeOfBook; ++i) {
		curTotalMoney += BookInfo[genreId][i - 1];
		res = max(res, solve(curSum + i, genreId + 1) + curTotalMoney + i*(i - 1));
	}

	return DpMoney[genreId][curSum] = res;
}

int main() {
	int c, g;

	fill(DpMoney[0], DpMoney[0] + 10 * 2001, -1);
	BookInfo.resize(10);
	for (int i = 0; i < 10; ++i) {
		BookInfo[i].clear();
	}
	cin >> N >> K;
	for (int i = 0; i < N; ++i) {
		cin >> c >> g;
		BookInfo[g - 1].push_back(c);
	}
	for (int i = 0; i < 10; ++i) {
		sort(BookInfo[i].begin(), BookInfo[i].end(), greater<int>());
	}
	cout << solve(0, 0) << endl;

	return 0;
}


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

int main(){
	int a,b,c;
    cin >> a >> b >> c;
    int s = (a+b+c)/2;
    if((a==s||b==s||c==s)&&2*s==a+b+c)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
}


Measured memory_bytes: 384
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <limits.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define FOR(i,a,n) for(i=(a);i<(n);i++)
int comp(const void* a,const void* b){
	return *(int*)b-*(int*)a;
}
void fill(int a[],int b,int c){
	int i;
	FOR(i,0,b) a[i]=c;
	return;
}
int a[100000];
int t[2];
int main(void)
{
	int n,cnt=0,i;
	scanf("%d",&n);
	FOR(i,0,n) scanf("%d",&a[i]);
	qsort(a,n,sizeof(int),comp);
	FOR(i,0,n-1){
		if(a[i]==a[i+1]) t[cnt++]=a[i],i++;
		if(cnt==2) break;
	}
	if(cnt<2) puts("0");
	else printf("%lld\n",(ll)t[0]*t[1]);
	return 0;
}


Measured memory_bytes: 892
#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;
const int N = 1000005;
int n; long long k, ans;
int a[N], f[N];
bool ck(long long x)
{
	long long res = 0;
	for(int i = 1; i <= n; i++)
	{
		long long y = x / f[n-i+1];
		if(a[i] > y) res += a[i] - y;
	}
	return res <= k;
}
int main()
{
	cin >> n >> k;
	for(int i = 1; i <= n; i++) cin >> a[i];
	for(int i = 1; i <= n; i++) cin >> f[i];
	sort(a+1,a+n+1);
	sort(f+1,f+n+1);
	long long l = 0, r = 1e13, ans = 0, mid = 0;
	while(l <= r)
	{
		mid = (l+r)>>1;
		if(ck(mid)) ans = mid, r = mid-1;
		else l = mid+1;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 5120
#include <stdio.h>
#include <math.h>

int main(void)
{
    char S[128];
    scanf("%s",&S);
    int cnt[26];
    for(int i=0;i<26;i++) cnt[i] = 0;
    for(int i=0;i<4;i++) cnt[S[i] - 'A']++;
    for(int i=0;i<26;i++)
    {
        if (cnt[i] != 0 && cnt[i] != 2)
        {
            puts("No");
            return 0;
        }
    }
    puts("Yes");
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint ungigned
#define db double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pli pair<ll,int>
#define vi vector<int>
#define vpi vector<pii >
#define IT iterator
 
#define PB push_back
#define MK make_pair
#define LB lower_bound
#define UB upper_bound
#define y1 wzpakking 
#define fi first
#define se second
#define BG begin
#define ED end
 
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define UPD(x,y) (((x)+=(y))>=mo?(x)-=mo:233)
#define CLR(a,v) memset(a,v,sizeof(a))
#define CPY(a,b) memcpy(a,b,sizeof(a))
#define sqr(x) (1ll*x*x)
 
#define LS3 k*2,l,mid
#define RS3 k*2+1,mid+1,r
#define LS5 k*2,l,mid,x,y
#define RS5 k*2+1,mid+1,r,x,y
#define GET pushdown(k);int mid=(l+r)/2
#define INF (1ll<<60)
using namespace std;

const int mo=1000000007;
int power(int x,ll y){
	int s=1;
	for (;y;y/=2,x=1ll*x*x%mo)
		if (y&1) s=1ll*s*x%mo;
	return s;
}
const int N=105;
int a[N],mn[N][N];
int fxor[N][N];
int tr[N][N];
int mx[N],g[N],n;
int main(){
	scanf("%d",&n); n++;
	For(i,2,n) scanf("%d",&a[i]);
	a[0]=a[1]=a[n+1]=a[n+2]=1;
	For(i,0,n+2) mn[i][i]=i;
	For(l,0,n+2) For(r,l+1,n+2)
		mn[l][r]=(a[r]<a[mn[l][r-1]]?r:mn[l][r-1]);
	For(i,1,n+2) fxor[i][i-1]=1;
	Rep(l,n+2,1) For(r,l,n+2){
		if (a[l]<a[l-1]||a[r]<a[r+1]) continue;
		int dn=max(a[l-1],a[r+1]),md=mn[l][r];
		if (a[md]>=dn) fxor[l][r]=1ll*power(2,a[md]-dn)*fxor[l][md-1]%mo*fxor[md+1][r]%mo;
	}
	for (int l=n+1;l>=1;l--)
		for (int r=l;r<=n+1;r++){
			for (int k=l-1;k<=r+1;k++) mx[k]=0;
			int tmp=a[l-1];
			for (int k=l;k<=r;k++)
				mx[k]=tmp=min(tmp,a[k]);
			tmp=a[r+1];
			for (int k=r;k>=l;k--)
				mx[k]=max(mx[k],tmp=min(tmp,a[k]));
			int las=l-1; tr[l][r]=1;
			for (int k=l;k<=r+1;k++)
				if (mx[k]>=a[k]||k==r+1) tr[l][r]=1ll*tr[l][r]*fxor[las+1][k-1]%mo,las=k;
		}
	g[1]=1;
	For(i,2,n+2) For(j,1,i-1)
		UPD(g[i],1ll*g[j]*tr[j][i-1]%mo);
	printf("%d\n",1ll*g[n+2]*500000004ll%mo);
}

Measured memory_bytes: 384
#include <stdio.h>
 
int main()
{
    int S,h,m,s;
    scanf("%d",&S);
h=S/3600;
s=S%3600;
m=s/60;
    s=s%60;
 
    printf("%d:%d:%d\n",h,m,s);
    return 0;
}



Measured memory_bytes: 2120
#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include<cstring>
#include<map>
#include<set>
#include<cstdlib>
#include<bitset> 
using namespace std;
typedef long long ll;
int main(void)
{
	ll n;
	scanf("%lld",&n);
	n=n%1000;
	if(n==0) printf("0");
	else printf("%lld",1000-n);
}

Measured memory_bytes: 3804
list = input().split()
stack = []
for i in list:
    if i == '+':
        x = stack.pop()
        y = stack.pop()
        stack.append(y+x)
    elif i == '-':
        x = stack.pop()
        y = stack.pop()
        stack.append(y-x)
    elif i == '*':
        x = stack.pop()
        y = stack.pop()
        stack.append(y*x)
    else:
        stack.append(int(i))
print(stack[0])



Measured memory_bytes: 5600