akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h> 
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define size_of_array(array) (sizeof(array)/sizeof(array[0]))
#define MAX 100005
#define DEBUG 0 
#define LIMIT (LONG_MAX / 10)
#define POSITIVE_LAST_D (LONG_MAX % 10)
using ll =long long;
using namespace std;
using Graph=vector<vector<int>>;

int main(){
    ll n,k;
    cin>>n>>k;

    ll mod1097=pow(10,9)+7;
    ll temp=0;
    for(ll s=k;s<=n+1;s++){
        ll mink=(s*(s-1))/2,maxk=((2*n-s+1)*s)/2;
        temp+=(maxk-mink+1);
        temp%=mod1097;
    }

    cout<<temp<<endl;
    return 0;
}

Measured memory_bytes: 3560
using System;
using System.Collections.Generic;

namespace ABC_A_WhiteCells
{
    class Program
    {
        static void Main(string[] args)
        {
            IReadOnlyList<string> stdin = GetStandardInput();

            if (stdin == null)
                return;

            IReadOnlyList<int> vsi = ValidateStandardInput(stdin);

            if (vsi == null)
                return;

            var H = vsi[0];
            var W = vsi[1];
            var h = vsi[2];
            var w = vsi[3];

            var ans = (H - h) * (W - w);
            Console.WriteLine(ans.ToString());
        }

        private static List<string> GetStandardInput()
        {
            var strs = new List<string>();

            for (var i = 0; i <= 1; i++)
            {
                var stdin = Console.ReadLine();

                if (!stdin.Contains(" "))
                {
                    Console.WriteLine("Too few arguments.");
                    return null;
                }

                var arr = stdin.Split(' ');

                if (arr.Length >= 3)
                {
                    Console.WriteLine("Too many arguments.");
                    return null;
                }

                strs.Add(arr[0]);
                strs.Add(arr[1]);
            }

            return strs;
        }

        private static List<int> ValidateStandardInput(IReadOnlyList<string> input)
        {
            var errorMessage = string.Empty;
            int o = int.MinValue;

            if (!int.TryParse(input[0], out o))
                errorMessage += "H is not a number.\r\n";
            if (!int.TryParse(input[1], out o))
                errorMessage += "W is not a number.\r\n";
            if (!int.TryParse(input[2], out o))
                errorMessage += "h is not a number.\r\n";
            if (!int.TryParse(input[3], out o))
                errorMessage += "w is not a number.\r\n";

            if (errorMessage != string.Empty)
            {
                Console.Write(errorMessage);
                return null;
            }

            errorMessage = string.Empty;

            var ints = new List<int>()
            {
                int.Parse(input[0]),
                int.Parse(input[1]),
                int.Parse(input[2]),
                int.Parse(input[3])
            };

            if (ints[0] < 1 || ints[0] > 20)
                errorMessage += "Out of range at H\r\n";
            if (ints[1] < 1 || ints[1] > 20)
                errorMessage += "Out of range at W\r\n";
            if (ints[2] < 1 || ints[2] > ints[0] || ints[2] > 20)
                errorMessage += "Out of range at h\r\n";
            if (ints[3] < 1 || ints[3] > ints[1] || ints[3] > 20)
                errorMessage += "Out of range at w\r\n";

            if (errorMessage != string.Empty)
            {
                Console.Write(errorMessage);
                return null;
            }

            return ints;
        }
    }
}

Measured memory_bytes: 13396
// Author: Ishaan Gupta

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 1000000007;
#define endl '\n'
#define pb push_back
#define DEB(x) cout << '>' << #x << ':' << x << endl;
inline ll add(ll a,ll b){return (a%MOD+b%MOD)%MOD;}
inline ll sub(ll a,ll b){return (a%MOD-b%MOD+MOD)%MOD;}
inline ll mult(ll a,ll b){return ((a%MOD)*(b%MOD))%MOD;}
inline ll power(ll a,ll b){a%=MOD;ll r=1;while(b){if(b&1)r=mult(r,a);a=mult(a,a);b>>=1;}return r;}

void min_self(ll &a, ll b)
{
    a = min(a,b);
}
const ll INF = 1e18l+5;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed;
#ifdef IG_PC
    freopen("input", "r", stdin);
    freopen("output", "w", stdout);
#endif
    ll n,w;
    cin >> n >>w;
    
    vector<ll>weight(n), value(n);
    for(ll i = 0;i < n; ++i)
    {
        cin >> weight[i] >> value[i];
    }
    ll sum_value =0;
    for(ll i : value)
    {
        sum_value += i;
    }
    vector<ll>dp(sum_value+1, INF);
    dp[0]=0;
    for(ll items = 0; items < n; ++items)
    {
        for(ll value_already = sum_value; value_already >=value[items]; --value_already)
        {
            min_self(dp[value_already], dp[value_already-value[items]] + weight[items]);
        }
    }
    ll ans=0;
    for(ll i=0;i<=sum_value;++i)
    {
        if(dp[i]<=w)
        {
            ans = max(ans, i);
        }
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 1024
N, M = map(int, input().split())

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

L = [list(map(int, input().split())) for _ in range(M)]

L.sort(reverse=True, key=lambda x:x[1])
A.sort()


ans = 0
i = 0
j = 0
k = 0
for i in range(N):
    if j < M:
        if A[i] < L[j][1]:
            ans += L[j][1]
            k += 1
            
        else:
            ans += A[i]
        
        
        if k == L[j][0]:
            k = 0
            j += 1
            
    else:
        ans += A[i]
        

        
print(ans)
    

Measured memory_bytes: 32964
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define Mid ((l+r)/2)
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define drep(i,a,b) for(int i=(a);i>=(b);--i)
#define file(a) freopen(#a".in","r",stdin),freopen(#a".out","w",stdout);
const int maxn=1e5+5,mod=1e9+7,inf=0x3f3f3f3f;
int n,m,Q,K,T;
int read(){
    int x=0,f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    return x*f;
}int a[maxn];
bool pd(int x,int y,int z){
    if(x+y>z&&x+z>y&&y+z>x)return true;
    return false;
}
signed main(){
    //file(a);
    n=read();rep(i,1,n)a[i]=read();
    sort(a+1,a+1+n);int ans=0;
    // rep(i,1,n)cout<<a[i]<<" ";cout<<endl;
    rep(i,1,n){
        int posj=i+1,posk;
        while(a[posj]==a[i])++posj;
        rep(j,posj,n){
            posk=j+1;
            while(a[posk]==a[j])++posk;
            rep(k,posk,n){
                if(pd(a[i],a[j],a[k]))++ans;
            }
        }
    }printf("%d\n",ans);


    return 0;
}


Measured memory_bytes: 3772
import math

MAX = 10000


def is_prime_number(num):
    for divisor in range(3, int(math.sqrt(num) + 1), 2):
        if num % divisor == 0:
            return False

    return True


def create_prime_number_list(max):
    prime_number_list = list(range(0, max + 1))

    prime_number_list[0] = False
    prime_number_list[1] = False

    for index in range(2 * 2, max + 1, 2):
        prime_number_list[index] = False

    for num in range(3, int(math.sqrt(max + 1)), 2):

        if is_prime_number(num):
            for index in range(num * 2, max + 1, num):
                prime_number_list[index] = False

    return prime_number_list


prime_number_list = create_prime_number_list(MAX)
output = []

while True:

    num = int(input())

    if num == 0:
        break

    if num % 2 == 0:
        num -= 1

    for index in range(num, 0, -2):
        if prime_number_list[index - 2] and prime_number_list[index]:
            output.append(str(index - 2) + " " + str(index))
            break

print("\n".join(output))



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

int main(){
	int n;
	cin >> n;
	bool f = 0;
	for(int i = 1;i <= 9;i++){
		for(int j = 1;j <= 9;j++){
			if(i * j == n){
				f = 1;
				break;
			}
		}
		if(f) break;
	}
	if(f) cout << "Yes\n";
	else cout << "No\n";
	return 0;
}

Measured memory_bytes: 256
S = input()
L = ['A','C','G','T']

ans,count,flag = 0,0,1
for s in S:
    if s in L:
        if not flag:
            flag = 1
            count = 0
        count += 1
    else:
        if flag:
            flag = 0
            ans = max(ans,count)
ans = max(ans,count)

print(ans)

Measured memory_bytes: 3060
#include<iostream>
using namespace std;
int main()
{
   int n,x,y;
   cin>>n>>x>>y;
   int count[n]={0};
   int i,j;
   for(i=1;i<=n;i++)
   {
      for(j=i+1;j<=n;j++)
      {
	      int v1=j-i;
	      int v2=abs(i-x)+1+abs(y-j);
	      int d=min(v1,v2);
	      count[d]++;
      }
   }   
   for(j=1;j<n;j++)
	   cout<<count[j]<<endl;
}


Measured memory_bytes: 256
#![allow(unused_imports)]

use proconio::{input, fastout};
use proconio::marker::*;
use nalgebra::min;

#[fastout]
fn main() {
    input! {
    n: usize,
    m: usize,
    ac: [(usize, [Usize1]);m]
    }
    let mut dp = vec![std::usize::MAX; 1 << n];
    dp[0] = 0;
    for i in 0..m {
        let mut t = 0;
        for &i in &ac[i].1 {
            t |= 1 << i;
        }
        dp[t] = min(dp[t], ac[i].0);
    }
    for i in 0..1 << n {
        for j in 0..1 << n {
            let t = i | j;
            dp[t] = min(dp[t], dp[i].saturating_add(dp[j]))
        }
    }
    let ans = dp[(1 << n) - 1];
    if ans == std::usize::MAX { println!("-1") } else {
        println!("{}", ans);
    }
}


Measured memory_bytes: 2252
#include<iostream>
#include<string>
#include<algorithm>
#include<cstdio>
#include<memory.h>
#include<map>
#include<vector>
#define PRE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long ll;
const int Max = 1e6 + 5;
const int Mod = 1e9 + 7;
int lst[Max];
const int max_n = 1e4 + 100;
struct oper {
	int i, j, x;
};
struct nde {
	int val, id;
	bool operator<(nde& n2) {
		if (val % id == 0)return true;
		if (n2.val % n2.id == 0)return true;
		int t1 = id - val % id;
		int t2 = n2.id - n2.val % n2.id;
		if (t1 != t2)return t1 < t2;
		return val > n2.val;
	}
}a[max_n];

int main()
{
	ll x, y;
	cin >> x >> y;
	ll ans = y / x;
	int f = 0;
	while (ans)
	{
		++f;
		ans /= 2;
	}
	cout << f;
}



Measured memory_bytes: 3192
#include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <ratio>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = long long;
using ull = unsigned long long;
template<class T> using v = vector<T>;
template<class T, class U> using p = pair<T, U>;

#define REP(i, n) for(int i = 0; i < n; ++i)
#define REP1(i, n) for(int i = 1; i <= n; ++i)

template<class T> T read() { T x{}; cin >> x; return x; }
template<class T> v<T> read(int N){ v<T> x(N); REP(i, N) cin >> x[i]; return x; }

template<class T>
void write(const T &x){ cout << x << endl; }
void write(double x){ printf("%.15f\n", x); }

const ull MOD = 1000'000'007;

ll N;

int main(){
    cin >> N;
    auto A = read<ll>(N);
    sort(A.begin(), A.end());
    for(ll i = 1; i < N; ++i){
        if(A[i-1] == A[i]){ 
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
}



Measured memory_bytes: 1920
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 998244353
#define fi first
#define se second
#define pii pair<int,int>
#define int long long
#define endl '\n'
#define pll pair<long long,long long>
#define LONGLONG_MAX 100000000000000
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a)%mod;}
                a=(a*a)%mod;
                b>>=1;
        }
    return ans;
        
}
string s[100005];
map<string,int>m;
string ans;
map<string,int>m1;
bool fun(int i,vector<int>v,int n){
    if(v[0]<0||v[1]<0||v[2]<0)return false;
    if(i==n){
        return true;
    }
    v[s[i][0]-'A']++;
    v[s[i][1]-'A']--;
    if(fun(i+1,v,n)){
        ans.push_back(s[i][0]);
        return true;
    }
    v[s[i][0]-'A']--;
    v[s[i][1]-'A']++;
    
    v[s[i][0]-'A']--;
    v[s[i][1]-'A']++;
    if(fun(i+1,v,n)){
        ans.push_back(s[i][1]);
        return true;
    }
    return false;
}
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,a,b,c;
    cin>>n>>a>>b>>c;
    for(int i=0;i<n;i++){
        cin>>s[i];
    }
    m1["AB"]=0;
    m1["BC"]=1;
    m1["AC"]=2;
    vector<int>v;
    v.push_back(a);
    v.push_back(b);
    v.push_back(c);
    if(fun(0,v,n)){cout<<"Yes"<<endl;reverse(ans.begin(),ans.end());for(auto j:ans)cout<<j<<endl;return 0;}
    cout<<"No";
    return 0;
}


Measured memory_bytes: 23900
function main(input){
	input=input.split("\n");
var X=input[0];

if(400<=X,X<=599){console.log("8");
	}else if(600<=X,X<=799){console.log("7");
		} else if(800<=X,X<=999){console.log("6");
			}else if(1000<=X,X<=1199){console.log("5");
				}else if(1200<=X,X<=1399){console.log("4");
					}else if(1400<=X,X<=1599){console.log("3");
						}else if(1600<=X,X<=1799){console.log("2");
							}else if(1800<=X,X<=1999){console.log("1");
								}


}

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


Measured memory_bytes: 29684
#include "bits/stdc++.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define FOR(i,init,a) for(int i=init; i<a; i++)
#define rep(i,a) FOR(i,0,a)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()
#define chmin(a,b) a=min(a,b);
#define chmax(a,b) a=max(a,b);

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int a,b,c,n;
    cin>>a>>b>>c;
    n=a*100+b*10+c;
    
    if(n%4==0){
        cout1("YES")
    }else{
        cout1("NO")
    }
}

Measured memory_bytes: 256
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "ctime"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;

//long long int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


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

	cin >> N;
	cout << "Christmas";
	while (N < 25) {
		cout << " Eve";
		N++;
	}
	cout << endl;
	return 0;
}


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


int main() {
    int n,k;
    cin>>n>>k;
    ll re=k;
    for (int i = 0; i < n-1; ++i) {
        re*=k-1;
    }
    cout<<re<<endl;
    return 0;
}

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

int main()
{
	int x;
	cin>>x;
	for(int i=1;i<=x;i++)
		{
			if(i*(i+1)/2>=x)
				{
					cout<<i<<endl;
					break;
				}
		}
}

Measured memory_bytes: 3628
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
using namespace std;

int main(){
    int a[5];
    int m = 1 << 10;
    int sum = 0;
    for(int &i : a) {
        cin >> i;
        if(i%10 != 0) {
            int buf = i +(10- i %10);
            sum += buf;
            m = min(m, i % 10);
        }else{
            sum += i;
        }
        cerr << sum << endl;
    }

    cerr << sum << endl;
    cerr << m << endl;
    if(m == (1<<10)){
        m = 10;
    }
    cout << sum-(10-m) << endl;

    return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <cstdio>
#include <numeric>
#include <iomanip>

using namespace std;

using ll = long long;

ll N, K;
ll A[200005];


int main()
{
    cin >> N >> K;
    for(ll i = 0;i < N;i++)
    {
        cin >> A[i];
        if(i >= K)
        {
            cout << (A[i-K] < A[i] ? "Yes" : "No") << endl; 
        }
    }
    return 0;
}

Measured memory_bytes: 4688
#include<bits/stdc++.h>
using namespace std;
 
#define pii pair<int,int>
#define pll pair<ll,ll>
#define eb emplace_back
#define ll long long
#define nl '\n'
#define in() ( { int a ; scanf("%d",&a); a; } )
 
const int N = 3e5 + 9;
const int mod = 1e9 + 7;
//int dx[]={1,0,-1,0,1,-1,-1,1};
//int dy[]={0,1,0,-1,1,1,-1,-1};
vector<int> graph[10003];
int vis[10003], ans[10003];
int dist[10003][10003];
void bfs(int src)
{
    
    int i;
    deque<int> q;
    q.eb(src);
    vis[src] = 1;
    dist[src][src] = 0;
    while (!q.empty())
    {
        int ma_src = q.front();
        q.pop_front();
        for (i = 0; i < graph[ma_src].size(); i++){
            int adj = graph[ma_src][i];
            //cout << ma_src << " " << adj << nl;
            if(!vis[adj]){
                dist[src][adj] = min(dist[src][adj], 1 + dist[src][ma_src]);
                dist[adj][src] = min(dist[adj][src], 1 + dist[ma_src][src]);
                //cout << dist[src][adj] << " " << dist[adj][src] << nl;
                vis[adj] = 1;
                q.eb(adj);
            }
        }
    }
}
int main()
{
    int n, x, y, i, j;
    cin >> n >> x >> y;
    for (i = 1; i < n; i++)
    {
        graph[i].eb(i + 1);
        graph[i + 1].eb(i);
    }
    graph[x].eb(y);
    graph[y].eb(x);
    for (i = 0; i <= n; i++){
        for (j = 0; j <= n; j++){
            dist[i][j] = 9999999;
        }
    }
    for (i = 1; i <= n; i++)
    {
        bfs(i);
        memset(vis, 0, sizeof(vis));
    }
        //cout << "HEint" << nl;
    for (i = 0; i <= n; i++){
        for (j = i + 1; j <= n; j++){
            if(dist[i][j] != 9999999){
                ans[dist[i][j]]++;
            }
        }
    }
    for (int k = 1; k < n; k++){
        cout << ans[k] << nl;
    }
}

Measured memory_bytes: 80768
#include <stdio.h>

int main(int argc, const char * argv[]) {
    
    int h, w;
    
    while (1) {
        scanf("%d %d", &h, &w);
        if (h == 0 && w == 0) {
            break;
        }
        for (int y=0; y<h; y++) {
            for (int x=0; x<w; x++) {
                if (y == 0 || y == h-1 || x == 0 || x == w-1) {
                    printf("#");
                }else{
                    printf(".");
                }
                
            }
            printf("\n");
        }
        printf("\n");
    }
    
    
    return 0;
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n,ans=0;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  for(int i=0;i<n-2;i++){
    if(a[i]<a[i+1]&&a[i+1]<a[i+2]) ans++;
    else if(a[i]>a[i+1]&&a[i+1]>a[i+2]) ans++;
  }
  cout<<ans;
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
 
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];
        for(int i=0;i<N;i++) A[i]=sc.nextInt();
        HashMap<Integer,Integer> val_idx = new HashMap<>();
        for(int i=0;i<N;i++) val_idx.put(A[i],i);
        int[] B = new int[N];
        System.arraycopy(A,0,B,0,N);
        Arrays.sort(B);
        int ans = 0;
        for(int i=0;i<N;i++){
            if(i%2==1&&val_idx.get(B[i])%2==0) ans++;
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 56012
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Threading;

namespace Sweet
{
    class Program
    {
        static void Main(string[] args)
        {
            Int32 num;
            num=Int32.Parse(Console.ReadLine());
            //Console.WriteLine("you entered {0} 0x{0:x4}.", num);
            num = num * num * num;
            //string ans = string.Format("{0}", num * num * num);
            Console.WriteLine("{0}", num);
            /*Console.WriteLine("Hello World");*/
            //Console.ReadLine();
            //Console.ReadLine();
        }
    }
}

Measured memory_bytes: 9136
#include <iostream>
#include <vector>
#include <tuple>
#include <fstream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <functional>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;


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

  string s,t, t1;
  int n;
  cin >> s >> t;
  n = t.length();
  t1 = t.erase(n-1);
  if (s == t1){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }


}
  

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

int main()
{
    string s;
    cin >> s;
    sort(s.begin(), s.end());

    string t;
    cin >> t;
    sort(t.begin(), t.end());
    reverse(t.begin(), t.end());

    if (s < t)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
int test[4];
signed main() {
	int n, x, cnt = 1; cin >> n >> x;
	if (x == 1 || x == 2 * n - 1) { cout << "No" << endl; return 0; }
	cout << "Yes" << endl;
	if (n == 2) { cout << 1 << endl; cout << 2 << endl; cout << 3 << endl; return 0; }
	test[0] = x - 1; test[1] = x; test[2] = x + 1; test[3] = x - 2;
	if (x == 2) { test[0] = x + 1; test[1] = x; test[2] = x - 1; test[3] = x + 2; }
	for (int h = 1; h < 2 * n; h++) {
		if (h == n - 1) {
			cout << test[0] << endl; cout << test[1] << endl;
			cout << test[2] << endl; cout << test[3] << endl;
			h += 3;
		}
		else {
			while (cnt == test[0] || cnt == test[1] || cnt == test[2] || cnt == test[3]) {
				cnt++;
			}
			cout << cnt << endl; cnt++;
		}
	}
	return 0;
}

Measured memory_bytes: 1536
import java.util.Scanner;

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

    String a = sc.nextLine();
    byte[] b = a.getBytes();
    char[] c = Character.toChars(b[0] + 1);
    System.out.println(new String(c));
  }
}


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

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define REPS(i, m, n) for (int i = (m); i <= (int)(n); i++)
#define RREPS(i, m, n) for (int i = (m); i >= (int)(n); i--)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) for (int i = 0; i <= (int)(n); i++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define rreps(i, x) for (int i = (int)(x); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
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; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) { fill( (T*)array, (T*)(array+N), val ); }

int N;
ll C;
ll x[100010], v[100010];
ll y[100010];
ll A[100010], B[100010], D[100010];

ll solve() {
    // 時計回りの価値の累積和
    A[0] = v[0];
    REP(i, 1, N) A[i] = A[i-1] + v[i];

    // 反時計回りの価値の累積和
    B[N-1] = v[N-1];
    RREPS(i, N-2, 0) B[i] = B[i+1] + v[i];

    // y[0]は右から0番目を反時計回りで歩いた時に消費するカロリー
    // y[N-1]からiが少なくなるほど、反時計周りした時に消費するカロリーは減る
    rep(i, N) y[i] = C - x[i];

    D[N-1] = B[N-1] - y[N-1];
    RREPS(i, N-2, 0) {
        // i番目までの寿司を食べる時のカロリー差の最大値
        D[i] = B[i] - y[i];
        //　N-1番目からi番目までの寿司を食べられる時のカロリー差の最大値
        chmax(D[i], D[i+1]);
    }

    ll ans = 0;
    rep(i, N) {
        ll sm = 0;
        sm -= x[i];
        sm += A[i];
        chmax(ans, sm);
        sm -= x[i];

        if (i < N - 1) sm += D[i+1];
        chmax(ans, sm);
    }
    return ans;
}

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

    cin >> N >> C;
    rep(i, N) cin >> x[i] >> v[i];

    ll ans = 0;
    chmax(ans, solve());

    reverse(v, v + N);
    rep(i, N) x[i] = C - x[i];
    reverse(x, x + N);
    chmax(ans, solve());
    cout << ans << endl;
    return 0;
}

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

vector<vector<pair<int, int>>> g;
vector<bool> used;
vector<int> dist;

bool dfs(int v, int d) {
  used[v] = true;
  bool found = false;
  for (auto el : g[v]) {
    int to = el.first, cost = el.second;
    if (used[to] && dist[v] - dist[to] + cost != 0) found = true;
    if (!used[to]) {
      dist[to] = dist[v] + cost;
      found = dfs(to, d + cost);
    }
    if (found) break;
  }
  return found;
}

int main() {
  int n, m;
  cin >> n >> m;
  g.resize(n);
  for (int i = 0; i < m; ++i) {
    int u, v, d;
    cin >> u >> v >> d;
    --u;
    --v;
    g[u].push_back(make_pair(v, d));
    g[v].push_back(make_pair(u, -d));
  }
  used.assign(n, false);
  dist.assign(n, 0);
  bool contradiction = false;
  for (int i = 0; i < n; ++i) {
    if (!used[i]) contradiction = dfs(i, 0);
    if (contradiction) {
      break;
    }
  }
  if (!contradiction) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 15852
// E.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <bitset>

using namespace std;
typedef bitset<512000> BS;
const int offset = 512000 / 2;

int main(int argc, char* argv[]) {

#ifdef _MSC_VER
	while (true)
#endif
	{
		int h = -1, w = -1;
		cin >> h >> w;
		if (h < 0) return 0;
		int a[80][80] = {}, b[80][80] = {};
		for (int i = 0; i < h; ++i) {
			for (int j = 0; j < w; ++j) {
				cin >> a[i][j];
			}
		}
		for (int i = 0; i < h; ++i) {
			for (int j = 0; j < w; ++j) {
				cin >> b[i][j];
			}
		}
		vector<BS> prev(w);
		for (int i = 0; i < h; ++i) {
			vector<BS> curr(w);
			for (int j = 0; j < w; ++j) {
				int diff = abs(b[i][j] - a[i][j]);
				if (i == 0 && j == 0) {
					curr[0][offset + diff] = true;
				}
				if (i > 0) {
					curr[j] |= (prev[j] << diff);
					curr[j] |= (prev[j] >> diff);
				}
				if (j > 0) {
					curr[j] |= (curr[j - 1] << diff);
					curr[j] |= (curr[j - 1] >> diff);
				}
			}
			prev = curr;
		}
		int ans = 1 << 30;
		for (int i = 0; i < 200000; ++i) {
			if (prev[w - 1][offset + i] || prev[w - 1][offset - i]) {
				ans = i;
				break;
			}
		}
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 10484
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def main():
    N=int(input())
    S=input()[:-1]
    
    can = set([""]) ## 2文字以下で現在構築可能な文字列(最大10+10*10 = 1010)
    ans = set() ## 3文字で現在構築可能な文字列(最大10*10*10 = 1,000)
    for s in S: 
        for c in can.copy(): #途中でcanという集合に追加されるのでcopyする
            res = c+s #2文字以下 + 1文字 で結合する
            if len(res) == 3: #3文字なので暗証番号の候補
                ans.add(res)
            elif len(res) < 3: #2文字以下なのでcanに挿入
                can.add(res)
    print(len(ans))

    """
    copyする回数 = N * len(can) <= 10^3 * N
    for文の走査回数 = N * len(can) <= 10^3 * N
    
    全体で  2 * (10^3 * N)
    N<=3*10^4なので
    2*3* 10^3 * 10^4 = 6 * 10^7 -> 間に合わない？んですか・・・？
    """

if __name__ == '__main__':
    main()


Measured memory_bytes: 41324
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

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

    while (b <= a && k) {
        b *= 2;
        k--;
    } 

    while (c <= b && k) {
        c *= 2;
        k--;
    }
    if (a < b && b < c) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

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

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

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

template<typename T>
constexpr T inf = static_cast<T>(pow(10, static_cast<int>(log10(numeric_limits<T>::max())))) + 7;
constexpr llong mod = 1e9+7;

int main() {
  string N;

  cin >> N;

  llong stay = N.back() - '0', down = 10 - stay;
  cerr << down << " " << stay << endl;
  for (int i = N.size() - 2; i >= 0; --i) {
    llong n = N[i] - '0';
    llong d = min(10 - n + stay, 9 - n + down);
    llong s = min(1 + n + down, n + stay);

    down = d;
    stay = s;
    cerr << down << " " << stay << endl;
  }

  cout << min(down + 1, stay) << endl;

  return 0;
}

Measured memory_bytes: 1412
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define INF 2147483647
pair<int,int> data[4000001];
int n,_n;
void init(int n){
  _n=1;
  while(_n<1500000)_n*=2;
}
void update(int i,int x){
  int p=i;
  i+=_n-1;
  data[i].f+=x;
  data[i].s=p+1;
  while(i>0){
    i=(i-1)/2;
    if(data[2*i+1].f==data[2*i+2].f){
      if(data[2*i+1].s<data[2*i+2].s)
        data[i]=data[2*i+1];
      else data[i]=data[2*i+2];
    }
    else if(data[2*i+1].f>data[2*i+2].f)
      data[i]=data[2*i+1];
    else data[i]=data[2*i+2];
  }
}
int main(){
  int q;
  cin>>n>>q;
  init(n);
  while(q--){
    int a,b;
    cin>>a>>b;
    update(a-1,b);
    cout<<data[1].second<<' '<<data[1].first<<endl;
  }
}

Measured memory_bytes: 34352
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        int mod = 11;
        long ans = (n / mod) * 2;
        if (n % mod == 0) {
            
        } else if (n % mod <= 6) {
            ans++;
        } else {
            ans++;
            ans++;
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 35832
import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 998244353
inf = 10**20

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

s = S()
print("x"*len(s))

Measured memory_bytes: 5328
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

struct fast_io {
	fast_io(){
		std::cin.tie(nullptr);
		std::ios::sync_with_stdio(false);
	};
} fio;

signed main(){
	cout<<fixed<<setprecision(10);
	
	int N;
    vector<int> A;
    int sum = 0;
    
    cin>>N;
    
    A.resize(N);
	
    
    for(int i = 0; i < N; i++){
        cin>>A[i];
        
        if(i) {
            if(A[i] < A[i-1]) {
                sum += A[i-1] - A[i];
                A[i] = A[i-1];
            } else {
                
            }
            
        }
    }
    
    cout<<sum<<endl;
	
	return 0;
}

Measured memory_bytes: 4780
#include <iostream>
using namespace std;
  
#define check cnt=0;for(j=0;j<6;j++)if(d[q][j]==d[r][j])cnt++;
#define m tmp=d[r][1];d[r][1]=d[r][3];d[r][3]=d[r][4];d[r][4]=d[r][2];d[r][2]=tmp;
#define y tmp=d[r][0];d[r][0]=d[r][3];d[r][3]=d[r][5];d[r][5]=d[r][2];d[r][2]=tmp;
  
bool same(int d[][6],int q,int r){
 int tmp,cnt,j,a=1,i,k;
 check if(cnt==6)a=0;
  
 while(a){
  for(i=0;i<5;i++){
   for(k=0;k<4;k++){
    check if(cnt==6)break;
    m
   }
   check if(cnt==6)break;
   tmp=d[r][0];
   d[r][0]=d[r][1];
   d[r][1]=d[r][5];
   d[r][5]=d[r][4];
   d[r][4]=tmp;
  }
  if(cnt==6)break;
  y
  for(k=0;k<4;k++){
   check if(cnt==6)break;
   m
  }
  if(cnt==6)break;
  y y
  for(k=0;k<4;k++){
   check if(cnt==6)break;
   m
  }
  a=0;
 }
  
 if(cnt==6)return true;
 return false;
}

int main(){
 int n,judge=0;
 cin >> n;
 int d[n][6];
  
 for(int i=0;i<n;i++){
  for(int j=0;j<6;j++){
   cin >> d[i][j] ;
  }
 }
  
 for(int q=0;q<n-1;q++)for(int r=q+1;r<n;r++)if(same(d,q,r))judge++;

 if(judge>0)cout << "No" << endl ;
 else cout << "Yes" << endl ;
  
 return 0;
}

Measured memory_bytes: 3088
n,k=map(int, input().split())
*a,=map(int, input().split())
mx=max(a)
mn=10**(-9)
from math import ceil
while mx-mn>10**(-5):
    md=(mx+mn)/2
    cnt=0
    for ai in a:
        cnt+=ceil(ai/md)-1
    if cnt<=k:
        mx=md
    else:
        mn=md
print(ceil(mn))
    

Measured memory_bytes: 95984
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    int sumxor = 0;
    vector<int> vec(N);
    for (int i=0; i<N; i++) {
        int num;
        cin >> num;
        vec[i] = num;
        sumxor = sumxor ^ num;
    }

    for (int i=0; i<N; i++) {
        cout << (vec[i] ^ sumxor);
        if (i < N-1) {
            cout << " ";
        }
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 4052
#include<bits/stdc++.h>
#define pb push_back
 using namespace std;
  int main(){
    int n,k;
    
     cin>>n>>k;
      vector<int>v(n);
       for(int i=0; i<n; i++)
        cin>>v[i];
        sort(v.begin(),v.end());
         int g=0;
         int sum=0;
        while(k--)
        {
            sum+= v[g++];
        }
        cout<<sum;
      
  }

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

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

string s, t;

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

  cin>>s>>t;
  if(s.length() + 1 == t.length()){
    for(int i = 0; i < s.length(); i++){
      if(s[i] != t[i]){
        cout<<"No"<<endl;
        return 0;
      }
    }
    cout<<"Yes"<<endl;
  }
  return 0;
}


Measured memory_bytes: 3612
n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(m)]
a.sort()
a = sorted(a, key = lambda x : x[1])
c = a[0][1]
ans = 1
for i in range(1, m):
    if a[i][0] >= c:
        ans += 1
        c = a[i][1]
print(ans)

Measured memory_bytes: 29960
'use strict'

function main(input) {

    input = input.split('\n')
    let ary = input[1].split('')
    let a, b = [];
    let cnt = 0
    let max = 0 //answer
    let matched = {};

    for (let i = 0; i < ary.length; i++) {

        a = ary.slice(0, i)
        b = ary.slice(i, ary.length)

        if (i >= max) { // max が 配列数より大きかったら停止

            cnt = 0
            matched = {}

            for (let j = 0; j < i; j++) {
                b.find(element => {

                    if (element == a[j]) {
                        matched[a[j]] = true
                    }
                })
            }
            cnt = Object.keys(matched).length

            max = (max > cnt) ? max : cnt
        }

    }
    console.log(max)
}

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

Measured memory_bytes: 7868
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define TM_T template <class T>
using namespace std;
typedef long long ll;
TM_T T inp(){T it;cin >> it;return it;}

int N, K;
vector<ll> a;
vector<ll> b;

int input(){
  cin >> N;
  REP(i,N) a.push_back( inp<ll>() );
}

int main()
{
  input();
  
  REP(i,N+2) b.push_back( INF );
  b[0] = 0;
  
  REP(i,N){
    b[i+2] = min(b[i+2],b[i]+abs(a[i+2]-a[i]));
    b[i+1] = min(b[i+1],b[i]+abs(a[i+1]-a[i]));
  }
  cout << b[N-1] << endl;
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ALL(a) begin(a),end(a)
#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))
#define SP << " " <<
#define FMT(a) #a<<":"<<a 
#define FMT2(a,b) #a<<":"<<a<<", "<<#b<<":"<<b 
#define FMT3(a,b,c) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c 
#define FMT4(a,b,c,d) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c<<", "<<#d<<":"<<d 
typedef long long ll;
template<class T> istream& operator >> (istream& s, vector<T>& v) {
  for (T& x: v) s >> x;
  return s;
}
inline void Yes(bool f=true){cout<<(f?"Yes":"No")<<endl;}
inline void YES(bool f=true){cout<<(f?"YES":"NO")<<endl;}
#define ANS(a) cout<<a<<endl

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

    string s; cin >>s;
    string ans;
    if (s=="Sunny")
        ans = "Cloudy";
    else if (s=="Cloudy")
        ans = "Rainy";
    else
        ans="Sunny";
    cout << ans << endl;
}


Measured memory_bytes: 256
def main():
    N, M = map(int, input().split())
    A = sorted([int(a) for a in input().split()], reverse=True)
    t = 1 / (4*M)
    vote_num = sum(A)

    for a in A:
        if t > (a/vote_num):
            print("No")
            return
        else:
            M -= 1
            if M == 0:
                print("Yes")
                return


if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
def prime_factor(n):
    factors = []
    for i in range(2, int(n**0.5)+1):
        count = 0
        while n % i == 0:
            count += 1
            n /= i
        if count != 0:
            factors.append((i, count))
    if n != 1:
        factors.append((n, 1))
    return factors
a, b = map(int, input().split())
apf = prime_factor(a)
bpf = prime_factor(b)
print(len(set(i[0] for i in apf)&set(i[0] for i in bpf))+1)

Measured memory_bytes: 3188
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define BIT(X, i) ((X>>i)&1)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define r_all(a) (a).rbegin(), (a).rend()

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
typedef priority_queue<ll> pq;

const int MOD = 1e9+7;
const int INF = (1<<30);
const ll INFL = (1L<<62);

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

int main() {
  int n; cin >> n;
  vi a(n);
  if (n == 2) {
    ll x, y; cin >> x >> y;
    cout << max(x, y) << endl;
    return 0;
  }
  rep(i, n) {
    cin >> a[i];
  }
  vi dpl(n), dpr(n);
  dpl[0] = a[0];
  dpr[n-1] = a[n-1];
  for (int i = 1; i < n; i++) {
    dpl[i] = gcd(dpl[i-1], a[i]);
  }
  for (int i = n-2; i >= 0; i--) {
    dpr[i] = gcd(dpr[i+1], a[i]);
  }
  ll ans = max(dpl[n-2], dpr[1]);
  REP(i, 1, n-1) {
    ans = max(ans, gcd(dpl[i-1], dpr[i+1]));
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 2688
# AtCoder Beginner Contest 179
# B - Go to Jail

N=int(input())
count=0
for i in range (N):
    a,b=map(int,input().split())
    if a==b:
        count+=1
    else:
        count=0
    if count>=3:
        print('Yes')
        exit()

print('No')

Measured memory_bytes: 9108
using System;

namespace ConsoleApplication1
{
    class Program
    {
        static string strA, strB;

        private static void Main(string[] args)
        {
            strA = Console.ReadLine();
            strB = Console.ReadLine();
            int length = strA.Length;
            for (int i = 0; i < length; ++i)
            {
                strA = (strA[length - 1] + strA).Substring(0, length);
                if (strA == strB)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
            Console.WriteLine("No");
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll N=2005*2005;
bitset<N> mask;
int main(){
    cin.tie(NULL); cout.tie(NULL);
    ios_base:: sync_with_stdio(false);
    ll n,sum=0;cin>>n;
    mask[0]=1;
    for(ll i=0,x;i<n;i++)cin>>x,sum+=x,mask|=mask<<x;

    ll req = (sum+1)/2;
    while(!mask[req])req++;
    cout<<req;
}

Measured memory_bytes: 1792
import math
A,B = map(int,input().split())
X1 = math.ceil(A / 0.08)
X1max = (A+1) / 0.08
X2 = math.ceil(B / 0.10)
X2max = (B+1) / 0.10
#print (X1,X1max,X2,X2max)

X = max(X1,X2)
if X2max <= X1 or X1max <= X2:
    print(-1)
else:
    print(X)

Measured memory_bytes: 3188
#include<stdio.h>

int main() {
   int x,y,z,temp;
   scanf("%d %d %d", &x, &y, &z);
   temp = y;
   y = x;
   x = temp;
   temp = z;
   z = x;
   x = temp;
   printf("%d %d %d\n", x,y,z);
   return 0;
}




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

static const set<char> chars{'A', 'C', 'G', 'T'};

int main() {
  string S;
  cin >> S;
  int N = S.length();

  int ans{};
  int sum{};
  int right{};
  for (int left{}; left < N; left = right) {

    while (right < N
      // rightを1進めるための満たすべき条件
      && chars.find(S[right]) != chars.end()
        ) {
      // 条件更新となる処理
      ++right;
    }

    // 条件を満たすright取得時の処理
    ans = max(ans, right - left);

    if (left == right) {
      ++right;
    }
  }

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


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

using namespace std;

int main()
{
  int N, M;
  int A[50], B[50];
  int C[50], D[50];

  cin >> N >> M;
  for(int i = 0; i < N; i++) cin >> A[i] >> B[i];
  for(int j = 0; j < M; j++) cin >> C[j] >> D[j];

  for(int i = 0; i < N; i++) {
    int dist = numeric_limits< int >::max();
    for(int j = 0; j < M; j++) {
      dist = min(dist, abs(A[i] - C[j]) + abs(B[i] - D[j]));
    }
    for(int j = 0; j < M; j++) {
      if(dist == abs(A[i] - C[j]) + abs(B[i] - D[j])) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define lo long
const int lmax=1999999999;
const long long lmx=1999999999999999999;
int x,y;
int main(){std::ios::sync_with_stdio(false);
cin>>x>>y;
cout<<x+y/2<<endl;
}
/*

                   *         *
                  * *       * *
                 *   *     *   *
                *     *   *     *
               *       * *       *
               *        *        *
                *               *
                 *             *
                  *           *
                   *         *
                    *       *
                     *     *
                      *   *
                       * *
                        *



*/





Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <climits>
#include <cstdlib>
#include <vector>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#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 INF (INT_MAX/3)
#define PSB push_back
typedef long long LL;
//#define int long long

//booooooooooooost
/*
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;	//多倍長整数(mp::cpp_int)
*/


signed main() {

	int N;
	vector<int> L;
	cin >> N;
	REP(i, 2 * N) {
		int tmp;
		cin >> tmp;
		L.PSB(tmp);
	}

	sort(ALL(L));
	int ans = 0;
	REP(i, N) {
		ans += min(L[2 * i], L[2 * i + 1]);
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
N,K,Q = map(int, input().split()) #N人、K点、Q問
A = [int(input()) - 1 for i in range(Q)] #受験番号とリスト番号のズレを補正
# print(A)
P = [0] * N #持ち点
for j in range(Q):
    P[A[j]] +=1
for k in range(N):
    if P[k] > Q - K:
        print("Yes")
    else:
        print("No")

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

using namespace std;

int main(void) {
    int x, a, b;
    cin >> x >> a >> b;
    int d = b - a;
    if (b <= a) cout << "delicious\n";
    else if (b <= a + x) cout << "safe\n";
    else cout << "dangerous\n"; 

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
typedef long long ll;
const ll longinf=1LL<<60;
using namespace std;
int n,k;

int main()
{
    cin >> n>>k;
    if (k==1) cout<<0<<endl;
    else cout<<n-k<<endl;
    return 0;
}



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

int main()
{
  int N; cin >> N;
  map<int, int> mp;
  for (int i = 0; i < N; ++i) {
    int a; cin >> a;
    mp[a]++;
  }

  int ans = 0;
  for (auto v : mp) {
    if (v.second % 2 == 1) ans++;
  }

  cout << ans << endl;
}

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

int main() {
	int i, a[3];
	cin >> i;

	bool ans[i];
	for (int j = 0; i > j; j++) {
		cin >> a[0] >> a[1] >> a[2];

		sort(a,a+3);

		if(a[0]*a[0] + a[1] * a[1] == a[2] * a[2]) ans[j] = true;
		else                                       ans[j] = false;
	}

	for(int j = 0; i > j; j++) {
		if(ans[j] == true) cout<<"YES"<<endl;
		else               cout<<"NO"<<endl;
	}
	return 0;
}

Measured memory_bytes: 1176
N = int(input())
S = input()

count = 0
l = 0
for i in range(len(S)):
    if S[i] == '(':
        count += 1
    else:
        if count == 0:
            l += 1
        else:
            count -= 1
S = '('*l + S
S = S[::-1]

count = 0
r = 0
for i in range(len(S)):
    if S[i] == ')':
        count += 1
    else:
        if count == 0:
            r += 1
        else:
            count -= 1

S = ')'*r + S
print(S[::-1])

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

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

    string s;
    cin >> s;

    int total_w = 0, total_e = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'W') {
            total_w++;
        } else {
            total_e++;
        }
    }

    int cur_w = 0, cur_e = 0, min_cnt = n;
    for (int i = 0; i < n; i++) {
        min_cnt = min(min_cnt, cur_w + (total_e - cur_e - (s[i] == 'E' ? 1 : 0)));
        if (s[i] == 'W') {
            cur_w++;
        } else {
            cur_e++;
        }
    }
    cout << min_cnt << endl;
    return 0;
}

Measured memory_bytes: 900