akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = long long;
using PAIR = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<"\n";
#define debug(x) cerr << #x << ":" << (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

signed main() {
  INIT;

	VAR(int, n);
	VEC(int, s, n);
	sort(ALL(s));

	int ans = 0, mn = INF;
	bool ng = true;
	RREP(i, n) {
		ans += s[i];
		if (s[i] % 10 != 0) {
			mn = min(mn, s[i]);
			ng &= false;
		}
	}

	if (ng) ans = 0;
	else if (ans % 10 == 0) ans -= mn;
	OUT(ans)BR;
  
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
  char str1[8],str2[8],str3[8];
  
  fgets(str1,sizeof(str1),stdin);
  fgets(str2,sizeof(str2),stdin);
  fgets(str3,sizeof(str3),stdin);
  
  printf("%c%c%c",str1[0],str2[1],str3[2]);
  
  return 0;
}

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

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

int main() {
  int n,k,amax=0;
  cin>>n>>k;
  vector<int> a(n);
  rep(i, n) {
    cin>>a[i];
    amax=max(amax, a[i]);
  }

  int x=a[n-1];
  rep(i, n-1) x=gcd(x, a[i]);
  bool frag=true;
  if (amax<k) frag=false;
  if (k%x!=0) frag=false;
  
  if (frag) cout<<"POSSIBLE"<<endl;
  else cout<<"IMPOSSIBLE"<<endl;
  
  return 0;
}

Measured memory_bytes: 640
/**
 *   author:  cryforthemoon46
 *   created: 23.05.2020 21:01:17
**/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define REP(i, n) for(ll i = 0; i < (ll)(n); i++)

const ll INF = (ll)1e18;

ll T, N, A, B, C, D;
map<ll, ll> memo;

ll solve(ll x) {
    if (x == 0) return 0;
    if (x == 1) return D;
    if (memo.count(x)) return memo[x];
    memo[x] = min({
        (x < INF / D) ? x * D : INF,
        llabs((x / 2) * 2 - x) * D + A + solve(x / 2),
        llabs(((x + 1) / 2) * 2 - x) * D + A + solve((x + 1) / 2),
        llabs((x / 3) * 3 - x) * D + B + solve(x / 3),
        llabs(((x + 2) / 3) * 3 - x) * D + B + solve((x + 2) / 3),
        llabs((x / 5) * 5 - x) * D + C + solve(x / 5),
        llabs(((x + 4) / 5) * 5 - x) * D + C + solve((x + 4) / 5),
    });
    return memo[x];
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> T;
    REP(i, T) {
        memo.clear();
        cin >> N >> A >> B >> C >> D;
        cout << solve(N) << endl;
    }
}

Measured memory_bytes: 4344
a,b,q=map(int,input().split())
s=[int(input()) for _ in range(a)]
t=[int(input()) for _ in range(b)]
import bisect
for _ in range(q):
    x=int(input())
    sb=bisect.bisect_left(s,x)
    tb=bisect.bisect_left(t,x)
    ss=[x-s[max(sb-1,0)],x-s[min(sb,a-1)]]
    tt=[x-t[max(tb-1,0)],x-t[min(tb,b-1)]]
    l=[]
    for i in ss:
        for j in tt:
            if i*j>=0:
                l.append(max(abs(i),abs(j)))
            else:
                l.append(max(abs(i),abs(j))+2*min(abs(i),abs(j)))
    print(min(l))


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

namespace AtCoder.Heuristics
{
    class Introduction
    {
        private static int dayN;

        private static int[] c;

        private static int[] t;

        private static int[][] s;

        private static int sumC;

        public static void Score(int[] t, int[] v)
        {
            var last = new int[dayN + 1];
            var sum = c.Sum();
            var dec = 0;
            v[0] = 0;
            for (int i = 1; i <= dayN; i++)
            {
                dec += sum - (c[t[i]] * (i - last[t[i]]));
                last[t[i]] = i;
                v[i] = v[i-1] - dec + s[i][t[i]];
            }
        }

        public static void Main()
        {
            dayN = int.Parse(Console.ReadLine());
            c = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            sumC = c.Sum();

            s = new int[dayN + 1][];
            t = new int[dayN + 1];
            for (int i = 1; i <= dayN; i++)
            {
                s[i] = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
                for (int j = 0; j < s[i].Length; j++)
                    if (s[i][t[i]] < s[i][j])
                        t[i] = j;
            }


            for (int i = 1; i <= dayN; i++)
                Console.WriteLine(t[i] + 1);
        }
    }
}


Measured memory_bytes: 28856
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007LL
#define eps 1e-8
#define N 1000002
#define all(x) (x).begin(), (x).end()

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    vector<int> v(3);
    cin >> v[0] >> v[1] >> v[2];
    sort(all(v));

    if (v[0] == v[1] && v[1] != v[2])
        cout << "Yes\n";
    else if (v[1] == v[2] && v[0] != v[1])
        cout << "Yes\n";
    else
        cout << "No\n";

}


Measured memory_bytes: 256
#! python3
# stableSort.py - 安定的なソートを行っているかどうか判別するプログラム

# インプットの例
# 5
# H4 C9 S4 D2 C3

# コマンド引数から値を受け取る
number = int(input())
array = input().split(' ')
bubble_array = array.copy()
select_array = array.copy()

# bubblesortのアルゴリズム
def bubbleSort(array, number):
    flag = 1
    i = 0
    while flag ==1:
        flag = 0
        for j in range(number-1, i, -1):
            if array[j][1] < array[j-1][1]:
                tmp = array[j]
                array[j] = array[j-1]
                array[j-1] = tmp
                flag = 1
    map_list = map(str, array)
    a = ' '.join(map_list)
    print(a)
    return array

# 選択ソートのアルゴリズム
def selectionSort(array, number):
    # counter = 0
    for i in range(number-1):
        mini_j = i
        for j in range(i + 1, number):
            if int(array[mini_j][1]) > int(array[j][1]):
                mini_j = j

        #if int(array[i][1]) > int(array[mini_j][1]):
        v = array[i]
        array[i] = array[mini_j]
        array[mini_j] = v
            # counter += 1

    map_list = map(str, array)
    a = ' '.join(map_list)
    print(a)
    return array

# 安定ソートかどうかを判別する
def isStable(input, output):
    for i in range(0, number):
        for j in range(i+1, number):
            for a in range(0, number):
                for b in range(a+1, number):
                    if input[i][1] == input[j][1] and input[i] == output[b] and input[j] == output[a]:
                        return 'Not stable'
    return 'Stable'

input = array
output_bubble = bubbleSort(bubble_array, number)
# print(output_bubble)
print(isStable(input, output_bubble))

output_select = selectionSort(select_array, number)
# print(output_select)
print(isStable(input, output_select))


Measured memory_bytes: 5608
D, G = map(int, input().split())
problem = []
bonus = []
for i in range(D):
    pi, ci = map(int, input().split())
    problem.append(pi)
    bonus.append(ci)
ans = float('inf')
for S in range(1 << D):  # Sは2^Dの元
    score = sum([(problem[j] * 100 * (j + 1) + bonus[j]) * ((S >> j) & 1) for j in range(D)])
    count = sum([problem[j] * ((S >> j) & 1) for j in range(D)])
    if score >= G:
        ans = min(ans,count)
    else:
        for i in range(D):
            if (S >> i) & 1 == 0 and score + problem[i] * 100 * (i + 1) >= G: #Sにiが含まれないとき
                count_2 = count + (G - score + (100 * (i + 1)) - 1) // (100 * (i + 1))
                ans = min(ans, count_2)
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL (1LL<<62) // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    Init();
    ll n;
    cin >> n;
    vi a(n+1, 0), t(n+1, 0), mHeight(n, 0);
    repf(i, n) cin >> t[i];
    rep(i, n)  cin >> a[i];

    repf(i, n){
        if(t[i] == t[i-1]) continue;
        mHeight[i-1] = t[i];
        if(a[i-1] < t[i]){
            cout << 0 << endl;
            return 0;
        }
    }

    for(ll i=n-1; i>=0; i--){
        if(a[i] == a[i+1]) continue;
        if(mHeight[i] == 0){
            mHeight[i] = a[i];
            if(t[i+1] < a[i]){
                cout << 0 << endl;
                return 0;
            }
        }
        else if(mHeight[i] != a[i]){
            cout << 0 << endl;
            return 0;
        }
    }

    ll ans = 1;
    rep(i, n){
        if(mHeight[i] == 0){
            ans *= min(t[i+1], a[i]);
            ans %= MODV;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 5556
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9+7;
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  ll a;
  string s;
  cin >> a >> s;
  if(a >= 3200) cout << s;
  else cout << "red";
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

int main()
{
   char s[20];
   scanf("%s",s);
   int l=strlen(s),i;
   int sum=(l-1)*9;
   for(i=1;i<l;i++)//第一种情况
        if(s[i]!='9') break;
    if(i==l) sum+=(s[0]-'0');
    else//第二种
       sum+=(s[0]-'0')-1;
    printf("%d\n",sum);
    return 0;
}


Measured memory_bytes: 256
x, k, d = map(int, input().split())
x = abs(x)
a = x//d
if a>=k:
    ans = x-k*d
else:
    if (k-a)%2==0:
        ans = x-d*a
    else:
        ans = abs(x-(a+1)*d)
    

print(ans)

Measured memory_bytes: 61852
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int res, n, u[101], f[101], L[101];
vector<int> g[101], T[24];

void dfs(int x)
{
    u[x]++;
    for(int v: g[x]) f[v]++;

    int c=0;
    for(int i=x+1;i<n;++i) if (!f[i] and !u[i]) {
        dfs(i);
        ++c;
    }
    if (c==0) {
        int r=0;
        for(int i=0;i<n;++i) if (u[i]) r+=L[i];
        res=max(res, r);
    }

    for(int v: g[x]) f[v]--;
    u[x]--;
}

int main(void)
{
    while (scanf("%d", &n), n) {
        for(int i=0;i<n;++i) g[i].clear();
        for(int i=0;i<24;++i) T[i].clear();
        for(int i=0;i<n;++i) {
            int m;
            scanf("%d%d", &m, L+i);
            for(int j=0;j<m;++j) {
                int s, e;
                scanf("%d%d", &s, &e);
                for(int k=s;k<e;++k) T[k].push_back(i);
            }
            for(int j=0;j<24;++j)
                for(int k: T[j]) for(int l: T[j]) g[k].push_back(l);
            for(int j=0;j<n;++j) {
                sort(begin(g[j]), end(g[j]));
                g[j].erase(unique(begin(g[j]), end(g[j])), end(g[j]));
            }
        }
        res=0;
        memset(u, 0, sizeof(u));
        memset(f, 0, sizeof(f));
        for(int i=0;i<n;++i) dfs(i);
        printf("%d\n", res);
    }
    return 0;
}

Measured memory_bytes: 1484
#include<cstdio>

using namespace std;

int check(int n){
	if(n / 10000 != n % 10) return 0;
	if((n / 1000) % 10 != (n % 100) / 10) return 0;
	return 1;
}

int main(){
	int a, b; scanf("%d %d", &a, &b);
	int res = 0;
	for(int i = a; i <= b; i++){
		if(check(i)) res++;
	}
	printf("%d\n", res);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <cassert>

int main() {
    int n;
    std::cin >> n;
    assert(3 <= n && n <= 20);

    int p[n];

    for (int i=0; i<n; i++) {
        int t;
        std::cin >> t;
        assert(1 <= t && t <= n);
        p[i] = t;
    }

    int count = 0;

    for (int i=0; i<n-2; i++) {
        assert(p[i] != p[i+1]);
        assert(p[i] != p[i+2]);
        assert(p[i+1] != p[i+2]);
        if (p[i+1] < p[i] && p[i+1] < p[i+2]) continue;
        if (p[i+1] > p[i] && p[i+1] > p[i+2]) continue;
        count++;
    }

    std::cout << count << std::endl;

    return 0;
}


Measured memory_bytes: 384
//======================================================================
// Contents    : AOJ ITP1_6_A
//               与えられた数列を逆順に出力
// Input       : n(数列の長さ)、data_in
// Output      : data_out
// Constraints : n ≤ 100
//               0 ≤ data_in < 1000
// Author      : 廣部智也
// LastUpdate  : 2020/06/29
// Since       : 2020/06/17
//======================================================================

#include <stdio.h>
#include <stdlib.h>                                                 // exit 関数を使用するため

#define LOWER_LIMIT   0
#define UPPER_LIMIT 999

// 入力エラーを判断する関数
int Input_error( int number, int lower_limit, int upper_limit );    

// 数列を逆順にする関数
void Sort_Reversal( int n );

int main(){

    int n = 0;
        
    // データの入力
    scanf("%d", &n );

    // 入力エラーの判断
    if( n > 100 ){
        printf("Input error\n");
        return 0;
    }

    // データの出力
    Sort_Reversal( n );

    return 0;
}



//============================================================
// Contents    : 数列を逆順に出力
// Input       : data_in
// Output      : data_out
// Author      : 廣部智也
// LastUpdate  : 2020/06/17
// Since       : 2020/06/17
//============================================================

void Sort_Reversal( int n ){

    int data_in[100]  = {};
    int i = 0;

    // データの入力
    for( i = 0; i < n; i++ ){
        
        scanf("%d", &data_in[i] );

        // 入力エラーの判断
        Input_error( data_in[i], LOWER_LIMIT, UPPER_LIMIT );
    }

    // データの出力
    for( i = 0; i < n - 1; i++ ){

        printf("%d ", data_in[n-i-1] );

    }

    printf("%d\n", data_in[0] );
    

    return;
}



//============================================================
// Contents    : 入力エラーを判断
// Input       : 調べる変数, 下限, 上限
// Output      : エラーなら強制終了
// Author      : 廣部智也
// LastUpdate  : 2020/06/05
// Since       : 2020/06/05
//============================================================

int Input_error( int number, int lower_limit, int upper_limit ){
    
    if( number < lower_limit || number > upper_limit ){
        printf("Input error\n");
        exit(1);
    }

    return 0;
}


Measured memory_bytes: 2104
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
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; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//�]���؂�グ�� =>  (a + b - 1) / b 

signed main(){
	int a,b; cin>>a>>b;
  cout<<(a-b+1)<<endl;
	
	return 0;
}

Measured memory_bytes: 3600
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main{
    public static void main(String[] args) throws IOException{
        FastReader sc = new FastReader();
        for (int i = 0; i < 5; i++){
            if (sc.nextInt() == 0){
                System.out.println(i+1);
                break;
            }
        }
    }
}
class FastReader{ 
    BufferedReader br; 
    StringTokenizer st; 
    public FastReader() { 
        br = new BufferedReader(new InputStreamReader(System.in)); 
    } 
    String next(){ 
        while (st == null || !st.hasMoreElements()) { 
            try{ 
                st = new StringTokenizer(br.readLine()); 
            }catch (IOException  e){ 
                e.printStackTrace(); 
            } 
        } 
        return st.nextToken(); 
    } 
    int nextInt(){ 
        return Integer.parseInt(next()); 
    } 
    long nextLong(){ 
        return Long.parseLong(next()); 
    } 
    double nextDouble(){ 
      return Double.parseDouble(next()); 
    } 
    String nextLine(){ 
        String str = ""; 
        try{ 
            str = br.readLine(); 
        } 
        catch (IOException e){ 
            e.printStackTrace(); 
        } 
        return str; 
    } 
}


Measured memory_bytes: 32672
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct node{
	int key;
	struct node *next;
	struct node *prev;
};

typedef struct node * NodePointer;

NodePointer nil;

/*
NodePointer listSearch(int key){
	NodePointer t;
	for(t = nil -> next;t != nil;t = t -> next){
		if(t -> key == key){
			return t;
		}
	}
}*/

void init(){
	nil = (struct node*)malloc(sizeof(struct node));
	nil -> next = nil;
	nil -> prev = nil;
}

void printList(){
	struct node *p;
	for(p = nil -> next; p != nil;p = p -> next){
		if(p != nil -> prev){
			printf("%d ", p -> key);
		}else if(p == nil -> prev){
			printf("%d\n", p -> key);
		}
	}
	/*
	NodePointer cur = nil -> next;
	int isf = 1;
	while(1){
		if(cur == nil) break;
		if(isf == 0) printf(" ");
		printf("%d\n", cur -> key);
		cur = cur -> next;
		isf = 0;
	}
	printf("\n");
	*/
}

void deleteNode(NodePointer t){
	if(t -> prev == nil){//deleteFirst
		nil -> next = t -> next;
		t -> next -> prev = nil;
		free(t);
	}else if(t -> next == nil){//deleteLast
		nil -> prev = t -> prev;
		t -> prev -> next = nil;
		free(t);
	}else{
		t -> prev -> next = t -> next;
		t -> next -> prev = t -> prev;
		free(t);
	}
}

void deleteFirst(){
	NodePointer t = nil -> next;
	if(t == nil) return;
	deleteNode(t);
}

void deleteLast(){
	NodePointer t = nil -> prev;
	if(t == nil) return;
	deleteNode(t);
}

void del(int key){
	//NodePointer t;
	struct node *p;

	if(nil -> key == key){
		deleteFirst();
		return;
	}
	for(p = nil -> next;p != nil;p = p -> next){
		if(p -> key == key){
			deleteNode(p);
			return;
		}
	}

	//t = listSearch(t);

}

void insert(int key){
	NodePointer x;
	x = (struct node*)malloc(sizeof(struct node));
	x -> key = key;

	if(nil -> next == nil){
		nil -> prev = x;
	}

	x -> next = nil -> next;
	x -> prev = nil;
	nil -> next -> prev = x;
	nil -> next = x;
}

int main(void){
	int key,n,i;
	char com[200];
	scanf("%d", &n);

	init();

	for(i = 0;i < n;i++){
		scanf("%s", com);
		if(com[0] == 'i'){
			scanf("%d", &key);
			insert(key);
		}else if(com[0] == 'd'){
			if(strlen(com) > 6){
				if(com[6] == 'F') deleteFirst();
				else if(com[6] == 'L') deleteLast();
			}else{
				scanf("%d", &key);
				del(key);
			}
		}
	}

	printList();
	return 0;
}

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

int main() {
  int a,b,c,x; cin >> a >> b >> c >> x;

  int ans = 0;
  for(int i = 0; i <= a ; i++) {
    for(int j = 0; j <= b; j++) {
      int check = 500 * i + 100 * j;
      if(check <= x && x <= check + 50 * c) ans++;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3588
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);

	    int D = scanner.nextInt();
	    int N = scanner.nextInt();

	    int answer = (int)Math.pow(100,D) * N;

	    if(N == 100) answer += (int)Math.pow(100,D);

	    System.out.println(answer);

	    scanner.close();
    }

}

Measured memory_bytes: 21972
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,m=LI()
  l=[0]*n

  for _ in range(m):
    a,b=LI()
    a-=1
    b-=1
    l[a]+=1
    l[b]+=1

  for i in range(n):
    if l[i]%2==1:
      return 'NO'

  return 'YES'

# main()
print(main())


Measured memory_bytes: 5932
#include<iostream>
#include<cmath>
#include<algorithm>
#include <iomanip> 
#include<vector>
#include<queue>
#include<set>
#define fo(i,n) for(ll i=0;i<n;i++)
#define f(i,n) for(ll i=1;i<n;i++)
#define ff(i,k,n) for(ll i=k;i<n;i++)
#define ll long long
#define  vt  vector<ll>
#define pb(x)  push_back(x)
#define   vts  vector<string>
/*Elegizip, elegizip otken sol bir shaktar-ai
 Elendeter zamanymnyn otip bara zhatkanny-ai
Umytylmas-Umytylmas Kairan esil shaktar-ai
Zamanymnyn kolyn bulgap otip bara jatkany-ai
 kairan esil , kairan esil shaktar-ai
kolyn bulgap zamanymnyn otip bara jatkany-ai;*/
using namespace std;



int main()
{ios::sync_with_stdio(0);
ll a,b,c;
cin>>a>>b>>c;
if(a<=c*b){
    cout<<"Yes";
}
else cout<<"No";
}





Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

const ll p = 1e9+7;
const int MAXN = 1e5+5;

map<pii, int> m;
int n;

int main() {
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int x; cin >> x;
		x--;
		m[pii(i, x)] = 1;
	}

	ll tot = 0;
	for (auto it : m) {
		pii t = it.first;
		tot += m.count(pii(t.second, t.first));
	}

	cout << tot/2 << endl;
}

Measured memory_bytes: 6528
n, p = map(int,input().split())
num = list(map(int,input().split()))

semua_angka_genap = True
ada_angka_ganjil = False
for i in num:
  if i % 2 == 1:
    semua_angka_genap = False
    ada_angka_ganjil = True

if semua_angka_genap:
  if p == 0:
    print(2**n)
  else:
    print(0)

if ada_angka_ganjil:
  print(2**(n-1))



Measured memory_bytes: 61860
/* Hello darkness my old friend, I've come to visit you again! */

#include<bits/stdc++.h>
#define lli long long int
#define FOR(i,a,b) for(i=a;i<b;i++)
#define FORB(i,b,a) for(i=b;i>=a;i--)
#define mod 1000000007
#define PI 2*acos(0.0)
#define gs getline(cin,s)
#define pii pair<int,int>
#define pli pair<long long int,int>
#define pil pair<int,long long int>
#define pll pair<long long int,long long int>
#define pb push_back
#define eb emplace_back
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 1000000005
#define INF 1000000000000000005
#define io ios_base::sync_with_stdio(0);
#define ff first
#define ss second
using namespace std;
int par[100005],a[100005],idx[100005],sz[100005];
pii p[100005];
vector <int> adj[100005];
int root(int x)
{
    while(x!=par[x])
        x=par[par[x]];
    return x;
}
void un(int x,int y)
{
    int rx=root(x),ry=root(y);
    if(rx==ry)
        return;
    if(sz[rx]>=sz[ry])
    {
        par[ry]=par[rx];
        sz[rx]+=sz[ry];
        sz[ry]=0;
    }
    else
    {
        par[rx]=par[ry];
        sz[ry]+=sz[rx];
        sz[rx]=0;
    }
}
int main()
{
    io;
    cin.tie(0);
    cout.tie(0);
    int n,i,m,x,y,j;
    cin>>n>>m;
    FOR(i,1,n+1)
    {
        cin>>a[i];
        par[i]=i;
        idx[a[i]]=i;
        sz[i]=1;
    }
    FOR(i,0,m)
    {
        cin>>x>>y;
        un(x,y);
    }
    FOR(i,1,n+1)
    adj[root(i)].pb(i);
    int ans=0;
    FOR(i,1,n+1)
    {
        if(adj[i].size()==0)
            continue;
        FOR(j,0,adj[i].size())
        {
            x=adj[i][j];
            if(root(x)==root(idx[x]))
                ans++;
        }
    }
    cout<<ans;
    return 0;
}

/* This is the end, beautiful friend! */


Measured memory_bytes: 8064
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
 
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define ll long long
#define vi vector<int>
#define pi pair<int,int>
#define mp make_pair
 #define int ll
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
 
const int mod=1e9+7;
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
int mul(int a,int b){
	return ((a)*1ll*(b))%mod;
}
 
void add(int &a,int b){
	a+=b;
	if(a>=mod)a-=mod;
}
 
int sub(int a,int b){
	a-=b;
	if(a<0){
		a+=mod;
	}
	return a;
}
 
int powz(int a,int b){
	int res=1;
	while(b){
		if(b&1){
			res=mul(res,a);
		}
		b/=2;
		a=mul(a,a);
	}
	return res;
}
 
template <typename A, typename B>
istream& operator>>(istream& input,pair<A,B>& x) {
	input>>x.F>>x.S;
	return input;
}
 
template <typename A>
istream& operator>>(istream& input,vector<A>& x) {
	for(auto& i:x)
		input>>i;
	return input;
}
 
template<typename A>
ostream& operator<<(ostream& output,vector<A>& x) {
	for(auto& i:x)
		output<<i<<' ';
	return output;
}
 
const int N=100002;
 
void solve(){
	int n;
	cin>>n;
	vi a(n);
	cin>>a;
	vector<int>digits(61);
	for(int i=0;i<n;i++){
		for(int j=0;j<61;j++){
			if(a[i]&(1ll<<j)){
				digits[j]++;
			}
		}
	}
	ll ans=0;
	for(int i=0;i<61;i++){
		add(ans,mul(powz(2,i),mul(digits[i],n-digits[i])));
	}
	cout<<ans;
}
 
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int tc=1;
	//~ cin>>tc;
	for(int _=0;_<tc;_++){
		//~ cout<<"Case #"<<_+1<<": ";
		solve();
		if(_!=tc-1)
		cout<<"\n";
	}
}


Measured memory_bytes: 2560
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

def l_s(L):
    return "".join(map(str, L))

from itertools import combinations_with_replacement as cwr

N, M, Q = MI()
comb = [LI() for _ in range(Q)]
sequence = list(range(1, M + 1))
ans = 0

for A in cwr(sequence, N):
    tmp = 0
    A = list(A)
    for abcd in comb:
        a, b, c, d = abcd[0], abcd[1], abcd[2], abcd[3]
        if A[b - 1] - A[a - 1] == c:
            tmp += d
            
    ans = max(ans, tmp)
    
print(ans)

Measured memory_bytes: 73944
#include<stdio.h>
#include<string>
#include<string.h>
#include<utility>
#include<iostream>
#include<queue>
#include<math.h>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<bitset>
#include <cmath>
#include <limits>
#include <numeric>
#include <cmath>
#include <limits>

using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)(n);i++)

int main(){
    int h,w,k;
    scanf("%d%d%d",&h,&w,&k);
    char s[305][305]={};

    char j[305]={};
    REP(y,h){
        scanf("%s",j);
        REP(i,w)s[y][i]=j[i];
    }

    int yi[305]={};
    int xi[305]={};
    REP(y,h)REP(x,w)if(s[y][x]=='#'){
        yi[y]++;
        xi[x]++;
    }
    int xm[305]={};
    int keep=0;
    for(int x=0;x<w;x++){
        if(xi[x]!=0){
            xm[x]=keep;
            keep=x+1;
        }
    }

    int mat[305][305]={};
    int count=0;
    REP(x,w)if(xi[x]!=0){
        int nul=0;
        for(int y=h-1;y>=0;y--){
            if(s[y][x]=='#'){
                count++;
                nul=count;
            }
            for(int xx=xm[x];xx<=x;xx++){
                mat[y][xx]=nul;
            }
        }
    }

    REP(x,w){
        int k=0;
        REP(y,h){
            if(mat[y][x]!=0)k=mat[y][x];
            else mat[y][x]=k;
        }
    }
    REP(y,h){
        int k=0;
        REP(x,w){
            if(mat[y][x]!=0)k=mat[y][x];
            else mat[y][x]=k;
        }
    }

    //REP(x,w)printf("####%d\n",xm[x]);
    //printf("\n");
    REP(y,h){
        REP(x,w){
            printf("%d ",mat[y][x]);
        }
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 1152
#include "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

int main(){
	int n,memo = 0;
  	cin >> n;
  	memo = n / 100;
  	memo = memo*100 + memo*10 + memo;
  
 	if(n <= memo){
      cout << memo << endl;
    }
  	else{
      memo /= 100;
      memo++;
      memo = memo*100 + memo*10 + memo;
      cout << memo << endl;
    }
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define uu unsigned
#define io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MOD 1000000007
#define pi pair<int,int>
#define pl pair<ll,ll>
#define mkp make_pair
#define all(x) x.begin(),x.end()
#define ss second
#define ff first
#define mit map<ll,ll>::iterator
#define sit unordered_set<ll>::iterator
#define lit list<ll>::iterator
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define pf push_front
#define printf __mingw_printf
#define printcas cout<<"Case "<<cas<<": "
#define _ continue;
#define endl '\n'
#define __ cout<<endl;continue;
#define vec4d(nam,type,a,b,c,d,fix) vector<vector<vector<vector<type>>>> nam(a,vector<vector<vector<type>>>(b,vector<vector<type>>(c,vector<type>(d,fix))))
int main()
{
     io;
    //string hudai(1000000,'a');
    int T=1;
   // cin>>T;
     for(int cas=1;cas<=T;cas++)
    {
       ll n,i,j;
       cin>>n;
       vector<vl> v(n+1,vl(3)),dp(n+1,vl(3,0));
       for(i=1;i<=n;i++)
       {
         cin>>v[i][0]>>v[i][1]>>v[i][2];

       }
       for(i=1;i<=n;i++)
       {
           dp[i][0]=v[i][0]+max(dp[i-1][1],dp[i-1][2]);
           dp[i][1]=v[i][1]+max(dp[i-1][0],dp[i-1][2]);
          dp[i][2]=v[i][2]+max(dp[i-1][0],dp[i-1][1]);
       }
       cout<<max(dp[n][0],max(dp[n][1],dp[n][2]));
    }
    return 0;
}


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


int main()
{
	int arrayLength, buffer;
	scanf("%d", &arrayLength);

	int *intArray = (int *)calloc(arrayLength, sizeof(int));

	for (int i = 0; i < arrayLength; i++)
	{		
		scanf("%d", &buffer);
		intArray[i] = buffer;
	}

	for (int i = 0; i < arrayLength; i++)
	{
		if (intArray[i] % 2 == 0)
		{
			if (intArray[i] % 5 == 0)
			{
				continue;
			}
			else if (intArray[i] % 3 == 0)
			{
				continue;
			}
			else
			{
				printf("DENIED \n");
				return 0;
			}	
		}
	}
	printf("APPROVED \n");

	return 0;
}

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

   typedef long long ll;
   typedef pair<ll, ll> Pii;
   typedef vector<ll> Vi;
   typedef vector<Vi> VVi;

   const double EPS = (1e-7);
   const ll INF =(1e13);
   const double PI = (acos(-1));
   const ll MOD = ll(1e9) + 7;

   #define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
   #define REPR(i, n) for(ll i = n; i > -1; i--)
   #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
   #define ALL(x) (x).begin(),(x).end()
   #define SORT(x) sort((x).begin(), (x).end())
   #define RSORT(x) sort((x).rbegin(), (x).rend()
   #define REVERSE(x) reverse((x).begin(), (x).end())
   #define SZ(x) ((ll)(x).size())
   #define pb push_back
   #define mp make_pair

   //chmax(a, b): a>bならaをbで更新　更新したときにtrueを返す
   //chmin(a, b): a<bならaをbで更新　更新したときにtrueを返す
   template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
   template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

   #define dump(x) cerr<< #x << "= " << (x) << endl;

   ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
   ll pow(ll a, ll b){if (b == 0) return 1; else if (b % 2 == 0) return pow(a * a, b / 2); else return pow(a * a, b / 2) * a;}
   ll pow(ll a, ll b, ll m){if (b == 0) return 1; else if (b % 2 == 0) return (pow(a * a, b / 2, m) % m); else return (pow(a * a, b / 2) * a) % m;}
   ll residue(ll a, ll m){return ((a % m) + m) % m;};

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

ll N, A, B;
int main(){
   cin >> N >> A >> B;
   cout << min(A, B) << ' ' << max(0ll, A + B - N) << endl;
}


Measured memory_bytes: 256
# https://atcoder.jp/contests/keyence2019/tasks/keyence2019_c

import sys
n = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]

for i in range(n):
    if A[i] < B[i]:
        break
else:
    print(0)
    sys.exit()
s = 0
ans = 0
t = []
for i in range(n):
    if A[i] < B[i]:
        s += B[i] - A[i]
        ans += 1
    t.append(A[i] - B[i])
t.sort(reverse=True)

for i in range(n):
    if s < 0:
        break
    s -= t[i]
    ans += 1
if s > 0:
    print(-1)
else:
    print(ans)


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

int main() {
    int r, g, b;
    cin >> r >> g >> b;
    int n = 100 * r + 10 * g + b;
    if(n % 4 == 0)
        cout << "YES" << endl;
    else
    {
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("No"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
#define bn(x) ((1<<x)-1)
#define newline puts("")
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,const vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;



int main() {
  int n;
  scanf("%d",&n);
  vi a(n);
  cin>>a;
  int l = INF;
  rep(i,n) mins(l,a[i]);
  rep(i,n) if (a[i] > l+1) dame;
  string ans = "No";
  for (int x = l; x <= l+1; ++x) {
    bool ok = true;
    rep(i,n) if (a[i] > x) ok = false;
    if (!ok) continue;
    int one = 0, two = 0;
    rep(i,n) if (a[i] == x-1) one++; else two++;
    int s = one+(two?1:0);
    int t = one+(two/2);
    if (s <= x && x <= t) ans = "Yes";
  }
  cout<<ans<<endl;
  return 0;
}






















Measured memory_bytes: 640
from itertools import product
N = int(input())
S = input()

st = [set() for _ in range(3)]

for s in S:
    for pre in st[1]:
        st[2].add(pre+s)
    for pre in st[0]:
        st[1].add(pre+s)
    st[0].add(s)
        
print (len(st[2]))





Measured memory_bytes: 3188
#!/usr/bin/env python
# coding: utf-8

from collections import Counter

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n = ri()
    cnt = Counter()
    for i in range(n):
        s = input()
        cnt[s] += 1
    for st in ["AC", "WA", "TLE", "RE"]:
        print("{} x {}".format(st, cnt[st]))
    


if __name__ == '__main__':
    main()


Measured memory_bytes: 9480
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct edge{
    int to, ye, snu;
};
const int maxN = (int)1e5 + 10;
const ll INF = (ll)1e18;
int n, m, s, t;
vector < edge > g[maxN];
ll dist_e[maxN];
ll dist_s[maxN];
ll ans[maxN];
int main(){
    ios_base::sync_with_stdio(false);
    srand(time(0));
    //freopen("input.txt", "r", stdin);
    cin >> n >> m >> s >> t;
    for (int i = 1; i <= m; i++) {
        int a, b, ye, snu;
        cin >> a >> b >> ye >> snu;
        edge x;
        x.to = a;
        x.ye = ye;
        x.snu = snu;
        g[b].push_back(x);
        x.to = b;
        g[a].push_back(x);
    }
    for (int i = 1; i <= n; i++) {
        dist_e[i] = INF;
        dist_s[i] = INF;
    }
    priority_queue < pair < ll, int > > q;
    dist_e[s] = 0;
    dist_s[t] = 0;
    q.push(make_pair(dist_e[s], s));
    while (!q.empty()) {
        auto t = q.top();
        q.pop();
        ll dist = -t.first;
        int v = t.second;
        if (dist != dist_e[v]) continue;
        for (int i = 0; i < g[v].size(); i++) {
            int to = g[v][i].to;
            if (dist_e[to] > dist + g[v][i].ye) {
                dist_e[to] = dist + g[v][i].ye;
                q.push(make_pair(-dist_e[to], to));
            }
        }
    }
    q.push(make_pair(dist_s[t], t));
    while (!q.empty()) {
        auto t = q.top();
        q.pop();
        ll dist = -t.first;
        int v = t.second;
        if (dist != dist_s[v]) continue;
        for (int i = 0; i < g[v].size(); i++) {
            int to = g[v][i].to;
            if (dist_s[to] > dist + g[v][i].snu) {
                dist_s[to] = dist + g[v][i].snu;
                q.push(make_pair(-dist_s[to], to));
            }
        }
    }
    set < pair < ll, int > > ss;
    for (int i = 1; i <= n; i++) {
        ss.insert(make_pair(dist_e[i] + dist_s[i], i));
    }
    for (int i = 0; i < n; i++) {
        ans[i] = (*ss.begin()).first;
        ss.erase(make_pair(dist_e[i + 1] + dist_s[i + 1], i + 1));
    }
    for (int i = 0; i < n; i++) {
        cout << 1000LL * 1000 * 1000 * 1000 * 1000 - ans[i] << '\n';
    }
    return 0;
}


Measured memory_bytes: 17396
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(int i=0; i<n; i++)
#define reps(i, s, e) for(int i=s; i<e; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define reprs(i, s, e) for(int i=e-1; i>=s; i--)

int main(){

    int n; cin >> n;
    ll a[n];
    rep(i, n){
        cin >> a[i];
    }

    ll sum[n+1];
    sum[0] = 0;
    rep(i, n){
        sum[i+1] = sum[i] + a[i];
    }

    int il = 1;
    int ir = 3;
    ll ans = 1e18;
    reps(ic, 2, n-1){
        ll sum1, sum2, sum3, sum4;

        while(true){
            sum1 = sum[il];
            sum2 = sum[ic] - sum[il];
            ll d = abs(sum1 - sum2);

            if(il + 1 == ic) break;
            if(d <= abs(sum1 - sum2 + 2*a[il]) ) break;

            il++;
        }

        while(true){
            sum3 = sum[ir] - sum[ic];
            sum4 = sum[n]  - sum[ir];
            ll d = abs(sum3 - sum4);

            if(ir == n-1) break;
            if(d <= abs(sum3 - sum4 + 2*a[ir])) break;

            ir++;
        }

        // cout << il << " " << ic << " " << ir << endl;
        // cout << " " << sum1 << " " << sum2 << " " << sum3 << " " << sum4 <<endl;

        ll vmax = max(max(sum1, sum2), max(sum3, sum4));    
        ll vmin = min(min(sum1, sum2), min(sum3, sum4));

        ans = min(ans, vmax - vmin);
    }

    cout << ans;

    return 0;
}

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

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string s;
	cin >> s;
	set <char> s2;
	for (char c : s) s2.insert(c);
	cout << (s2.size() == 1 ? "No" : "Yes") << "\n";
	return 0;
}


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


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


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

void YN(bool ans){
    if(ans)cout<<"Yes"<<endl;
    else cout <<"No"<<endl;
    return;
}
int main(){
    string S;
    cin>>S;
    rep(i,0,S.size()){
        if(S[i] == '?')S[i] = 'D';
    }
    cout<<S;
    return 0;
}

Measured memory_bytes: 3764
#include <bits/stdc++.h>
#define LL long long
#define PII pair<int,int>
#define PIL pair<int,LL>
#define PLI pair<LL,int>
#define PIII pair<int,PII>
#define PLL pair<LL,LL>
#define PLII pair<LL,PII>
#define VI vector<int>
#define VVI vector<VI>
#define VL vector<LL>
#define VVL vector<VL>
#define VPII vector<PII>
#define FF first
#define SS second
#define MP make_pair
#define PB push_back
#define all(x) x.begin(),x.end()
#define watch(x) cout<<(#x)<<" = "<<(x)<<'\n'
#define mset(a,v) memset(a,v,sizeof(a))
#define setp(x) cout<<fixed<<setprecision(x)
#define EPS 0.00000000001
#define PI acos(-1)
#define loop(i,b,n) for(int i=b;i<n;++i)
#define rev_loop(i,b,n) for(int i=b;i>=n;--i)
using namespace std;

const int MOD = 1e9 + 7;
const LL MX = 1e9;
const LL INF = 1e9;

int main()
{
    //ofstream out("output.txt");
    //ifstream in("input.txt");
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    int n;
    cin>>n;
    int c = 0, f = 0, d1, d2;
    while(n--)
    {
        cin>>d1>>d2;
        if(d1 == d2)
        {
            ++c;
            if(c == 3) f = 1;
        }
        else c = 0;
    }

    if(f) cout<<"Yes\n";
    else cout<<"No\n";

    return 0;
}


Measured memory_bytes: 3644
n = int(input())
t, a = map(int, input().split())
h = map(int, input().split())


# sol 1
#lst = list(map(int, input().split()))
#print(max(lst) - min(lst))

IDX = -1
DIFF = 10000
for idx, height in enumerate(h):
    diff = abs(t - 0.006 * height - a)
    if diff < DIFF:
        DIFF = diff
        IDX = idx
print(IDX + 1)

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

int main() 
{
    int n;
    
    cin >> n;
    
    int a[n];
    int l;
    
    long sum_a = 0;
    int m = 0;
    while (cin >> l) {
        a[m] = l;
        sum_a += l;
        m++;
    }
    
    int min = a[0];
    int max = a[0];
    
    for (int i = 0; i < n; i++) {
        if (min > a[i]) {
            min = a[i];
        }
        
        if (max < a[i]) {
            max = a[i];
        }
    }
    
    cout << min << " " << max << " " << sum_a << endl;
    
    return 0;
}


Measured memory_bytes: 3104
package main

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

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	s := Scan()
	x, y := stringToInt(s[:2]), stringToInt(s[2:])
	f, g := (0 < x && x <= 12), (0 < y && y <= 12)
	if f && g {
		fmt.Println("AMBIGUOUS")
	} else if f {
		fmt.Println("MMYY")
	} else if g {
		fmt.Println("YYMM")
	} else {
		fmt.Println("NA")
	}
}


Measured memory_bytes: 1756
#include <iostream>

using namespace std;

int n, dp[5][4001];

int main()
{
    dp[0][0] = 1;
    
    for(int i = 1; i < 5; i++)
    {
        for(int j = 0; j <= 4000; j++)
        {
            for(int k = 0; k <= 1000; k++)
            {
                if(j - k >= 0)
                {
                    dp[i][j] += dp[i - 1][j - k];
                }
            }
        }
    }

    while(cin >> n)
    {
       cout << dp[4][n] << endl;
    }
    
    return 0;
}

Measured memory_bytes: 3160
#include<stdio.h>

void swap(int *x, int *y){
  int temp = *x;
  *x = *y;
  *y = temp;
}

int main(){
  
  int N,i,j,flag,count=0;
  scanf("%d",&N);
  
  int A[N];
  for(i=0; i<N; i++){
    scanf("%d",&A[i]);
  }
  
  flag = 1;

  while(flag){
    flag=0;
      for(j=N-1; j>=1; j--){
	if(A[j] < A[j-1]){
	  swap(&A[j],&A[j-1]);
	  flag = 1;
	  count++;
	}
      }
  }
  
  for(i=0; i<N-1; i++){
    printf("%d ",A[i]);
  }
  printf("%d\n%d\n",A[N-1],count);
  return 0;
}





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

sub = []
for i in range(n):
  sub.append(abs(x - l[i]))

# a,bの最大公約数を求めます。（ユークリッドの互除法）
def gcd(m, n):
  if n == 0:
    return m

  return gcd(n, m % n)

#gcd_複数の値の最大公約数を求める
def gcd_2(a):
  if len(a) == 1:
    return a[0]

  ans = a[0]
  for i in range(1, len(a)):
    ans = gcd(ans, a[i])
  return ans

print(gcd_2(sub))

Measured memory_bytes: 14224
#include <bits/stdc++.h>
#define N 100005
#define ll long long
using namespace std;
ifstream in("in.txt");
ll a[N], b[N], c[N];
priority_queue<ll>q;
int main(){
    ll x, y, na, nb, nc,sum=0;
    cin>>x>>y>>na>>nb>>nc;
    for(ll i=1; i<=na; ++i){
        cin>>a[i];
    }
    for(ll i=1; i<=nb; ++i){
        cin>>b[i];
    }
    for(ll i=1; i<=nc; ++i){
        cin>>c[i];
    }
    sort(a+1, a+na+1);
    sort(b+1, b+nb+1);
    sort(c+1, c+nc+1);
    ll i=na;
    while(x>0 && i>0){
        sum+=a[i];
        q.push(-a[i--]);
        --x;
    }
    i=nb;
    while(y>0 && i>0){
        sum+=b[i];
        q.push(-b[i--]);
        --y;
    }
    i=nc;
    x+=y;
    while(x>0 && i>0){
        sum+=c[i];
        q.push(-c[i--]);
        --x;
    }
    while(i>0 && c[i]>-q.top()){
        sum+=c[i]+q.top();
        q.pop();
        --i;
    }
    cout<<sum;
    return 0;
}

Measured memory_bytes: 4724
#include"stdio.h"
int main()
{
	char X,Y,Z;
	char a[12]={'A','B','C','D','E','F'};
	int b[6]={10,11,12,13,14,15},t,j,i;

	scanf("%c%c%c",&X,&Z,&Y);

   for(i=0;i<6;i++)
   {
	   if(a[i]==X)t=i;
	   if(a[i]==Y)j=i;
   }

if(t==j)
printf("=");
if(t<j)
printf("<");
if(t>j)
printf(">");
}


Measured memory_bytes: 128
use proconio::{input, fastout};
use proconio::marker::{Chars};
use std::cmp::*;
#[fastout]
fn main() {
    input!{
        s: Chars,
    }

    let mut cnt = 0;
    let mut ans = 0;
    for i in 0..s.len() {
        if s[i]=='A' || s[i]=='C' || s[i]=='G' || s[i]=='T' {
            for j in i..s.len() {
                if s[j]=='A' || s[j]=='C' || s[j]=='G' || s[j]=='T' {
                    cnt += 1;
                } else {
                    break;
                }
            }
            ans = max(ans, cnt);
            cnt = 0;
        } else {
            continue;
        }
    }

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


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

typedef unsigned int U;
#define L 1<<21
char HA[L];
char T[256];

int main() {
    U n, s, t;
    char c;
    T['A'] = 1;
    T['C'] = 2;
    T['G'] = 3;
    T['T'] = 4;
    scanf("%d", &n);
    getchar();
    while (n--) {
        s = 0;
        t = 1;
        int flag = ( c = getchar() ) == 'i';
        while ( ( c = getchar() ) != ' ' );
        while ( ( c = T[getchar()] ) != 0 ) {
            s += c * t;
            t *= 4;
        }
        if ( flag ) {
            HA[s] = 1;
        } else {
            puts( HA[s] ? "yes" : "no" );
        }
    }
    return 0;
}

Measured memory_bytes: 1748