akhauriyash/Code-Regression huggingface dataset:
void main() {
	(arr => arr.uniq.array.length == 1 ? "Yes" : "No")(readAs!(int[])).writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

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

int main()
{
    string s;
    cin >> s;
    ll sum = 0;
    rep(i, 0, s.size()){
        sum += s[i] - '0';
        sum %= 9;
    }
    if(sum == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3692
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);
	static int[] leaf;

	public static void main(String[] args) throws Exception {
		double EPS = 1e-9;
		while (true) {
			double D = sc.nextDouble();
			if (D == 0) break;
			double px = sc.nextDouble();
			double py = sc.nextDouble();
			double vx = sc.nextDouble();
			double vy = sc.nextDouble();
			if (Math.abs(px * vy - py * vx) > EPS) {
				System.out.println("impossible");
				continue;
			}
			double dist = Math.sqrt(px * px + py * py);
			double v = Math.sqrt(vx * vx + vy * vy);
			if (px * vx >= 0 && py * vy >= 0) {
				dist = (2 - dist);
			}
			double time = dist / v;
			if (time < D) {
				System.out.println(dist);
			} else {
				System.out.println("impossible");
			}
		}
	}

}

Measured memory_bytes: 12000
n=int(input())
l=list(input())
ans=0
for i in range(10):
  for j in range(10):
    for k in range(10):
      now=str(i)
      count=0
      b=True
      f=1
      while count<n and b:
        if l[count]==now:
          if f==1:
            now=str(j)
            f+=1
          elif f==2:
            now=str(k)
            f+=1
          else:
            b=False
            ans+=1
        count+=1
print(ans)
            

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

long long gcd(long long a,long long b){
    while(a&&b){
        if(a>b){
            a = a%b;
        }else{
            b = b%a;
        }
    }
    return a+b;
}



int main()
{
    int n;
    std::cin>>n;
    std::vector<int> v(n);
    for(int i=0;i<n;i++)std::cin>>v[i];

    int greaterst = gcd(v[0],v[1]);
    for(int i=1;i<n;i++){
        greaterst = gcd(v[i],greaterst);
    }
    std::cout<<greaterst<<std::endl;
    
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main() {
    string S;
    cin >> S;
    if (S == "a"){
      cout << "vowel" << endl;
    }
    else if (S == "i"){
      cout << "vowel" << endl;
    }
    else if (S == "u"){
      cout << "vowel" << endl;
    }
    else if (S == "e"){
      cout << "vowel" << endl;
    }
    else if (S == "o"){
      cout << "vowel" << endl;
    }
    else {
    cout << "consonant" << endl;
    }
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define mod1 1000000007
#define mod2 1000000009
int getTheAnswer() {
    return 42;
}

using namespace std;
using ll=long long;

class CTsundoku {
public:
	void solve(std::istream& cin, std::ostream& cout) {
        int n,m,k;
        cin>>n>>m>>k;
        ll a[n],b[m];
        ll val=0,counta=n,countb=0,ans=INT_MIN;
        for (int i=0;i<n;i++){
            cin>>a[i];
            val+=a[i];
        }
        for (int i=0;i<m;i++)
            cin>>b[i];
        while (true){
            if (val<=k){
                ans=max(counta+countb,ans);
                if (countb<m){
                    val+=b[countb];
                    countb++;
                }
                else break;
            }
            else{
                if (counta==0)
                    break;
                counta--;
                val-=a[counta];
            }
        }
        cout<<ans<<endl;
	}
};


int main() {
	CTsundoku solver;
	std::ios::sync_with_stdio(false);
	std::cin.tie(NULL);
	std::cout.tie(NULL);
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 6768
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
/* constant */
const int MAX = 100001;
/* global variables */
/* function */
/* main */
int main(){
    vector<set<pii> > vs(MAX, set<pii>());

    int N, M;
    cin >> N >> M;
    int p, y;
    for (int i = 0; i < M; i++) {
        cin >> p >> y;
        vs[p].insert(pii(y, i));
    }

    vector<pis> vp;
    for (int i = 1; i <= N; i++) {
        int j = 1;
        for (auto s : vs[i]) {
            ostringstream ss;
            ss << setw(6) << setfill('0') << i << setw(6) << setfill('0') << j << "\n";
            string S(ss.str());
            vp.push_back(pis(s.second, S));
            j++;
        }
    }
    sort(vp.begin(), vp.end());
    for (auto p : vp) cout << p.second;
}


Measured memory_bytes: 17648
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <array>
#include <tuple>
#include <string>
#include <algorithm>
#include <functional> // greater など
#include <cmath>      // abs など
#include <numeric>    // accumulate, gcd など
#include <cassert>    // assert
#include <stdexcept>
#include <bitset>
using namespace std;

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

// GCC, 配列のアクセスなど
#define _GLIBCXX_DEBUG
// Clang, 配列のアクセスなど
#define _LIBCPP_DEBUG 0

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

// constexpr inline ll mod = 1'000'000'007;
constexpr int max_n = 100'000 + 5;

int n,a,b,c;
vector<int> ss(max_n);
map<string,int> ma = { {"BC",0}, {"AC",1}, {"AB",2} };
vector<string> ma2 = { "A", "B", "C" };
vector<vector<int>> ma3 = { {1,2}, {0,2}, {0,1} };
vector<int> play(max_n);

int main()
{
    // 高速な入出力
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << setprecision(15); // 浮動小数の表示の精度

    cin>>n>>a>>b>>c;
    ss.resize(n); play.resize(n);
    rep(i,n) {
        string s; cin>>s;
        ss[i] = ma[s];
    }

    bool win = true;
    vector<int> stat = { a,b,c };
    rep(i,n) {
        int s = ss[i];
        int s0 = ma3[s][0], s1 = ma3[s][1];

        // 両方0なら終わり
        if (stat[s0] == 0 && stat[s1] == 0) {
            win = false; break;
        }
        // 片方0なら手は決まる
        if (stat[s0] == 0) {
            play[i] = s0;
            stat[s0]++;
            stat[s1]--;
        }
        else if (stat[s1] == 0) {
            play[i] = s1;
            stat[s1]++;
            stat[s0]--;
        }
        // 両方1なら先読み 次の手で使う方へ動かす
        else if (stat[s0] == 1 && stat[s1] == 1) {
            if (i + 1 == n) {
                // 最後の場合
                play[i] = s0;
                stat[s0]++;
                stat[s1]--;
            }
            else
            {
                // 先読み
                int t = ss[i+1];
                int t0 = ma3[t][0], t1 = ma3[t][1];
                if (t0 == s0 || t1 == s0) {
                    play[i] = s0;
                    stat[s0]++;
                    stat[s1]--;
                } else {
                    play[i] = s1;
                    stat[s1]++;
                    stat[s0]--;
                }
            }
        }
        // 片方1ならそちらへ それ以外は何でも
        else if (stat[s0] <= stat[s1]) {
            play[i] = s0;
            stat[s0]++;
            stat[s1]--;
        }
        else
        {
            play[i] = s1;
            stat[s1]++;
            stat[s0]--;
        }
    }
    if (win) {
        cout << "Yes\n";
        rep(i,n) {
            cout << ma2[play[i]] << "\n";
        }
    } else {
        cout << "No\n";
    }

    return 0;
}


Measured memory_bytes: 3756
'use strict'

function Main(input) {
  const A = Number(input.split(' ')[0]);
  const B = Number(input.split(' ')[1]);

  if (A <= 8 && B <= 8) {
    console.log('Yay!');
  } else {
    console.log(':(');
  }
  
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());

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

using namespace std;
#define ll long long
#define fr(i,s,e) for(i=s;i<e;i++)

int main(){
    ll n,i,mx=INT_MIN,mn=INT_MAX;
    cin>>n;
    ll a[n];
    fr(i,0,n)
    cin>>a[i];
    fr(i,0,n){
        mn=min(mn,abs(a[i]));
        mx=max(mx,abs(a[i]));
    }
    cout<<mx-mn;
return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
bool b[1000005];
int s[1000005];
int main(){
	int i,j,k;
	int n;
	b[i]=true;
	for(i=2;i<1000000;i++){
		if(b[i]==false){
			for(j=2*i;j<1000000;j+=i){
				b[j]=true;
			}
			s[i]=s[i-1]+1;
		}else{
			s[i]=s[i-1];
		}
	}
	while(cin>>n){
		cout<<s[n]<<endl;
	}
	return 0;
}

Measured memory_bytes: 6044
#include<stdio.h>
#include<ctype.h>
#define SIZE 1200

int main(void)
{
    char c;
    
    while ( (c=getchar()) != '\n') {
        if ( isupper(c)) 
            printf("%c", tolower(c));
        else if ( islower(c)) 
            printf("%c", toupper(c));
        else 
            printf("%c", c);
    }
    putchar('\n');
    
    return 0;
}


Measured memory_bytes: 2100
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;

long long int power(long long int x, long long int n, long long int M) {
	long long int tmp = 1;

	if (n > 0) {
		tmp = power(x, n / 2, M);
		if (n % 2 == 0) tmp = (tmp*tmp) % M;
		else tmp = (((tmp*tmp) % M)*x) % M;
	}
	return tmp;
}

long long int N, M, K, Q, W, H, L, R;
long long int ans;

using namespace std;


int main() {
	ios::sync_with_stdio(false);
	cin >> N >> M;
	long long int num[100001] = {};
	long long int sum[100001] = {};
	long long int big[100001] = {};
	for (int i = 1; i <= N; i++) {
		cin >> num[i];
		sum[i] = sum[i - 1] + num[i];
		big[i] = big[i - 1] + max(num[i], (long long int)0);
	}
	for (int i = 1; (i + M - 1) <= N; i++) {
		long long int box = 0;
		box = max(box,sum[i + M - 1] - sum[i - 1]);
		box += big[N];
		box -= big[i + M - 1];
		box += big[i - 1];
		ans = max(ans, box);
		//cout << box << endl;
	}
	cout << ans << endl;
	return 0;
}

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

int main() {
  int a;
  string s;
  cin >> a >> s;
  if (a >= 3200)
    cout << s << endl;
  else
    cout << "red";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;

int main()
{
    string w, t;
    cin >> w;

    uint cnt = 0;
    do {
        cin >> t;
        if (t == "END_OF_TEXT")
            break;

        transform(all(t), t.begin(), ::tolower);
        if (w == t) {
            cnt++;
        }

    } while (true);

    cout << cnt << endl;
}



Measured memory_bytes: 3216
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define Rep(i, s, n) for (ll i = (ll)s; i < (ll)n; i++)
#define len(array) (sizeof(array) / sizeof(array[0]))
 
 
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    int a[n], b[n];
    rep (i, n) {
        cin >> a[i];
        b[i] = a[i];
    }
    sort(b, b + n);
    int res = 0;
    rep (i, n) {
        if (a[i] != b[i]) res++;
    }
    if (res == 0 || res == 2) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 3600
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

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

int main(){
    long a,b;
    long long l,g;
    while (scanf("%ld %ld",&a,&b)!=EOF){
        g=gcd(a,b);
        l=a/g*b;
        printf("%lld %lld\n",g,l);
    }
    return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
#define uint unsigned int
#define ull  unsigned long long
typedef string str;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define fi first
#define se second
#define ins insert
#define all(x) (x).begin(), (x).end()
#define fr(i, n) for(int i = 0; i < n; i++)
#define rall(x) (x).rbegin(), (x).rend()
#define speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int INF = 1e9 + 5;
 
int gcd(int a, int b){
    if(b == 0) return a;
    else return gcd(b, a%b);
}
 
void solve(){
    int a;
    cin >> a;
    ull sum = 0;
    for(int i = 1; i <= a; ++i){
        for(int j = 1; j <= a; ++j){
            for(int k = 1; k <= a; ++k){
                sum += gcd(gcd(i, j), k);
            }
        }
    }
    cout << sum;
    
}
 
 
int main(){
    speed();
    int t = 1;
    // cin >> t;
    while(t--)solve();
}

Measured memory_bytes: 3640
import java.util.Scanner;

class Main{


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		int n = sc.nextInt();
		long[] A = new long[n];

		for(int i = 0;i < n;i++){
			A[i] = sc.nextLong();
		}
		int s = 0;						//左端
		int t = 0;						//右端
		long sum = 0;					//左端から右端までの要素の和
		long ans = 0;

		while(s < n){
			while(t < A.length && sum + A[t] == (sum^A[t])){			//右端の更新
				sum += A[t];
				t++;
			}
			ans += t-s;
			sum -= A[s];
			s++;
			if(s > t){
				t = s;
			}
			
			
		}

		System.out.println(ans);


	}

	static int syautori(int[] data,int S){
		int s = 0;						//左端
		int t = 0;						//右端
		int res = data.length;			//答えの長さ
		int sum = 0;					//左端から右端までの要素の和

		for(;;){
			while(t < data.length && sum < S){			//右端の更新
				sum += data[t];
				t++;
			}
			if(sum < S){				//全部足してもSより小さい時、out
				break;
			}
			res = Math.min(res, t - s);
			sum -= data[s];				//左端の更新
			s++;
		}

		if(res >= data.length){			//全部足してもSより小さい時、0を返す
			res = 0;
		}
		return res;

	}




}



class Pair implements Comparable{
	int from;		//p
	int end;		//y
	int num;
	int bango;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}



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

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

  int N;
  cin >> N;
  vector<int> H(N);
  for(int i = 0; i < N; ++i){
    cin >> H.at(i);
  }
  for(int i = 0; i < N - 1; ++i){
    if(H.at(i + 1) - H.at(i) > 0){
      H.at(i + 1)--;
    }
    else if(H.at(i + 1) < H.at(i)){
      cout << "No" <<endl;
      return 0;
    }
  }
  cout << "Yes" <<endl;
}

Measured memory_bytes: 640
using System;
namespace kozaiyApp
{
    public class B
    {
        static void Main()
        {
            string[] input = Console.ReadLine().Split(' ');
            int A = int.Parse(input[0]);
            int B = int.Parse(input[1]);
            int C = int.Parse(input[2]);
            int D = int.Parse(input[3]);

            int taka = 0;
            int ao = 0;

            int takaT = A;
            int aoT = C;

            // 高橋くん何回攻撃すればよいか
            for (int i = 1; i <= 100; i++)
            {
                if (aoT <= 0)
                {
                    taka = i;
                    break;
                }

                aoT = (aoT - B);
            }

            // 青木くん何回攻撃すればよいか
            for (int i = 1; i <= 100; i++)
            {
                if (takaT <= 0)
                {
                    ao = i;
                    break;
                }

                takaT = (takaT - D);
            }

            // 攻撃数少ないほうがかち
            if (taka == ao)
            {
                Console.WriteLine("Yes");
            }
            else if (taka > ao)
            {
                Console.WriteLine("No");
            }
            else
            {
                Console.WriteLine("Yes");
            }
        }
    }
}


Measured memory_bytes: 27520
function main(input) {
  const R = parseInt(input, 10);
  
  if (R < 1200) {
    console.log('ABC');
  } else if (R < 2800) {
    console.log('ARC');
  } else {
    console.log('AGC');
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 29560
#include <cstdio>
int n;
int main()
{
	scanf("%d",&n);
	n=n%10;
	if(n==2||n==4||n==5||n==7||n==9) printf("hon");
	else if(n==0||n==1||n==6||n==8) printf("pon");
	else printf("bon");
	return 0;
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1000000007;

int main(){
  ll n,m;
  cin>>n>>m;
  string s,t;
  cin>>s>>t;
  ll o=min(n,m);
  while(true){
    if(n%o==0&&m%o==0){
      break;
    }
    o--;
  }
  ll lcm=n*m/o;
  ll x=lcm/n,y=lcm/m;
  ll z=min(x,y);
  if(s.at(0)!=t.at(0)){
    cout<<-1<<endl;
    return 0;
  }
  else {
    while(true){
    if(x%z==0&&y%z==0){
      break;
    }
    z--;
  }
  ll lcm2=x*y/z;
  ll i=1;
  ll ans=0;
  while(lcm2*i<lcm){
    if(s.at(lcm2*i/x)==t.at(lcm2*i/y)){
      i++;
    }
    else{
         ans++;
         break;
    }
  }

    if(ans==0){
         cout<<lcm<<endl;
       }
    else{
         cout<<-1<<endl;
       }
  }
    
    
  
    
  
}
  


Measured memory_bytes: 3728
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>

using namespace std;
using boost::adaptors::reversed;
using boost::irange;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;

int main() {
    double n, m, d;
    cin >> n >> m >> d;
    double k;
    if (d == 0){
        k = n;
    } else if (d <= n / 2) {
        k = 1 * (2 * d) + 2 * (n - 2 * d);
    } else {
        k = 1 * (2 * (n - d));
    }
    double s = k / n / n;
    cout << fixed << setprecision(100) << s * (m - 1);
    return 0;
}


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

inline int Isdigit(char c) {
	if (c < '0' || c > '9') return 0;
	return 1;
}
inline int readint(){
    register int x = 0, flag = 1;
    register char ch;
    while (!Isdigit(ch = getchar())) if (ch == '-') flag = -1;
    while (x = x * 10 + (ch & 15), Isdigit(ch = getchar()));
	return x * flag;
}

inline long long readlong() {
	register long long x = 0, flag = 1;
	register char ch;
	while (!Isdigit(ch = getchar())) if (ch == '-') flag = -1;
    while (x = x * 10 + (ch & 15), Isdigit(ch = getchar()));
	return x * flag;
}
template <class T>
inline void write(T x){
    if (x < 0)
        putchar('-'), x = -x;
    if(x >= 10) write(x / 10); 
    putchar(x % 10 + '0');
}

template<class T> inline bool Chkmax(T& x, const T& y) { return x < y ? x = y, true : false; }
template<class T> inline bool Chkmin(T& x, const T& y) { return x > y ? x = y, true : false; }

#define For(i, x, y) for (int i = (x); i <= (y); i++) 
#define Rep(i, x, y) for (int i = (x); i >= (y); i--) 
#define ri readint
#define rl readlong

#define int long long
signed main() {
	int n, a, b;
	cin >> n >> a >> b;
	int op = (n / (a + b));
	int ans = op * a;
	int yu = n % (a + b);
	if (yu <= a) ans += yu;
	else ans += a;
	cout << ans;
	return 0;
}

Measured memory_bytes: 3600
#include <stdio.h>
 
int main( void )
{
	int N,M,C ;
	scanf("%d %d %d", &N, &M, &C ) ;
	int B[20];
	for( int m = 0 ; m < M ; m++ ) {
		scanf("%d", &B[m]) ;
	}
	int c = 0 ;
	for( int n = 0 ; n < N ; n++ ) {
		int a = C ;
		for( int m = 0 ; m < M ; m++ ) {
			int v ;
			scanf("%d", &v) ;
			a += v*B[m];
		}
		if( a > 0 ) c++ ;
	}
	printf("%d\n", c ) ;
	return 0 ;
}


Measured memory_bytes: 256
import Data.List
import Data.Maybe

main = do
  [n,k] <- map read.words <$> getLine
  as <- map read.words <$> getLine
  print $ solve n k as

solve :: Int -> Int -> [Int] -> Int
solve n k as = fromJust $ find eval ds where
  eval d = sum inc <= k where
    inc = take (n - sum rs `div` d) rs
    rs = sort $ map (`mod` d) as
  ds = sortBy (flip compare) (divisiors $ sum as)

divisiors n = f $ takeWhile ((<=n).(^2)) [1..] where
  f (x:xs)
    | r == 0 && q /= x = x: q: f xs
    | r == 0 = x: f xs
    | otherwise = f xs
    where (q, r) = divMod n x
  f _ = []


Measured memory_bytes: 1532
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define ALL(a) (a).begin(), (a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef pair<ll, ll> pii;
const ll INF = 1LL << 58;
const ll MOD = 1000000007;
typedef vector<pii> vpii;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

/* a と b の最大公約数を返す関数 */
long long GCD(long long a, long long b)
{
    if (b == 0)
        return a;
    else
        return GCD(b, a % b);
}

/* a と b の最小公倍数を求める */
long long LCM(long long a, long long b)
{
    long long g = GCD(a, b);
    return a / g * b;
}

long long modinv(long long a, long long m)
{
    long long b = m, u = 1, v = 0;
    while (b)
    {
        long long t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0)
        u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod)
{
    long long res = 1;
    while (n > 0)
    {
        if (n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
const int MAX = 510000;

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()
{
    int N, a, b;
    cin >> N >> a >> b;
    int all = modpow(2, N, MOD);
    int aa = 1;
    REP(i, a)
    {
        aa = aa * (N - i) % MOD;
        aa = aa * modinv(i + 1, MOD) % MOD;
    }
    int bb = 1;
    REP(i, b)
    {
        bb = bb * (N - i) % MOD;
        bb = bb * modinv(i + 1, MOD) % MOD;
    }
    aa = aa + bb + 1;
    aa %= MOD;
    all -= aa;
    if (all < 0)
        all += MOD;
    cout << all << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF (1LL<<60)
#define MOD7 1000000007LL
#define PREP(i, s, x) for(ll i = (s); i < (x); i ++)
#define MREP(i, s, x) for(ll i = (s); i >= (x); i --)
#define REP(i, x) PREP(i, 0, x)
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;
template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return 1;}return 0;}
ll llpow(ll a, ll n){ll res=1;REP(_,n){res*=a;}return res;}

int main(){
    ll n;
    cin >> n;
    vector<P> xy(n);
    REP(i, n){
        cin >> xy[i].first >> xy[i].second;
    }

    vector<ll> v(n);
    ll kaijo = 1;
    REP(i, n){
        v[i] = i;
        kaijo *= (i + 1);
    }

    double sum = 0.0;

    do{
        REP(i, n-1){
            double dx = abs(xy[v[i]].first - xy[v[i + 1]].first);
            double dy = abs(xy[v[i]].second - xy[v[i + 1]].second);
            sum += sqrt(dx * dx + dy * dy);
        }
    } while (next_permutation(v.begin(), v.end()));

    cout << fixed << setprecision(10) << (sum / (double)kaijo) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;  // vi <=> vl
using P = pair<int, int>;  // int <=> ll
const int MOD = 1e9+7;
const double EPS = 1e-9;

int main() {
  int n, a, b; cin >> n >> a >> b;
  vi arr(n);
  rep(i,n) cin >> arr[i];
  int ratio = b/a;
  ll ans = 0;
  rep(i,n-1) {
    if (arr[i+1] - arr[i] <= ratio) ans += (arr[i+1] - arr[i]) * a;
    else ans += b;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define		pb              push_back
#define		PB              pop_back
#define		nn              "\n"
#define     O_O             ios_base::sync_with_stdio(false); cin.tie(NULL)
#define		all(p)          p.begin(),p.end()
#define		zz(v)           v.size()
#define		ss              ' '
#define 	S(a)            scanf("%lld",&a)
#define 	SS(a,b)         scanf("%lld %lld",&a,&b)
#define 	SSS(a,b,c)      scanf("%lld %lld %lld",&a,&b,&c)
#define		gcd(a,b)        __gcd(a,b)
#define		lcm(a,b)        (a*b)/gcd(a,b)
#define		pi              acos(-1.0)
typedef		long long       ll;
typedef		vector<ll>      vll;


int main()
{
 //O_O ;
   ll k,n;
   cin>>k>>n;
   if(k*500>=n)
    cout<<"Yes"<<nn;
   else cout<<"No"<<nn;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<long double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }
#define INF 1LL<<60
const double PI=3.14159265358979323846;
int main() {
    double R;
    cin >> R;

    printf("%.6f\n", 2*PI*R);
    return 0;
}

Measured memory_bytes: 3780
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func main() {
	var d, g int
	fmt.Scan(&d, &g)
	g /= 100

	num := 0
	ps := make([]int, d)
	cs := make([]int, d)
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	for i := 0; i < d; i++ {
		sc.Scan()
		ps[i], _ = strconv.Atoi(sc.Text())
		num += ps[i]
		sc.Scan()
		c, _ := strconv.Atoi(sc.Text())
		cs[i] = c / 100
	}
	rests := make([]bool, d)
	fmt.Printf("%d\n", searchMin(g, 0, rests, ps, cs))
	return
}

func searchMin(g, idx int, rests []bool, ps, cs []int) int {
	if g <= 0 {
		return 0
	}
	if idx == len(rests) {
		return numOfRests(g, rests, ps)
	}

	n, s := fullScore(idx, ps, cs)
	full := searchMin(g-s, idx+1, rests, ps, cs) + n

	nRests := make([]bool, len(rests))
	copy(nRests, rests)
	nRests[idx] = true
	notFull := searchMin(g, idx+1, nRests, ps, cs)
	if notFull < full {
		return notFull
	}
	return full
}

func fullScore(idx int, ps, cs []int) (num, score int) {
	return ps[idx], ps[idx]*(idx+1) + cs[idx]
}

func numOfRests(g int, rests []bool, ps []int) (num int) {
	l := len(rests)
	for i := l; i > 0; i-- {
		if !rests[i-1] {
			continue
		}
		limit := ps[i-1] - 1
		n := (g + i - 1) / i
		if n == 0 {
			break
		}
		if limit < n {
			n = limit
		}
		num += n
		g -= n * i
	}
	if g <= 0 {
		return num
	}
	return math.MaxInt32
}


Measured memory_bytes: 640
S = gets.chomp
K = gets.to_i

count = 0
count_base = 0

ss = S.split("")

if ss.uniq.size == 1 then
	count = ss.size * K / 2
else
	head = 0
	tail = 0

	if ss[0] == ss[-1] then
		head = ss.index{|x| x != ss[0]}
		tail = ss.size - ss.rindex{|x| x != ss[0]} - 1
	end

	temp = nil
	temp_count = 0

	(head ... ss.size - tail).each{ |i|
		if temp == ss[i] then
			temp_count += 1
		else
			count_base += temp_count / 2
			temp_count = 1
		end
		temp = ss[i]
	}

	if temp_count != 0 then
		count_base += temp_count / 2
	end

	count = count_base * K
	count += (head + tail) / 2 * (K - 1)
	
	count += head / 2
	count += tail / 2
end

puts count

Measured memory_bytes: 1788
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cassert>
using namespace std;

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

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

namespace ABC162_A
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = Console.ReadLine();
            bool ans = (N.Contains("7"));
            
            if (ans)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 17308
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod998 = 998244353;
const ll intmax = 2147483647;
const ll llmax = 9223372036854775807;
const char sp = ' ';

bool b[111111];
int X;

int main() {
	cin >> X;
	b[0] = true;
	for (int i = 0; i < X; i++) {
		if (b[i]) {
			for (int j = 100; j <= 105; j++) {
				b[i + j] = true;
			}
		}
	}
	cout << b[X] << endl;
}

Measured memory_bytes: 384
import java.io.File;
import java.io.FileInputStream;
import java.util.NoSuchElementException;
import java.util.Scanner;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		System.out.println((A * B > C * D) ? A * B : C * D);
	}
}

Measured memory_bytes: 22612
#include<stdio.h>
int main()
{
    int i=0,num=0,max=0;
   char s[30];
   scanf("%s",s);
   
   for(i=0; i<15; i++)
   {
       if(s[i]=='A' || s[i]=='T' || s[i]=='G' || s[i]=='C')
       {
           num+=1;
       }else
       {
           if(num>max)
           {
               max=num;
           }
           num=0;
       }
   }
   printf("%d",max);
    return 0;
}

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

int main() {
	int n,a,b;cin>>n>>a>>b;
	string s;cin>>s;
	int d=0;
	int f=0;
	for(int i=0;i<n;i++){
		if(s[i]=='a'){
			if(d+f<a+b){
				d++;
				cout<<"Yes"<<endl;
			}else{
				cout<<"No"<<endl;
			}
		}else if(s[i]=='b'){
			if((d+f<a+b)*(f<b)){
				f++;
				cout<<"Yes"<<endl;
			}else{
				cout<<"No"<<endl;
			}
		}else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}


Measured memory_bytes: 896
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <iomanip>
#include <map>
#include <set>
#include <tuple>
#include <unordered_map>
#include <iterator>
#include <string>
#include <limits>

using namespace std;

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

template<typename IntType>
struct mat2d_t {
    mat2d_t(size_t h, size_t w) : h(h), w(w) {
        mat = std::vector<std::vector<IntType>>(h, std::vector<IntType>(w, 0));
    }
    mat2d_t(size_t h, size_t w, IntType init) : h(h), w(w){
        mat = std::vector<std::vector<IntType>>(h, std::vector<IntType>(w, init));
    }

    std::vector<IntType>& operator[](size_t p) {
        return mat[p];
    }

    const std::vector<IntType>& operator[](size_t p) const {
        return mat[p];
    }
    size_t height() const {
        return h;
    }
    size_t width() const {
        return w;
    }

private:
    std::vector<std::vector<IntType>> mat;
    size_t h;
    size_t w;
};

int main(int argc, char **argv) {
    string s,t;
    cin >> s >> t;

    mat2d_t<i64> dp(s.size()+1, t.size()+1, 0);

    for (int i=0; i<s.size(); ++i) {
        for (int j=0; j<t.size(); ++j) {
            if (s[i] == t[j]) {
                dp[i+1][j+1] = max(dp[i][j]+1, dp[i][j+1]);
            } else {
                dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
            }
        }
    }
    size_t ss=s.size();
    size_t tt=t.size();
    string ans;
    while (ss > 0 && tt > 0) {
        if (dp[ss][tt-1] == dp[ss][tt]) {
            --tt;
        } else if (dp[ss-1][tt] == dp[ss][tt]) {
            --ss;
        } else {
            --tt; --ss;
            ans += t[tt];
        }
    }
    std::reverse(ans.begin(), ans.end());
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 70784
#include<iostream>
#include<set>
#include <bitset>
#include<queue>
#include<vector>
#include<map>
#include<stack>
#include <cstdio>
#include<algorithm>
#include <sstream>
#include<string>
#include<string.h>
#include <cmath>
#include <iomanip>
#include <string>
#include<list>
#include <limits>
#include <numeric>
#include <type_traits>
#define int long long
#define ll long long
#define mod  1000000007
#define inf 1e17
#define rep(i,j,n) for(int i=j;i<n;i++)
#define P pair<int,int>
double pi = 3.141592653589793;
using namespace std;
//ここから始めよう
int a[5005];int n,k;
bitset<5005>s;
bool c(int mid){
    s=0;s[0]=1;
    rep(i,0,n){
        if(i==mid)continue;
        else s|=(s<<a[i]);
    }
    if(a[mid]>k)return 1;
    rep(i,k-a[mid],k){
        if(s[i])return 1;
    }
    return 0;
}
signed main(){
    cin>>n>>k;
    rep(i,0,n)cin>>a[i];
    int l=0,r=n;
    sort(a,a+n);
    rep(i,0,32){
        int mid=(l+r)/2;
        if(c(mid))r=mid;
        else l=mid;
    }
    cout<<r<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<list>
#include<cmath>
#include<map>
using namespace std;
using ll = long long;
const int INF = 1e9;
#define rep(i,n)for(int i=0;i<n;++i)
#define p pair<int,int>
int main() {
	string S;
	cin >> S;
	int sum = 0;
	for (int i = 0; i < S.size()-1; ++i) {
		if (S[i] != S[i + 1]) {
			sum++;
		}
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 512
#include<stdio.h>
#include<string.h>

int get_upper(int*, int);//????????????operation??????????????????????????¶????????´??°???????????¨??????????????¢?????????

int main(void) {
    int n, i;
    char command[10];
    char north[] = "North";
    char south[] = "South";
    char east[] = "East";
    char west[] = "West";
    char right[] = "Right";
    char left[] = "Left";
    
    scanf("%d", &n);
    
    for(;;) {
        if(n==0){
            break;
        }
        
        //{Upper, North, South, East, West, Under}
        int dice_state[] = {1, 5, 2, 3, 4, 6};
        
        int sum = dice_state[0];
        
        for(i=0; i<n; i++) {
            scanf("%s", command);
            if(strcmp(command,north) == 0) {
                sum += get_upper(dice_state, 0);
            } else if(strcmp(command,south) == 0) {
                sum += get_upper(dice_state, 1);
            } else if(strcmp(command,east) == 0) {
                sum += get_upper(dice_state, 2);
            } else if(strcmp(command,west) == 0) {
                sum += get_upper(dice_state, 3);
            } else if(strcmp(command,right) == 0) {
                sum += get_upper(dice_state, 4);
            } else if(strcmp(command,left) == 0) {
                sum += get_upper(dice_state, 5);
            } else {}
            
           // printf("%d %d %d %d %d %d\n", dice_state[0], dice_state[1], dice_state[2], dice_state[3], dice_state[4], dice_state[5]);
        }
        printf("%d\n", sum);
        
        scanf("%d", &n);
        
    }
    
    return 0;
}

int get_upper(int *dice_state, int operation) {
    int upper = dice_state[0];
    int north = dice_state[1];
    int south = dice_state[2];
    int east = dice_state[3];
    int west = dice_state[4];
    int under = dice_state[5];
    
    switch (operation) {
        case 0://North
        dice_state[0] = south;
        dice_state[1] = upper;
        dice_state[2] = under;
        dice_state[5] = north;
        break;
        case 1://South
        dice_state[0] = north;
        dice_state[1] = under;
        dice_state[2] = upper;
        dice_state[5] = south;
        break;
        case 2://East
        dice_state[0] = west;
        dice_state[3] = upper;
        dice_state[4] = under;
        dice_state[5] = east;
        break;
        case 3://West
        dice_state[0] = east;
        dice_state[3] = under;
        dice_state[4] = upper;
        dice_state[5] = west;
        break;
        case 4://Right
        dice_state[1] = west;
        dice_state[2] = east;
        dice_state[3] = north;
        dice_state[4] = south;
        break;
        case 5://Left
        dice_state[1] = east;
        dice_state[2] = west;
        dice_state[3] = south;
        dice_state[4] = north;
        break;
        default:
        break;
    }
    return dice_state[0];
}

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

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define ALL(a) (a).begin(),(a).end()
const int INF = INT_MAX/3;
const double EPS = 1e-14;

template<typename U, typename T>
void chmin(U &x, T y) { x = min(x, y); }

template<typename U, typename T>
void chmax(U &x, T y) { x = max(x, y); }

typedef long long int lli;
typedef long double ld;

const int VMAX = 1024;
struct edge { int to, cap, rev; };
vector<edge> G[VMAX];
bool used[VMAX];

void add_edge(int from, int to, int cap) {
  G[from].push_back((edge){to, cap, (int)G[to].size()});
  G[to].push_back((edge){from, 0, (int)G[from].size() - 1});
}

int dfs(int v, int t, int f) {
  if (v == t) return f;
  used[v] = true;
  for (int i = 0; i < (int)G[v].size(); i++) {
    edge &e = G[v][i];
    if (!used[e.to] and e.cap > 0) {
      int d = dfs(e.to, t, min(f, e.cap));
      if (d > 0) {
        e.cap -= d;
        G[e.to][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}

int max_flow(int s, int t) {
  int flow = 0;
  while (true) {
    memset(used, 0, sizeof(used));
    int f = dfs(s, t, INF);
    if (f == 0) return flow;
    flow += f;
  }
}

int gcd(int x, int y) {
  return (y == 0 ? x : gcd(y, x % y));
}

int main() {
  const int SOURCE = VMAX - 2, SINK = VMAX - 1;
  int m, n;
  while (cin >> m >> n and m) {
    REP(i, VMAX) { 
      G[i].clear(); 
      used[i] = false;
    }
    vector<int> b_(m), r_(n);
    REP(i, m) { 
      cin >> b_[i]; 
      add_edge(SOURCE, i, 1);
    }
    REP(j, n) { 
      cin >> r_[j];
      add_edge(m + j, SINK, 1);
    }
    REP(i, m) REP(j, n) {
      if (gcd(b_[i], r_[j]) > 1) { add_edge(i, m + j, 1); }
    }

    cout << max_flow(SOURCE, SINK) << endl;
  }
  return 0;
}

Measured memory_bytes: 7596
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>

using namespace std;

#define ALL(c) (c).begin(), (c).end()

int main() {
	int N{};
	int T{};
	cin >> N >> T;

	vector<pair<int,int>> v;

	for (int i = 0; i < N; i++) {
		int c{};
		int t{};
		cin >> c >> t;
		if (t <= T) {
			v.push_back(make_pair(c, t));
		}
	}
	if (!v.empty()) {
		sort(ALL(v));
		cout << v[0].first << endl;
	}
	else {
		cout << "TLE" << endl;
	}
}


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

int main()
{
    int k, n;
    cin >> k >> n;
    int longer = 0;
    int first = -1;
    int preb = 0;
    for(int i = 0; i < n; ++i)
    {
        int t;
        cin >> t;
        if(first < 0)
        {
            first = t;
            preb = t;
        }
        else
        {
            longer = max(longer, t-preb);
            preb = t;
        }
        if(i == n-1)
        {
            longer = max(longer,k+first-t);
        }
    }

    cout << k-longer << endl;
}

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

int main()
{
    int n, x, y;
    cin >> n >> x;
    long long sum = 0;
    for(int i = 1; i < n; i++)
    {
        cin >> y;
        if(x > y)
        {
            sum += x - y;
            x = x - y;
        }
        else
            x = 0;
        
        x += y;
    } 
    cout << sum << endl;
}

Measured memory_bytes: 3624
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
#define P pair<ll, ll>

/* ---------- Constants  */
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;
// const double PI = acos(-1);
// const double EPS = 1e-10;
// mt19937 mert(LL(time(0)));

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */

signed main() {
    int x;
    cin >> x;
    if (x == 3 || x == 5 || x == 7) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;

const ll INF = 1LL << 50;

int main() {
  ll n, x, y;
  cin >> n >> x >> y;

  vll a(n);

  for (ll i = 0; i < n; i++) {
    cin >> a[i];
  }

  if (n == 1) {
    cout << abs(y - a[0]) << endl;
    return 0;
  }

  cout << max(abs(a[n - 2] - a[n - 1]), abs(y - a[n - 1])) << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef _WIN32
#include "debug.hpp"
#endif
using namespace std;

#define rep(i, N)  for(int i = 0; i < (N); i++)
#define reps(i, N) for(int i = 1; i <= (N); i++)
#define repr(i, N) for(int i = (N) - 1; i >= 0; i--)
#define pub push_back

template<typename T> 
void chmax(T &a, T b){ a = max(a, b); };
template<typename T> 
void chmin(T &a, T b){ a = min(a, b); };

typedef long long ll;
typedef pair<int, int> P;
const int INF = 100000000;
const ll LINF = 10000000000000000;
const int MOD = 1000000007;
const int dx[9] = { 0, 1,  0, -1, 1,  1, -1, -1, 0};
const int dy[9] = { 1, 0, -1,  0, 1, -1, -1,  1, 0};
//--------------------------------------//
int H, W;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> H >> W;
	rep(i, W + 2)
		cout << '#';
	cout << endl;
	rep(i, H){
		string s;
		cin >> s;
		cout << "#" + s + "#" << endl;
	}
	rep(i, W + 2)
		cout << '#';
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define RI register int
int read() {
	int q=0;char ch=' ';
	while(ch<'0'||ch>'9') ch=getchar();
	while(ch>='0'&&ch<='9') q=q*10+ch-'0',ch=getchar();
	return q;
}
int a[105],n,ans;
int main()
{
	n=read();
	for(RI i=1;i<=n+n;++i) a[i]=read();
	sort(a+1,a+1+n+n);
	for(RI i=1;i<=n+n;i+=2) ans+=a[i];
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int n = Integer.parseInt(sc.nextLine());
		char[] cArray = sc.nextLine().toCharArray();

		if ((n % 2) != 0) {
			System.out.println("No");
		} else {

			int base = n / 2;
			if (trueOrFalse(cArray, base)) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
		sc.close();
	}

	private static boolean trueOrFalse(char[] cArray, int base) {

		for (int i = 0; i < base; i++) {
			if (cArray[i] != cArray[i + base]) {
				return false;
			}
		}
		return true;
	}

}


Measured memory_bytes: 21844
<?php
 
  list($n, $k) = explode(' ', trim(fgets(STDIN)));
  list($r, $s, $p) = explode(' ', trim(fgets(STDIN)));
  $t = trim(fgets(STDIN));
  $w_table = [
    'r' => 'p',
    's' => 'r',
    'p' => 's',
  ];
  $p_table = [
    'r' => $r,
    's' => $s,
    'p' => $p,
  ];
$total = 0;
$before = '';
$history = '';
for ($i = 0; $i <$n; $i++) {
  $now = substr($t, $i, 1);
  if ($k <= $i) {
    $before = substr($history, ($i-$k), 1);
  }
  $win = $w_table[$now];
  if ($win !== $before) {
      $total += $p_table[$win];
      $history .= $win;
  } else {
    $history .= "a";
  }
}
echo $total . PHP_EOL;

Measured memory_bytes: 4856
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
#include <cassert>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 2e5 + 10;
int a[N];
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n;
	cin >> n;
	vector<pair<int, int>> vp;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
		a[i] = INF - a[i];
	}
	for (int i = 1; i <= n; i++)
	{
		auto iter = lower_bound(vp.begin(), vp.end(), make_pair(a[i], i));
		if (iter == vp.end()) vp.emplace_back(a[i], i);
		else *iter = make_pair(a[i], i);
	}
	cout << vp.size() << endl;
	return 0;
}

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

int main(){
    int a,b,c,d;
    int Takahashi = 0;

    cin >> a >> b >> c >> d;

    
    while((a >= 0)||(c >= 0)){
        c -= b;
        if(c <= 0){
            Takahashi = 1;
            break;
        }
        a -= d;
        if(a <= 0){
            Takahashi = -1;
            break;
        }
    }

    if(Takahashi == 1){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3592
from bisect import bisect_left, bisect_right
import sys
input = sys.stdin.readline

n = int(input())
col_maxs = []
for _ in range(n):
    a = int(input()) * (-1)
    if not col_maxs:
        col_maxs.append(a)
        continue

    curr_max = col_maxs[-1]
    if a >= curr_max:
        col_maxs.append(a)
    else:
        # aより大きい最小要素のindex/value
        ind = bisect_right(col_maxs, a)
        col_maxs[ind] = a

print(len(col_maxs))

Measured memory_bytes: 77440