akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<string> s(n);
  set<string> st;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    st.insert(s[i]);
  }
  if (st.size() != n) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i + 1 < n; i++) {
    if (s[i].back() != s[i + 1].front()) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}



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

int main()
{
  int a,b,c;
  int L = 0;
  int L1 = 0;
  int L2 = 0;
  int L3 = 0;

  while(1){
    cin>>a>>b>>c;
    int d = max(a,b);
    int e = max(d,c);
    int f = min(a,b);
    int g = min(d,c);

    if(f + g <= e){
      break;
    }

    int delta = (f * f) + (g * g) - (e * e);
    if(delta == 0){
      ++L1;
    }
    else if(delta > 0){
      ++L2;
    }
    else{
      ++L3;
    }
  }
  L = L1 + L2 + L3;
  cout<<L<<" "<<L1<<" "<<L2<<" "<<L3<<endl;
  return 0;
}


Measured memory_bytes: 3116
#include<bits/stdc++.h>
using namespace std;
int main(){
	string str;
	cin>>str;
	int len=str.size();
	int start,end;
	for(int i=0;i<len;i++){
		if(str[i]=='A'){
			start=i+1;
			break;
		}
	}
	for(int i=len-1;i>=0;i--){
		if(str[i]=='Z'){
			end=i+1;
			break;
		}
	}
	cout<<end-start+1<<endl;
}

Measured memory_bytes: 640
#-*-coding:utf-8-*-
import math

def fact(n):
    val = 1
    for i in range(2, n + 1):
        val *= i
    return val

def main():
    n, m = map(int, input().split())

    if abs(n - m) < 2:
        if n == m:
            ans = math.factorial(n) ** 2 * 2
            print(ans % 1000000007)
        else:
            ans = math.factorial(n) * math.factorial(m)
            print(ans % 1000000007)
    else:
        print(0)

if __name__ == '__main__':
    main()

Measured memory_bytes: 5180
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		//initialization
		int A  = 0,
            B  = 0,
            AB = 0,
            O  = 0;

        //input
		String blood;
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
        	blood = sc.nextLine().split(",")[1];

        	if(blood.equals("A")) {A++; }
        	if(blood.equals("B")) {B++; }
        	if(blood.equals("AB")){AB++;}
        	if(blood.equals("O")) {O++; }
        }
        System.out.println(A);
        System.out.println(B);
        System.out.println(AB);
        System.out.println(O);
	}
}

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

int main(){
  long N;
  vector<long> A;
  cin >> N;
  bool flag=false;
  for(int i=0; i<N; i++){
    long a; cin >> a;
    if(a==1) flag =true;
    A.push_back(a);
  }
  if(!flag){
    cout << "-1" << endl;
    return 0;
  }
  int c=1;
  for(int i=0; i<N; i++){
    if(A[i]==c) c++;
  }
  cout << N-c+1 << endl;
  return 0;
}

Measured memory_bytes: 2420
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;

    // 整数スキャン（複数）
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&z);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s;
    cin >> s;
    */

    // n個の文字列スキャン
    /*
    vector<string> slist;
    rep(i,n){
        string s;
        cin >> s;
        slist.push_back(s);
    }
    */

int main() {
    int n;
    scanf("%d",&n);
    int x;
    scanf("%d",&x);
    ll a[n] = {};
    ll b = 0;
    ll m = 999999;
    rep(i,n){
        scanf("%lld",&a[i]);
        mins(m,a[i]);
        x-=a[i];
    }


    ll ans = n;
    while(x>=m){
        ans++;
        x-=m;
    }
    
    cout << ans << endl;
    return 0;
}
 
 


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

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define REP(i,n) for(ll i = 0;i < (ll)n;i++)
#define REPD(i,n) for(ll i = (ll)n - 1;i >= 0;i--)
#define ALL(x) (x).begin(),(x).end()
#define FILLl(n,first_dimension_size,value) fill((ll*)n,(ll*)(n+first_dimension_size),value)
#define FILL(n,first_dimension_size,value) fill((int*)n,(int*)(n+first_dimension_size),value)
#define INF (1 << 29)
#define MOD 1000000007
//int dx[4] = {1,0,0,-1};
//int dy[4] = {0,1,-1,0};






int main(){
  
  int n;
  cin >> n;
  vector<int> v(n);
  REP(i,n)cin >> v[i];
  int dp[n+1];
  FILL(dp,n+1,INF);
  dp[0] = 0;
  dp[1] = 0;
  dp[2] = abs(v[0]-v[1]);
  for(int i = 1;i < n-1;i++){
    dp[i+2] = min(dp[i+1] + abs(v[i]-v[i+1]),dp[i] + abs(v[i-1]-v[i+1]));
  }
  cout << dp[n] << endl;




  return 0;
}


Measured memory_bytes: 1024
//g++ -std=c++14 test.cpp -o test.out
//問題URL
//https://atcoder.jp/contests/agc031/tasks/agc031_b

//参考：
//https://www.hamayanhamayan.com/entry/2019/03/17/003754

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

LL N;
LL X[50],Y[50];

LL ans = 1;

void solve(){
	if(N==1) return;

	map<pair<LL,LL>,LL> counter;
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			counter[pair<LL,LL>(X[i]-X[j],Y[i]-Y[j])]++;
			counter[pair<LL,LL>(-X[i]+X[j],-Y[i]+Y[j])]++;
		}
	}

	LL counter_max = 0;
	for(auto iter=counter.begin();iter!=counter.end();iter++){
		//cout << (iter->first).first << "," << (iter->first).second << "=" << iter->second << endl;
		counter_max = max(counter_max,iter->second);
	}
	ans = N - counter_max;
}
 
int main(){
    cin >> N;
    for(int i=0;i<N;i++) cin >> X[i] >> Y[i];
 
    solve();

    cout << ans << endl;
    return 0;
}

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

typedef long long ll;

int main()
{
    int n,k;
    cin>>n>>k;
    vector<int> a(n);
    rep(i, n) cin >> a[i];

    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    int max = a[0];
    int g=a[0];
    rep(i,n)g=__gcd(g,a[i]);

    if(max>=k&&(max-k)%g==0)
        cout << "POSSIBLE" << endl;
    else
        cout << "IMPOSSIBLE" << endl;
    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  
  int ans = n % 1000;
  
  if (ans == 0) {
    cout << "0\n";
  }else {
    cout << 1000 - ans << "\n";
  }
  
  return 0;
}

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

int main(){
  int n, m, num;
  long long int ans=0;
  priority_queue<long long int> que;
  cin >> n >> m;
  for(int i=0;i<n;i++){
    cin >> num;
    que.push(num);
  }
  for(int i=0;i<m;i++){
    int x=que.top();
    que.pop();
    que.push(x/2);
  }
  while (!que.empty()) {
    ans+=que.top();
    que.pop();
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
    int a; int b; a=0; b=0;
    cin >> a >> b;
    if(a<1){
        return 0;
    }else{
        if(b>100){
            return 0;
        }else{
            cout << a*b << " " << a+b+a+b << endl; 
        }
    }
    return 0;
}

Measured memory_bytes: 3080
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
#define int long long
#define double long double
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 


////////////////////////////////////////////////////////////////////
template<typename T>
struct edge {
  int to, from;T cost;
  edge(int to) : from(-1), to(to), cost(-1) {}
  edge(int to, T cost) : from(-1), to(to), cost(cost) {}
  edge(int from, int to, T cost) : from(from), to(to), cost(cost) {}
};
template<typename T>
using edges = vector<edge<T>>;
template<typename T>
using graph = vector<edges<T>>;
template<typename T>
using matrix = vector<vector<T>>;

template<typename T>
bool compByCost(const edge<T>& left, const edge<T>& right){
  return left.cost < right.cost; 
}

template<typename T>
vector<vector<T>> warshall(matrix<T> &g){
  vector<vector<T>> dist(g.size());
  rep(i,g.size()){
    dist[i].resize(g.size());
    rep(j,g.size())dist[i][j] = (i == j ? 0 : g[i][j]);
  }
  rep(k,g.size()){
    rep(i,g.size()){
      rep(j,g.size()){
        if(dist[i][k] == INF || dist[k][j] == INF)continue;
        dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
      }
    }
  }
  return dist;
}

#define warshall warshall<int>// matの初期化でINFを詰めておく



////////////////////////////////////////////////////////////////////

int n,m,r;vector<int> t;matrix<int> g(210);
vector<vector<int>> dist; 
signed main(){
  cin>>n>>m>>r;
  rep(i,r){
    int tt;cin>>tt;tt--;t.push_back(tt);
  }
  sort(t.begin(), t.end());
  rep(i,210){
    g[i].resize(210);
    rep(j,210)g[i][j] = INF;
  }
  rep(i,m){
    int a,b,c;cin>>a>>b>>c;a--;b--;
    g[a][b] = g[b][a] = c;
  }
  dist = warshall(g);
  int ans = INF;

  do{
    int sum = 0;
    rep(i,r-1){
      sum += dist[t[i]][t[i+1]];
    }
    chmin(ans, sum);
  }while(next_permutation(t.begin(), t.end()));
  cout << ans << endl;
}


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

#include <bits/stdc++.h>

using namespace std;

#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(nullptr)
#define FOR(i, a, b) for(int i = (a); i <= (b); i++)
#define REP(n) FOR(O, 1, (n))
#define pb push_back
#define f first
#define s second
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<piii> viii;

const int MAXN = 1000100, MAXK = 23;
const ll MOD =  2020202003;
const ll INF = 1e18;
const ld PI = asin(1) * 2;

void setIO () {
    FAST_IO;
}

void setIO (string s) {
    setIO();
 	freopen((s+".in").c_str(),"r",stdin);
	freopen((s+".out").c_str(),"w",stdout);
}

int n;
set<string> s;


int main() {
	setIO();

    cin >> n;
    REP(n) {
        string in; cin >> in;
        s.insert(in);
    }
    cout << ((int)s.size());

	return 0;
}


Measured memory_bytes: 19276
import java.util.*;
 
public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
 
        double l = stdIn.nextInt();

        
        

        //int c = stdIn.nextInt();
        //int x = stdIn.nextInt();
        
        
        
        
        // for(int i = 0; i < s.length(); i++){
        //     a[i] = c[i] - 48;
        //     System.out.println(a[i]);
        // }
        //int sum = 0;
        //boolean flag = true;
        //for(int i = 0; i < s.length(); i++){
        //}
 
        System.out.println(String.format("%f", Math.pow(l / 3, 3)));
 
        //System.out.println();
        //System.out.print();
 
        stdIn.close();
    }
}

Measured memory_bytes: 21844
#include <stdio.h>

int main(int argc, const char * argv[]) {
    int x, y;
    int tmp;
    
    while (1){
        scanf("%d %d", &x, &y);
        if (x==0 && y==0) {
            break;
        }
        else{
            if (x > y) {
                tmp = x;
                x  = y;
                y = tmp;
            }
            printf("%d %d\n", x, y);
        }
    }
    
    return 0;
}

Measured memory_bytes: 600
n = int(input())
a = [int(i) for i in input().split()]
for i in range(n):
    a[i] -= i + 1
a = sorted(a)
#print(a)
pivot = a[int(n / 2)]
#print(pivot)

count = 0
for i in range(int(n / 2)):
    count -= a[i]

for i in range(int(n / 2), n):
    count += a[i]

if n % 2 == 0:
    print(count)
else:
    print(abs(count - pivot))


Measured memory_bytes: 25196
#include<stdio.h>
#define MAX 101

void pop(int A[],int *top){

 printf("%d\n",A[(*top)]);
 (*top)--;

 return;
}

void push(int A[],int x,int *top){

 (*top)++;
 A[(*top)]=x;

 return;
}

int main(){
 int x;
 int A[MAX];
 int top=-1;

 while(scanf("%d",&x)!=EOF){

  if(x==0)pop(A,&top);

  else push(A,x,&top);

 }

 return 0;
}


Measured memory_bytes: 2016
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
const ll INF = 1LL << 60;

int main(){
	int a, b, c; cin >> a >> b >> c;
	cout << a + b + c - max({a, b, c});
}


Measured memory_bytes: 256
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N,K = [int(i) for i in input().split()]

for i in range(K):
  if N-K+1 < i+1:
    print(0)
  else:
    print(cmb(N-K+1,i+1)*cmb(K-1,i)%1000000007)

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

int main()
{
    vector<int> antena(5);
    rep(i, 5) cin >> antena.at(i);
    int k;
    cin >> k;
    bool is_connect = true;
    rep(i, 5)
    {
        rep(j, 5)
        {
            if (i == j)
                continue;
            if (antena.at(i) - antena.at(j) > k)
            {
                is_connect = false;
            }
        }
    }
    if (is_connect == true)
        cout << "Yay!" << endl;
    else
        cout << ":(" << endl;
}

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

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'
#define debugArrayP(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i].first<< " " << x[i].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = LLONG_MAX;
const ll MOD = 1e9+7;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;cin>>N;
  ll k=1;
  for(;k*(k-1)/2<N;k++);
  if(k*(k-1)/2!=N){
    cout << "No" << endl;
    return 0;
  }
  vector<vint> S(k);
  int cnt=1;
  repeat(i,k){
    repeat(j,i){
      S[i].push_back(cnt);
      S[j].push_back(cnt);
      cnt++;
    }
  }
  cout << "Yes" << endl;
  cout << k << endl;
  repeat(i,k){
    cout << k-1;
    repeat(j,k-1){
      cout << " " << S[i][j];
    }
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 2304
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
#define MAX 200200
#define ll long long
inline int read()
{
	int x=0;bool t=false;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')t=true,ch=getchar();
	while(ch<='9'&&ch>='0')x=x*10+ch-48,ch=getchar();
	return t?-x:x;
}
struct Line{int v,next,w;}e[MAX<<1];
int h[MAX],cnt=1;
inline void Add(int u,int v,int w){e[cnt]=(Line){v,h[u],w};h[u]=cnt++;}
struct Edge{int u,v;ll w;}E[MAX*50];
bool operator<(Edge a,Edge b){return a.w<b.w;}
int Size,mx,rt,size[MAX];bool vis[MAX];
int n,m,W[MAX];
void Getroot(int u,int ff)
{
	int ret=0;size[u]=1;
	for(int i=h[u];i;i=e[i].next)
	{
		int v=e[i].v;if(vis[v]||v==ff)continue;
		Getroot(v,u);size[u]+=size[v];
		ret=max(ret,size[v]);
	}
	ret=max(ret,Size-size[u]);
	if(ret<mx)mx=ret,rt=u;
}
int P;ll Val;
void dfs(int u,int ff,ll dep)
{
	if(dep+W[u]<Val)Val=dep+W[u],P=u;
	for(int i=h[u];i;i=e[i].next)
		if(!vis[e[i].v]&&e[i].v!=ff)
			dfs(e[i].v,u,dep+e[i].w);
}
void Link(int u,int ff,ll dep)
{
	E[++m]=(Edge){u,P,Val+dep+W[u]};
	for(int i=h[u];i;i=e[i].next)
		if(!vis[e[i].v]&&e[i].v!=ff)
			Link(e[i].v,u,dep+e[i].w);
}
void Divide(int u)
{
	vis[u]=true;
	Val=1e18;P=0;dfs(u,0,0);Link(u,0,0);
	for(int i=h[u];i;i=e[i].next)
	{
		int v=e[i].v;if(vis[v])continue;
		Size=mx=size[v];Getroot(v,u);
		Divide(rt);
	}
}
int f[MAX];ll ans;
int getf(int x){return x==f[x]?x:f[x]=getf(f[x]);}
int main()
{
	n=read();
	for(int i=1;i<=n;++i)W[i]=read();
	for(int i=1;i<n;++i)
	{
		int u=read(),v=read(),w=read();
		Add(u,v,w);Add(v,u,w);
	}
	Size=mx=n;Getroot(1,0);Divide(rt);
	sort(&E[1],&E[m+1]);
	for(int i=1;i<=n;++i)f[i]=i;
	for(int i=1;i<=m;++i)
	{
		int u=getf(E[i].u),v=getf(E[i].v);
		if(u==v)continue;
		ans+=E[i].w;f[u]=v;
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 74752
st = str(input())
q = int(input())
com = []
for i in range(q):
	com.append(input().split())
for k in com:
	if k[0] == "print":
		print(st[int(k[1]):int(k[2])+1])
	elif k[0] == "reverse":
		s = list(st[int(k[1]):int(k[2])+1])
		s.reverse()
		ss = "".join(s)
		st = st[:int(k[1])] + ss + st[int(k[2])+1:]
	else:
		st = st[:int(k[1])] + k[3] + st[int(k[2])+1:]


Measured memory_bytes: 5624
//競技プログラミング用のテンプレート
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <math.h>
#include <stack>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repr(i, n) for(int i = n - 1; i >= 0; i--)

using namespace std;
using ll = long long int;
using p = pair<int, int>;
using pl = pair<ll, ll>;
using v = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vl = vector<ll>;

int main()
{
  int n;
  cin >> n;
  string s = to_string(n);
  for(int i = 0; i < s.size(); i++)
  {
    if(s[i] == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}


Measured memory_bytes: 3692
import java.util.*;
import java.math.BigDecimal;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        
        String A = scanner.next();
        String B = scanner.next();
        
        BigDecimal bA = new BigDecimal(A);
        BigDecimal bB = new BigDecimal(B);
        
        BigDecimal ans = bA.multiply(bB);
        BigDecimal Ans = ans.setScale(0,BigDecimal.ROUND_DOWN);
        
        System.out.println(Ans);
    }
}


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

int main()
{
  char str[100002];
  cin>>str;
  
  int length = strlen(str);
  
  char stk[length+2];
  int i=0,top=-1;
  while(str[i])
  {
  	
    if(top==-1)
      stk[++top]=str[i];
    else
    {
      if(stk[top]==str[i])
        stk[++top]=str[i];
      else
        top--;
    }
    
    i++;
  }
  
    cout<<length-top-1;
  
}
  

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

using namespace std;

template<class T>
struct Graph
{
	struct Vertex{};
	struct Edge {
		int to;
		int cost;
		Edge(int t, int c) : to(t), cost(c) {}
		Edge() {}
	};
	int sz;
	vector<Vertex> v;
	vector<vector<Edge>> e;
	Graph(int n) : sz(n), v(n), e(n) {}
	template<class... Args>
	inline void assign_vertex(int pos, Args... args) {
		v[pos] = V(args...);
	}
	template<class... Args>
	inline void add_edge(int pos, Args... args) {
		e[pos].emplace_back(args...);
	}
	inline int size() {
		return sz;
	}
};

template<class T>
struct Diameter : public Graph<T> {
	Diameter(int n) : Graph<T>(n) {}
	int Diameter_solve() {
		auto dfs = [this](auto f, int start, int& goal, int par = -1) -> int {
			goal = start;
			int res = 0;
			for (auto& i: this->e[start]) {
				if (i.to == par) continue;
				int t;
				int r = f(f, i.to, t, start);
				r += i.cost;
				if (r > res) {
					res = r;
					goal = t;
				}
			}
			return res;
		};
		int g;
		dfs(dfs, 0, g);
		return dfs(dfs, g, g);
	}
};

int main() {
	int n;
	cin >> n;
	Diameter<long long> G(n);
	for (int i = 0; i < n - 1; i++) {
		int s, t, w;
		cin >> s >> t >> w;
		G.add_edge(s, t, w);
		G.add_edge(t, s, w);
	}
	cout << G.Diameter_solve() << endl;
}

/*
	Verified on http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_5_A&lang=jp
*/


Measured memory_bytes: 11992
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

 
using vvll = vector< vector<ll> >;
using vll = vector<ll> ;
using vb = vector<bool> ;
using pll = pair<ll, ll> ;

#define IOS ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define I insert
#define endl '\n'
#define all(x) x.begin(), x.end()
#define sz(x) ((long long)x.size())
#define arr array

const ll maxs = 1e6+5;
const ll lmaxs = 20;
ll mod = 1e9+7;
ll oo = 1e10;


void pre(){



}



void solve(){  
    string s;
    int n,m;
    cin >> s >> m;
    n = s.size();
    vector<vector<vector<int>>> dp(101,vector<vector<int>>(2,vector<int>(11,0)));
    dp[0][0][0] = 1;
    for(int i=0;i<n;i++){
        for(int j=0;j<2;j++){
            for(int k=0;k<=m;k++){
                ll D = s[i]-'0';
                for(int d=0;d<=(j ? 9 : D) ;d++){
                    dp[i+1][j || d < D][k+(d!=0)] += dp[i][j][k];
                } 
            }
        }
    }
    int ans = dp[n][0][m] + dp[n][1][m];
    cout << ans << endl;

}   

int main(){
    #ifndef ONLINE_JUDGE
    freopen("input00.txt","r",stdin);
    #endif
    IOS;
    pre();
    ll T = 1;   
    //cin>>T;
    ll tt = 1;
    while(T--){  
        //cout << "Case #" << tt << ": "; 
        tt++;
        solve();
    }
    return 0;
}

Measured memory_bytes: 3680
n,m = map(int,input().split())
edge = [[] for i in range(n)]
st = []
to = [0]*n
dp = [0]*n
for i in range(m):
  x,y = map(int,input().split())
  edge[x-1].append(y-1)
  to[y-1] += 1
for i in range(n):
  if to[i] == 0:
    st.append(i)
while len(st) > 0:
  go = st.pop()
  for i in edge[go]:
    to[i] -= 1
    if to[i] == 0:
      st.append(i)
    dp[i] = max(dp[go]+1,dp[i])
print(max(dp))

Measured memory_bytes: 22704
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

namespace AtCodeeeer
{
    class AtCOOOOOOOOOOOder
    {
        static void Main(string[] args)
        {
            int n = int.Parse(ReadLine());
            long untilTime = 0;
            var tpls = new Tuple<long, long>[n];
            for (int i = 0; i < n; i++)
            {
                long[] s = ReadLine().Split(' ').Select(long.Parse).ToArray();
                long a = s[0];
                long b = s[1];
                tpls[i] = Tuple.Create(b,a);
            }

            Array.Sort(tpls);

            bool ans = true;
            //当核問題処理
            foreach (var item in tpls)
            {
                untilTime += item.Item2;
                if (untilTime > item.Item1)
                {
                    ans = false;
                    break;
                }
            }
            WriteLine(ans ? "Yes" : "No");
        }
    }
}

Measured memory_bytes: 27196
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define int long long
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;

const int MAX = 5100000;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

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



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

    int x,y;
    cin>>x>>y;
    int s=x+y;
    int ans=0;
    if(s%3!=0) {
        cout << ans << endl;
        return 0;
    }
    int n=s/3;
    int co=2*n-x;

    COMinit();

    cout << COM(n,co) << endl;




}


Measured memory_bytes: 119808
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999999
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef vector<llong> LV;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};



int main() {
	int N;
    cin >> N;
    string S;
    cin >> S;
    int K;
    cin >> K;
    char t = S[K-1];
    REP(i,N){
        if(S[i]!=t){
            S[i]='*';
        }
    }
    cout << S << endl;
   



}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

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

    int n=s.size();
    int a=0,b=0,c=0;
    rep(i,n){
        if(s[i]=='a') a++;
        else if(s[i]=='b') b++;
        else c++;
    }

    if(abs(a-b)>1 || abs(b-c)>1 || abs(c-a)>1) cout<<"NO"<<endl;
    else cout<<"YES"<<endl;
}


Measured memory_bytes: 3728
def main():
    x, y, a, b, c = map(int, input().split())
    p = list(map(int, input().split()))
    q = list(map(int, input().split()))
    r = list(map(int, input().split()))
    p.sort()
    q.sort()
    for i in range(-1, -x - 1, -1):
        r.append(p[i])
    for i in range(-1, -y - 1, -1):
        r.append(q[i])
    r.sort(reverse=True)
    print(sum(r[:x + y]))


if __name__ == '__main__':
    main()



Measured memory_bytes: 23328
from bisect import bisect_left

input()
S = sorted(list(map(int, input().split())))
input()
T = sorted(list(map(int, input().split())))
count = 0

for t in T:
    i = bisect_left(S, t)
    if i > len(S)-1 or i < 0:
        continue
    if S[i] == t:
        count += 1

print(count)


Measured memory_bytes: 16736
#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int A, B, C;
  cin >> A >> B >> C;
  for (int i = 0; i < 31; i++){
    if(A % 2 == 1 || B % 2 == 1 || C % 2 == 1){
      cout << i << endl;
      return 0;
    }
    int a = B / 2 + C / 2;
    int b = A / 2 + C / 2;
    int c = A / 2 + B / 2;
    A = a;
    B = b;
    C = c;
  }
  cout << -1 << endl;
}

Measured memory_bytes: 3588
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <sstream>

#define rep(i, j) for(int i = 0; i < j; i++)
// sp_rep
#define sp_rep(i, j) for(int i = 0; i <= j; i++)
#define all(i) i.begin(), i.end()
#define ll long long

using namespace std;

string Num2Str(int num)
{
	stringstream ss;
	ss << num;
	return ss.str();
}

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

	// code
	int n;
	while (cin >> n) {
		int cnt = 0;
		sp_rep(a, 9) {
			sp_rep(b, 9) {
				sp_rep(c, 9) {
					sp_rep(d, 9) {
						if (n == (a + b + c + d)) cnt++;
					}
				}
			}
		}
		cout << cnt << endl;
	}

	return 0;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main() {
    ios_base::sync_with_stdio(0);
    string s, t; cin >> s >> t;

    int ans = 1e9;
    for (int i=0;i<s.length()-t.length()+1;i++) {
        int cnt = 0;
        for (int j=i;j<i+t.length();j++) {
            if (s[j]!=t[j-i]) cnt++;
        }
        ans = min(ans, cnt);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3572
N, K = map(int, input().split())

if N == 2:
    if K == 0:
        print (1)
        print (1, 2)
        exit()
    else:
        print (-1)
        exit()

if N == 3:
    if K == 0:
        print (3)
        print (1, 2)
        print (2, 3)
        print (1, 3)
        exit()
    elif K == 1:
        print(2)
        print (1, 2)
        print (2, 3)
        exit()
    else:
        print (-1)
        exit()

if N == 4:
    if K == 0:
        print (6)
        for i in range(1, 5):
            for j in range(i + 1, 5):
                print (i, j)
        exit()
    elif K == 1:
        print (5)
        for i in range(1, 5):
            for j in range(i + 1, 5):
                if i == 3 and j == 4:
                    pass
                else:
                    print (i, j)
        exit()
    elif K == 2:
        print (3)
        for i in range(1, 4):
            print (i, i + 1)
        exit()
    elif K == 3:
        print (3)
        for i in range(2, 5):
            print (1, i)
        exit()
    else:
        print (-1)
        exit()

edge = [[0] * N for _ in range(N)] #1: 辺あり, 0: 辺なし
# print (edge) 

#必要な辺が多すぎるとき
if ((N - 1) * (N -2))//2 < K:
    print (-1)
    exit()

def output(lst): #リストをもらって答えをアウトプットする
    count = 0
    for i in lst:
        for j in i:
            if j == 1:
                count += 1
    print (count)
    for i in range(N):
        for j in range(N):
            if lst[i][j] == 1:
                if i <= j:
                    print (i + 1, j + 1)
                else:
                    print (j + 1, i + 1)
    return

for i in range(1, N): #1からすべての点に伸ばし、トータルで(n-1)C2の組を作る
    edge[0][i] = 1
    #あと何組減らさないといけないか
res = ((N - 1) * (N - 2)) //2 - K
#組を減らす必要があるときTrue
if res == 0:
    output(edge)
    exit()

tmp = 0
while True:
    tmp += 1
    for i in range(1, N):
        if res == 0:
            # flag = False
            output(edge)
            exit()
        if i + tmp < N:
            if i != i + tmp and edge[i][i + tmp] == 0 and edge[i + tmp][i] == 0:
                edge[i][i + tmp] = 1
                res -= 1
        else:
            if i != ((i + tmp) % N) + 1 and edge[i][((i + tmp) % N) + 1] == 0 and edge[((i + tmp) % N) + 1][i] == 0:
                edge[i][((i + tmp) % N) + 1] = 1
                res -= 1


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

using namespace std;
using LL = long long;

const int MOD = 1e9+7;

class Edge{
public:
    LL from,to, value;
    Edge(int f,int t, int c){
        from = f;
        to = t;
        value = c;
    }
};

long double pi = 3.14159265359;

int main(){
    int a,b,x;cin >> a >> b >> x;
    std::cout << std::setprecision(20);;
    auto calc = [&](long double theta){
        long double v = a * cos(theta / 180 * pi)* a / sin(theta / 180 * pi) / 2;
        if(v * 2 > a * b){
          //  cout<<"USI"<<endl;
            return (b * cos(theta / 180 * pi) + b * tan(theta / 180 * pi) * sin(theta / 180 * pi)) * b * sin(theta / 180 * pi) / 2 * a;
        }else{
          //  cout<<"TAPI"<<endl;
            return ((a * b) - v) * a;
        }
    };
    long double ok = 90;
    long double ng = 0;
    while(ok - ng > 1e-06){
        long double mid = (ok + ng)/2;
        //cout<<mid<<endl;
        if(calc(mid) > x){
            ok = mid;
        }else{
            ng = mid;
        }
    }
    for(int i = 0;i < 90;i++){
        //cout<<i<<" "<<calc(i)<<endl;
    }
    cout<<90 - ok<<endl;
}


Measured memory_bytes: 256
#!/usr/bin/env pypy3


P = 10 ** 9 + 7


def binom(n, k, p=P):
    denominator = 1
    for i in range(2, k + 1):
        denominator *= i
        denominator %= p
    numerator = 1
    for i in range(n, n - k, -1):
        numerator *= i
        numerator %= p
    inv_denominator = pow(denominator, p - 2, p)
    res = numerator * inv_denominator % p
    return res


def compute(n, a, b, p=P):
    num_all = pow(2, n, p)
    num_a = binom(n, a, p)
    num_b = binom(n, b, p)
    res = (num_all - 1 - num_a - num_b) % p
    return res


def main():
    n, a, b = (int(z) for z in input().split())
    res = compute(n, a, b)
    print(res)


if __name__ == "__main__":
    main()


Measured memory_bytes: 38640
'''
.append(要素) リストに要素を追加 
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前

sort()
sorted(reverse=true)

配列の初期化
配列名=[a]*n+[b]*m

Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
import itertools
from functools import reduce
from operator import mul

f = [int(s) for s in stdin.readline().rstrip().split()]
N = f[0]
K = f[1]
p = list(map(lambda x: 1/2+x/2, [int(s)
                                 for s in stdin.readline().rstrip().split()]))
E = []
tmp = 0
for el in p:
    tmp += el
    E.append(tmp)
past = E[K - 1]
for el in range(len(E)):
    if el - K < 0:
        continue
    e = E[el] - E[el - K]
    if past < e:
        past = e
print(past)


Measured memory_bytes: 78776
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<(n);i++)
#define all(t) (t).begin(),(t).end()
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}else{return 0;}}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}else{return 0;}}
template <class T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <class T> inline T LCM(T a,T b){return a*b/GCD(a,b);}

int n,m;


vector<int> g[100010];
int h[100010]={0};

int main(){
	
	cin >> n >> m;
	FOR(i,n+m-1){
		int a,b;
		cin >> a >> b;
		g[a].push_back(b);
		h[b]++;
	}

	stack<int> st;
	int ans[100010];

	FOR(i,n)if(h[i]==0)st.push(i);
	int cnt=0;
	while(!st.empty()){
		int p=st.top();st.pop();
		if(cnt==0)ans[p]=0;
		FOR(i,g[p].size()){
			h[g[p][i]]--;
			if(h[g[p][i]]==0){st.push(g[p][i]);ans[g[p][i]]=p;}
		}
		cnt++;
	}

	FOR(i,n){
		cout << ans[i+1] << endl;
	}
}



Measured memory_bytes: 7040
N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

pushed = [0] * N
pushed[0] = 1

current_bottom = a[0]
ans = 1
if current_bottom == 2:
    print(ans)
    exit()

for _ in range(N):
    current_bottom = a[current_bottom-1]
    if pushed[current_bottom-1] == 1:
        print(-1)
        exit()
    else:
        pushed[current_bottom-1] = 1
    ans += 1
    if current_bottom == 2:
        print(ans)
        exit()

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

int main() {
    
    int N,a;
    cin >> N;
    a = 0;
    for (int i = 0; i < N;i++) {
        int li,ri;
        cin >> li>>ri;
        a += -li + ri + 1;
        
    };

    cout << a << endl;

}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
	long N, flaga, flagb, i;
	long a[10000], b[10000];
	flaga = 0;
	flagb = 0;
	cin >> N;
	for (i = 0;i < N;i++) {
		cin >> a[i];
	}
	for (i = 0;i < N;i++) {
		cin >> b[i];
	}
	for (i = 0;i < N;i++) {
		if (a[i] < b[i]) {
			flaga = flaga + ((b[i] - a[i]) / 2);
			}
		if (a[i] > b[i]) {
			flagb = flagb + (a[i] - b[i]);
		}
	}
	if (flaga >= flagb) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 384
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s = iterator.next().unwrap();
    let chars: Vec<char> = s.chars().collect();

    return if *chars.last().unwrap() == 's' {
        format!("{}es", s)
    } else {
        format!("{}s", s)
    }
}


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

using namespace std;

const int INF = 1 << 28;

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

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int H, N;
  cin >> H >> N;
  vector<int> AA(N), BB(N);
  vector<pair<double, int>> C(N);
  for (int i = 0; i < N; i++) {
    cin >> AA[i] >> BB[i];
    C[i] = make_pair((double)AA[i] / BB[i], i);
  }

  sort(C.begin(), C.end());
  reverse(C.begin(), C.end());

  vector<int> A(N), B(N);
  for (int i = 0; i < N; i++) {
    int k = C[i].second;
    A[i] = AA[k];
    B[i] = BB[k];
  }

  vector<vector<int>> dp(N + 1, vector<int>(H + 1, INF));
  for (int i = 1; i < N + 1; i++) {
    dp[i][0] = 0;
  }

  for (int i = 0; i < N; i++) {
    for (int h = 0; h < H; h++) {
      chmin(dp[i + 1][min(H, h + A[i])], dp[i][min(H, h + A[i])]);
      chmin(dp[i + 1][min(H, h + A[i])], dp[i + 1][h] + B[i]);
    }
  }

  cout << dp[N][H] << '\n';
  return 0;
}


Measured memory_bytes: 39424
def main():
    X, Y = map(int, input().split())
    if Y % 2 == 1:
        print("No")
        exit()
    crane = Y / 2 - X
    turtle = X - crane
    if crane >= 0 and turtle >= 0:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()


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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  
  if(A+B == C+D)
    cout << "Balanced" << endl;
  else if(A+B >= C+D)
    cout << "Left" << endl;
  else
    cout << "Right" << endl;

  
  return 0;
}


Measured memory_bytes: 3608
#include <iostream> 
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
#include<cmath>
typedef long long int ll;
#define rep(i,n) for(int i = 0;i < n; i++)
#define c(ans) cout << (ans) << '\n'
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define Sort(a) sort(a.begin(), a.end())
using namespace std;
unsigned long long int m,k, a, b, c;string s, t;
int main() {
	cin >> a >> b >> c;
	m = a * a + b * b + c * c;
	if (2 *(a * b + a * c + b * c) < m && a + b < c)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

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

int main() {
  int a, b;
  cin >> a >> b;
  
  if(a <= 0 && b >= 0){
    cout << "Zero" << endl;
  }
  else if(a > 0){
    cout << "Positive" << endl;
  }
  else{
    if((b - a) % 2 != 0){
      cout << "Positive" << endl;
    }
    else{
      cout << "Negative" << endl;
    }
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define all(x) x.begin(),x.end()
#define ld long double
#define fast  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
signed main(){
    fast;
    int n;
    cin>>n;
    int a[n+1];
    for(int i = 1;i<=n;i++)
    	cin>>a[i];
    int ans = 0;
    for(int i = 1;i<=n;i++){
    	for(int j = i+1;j<=n;j++){
    		for(int k = j+1;k<=n;k++){
    			set<int> st;
    			st.insert(a[i]);
    			st.insert(a[j]);
    			st.insert(a[k]);

    			if(st.size() == 3){
    				vector<int> v;
					for(auto &x:st){
						v.push_back(x);
					}
					if(v[0] + v[1] > v[2] && v[1] + v[2] > v[0] && v[2] + v[0]>v[1])
						ans++;
    			}
    		}
    	}
    }
    cout<<ans;
}

Measured memory_bytes: 3656
#include <stdio.h>
#include <stdlib.h>

int fibonacci(int);

int fib[45]; //??¨???0

main(){
	int n;

	scanf("%d", &n);
	printf("%d\n", fibonacci(n));
	return 0;
}

int fibonacci(int n){
	int i;

	fib[0] = 1;
	fib[1] = 1;
	for (i = 2; i <= n; i++){
		fib[i] = fib[i - 1] + fib[i - 2];
	}

	return fib[n];
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
//



//-------------------------------------------------


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll A,B;
  cin >>A>>B;
  cout <<lcm(A,B)<<endl;
  
}





Measured memory_bytes: 256
H=int(input())+1
A=[0]+list(map(int,input().split()))
def h(i):
 l=2*i;r,g=l+1,[i,l][l<H and A[i]<A[l]]
 if r<H and A[g]<A[r]:g=r
 if g>i:A[i],A[g]=A[g],A[i];h(g)
for i in range(H//2,0,-1):h(i)
print(' '+' '.join(map(str,A[1:])))


Measured memory_bytes: 64172
def solve():
  w,h,n = (int(i) for i in input().split())
  lx = 0
  ly = 0
  rx = w
  ry = h
  for i in range(n):
    x,y,a = (int(i) for i in input().split())
    if a == 1:
      lx = max(lx,x)
    elif a == 2:
      rx = min(rx,x)
    elif a == 3:
      ly = max(ly,y)
    else:
      ry = min(ry,y)
  print(max(0,(rx-lx))*max(0,(ry-ly)))
solve()

Measured memory_bytes: 3064
import qualified Data.Vector.Unboxed as V
import qualified Data.Vector.Unboxed.Mutable as VM
import Data.Char
import Data.List
import Control.Monad

solve :: String -> Int
solve a = 1 + answer
  where
    vec = V.create $ do
      v <- VM.replicate 26 0
      forM a $ \c -> VM.modify v (+ 1) (ord c - ord 'a')
      return v
    lst = V.toList vec
    answer = sum $ zipWith (*) lst $ map sum $ tail (tails lst)

main :: IO ()
main = do
  cont <- getContents
  let [a] = words cont
      answer = solve a
  putStrLn $ show answer
  


Measured memory_bytes: 15228
use itertools::Itertools;
use proconio::input;
use proconio::marker::{Chars, Usize1};
use std::cmp::*;
use std::collections::*;
use std::iter::Iterator;

#[allow(unused_macros)]
macro_rules! max {
    ($x:expr) => {
      $x
    };
    ($x:expr, $($xs:tt)+) => {
      max($x,max!($($xs)+))
    };
  }

#[allow(unused_macros)]
macro_rules! min {
    ($x:expr) => {
      $x
    };
    ($x:expr, $($xs:tt)+) => {
      min($x,min!($($xs)+))
    };
  }

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
  input! {
  a: i64,
  b: i64,
  c: i64,
  d: i64,
  e: i64,
  }

  let mut vec = vec![];
  vec.push(a);
  vec.push(b);
  vec.push(c);
  vec.push(d);
  vec.push(e);

  let it = vec.into_iter().permutations(5);

  let mut min_time = 130 * 5;
  for i in it {
    let mut time = 0;
    for (index, v) in i.iter().enumerate() {
      if index == 4 {
        time += v;
      } else {
        if v % 10 == 0 {
          time += v;
        } else {
          time += (v / 10 + 1) * 10;
        }
      }
    }

    min_time = min!(time, min_time);
  }

  println!("{}", min_time);
}


Measured memory_bytes: 2136
import math
p=math.pi
a,b,h,m=map(int,input().split())
j=(b*math.cos(p*m/30),b*math.sin(p*m/30))
t=(a*math.cos((h/6+m/360)*p),a*math.sin((h/6+m/360)*p))
print(((j[0]-t[0])**2+(j[1]-t[1])**2)**(0.5))

Measured memory_bytes: 9524
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
//#include <chrono> //1e+9で割る auto end= chrono::system_clock::now()-st;  cout<<end.count()%1e+9<<endl;
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> LP;
typedef long double db;

#define fr first
#define sc second
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)

ll N;
P X[200000];
ll id[200000];
ll v1,v2;
int main()
{
	cin>>N;
	rep(i,N){
		cin>>X[i].fr;
		X[i].sc=i;
	}
	sort(X,X+N);
	rep(i,N){
		id[X[i].sc]=i;
	}
	v1=X[N/2-1].fr;
	v2=X[N/2].fr;
	rep(i,N){
		if(id[i]<N/2) cout<<v2<<endl;
		else cout<<v1<<endl;
	}
}

Measured memory_bytes: 5376
#include <bits/stdc++.h>
#define ll long long int
#define yorn(f) cout<<((f)?"Yes":"No")<<endl
#define YORN(f) cout<<((f)?"YES":"NO")<<endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main()
{
    int x, a, b;
    cin >> x >> a >> b;
    if (b - a <= 0) {
        cout << "delicious" << endl;
    }
    else if (b - a <= x) {
        cout << "safe" << endl;
    }
    else {
        cout << "dangerous" << endl;
    }
    return 0;
}

Measured memory_bytes: 3536
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll i,j,k,m,n,x,a,b;
    cin>>a>>b>>x;
    if(a==0)
        cout<<b/x-a/x+1<<endl;
    else
        cout<<b/x-(a-1)/x<<endl;
    return 0;
}


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

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

    for (int i = 0; i < data.size(); i++) {
        if (i == data.size() - 1) {
            cout << data.at(i) << endl;
        } else {
            cout << data.at(i) << " ";
        }
    }
    for (int i = 1; i < data.size(); i++) {
        int v = data.at(i);
        int j = i -1;
        while (j >= 0 && v < data.at(j)) {
            data.at(j + 1) = data.at(j);
            j--;
            }
        data.at(j + 1) = v;
        for (int i = 0; i < data.size(); i++) {
            if (i == data.size() - 1) {
                cout << data.at(i) << endl;
            } else {
                cout << data.at(i) << " ";
            }
        }
            }
    
}


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

int main(){
	int N;
	std::cin >> N;
	std::vector<int> h(N);
	for(auto&v:h)std::cin >> v;
	std::vector<int> dp(N,INT_MAX/4);
	dp[0]=0;
	for(int i=0;i<N;++i){
		if(i+2<N)dp[i+2]=std::min(dp[i+2],dp[i]+std::abs(h[i+2]-h[i]));
		if(i+1<N)dp[i+1]=std::min(dp[i+1],dp[i]+std::abs(h[i+1]-h[i]));
	}
	std::cout << dp[N-1] << std::endl;
}


Measured memory_bytes: 1024