akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
int main(void)
{
    int N;
    string s;
    cin >> N;
    cin >> s;
    int left[10];
    int right[10];
    vector<int> mid[10];
    memset(left,-1,sizeof(left));
    memset(right,-1,sizeof(right));
    int ans=0;
    for(int j=0;j<=9;j++)
    {
        for(int i=0;i<N;i++)
        {
            if(s[i]-'0'==j) {left[j]=i+1;break;}
        }
    }
    for(int j=0;j<=9;j++)
    {
        for(int i=N-1;i>=0;i--)
        {
            if(s[i]-'0'==j) {right[j]=i+1;break;}
        }
    }
    for(int j=0;j<=9;j++)
    {
        for(int i=0;i<N;i++)
        {
            if(s[i]-'0'==j && (i+1)!=left[j]) {mid[j].push_back(i+1);}
        }
    }
    for(int l=0;l<=9;l++)
    {
        if(left[l]==-1) continue;
        for(int m=0;m<=9;m++)
        {
            for(int r=0;r<=9;r++)
            {
                if(right[r]==-1) continue;
                if(left[l]<left[m] && left[m]<right[r]) ans++;
                else if(left[l]<right[m] && right[m]<right[r]) ans++;
                else
                {
                    if(mid[m].size()!=0) 
                    {
                        auto mloc=upper_bound(mid[m].begin(),mid[m].end(),left[l]);
                        //cout << *mloc << endl;
                        if(mloc!=mid[m].end() && left[l]<*mloc && *mloc<right[r]) ans++;
                    }
                }
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		// N = ドル
		//for(int i = 1; i <= 100; i++) {
		int N = sc.nextInt();
		// TODO test
		//int N = i;
		boolean ans = false;
		if(N <= 3 || N == 5 || N == 6 || N == 9 || N == 10) {

		}else if(N % 7 == 0) {
			ans = true;
		}else if(N % 4 == 0) {
			ans = true;
		}else if(N % 7 % 4 == 0) {
			ans = true;
		}else if(N % 8 % 7 == 0 || N % 14 % 4 == 0) {
			ans = true;
		}else if(N % 12 % 7 == 0 || N % 21 % 4 == 0) {
			ans = true;
		}else if(N % 16 % 7 == 0 || N % 20 % 7 == 0 || N % 24 % 7 == 0) {
			ans = true;
		}

		//System.out.print(N +":");
		System.out.println(ans? "Yes":"No");
		sc.close();

		//}
	}

}


Measured memory_bytes: 23764
#include <algorithm>
#include <array>
#include <bitset>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
//region cp_helper
using namespace std;
#define _io ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define ll long long
#define ull unsigned long long
#define ii pair<int, int>
#define vi vector<int>
#define vvi vector< vector<int> >
#define vll vector<ll>
#define vii vector<ii>
#define in(n) cin >> n
#define out(n) cout << n
#define outs(n) cout << n << ' '
#define outn(n) cout << n << '\n'
#define vin(a, n) for (int i=0; i<n; i++) in(a[i])
#define vout(a) for (auto i : a) outs(i)
#define all(a) a.begin(), a.end()
#define qsort(a) sort(all(a))
#define qdsort(a) sort(all(a), greater<>())
const int mod = (int)(1e9) + 7;
//endregion

using namespace std;

int main() {
    _io
    int k, x;
    in(k); in(x);
    for (int i=(x-k+1); i<=(x+k-1); i++) outs(i);
}



Measured memory_bytes: 256
def main():
    import bisect
    n,k=map(int,input().split())
    x=list(map(int,input().split()))
    d=dict()
    for j,i in enumerate(x):
        if i in d.keys():
            d[i].append(j)
        else:
            d[i]=[j]
    first_word=[""]
    
    def operation(temp_operated,temp_operator):
        l=[i for i in temp_operated]
        s=set(temp_operated)
        for i in temp_operator:
            if i in s:
                while True:
                    if l[-1]!=i:
                        l.pop()
                    else:
                        l.pop()
                        s=set(l)
                        break
            else:
                l.append(i)
                s.add(i)
        return l
    
    if operation("",x)!=[]:
        first_word.append(operation("",x)[0])
    flag=0

    while True:
        w=first_word[-1]
        if w=="":
            break
        t=d[w][0]
        if t==n-1:
            break
        while True:
            ww=x[t+1]
            temp=bisect.bisect_right(d[ww],t+1)
            if temp>=len(d[ww]):
                first_word.append(ww)
                break
            else:
                t=d[ww][temp]
                if t==n-1:
                    flag=1
                    break
        if flag==1:
            break
    
    l=len(first_word)
    k=k%l
    if len(first_word)==1:
        print("")
    elif k-1==0:
        print(*operation("",x))
    else:
        print(*operation("",x[d[first_word[k-1]][0]+1:]))

main()

Measured memory_bytes: 67148
import sys
sys.setrecursionlimit(200000)
N = int(input())
ans = [0] * (N - 1)
G = [list() for _ in range(N)]

for i in range(N-1):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    G[a].append([b,i])
    G[b].append([a,i])

def dfs(v,c = -1,p = -1):
    k = 1
    for i in range(len(G[v])):
        u = G[v][i][0];ei = G[v][i][1]
        if u == p:continue
        if k == c:
            k += 1
        ans[ei] = k
        k += 1
        dfs(u,ans[ei],v)
dfs(0)

k = max(map(len, G))
print(k)

for i in range(N-1):
    print(ans[i])



Measured memory_bytes: 88828
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
ll mod=1000000007;

int main() {
  int n, x; cin >> n >> x;
  int out=0;
  int cnt=1;
  for(int i =0; i<n;++i){
    int in,tmp;cin>>in;
    tmp = out + in;
    if(tmp<=x) {
      out = tmp;
      ++cnt;
    } else {
      break;
    }
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256
package main

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

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func readString() string   { sc.Scan(); return sc.Text() }
func readInt() int         { a, _ := strconv.Atoi(readString()); return a }
func readFloat64() float64 { a, _ := strconv.ParseFloat(readString(), 64); return a }
func readInts(n int) []int { ints := make([]int, n); for i := range ints { ints[i] = readInt()}; return ints }

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

const (
	MOD = 1000000007
	INF = int(math.MaxInt64)
)

func min(a, b int) int { if a < b { return a}; return b }
func max(a, b int) int { if a < b { return b}; return a }
func abs(a int) int    { if a < 0 { return -a }; return a }
func pow(p, q int) int { return int(math.Pow(float64(p), float64(q))) }
func gcd(a, b int) int {if b == 0 { return a } else { return gcd(b, a % b) } }
func lcm(a,b int) int  { return a  / gcd(a, b) * b }
func isInteger(x float64) bool { return math.Floor(x) == x }

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

func init() { sc.Split(bufio.ScanWords); sc.Buffer([]byte{}, INF) }

func main() {
	defer wr.Flush()

	N := readInt()
	S := readString()

	var R []int
	var G []int
	var B []int

	for i, s := range S {
		if s == 'R' {
			R = append(R, i)
		}
		if s == 'G' {
			G = append(G, i)
		}

		if s == 'B' {
			B = append(B, i)
		}
	}

	ans := len(R) * len(G) * len(B)

	for i, s := range S {
		for j := 1; j <= ((N-i) / 2); j++ {
			if i + j >= N {
				break
			}

			if i + j + j >= N {
				break
			}

			if s != rune(S[i+j]) && S[i+j] != S[i+j+j] && s != rune(S[i+j+j]) {
				ans--
			}
		}
	}

	fmt.Fprintln(wr, ans)
}


Measured memory_bytes: 1924
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi vector<vector<int> >
#define vvl vector<vector<ll> >
#define vll vector<ll>
#define rep(c, a, b) for(ll c=a;c<b;c++)
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
using namespace std;
#define P 998244353

//-------------------------------------------------------------------
#define N_MAX 2000000
typedef long long int ll;
ll fac[N_MAX+1];
ll inv[N_MAX+1];
ll finv[N_MAX+1];

ll comb(ll n, ll k){
    return (((fac[n]*finv[n-k])%P)*finv[k])%P;
}

void init(){
    fac[0] = finv[0] = fac[1] = finv[1] = inv[1] = 1;
    for(int i = 2; i <= N_MAX; i++){
        fac[i] = (fac[i-1]*i)%P;
        inv[i] = ((-(P/i)*inv[P%i])%P+P)%P;
        finv[i] = (finv[i-1]*inv[i])%P;
    }
}
ll pp(ll a, ll b){
  return (a * b)%P;
}
//-------------------------------------------------------------------
int main(int argc, char const *argv[]) {
  string s;std::cin >> s;ll n = s.size();
  ll a = 0, b =0;
  init();
  re(i, n){
    if(s[i]=='0') a+=2;
    else if(s[i]=='1') a++, b++;
    else b+=2;
  }
  vll blue_limit(n+1, 0), red_limit(n+1, 0);
  re(i, n){
    blue_limit[i+1] = blue_limit[i] + (s[i]=='1'?1:s[i]=='2'?2:0);
    red_limit[i+1] = red_limit[i] + (s[i]=='1'?1:s[i]=='0'?2:0);
  }
  vvl dp = vv(n+1, n+1, 0, ll);
  dp[0][0] = 1;
  for(int i=1;i<=n;i++){
    for(int j=0;j<=n;j++){
      if(j>red_limit[i]||i-j>blue_limit[i]) continue;
      dp[i][j] = ((j==0?0:dp[i-1][j-1]) + dp[i-1][j])%P;
    }
  }
  ll ans = 0;
  for(int i=0;i<=n;i++){
    if(dp[n][i]==0) continue;
    ans = (ans + pp(dp[n][i], comb(a+b-n, a-i)))%P;
  }
  std::cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 78592
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		String S = sc.next();
		
		if(a >= 3200){
		    System.out.println(S);
		}else{
		    System.out.println("red");
		}
	}
}

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

long long mod = 998244353;
vector<vector<long long>> vec(3001,vector<long long>(3001));

long long dp(long long x, long long y, long long A, long long B)
{
    if (x == A && y == B)
    {
        return 1;
    }

    else if (x < A || y < B)
    {
        return 0;
    }

    if (vec.at(x).at(y) != 0)
    {
        return vec.at(x).at(y);
    }

    else 
    {
        long long res = (y * dp (x-1, y, A, B) % mod + x * dp (x, y-1, A, B) % mod + mod - (x-1) * (y-1) * dp (x-1, y-1, A, B) % mod) % mod;
        vec.at(x).at(y) = res;
        return res;
    }
}

int main(void)
{
    long long A, B, C, D;
    cin >> A >> B >> C >> D;

    for (long long i = 1; i < 3001; i++)
    {
        for (long long j = 1; j < 3001; j++)
        {
            vec.at(i).at(j) = 0;
        }
    }

    long long ans = dp(C, D, A, B);
    cout << ans <<endl;
}

Measured memory_bytes: 74140
#include<stdio.h>
int main(void) {
	int cost, coin, cv[] = { 500,100,50,10,5,1 };
	while (scanf("%d", &cost))
	{
		if (cost == 0)break;
		coin = 0;
		cost = 1000 - cost;
		for (int i = 0; i < 6; i++)
		{
			coin += cost / cv[i];
			cost = cost % cv[i];
		}
		printf("%d\n", coin);
	}
	return 0;
}

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

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  long long int a;
  cin>>a;
  long long b,c;
  char d;
  cin>>b>>d>>c;
  cout<<a*b+(a*c)/100<<endl;



}


Measured memory_bytes: 3652
#include <stdio.h>

int main(void)
{
	int t, n, sum;
	int start, finish, i;
	
	while (1){
		
		scanf("%d", &t);
		
		if (t == 0){
			break;
		}
		
		scanf("%d", &n);
		sum = 0;
		
		for (i = 0; i < n; i++){
			
			scanf("%d %d", &start, &finish);
			
			sum += finish - start;
		}
		
		if (t <= sum){
			printf("OK\n");
		}
		else{
			printf("%d\n", t - sum);
		}
	}
	return (0);
}

Measured memory_bytes: 612
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <unordered_map>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(bool x) {cerr << (x ? "true" : "false");}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

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


int main() {

	long long k; cin >> k;
	long long ans = 0;
	for (long long i = 1; i <= k; i++) {
		for (long long j = 1; j <= k; j++) {
			for (long long c = 1; c <= k; c++) {
				ans += gcd(gcd(i, j), c);
			}
		}
	}
	cout << ans;
}

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

string FMT_F = "%.10f";

static File _f;
void file_io(string fn) { _f = File(fn, "r"); }
static string[] s_rd;
T _RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T _RD(T = long)(File f) { while(!s_rd.length) s_rd = f.readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T[] _RDA(T = long)(T fix = 0) { auto r = readln.chomp.split.to!(T[]); r[] += fix; return r; }
T[] _RDA(T = long)(File f, T fix = 0) { auto r = f.readln.chomp.split.to!(T[]); r[] += fix; return r; }
T RD(T = long)() { if (_f.isOpen) return _RD!T(_f); else return _RD!T; }
T[] RDA(T = long)(T fix = 0) { if (_f.isOpen)  return _RDA!T(_f, fix); else return _RDA!T(fix); }

size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

void chmin(T)(ref T x, T y) { x = min(x, y); } void chmax(T)(ref T x, T y) { x = max(x, y); }
bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
T lcm(T)(T x, T y) { return x * (y / gcd(x, y)); }

long mod = 10^^9 + 7;
//long mod = 998_244_353;
//long mod = 1_000_003;
void moda(T)(ref T x, T y) { x = (x + y) % mod; }
void mods(T)(ref T x, T y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(T)(ref T x, T y) { x = (x * y) % mod; }
void modpow(T)(ref T x, T y) { if (!y) { x = 1; return; } auto t = x; x.modpow(y>>1); x.modm(x); if (y&1) x.modm(t); }
void modd(T)(ref T x, T y) { y.modpow(mod - 2); x.modm(y); }

void main()
{
	auto S = RD!string;
	
	writeln(S[$-1] == 's' ? S ~ "es" : S ~ "s");
	stdout.flush;
	debug readln;
}


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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

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

  cout << fixed << setprecision(10);

  int n;
  cin >> n;
  vector<double> xs(n), ys(n);
  for (int i = 0; i < n; i++) {
    cin >> xs[i] >> ys[i];
  }
  double x = 0, y = 0;
  double alpha = 1E6;
  while (true) {
    double max_d = 0;
    int max_arg = -1;
    for (int i = 0; i < n; i++) {
      double dx = xs[i] - x;
      double dy = ys[i] - y;
      double d = sqrt(dx * dx + dy * dy);
      if (d > max_d) {
        max_d = d;
        max_arg = i;
      }
    }

    if (alpha < 1E-12) {
      cout << max_d << endl;
      return 0;
    }

    x += (xs[max_arg] - x) / max_d * alpha;
    y += (ys[max_arg] - y) / max_d * alpha;
    alpha *= 0.99;
  }
}

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

ll mo=1e+9+7;

int main(){

    int h,w;
    cin >> h >> w;
    vector<string> m(h);
    rep(i,h){
        cin >> m[i];
    }

    vector<vector<ll>> dp(h+1,vector<ll>(w+1,-1));
    dp[1][1]=1;
    m[0][0]='#';
    for(int i=1;i<=h;i++){
        for(int j=1;j<=w;j++){
            if(m[i-1][j-1]=='#')continue;
            dp[i][j]=(dp[i-1][j]==-1?0:dp[i-1][j])+(dp[i][j-1]==-1?0:dp[i][j-1]);
            dp[i][j]%=mo;
        }
    }
    cout << dp[h][w] << endl;

    return 0;
}

Measured memory_bytes: 9216
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

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

	if (abs(x - a) < abs(x - b))cout << "A" << endl;
	else cout << "B" << endl;

	return 0;
}


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

const double EPS = 1e-9;
int N;
int X[50], Y[50];

bool equal(double x, double y) {
  return abs(x-y) < EPS;
}

double calc(double x, double y) {
  return (x+y)/2.0;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> X[i] >> Y[i];
  }
  if (N & 1) {
    cout << "NA" << endl;
    return 0;
  }
  double px = calc(X[0], X[N/2]);
  double py = calc(Y[0], Y[N/2]);
  for (int i = 0; i < N / 2; i++) {
    if (equal(calc(X[i], X[i+N/2]), px) && equal(calc(Y[i], Y[i+N/2]), py)) continue;
    cout << "NA" << endl;
    return 0;
  }
  cout << px << " " << py << endl;

  return 0;
}


Measured memory_bytes: 3296
#include<bits/stdc++.h>
using namespace std;
int main(){
    int  N,M,X;
    cin>>N>>M>>X;
    vector<int>A(M);
    for (int i = 0; i < M; i++)
    {
        cin>>A[i];
    }
    sort(A.begin(),A.end());
    int count1=0;
    int count2=0;
    for (int i = 0; i < M; i++)
    {
        if (X<A[i])
        {
            count1++;
        }
        if (X>A[i])
        {
            count2++;
        }
        
        
    }
    cout<<min(count1,count2)<<endl;
    
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
//typedef vector<unsigned int>vec;
typedef vector<ll>vec;
typedef vector<vec> mat;
typedef vector<vector<int>> Graph;

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

int h[202020];
ll dp[202020];
int N, K;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> K;
    REP(i,N) cin >> h[i];
    REP(i,N) dp[i] = LINF;
    dp[0] = 0;
    for(int i=1;i<N;i++){
        for(int k=1;k<=K;k++){
            if(i - k >= 0) chmin(dp[i], dp[i-k] + abs(h[i] - h[i-k]));
        }
    }
    cout << dp[N-1] << endl;
}


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

int comp(const void *a,const void *b){
	long long int da = *(long long int*)a;
    long long int db = *(long long int*)b;
    if(da > db)
    	return -1;
    else if(da == db)
    	return 0;
    else return 1;
}

int main()
{
	int a,b,c;
	long long x[1001],y[1001],z[1001];
	long long k1,k,sum = 0;
	long long s[300000];
	
	scanf("%d %d %d %lld",&a,&b,&c,&k);
	for(int i = 0;i < a;i++)
		scanf("%lld",&x[i]);
	for(int i = 0;i < b;i++)
		scanf("%lld",&y[i]);
	for(int i = 0;i < c;i++)
		scanf("%lld",&z[i]);
	
	qsort(x,a,sizeof(x[0]),comp);
	qsort(y,b,sizeof(y[0]),comp);
	qsort(z,c,sizeof(z[0]),comp);
	
	for(int i = 0;i < a;i++){
		for(int j = 0;j < b;j++){
			for(int g = 0;g < c;g++){
				if((i+1)*(j+1)*(g+1) <= k){
					s[sum] = x[i] + y[j] + z[g];
					sum++;
				}
			}
		}
	}
	
	qsort(s,sum,sizeof(s[0]),comp);
	for(int i = 0;i < k;i++)
		printf("%lld\n",s[i]);
	return 0;
}

Measured memory_bytes: 3196
<?php
//error_reporting(0);
list($N,$Q) =  explode(" ",trim(fgets(STDIN)));
$S = trim(fgets(STDIN));
$a = array_fill(0,$N,1);
for($i=0;$i<$Q;$i++) {
  list($t[],$d[])= explode(" ",trim(fgets(STDIN)));
}
$l=-1;
$r=$N;
for($i=$Q-1;0<=$i;$i--) {
  if ($d[$i]== 'L' && $t[$i] == $S[$l+1])
   $l++;
  if ($d[$i]== 'R' && $t[$i] == $S[$r-1])
   $r--;
  if ($d[$i]== 'L' && $r < $N && $t[$i] == $S[$r])
   $r++;
  if ($d[$i]== 'R' && $l >= 0 && $t[$i] == $S[$l])
   $l--;
}
printf("%d\n",$r-$l-1);


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

int main(){
  map<int,int> mp;
  int n,cnt=0;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
    mp[a[i]]++;
  }
  for(auto k:mp){
    if(k.second%2==1) cnt++;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 5376
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<map>
using namespace std;
map<int,int>num;
typedef long long ll;
const int N=1e6+10;
const int Mod=1e9+7;
ll cal(ll x){
	if(num[x]!=0) return num[x];
	return num[x]=(cal(x/2)+cal((x-1)/2)+cal((x-2)/2))%Mod;
}
int main(){
	num[0]=1;num[1]=2;
	ll n;
	scanf("%lld",&n);
	printf("%lld\n",cal(n));
	return 0;
} 

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

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

    vector<long long> h;
    for (int i = 0; i < n; i++) {
        long long hi;
        cin >> hi;
        h.push_back(hi);
    }

    sort(h.begin(), h.end());
    reverse(h.begin(), h.end());

    long long ans = 0;
    for (int i = 0; i < n; i++) {
        if (i < k) {
            continue;
        }
        ans += h.at(i);
    }

    cout << ans << endl;
}

Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s,t;
	cin>>s>>t;
	map<char,char> diferrence,dif;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]!=t[i]&&diferrence.count(s[i]) == 0)
		{
			diferrence[s[i]] = t[i];
		}
		else if(s[i]!=t[i]&&diferrence.count(s[i])&&diferrence[s[i]]!=t[i])
		{
			cout<<"No\n";
			return 0;
		}
	}
	for(int i=0;i<s.size();i++)
	{
		if(dif.count(t[i]) == 0)
		{
			dif[t[i]] = s[i];
		}
		else if(t[i]!=s[i]&&dif.count(t[i])&&dif[t[i]]!=s[i])
		{
			cout<<"No\n";
			return 0;
		}
	}
	cout<<"Yes\n";
	return 0;
} 

Measured memory_bytes: 776
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  
  int n,k;
  cin>>n>>k;
  int t;
  long long d;
  vector<long long> points[n];
  REP(i,n){
    cin>>t>>d;
    t--;
    points[t].push_back(d);
  }
  vector<long long> normals,criticals;
  int s;
  REP(i,n){
    s = points[i].size();
    if(s==0)continue;
    sort(points[i].begin(),points[i].end(),greater<long long>());
    REP(j,s){
      if(j==0){
        criticals.push_back(points[i][j]);
      }else{
        normals.push_back(points[i][j]);
      }
    }
  }
  
  sort(criticals.begin(),criticals.end(), greater<long long>());
  sort(normals.begin(),normals.end(), greater<long long>());
  
  int num_x,num_y;
  num_x = normals.size();
  num_y = criticals.size();
  
  long long ans=0;
  if(num_x==0){
    REP(i,k){
      ans += criticals[i];
    }
    ans += (long long)k*(long long)k;
    cout<<ans<<endl;
    return 0;
  }
  long long sx[num_x];
  long long sy[num_y];
  REP(i,num_x){
    if(i==0){
      sx[i] = normals[i];
    }else{
      sx[i] = sx[i-1] + normals[i];
    }
  }
  REP(i,num_y){
    if(i==0){
      sy[i] = criticals[i];
    }else{
      sy[i] = sy[i-1] + criticals[i];
    }
  }
  
  long long temp;
  REPP(i,num_y){
    temp = 0;
    temp += sy[i-1];
    if(k-i>num_x || k-i<0)continue;
    if(k-i>0){
      temp += sx[k-i-1];
    }
    temp += (long long)i*(long long)i;
    ans = max(ans,temp);
  }
  
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 6904
#pragma GCC optimize("O2")
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pi pair<int,int>
#define vp vector<pi>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define f(i,x,z) for(int i=x;i<z;i++)
#define debug(x) cout<<"DEBUG------> "<<x<<endl
#define endl "\n"
#define srt(v) sort(v.begin(), v.end())
int main() {
    long long co=0,b,pre;
    int a,i;
    cin>>a;
    for(i=0;i<a;i++)
    {
        cin>>b;
        
        if(pre>b && i>0)
        {
            co+=pre-b;
            b=pre;
        }
        else
        {
            pre=b;
        }
    }
    cout<<co;
    return 0;
}

Measured memory_bytes: 3580
class Dice
	attr_accessor :t, :b, :n, :e, :s, :w
	def initialize(*labels)
		@t = labels[0]
		@s = labels[1]
		@e = labels[2]
		@w = labels[3]
		@n = labels[4]
		@b = labels[5]
	end
	def roll(dir)
		case dir
		when 'N'
			@t, @s, @b, @n = @s, @b, @n, @t
		when 'S'
			@s, @b, @n, @t = @t, @s, @b, @n
		when 'W'
			@t, @e, @b, @w = @e, @b, @w, @t
		when 'E'
			@e, @b, @w, @t = @t, @e, @b, @w
		end
	end
end

dice = Dice.new(*gets.split)
gets.chomp.chars{|c|dice.roll c}
puts dice.t

Measured memory_bytes: 8692
from math import sqrt 
ans=[]
n=input()
for i in xrange(n):
    x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
    A1=2*(x2-x1)
    A2=2*(x3-x1)
    B1=2*(y2-y1)
    B2=2*(y3-y1)
    C1=x1**2-x2**2+y1**2-y2**2
    C2=x1**2-x3**2+y1**2-y3**2
    x=(B1*C2-B2*C1)/(A1*B2-A2*B1)
    y=(C1*A2-C2*A1)/(A1*B2-A2*B1)
    r=sqrt((x-x1)**2 + (y-y1)**2)
    ansstr='%.3f %.3f %.3f' % (x,y,r)
    ans.append(ansstr)
for i in ans:
    print i

Measured memory_bytes: 4440
//The best is yet to come...
 #include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define inf 1000000000000
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define S second
#define F first
#define boost1 ios::sync_with_stdio(false);
#define boost2 cin.tie(0);
#define mem(a,val) memset(a,val,sizeof a)
#define endl "\n"
#define maxn 100001

ll prime[maxn];
void seive()
{
    prime[0]=prime[1]=1;
    for(int i=2;i<=1000;i++)
    {
        if(prime[i])
        continue;
        for(int j=2*i;j<=1000;j+=i)
        prime[j]=1;
    }
}
int main()
{
    boost1;boost2; 
    ll i,j,n,x,y,got,ans=1;
    seive();
    cin>>n;
    for(i=2;i<=n;i++)
    {
        if(prime[i])
        continue;
        x=i;
        got=0;
        while(1)
        {
            if(n/x==0)
            break;
            got+=n/x;
            x=x*i;
        }
        ans=(ans*(got+1))%mod;
    }   
    cout<<ans;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(){
	char a[50],b[50],c[50];
	int x,y;
	scanf("%s%s",a,b);
	scanf("%d%d",&x,&y);
	scanf("%s",c); 
	if(strcmp(a,c)==0)printf("%d %d",x-1,y);
	if(strcmp(b,c)==0)printf("%d %d",x,y-1);
	return 0;
}

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

void encode( const int a, const int b, string& s ){
	for ( unsigned i = 0; i < s.size(); ++i ){
		s[ i ] = static_cast< char >( ( ( s[ i ] - 'a' ) * a + b ) % 26 + 'a' );
	}
}

void decode( const int a, const int b, string& s ){
	string listA = "abcdefghijklmnopqrstuvwxyz", listB;
	for ( unsigned i = 0; i < listA.size(); ++i ){
		listB += static_cast< char >( ( ( listA[ i ] - 'a' ) * a + b ) % 26 + 'a' );
	}
	for ( unsigned i = 0; i < s.size(); ++i ){
		if ( !( s[ i ] >= a && s[ i ] <= 'z' ) ) continue;
		for ( unsigned j = 0; j < listB.size(); ++j ){
			if ( s[ i ] == listB[ j ] ){
				s[ i ] = listA[ j ];
				break;
			}
		}
	}
}

void identifyKeys( int& a, int& b, const string s ){
	for( a = 3; ; ++a ){
		if ( !( a % 2 ) || !( a % 13 ) ) continue;
		for ( b = 0; b < 26; ++b ){
			string sThis = "this", sThat = "that";
			encode( a, b, sThat );
			encode( a, b, sThis );
			if ( s.find( sThat ) != string::npos || s.find( sThis ) != string::npos ){
				return;
			}
		}
	}
}

int main(){
	string s, ws;
	int n;

	cin >> n;
	cin.ignore();

	for ( int i = 0; i < n; ++i ){
		getline( cin, s );
		int aKey = 0, bKey = 0;
		identifyKeys( aKey, bKey, s );
		decode( aKey, bKey, s );
		cout << s << endl;
	}

	return 0;
}

Measured memory_bytes: 0
size = [int(i) for i in input().split()]
sheet =[ [0 for i in range(size[1])] for j in range(size[0])]
for gyou in range(size[0]):
    x = [int(i) for i in input().split()]
    sheet[gyou] = x
    sheet[gyou].append(sum(sheet[gyou]))

for gyou in range(size[0]):
    for retsu in range(size[1]+1):
        print(sheet[gyou][retsu],end="")
        if retsu != size[1]:
            print(" ",end="")
    print("")
for retsu in range(size[1]+1):
    sum2 = 0
    for gyou in range(size[0]):
        sum2 += sheet[gyou][retsu]
    print(sum2, end="")
    if retsu != size[1]:
        print(" ",end="")
print("")



Measured memory_bytes: 6736
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

signed main() {
	int N, Ma, Mb; cin >> N >> Ma >> Mb;
	vector<int> a(N), b(N), c(N); rep(i, 0, N) { cin >> a[i] >> b[i] >> c[i]; }
	static int dp[44][410][410] = {};
	memset(dp, 0x3f, sizeof(dp));
	dp[0][0][0] = 0;
	rep(i, 0, N) {
		rep(j, 0, 410 - a[i]) {
			rep(k, 0, 410 - b[i]) {
				if (dp[i][j][k] == INF)continue;
				chmin(dp[i + 1][j][k], dp[i][j][k]);
				chmin(dp[i + 1][j + a[i]][k + b[i]], dp[i][j][k] + c[i]);
			}
		}
	}
	int ans = INF;
	for (int i = 1;; i++) {
		int ma = Ma*i, mb = Mb*i;
		if (ma > 410 || mb > 410)break;
		chmin(ans, dp[N][ma][mb]);
	}
	if (ans == INF)cout << -1 << endl;
	else cout << ans << endl;
	return 0;
}

Measured memory_bytes: 57984
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define PI acos(-1)
#define Mod (int)1000000007
#define INFTY (int)INT_MAX
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define BitRep(i, n) for (int i = 0; i < (int)(1 << n); i++)
#define All(vec) vec.begin(), vec.end()
#define Part(vec, b, e) vec.begin() + b, vec.begin() + e
#define Sum(vec) accumulate(vec.begin(), vec.end(), 0)
#define Sort(vec) sort(vec.begin(), vec.end())
#define Reverse(vec) reverse(vec.begin(), vec.end())
#define Count(vec, x) count(vec.begin(), vec.end(), x)
#define Next_permutation(vec) next_permutation(vec.begin(), vec.end())
#define Find(vec, s) vec.find(s) != vec.end()

int main() {
	map<string, int> M;
	int q;
	cin >> q;
	Rep(i, q) {
		int n;
		string key;
		cin >> n >> key;
		if (n == 0) {
			int x;
			cin >> x;
			M[key] = x;
		}
		else if (n == 1) {
			if (M.count(key)) cout << M.at(key) << endl;
			else cout << 0 << endl;
		}
		else if (n == 2) {
			M.erase(key);
		}
	}
	return 0;
}


Measured memory_bytes: 27824
#include <iostream>
#include <string>
using namespace std;
int main() {
	string str;
	cin >> str;

	int total = 0;

	for (int i = 0; i < str.size(); i++) {
		total += str[i] - '0';
	}

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

Measured memory_bytes: 3736
#include <bits/stdc++.h>
#define Int int64_t

using namespace std;

int main() {
	Int N, D, A;
	cin >> N >> D >> A;
	vector<pair<Int, Int>> xH(N);
	vector<Int> x(N), H(N);
	for (int i = 0; i < N; ++i) {
		cin >> x[i] >> H[i];
		xH[i] = { x[i], H[i] };
	}

	sort(xH.begin(), xH.end());
	vector<Int> y(N), cnt(N);
	for (int i = 0; i < N; ++i) { 
		y[i] = xH[i].first;
		cnt[i] = (xH[i].second + A - 1) / A;
	}

	vector<Int> memo(N + 1, 0);
	Int ans = 0;
	for (int i = 0; i < N; ++i) {
		if (i > 0) { memo[i] += memo[i - 1]; }
		if (cnt[i] - memo[i] <= 0) { continue; }

		Int z = cnt[i] - memo[i];
		int idx = upper_bound(y.begin(), y.end(), y[i] + 2 * D) - y.begin();
		memo[i] += z;
		memo[idx] -= z;
		ans += z;
	}
	cout << ans << endl;

	return 0;
}


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

using namespace std;

int main(int argc, char *argv[]) {
  vector<int> result;
  double v, t, h;

  while (cin >> v) {
    t = v / 9.8;
    h = 4.9 * t * t;
    int n = 1;
    while (true)
      if (5 * (n - 1) >= h) {
        result.push_back(n);
        break;
      } else {
        n++;
      }
  }

  for (int i = 0; i < result.size(); i++)
    cout << result[i] << endl;
  return 0;
}

Measured memory_bytes: 1244
#include <iostream>

int main()
{
    while(true)
    {
        int h,w;
        std::cin >> h >> w;
        
        if(h==0 && w==0)
            break;
            
        for(int i=0;i<h;i++)
        {
            for(int j=0;j<w;j++)
                std::cout << "#";
            std::cout << std::endl;
        }
        std::cout << std::endl;
    }
}


Measured memory_bytes: 3104
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner scn = new Scanner(System.in)) {
			double zandaka = 100;
			double rishi = 0.01d;
			long X = scn.nextLong();

			int year = 0;
			while(zandaka < X) {
				double fukuri = Math.floor(zandaka*rishi);
				zandaka = zandaka + fukuri;
				year++;
			}

			System.out.println(year);
		}
	}
}

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

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

//--------------------------------------------
const double EPS = 1e-14;
const double PI  = acos(-1.0);

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

int main(){
  int n, a, b;
  string s;
  vector <string> v;

  cin >> n >> a >> b;
  cin >> s;

  int j = 0;
  int k = 0;
  REP (i, n) {
    if (s.at(i) == 'a' && j + k < a + b) {
      v.push_back("Yes");
      j++;
    } else if (s.at(i) == 'b' && j + k < a + b && k < b) {
      v.push_back("Yes");
      k++;
    } else {
      v.push_back("No");
    }
  }

  REP (i, n) {
    cout << v.at(i) << "\n";
  }
}


Measured memory_bytes: 6260
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define dbg(x) cout<<"( "<<#x<<" -> "<<x<<" )"<<endl;
using namespace std;
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    int ele,cnt=0;
    for (int i=0;i<n;i++)
    {
        scanf("%d",&ele);
        if (ele>=k)
        cnt++;
    }
    printf("%d\n",cnt);
    return 0;
}

Measured memory_bytes: 3768
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using uint = unsigned int;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;
const ld PI = acosl(-1);

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

    char a;
    cin >> a;

    if ('A' <= a && a <= 'Z')
        cout << 'A' << endl;
    else
        cout << 'a' << endl;

    return 0;
}


Measured memory_bytes: 3644
n = int(input())
b = list(map(int, input().split()))

a = [0] * (n + 1)
a[0] = b[0]

for i in range(1, n - 1):
  a[i] = min(b[i], b[i - 1])

a[n - 1] = b[n - 2]

print(sum(a))

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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    string s; cin >> s;
    sort(all(s));
    if(s=="abc")cout << "Yes" << endl;
    else cout << "No"<< endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define y_n(ans) cout<<(ans?"Yes":"No")<<endl;

int main() {
    string s;
    cin >> s;
    if (s[0] == 'R' && s[1] == 'R' & s[2] == 'R') {
        cout << 3 << endl;
    } else if (s[0] == 'R' && s[1] == 'R') {
        cout << 2 << endl;
    } else if (s[1] == 'R' && s[2] == 'R') {
        cout << 2 << endl;
    } else if (s[0] == 'S' && s[1] == 'S' && s[2] == 'S') {
        cout << 0 << endl;
    } else {
        cout << 1 << endl;
    }
}

Measured memory_bytes: 3624
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")

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

typedef unsigned long long int ull;
typedef long long ll;
#define pb push_back

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //your code starts here

    ll a, b, c, d;
    cin >> a >> b >> c >> d;

    ll ans;

    if (b > 0 && d > 0)
        ans = max(a * c, b * d);

    else if (b <= 0 && d <= 0)
        ans = a * c;

    else
    {
        if (a >= 0 && d <= 0)
            ans = a * d;

        else if (b <= 0 && c >= 0)
            ans = b * c;

        else if (a * c <= 0 || b * d <= 0)
            ans = max({0LL, a * c, b * d, a * d, b * c});

        else
            ans = max({a * c, b * d, a * d, b * c});
    }

    cout << ans;
    return 0;
}


Measured memory_bytes: 3648
n=int(input())
s=input()

cntr=0
cntg=0
cntb=0

for i in range(n):
    if s[i] == "R":
        cntr+=1
    elif s[i] == "G":
        cntg+=1
    else:
        cntb+=1

cntng = 0
cntng += cntr*(cntr-1)//2*(cntg+cntb)
cntng += cntg*(cntg-1)//2*(cntr+cntb)
cntng += cntb*(cntb-1)//2*(cntr+cntg)
cntng += cntr*(cntr-1)*(cntr-2)//6
cntng += cntg*(cntg-1)*(cntg-2)//6
cntng += cntb*(cntb-1)*(cntb-2)//6



for i in range(n):
    for sa in range(1,n):
        if i + 2*sa >= n:
            break
        if s[i] != s[i+sa] and s[i+sa] != s[i+2*sa] and s[i+2*sa] != s[i]:
            cntng+=1

print(n*(n-1)*(n-2)//6 - cntng)


Measured memory_bytes: 68252
#coding: utf-8                          
                                        
ABX = [int(i) for i in input().split()] 
A, B, X = ABX[0],  ABX[1],  ABX[2]      
                                        
if A + B >= X and A <= X:               
  print("YES")                          
else:                                   
  print("NO")                           

Measured memory_bytes: 2940
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtTest.ForYellow
{
    class ABC156_F
    {
        static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false };
            SetOut(sw);

            Method(args);

            Out.Flush();
        }

        static void Method(string[] args)
        {
            int[] kq = ReadInts();
            int k = kq[0];
            int q = kq[1];
            long[] ds = ReadLongs();
            for (int i = 0; i < q; i++)
            {
                long[] nxm = ReadLongs();
                long n = nxm[0];
                long x = nxm[1];
                long m = nxm[2];

                long sum = x % m;
                for (int j = 0; j < Min(k, n); j++)
                {
                    long delta = ds[j] % m;
                    long cnt = (n - 1) / k;
                    if ((n - 1) % k > j)
                    {
                        cnt++;
                    }
                    if (delta > 0)
                    {
                        sum += delta * cnt;
                    }
                    else
                    {
                        sum += m * cnt;
                    }
                }

                long res = n - 1 - sum / m;
                WriteLine(res);
            }
        }

        private static string Read() { return ReadLine(); }
        private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 15332
#include <iostream>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)

int main(int argc, char const *argv[]) {
  string s, ans;
  cin >> s;
  rep(i, s.size()) ans.push_back('x');
  cout << ans << endl;
  return 0;
}


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

int top,S[1000];

void push(int);
int pop();
int main(void){
	int a,b;
	top=0;
	char s[100];
	
	while(scanf("%s",s)!=EOF){
		if(s[0]=='+'){
			a=pop();
			b=pop();
			push(a+b);
		}else if(s[0]=='-'){
			b=pop();
			a=pop();
			push(a-b);
		}else if(s[0]=='*'){
			a=pop();
			b=pop();
			push(a*b);
		}else{
			push(atoi(s));
		}
	}
	
	printf("%d\n",pop());
	
	return 0;
}

void push(int x){
	S[++top]=x;
}

int pop(){
	top--;
	return S[top+1];
}

Measured memory_bytes: 1752
#include <stdio.h>

int main(){
    int n,m,k;
    int i,j,ans;

    scanf("%d %d %d",&n,&m,&k);

    ans=0;
    for(i=0;i<n+1;++i){
        for(j=0;j<m+1;++j){
            if(k==(m*i+n*j-2*i*j)){
                ans=1;
                break;
            }
        }
    }

    puts(ans?"Yes":"No");

    return 0;
}


Measured memory_bytes: 128
package main

import "fmt"

func calc(x int) int {
	a := [5]int{10000, 1000, 100, 10, 1}
	sum := 0
	for _, v := range a {
		sum += x / v
		x %= v
	}
	return sum
}

func main() {
	var n, a, b, ans int
	fmt.Scan(&n, &a, &b)

	for i := 1; i <= n; i++ {
		sum := calc(i)
		if sum >= a && sum <= b {
			ans += i
		}
	}

	fmt.Println(ans)
}


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

#ifdef _DEBUG
#define dout cout
#define debug() if (true)
#define dvout(v) vout(v)
#else
#define dout if (false) cout
#define debug() if (false)
#define dvout(v) if(false) vout(v)
#endif

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define vout(v)           \
	for (auto &i : v)     \
	{                     \
		cout << i << " "; \
	}                     \
	cout << "\n"; //配列出力
#define vec(v, n) vector<int> v(n, 0);
#define vin(v)        \
	for (auto &i : v) \
		cin >> i; //配列入力

#define mod (int)(1e9+7)
typedef long long ll;
typedef unsigned long long ull;
#define next asdnext
#define prev asdprev
#define _n "\n"
#define _n2 "\n\n"
#define _t "\t"



void Main()
{
	ull N;
	cin>>N;
	string s="";
	while(N!=0){
//		dout<<N<<_n;
		s+='a'+(char)((N-1)%26);
		N=(N-1)/26;
	}
//	dout<<_n2;
	reverse(all(s));
	cout<<s<<_n;
}



int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << std::fixed << std::setprecision(15);
	Main();
	return 0;
}


Measured memory_bytes: 3648
# coding: utf-8
# hello worldと表示する
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
n=I()
s=SI()
count=0
for i in range(n):
    if s[i]=="R":
        count+=1
for i in range(count):
    if s[i]=="R":
        count-=1
print(count)

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

int main() {
	int a, b, c, x, y, mini; cin >> a >> b >> c >> x >> y;
	c *= 2; mini = min(x, y);
	int ans = mini * min(a + b, c);
	x -= mini, y -= mini;
	if (x) {
		ans += min(a, c) * x;
	}
	if (y) {
		ans += min(b, c) * y;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3564