akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i < n; i++) {
		cin >> a[i];
	}
	int ans = abs(a[n - 1] - a[0]);
	for(int i = 0; i < n; i++) {
		for(int j = i + 1; j < n; j++) {
			ans = max(ans, abs(a[i] - a[j]));
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<queue>
#include<cstring>
using namespace std;
typedef pair<int,int> P;
int N,M;
char mz[52][52];
int mark[52][52];
int ans=0;
int dx[]={-1,1,0,0};
int dy[]={0,0,-1,1};
int BFS(int c,int l)
{
    queue<P>que;
    que.push(P(c,l));
    while(!que.empty())
    {
        c=que.front().first,l=que.front().second;//Tmp=Queue.Top
        if(c==N-1&&l==M-1)
            return mark[c][l];//结束条件:找到终点
        que.pop();
        for(int i=0;i<4;i++)//状态扩展，列出下一层的所有可能状态
        {
            int x=c+dx[i];
            int y=l+dy[i];
            if(x<0||y<0||x>=N||y>=M)
                continue;
            if(!mark[x][y]&&mz[x][y]!='#')//状态合法，则生成新状态NEXT
            {
                mark[x][y]=mark[c][l]+1;//NEXT.STEP=Tmp.STEP+1
                que.push(P(x,y));//加入队列
            }
        }
    }
    return -1;
}
int main()
{
    memset(mark,0,sizeof(mark));
    scanf("%d%d",&N,&M);
    getchar();
    int num=0;
    for(int i=0;i<N;i++)
    {
        for(int j=0;j<M;j++){
        scanf("%c",&mz[i][j]);
        if(mz[i][j]=='#')
        num++;
        }
        getchar();
    }
    ans=BFS(0,0);
    ans++;
    if(ans==0||mz[0][0]=='#'||mz[N-1][M-1]=='#') printf("-1");
    else
    printf("%d",N*M-ans-num);
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int fib(int *,int,int);
int main(){
  int A[45],x;
  A[0]=1;
  A[1]=1;
  scanf("%d",&x);
  if(x==1||x==0)
    printf("1\n");
 else printf("%d\n",fib(A,2,x));
}
int fib(int A[],int i,int x){
  A[i]=A[i-2]+A[i-1];
  if(i==x)
    return A[i];
  else
    return fib(A,i+1,x);
}


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

using namespace std;

unordered_map<string, int> mp;

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

mp["SUN"] = 1; 
mp["MON"] = 2; 
mp["TUE"] = 3; 
mp["WED"] = 4;
mp["THU"] = 5; 
mp["FRI"] = 6; 
mp["SAT"] = 7;

   
    string s;
    cin >> s;
    if(s == "SUN") cout << "7\n";
    else cout << 8 - mp[s] << "\n";

    return 0;    
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
int n, a[1000];
using namespace std;

int main() {
  while (1) {
    scanf("%d", &n);
    if (n == 0) break;
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    int diff = 100000000;
    sort(a, a + n);
    for (int i = 0; i < n - 1; i++) diff = min(diff, a[i+1] - a[i]);
    printf("%d\n", diff);
  }
}



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

void solve(){
	int n,m,p,x;
	cin>>n;
	vector<int> arr(n);
	for(int&x : arr)cin>>x;
	int sum= accumulate(arr.begin(),arr.end(),0);
	cin>>m;
	for(int i =0;i<m;i++){
		cin>>p>>x;
		ll temp=sum+x-arr[p-1];
		cout<<temp<<'\n';
	}
}


int main(){
	solve();
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
constexpr int MOD = 1000000007;
int main()
{
    int H, W, K;
    cin >> H >> W >> K;
    vector<string> s(H);
    REP(i, H) cin >> s[i];
    vector<int> row(H, 0);
    REP(i, H) {
        REP(j, W) {
            if(s[i][j] == '#') row[i]++;
        }
    }
    vector<vector<int>> ans(H, vector<int>(W, 0));
    int nowid = 1;
    REP(i, H) {
        if(row[i] == 0) continue;
        bool flg = false;
        REP(j, W) {
            if(s[i][j] == '#') {
                if(!flg) {
                    flg = true;
                } else {
                    nowid++;
                }
            }
            ans[i][j] = nowid;
        }

        int i2 = i-1;
        while(i2 >= 0) {
            if(row[i2] == 0) {
                REP(j, W) ans[i2][j] = ans[i][j];
            } else {
                break;
            }
            i2--;
        }

        i2 = i+1;
        while(i2 < H) {
            if(row[i2] == 0) {
                REP(j, W) ans[i2][j] = ans[i][j];
            } else {
                break;
            }
            i2++;
        }
        nowid++;
    }
    
    REP(i, H) {
        REP(j, W) cout << ans[i][j] << (j!=W-1 ? " " : "");
        cout << endl;
    }
}

Measured memory_bytes: 1280
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
#include <string>
#include <time.h>
#include <bitset>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }

int N, M;

int main() {

	cin >> N >> M;



	cout << (N * (N - 1)) / 2 + (M * (M - 1)) / 2 << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>

template<typename T>
T euclidean_gcd(T a, T b){
    if(a == 0)return b;
    while(a){
        swap(a, b);
        a %= b;
    }
    return b;
}

int main(){
    using namespace std;
    using bigint = boost::multiprecision::cpp_int;
    constexpr unsigned long MOD = 1000000007;
    bigint lcm{1}, b{0};
    unsigned long N;
    cin >> N;
    for(unsigned long i{0}, A; i < N; ++i){
        cin >> A;
        auto t = euclidean_gcd<bigint>(lcm, A);
        (b *= (A / t)) += lcm /= t;
        lcm *= A;
    }
    cout << ::boost::multiprecision::integer_modulus(b, MOD) << endl;
    return 0;
}

Measured memory_bytes: 384
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 100_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "a", long, "b");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

void main()
{
    long n, m;
    scan(n, m);
    auto p = new Pair[](n);
    foreach (i; iota(n))
    {
        long a, b;
        scan(a, b);
        p[i] = Pair(a, b);
    }
    p.sort!"a.a < b.a"();
    long ans, cnt;
    foreach (e; p)
    {
        if (cnt + e.b > m)
        {
            long r = m - cnt;
            ans += (e.a * r);
            cnt += r;
        }
        else
        {
            ans += e.a * e.b;
            cnt += e.b;
        }
    }
    ans.writeln();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}


Measured memory_bytes: 12668
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
inline int read(){
	int re=0,flag=1;char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-') flag=-1;
		ch=getchar();
	}
	while(isdigit(ch)) re=(re<<1)+(re<<3)+ch-'0',ch=getchar();
	return re*flag;
}
int n,m,a[2010][2010],b[2010][2010],height[2010],sta[2010],top,le[2010],ri[2010];
char s[2010];
int main(){
	n=read();m=read();int i,j;
	for(i=1;i<=n;i++){
		scanf("%s",s);
		for(j=1;j<=m;j++) a[i][j]=(s[j-1]=='#');
	}
	for(i=1;i<n;i++) 
		for(j=1;j<m;j++)
			b[i][j]=a[i][j]^a[i+1][j]^a[i][j+1]^a[i+1][j+1];
	int ans=max(n,m);
	for(i=1;i<=n;i++){
		for(j=1;j<m;j++) height[j]++,le[j]=0,ri[j]=m;
		top=1;sta[top]=0;
		for(j=1;j<m;j++){
			while(height[sta[top]]>height[j]){
//				cout<<"poped1\n";
				ri[sta[top]]=j;
				sta[top--]=0;
			}
			sta[++top]=j;
		}
		top=1;sta[top]=m;
		for(j=m-1;j>0;j--){
			while(height[sta[top]]>height[j]){
//				cout<<"poped2\n";
				le[sta[top]]=j;
				sta[top--]=0;
			}
			sta[++top]=j;
		}
		for(j=1;j<m;j++) ans=max(ans,height[j]*(ri[j]-le[j]));
		for(j=1;j<m;j++) if(b[i][j]) height[j]=0;
	}
	printf("%d\n",ans);
}


Measured memory_bytes: 31744
A = gets.to_i
B = gets.to_i
C = gets.to_i
X = gets.to_i

ans = 0
(0..A).each do |a|
  (0..B).each do |b|
    (0..C).each do |c|
      ans += 1 if a * 500 + b * 100 + c * 50 == X
    end
  end
end
puts ans


Measured memory_bytes: 1788
N,W = map(int,input().split())
INF = 10**9+7
NV = (10**3)*N
dp = [[0]+[INF for j in range(NV)] for i in range(N+1)]

for i in range(1,N+1):
    w,v = map(int,input().split())
    for j in range(NV+1):
        if j < v:
            dp[i][j] = min(dp[i-1][j], w)
        else:
            dp[i][j] = min(dp[i-1][j], dp[i-1][j-v]+w)

ans = 0
for j in range(NV+1):
    if dp[N][j] <= W:
        ans = j
print(ans)


Measured memory_bytes: 181968
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}

const ll INF=1e15;

int main(){
    string sa,sb,sc;
    cin>> sa>> sb >> sc;
    ll posa=0,posb=0,posc=0;
    char c=sa[posa++];
    //cout << c <<endl;
    while(true){
        if(c=='a'){
            if(posa==sa.length()){
                cout << 'A' << endl;
                return 0;
            }
            c=sa[posa++];
        }
        else if(c=='b'){
            if(posb==sb.length()){
                cout << 'B' << endl;
                return 0;
            }
            c=sb[posb++];
        }
        else{
            if(posc==sc.length()){
                cout << 'C' << endl;
                return 0;
            }
            c=sc[posc++];
        }
    }
    return 0;
}

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

#define inf 99999999

int dp[110][10010] = {0} ;

int main()
{
    int N = 0 ;
    int W = 0 ;
    int v[110] = {0} ;
    int w[110] = {0} ;

    cin >> N >> W ;
    for ( int i = 0 ; i < N ; i++ )
    {
        cin >> v[i] >> w[i] ;
    }

    for ( int i = 0 ; i <= N ; i++ )
    {
        dp[i][0] = 0 ;
        if ( i == 0 )
        {
            for ( int j = 0 ; j <= W ; j++ )
            {
                dp[i][j] = 0 ;
            }
        }
    }

    for ( int i = 0 ; i <= N ; i++ )
    {
        for ( int j = 0 ; j <= W ; j++ )
        {
            if ( i == 0 )
            {
                dp[i][j] = 0 ;
            }
            else if ( j == 0 )
            {
                dp[i][j] = dp[i-1][j] ;
            }
            else
            {
                if ( j-w[i-1] >= 0 )
                {
                    dp[i][j] = max( dp[i-1][j-w[i-1]] + v[i-1] , dp[i-1][j] ) ;
                }
                else
                {
                    dp[i][j] = dp[i-1][j] ;
                }

            }
            //printf("% 9d,",dp[i][j]);
        }
        //printf("\n");
    }

    printf("%d\n",dp[N][W]) ;

    return 0 ;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SZ(x) ((int)(x).size())
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))

int main() {
  string S;
  cin >> S;
  int N = S.length();
  char tmp[1024];
  strcpy(tmp, S.c_str());
  int a[1024];
  for(int i = 0; i < N; i++) {
    a[i] = tmp[i] - '0';
  }
  int min = 1000;
  for (int i = 0; i < N - 2; i++){
    if (min > abs(753 - (a[i] * 100 + a[i+1] * 10 + a[i+2]))){
      min = abs(753 - (a[i] * 100 + a[i + 1] * 10 + a[i + 2]));
    }
  }
  cout << min << endl;
  return 0;
}


Measured memory_bytes: 760
fn input_line() -> Vec<String> {
  let mut buf = String::new();
  std::io::stdin().read_line(&mut buf).unwrap();
  return buf
    .split_whitespace()
    .map(|word| String::from(word))
    .collect();
}

fn main() {
  let inputs = input_line();
  let x: i32 = inputs[0].parse().unwrap();
  let ans = if x >= 30 {
    "Yes"
  } else {
    "No"
  };
  println!("{}", ans);
}

Measured memory_bytes: 2108
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 10000000000000000
#define endl '\n'
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; }
using namespace std;
#define pp pair<pair<string,int>,int> 
#define ppp pair<string,int>
int n;
pp a[101];


signed main(void){
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cin>>n;
    rep(i,n){
        cin>>a[i].F.F>>a[i].F.S;
        a[i].S=i+1;
    }
    a[n]=pp(ppp("zzzzzzzzzzzz",0),n+1);
    sort(a,a+n);
    int l=0,r=0;
    rep(i,n){
        r++;
        if(a[i].F.F!=a[i+1].F.F){
            reverse(a+l,a+r);
            l=i+1; r=i+1;
        }
    }
    rep(i,n)cout<<a[i].S<<endl;
}

Measured memory_bytes: 256
#define D(x) cout << #x " = " << x << endl
#define DD(x, y) cout << "(" #x ", " #y ") = (" << x << ", " << y << ")" << endl
#define DDD(x, y, z) cout << "(" #x ", " #y ", " #z ") = (" << x << ", " << y << ", " << z << ")" << endl
#define DV(v) for (auto __macro_vi : v){ cout << __macro_vi << " ";} cout << endl;
#define DA(a, n) for (int __macro_i = 0; __macro_i < n; ++__macro_i) { cout << a[__macro_i] << " "; } cout << endl;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(v) (v).begin(), (v).end()
#include<iostream>
#include<vector>
#include<cassert>
#include<cmath>
#include<string>

using namespace std;
using ll = long long;
int h, w;
vector<string> grid;
vector<vector<ll>> dp;

ll dfs(int i, int j) {
    // DD(i, j);
    if (dp[i][j] != -1) return dp[i][j];
    ll ans = 0;
    if (i > 0 && grid[i - 1][j] != '#') ans = (ans + dfs(i - 1, j)) % 1000000007;
    if (j > 0 && grid[i][j - 1] != '#') ans = (ans + dfs(i, j - 1)) % 1000000007;
    dp[i][j] = ans;
    return ans;
}

int main()
{
    cin >> h >> w;
    grid.resize(h);
    dp = vector<vector<ll>>(h, vector<ll>(w, -1));
    REP(i, h) {
        cin >> grid[i];
    }
    dp[0][0] = 1;
    cout << dfs(h - 1, w - 1) << endl;
    // for (auto row : dp) {
    //     DV(row);
    // }
}


Measured memory_bytes: 9728
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C_Lamps solver = new C_Lamps();
        solver.solve(1, in, out);
        out.close();
    }

    static class C_Lamps {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }
            for (int step = 0; step < k; step++) {
                int[] na = once(a);
                if (Arrays.equals(a, na)) {
                    break;
                }
                a = na;
            }
            for (int i = 0; i < n; i++) {
                if (i > 0) {
                    out.print(" ");
                }
                out.print(a[i]);
            }
            out.println();
        }

        private int[] once(int[] a) {
            int n = a.length;
            int[] add = new int[n + 1];
            for (int i = 0; i < a.length; i++) {
                int l = Math.max(i - a[i], 0);
                int r = Math.min(i + a[i], n - 1);
                ++add[l];
                --add[r + 1];
            }
            int[] na = new int[n];
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += add[i];
                na[i] = sum;
            }
            return na;
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



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

int main()
{
    ll n;
    cin >> n;
    ll h[n];
    rep(i, n) cin >> h[i];
    for (ll i = n - 1; i > 0; i--)
    {
        if (h[i] < h[i - 1])
            h[i - 1]--;
    }
    rep(i,n-1){
        if(h[i]>h[i+1]){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}

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

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

  char now = S[0];
  int ans = 0;
  for(int i=1;i<S.size();i++){
    if(now != S[i]){
      now = S[i];
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 512
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define vec(s) vector

#define vvec(s) vector<vector
>
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli,lli> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
#define YES(x) cout<<(x?"YES":"NO")<<endl;
#define out(s) cout<<s<<endl;
#define Reverse(x) reverse(all(x));
#define Sort(x) sort(all(x));
#define pb(s) push_back(s);
#define sp " " 
#define INF 10000000000
#define LINF 9000000000000000000
#define all(s) s.begin(),s.end()
void vout(vi v){
    for(lli i=0;i<v.size();i++)
    cout<<v.at(i)<<endl;
}
int main(){
    cout << std::fixed << std::setprecision(10);
    lli n,x,t;
    cin>>n>>x>>t;
    lli ans = 0;
    ans = (n / x) * t;
    if(n%x!=0){
        ans +=t;
    }
    out(ans);
}

Measured memory_bytes: 3632
//by sdfzchy
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
typedef pair<int,int> PII;
typedef long long LL;
const int inf=(1<<30),N=100010;
int n,m;
deque<PII> q;
inline int in()
{
	char ch=getchar();
	int f=1,tmp=0;
	while(ch<'0'||ch>'9') {if(ch=='-') f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') {tmp=(tmp<<1)+(tmp<<3)+(ch-'0');ch=getchar();}
	return tmp*f;
}
bool vis[N];
int main()
{
	n=in();
	q.push_front(make_pair(1,1));
	while(!q.empty())
	{
		PII x=q.front();
		q.pop_front();
		int fir=x.first,sec=x.second;
		if(vis[fir]) continue;
		vis[fir]=1;
		if(fir==0) {printf("%d\n",sec);return 0;}
		q.push_front(make_pair(fir*10%n,sec));
		q.push_back(make_pair((fir+1)%n,sec+1));
	}
	return 0;
}


Measured memory_bytes: 1152
s = input()
t = input()
Alphabet = list(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
)

flag = 0
S = sorted(s)
T = sorted(t,reverse = True)
for i in range(min(len(S),len(T))) :
    if S[i] == T[i] :
        flag += 1
    else :
        for j in range(len(Alphabet)) :
            if S[i] == Alphabet[j] :
                print("Yes")
                flag += -10000
                break
            elif T[i] == Alphabet[j] :
                print("No")
                flag += -10000
                break
            else :
                continue
        break
    
if flag == min(len(S),len(T)) :
    if len(S) >= len(T) :
        print("No")
    elif s != t :
        print("Yes")
    else :
        print("No")
#print(Alphabet)
        

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define int long long
using P = pair<int,int>;
const int INF = 1e18;
#define put(n) cout<<(n)<<endl
#define rep(i,N) for(int(i)=0;(i)<(N);++(i))
#define all(v) (v).begin() , (v).end()
#define rall(v) (v).rbegin() , (v).rend()
#define pb(n) push_back(n)

signed main(){
    char c;
    cin >> c;
    if(c == 'A') put('T');
    if(c == 'T') put('A');
    if(c == 'C') put('G');
    if(c == 'G') put('C');

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
namespace ZDY{
    #define res register
    #define ri res ll
    #define ll unsigned long long
    #define db double
    #define sht short
    #define il inline
    #define MB template <class T>
    #define Fur(i,x,y) for(ri i=x;i<=y;i++)
    #define fur(i,x,y) for(i=x;i<=y;i++)
    #define Fdr(i,x,y) for(ri i=x;i>=y;i--)
    #define clr(x,y) memset(x,y,sizeof(x))
    #define cpy(x,y) memcpy(x,y,sizeof(x))
    #define fl(i,x) for(ri i=head[x],to;to=e[i].to,i;i=e[i].nxt)
    #define inf 21474836473
    #define fin(s) freopen(s".in","r",stdin)
    #define fout(s) freopen(s".out","w",stdin)
    #define l2(n) (ceil(log2(n)))
    MB il T ABS(T x){return x>0?x:-x;}
    MB il T MAX(T x,T y){return x>y?x:y;}
    MB il T MIN(T x,T y){return x<y?x:y;}
    MB il T GCD(T x,T y){return y?GCD(y,x%y):x;}
    //#define gc() getchar()
    il char gc(){static char buf[1000000],*s,*t;return s==t?(((t=(s=buf)+fread(buf,1,1000000,stdin))==s)?-1:*s++) : *s++;}
    il int gi(){int x=0,f=0;char c=gc();while(c<'0'||'9'<c){if(c=='-')f=!f;c=gc();}while('0'<=c&&c<='9'){x=x*10+c-48;c=gc();}return f?(-x):x;}
}using namespace ZDY;using namespace std;
#define N 100010
ll l[55],n,k,s[55],ans=0;
il void cl(){
    l[0]=s[0]=1;
    Fur(i,1,50)l[i]=(l[i-1]<<1)+3,s[i]=(s[i-1]<<1)+1;
}
#define chk if(!k){cout<<ans<<endl;exit(0);}
il void dfs(ll d){
    if(d==0){
        chk;
        cout<<ans+1<<endl;exit(0);
    }
    chk;//  _
    k--;chk;// .
    if(k>=l[d-1]){ans+=s[d-1],k-=l[d-1];chk;}// .bk
    else dfs(d-1);
    ans++;k--;chk;// .bk$
    if(k>=l[d-1]){ans+=s[d-1],k-=l[d-1];chk;}// .bk&bk
    else dfs(d-1);
    k--;chk;// .bk&bk.
}
int main(){
    cl();
    cin>>n>>k;
    dfs(n);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
#define pb(a) push_back(a)
#define pr(a) cout<<(a)<<endl
#define PR(a,b) cout<<(a)<<" "<<(b)<<endl
#define R cin>>
#define F first
#define S second
#define ll long long
bool check(int n,int m,int x,int y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<60,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;
typedef pair<P,P> P2;

int main() {
  int n,m;
  while(cin >> m >> n && n) {
    int a[n][m];
    rep(i,n)rep(j,m) R a[i][j];
    int d[n][m][4],c[4];
    rep(i,n)rep(j,m)rep(k,4) d[i][j][k]=MAX;
    rep(i,4) R c[i];
    d[0][0][1]=0;
    priority_queue<P2,vector<P2>,greater<P2> > que;
    que.push(P2(P(0,1),P(0,0)));
    int ans=-1;
    while(!que.empty()) {
      P2 p=que.top();que.pop();
      int nx=p.S.F,ny=p.S.S,cc=p.F.F,k=p.F.S;
      if(cc<d[nx][ny][k]) continue;
      if(nx==n-1 && ny==m-1) {
	ans=d[nx][ny][k];
	break;
      }
      rep(i,4) {
	int z=c[i],kk=(k+i)%4;
	int x=nx+dx[kk],y=ny+dy[kk];
	if(!check(n,m,x,y)) continue;
	if(a[nx][ny]==i) z=0;
	if(d[x][y][kk]>d[nx][ny][k]+z) {
	  d[x][y][kk]=d[nx][ny][k]+z;
	  que.push(P2(P(d[x][y][kk],kk),P(x,y)));
	}
      }
    }
    pr(ans);
  }
  return 0;
}


Measured memory_bytes: 1328
#include<bits/stdc++.h>
#define M 1000000007
#define pi ld(acos(-1.0))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,n) for(int i=1;i<(int)(n);i++)
#define repp(i,a,b)  for(ll i=a;i<=(ll)(b);i++)
#define Repp(i,a,b)  for(int i=a;i>=(int)(b);i--)
#define cs ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fi first
#define se second
#define ii pair<int,int>
#define bye(x) {cout<<x;return 0;}
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
    cs
    int n,ans=0;cin>>n;
    vector<int> v(n-1);
    for(auto &i:v) cin>>i;
    vector<int> vv(n);vv[0]=vv[1]=v[0];
    repp(i,1,n-2) {
        vv[i+1]=v[i];
        if(vv[i]>v[i]) vv[i]=v[i];
    }
    for(auto i:vv) ans+=i;cout<<ans;
}

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

int main() {
  int N; cin >> N;
  int n = N;
  int s = 0;
  while (n != 0) {
    s += n % 10;
    n /= 10;
  }
  if (N % s == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;

const int Mx=1e6+11;
const double PI = acos(-1);
#define MOD 1000000007

#define nl '\n'
#define pb push_back
#define F first
#define S second
#define I insert
#define mp make_pair

#define sz(x) x.size()
#define tt int t; cin>>t; while(t--)
#define be(a) (a).begin(),(a).end()
#define rbe(a) (a).rbegin(),(a).rend()
#define mem(a,b) memset(a,b,sizeof(a))
#define yes cout<<"YES"<<nl
#define no cout<<"NO"<<nl

#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define frac cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

void solve()
{
  int k;
  cin>>k;
  for(int i=1;i<=k;i++)
    cout<<"ACL";
  cout<<nl;
}

int main()
{
    fio;
    solve();
    return 0;
}


Measured memory_bytes: 3596
import java.util.*;


public class Main {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		if (a < b && b < c) {
		    System.out.println("Yes");
		} else {
		    System.out.println("No");
		}
    }
}


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

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
#define mem(a,b) memset(a,b,sizeof(a))
#define shutdown ios::sync_with_stdio(false)
#define MAX 1e18+1000//1*10^18

bool a[2000000]={false};

int main(){
    int n,m,k;
    scanf("%d%d%d",&n,&m,&k);
    for(int i=0;i<=m;i++){
        for(int j=0;j<=n;j++){
            a[i*n+j*m-2*i*j]=true;
        }
    }
    if(a[k]==true)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}



Measured memory_bytes: 1280
#include <iostream>
#include <map>
#include <vector>
#include <stack>
#include <stdio.h>
#include <algorithm>
#include<cstring>
using namespace std;
map<long long,int>mp;
int main()
{
    int n;
    cin>>n;
    long long ans=0;
    for(int i=0;i<n;++i)
    {
        long long x;
        cin>>x;
        ans+=mp[i-x];
        mp[x+i]++;
    }
    cout<<ans<<endl;
    return 0;
}


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

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

	int next = 1;
	for (int i = 0; i < N; i++) {
		if (a.at(i) == next) next++;
	}

	if (next == 1) {
		cout << -1 << endl;
	} else {
		cout << N - (next - 1) << endl;
	}
}

Measured memory_bytes: 1024
n = int(input())
ac, wa, tle, re = 0, 0, 0, 0
for i in range(n):
    jd = str(input())
    if jd == 'AC':
        ac += 1
    elif jd == 'WA':
        wa += 1
    elif jd == 'TLE':
        tle += 1
    else:
        re += 1

print('AC x {}'.format(ac))
print('WA x {}'.format(wa))
print('TLE x {}'.format(tle))
print('RE x {}'.format(re))


Measured memory_bytes: 9204
/* dijkstra.cpp
    ダイクストラ法で、ある頂点から各頂点への最短距離を求めるアルゴリズム
    負の辺が含まれる場合はうまく計算出来ないので、ベルマンフォード法を用いる

    verified: AOJ GRL_1_A
        http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A&lang=jp
*/

#include <bits/stdc++.h>
using namespace std;

template <typename T>
struct Edge {
    int to;
    T cost;
};
using Graph = vector<vector<Edge<long long>>>;  // 距離/コストの型 T を指定する
const long long INF = (1LL << 60);              // 型 T のINF (完全な最大値は取らないように)

using ll = long long;

int S;

/* dijkstra(G,s,dis,prev)
    入力：グラフ G, 開始点 s, 距離を格納する dis, 最短経路の前の点を記録するprev
    計算量：O(|E|log|V|)
    副作用：dis, prevが書き換えられる
*/
template <typename T>
void dijkstra(const Graph &G, int s, vector<T> &dis, vector<int> &prev) {
    using P = pair<T, int>;

    int N = G.size();
    dis.resize(N, INF);
    prev.resize(N, -1);
    priority_queue<P, vector<P>, greater<P>> pq;  // the least element is top. first:cost, second: node
    dis[s] = 0;
    pq.emplace(dis[s], s);
    while (!pq.empty()) {
        P p = pq.top();  // the least element
        pq.pop();
        int v = p.second;
        if (dis[v] < p.first) {
            continue;
        }
        for (auto &e : G[v]) {
            if (dis[e.to] > dis[v] + e.cost) {
                dis[e.to] = dis[v] + e.cost;
                prev[e.to] = v;
                pq.emplace(dis[e.to], e.to);
            }
        }
    }
}

int main() {
    int N, M;
    cin >> N >> M >> S;
    Graph G(N * 2501);
    for (int i = 0; i < M; i++) {
        int u, v, a, b;
        cin >> u >> v >> a >> b;
        u--, v--;
        for (int j = 0; j < 2501; j++) {
            if (j - a >= 0) G[u * 2501 + j].push_back({v * 2501 + (j - a), b});
            if (j - a >= 0) G[v * 2501 + j].push_back({u * 2501 + (j - a), b});
        }
    }
    for (int u = 0; u < N; u++) {
        int c;
        ll d;
        cin >> c >> d;
        for (int j = 0; j < 2501 - 1; j++) {
            G[u * 2501 + j].push_back({u * 2501 + min(j + c, 2501 - 1), d});
        }
    }
    vector<long long> dis;
    vector<int> prev;
    dijkstra(G, min(S, 2500), dis, prev);
    for (int i = 1; i < N; i++) {
        ll ans = INF;
        for (int j = 0; j < 2501; j++) {
            ans = min(ans, dis[i * 2501 + j]);
        }
        cout << ans << endl;
    }

    return 0;
}


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

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;

using _loop_int = int;
#define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); i++)
#define FOR(i, a, b) for (_loop_int i = (_loop_int)(a); i < (_loop_int)(b); i++)
#define FORR(i, a, b) for (_loop_int i = (_loop_int)(b)-1; i >= (_loop_int)(a); i--)

#define CHMIN(a, b) (a) = min((a), (b))
#define CHMAX(a, b) (a) = max((a), (b))
#define ALL(v) (v).begin(), (v).end()

#ifdef HOGE
#define DEBUG(x) cerr << #x << ": " << (x) << endl
#define DEBUG_VEC(v)                                                                                                   \
  cerr << #v << ": ";                                                                                                  \
  REP(__i, (v).size()) cerr << ((v)[__i]) << ", ";                                                                     \
  cerr << endl
#else
#define DEBUG_VEC(v)
#define DEBUG(x)
#endif

#define PRINT(x) cout << (x) << endl;
#define PRINT_ARR(arr)                                                                                                 \
  for (_loop_int i = 0; i < arr.size() - 1; i++)                                                                       \
    cout << arr[i] << " ";                                                                                             \
  cout << arr[arr.size() - 1] << endl;
#define IN(n) cin >> n;
#define EXTEND(base_arr, arr) base_arr.insert(base_arr.begin(), arr.begin(), arr.end());

const ll MOD = 1000000007ll;

int main() {
  string s;
  IN(s)

  int rcount = 0;
  int lcount = 0;
  char l = 'R';
  vl result = vl(0);
  REP(i, s.size()) {
    char c = s[i];
    if (l == 'L' && c == 'R') {
      int rr = (rcount + 1) / 2 + (lcount / 2);
      int ll = rcount + lcount - rr;
      DEBUG_VEC(result);
      result.insert(result.end(), rcount - 1, 0);
      result.push_back(rr);
      result.push_back(ll);
      result.insert(result.end(), lcount - 1, 0);
      rcount = 0;
      lcount = 0;
    }
    if (c == 'R') {
      rcount += 1;
    }
    if (c == 'L') {
      lcount += 1;
    }
    l = c;
  }
  int rr = (rcount + 1) / 2 + (lcount / 2);
  int ll = rcount + lcount - rr;
  result.insert(result.end(), rcount - 1, 0);
  result.push_back(rr);
  result.push_back(ll);
  result.insert(result.end(), lcount - 1, 0);

  PRINT_ARR(result);
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
#define int long long int
#define get(a,b,c)  int a[n];int b[n];int c[n]; for(int i=0;i<n;i++){cin>>a[i];cin>>b[i];cin>>c[i];}
#define out(a) for(int i=0;i<n;i++){cout<<a[i]<<" ";}cout<<endl;
#define db(x) cout<<x<<" "<<endl;
#define deb  cout<<"hi"<<" "<<endl;
#define endl "\n"

using namespace std;
int mod(int a,int b)
{
    if(a-b<=0)
    {
        return b-a;
    }
    else
    {
        return a-b;
    }
}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
//    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        get(a,b,c);
        for(int i=n-2;i>=0;i--)
        {
            a[i]=a[i]+max(b[i+1],c[i+1]);
            b[i]=b[i]+max(a[i+1],c[i+1]);
            c[i]=c[i]+max(a[i+1],b[i+1]);
        }
        cout<<max(a[0],max(b[0],c[0]))<<endl;
    }
  
}

Measured memory_bytes: 2560
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>


using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define REPO(i, n) for(int i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define INF64 1999999999999999999
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007


string s;
int main() {
	cin >> s;
	s[3] = '8';
	cout << s << endl;
}



Measured memory_bytes: 256
n = int(input())
i = 1
k = ""
while i <= n:
    if i%3 == 0:
        print(k, end=" ")
        k = i
    else:
        m = i
        while m//10 > 0:
            if m%10 == 3 or m//10 == 3:
                print(k, end=" ")
                k = i
                m = 0
            else:
                m = m//10
    i += 1
    
print(k)


Measured memory_bytes: 5868
package main

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

func main() {
	fsc := NewFastScanner()
	x := fsc.NextInt()
	if x < 1200 {
		fmt.Println("ABC")
	} else {
		fmt.Println("ARC")
	}
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1024)
	return &FastScanner{r: rdr}
}
func (s *FastScanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *FastScanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *FastScanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *FastScanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *FastScanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *FastScanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

func IntMax(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func Int64Max(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func Float64Max(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}

func IntMin(a, b int) int {
	if a > b {
		return b
	}
	return a
}

func Int64Min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func Float64Min(a, b float64) float64 {
	if a > b {
		return b
	}
	return a
}


Measured memory_bytes: 640
import java.util.*;
public class Main{
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

while(true){
  String b = sc.next();
  int a = b.length();
  int goukei = 0;
  int kazu[] = new int [a];

  if(b.equals("0"))
    break;
  for(int i = 0; i<a; i++){
    kazu[i] = b.charAt(i)-'0';
    goukei += kazu[i];
  }
  System.out.println(goukei);
}

}
}



Measured memory_bytes: 26328
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <fstream>
#include <string>
#include <math.h>
#include <set>
#include <string>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> T;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define revrep(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define f first
#define s second
#define pb push_back

ll mod = 1000000007;
const ll INF = 100000000000010000;
//const ull B = 998244353;

ll bit[200010];
//ll kai[3010];
ll Cnt[1000010];

//void pres(double A, ll x = 20) { printf("%.20f\n", x); }



/*ll sum(ll i)
{
	//i += 1;
	ll t = 0;
	while (i > 0)
	{
		t += bit[i];
		i -= i & -i;
	}
	return t;
}

void add(ll i, ll x)
{
	//i += 1;
	while (i <= 200005)
	{
		bit[i] += x;
		i += i & -i;
	}
}*/

/*`ll SAIKI(ll S) {
	for (ll T = S; ; T = (T - 1) & S) {

	}
}*/



void test() {
	cout << "888888888888888888888888" << endl;
}

ll gcd(ll x, ll y) {
	if (y == 0) return x;
	return gcd(y, x % y);
}

ll pow_mod(ll x, ll k) {
	x %= mod;
	ll res = 1;
	while (k > 0) {
		if (k % 2) {
			res *= x; res %= mod;
		}
		x *= x; x %= mod;
		k /= 2;
	}
	return res;
}

ll div_mod(ll x) {
	return pow_mod(x, mod - 2);
}

//コンビネーション
const int MAXcomb = 200010;
ll fac[MAXcomb], finv[MAXcomb], inv[MAXcomb];
//facはn!,finvは1/n!
//invは逆元
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAXcomb; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod%i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}
ll comb(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * finv[k] % mod * finv[n - k] % mod;
}

void makePrimeList(ll x) {
	ll X = x;
	for (ll j = 2; j * j <= x; j++) {
		ll cnt = 0;
		while (X % j == 0) {
			cnt++;
			X /= j;
		}
		if (cnt) {
			Cnt[j] = max(Cnt[j], cnt);
		}
	}
	if (X != 1) Cnt[X] = max(Cnt[X], 1LL);
}

ll a, b;

void solve() {
	cin >> a >> b;
	rep(i, 3) {
		if (i + 1 != a && i + 1 != b) {
			cout << i + 1 << endl;
		}
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	solve();
	ll N;
	cin >> N;
}

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

int main() {
	int a, b, x;
	cin >> a >> b >> x;
	if (a > x) {
		cout << "NO" << endl;
		return 0;
	}
	if (x - a <= b)cout << "YES" << endl;
	else cout << "NO" << endl;
}

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

int n;

// claudio van
int main() {
  scanf("%d", &n);
  if (n <= 9) {
    printf("%d\n", n);
  } else if (n <= 99) {
    printf("%d\n", 9);
  } else if (n <= 999) {
    printf("%d\n", 9 + n - 99);
  } else if (n <= 9999) {
    printf("%d\n", 9 + 999 - 99);
  } else if (n <= 99999) {
    printf("%d\n", 9 + 999 - 99 + n - 9999);
  } else {
    printf("%d\n", 9 + 999 - 99 + 99999 - 9999);
  }
  return 0;
}


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


using namespace std;

int main(){
    int A,B,C;
    int flag = 0;
    cin >> A >> B >> C;
    if(A == B){
        if(A != C) flag = 1;
    }

    else if(B == C){
        if(B != A) flag = 1;
    }

    else if(C == A){
        if(C != B) flag = 1;
    }
    
    if(flag == 1) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
using namespace std;
int prime[1000000];
int main(){
    int n,ans=0;
    for(int i=0;i<1000000;i++)
        prime[i]=1;
    prime[1]=0;
    prime[2]=1;
    for(int i=1;i<1001;i++){
        if(prime[i]==1){
            for(int j=i+1;j<1000000;j++){
                if(j%i==0)
                    prime[j]=0;
            }
        }
    }
    while(scanf("%d",&n)!=EOF){
        ans=0;
        for(int i=1;i<=n;i++){
            if(prime[i]==1)
            ans++;
        }
        printf("%d\n",ans);
    }

    return 0;
}

Measured memory_bytes: 5096
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,P,cnt=0,min_=0;
  bool frag = false;
  cin >> N;
   vector<int> arra(N);
  for(int i = 0;i< N;i++){
  	cin >> P;
    arra.at(i) = P;
  }
  min_ = arra.at(0);
  for(int i = 0;i<N;i++){
   min_ = min(min_,arra.at(i));
     if(min_ >= arra.at(i)){
     	cnt++;
     }
   /*
    
    frag = true;
  	for(int j = 0;j<i;j++){
    	if(arra.at(i) > arra.at(j)){
        	frag = false;
          	break;
        }
    }
    if(frag){
    	cnt++;
    }
        if(arra.at(i) == 1){
      	break;
    }
    */
  }
  cout << cnt << endl;
}

Measured memory_bytes: 1024
#include <stdio.h>

int main() {
    int n, x, i, j, k, count;
    while (scanf("%d%d", &n, &x) == 2 && (n || x)) {
        count = 0;
        for (i = 1; i < n - 1; i++) {
            for (j = i + 1; j < n; j++) {
                for (k = j + 1; k <= n; k++) {
                    if (i + j + k == x) {
                        count++;
                    }
                }
            }
        }
        printf("%d\n", count);
    }
    return 0;
}

Measured memory_bytes: 600
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<complex>
#include<cmath>
#include<algorithm>
#include<map>
#include<vector>
#include<sstream>
#include<iostream>
using namespace std;
struct human{
    unsigned int t;
    int m;
};
int main(void){

    int n;
    human h[250];
    while(cin>>n,n){
        for(int i = 0;i < n;i++){
            int dm,da,db;
            cin>>dm>>da>>db;
            h[2 * i].t = da;
            h[2 * i].m = dm;

            h[2 * i + 1].t = db;
            h[2 * i + 1].m = -dm;
        }
        for(int i = 0;i < 2*n;i++){
            for(int j = i + 1;j < 2*n;j++){
                if(h[i].t > h[j].t){
                    human sub;
                    sub = h[i];
                    h[i] = h[j];
                    h[j] = sub;
                }
            }
        }
        for(int i = 0;i < 2*n - 1;i++){
            if(h[i].t == h[i+1].t){
                h[i+1].m +=h[i].m;
                h[i].m = 0;
            }
        }
        int now = 0,ans = 0;
        for(int i = 0;i < 2*n;i++){
            now += h[i].m;
            ans = max(ans,now);
        }
        if(ans>150)cout<<"NG"<<endl;
        else cout<<"OK"<<endl;
    }


    return 0;
}

Measured memory_bytes: 1152
import java.util.*;
public class Main {
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	// 整数の入力
	int n = sc.nextInt();

	int pmax = 0;
	int total = 0;
	int a;
	for (int i = 1; i <= n; i++){
	    a = sc.nextInt();
	    total += a;
	    if (a > pmax){
		pmax = a;
	    }
	}
	total -= pmax / 2;

	// 出力
	System.out.println(total);
    }
}


Measured memory_bytes: 22356
#include <iostream>
#include <string>
using namespace std;
string s;
string st="keyence";
int main()
{
	cin >>s;
	for (int i=1;i<=7;i++)
	{
		string a=st.substr(0,i);
		string b=st.substr(i);
		//cout <<a<<" "<<b<<"\n";
		if (s.substr(0,i)==a && s.substr(s.size()-7+i)==b)
		{
			cout <<"YES";
			return 0;
		}
	}
	cout <<"NO";
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;

string s;
int main(){
    while(cin >> s){
        int ns = 0, we = 0;
        each(c, s){
            if(c == 'N')ns |= 1;
            if(c == 'S')ns |= 2;
            if(c == 'W')we |= 1;
            if(c == 'E')we |= 2;
        }
        if((ns == 0 || ns == 3) && (we == 0 || we == 3))cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

Measured memory_bytes: 256
import math

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

# 二次元配列作成
dv = []
for _ in range(int(math.log2(K)) + 1):
    l = [0] * N
    dv.append(l)

# dv[0][0:N]を初期化。1回目にいるところ
dv[0] = [a-1 for a in A]

# ダブリングで表を構築。2^n回目にいるところを埋める
for k in range(1, int(math.log2(K)) + 1):
    for n in range(N):
        dv[k][n] = dv[k - 1][dv[k - 1][n]]

# bitの立っている位置のみを取得
a = []
for i in range(int(math.log2(K)) + 1):
    if K >> i & 1:
        a.append(i)

now = 0
for i in a:
    now = dv[i][now]
print(now + 1)


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

int main(){
    string s;
    cin >> s;
    int k = (int)s.size();
    if (k < 26) {
        vector<bool> abc(26, false);
        for (int i = 0; i < k; i++) abc[s[i] - 'a'] = true;

        for (int i = 0; i < k; i++) cout << s[i];
        for (int i = 0; i < 26; i++){
            if (abc[i] == false) {
                cout << (char)('a' + i) << endl;
                exit(0);
            }
        }
    }
    else {
        vector<bool> abc(26, false);
        for (int i = k - 1; i > 0; i--) {
            abc[s[i] - 'a'] = true;
            if (s[i] > s[i-1]) {
                for (int j = 0; j < i - 1; j++) cout << s[j];
                for (int j = s[i-1] - 'a'; j < 26; j++) {
                    if (abc[j]) {
                        cout << (char)(j + 'a') << endl;
                        exit(0);
                    }
                }
            }
        }
        cout << - 1 << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma warning(disable:4996)
using namespace std;
using ll = long long;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
//#define int long long
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}
long long LCM(long long a, long long b) {
	long long g = GCD(a, b);
	return a / g * b;
}
long long multi_LCM(vector<long long>&v) {
	long long res = v[0];
	for (int i = 0; i < v.size() - 1; i++) {
		res = LCM(res, v[i + 1]);
	}
	return res;
}
signed main() {
	int N;
	cin >> N;
	vector<ll>v(N);
	for (int i = 0; i < N; i++) {
		cin >> v[i];
	}
	cout << multi_LCM(v) << endl;
}

Measured memory_bytes: 256
import bisect

n = int(input())
D = list(map(int, input().split()))
if D[0] != 0:
  print(0)
else:
  c = 1
  temp = 1
  e = 1
  D.sort()
  m = D[-1]
  if n > 1 and D[1] == 0:
    print(0)
    exit()
  else:
    for i in range(1, m+1):
      a = bisect.bisect_right(D, i)
      d = a - temp
      temp = a
      if d == 0 and i>0:
        print(0)
        exit()
      else:
        c *= e**d
        c %= 998244353
        e = d
    print(c)

Measured memory_bytes: 54580