akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <map> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;

int main(){
    string s;
	cin >> s;
	int alpha[26] = {};

	REP(i,s.size())
	{
		alpha[s[i] - 'a']++;
	}

	int iMax = 0;
	REP(i,26)
	{
		iMax = max(iMax, alpha[i]);
	}
	string res;
	if(iMax <= 1)
	{
		res = "yes";
	}
	else
	{
		res = "no";
	}

	cout << res << endl;


    return 0;    
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
int gcd( int x, int y ){ return y ? gcd(y, x%y) : x; }
signed main() {
int x=0,y=0,z=0,w=0,n=0,m=0;
std::vector<int> v(3);
std::cin >> v[0]>>v[1]>>v[2];
sort(all(v));
std::cout << (abs(v[0]-v[1])+abs(v[1]-v[2])) << '\n';

}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << endl; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll a, v, b, w, t;
    cin, a, v, b, w, t;
    ll dist = abs(a - b);
    ll inter = v - w;
    print(t * inter >= dist ? "YES" : "NO");
    return 0;
}


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

using namespace std;

int p[100];
int main() {
  int n;

  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &p[i]);
  int ans = 0;
  for (int i = 1; i < n-1; i++) {
    if (p[i-1] < p[i] && p[i] < p[i+1]) ans++;
    else if (p[i-1] > p[i] && p[i] > p[i+1]) ans++;
  }

  printf("%d\n", ans);

  return 0;
}


Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>

using namespace std;

typedef long long ll;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    string s;
    cin>>n;
    cin>>s;
    s='.'+s+'#';
    vector<int> m,m1,m2;
    int k=1;
    for (int i=0; i<n+1; i++){
        if(s[i]=='.'){
            if(s[i+1]=='#') {
                m.push_back(k);
                k=1;
            }
            else k++;
        } else {
            if(s[i+1]=='.') {
                m.push_back(k);
                k=1;
            }
            else k++;
        }
    }
    m2.push_back(0);
    for(int i=0;i<m.size();i++){
        if (i%2==0){
            if (i==0) m1.push_back(m.at(0));
            else m1.push_back(*(m1.end()-1)+m.at(i));
        } else {
            if (i==1) m2.push_back(m.at(1));
            else m2.push_back(*(m2.end()-1)+m.at(i));
        }
    }
    int ans=n;
    for(int i=0;i<m1.size();i++) {
        int ans1=m1.at(m1.size()-1)-m1.at(i)+m2.at(i);
        ans=min(ans,ans1);
    }
    
    cout<<ans<<endl;
}

Measured memory_bytes: 2508
#include<iostream>
#include<numeric>
#include<math.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<climits>
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define mkp make_pair
#define pll pair<ll,ll>
#define rep(i,from,to) for(int i=from;i<to;i++)
#define repd(i,from,till) for(int i=from;i>=till;i--)
#define waste ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inf 1e9+1
#define mod 1e9+7
#define inf1 1e18+1
#define pie 3.14159265358979323846
#define N 100005
using namespace std;

int solve(){
    int d,t,s;
    cin>>d>>t>>s;
	if(d>t*s)cout<<"No"<<endl;
	else cout<<"Yes"<<endl;
	return 0;
}
int main(){
    waste;
    int t;
    //cin>>t;
    t=1;
    while(t--){
       	solve();
    }
}


Measured memory_bytes: 3652
#include<cstdio>
#include<algorithm>

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

using namespace std;

int main(){
	for(int n,w;scanf("%d%d",&n,&w),n;){
		int hist[11]={},m=1;
		rep(i,n){
			int v;	scanf("%d",&v);
			hist[v/w]++;
			m=max(m,v/w+1);
		}
		int hmax=*max_element(hist,hist+m);

		double ink=0.01;
		rep(i,m)	ink+=1.*(m-i-1)/(m-1)*hist[i]/hmax;
		printf("%.9f\n",ink);
	}

	return 0;
}

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

using namespace std;

string s;
int pos;

struct NODE{
	string s;
	long long size;
	vector< pair<NODE*,int> > ch;
};


NODE* getStringNode(){
	NODE *ans = new NODE();
	while(s[pos] >= 'A' && s[pos] <= 'Z'){
		ans->s += s[pos++];
	}
	ans->size = (ans->s).size();
	return ans;
}
int getNumber(){
	int ans = 0;
	while(s[pos] >= '0' && s[pos] <= '9'){
		ans = ans * 10 + s[pos++]-'0';
	}
	return ans;
}

NODE* parse(){ 
	NODE *mine = new NODE();
	
	mine->size = 0;
	
	int coef = 1;
	while(s[pos] != ')'){
		//cout << s[pos] << " < " << pos << " " << s << endl;
		if( s[pos] == '('){
			pos++;
			mine->ch.push_back(make_pair(parse(),coef));
			coef = 1;
		}else if('1' <= s[pos] && s[pos] <= '9'){
			coef = getNumber();
		}else{
			(mine->ch).push_back(make_pair(getStringNode(),coef));
			coef = 1;
		}
	}
	
	//cout << mine->ch.size() << endl;
	for(int i = 0 ; i < (mine->ch).size() ; i++){
		//cout << " " << (mine->ch)[i].second << " " << mine->ch[i].first->size << endl;
		mine->size += (mine->ch)[i].second * mine->ch[i].first->size;
		mine->size = min(2000000ll,mine->size);
	}
	pos++;
	return mine;
}
char f(NODE *root,int K){
	if( root->s.size() != 0 ){
		return root->s[K];
	}
	
	for(int i = 0 ; i < root->ch.size() ; i++){
		long long C = (root->ch)[i].second * root->ch[i].first->size;
		if( K < C ){
			K %= root->ch[i].first->size;
			return f(root->ch[i].first,K);
		}else{
			K -= C;
		}
	}
	return '0';
}

int main(){
	int n;
	while(cin >> s >> n && s != "0"){
		pos = 0;
		s += ")";
		NODE *root = parse();
		//cout << root->size << endl;
		cout << f(root,n) << endl;
	}
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    int THP, TAttack, AHP, AAtack;

    cin >> THP >> TAttack >> AHP >> AAtack;

    string Answer = "yes";

    while (true)
    {
        AHP = AHP - TAttack;

        if (0 >= AHP)
        {
            Answer = "Yes";
            break;
        }
        if (0 >= THP)
        {
            Answer = "No";
            break;
        }

        THP = THP - AAtack;

        if (0 >= THP)
        {
            Answer = "No";
            break;
        }
        if (0 >= AHP)
        {
            Answer = "Yes";
            break;
        }
    }

    cout << Answer << endl;
}

Measured memory_bytes: 3628
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    //nextLineとnextを同時に使ったら死ぬ
    val sc = new Scanner(System.in)
    val a, b, c, d = sc.nextInt()
    val aa = if (a % d == 0) a / d else a / d + 1
    val cc = if (c % b == 0) c / b else c / b + 1

    if (aa >= cc) {
      println("Yes")
    } else {
      println("No")
    }
  }
}


Measured memory_bytes: 55344
import java.io.*;
import java.util.*;

public class Main {

    private static PrintWriter out;

    private static <T> void mprintln(T... ar) {
        for (T i : ar) {
            out.print(i + " ");
        }
        out.println();
    }

    public static void main(String[] args) throws FileNotFoundException {

        // Input from file
        // File inputFile = new File("JavaFile.txt");
        // File outputFile = new File("JavaOutputFile.txt");
        // FileReader fileReader = new FileReader(inputFile);
        // Here it ends

        MyScanner sc = new MyScanner();
        // MyScanner sc = new MyScanner(fileReader);

        out = new PrintWriter(new BufferedOutputStream(System.out)); // Output to console
        // out = new PrintWriter(new PrintStream(outputFile)); // Output to file

        getAns(sc);

        out.close();
    }

    /*
     *Don't use builtin function (Math.ceil)
     */

    static final long MOD = (long) (1e9 + 7);

    private static void getAns(MyScanner sc) {
        int k = sc.ni(), x = sc.ni();
        for (int i = x - k + 1; i <= x + k - 1; i++) out.print(i + " ");
    }

    static class MyScanner {

        BufferedReader br;
        StringTokenizer st;

        MyScanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nn() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }

        char nc() {
            return nn().charAt(0);
        }

        int ni() {
            return Integer.parseInt(nn());
        }

        long nl() {
            return Long.parseLong(nn());
        }

        double nd() {
            return Double.parseDouble(nn());
        }

        int[] niArr0(int n) {
            int[] ar = new int[n];
            for (int i = 0; i < n; i++) {
                ar[i] = ni();
            }
            return ar;
        }

        int[] niArr1(int n) {
            int[] ar = new int[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = ni();
            }
            return ar;
        }

        long[] nlArr0(int n) {
            long[] ar = new long[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nl();
            }
            return ar;
        }

        long[] nlArr1(int n) {
            long[] ar = new long[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nl();
            }
            return ar;
        }
    }
}

Measured memory_bytes: 23252
#include<iostream>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include <vector>
#include <numeric>
#include <map>

typedef long long int ll;
using namespace std;
int main() {
	int A,P;
	cin>> A >> P;
	cout << (A*3+P)/2<<endl;
}

Measured memory_bytes: 256
/*
 * @Author       : nonameless
 * @Date         : 2020-09-19 20:00:41
 * @LastEditors  : nonameless
 * @LastEditTime : 2020-09-19 20:03:08
 */
#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define sz(x) (int)x.size()
#define toStr(name) (#name)
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
const double eps = 1e-6;
const double PI  = acos(-1.0);
const int INF = 0x3f3f3f3f;
const ll LNF  = 0x3f3f3f3f3f3f3f3f;
inline int gcd(int a, int b) { return b ? gcd(b,a % b):a;}
inline ll  gcd(ll  a, ll  b) { return b ? gcd(b,a % b):a;}
inline int lcm(int a, int b) { return a * b / gcd(a, b); }

template<class T>
inline void read(T &x){
    x = 0;
    int f = 1;
    char c = getchar();
    while(c < '0' || c > '9')   { if(c == '-') f = -1;  c = getchar(); }
    while(c >= '0' && c <= '9') { x = x * 10 + c - '0'; c = getchar(); }
    x = x * f;
}

template<class T>
inline void out(string a, T x){ cout << a << " = " << x << endl; }


int main(){

    string s; cin >> s;
    int len = sz(s);
    if(s[len - 1] == 's') s = s + "es";
    else s = s + 's';
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <map>
using namespace std;
int main(){
    string str;
    cin >> str;
    if(str[0]==str[1] && str[1]==str[2] && str[2]==str[3]){
        cout << "No\n";
        return 0;
    }else{
        if(str[0]==str[1]){
            if(str[2] == str[3]){
                cout << "Yes\n";
                return 0;
            }
        }
        if(str[0]==str[2]){
            if(str[1] == str[3]){
                cout << "Yes\n";
                return 0;
            }
        }
        if(str[0]==str[3]){
            if(str[2] == str[1]){
                cout << "Yes\n";
                return 0;
            }
        }
        cout << "No\n";

    }
    
    return 0;
}

Measured memory_bytes: 256
N,x = map(int,input().split())
A = list(map(int,input().split()))
A_org = sum(A)
if A[0]>x:
	A[0]=x
for i in range(N-1):
	if A[i]+A[i+1]>x:
		A[i+1] = x-A[i]

print(A_org-sum(A))

Measured memory_bytes: 14540
def BFS(K,edges,N):
  roots=[ [] for i in range(N)]
  for a,b,c in edges:
    roots[a-1]+=[(b-1,c)]
    roots[b-1]+=[(a-1,c)]
  dist=[-1]*N
  stack=[]
  stack.append(K)
  dist[K]=0
  while stack:
    label=stack.pop(-1)
    for i,c in roots[label]:
      if dist[i]==-1:
        dist[i]=dist[label]+c
        stack+=[i]
  return dist
 
N=int(input())
edges=[]
for i in range(N-1):
  edges+=[list(map(int,input().split()))]
Q,K=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(Q)]
distance=BFS(K-1,edges,N)
for i in range(Q):
  print(distance[xy[i][0]-1]+distance[xy[i][1]-1])


Measured memory_bytes: 86008
#pragma warning(disable:4996)
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iostream>
#include<time.h>
#include<map>
#include<set>
#include<sstream>
#include<cassert>
#include<limits>
using namespace std;
const int INF = 0x3f3f3f3f;
using ll = long long;
using vs = vector<string>;
using vi = vector<int>;

int cntDigists(ll n){
    int digits = 1;
    while(n/10)
    {
        digits++;
        n = n/10;
    }
    return digits;
}

void p1(){
    int a,b,c;
    cin >> a >> b >>c;
    if(c-b == b-a) cout<<"YES"<<endl;
    else cout<<"NO";
}


int main()
{
   //freopen("in.txt", "r", stdin);
    p1();
    return 0;
}



Measured memory_bytes: 256
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from random import *

def readln():
    _res = list(map(int,str(input()).split(' ')))
    return _res

def calc(s):
    res = [0 for ch in s]
    prev = 0
    for i in range(0,len(s)):
        if s[i] == 'A':
            res[i] = (prev - 1) % 3
        else:
            if s[i] == 'B':
                res[i] = (prev + 1) % 3
        prev = res[i]
    return res

def sum(l,r,s):
    l = l - 1
    r = r - 1
    if l > 0:
        res =  s[r] - s[l - 1]
    else:
        res =  s[r]
    return (res + 30000) % 3

s = input()
t = input()
ss = calc(s)
st = calc(t)
q = readln()[0]
for i in range(0,q):
    a,b,c,d = readln()
    x = sum(a,b,ss)
    y = sum(c,d,st)
    if x == y :
        print('YES')
    else:
        print('NO')


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

typedef long long ll;

int n;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    cout << setprecision(10) << fixed;
    if (n & 1) {
        double h = (n - 1) / 2;
        cout << double (h + 1) / n << endl;
    } else {
        cout << 0.5 << endl;
    }

    return 0;
}



Measured memory_bytes: 256
import sys
input = sys.stdin.readline

def solve():
    n, m = map(int,input().split())
    #print(n,m)
    swi = []
    for i in range(m):
        li = list(map(int,input().split()))
        a = 0
        for j in range(1,li[0]+1):
            a += 1 << li[j]-1
        swi.append(a)
    p = list(map(int,input().split()))
    ans = 0
    for i in range(1 << n):
        for j in range(m):
            a = i & swi[j]
            if p[j] != bin(a).count("1")%2:
                break
        else:
            ans += 1
    print(ans)
        
"""
    print(swi)
    print(p)
"""
if __name__ == "__main__":
    solve()


Measured memory_bytes: 3064
#include <stdio.h>
int main()
{
int a[10],i,j;
while(scanf("%1d",&a[0])!=EOF){
for(i=1;i<10;i++)scanf("%1d",&a[i]);
for(i=9;i>=0;i--)
for(j=0;j<i;j++)
a[j]=a[j]+a[j+1]-((a[j]+a[j+1])/10)*10;
printf("%d\n",a[0]);
}
return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(a) ((a).begin(), (a).end())
typedef long long ll;
// const long long INF = 1LL << 60;
const int INF = 1010101010;
// using Graph = vector<vector<int>>;
const int MOD = 1000000007;

int main() {
  long double a, b, c;
  cin >> a >> b >> c;
  long double aa = 2 * sqrt(a * b);
  if (aa + a + b < c)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template<size_t I,class H,class...T>struct TupleReaderWriter{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple_cat(tuple<H>(v),TupleReaderWriter<sizeof...(T)-1,T...>::r(i));}static void w(ostream&o,tuple<H,T...>&t,string d){TupleReaderWriter<I-1,H,T...>::w(o,t,d);o<<d<<get<I>(t);}};
template<class H,class...T>struct TupleReaderWriter<0,H,T...>{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple<H>(v);}static void w(ostream&o,tuple<H,T...>&t,string d){o<<get<0>(t);}};
template<class...T>istream&operator>>(istream&i,tuple<T...>&t){t=TupleReaderWriter<sizeof...(T),T...>::r(i);return i;}
template<class...T>ostream&operator<<(ostream&o,tuple<T...>&t){string delim=" ";TupleReaderWriter<sizeof...(T)-1,T...>::w(o,t,delim);return o;}
template<class T>istream&operator>>(istream&i,vector<T>&v){for(auto&x:v)i>>x;return i;}
template<class T>ostream&operator<<(ostream&o,vector<T>&v){string delim="";for(auto&x:v)o<<delim<<x,delim=" ";return o;}
template<class T>using rev_priority_queue=priority_queue<T,vector<T>,greater<T>>;
template<class T>using vector2d=vector<vector<T>>;
struct fixprec{int x;fixprec(int d):x(d){}};
ostream&operator<<(ostream&o,fixprec f){return o<<fixed<<setprecision(f.x);}
void R_YESNO(bool p) { cout << (p ? "YES" : "NO") << endl; }
void R_YesNo(bool p) { cout << (p ? "Yes" : "No") << endl; }
const i64 MOD = 1e9 + 7;
int main() {
    int N;
    cin >> N;
    i64 ans = 1;
    vector<int> num(N);
    for(int i = 0; i < N; i++) {
        int a;
        cin >> a;
        if (a != 0) {
            ans *= num[a - 1] - num[a];
        } else {
            ans *= 3 - num[a];
        }
        ans %= MOD;
        num[a]++;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 640
import sys
N = int(input())
s = input()
t = input()
for i in range(N):
    flg = True
    for j in range(N - i):
        if s[i + j] != t[j]:
            flg = False
            break
    if flg:
        print(N + i)
        sys.exit()
print(2 * N)


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

int solve(){
    int n, m, k;
    cin >> n >> m >> k;
    if(n == 0) return 1;
    vector<vector<double> > dp(n+1, vector<double>(n*m+1, 0.0));  // dp[i][j] サイコロをi個振って和がj
    dp[0][0] = 1.0;
    for(int i=0;i<n;i++){
        for(int j=i;j<=i*m;j++){
            for(int k=1;k<=m;k++){
                dp[i+1][j+k] += dp[i][j]/m;
            }
        }
    }
    double ans = 0.0;
    for(int i=0;i<=n*m;i++){
        ans += max(i-k,1)*dp[n][i];
    }
    printf("%.8lf\n",ans);
    return 0;
}

int main(){
    while(solve()==0);
    return 0;
}



Measured memory_bytes: 3288
#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const ll mod = 1e9+7;
const int N=2e5+9;
int mx=1e9;
int main()
{
    FASTINOUT;
    int y[3],ans=0;
    cin>>y[0]>>y[1]>>y[2];
    sort(y,y+3);
    ans+=y[2]-y[1];
    y[0]+=(y[2]-y[1]);
    y[1]=y[2];
    ans+=(y[2]-y[0])/2;
    y[0]=y[0]+((y[2]-y[0])/2*2);
    cout<<(y[0]==y[1]?ans:ans+2);
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
 
int main(){
    char ch;
    while((ch = getchar()) != EOF){
            if(ch >= 97 && ch <= 122)
                printf("%c",ch-32);
            else if(ch >= 65 && ch <= 90)
                printf("%c",ch+32);
            else
                printf("%c",ch);
    }
}


Measured memory_bytes: 2492
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int GCD(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   if(_a % _b == 0){
      return _b;
   }
   else{
      return GCD(_b, _a % _b);
   }
}

int LCM(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   return (_a*_b)/(GCD(_a, _b));
}

int main(){
   string s1, s2;
   cin >> s1 >> s2;

   bool is_ok = true;
   for(int i = 0; i < 3; i++){
      if(s1[i] != s2[2-i]){
         is_ok = false;
         break;
      }
   }

   cout << (is_ok ? "YES" : "NO") << endl;

   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long int N,K,H[200001];

int main(){
    cin >> N >> K;
    for (int i=0;i<N;i++) cin >> H[i];

    long int count = 0;
    sort(H,H+N);
    for (int i= 0;i<N-K;i++){
        count += H[i];
    }

    cout << count << endl;
    return 0;
}

Measured memory_bytes: 1792
n, m = map(int, input().split())
a, stack = [0]*(n+1), [0]*(n+1)
for _ in range(m):
    ai = int(input())
    a[ai] = 1
stack[0] = 1
for i in range(1, n+1):
    if a[i] == 1:
        pass
    else:
        stack[i] = stack[i-1] + stack[i-2]
print(stack[-1]%(10**9+7))

Measured memory_bytes: 460788
#                         _
#                        | |
#   ___ _   _ _ __  _   _| | _____
#  / __| | | | '_ \| | | | |/ / _ \
#  \__ \ |_| | | | | |_| |   <  __/
#  |___/\__,_|_| |_|\__,_|_|\_\___|
#
#
n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 1
tmp = 0
for i in l:
    tmp += i
    if tmp <= x:
        ans+=1
print(ans)








#        _           _              _       _
#       | |         | |            | |     (_)
#    ___| |__   ___ | | ___   _  __| | __ _ _
#   / __| '_ \ / _ \| |/ / | | |/ _` |/ _` | |
#  | (__| | | | (_) |   <| |_| | (_| | (_| | |
#   \___|_| |_|\___/|_|\_\\__,_|\__,_|\__,_|_|
#
#


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

int main() {
  int n,d;
  cin >> n >> d;
  if(n%(2*d+1) == 0){
    cout << n/(2*d+1) << endl;
    return 0;
  }
  else{
    cout << n/(2*d+1)+1 << endl;
    return 0;
  }
 }


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

int maxVal(vector<int>&w,vector<int>&v,int index,int remainingCap,vector<vector<int>>&m){
    
    if(m[index][remainingCap]!=-1){
        return m[index][remainingCap];
    }
    
    if(index==0){
        if(w[index]>remainingCap){
            return m[index][remainingCap] = 0;
        }
        else{
            return m[index][remainingCap] = v[index];
        }
    }
    else{
        if(w[index]>remainingCap){
            return m[index][remainingCap] = maxVal(w,v,index-1,remainingCap,m);
        }
        else{
            int choose = v[index] + maxVal(w,v,index-1,remainingCap-w[index],m);
            return m[index][remainingCap] = max(choose,maxVal(w,v,index-1,remainingCap,m));
        }
    }
}

int32_t main(){
    int n,w;
    vector<int>weights,values;
    cin>>n>>w;
    for(int i=0;i<n;i++){
        int w,v;
        cin>>w>>v;
        weights.push_back(w);
        values.push_back(v);
    }
    vector<vector<int>> matrix;
    for(int i=0;i<n;i++){
        vector<int> x;
        for(int i=0;i<=w;i++){
            x.push_back(-1);
        }
        matrix.push_back(x);
    }
    cout<<maxVal(weights,values,n-1,w,matrix)<<endl;

    return 0;
}

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

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

    int i, j, len;
	bool exist;
	len = 0;
    for(i = 0; s[i]; i++) len++;

    s = s + s;
	for(i = 0; i < len; i++){
        exist = true;
        for(j = 0; p[j]; j++){
            if(s[i + j] != p[j]){
                exist = false;
                break;
            }
        }
        if(exist) break;
    }
    if(exist){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 1188
from sys import stdin
import heapq
INF = 1<<21
n = int(stdin.readline())
adj = [[]] * n
for u in range(0, n):
    U = list(map(int, stdin.readline().split()))
    adj[u] = zip(U[2::2], U[3::2])
def dijkstra():
    d = [0] + [INF] * (n - 1)
    hq = [(0, 0)]
    while hq:
        u = heapq.heappop(hq)[1]
        for v, c in adj[u]:
            alt = d[u] + c
            if d[v] > alt:
                d[v] = alt
                heapq.heappush(hq, (alt, v))
    for i, c in enumerate(d):
        print(i, c)
dijkstra()

Measured memory_bytes: 42352
// Last Change: 04/20/2020 00:03:26.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

const ll MOD = 1e9 + 7;

ll calc(ll s, ll e) {
  if (s > e) {
    swap(s, e);
  }
  ll res = (((s + e) * (e - s + 1)) / 2) % MOD;
  return res;
}

int main() {
  ll N, K;
  cin >> N >> K;

  ll res = 0;
  for (ll i = K; i <= N + 1; ++i) {
    ll a = calc(0, i - 1);
    ll b = calc(N - i + 1, N);
    ll temp;
    if (a > b) {
      temp = (b - a + 1) + MOD;
    } else {
      temp = (b - a + 1) % MOD;
    }
    res = (temp + res) % MOD;
  }
  cout << res << endl;
}


Measured memory_bytes: 3192
#include<stdio.h>

int n, A[50];

int solve(int i, int m)
{
	if( m == 0 ) return 1;
	if( i >= n ) return 0;
	int res = solve(i + 1, m) || solve(i + 1, m - A[i]);
	return res;
}

int main()
{
	int q, M, i;

	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &A[i]);
	}
	scanf("%d", &q);
	for (i = 0; i < q; i++)
	{
		scanf("%d", &M);
		if(solve(0, M)) printf("yes\n");
		else printf("no\n");
	}
	return 0;
}


Measured memory_bytes: 2704
#include <bits/stdc++.h>
using namespace std;
#define REP(name, stop) for (ll(name) = 0; (name) < (stop); (name)++)
using ll = long long;
using vi = vector<ll>;

int main(void) {
    ll N, M;
    cin >> N >> M;
    vi A(M);
    REP(i, M) {
        cin >> A[i];
    }
    ll study = accumulate(begin(A), end(A), 0LL);
    ll ans = max(N - study, -1LL);
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3644
H, W = map(int, input().split())
graph = [list(input()) for _ in range(H)]
def rotate_cw(graph):
    height = len(graph)
    width = len(graph[0])
    result = [[] for _ in range(width)]
    for x in range(width):
        for y in range(height - 1, -1, -1):
            result[x].append(graph[y][x])
    return result

for _ in range(max(H, W)):
    for angle in range(4):
        pop = 0
        for i in range(len(graph)):
            if "#" not in graph[i-pop]:
                graph.pop(i-pop)
                pop += 1
        graph = rotate_cw(graph)
for line in graph:
    print("".join(line))

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
 
int seat[100000];
 
int ck(string s){
	if (s == "Vacant"){
		return 0;
	}
	if (s == "Male"){
		return 1;
	}
	return 2;
}
 
int main(){
	int n;
	cin >> n;
	int l = 0, r = n - 1, a;
	string ver;
	
	cout << l << endl;
	cout.flush();
	cin >> ver;
	seat[l] = ck(ver);
	if (!seat[l]) exit(0);
	
	cout << r << endl;
	cout.flush();
	cin >> ver;
	seat[r] = ck(ver);
	if (!seat[r]) exit(0);
	
	while (l != r - 1){
		int mid = (l + r) / 2;
		cout << mid << endl;
		cout.flush();
		cin >> ver;
		seat[mid] = ck(ver);
		
		if (!seat[mid]) exit(0);
		if(abs(seat[mid] - seat[l]) != (mid - l) % 2) r = mid;
		else l = mid;
	}
	cout << l << endl;
	cout.flush();
	cin >> ver;
	seat[l] = ck(ver);
	if (!seat[l]){
		exit(0);
	}
	
	cout << r << endl;
	cout.flush();
	cin >> ver;
	seat[r] = ck(ver);
	if (!seat[r]){
		exit(0);
	}
}

Measured memory_bytes: 852
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  Int q;
  cin>>q;
  list<Int> l;
  auto a=l.end();
  for(Int i=0;i<q;i++){
    Int t;
    cin>>t;
    if(t==0){
      Int x;
      cin>>x;
      a=l.insert(a,x);
    }
    if(t==1){
      Int d;
      cin>>d;
      for(Int i=0;i<-d;i++) --a;
      for(Int i=0;i<d;i++)  ++a;
    }
    if(t==2){
      a=l.erase(a);
    }
  }
  for(Int x:l) cout<<x<<endl;
  return 0;
}



Measured memory_bytes: 18532
#include <stdio.h>
  
int main(){
    int sum = 0;
    char ch;
  
    while(true)
    {
        while((ch = getchar()) != '\n'){
            sum += ch - '0';
        }
        if(sum == 0)
            break;
        else{
            printf("%d\n",sum);
            sum = 0;
        }
    }
}


Measured memory_bytes: 2608
main :: IO ()
main = do
    -- {{{ 入力

    -- r <- readLn -- 入力が一行に一文字の場合
    as <- map read . words <$> getLine -- 一行に入力が複数ある場合

    -- }}}

    -- {{{ Solver

    -- putStrLn $ show $ solve a b -- solveの返り値がString型の場合
    -- putStrLn $ solve a b

    -- }}}

    putStrLn $ show $ solve as -- showの返り値がString型の場合

solve :: [Int] -> Int
solve [a, b, c] = if floor (fromIntegral b / fromIntegral a) < c
                    then floor (fromIntegral b / fromIntegral a)
                    else c


{-- その他 備忘録
    {{{ 型変換
       int 2 float: fromIntegral
       float 2 int: round 四捨五入
                    floor 床関数
                    ceiling 天井関数
       int 2 string: show
    }}}

    {{{ モジュール
        Data.List: sort
    }}}
--}


Measured memory_bytes: 508
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
#define EPS 1e-9
#define DEBUG 0
#define ll long long
#define Pll pair<ll, ll>
#define Pii pair<int, int>
 
using namespace std;
struct edge{int from, to; ll cost;};

signed main(){
    ios::sync_with_stdio(0); cin.tie(0);
    string s;
    cin >> s;

    int total = 0;
    rep((int)s.length()) total += int(s[i] - '0');

    if(stoi(s) % total == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ordered_set tree<long long, null_type,less<long long>, rb_tree_tag,tree_order_statistics_node_update>
//s.find_by_order(index) returns iterator to the index-th element
//in O(logn) time.



typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vii;
typedef vector<string> vss;
typedef vector<pair<ll, ll> > vpll;
typedef unordered_map<ll ,ll> mpll;
typedef unordered_map<int ,int> mpii;
typedef unordered_map<char ,ll> mpcl;
typedef pair<ll , ll> pll;
typedef complex<double> cd;
typedef vector< complex<double> > vcd;


#define fore(i,n) for(i=0;i<n;i++)
#define forz(i,s,f) for(i=s;i<f;i++)
#define forer(i,n) for(i=n-1;i>=0;i--)
#define forzr(i,s,f) for(i=s;i>=f;i--)
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ff first
#define ss second
#define pvec(i,vec) fore(i,vec.size())cout<<vec[i]<<" ";cout<<"\n";

const ll mod=1e9+7;
const ll modulo=998244353;
const double pi = 3.14159265358979323846;


ll power(ll x,ll y,ll m)//gives (x^y)%m
{
    ll ans=1;
    while (y>0)
    {
        if(y & 1)
        {
            ans=(ans*x)%m;
        }
        y=y/2;
        x=(x*x)%m;
    }
    return ans;
}

bool sortbysec(pll &a,pll &b)
{
    return(a.ss<b.ss);
}

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

ll lcm(ll a,ll b)
{
	ll ans=(a*b)/gcd(a,b);
	return ans;
}

long double logn(long double a,long double n)
{
	return(log(n)/log(a));
}

int main(int argc, char const *argv[])
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
    
	ll te=1,test,i,j,n,m,flag,k,p,temp;
	//cin>>te;
	for(test=1;test<=te;test++)
	{
		cin>>n>>k;


		vll a(n);
		fore(i,n)
		{
			cin>>a[i];
		}
		
		sort(a.begin(), a.end());
		ll ans=0;
		fore(i,k)
		ans+=a[i];

		cout<<ans<<"\n";
		//cout<<"hello\n";
		//cout<<"Case #"<<test<<": ";
	}

	return 0;
}

Measured memory_bytes: 3640
a,b = gets.split.map(&:to_i)

a_min = ((a.to_f / 8.0).to_f * 100).round
a_max = (((a.to_f + 0.9) / 8.0).to_f * 100).round
b_max = ((b + 0.9) * 10).round
b_min = b * 10

eight = (a_min..a_max).to_a
ten = (b_min..b_max).to_a

if (eight & ten).size == 0
  puts -1
else
  puts (eight & ten).min
end

Measured memory_bytes: 1788
#include<bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp> 
    #include <ext/pb_ds/tree_policy.hpp> 
    using namespace std;
    using namespace __gnu_pbds; 
    #define lli long long int
    #define fr(i,a,b) for(lli i=a;i<b;i++)
    #define bfr(i,a,b) for(lli i=a;i>=b;i--)
    #define fio ios_base::sync_with_stdio(false); cin.tie(NULL),cout.tie(NULL);
    #define tc int t;cin>>t;while(t--)
    #define mod 1000000007LL
    #define mod2 998244353LL
    #define all(vec) vec.begin(),vec.end()  
    #define ld long double
    #define pb push_back

    #define ordered_set tree<lli, null_type,less<lli>, rb_tree_tag,tree_order_statistics_node_update> 


       int main()
    {
                           
             

            
                        
              fio   
             
              lli n,sum=0;
              cin>>n;
              lli a[n+1];map<lli,lli> m;
              fr(i,1,n+1){
                cin>>a[i];
                sum+=m[i-a[i]];
                m[i+a[i]]++;}
              
              cout<<sum;
return 0;}

Measured memory_bytes: 27892
W, H, x, y, r  = map(int, input().split())

if x-r >= 0:
  if y-r >= 0:
    if y+r <= H:
      if x+r <= W:
        print("Yes")
      else:
        print("No")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")


Measured memory_bytes: 5596
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

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

const int MAX_E = 100000;
const int MAX_V = 100000;

struct edge
{
    int from;
    int to;
    int cost;
}; // 頂点fromから頂点toへのコストcostの辺

edge es[MAX_E]; // 辺
int d[MAX_V];   // 最短距離
int V, E;       // Vは頂点数,Eは辺の数

// s番目の頂点から各頂点への最短距離を求める
bool bellman_ford(int s)
{
    for (int i = 0; i < V; i++)
    {
        d[i] = INF;
    }
    d[s] = 0;

    int cnt = 0;

    while (true)
    {
        bool update = false;
        for (int i = 0; i < E; i++)
        {
            edge e = es[i];
            if (d[e.from] != INF && d[e.to] > d[e.from] + e.cost)
            {
                d[e.to] = d[e.from] + e.cost;
                update = true;
            }
        }
        if (!update)
        {
            return true;
        }
        if (cnt >= V)
        {
            return false;
        }
        cnt++;
    }
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int s;
    cin >> V >> E >> s;
    for (int i = 0; i < E; i++)
    {
        cin >> es[i].from >> es[i].to >> es[i].cost;
    }
    bool flg = bellman_ford(s);
    if (!flg)
    {
        cout << "NEGATIVE CYCLE" << endl;
    }
    else
    {
        for (int i = 0; i < V; i++)
        {
            if (d[i] == INF)
            {
                cout << "INF" << endl;
            }
            else
            {
                cout << d[i] << endl;
            }
        }
    }
}


Measured memory_bytes: 3216
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
  int n, m;
  cin >> n >> m;
  cout << (n*(n-1)+m*(m-1))/2 << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    long long i,j,a,b,c=0,l=0,t,x,y,n;
    string s;
    cin>>s;
  for(i=0;i<s.size();i++)
  {
    c+=int(int(s[i])-48);
  }
if(c%9==0) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
 return 0;
}

Measured memory_bytes: 3688
#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 ALL(x) (x).begin(), (x).end()

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1e15;
const ll MOD = 1e9 + 7;

int main() {
  ll k;
  cin >> k;
  vector<ll> ans(50, 49 + k / 50);
  ll cnt = k % 50;
  cout << 50 << endl;
  REP(i, 50) {
    if (i < cnt) {
      ans[i] += 50 - (cnt - 1);
    } else {
      ans[i] -= cnt;
    }
    cout << ans[i] << " ";
  }

  return 0;
}

Measured memory_bytes: 256
function Main(input) {
   	var inputArray = input.split("\n");
	var inputLine=inputArray[0].split(" ");
	var M1=inputLine[0]*1;
	var D1=inputLine[1]*1;
	var inputLine=inputArray[1].split(" ");	
	var M2=inputLine[0]*1;
	var D2=inputLine[1]*1;
	
	if(D2==D1+1){
		console.log("0");
	}else{
		console.log("1");		
	}
}
     
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
import sys


def main() -> None:
    x, y = [int(next_str()) for _ in range(2)]

    cnt = 0
    if abs(x) < abs(y):
        cnt += x < 0
        cnt += y < 0
    elif abs(x) > abs(y):
        cnt += x > 0
        cnt += y > 0
    else:
        cnt += sign(x) != sign(y)

    print(abs(abs(x) - abs(y)) + cnt)


def sign(n: int):
    if n == 0:
        return 0
    else:
        return n / abs(n)


def next_str() -> str:
    result = ""
    while True:
        tmp = sys.stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

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

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef array<int, 3> tri;
typedef long double ld;

template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;}
template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;}


int med(vector<int> a) {
        sort(all(a));
        return a[sz(a) / 2];
}



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

        int b = med(a);
        ll ans = 0;
        for (int i = 0; i < n; i++) ans += abs(a[i] - b);
        cout << ans;
}



signed main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//        freopen("input.txt", "r", stdin);
        int _t = 1;
//        cin >> _t;
        while (_t--) _main();
        return 0;
}


Measured memory_bytes: 4744
#include "bits/stdc++.h"
#define LF '\n'
#define ALL(x) x.begin(), x.end()
using namespace std;
typedef int64_t i64;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF = 0x3f3f3f3f;
template<class Itr> void dump(Itr begin, Itr end) { for (;begin != end; ++begin) clog << *begin << LF; }

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

  int a[3];
  cin >> a[0] >> a[1] >> a[2];

  sort(a,a +3);
  if (a[0] == 5 && a[1] == 5 && a[2] == 7) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const int inf = 1000000007;
string a;
string b;
string c;
signed main() {
	int n;
	cin >> n;
	cin >> a >> b >> c;
	int ans = 0;
	rep(i, n) {
		if (a[i] == b[i] && b[i] == c[i]&&a[i]==c[i]) {}
		else if ((a[i] != b[i] && b[i] == c[i]) || (a[i] == b[i] &&b[i]!=c[i])||(a[i]==c[i]&&b[i]!=c[i]))ans++;
		else ans += 2;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
    #define ll          long long
    #define pb          push_back
    #define eb          emplace_back
    #define c(P)        cout<<P<<"\n"
    #define pii         pair<ll,ll>
    #define mi          map<ll,ll>
    #define mii         map<pii,ll>
    #define mp(x,y)     make_pair(x,y) 
    #define exit(x)     cout<<x<<"\n",return
    #define mem(a,val)  memset(a,val,sizeof(a))
    #define fr(i,a,n)   for(ll i=a;i<n;i++)
    #define frr(i,a,n)  for(ll i=n-1;i>=a;i--)
    const ll N=500005;
    const ll mod = 1e9 + 7;
    ll dp[N],a[N];
      ll n;
    using namespace std;
     
    void solve()
    {
      ll T=1;
      //cin>>T;
      while(T--)
      {
     // string s;
      cin>>n;
      for (ll i = 1; i <= N; ++i)
      {
      cin>>a[i];
      dp[i] = mod;
      }
    dp[2] = abs(a[2] - a[1]);
    dp[3] = min(abs(a[3] - a[1]),abs(a[3] - a[2]) + abs(a[2] - a[1]));
      for (int i = 4; i <= n; ++i)
      {
        dp[i] = min(dp[i-2] + abs(a[i]-a[i-2]),dp[i-1] + abs(a[i]-a[i-1]));
       
      }
      
    cout<<dp[n]<<" ";
     
     }
    }
     
    signed main(){

            ios_base::sync_with_stdio(false);   
            cin.tie(NULL);
           solve();
        return 0;
        }

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

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

    int x = 0, ans = 0;
    for(int i=0; i<n; i++){
        if(s[i] == 'I') x += 1;
        if(s[i] == 'D') x -= 1;
        ans = max(ans, x);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import collections
import sys
import numpy as np
input = sys.stdin.readline
table = collections.defaultdict(set)
N = int(input())
S = [list(input().rstrip()) for i in range(N)]
T = [[""] * (N*2) for i in range(2*N)]
table2 = [[set() for j in range(N)] for i in range(N)]

for i in range(2*N):
    if i < N:
        T[i] = S[i] + S[i]
    else:
        T[i] = S[i - N] + S[i-N]
ans = 0
T = np.array(T)
for i in range(N):
    tmp = T[i:i+N, N-1-i:2*N-1-i]

    if (tmp == tmp.T).all():
        ans += N - (N // 2)

    tmp = T[i+1:i+N+1, N-1-i:2*N-1-i]

    if (tmp == tmp.T).all():
        ans += N // 2
print(ans)


Measured memory_bytes: 39928
#include<iostream>

using namespace std;

long long int mod (long long int a) {
    long long int x[4] = {a,1,a+1,0};
    return x[a % 4];
}

long long int A,B;
int main () {
    cin >> A >> B;
    if(A==0) cout << mod(B) << endl;
    else if(A==B) cout << A << endl;
    else cout << (mod(B) ^ mod(A-1)) << endl;
    return 0;
}


Measured memory_bytes: 256
n, m = map(int, input().split())
from collections import defaultdict as dd
d_ac = dd(lambda:0)
d_wa = dd(lambda:0)
for i in range(m):
  p, sc = input().split()
  if sc == "AC":
    d_ac[p] = 1
  if sc == "WA":
    if d_ac[p] == 0:
      d_wa[p] += 1

total_ac = sum(d_ac.values())
total_wa = 0
for key in d_ac.keys():
  if d_ac[key] == 1:
    total_wa += d_wa[key]
print(total_ac, total_wa)

Measured memory_bytes: 69080
/*
[abc131] D - Megalomania
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;

const int MAX_N = 2e5;

int N;
pii BA[MAX_N];

bool solve() {
    sort(BA, BA + N);

    ll s = 0;
    for (int i = 0; i < N; i++) {
        int a = BA[i].second;
        int b = BA[i].first;

        s += a;
        if (s > b) {
            return false;
        }
    }

    return true;
}

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> BA[i].second >> BA[i].first;
    }

    cout << (solve() ? "Yes" : "No") << endl;

    return 0;
}


Measured memory_bytes: 1792
n = int(input())
if n == 0:
    print(2)
    exit()
if n == 1:
    print(1)
    exit()
l = [2, 1] + [0]*(n-1)
for i in range(2, n+1):
    l[i] = l[i-2] + l[i-1]
print(l[-1])


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <map>
#include <utility>
#include <vector>
#include <cstdio>
#include <iomanip>
#include <cmath>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)

int main(){
    int n, p[20];
    cin >> n;
    rep(i,n) cin >> p[i];

    int cnt = 0;
    for (int i = 1; i < n-1; i++) {
        if ((p[i] >= p[i-1] && p[i] <= p[i+1]) || (p[i] >= p[i+1] && p[i] <= p[i-1])) {
            ++cnt;
        }
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,A,B;
  cin >> N >> A >> B;
  
  
    if (N*A > B) {
      cout << B << endl;
    }else if (N*A == B) {
      cout << B << endl;
    }else if (N*A <B){
      cout << N*A << endl;
    }
}

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

int main(){
  int wmax,hmax,n;
  cin >>wmax>>hmax>>n;
  int wmin=0;
  int hmin=0;
  int inp[n][3];
  rep(i,n){
    rep(j,3){
      cin >>inp[i][j];
    }
  }
  rep(i,n){
    if(inp[i][2]==1) wmin=max(wmin,inp[i][0]);
    if(inp[i][2]==2) wmax=min(wmax,inp[i][0]);
    if(inp[i][2]==3) hmin=max(hmin,inp[i][1]);
    if(inp[i][2]==4) hmax=min(hmax,inp[i][1]);
  }
  
  if(wmax>wmin&&hmax>hmin){
  cout<<(wmax-wmin)*(hmax-hmin)<<endl;
  }
  else cout<<0<<endl;
}
    
  

Measured memory_bytes: 256