akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    #define FAST ios_base::sync_with_stdio(false);cin.tie(0);
    const double EPS = 1e-9;
    const double PI = acos(-1);
    const int knightDir[8][2] = {{-2,-1},{-2,1},{-1,2},{1,2},{2,-1},{2,1},{-1,-2},{1,-2}};
    //const int dx[]={0,0,0,1,1,1,-1,-1,-1};
    //const int dy[]={-1,0,1,-1,0,1,-1,0,1};
    const int dx[] = {0 , 1 , 0 , -1};
    const int dy[] = {1 , 0 , -1 , 0};
    //#define MOD         1000000007LL
    #define MAX         1000005
    const ll MOD = 1000000000 + 7;
    int arr[MAX] , n ;
    int fact[MAX];
    
    bool pairwise()
    {
        
        for(int i = 0 ; i < n ; i++)
        {
            int x = arr[i];
            for(int j = 1 ; j * j <= x ; j++)
            {
                if(x % j == 0)
                {
                    fact[j]++;
                    if(j > 1 && fact[j] >= 2)return false;
                    if(x / j != j)
                    {
                        fact[x / j]++;
                        if(fact[x / j] >= 2)return false;
                    }
                }
            }
        }
        
        return true;
    }
    
    bool setwise()
    {
        int ans = arr[0];
        
        for(int i = 1 ; i < n ; i++)
        {
            ans = __gcd(ans , arr[i]);
            
        }
        if(ans != 1)return false;
        return true;
    }
    
    int main()
    {
        FAST
        int t;
        t = 1;

        while(t--)
        {
           
           cin >> n;
           
           for(int i = 0 ;  i < n ; i++)cin >> arr[i];
        
           if(pairwise())cout << "pairwise coprime\n";
           else if(setwise())cout << "setwise coprime\n";
           else cout << "not coprime\n";
        }
    }



Measured memory_bytes: 7824
a,b = list(map(int,input().split()))
def func(num):
    m = 0
    if num%2 == 0:
        if num%4 == 0:
            m = 1
        return num^m
    else:
        if (num-1)%4 == 0:
            m = 1
        return m^1
print(func(a-1)^func(b))

Measured memory_bytes: 3060
#include <iostream>
using namespace std;
int main(){
	bool p[50000];
	p[1]=false;
	for(int i=2;i<50000;i++){
		p[i]=true;
	}
	for(int j=2;j<50000;j++){
		if(p[j]){
			for(int k=j*2;k<50000;k+=j){
				p[k]=false;
			}
		}
	}
	int n;
	while(cin>>n){
		if(n==0) break;
		int count=0;
		if(p[n-2]) count++;
		for(int l=3;l<=n/2;l+=2){
			if(p[l] &&  p[n-l]) count++;
		}
		cout<<count<<endl;
	}
	return 0;
}

Measured memory_bytes: 1208
import sys
from operator import itemgetter #sortedの対象を決めたい
from fractions import gcd #最大公約数求めたい
from math import ceil, floor, sqrt #小数点切り上げ、切り捨て、平方根求めたい
from copy import deepcopy #参照で影響されないコピーが作られる
from collections import Counter, deque #要素ごとの出現回数を数える。双方向アクセス可能データ型
import heapq
from functools import reduce
sys.setrecursionlimit(200000)

input = sys.stdin.readline
# template


n = int(input())

v = list(map(int, input().split()))

v.sort()

ans = (v[0] + v[1])/2

for i in range(2, n):
    ans = (ans + v[i])/2

print(ans)


Measured memory_bytes: 5048
n = int(input())
l = list(map(int, input().split()))

mae = l[0]
ans = 0
kari = 0
for i in range(1, n):
    if mae >= l[i]:
        kari += 1
        mae = l[i]
    else:
        ans = max(ans, kari)
        kari = 0
        mae = l[i]

    if i == n-1:
        ans = max(ans, kari)

print(ans)

Measured memory_bytes: 14252
# -*- coding: utf-8 -*-

import sys
import numpy as np

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

def bisearch_min(mn, mx, func):
    """ 条件を満たす最小値を見つける二分探索 """

    ok = mx
    ng = mn
    while ng+1 < ok:
        mid = (ok+ng) // 2
        if func(mid):
            # 下を探しに行く
            ok = mid
        else:
            # 上を探しに行く
            ng = mid
    return ok

N, K = MAP()
A = LIST()

def check(omit):
    # 部分和DP
    dp = np.zeros((N+1, K), dtype=np.bool)
    dp[0,0] = 1
    for i in range(N):
        # まとめて遷移
        dp[i+1] = np.logical_or(dp[i+1], dp[i])
        if i != omit and A[i] < K:
            dp[i+1,A[i]:] = np.logical_or(dp[i+1,A[i]:], dp[i,:K-A[i]])
    # 今回の値A[omit]を足してKに到達できるような部分和があれば、これは必要
    for j in range(max(0, K-A[omit]), K):
        if dp[N,j]:
            return True
    # なければ不要
    return False

A.sort()
print(bisearch_min(-1, N, check))


Measured memory_bytes: 37004
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
using ll = long long;
const ll INF = 1e08;
const int mod = 998244353;
   
int main(){
  int n, m, x; cin >> n >> m >> x;
  vector<int> c(n);
  vector<vector<int>> a(n, vector<int>(m));
  rep(i, n){
    cin >> c[i];
    rep(j, m) cin >> a[i][j];
  }
  
  int ans = INF;
  for(int bit = 0 ; bit < ( 1 << n ); bit++){
    vector<int> algo(m);
    int cost = 0;
    bool can = true;
    rep(i, n){
    	if(bit & (1 << i)){
      		cost += c[i];
      		rep(j, m) algo[j] += a[i][j];
    		}
    }
    	rep(j, m) if(algo[j] < x) can = false;
    	if(can) ans = min(ans, cost);
  }

  if(ans != INF) cout << ans << endl;
  else cout << -1 << endl;
  
  return 0;
}

Measured memory_bytes: 3552
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;

void trace(int64_t A[], int64_t N) {
	for (int64_t i = 0; i < N; i++) {
		if (i > 0) std::cout << " ";
		std::cout << A[i];
	}
	std::cout << std::endl;
}

void insertionSort(int64_t A[], int64_t N) {
	for (int64_t i = 1; i < N; i++) {
		int64_t v = A[i];
		int64_t j = i - 1;
		while (j >= 0 && A[j] > v) {
			A[j + 1] = A[j];
			j--;
		}
		A[j + 1] = v;
		trace(A, N);
	}
}

void solve()
{
	int64_t N;
	int64_t A[100];
	std::cin >> N;
	for (int64_t i = 0; i < N; i++) {
		std::cin >> A[i];
	}

	trace(A, N);
	insertionSort(A, N);

}

int main()
{
	std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	solve();
}



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

struct data{
     int year , id , prefecture ;
     data(int year , int id , int prefecture) : year(year) , id(id) , prefecture(prefecture) {}
     bool operator < (const data &d) const {
         return year < d.year ;
     }
};

string get(int n){

     string ret = "000000" ;
     int i = ret.size() - 1 ;
     while(n){
          int c = n % 10 ;
          ret[i] = char('0' + c);
          i-- ;
          n /= 10 ;
     }
     return ret ;
}

int main(){

    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0) ;

    int n , m  ;
    cin >> n >> m ;

    vector < data > ve ;

    for(int i = 0 ; i < m ; i++){
           int p , y ;
           cin >> p >> y ;
           ve.push_back(data(y , i , p)) ;
    }

    sort(ve.begin() , ve.end()) ;


    vector < string > res(m);

    map < int , int > cnt ;

    for(int i = 0 ; i < ve.size() ; i++){
          string s1 = get(++cnt[ve[i].prefecture]) ;
          string s2 = get(ve[i].prefecture) ;
          res[ve[i].id] = s2 + s1 ;
    }


    for(int i = 0 ; i < m ; i++){
         cout << res[i] << endl ;
    }

    return 0;
}


Measured memory_bytes: 12788
/**
 *   @author: pr4shan7 (प्रशांत)
 */
#include <bits/stdc++.h>
using namespace std;

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

    string s;
    cin >> s;
    bool b = true;
    for (int i = 0; i < s.length(); i++) {
        if ((i & 1) and s[i] == 'R')
            b = false;
        else if (!(i & 1) and s[i] == 'L')
            b = false;
    }
    if (b)
        cout << "Yes" << '\n';
    else
        cout << "No" << '\n';
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
typedef long long LL;
const int N=10005,md=1e9+7;
int n,a,b,c,fac[N],iv[N],_[N],ans;
inline int pow(int a,int b){
	int ret=1;
	for(;b;b>>=1,a=(LL)a*a%md)if(b&1)ret=(LL)ret*a%md;
	return ret;
}
inline int C(int n,int m){return n>=m?(LL)fac[n]*iv[m]%md*iv[n-m]%md:0;}
int main(){
	scanf("%d%d%d%d",&n,&a,&b,&c);
	if(b&1){puts("0");return 0;}b>>=1;
	for(int i=*fac=1;i<=n*2;++i)fac[i]=(LL)fac[i-1]*i%md;
	iv[n*2]=pow(fac[n*2],md-2);
	for(int i=n*2-1;~i;--i)iv[i]=(i+1LL)*iv[i+1]%md;
	for(int i=*_=1;i<=c;++i)_[i]=C(i+b-1,i);
	for(int i=0;3*i<=c;++i){
		for(int x=c-3*i;~x;--x)if(c-3*i-x<=a){
			int _31=c-3*i-x,_1=a-_31;
			ans=(ans+(LL)fac[b+i+a]*iv[b]%md*iv[i]%md*iv[_31]%md*iv[_1]%md*_[x])%md;
		}
	}
	printf("%d\n",ans);
	return 0;
}

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

#define llint long long int

using namespace std;

int main(){
    llint A;
    string B;

    cin >> A >> B;

    int C = (B[0] - '0') * 100 + (B[2] - '0') * 10 + B[3] - '0';

    cout << ((llint) (A * C)) / 100 << endl;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
#define optimizar_io ios_base::sync_with_stdio(0); cin.tie(0);
#define fore(i, a, b) for(int i = a; i < b; i++)
#define fori(i, a, b) for(int i = a; i <= b; i++)
#define pb push_back
#define popb pop_back
#define mk make_pair
#define fi first
#define se second
#define endl '\n'
#define MAX 60
typedef long long int lli;
typedef long double ld;
const double PI = acos(-1.0);
ld eps = 1e-9;

int main() {
	lli n; cin >> n;
	string ans = "";

	while(n > 0) {
		n -= 1;
		ans += char('a' + (n % 26));
		n /= 26;
	}
	reverse(ans.begin(), ans.end());
	cout << ans << endl;
}

Measured memory_bytes: 3652
s = input()

alp = [chr(i) for i in range(97, 97+26)]

flag = [False for i in range(26)]

for c in s:
    flag[ord(c) - ord("a")] = True


def pr():
    for i in range(26):
        if not flag[i]:
            print(alp[i])
            return

    print('None')
    return

pr()


Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define loop(n) for (int ngtkana_is_genius = 0; ngtkana_is_genius < int(n); ngtkana_is_genius++)
#define rep(i, begin, end) for(int i = int(begin); i < int(end); i++)
#define all(v) v.begin(), v.end()
#define lint long long
auto cmn = [](auto& a, auto b){if (a > b) {a = b; return true;} return false;};
auto cmx = [](auto& a, auto b){if (a < b) {a = b; return true;} return false;};

template <typename T>
std::istream& operator>> (std::istream& is, std::vector<T>& v) {
  for (auto & x : v) is >> x;
  return is;
}

template <typename T>
std::ostream& operator<< (std::ostream& os, const std::vector<T>& v) {
  auto n = v.size();
  os << "{";
  for (size_t i = 0; i < n; i++)
    {os << (i > 0 ? "," : "") << v.at(i);}
  return os << "}";
}

void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail){
  std::cerr << " " << head;
  debug_impl(tail...);
}
#define debug(...)\
  std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
  debug_impl(__VA_ARGS__);\
  std::cerr << std::noboolalpha;

template <typename T>
auto make_vector_impl(size_t sz, T t) {return std::vector<T>(sz, t);}

template <size_t N, typename T, typename U, std::enable_if_t<N == 1, std::nullptr_t> = nullptr>
auto make_vector(size_t sz, U u) {return make_vector_impl(sz, T(u));}

template <size_t N, typename T, std::enable_if_t<N == 1, std::nullptr_t> = nullptr>
auto make_vector(size_t sz) {return std::vector<T>(sz);}

template <size_t N, typename T, typename... Args, std::enable_if_t<N != 1, std::nullptr_t> = nullptr>
auto make_vector(size_t a, Args... args) {return make_vector_impl(a, make_vector<N - 1, T>(args...));}

template <typename T, typename Size_t>
auto& at(T& t, Size_t i) {return t.at(i);}

template <typename T, typename Size_t, typename... Args>
auto& at(T& t, Size_t i, Args... args) {return at(t.at(i), args...);}

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  int h, w, d; std::cin >> h >> w >> d;
  auto a = make_vector< 2, int >(h, w, -1);
  if (d % 2 == 1) {
    rep(i, 0, h) rep(j, 0, w) {
      at(a, i, j) = ((i + j) % 2) * 1;
    }
  } else {
    rep(i, 0, h) rep(j, 0, w) {
      at(a, i, j) =
          (((i + j    ) / d) % 2) * 1
        + (((i + w - j) / d) % 2) * 2;
    }
  }
  for(auto& v : a) {
    for (auto x : v) {
      std::cout << (x == 0
        ? 'R'
        : x == 1
        ? 'Y'
        : x == 2
        ? 'G'
        : 'B'
        );
    }
    std::cout << std::endl;
  }
  return 0;
}


Measured memory_bytes: 1536
from itertools import combinations
n,m,x = map(int,input().split())
l = [[0]*(m+1) for i in range(n)]
for i in range(n):
    k = list(map(int,input().split()))
    for j in range(m+1):
        l[i][j] = k[j]
seq = [i for i in range(n)] #0~n-1のリストを作る
combis = [] #選ぶ参考書の組み合わせたちのリスト
for i in range(1,n+1): #i個選ぶ時の組み合わせを上で作ったリストに加えていく
    combis += list(combinations(seq,i))
ans = [] #条件を満たした組み合わせの合計金額たちを入れるリスト
for p in combis: #全ての組み合わせを試していく
    pcomp = [0]*m #組み合わせpの時の理解度
    pmoney = 0 #組み合わせpの時の金額
    for q in p: #組み合わせpの時に買う参考書q
        for j in range(m):
            pcomp[j] += l[q][j+1] #理解度のリストpcompに得られた理解度を足していく
        pmoney += l[q][0] #参考書qを買った時に値段を追加
    flag = True #目標達成したかどうか
    for i in pcomp:
        if i < x:
            flag = False
            break
    if flag: #目標達成したならこの組み合わせの合計金額をメモ
        ans.append(pmoney)
if ans == []: #満たした組み合わせがないなら
    print(-1)
else:
    print(min(ans))

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

int main(){
  long double n,m,d;
  cin >> n >> m >> d;

  long double result;
  if(d == 0){
    result = (m-1)/n;
  }else{
    result = 2*(m-1)*(n-d)/(n*n);
  }

  cout << setprecision(10) << result << endl;

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
 
int main(int argc, const char * argv[]) {
     
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
     
    int count = 0;
    int i;
    for(i=a;i<=b;i++){
        if(c%i == 0){
            count++;
        }
    }
     
    printf("%d\n",count);
     
    return 0;
}


Measured memory_bytes: 2120
s=input()
w=str()
b=str()
cnt1=0
cnt2=0
for i in range(len(s)):
    if i%2==0:
        w+='1'
        b+='0'
    else:
        w+='0'
        b+='1'
for i in range(len(s)):
    if s[i]!=w[i]:
        cnt1+=1
    if s[i]!=b[i]:
        cnt2+=1
print(min(cnt1,cnt2))


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

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;

const int INT_INF = 2147483646;
const ll LL_INF = 9223372036854775807;
const double PI=3.1415926535897932;

bool SecondCompare(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second<b.second;
}
 
bool SecondCompareDes(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second>b.second;
}

ll minll(ll a, ll b){
    if(a >= b)  return b;
    else    return a;
}

ll maxll(ll a, ll b){
    if(a >= b)  return a;
    else    return b;
}

ll a,b;

int main(){
    cin >> a >> b;
    ll ans = (a-1)*(b-1);
    cout << ans << endl;
    
    
}

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

int main() {
  int K;
  cin >> K;
  vector<int> vec = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  cout << vec.at(K - 1) << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){

    
    int W[100],H[100],i=0,j,k,l; 

 	  scanf("%d",&H[0]);
 	  scanf("%d",&W[0]);
 	  
     while((H[i]!=0)&&(H[i]!=0)){
        
      ++i;
      scanf("%d",&H[i]);
 	  scanf("%d",&W[i]);
      }
           
 	 for(j=0;j<i;++j){
 	 
 	   for(k=0;k<H[j];++k){
	 
	      for(l=0;l<W[j];++l){
		
			if ((k%2==0)&&(l%2==0)){  	
		       printf("#");
		   }else if((k%2==0)&&(l%2==1)){
		       printf(".");
		   }else if((k%2==1)&&(l%2==0)){
			   printf(".");
		   }else {
		    	printf("#");
		   }
		  }
		   printf("\n"); 
	     }
	      printf("\n");
	  }   
	      
	return 0;
}

Measured memory_bytes: 572
#define debug_interval ','
#define dump_interval ' '
#define debug_toggle 1
//{
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define INT_MAX LLONG_MAX
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define fi first
#define se second
#define mp make_pair
#define rev reverse
#define dans dump(ans)
#define MOD 1000000007
#define amp(v,n) (v).count(n)?v[n]++:v[n]=1;
#define cni cin

//{
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...A> inline void dump(){cout<<endl;}
template<class...A> inline void dump_rest() {cout<<endl;}
template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);}
template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);}
template<class...A> inline void debug(){cerr<<endl;}
template<class...A> inline void debug_rest() {cerr<<endl;}
template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cerr<<debug_interval<<first;debug_rest(rest...);}
template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cerr<<first,debug_rest(rest...);}
//}

typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
template<int m>class mint{private:int i;public:mint() : i(0){}mint(int i): i((i%m+m)%m){}mint operator+(const mint& o){return o.i+i;}mint operator*(const mint& o){return o.i*i;}mint operator-(){return -i;}operator int() {return i;}};

int n;
int b2,b4,b14,b24,b74;
int sosu[25]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};

main(){
	cin>>n;
	rep(i,25){
		int t=sosu[i],cnt=0;
		for(int j=t;j<=n;j*=t){
			cnt+=(n/j);
		}
		if(cnt>=74)b74++;
		else if(cnt>=24)b24++;
		else if(cnt>=14)b14++;
		else if(cnt>=4)b4++;
		else if(cnt>=2)b2++;
	}
	int s2=b2+b4+b14+b24+b74;
	int s4=s2-b2;
	int s14=s4-b4;
	int s24=s14-b14;
	int s74=s24-b24;
	debug(s2,s4,s14,s24,s74);
	dump(s74+s24*(s2-1)+s14*(s4-1)+s4*(s4-1)*(s2-2)/2);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend
#define all(x) (x).begin(),(x).end()
int a1,a2,a3;
int main(){
  cin >> a1 >> a2 >> a3;
  cout << (a1+a2+a3 >= 22?"bust":"win") << endl; 
}


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

int main() {
  long long r,g,b,n;
  cin >> r >> g >> b>>n;
  long long ans=0;
  for (long long R=0;R*r<=n;R++) {
    for (long long G=0;R*r+G*g<=n;G++) {
      long long C = n - R*r - G*g;
      if (C % b == 0) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
x = int(input())

def is_prime(n):
    prime = not(False)
    for i in range(2, n):
        if n%i == 0:
            prime = not(True)
            break
    return prime

while True:
    if is_prime(x):
        break
    else:
        x += 1
        
print(x)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rep1(i,x,n) for(int (i)=(x);(i)<(int)(n);(i)++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
using namespace std;
using ll = long long;
using Int = long long;

const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;

//少数点表示
//cout <<std::fixed << std::setprecision(14) <<double値

int main(){
    cin.tie( 0 ); ios::sync_with_stdio( false );
    ll a,b,c;
    cin >> a >> b >>c;
    ll abc = (c-(a+b))*(c-(a+b));
    if(c-(a+b)<=0){
        cout << "No";
        return 0;
    }
    if(4*a*b<abc){
        cout << "Yes";
    }else{
        cout << "No";
    }

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
using namespace std;

int main() {
  vector<int> a(3);
  cin >> a[0] >> a[1] >> a[2];
  sort(a.rbegin(), a.rend());
  cout << a[0]*10 + a[1] + a[2];
}

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

#define INF 1e9
using namespace std;
typedef long long ll;

int main() {

    int a, b, c; cin >> a >> b >> c;

    if ((a == 7 && b == 5 && c == 5) || (a == 5 && b == 7 && c == 5) || (a == 5 && b == 5 && c == 7)) {
        puts("YES");
    } else {
        puts("NO");
    }
}

Measured memory_bytes: 256
#include <cmath>
#include <iostream>

using namespace std;

static bool IsPrime(int x) {
  if (x < 2)
    return false;
  if (x == 2)
    return true;
  if (x % 2 == 0)
    return false;

  const int z = static_cast<int>(ceil(sqrt(x)));
  for (int i = 3; i <= z; i += 2) {
    if (x % i == 0)
      return false;
  }
  return true;
}

int main() {
  int n;

  cin >> n;

  int cnt = 0;
  int x;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (IsPrime(x))
      ++cnt;
  }
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 3064
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
#include <functional>
#include <random>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vvvl> vvvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vvb> vvvb;
typedef vector<vvvb> vvvvb;
typedef vector<string> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<ll, ll> PL;
typedef vector<PL> vpl;
typedef vector<vector<PL>> vvpl;
typedef vector<vvpl> vvvpl;
const int INF = 1001001001;
const ll LINF = 1e17;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define RFOR(i, a, b) for(ll i = (a); i > b; i--)
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, n) for(ll i = n-1; i > -1; i--)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back
#define epb emplace_back
#define ALL(X) (X).begin(),(X).end()

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    sort(ALL(vec));
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}

inline ll popcnt(ll x){return __builtin_popcountll((unsigned long long)x);};
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
//friend bool operator<(const stc& lhs, const stc& rhs){
//    return std::tie(lhs.l, lhs.r) < std::tie(rhs.l, rhs.r);
//}



int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ll H, W, A, B; cin >> H >> W >> A >> B;
    rep(i, H){
        rep(j, W){
            if(i < B){
                if(j < A){
                    cout << 1;
                }
                else{
                    cout << 0;
                }
            }
            else{
                if(j < A){
                    cout << 0;
                }
                else{
                    cout << 1;
                }
            }
        }
        cout << endstr;
    }
    return 0;
}


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

    int H, A;
    cin >> H >> A;
    if(H<=A) cout << 1 << endl;
    else if(H%A==0){
        cout << H/A << endl;
    }
    else cout << H/A +1 << endl;

}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// gp_hash_table<int, int> mapka;

using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

template<class C> void mini(C &a4, C b4) { a4 = min(a4, b4); }
template<class C> void maxi(C &a4, C b4) { a4 = max(a4, b4); }

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

const int MAX = 5001;
int n,P;
void add(int &a,int b){
  a += b;
  if(a >= P)
    a -= P;
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);
  cin >> n >> P;
  vector<int> dp1(n+1);
  dp1[0] = 1;
  int pol = (n + 1) / 2;
  for(int i = 1; i <= pol; i++){
    for(int sum = n; sum >= i; sum--){
      for(int j = 1; j * i <= sum; j++){
        add(dp1[sum], dp1[sum - i * j]);
      }
    }
  }
  debug(dp1);
  R(i,n-1)add(dp1[i+1], dp1[i]);
  debug(dp1);
  R(i,n-1)add(dp1[i+1], dp1[i]);
  debug(dp1);
  pol = n / 2;
  vector<int> dp2(n+1);
  dp2[0] = 1;
  for(int i = 2; i <= pol; i++){
    for(int sum = n; sum >= i; sum--){
      for(int j = 1; j * i <= sum; j++){
        add(dp2[sum], dp2[sum - i * j]);
      }
    }
  }
  debug(dp2);
  int res = 0;
  R(i,n){
    add(res, dp2[i] * dp1[n-i-1] % P);
  }
  cout << res << "\n";
}


Measured memory_bytes: 384
#include <stdio.h>

int main(void)
{
    int a, b, c;

    scanf("%d %d %d",&a,&b,&c);

    if( (a!=b&&b==c)||(b!=a&&a==c)||(c!=b&&a==b) )
        printf("Yes\n");
    else
        printf("No\n");

    return 0;
}


Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;

namespace AtCoder.ABC
{
	class QuestionB
	{
		public static void Main(string[] args)
		{
			var abc = Console.ReadLine().Split(" ").Select(x => long.Parse(x)).ToArray();
			var a = abc[0];
			var b = abc[1];
			var c = abc[2];

			var k = long.Parse(Console.ReadLine());

			if(b <= a) {
				for(int i = 1; i <= k; i++) {
					b *= 2;
					if(a < b) {
						k -= i;
						break;
					}
				}
			}

			if (c <= b) {
				for (int i = 1; i <= k; i++) {
					c *= 2;
					if (b < c) {
						break;
					}
				}
			}

			Console.WriteLine(Checked(a, b, c) ? "Yes" : "No");
		}

		public static bool Checked(long a, long b, long c)
		{
			return b > a && c > b;
		}
	}
}


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

using namespace std;

int main(){
    string s;
    string a = "";
    string b = "";
    cin >> s;
    for(int i = 0; i < s.length(); i++){
        if(s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C'){
            a += s[i];
            if(a.length() > b.length()){
                b = a;
            }
        }else{
            a = "";
        }
    }
    cout << b.length();
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PB push_back
using namespace std;
typedef long long LL;
const int MAXN=2e5 + 10, SEGSZ = 262144, oo= 1<<29;

int zkw[SEGSZ*2+10],N, w[MAXN], pre[MAXN], f[MAXN], Q;
vector<int> G[MAXN];
template<class T> void upmin(T &a ,T b){if( a>b) a=b;}
void Modify(int l, int r, int x){	for (l+=SEGSZ, r+=SEGSZ; l<=r; l=(l+1)>>1, r=(r-1)>>1) upmin(zkw[l],x), upmin(zkw[r],x);}
int Query(int p){
	int res =oo ;
	for (p+=SEGSZ; p ; p>>=1 ) upmin(res, zkw[p]);
	return res;
}

int main(){
	scanf("%d", &N);
	for (int i=0; i< SEGSZ<<1; i++) zkw[i] =oo;
	for (int i=1; i<=N; i++){
		scanf("%d", &w[i]);
		pre[i] = pre[i-1] +1-w[i];
	}
	scanf("%d", &Q);
	for (int b,e; Q--;){
		scanf("%d%d", &b, &e);
		G[e].PB(b);
	}
	for (int i=1; i<=N; i++){
		Modify(i-1,i-1,f[i-1]-pre[i-1]);
		for (int j=0,v; j<G[i].size()?v=G[i][j],1:0; j++)	Modify(v, i, Query(v-1));
		f[i] = min(f[i-1]+w[i] , Query(i)+pre[i]);
	}
	printf("%d\n", f[N]);
	return 0;
}


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

using namespace std;

const int MAX_N = 3000 + 10;

int n;
vector <double> prob;
double memo[MAX_N][MAX_N];

double dp (int pos, int head) {
  if (pos == n) return head > (n - head);
  double& ret = memo[pos][head];
  if (ret > -0.5) return ret;
  return ret = prob[pos] * dp(pos + 1, head + 1) + (1 - prob[pos]) * dp(pos + 1, head);
}

int main () {
  cin >> n;
  prob.resize(n);
  for (int i = 0; i < n; i++) cin >> prob[i];
  memset(memo, -1, sizeof memo);
  printf("%.12lf\n", dp(0, 0));
  return (0);
}


Measured memory_bytes: 71296
#include<iostream>
#include<vector>

using namespace std;

int main(int argc, char const *argv[])
{
    int N, K, Q;
    
    cin >> N >> K >> Q;

    vector<int> Person(N, K);

    int temp;

    for (int i = 0; i < Q; i++)
    {
        cin >> temp;
        Person[temp - 1]++;
    }
    
    for (auto &&p : Person)
    {
        cout << ((p - Q > 0)? "Yes": "No") << endl;
    }
    return 0;
}

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

int ans;
int n, m;

void dfs(int countNum, int minNum, int total){
	if(countNum == n){
		if(total == m) ans++;
	}
	else if(countNum < n){
		for(int i=minNum+1; i <= 9; i++){
			dfs(countNum+1, i, total+i);
		}
	}
}

int main(){
	while(cin >> n >> m, n || m){
		ans = 0;
		dfs(0, -1, 0);
		cout << ans << endl;
	}
}

Measured memory_bytes: 1160
import itertools,sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N,K = LI()
h = LI()
dp = [float('INF')]*N
dp[0] = 0
for i,j in itertools.product(range(N),range(1,K+1)):
    if i-j>=0:
        dp[i] = min(dp[i],dp[i-j]+abs(h[i]-h[i-j]))
print(dp[-1])


Measured memory_bytes: 57952
from collections import defaultdict,deque
import math
def main():
    n = int(input())
    A=[int(i) for i in input().split()]
    res = 0
    highest = A[0]
    for i in range(1,n):
        if A[i] < highest:
            res += A[i]-highest

        if A[i] > highest:
            highest = A[i]

    print(abs(res))

if __name__ == '__main__':
    main()


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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
  }
  
  int min=A[0], max=A[0];
  for (int i = 0; i < N; ++i) {
    if (min > A[i]) min = A[i];
    if (max < A[i]) max = A[i];
  }
  cout << max - min << endl;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AGarden solver = new AGarden();
        solver.solve(1, in, out);
        out.close();
    }

    static class AGarden {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            out.println((in.nextInt() - 1) * (in.nextInt() - 1));
        }

    }
}



Measured memory_bytes: 21972
#include <bits/stdc++.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define int long long
#define mod 1000000007
#define INF LLONG_MAX/5
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
signed main(){
	int a,b;
	cin>>a>>b;
	cout<<(b+a-3)/(a-1)<<endl;
}


Measured memory_bytes: 256
macro_rules! get_tuple {
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };

    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get_tuple!($($t),*)
        ).collect::<Vec<_>>()
    };
}

macro_rules! get_vec {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_| get_vec!($t)).collect::<Vec<_>>()
    };
}

fn main() {
    let (x, n) = get_tuple!(isize, isize);
    let v_p = get_vec!(isize);

    if v_p.len() == 0{
        println!("{}", x);
        return
    }

    let diff: Vec<_> = v_p.iter().map(|e| e - x).collect();

    let short_vec = generate_short_vec(100_usize);

    for i in short_vec {
        if diff.iter().all(|&e| e != i) {
            println!("{}", x + i);
            break
        }
    }

}

fn generate_short_vec(n: usize) -> Vec<isize> {
    let mut v = vec![0];

    for i in 1..=n {
        v.push(-(i as isize));
        v.push(i as isize);
    }

    v
}


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

int main(void) {
  ll N, M;
  cin >> N >> M;

  vector<ll> factor;
  for (ll i = 1; i * i <= M; i++) {
    if (M % i == 0) {
      factor.push_back(i);
      factor.push_back(M / i);
    }
  }
  sort(factor.begin(), factor.end());
  factor.erase(unique(factor.begin(), factor.end()), factor.end());

  ll ans = 1;
  for (ll g : factor) {
    if (M / g >= N) {
      ans = g;
    }
  }
  cout << ans << endl;
}

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

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF * 300 * 300;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}


void Main()
{
    int n;cin>>n;

    LL result = 0;

    REP(i,n){
        int t=i+1;
        if(t%3 == 0 || t%5 == 0){
            continue;
        }
        result += (LL)t;
    }
    cout<<result<<endl;

	return;
}

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

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

const int maxm = 100000 + 5;
const int maxn = 100000 + 5;

struct Edge{
	int to,next;
}G[maxm<<1];

int head[maxn],cnt = 0;
int color[maxn];
bool vis[maxn];

void Insert(int u,int v){
	G[++cnt].next = head[u];
	G[cnt].to = v;
	head[u] = cnt;
}

void Dfs(int u,int c){
	vis[u] = true;
	color[u] = c;
	for(int e = head[u];e; e = G[e].next){
		int v = G[e].to;
		if(!vis[v]){
			Dfs(v,c);
		}
	}
}

int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i = 1;i <= m; i++){
		int u,v;
		scanf("%d%d",&u,&v);
		Insert(u,v);
		Insert(v,u);
	}
	for(int i = 1;i <= n; i++){
		if(!vis[i]){
			Dfs(i,i);	
		}
	}
	int q;
	scanf("%d",&q);
	for(int i = 1;i <= q; i++){
		int u,v;
		scanf("%d%d",&u,&v);
		if(color[u] == color[v])printf("yes\n");
		else printf("no\n");
	}
}

Measured memory_bytes: 8684
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<(o)<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	for (string s; cin >> s&&s != "#";) {
		char c = 'A';
		rep(i, 0, s.size()) {
			switch (c)
			{
			case 'A':
				if (s[i] == '0')c = 'X';
				else c = 'Y';
				break;
			case 'X':
				if (s[i] == '0')c = '_';
				else c = 'Z';
				break;
			case 'Y':
				if (s[i] == '0')c = 'X';
				else c = '_';
				break;
			case 'Z':
				if (s[i] == '0')c = 'W';
				else c = 'B';
				break;
			case 'W':
				if (s[i] == '0')c = 'B';
				else c = 'Y';
				break;
			case 'B':
				if (s[i] == '0')c = 'Y';
				else c = 'X';
				break;
			default:
				break;
			}
		}
		if (c == 'B')cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 3156
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <bitset>
#include<iomanip>//小数点以下を精度良く表示

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define INF 2000000000
#define INF2 1000000000000000000
#define rep(i,n) for(int i=0;i<(n);i++)
typedef pair<string, string> P;
const ll MOD=1000000007;
using Graph = vector<vector<int>>;



const int MAX_N = 1000;
const int MAX_K = 100000;

template<class T>  T gcd(T a, T b) {
    while (a % b != 0) {
        T tmp = b;
        b = a % b;
        a = tmp;
    }
    return b;
}

template<class T> T lcm(T a, T b) {
    if (a == b) return b;
    T g = gcd(a, b);
    return (a / g) * b;
}


int main() {
    int n;
    cin >> n;
    string s = to_string(n);
    if (s[0] == '7' || s[1] == '7' || s[2] == '7') {
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
    return 0;
}

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

using namespace std;

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

int masu[55][55];
int w,h;

void saiki(int y,int x){
	if(y<0 || x<0 || y>=h || x>=w)return;
	if(masu[y][x]==0)return;
	masu[y][x]=0;
	
	int dx[]={0,1,0,-1,-1,-1,1,1};
	int dy[]={1,0,-1,0,1,-1,1,-1};
	
	rep(i,8){
		saiki(y+dy[i],x+dx[i]);
	}
}

int main(){
	
	A:
	cin>>w>>h;
	if(w==0 && h==0)return 0;
	
	rep(i,h){
		rep(j,w){
			cin>>masu[i][j];
		}
	}
	
	int count = 0;
	rep(i,h){
		rep(j,w){
			if(masu[i][j]==1){
				count++;
				saiki(i,j);
			}
		}
	}
	printf("%d\n",count);
	
	goto A;
}

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

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

    int cnt = 0, max=0;
    for (int i=0; i<s.length(); i++){
        if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
            cnt++;
        }
        else if (max < cnt) {
            max = cnt;
            cnt = 0;
        }
    }
    if (max < cnt) max = cnt;
    cout << max << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
int main()
{
    fast;

  int  red,gr,bl,cgr,cbl,cnt,m=0,i;
  cin >> red >> gr >> bl >> cnt;
  if(red>=gr)
  {
      for(i=1;i<=cnt;i++)
      {
          gr*=2;
          m++;
          if(gr>red)
          {
              break;
          }
      }
  }
  if(bl<=gr)
  {
      m++;
      for(i=m;i<=cnt;i++)
      {
         bl*=2;
      }
  }
  if(red<gr && gr<bl)
  {
      cout << "Yes"<<endl;
  }
  else{
    cout << "No"<<endl;
  }


}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
#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 all(a) a.begin(),a.end()
#define INF 1e9

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

    vector<int> v = {1};
    rep1(i,8){
        v.push_back(pow(9,i));
    }
    rep1(i,10){
        v.push_back(pow(6,i));
    }
    sort(all(v),greater<int>());

    vector<int> dp(n+1,INF);
    dp[0] = 0;
    for(int x : v){
        if(x>n) continue;
        rep(j,n+1)if(dp[j]!=INF){
            for(int k = 1; k<=10; k++)if(j+x*k<=n){
                if(dp[j+x*k] > dp[j]+k){
                    dp[j+x*k] = dp[j]+k;
                }
            }
        }
    }
    cout<<dp[n]<<endl;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define simplify ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define endl "\n"
using namespace std;


int32_t main() {

    simplify

    char c;
    cin>>c;

    if(c<='Z' && c>='A'){
        cout<<"A";
    }
    else{
        cout<<"a";
    }




    return 0;
}


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

int main(){
   int m,d,ans;
   while(cin >> m >> d&&m|d){
      ans=d;
      if(m>=2) ans+=31;
      if(m>=3) ans+=29;
      if(m>=4) ans+=31;
      if(m>=5) ans+=30;
      if(m>=6) ans+=31;
      if(m>=7) ans+=30;
      if(m>=8) ans+=31;
      if(m>=9) ans+=31;
      if(m>=10) ans+=30;
      if(m>=11) ans+=31;
      if(m>=12) ans+=30;
      if(ans%7==5) cout << "Monday" << endl;
      if(ans%7==6) cout << "Tuesday" << endl;
      if(ans%7==0) cout << "Wednesday" << endl;
      if(ans%7==1) cout << "Thursday" << endl;
      if(ans%7==2) cout << "Friday" << endl;
      if(ans%7==3) cout << "Saturday" << endl;
      if(ans%7==4) cout << "Sunday" << endl;
   }
}

Measured memory_bytes: 1152
#include <cstdio>
#include <cstring>
#define Min(A, B) A < B ? A : B
int N; 
int Solve(int A) {
	int Cnt = 0;
	while(A) {
		Cnt += A % 10;
		A /= 10;
	}
	return Cnt;
}
int Ans = 2147483647;
int main() {
	scanf("%d", &N);
	for(int i = 1; i < N; i++) {
		int Cnt = Solve(i) + Solve(N - i);
		Ans = Min(Ans, Cnt); 
	}
	printf("%d\n", Ans);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
#define mp make_pair
using namespace std;
int main(){
	ll n;
	cin>>n;
	vector<ll> a;
	ll cost[114514];
	a.pb(0);
	for(int i=0;i<n;i++){
		ll x;
		cin>>x;
		a.pb(x);
	}
	a.pb(0);
	ll sum = 0;
	for(int i=1;i<=n+1;i++){
		cost[i] = abs(a[i] - a[i-1]);
		sum += cost[i];
	}
	for(int i=1;i<=n;i++){
		if( (a[i-1]<=a[i] && a[i]<=a[i+1]) || (a[i-1]>=a[i] && a[i]>=a[i+1])){
			cout<<sum<<endl;
		}
		else if( (a[i-1]<=a[i+1] && a[i+1]<=a[i]) || (a[i-1]>=a[i+1] && a[i+1]>=a[i])){
			cout<<sum-2*cost[i+1]<<endl;
		}
		else{
			cout<<sum-2*cost[i]<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 2932
import java.util.*;
class Main{
  public static void main(String[]args){
    Scanner sc=new Scanner(System.in);
    int b=0;
    int[] a=new int[5];
    for(int i=0;i<5;i++){
      a[i]=sc.nextInt();
      if(a[i]==0) b=i+1;
    }
    System.out.printf("%d",b);
  }
}

Measured memory_bytes: 27092
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define clr(a, b) memset((a), (b), sizeof(a))
#define debugs(x) cout << "Line" << __LINE__ << "	" << #x << "=" << x << endl
#define break break
#define continue continue
#define itn int
#define endl '\n'
#define Endl endl
#define vint vector<ll>
#define pii pair<int, int> 
using namespace std;

int n, k, m;
int a[200005];
itn num[1000005];
void solve(int T)
{
	cin >> n;
	for (int x = 1; x <= 100; x++)
		for (int y = 1; y <= 100; y++)
			for (int z = 1; z <= 100; z++)
				num[(x + z) * (x + z) + (x + y) * (x + y) + (y + z) * (y + z)]++;
	for (int i = 1; i <= n; i++)
		cout << num[i * 2] << endl;
}
int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(NULL);
	int numoftest = 1;

	//cin >> numoftest;


	for (int siven = 1; siven <= numoftest; ++siven)
		solve(siven);
	return 0;
}

/*


*/

Measured memory_bytes: 4028
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    s = input()
    if s[2] == s[3] and s[4] == s[5]:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
  main()


Measured memory_bytes: 5276