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

#ifndef errOut
#define errOut(s)
#endif

using Value = int;

Value calc(Value n, Value d, Value x, std::vector<Value> as) {
    Value ret = x;
    for (int i = 0; i < n; ++i) {
        Value a = as[i];
        ret += (d + a - 1) / a;
    }
    return ret;
}

int main() {
    Value n, d, x;
    std::vector<Value> as;
    std::cin >> n >> d >> x;
    as.reserve(n);
    for (Value i = 0; i < n; ++i) {
        Value a;
        std::cin >> a;
        as.push_back(a);
    }
    auto ret = calc(n, d, x, as);
    std::cout << ret << std::endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<list>
using namespace std;
static const int MAX=100000;
static const int INFTY=(1<<29);

vector<int> G[MAX];
list<int> out;
bool V[MAX];
int N;
int indeg[MAX]; // 入力次数

void bfs(int s){
    queue<int> q;
    q.push(s);
    V[s] = true;
    while(!q.empty()){
        int u=q.front(); q.pop();
        out.push_back(u);
        for(int i=0; i<G[u].size(); i++){
            int v=G[u][i];
            indeg[v]--;
            if(indeg[v]==0 && !V[v]){
                V[v] = true;
                q.push(v);
            }
        }
    }
}

void tsort(){
    for(int i=0; i<N; i++){
        indeg[i] = 0;
    }

    for(int u=0; u<N; u++){
        for(int i=0; i<G[u].size(); i++){
            int v=G[u][i];
            indeg[v]++;
        }
    }

    for(int u=0; u<N; u++){
        if(indeg[u] == 0 && !V[u]) bfs(u);
    }

    for(list<int>::iterator it = out.begin(); it != out.end(); it++){
        cout << *it << endl;
    }
}

int main(int argc, char const *argv[])
{
    int s, t, M;
    cin >> N >> M;

    for(int i=0; i<N; i++) V[i] = false;

    for(int i=0; i<M; i++){
        cin >> s >> t;
        G[s].push_back(t);
    }
    tsort();
    return 0;
}



Measured memory_bytes: 6244
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int n = 0;
		int x = 0;
		int cnt;

		Scanner sc= new Scanner( System.in );

		while ( true ) {
			cnt = 0;
			
			n = sc.nextInt();
			x = sc.nextInt();

			if ( n == 0 && x == 0 ) {
				break;
			}

			for ( int i = 1 ; i < ( n - 1 ) ; i++ ) {
				for  ( int j = ( i + 1 ) ; j < n ; j++ ) {
					for ( int k = ( j + 1 ) ; k < ( n + 1 ) ; k++ ) {
						if ( ( i + j + k ) == x ) {
							cnt++;
						}
					}
				}

			}
			System.out.println( cnt );
		}
		sc.close();
	}
}




Measured memory_bytes: 26372
from heapq import heappush, heappop

def main():
    N, M = map(int, input().split())

    # 日数別に仕事を管理
    works = [[] for _ in range(M)]

    for i in range(N):
        A, B = map(int, input().split())
        
        if A > M:
            continue
        
        deadline = M - A
        # heapqは最小値を返す仕組みしかないので、最大値を返すため-する
        works[deadline].append(-B)
    
    ans = 0
    heapque = []

    # i日目に始めることができる仕事で報酬の高いものを選ぶ
    for i in range(M - 1, -1, -1):
        for work in works[i]:
            # heapqに候補を追加
            heappush(heapque, work)
        
        if heapque:
            ans += heappop(heapque)
    
    print(-ans)


main()

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

using mint=modint998244353;
const mint inv9 = mint(1)/9;
struct S {
	mint x,w;
	S(mint x=0, mint w=1): x(x), w(w) {}
};

S op(S a, S b) {
	return S(a.x * b.w + b.x, a.w*b.w);
}
S e() {return S();}

S mapping(int f, S a) {
	if (f ==0) return a;
	return S((a.w-1)*inv9*f,a.w);
}

int composition(int f, int g){
	if (f == 0) return g;
	return f;
}

int id() { return 0;}

int main() {
	int n,q;
	cin >> n >> q;
	lazy_segtree<S,op,e,int, mapping, composition, id> t(n);
	rep(i,n) t.set(i, S(1,10));
	rep(i,q) {
		int l,r,d;
		cin >> l >> r >> d;
		l--;
		t.apply(l, r, d);
		S ans = t.prod(0,n);
		printf("%d\n",ans.x.val());
	}
	return 0;
}


Measured memory_bytes: 9844
#include<stdio.h>
eye[4][2];
void check(double n,int w){
	if(n>=1.1)eye[0][w]++;
	else if(n>=0.6)eye[1][w]++;
	else if(n>=0.2)eye[2][w]++;
	else eye[3][w]++;
}
int main(){
	int i=0,j=0;
	double r,l;
	for(;scanf("%lf %lf",&l,&r)!=EOF;){check(l,0);check(r,1);}
	for(;i<4;i++){printf("%d %d\n",eye[i][0],eye[i][1]);}
	exit(0);
}

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

int main() {
    int C[3][3];
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            cin >> C[i][j];
        }
    }

    bool result = false;
    int a1, a2, a3, b1, b2, b3;
    for (int i = 0; i <= C[0][0]; i++) {
        a1 = i;
        b1 = C[0][0] - a1;
        if (b1 < 0)
            continue;
        for (int j = 0; j <= C[1][1]; j++)
        {
            a2 = j;
            b2 = C[1][1] - a2;
            if (b2 < 0)
                continue;
            if (a1 + b2 != C[0][1])
                continue;
            if (a2+b1 != C[1][0])
                continue;

            for (int l = 0; l <= C[2][2]; l++)
            {
                a3 = l;
                b3 = C[2][2] - a3;
                if (b3 < 0)
                    continue;
                if (a1+b3 != C[0][2])
                    continue;
                if (a2+b3 != C[1][2])
                    continue;
                if (a3+b1!= C[2][0])
                    continue;
                if (a3+b2 != C[2][1])
                    continue;

                result = true;
            }
        }
    }

    if (result)
        cout << "Yes" << endl;
    else
    {
        cout << "No" << endl;
    }
}

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

using namespace std;

#define INF 1000007
#define MOD 1000000007
#define int long long int
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int mpow(int N, int P, int M) //繰り返し自乗法
{
    if (P == 0)
        return 1;
    if (P % 2 == 0)
    {
        int t = mpow(N, P / 2, M);
        return t * t % M;
    }
    return N * mpow(N, P - 1, M) % M;
}
signed main()
{
    int A, B;
    cin >> A >> B;
    if (A <= 5)
    {
        cout << "0" << endl;
    }
    else if (A <= 12)
    {
        cout << B / 2 << endl;
    }
    else
    {
        cout << B << endl;
    }
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    // Here your code !
    int H,W,i,k;
    while(1)
    {
        scanf("%d%d",&H,&W);
        if(H == 0 && W == 0)
        {
            return 0;
        }
        for(i = 0;i < H;i++)
        {
            for(k = 0;k < W;k++)
            {
                printf("#");
            }
            printf("\n");
        }
        printf("\n");
    }
}

Measured memory_bytes: 572
fn main(){
    let n: u32 = read();
    let a: Vec<u32> = read_vec();
    
    let mut result: u32 = 0;
    let mut flag: bool = false;
    
    for i in 0..((n-1) as usize) {
        if flag {
            flag = false;
            continue;
        }
        if a[i] == a[i+1] {
            flag = true;
            result += 1;
        }
    }
    
    println!("{}", result);
    
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

Measured memory_bytes: 4352
package main

import (
  "fmt"
  "strconv"
  "math"
)

func main() {
  var a, b string
  fmt.Scan(&a, &b)
  ab, _ := strconv.Atoi(a + b)
  sq := int(math.Sqrt(float64(ab)))
  if sq * sq == ab {
    fmt.Println("Yes")
  } else {
    fmt.Println("No")
  }
}

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

int main(){
  int n[3];
  int c1=0,c2=0;  
  for(int i=0;i<3;i++){
   cin >> n[i];
   if(n[i] == 5){
     c1++;
   }else if(n[i] == 7){
     c2++;
   }
  }
  if(c1 == 2 && c2 == 1){
    cout << "YES\n";
  }else{
    cout << "NO";
  }
}


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

#define int 				long long int
#define all(c)				c.begin(), c.end()
#define init(arr, num)		memset(arr, num, sizeof(arr))
#define fast				ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define inputFile			freopen("input.txt", "r", stdin); 
#define outputFile			freopen("output.txt", "w", stdout);
#define modM 				1000000007


#ifdef Voneone
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>  void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << std::endl;}
template <typename Arg1, typename... Args> 
	void __f(const char* names, Arg1&& arg1, Args&&... args) {
		const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | "; 
		__f(comma + 1, args...);
}
#else
#define trace(...)
#endif
 

void solve() 
{ 

	int a, b;
	cin >> a >> b;
	cout << a*b;		

} 
 
 
signed main()
{
 
	
	#ifdef _DEBUG
		inputFile;
	#endif
	fast;
	int T = 1;
	// cin >> T;
	while(T--)
	{
		solve();
		cout << endl;
	}
	
	
	return 0;
 
}


  

Measured memory_bytes: 3652
#include<iostream>
#include<iomanip>
#include<sstream>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<map>
#include<vector>
#include<queue>
#include<set>
#include<numeric>
#include<complex>

using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define np string::npos
#define X real()
#define Y imag()
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define repc(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

typedef long long ll ;
typedef deque<int> di ;
typedef deque<ll> dl ;
typedef map<string,int> dict;
typedef complex<double> comd;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
const double PI = acos(-1.0) ;
double eps = 1e-10 ;

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

template <typename T>
void out(deque < T > d)
{
  for(size_t i = 0; i < d.size(); i++)
  {
    debug(d[i]);
  }
}

template<typename T>
T ston(string str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  double a,b;
  cin >> a >> b;
  fcout(5) << a * b / 3.305785 << endl ;
  return 0;
}

Measured memory_bytes: 3260
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

int main() {
	int n;
	while (cin >> n, n) {
		int *c = new int[n];
		for (int i = 0; i < n; i++)
			cin >> c[i];
		sort(c, c + n);
		long long ans = 0, pre = 0;
		for (int i = 0; i < n; i++) {
			ans += pre;
			pre += c[i];
		}
		cout << ans << endl;
		delete[] c;
	}
	return 0;
}

Measured memory_bytes: 1244
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    public static void Main()
    {
        var md = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();
        var M = md[0];
        var D = md[1];
        var ans = 0;
        for (int i = 4; i <= M; ++i)
        {
            var max = Math.Sqrt(i);
            for (int j = 2; j <= max; ++j)
            {
                if (i % j == 0 && 2 <= (i / j))
                {
                    if (10 <= j || 10 <= (i / j)) continue;
                    var a = i / j;
                    if (a == j && a * 10 + j <= D) ans++;
                    else if (a != j) {
                        if ( a * 10 + j <= D) ans++;
                        if ( j * 10 + a <= D) ans++;
                    }
                }
            }
        }
        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 13268
#include<bits/stdc++.h>
using namespace std;
char a[100005],b[100005];
int n,m,x[26][100005],l[26];
long long ans;
int main(){
	scanf("%s %s",a+1,b+1);
	n=strlen(a+1),m=strlen(b+1);
	for(int i=1;i<=n;++i){
		x[a[i]-'a'][++l[a[i]-'a']]=i;
	}
	int z=0;
	for(int i=0;i<26;++i)x[i][++l[i]]=1e9;
	for(int i=1;i<=m;++i){
		int nw=b[i]-'a';
		if(l[nw]==1){ans=-1;break;}
		int w=x[nw][upper_bound(x[nw]+1,x[nw]+l[nw]+1,z)-x[nw]];
		if(w==1e9){
			w=x[nw][1];
			ans+=w+n-z;
		}
		else ans+=w-z; 
		z=w;
	}
	printf("%lld",ans);
}

Measured memory_bytes: 8960
a,b,n=map(int,input().split())
if n<b:
  print(a*n//b)
else:
  if n==b:
    print(a*(n-1)//b)
  else:
    i=n//b
    print(max((a*n//b-a*i),(a*(b*i-1)//b-a*(i-1))))

Measured memory_bytes: 9080
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
vector<ll> V;
int pre[maxn],a[maxn],b[maxn];
int main() {
    int n;cin>>n;
    string s;cin>>s;
    for(int i=1;i<=s.length();i++) {
        if(i<=n) putchar(s[i-1]);
        else {puts("...");break;}
    }
    return 0;
}

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

#define vi vector<int>
#define vl vector<long long>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define vp vector<P>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPD(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FORD(i, a, b) for (int i = (int)(a); i >= (int)(b); i--)
#define INF 1e18
#define INFTY 1e9
const int mod = 1000000007;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

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;
}

//cout << fixed << setprecision(10) << y << endl;
struct edge {int to, cost;};
vector< vector<edge> > es;
const int MAX_N = 10010;

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

ll lcm(ll a, ll b) {
    return a/gcd(a, b)*b;
}

int n, m;
vvi G;
vi indeg;
vi topol;

void topological_sort() {
    stack<int> s;
    REP(i, n) {
        if (indeg[i] == 0) {
            s.push(i);
        }
    }
    while (!s.empty()) {
        int u = s.top(); s.pop();
        topol.push_back(u);
        REP(i, G[u].size()) {
            int v = G[u][i];
            --indeg[v];
            if (indeg[v] == 0) s.push(v);
        }
    }
}

int main() {
    cin >> n >> m;
    G.resize(n);
    indeg.resize(n, 0);
    REP(i, m) {
        int x, y;
        cin >> x >> y;
        --x, --y;
        G[x].push_back(y);
        indeg[y] += 1;
    }
    topological_sort();
    vi dp(n);
    int res = 0;
    REP(i, n) {
        int u = topol[i];
        REP(j, G[u].size()) {
            int v = G[u][j];
            chmax(dp[v], dp[u]+1);
        }
    }
    REP(i, n) {
        chmax(res, dp[i]);
    }
    cout << res << endl;
    return 0;
}

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

int a[3];

int main(){
    cin>>a[0]>>a[1]>>a[2];
    if(a[0]==a[1])cout<<a[2]<<endl;
    else if(a[1]==a[2])cout<<a[0]<<endl;
    else cout<<a[1]<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
typedef vector<int> VI;
#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )

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

    int vertical;
    int horizon;
    
    cin >> vertical;
    cin >> horizon;
    
    vector<int> numbers;
    REP(i, 0, vertical) {
        numbers.push_back(i+1);
    }
    
    REP(i, 0, horizon) {
        int sa, sb;
        char comm;
        cin >> sa >> comm >> sb;
        swap(numbers[sa-1], numbers[sb-1]);
    }

    REP(i, 0, vertical) {
        cout << numbers.at(i) << endl;
    }

    return 0;
}

Measured memory_bytes: 1212
import java.util.Scanner;

public class Main {

	private static int[] ar;

    public static void main(String[] args) {

    	Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));

    	int n,sum,max;
    	while((n = sc.nextInt()) != 0){
    		max = Integer.MIN_VALUE;;
    		ar = new int[n];
    		for(int i=0;i<n;i++){ar[i] = sc.nextInt();}
    		for(int i=0;i<n;i++){
   				sum = 0;
   				for(int j=i;j<n;j++){
   					sum += ar[j];
   	   				if(max < sum){max = sum;}
   				}
    		}
    		System.out.println(max);
    	}
	}
}

Measured memory_bytes: 26076
#include <stdio.h>
#include <string.h>
  
int main()
{
  char temp, str[1001], re[1001], p[101];
  int i, j, a, b, q;
  
  scanf("%s", str);
  scanf("%d", &q);

  for(i = 0; i < q; i++)
  {
    scanf(" %s%d%d", p, &a, &b);

    if(strcmp(p, "print") == 0)
    {
      for(j = a; j <= b; j++)
      {
          printf("%c", str[j]);
      }

      printf("\n");
    }

    else if(strcmp(p, "reverse") == 0)
    {
      for(j = 0; a+j < b-j; j++)
      {
         temp = str[a+j];
         str[a+j] = str[b-j];
         str[b-j] = temp;
      }
    }

    else if(strcmp(p, "replace") == 0)
    {
      scanf(" %s", re);
      for(j = 0; a+j <= b; j++)
      {
          str[a+j] = re[j];
      }
    }
  }
  return 0;
}


Measured memory_bytes: 2112
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <queue>
#include <stack>
#include <string.h>
#include <list>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define all(a)  (a).begin(), (a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define rep(i,n) for(int i = 0; i < n; i++)
#define repR(i,n) for(int i = n-1; i >= 0; i--)
#define FOR(i,m,n) for(int i = m; i < n; i++)
#define PB push_back
#define MP make_pair
#define INF (1e12)


int main(){
    int a, b, res;
    cin >> a >> b;
    if(b%a == 0)res = a+b;
    else res = b-a;
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
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; }
int main() {
    int K,A,B; cin >> K >> A >> B;
    string ans = "NG";
    for (int i=A;i<=B;++i) if (i%K==0) ans = "OK";
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3628
void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  int n, k; rd(n, k);
  auto cost=new int[][](k, k);
  foreach(i; 0..k) cost[i]=readln.split.to!(int[]);
  auto a=new int[][](n, n);
  foreach(i; 0..n){
    a[i]=readln.split.to!(int[]);
    a[i].each!((ref e)=>e--);
  }

  auto s=new int[][](k, n*2);
  foreach(c; 0..k)for(int i0=0; i0<=((n-1)*2); i0++){
    for(int j=max(0, i0-n+1), i=min(i0, n-1); i>=0 && j<n; i--, j++){
      s[c][i0]+=cost[a[i][j]][c];
    }
  }
  int mn=1_000_000_000;
  foreach(c1; 0..k)foreach(c2; 0..k)foreach(c3; 0..k){
    if((c1!=c2 && c2!=c3 && c3!=c1)==false) continue;
    int beta=0;
    for(int i=0; i<=(n-1)*2; i++){
      if(i%3==0){
        beta+=s[c1][i];
      }else if(i%3==1){
        beta+=s[c2][i];
      }else{
        beta+=s[c3][i];
      }
    }
    mn=min(mn, beta);
  }

  writeln(mn);
}


void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x) e=l[i].to!(typeof(e));
}

Measured memory_bytes: 11388
n, k = map(int, input().split())
S = list(input())

if S[k-1]=='A' :
    S[k-1]='a'
elif S[k-1]=='B' :
    S[k-1]='b'
elif S[k-1]=='C' :
    S[k-1]='c'
    
S0 = ''
for x in S:
    S0 += x
    
print(S0)

Measured memory_bytes: 3064
#pragma region
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define vi vector<int>
#define vd vector<double>
#define vs vector<string>
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m-1);i>=(int)(n);i--)
#define rev(i, n) revi(i, n, 0)
#define each(i, n) for(auto&& i: n)
#define sz(v) ((int)(v).size()) 
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define uniq(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
#define dump(x) cerr << #x << " = " << x << endl
#define gcd __gcd
int lcm(int a, int b){return a / gcd(a, b) * b;}
const int INF = 1e18;
const int MOD = 1e9 + 7;
const double EPS = 1e-15;
const double PI = acos(-1);
int dig(int n){return (int)(log10(n) + 1);}
int abc(char x){return (int)(x)-(int)('a');} // 0~25
char abc(int x){return (char)(x+(int)('a'));} 
int ABC(char x){return (int)(x)-(int)('A');}
char ABC(int x){return (char)(x+(int)('A'));}
void solve();
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);
	solve();
}
#pragma endregion

void solve() {
	string S; cin >> S;
	string ans;
	if (S == "Sunny") ans = "Cloudy";
	else if (S == "Cloudy") ans = "Rainy";
	else ans = "Sunny";
	cout << ans << endl;
}

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

int main(void){
    char t[1001];
    char w[11];
    int i,c=0;

    scanf("%s", w);
    for(i=0;i<strlen(w);i++){
        w[i] = tolower(w[i]);
    }
    while(scanf("%s", t)){
        if(strcmp(t,"END_OF_TEXT") == 0) break;
        for(i=0;i<strlen(t);i++){
            t[i] = tolower(t[i]);
        }
        if(strcmp(w,t) == 0) c++;
    }
    printf("%d\n",c);
    return(0);
}

Measured memory_bytes: 552
n = int(input());
s = input();
point = 0;
for i in range(1,n) :
	if s[i] == 'E' :
		point += 1;
ans = point;
for i in range(1,n) :
	if s[i-1] == 'W' :
		point += 1;
	if s[i] == 'E' :
		point -= 1;
	if point < ans :
		ans = point;
print(ans);

Measured memory_bytes: 3704
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
ll x;

int main() {
    cin >> x;
    ll kariKosuu = floor(x/100);
    ll kariHami = x - kariKosuu * 100;
    ll ans = 1;
    if(kariKosuu < 20 && ceil(kariHami/5.0) > kariKosuu) ans = 0;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
   long int a,b,c,x,y,flag=0,i,j,count,sum,min=10000;
   
   scanf("%ld%ld%ld",&a,&b,&x);
   if(x>=a && a+b>x )
   {
       printf("YES");
   }else{
       printf("NO");
   }
   
     return 0;
}


Measured memory_bytes: 128
<?php

fscanf(STDIN, '%s', $number);
$numbers = str_split($number);
for ($i = 0; $i < count($numbers); $i++) {
	$numbers[$i] = (int)$numbers[$i];
}

function sum($_numbers, $_cur = 0) {
    if (count($_numbers) === 0) {
    	return $_cur;
    } else if (count($_numbers) === 1) {
    	return $_cur + $_numbers[0];
    }
    $sum = 0;
    $cur = 0;
    for ($i = 0; $i < count($_numbers); $i++) {
        $cur = $cur * 10 + $_numbers[$i];
        $sum += sum(array_slice($_numbers, $i + 1), $_cur + $cur);
    }
    return $sum;
}

echo sum($numbers).PHP_EOL;

Measured memory_bytes: 3580
import Data.List
getInts :: IO [Int]
getInts = map read . words <$> getLine
main :: IO ()
main = do
  [n,k] <- getInts
  as <- sort . map (\x -> (length x , head x)) . group . sort <$> getInts
  let nSyurui = length as
  print $ if nSyurui <= k
          then 0
          else sum . map fst $ take (nSyurui - k) as
  return ()


Measured memory_bytes: 64252
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(long long i=0;i<n;i++)
#define REP1(i,n) for(long long i=1;i<=n;i++)
#define PER(i,n) for(long long i=((n)-1);i>=0;i--)
#define PER1(i,n) for(long long i=(n);i>0;i--)
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define FORE(i,a,b) for(long long i=(a);i<=(b);i++)
#define ITE(arr) for(auto ite=(arr).begin();ite!=(arr).end();ite++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define YNPRT(b) cout<<((b)?"Yes":"No")<<endl
#define REV(arr) reverse(ALL(arr))
#define PRT(a) cout<<a<<endl;
#define PRTLST(arr,num) REP(_i,num) cout<<_i<<" - "<<arr[_i]<<endl;
#define PRTLST2(arr2,d1,d2) REP(_i,d1) REP(_j,d2) cout<<_i<<","<<_j<<" : "<<arr2[_i][_j]<<endl;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int INF_INT = 2147483647;
const ll INF_LL = 9223372036854775807LL;
const ull INF_ULL = 18446744073709551615Ull;
const ll P = 92540646808111039LL;
const int Move[4][2] = {-1,0,1,0,0,1,0,-1};
const int Move_[8][2] = {-1,-1,-1,0,-1,1,0,-1,0,1,1,-1,1,0,1,1};

//---------------------
#define MAXN 100000
//---------------------

ll n,a[MAXN],ret=0;
vector<ll> plusnums,minusnums;
ll marks[MAXN];
int main(){
	cin>>n;
	REP(i,n) cin>>a[i];
	if(n==2){
		if(a[0]>a[1]){
		  	cout<<a[0]-a[1]<<endl;
			cout<<a[0]<<" "<<a[1]<<endl;
		}
		else{
			cout<<a[1]-a[0]<<endl;
			cout<<a[1]<<" "<<a[0]<<endl;
		}
		return 0;
	}
	sort(a,a+n);
	if(a[0]>0){
	  	minusnums.push_back(a[0]);
	  	ret-=a[0];
		REP1(i,n-1){
		  	ret+=a[i];
			plusnums.push_back(a[i]);
		}
	}
	else if(a[n-1]<=0){
	  	ret+=a[n-1];
	  	plusnums.push_back(a[n-1]);
		REP(i,n-1){
		  	ret-=a[i];
			minusnums.push_back(a[i]);
		}
	}else{
		REP(i,n){
			if(a[i]>0) {plusnums.push_back(a[i]);ret+=a[i];}
			else {minusnums.push_back(a[i]);ret-=a[i];}
		}
	}
	
	//PRTLST(minusnums,minusnums.size());
	
	//PRTLST(plusnums,plusnums.size());
	
	cout<<ret<<endl;
	ll cache=0;
	if(plusnums.size()==1){
		cache=plusnums[0]-minusnums[0];
		cout<<plusnums[0]<<" "<<minusnums[0]<<endl;
		REP1(i,minusnums.size()-1){
		  	cout<<cache<<" "<<minusnums[i]<<endl;
			cache=cache-minusnums[i];

		}
	}else{
		cache=minusnums[0]-plusnums[0];
		cout<<minusnums[0]<<" "<<plusnums[0]<<endl;
		REP1(i,plusnums.size()-2){
		  	cout<<cache<<" "<<plusnums[i]<<endl;
			cache=cache-plusnums[i];
		}
		if(minusnums.size()>0){
			cout<<plusnums[plusnums.size()-1]<<" "<<cache<<endl;
			cache=plusnums[plusnums.size()-1]-cache;
			REP1(i,minusnums.size()-1){
			  	cout<<cache<<" "<<minusnums[i]<<endl;
				cache=cache-minusnums[i];
			}
		}
	}
	
		return 0;
}

Measured memory_bytes: 3572
using System;
using System.Linq;

class Program
{
    static void Main(string[] args) {
        int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
        string s = Console.ReadLine();
        int i = 0;
        Console.WriteLine(s.Substring(n[0],1) == "-" && int.TryParse(s.Substring(0, n[0]), out i) && int.TryParse(s.Substring(n[0]+1), out i) ? "Yes" : "No");
    }
}

Measured memory_bytes: 13268
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};

ll gcd(ll a, ll b)
{
    if (a < b)
        swap(a, b);

    return a % b == 0 ? b : gcd(b, a % b);
}

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

    ll a, b;

    cin >> a >> b;

    cout << a * b / gcd(a, b) << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long
#define endl "\n"
#define print_array(name,n) for(ll o=0;o<n;o++) cout<<name[o]<<" "
#define fr(i,f,t) for(ll i=(f);i<t;i++)
#define fb(i,f,t) for(ll i=(f);i>=t;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 2e18
bool sortbysecond(const pair<int,int> &a,const pair<int,int> &b){
	return (a.ss>b.ss);
}
template <typename T>
string NumberTostring(T Number )
{
	ostringstream ss;
	ss<<Number;
	return ss.str();
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    ll x;
    cin>>x;
    ll cnt = 0;
    ll cur = 100;
    while(cur<x){
    	cur+=(cur/100);
    	cnt++;
    }
    cout<<cnt<<endl;
    return 0;
}

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

using namespace std; 

const int MAX_N = 1005; 

struct element {
	long long x, y, z; 
};

element a[MAX_N]; 
int n, m; 
long long res = 0; 

void process(long long c1, long long c2, long long c3) {
	vector <long long> save; 
	for (int i = 1; i <= n; i++) {
		long long tmp = a[i].x * c1 + a[i].y * c2 + a[i].z * c3;
		save.push_back(tmp);	
	}

	sort(save.begin(), save.end(), greater <long long>());  

	long long sum = 0LL; 
	for (int i = 0; i < m; i++) {
		sum += save[i]; 
	}

	res = max(res, sum); 
}

int main () {
	//freopen("input.txt", "r", stdin); 
	//freopen("output.txt", "w", stdout);
	scanf("%d %d", &n, &m); 
	for (int i = 1; i <= n; i++) {
		scanf("%lld %lld %lld", &a[i].x, &a[i].y, &a[i].z); 
	}

	long long add = 1; 
	long long sub = -1; 

	process(add, add, add); 
	process(add, add, sub); 
	process(add, sub, add); 
	process(add, sub, sub); 
	process(sub, add, add); 
	process(sub, add, sub); 
	process(sub, sub, add); 
	process(sub, sub, sub); 

	printf("%lld", res);
	return 0; 
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
const int w=4e5+5;
const ll mod=1e9+7;
int a[w],b[w];
int main()
{
    int i,j;
    int n,m,q;
    cin>>n>>m>>q;
    for(i=1;i<=n;i++)
        scanf("%d",&a[i]);
    for(i=1;i<=m;i++)
        scanf("%d",&b[i]);
    int ans=1e9;
    for(i=1;i<=q;i++)
    {
        int x,y,z;
        scanf("%d %d %d",&x,&y,&z);
        ans=min(ans,a[x]+b[y]-z);
    }
    sort(a+1,a+1+n);
    sort(b+1,b+1+m);
    ans=min(ans,a[1]+b[1]);
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1152
#include <iostream>
#include <algorithm>
#include <stack>
#include <string>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <list>
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <map>

using namespace std;

int main(){
	int n;
	cin >> n;
	int a[250+1];
	for( int i = 1; i <= n; i++) cin >> a[i];
	for( int i = 1; i <= n; i++) {
		cout << "node " << i << ": key = " << a[i] << ", ";
		if(i/2 >= 1) cout << "parent key = " << a[i/2] << ", ";
		if(2*i <= n) cout << "left key = " << a[i*2] << ", ";
		if(2*i+1 <= n) cout << "right key = " << a[i*2+1] << ", ";
		cout <<endl;
	}
	return 0;
}

Measured memory_bytes: 1164
// Author: Vamsi Krishna Reddy Satti
// With love for Competitive Programming!
 
#include <bits/stdc++.h>
using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	cerr << " " << to_string(H);
	debug_out(T...);
}
#ifdef LOCAL
	#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
	#define debug(...) 3
#endif

#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define cout_precision cout.setf(ios::fixed); cout.precision(32);
 
using ll = int64_t; using ull = uint64_t; using ld = long double;
using pii = pair<int, int>; using pll = pair<ll, ll>;

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

const int N = 5e5 + 5;
string s;
int n, a[N];

void func() {
	cin >> s;
	memset(a, 0, sizeof(a));
	n = s.length();
	for (int i = 0; i < n; ++i) {
		if (s[i] == '<') {
			a[i + 1] = max(a[i + 1], a[i] + 1);
		}
	}
	for (int i = n - 1; i >= 0; --i) {
		if (s[i] == '>') {
			a[i] = max(a[i], a[i + 1] + 1);
		}
	}
	ll ans = 0;
	for (int i = 0; i <= n; ++i) {
		ans += a[i];
	}
	cout << ans << endl;
}

int main() {
	fast_io; cout_precision;
	int t = 1; // cin >> t;
	for (int i = 1; i <= t; ++i) {
		func();
	}
}

Measured memory_bytes: 2844
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int arr[MAX];
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
   for(int i=0;i<3;i++)
    cin>>arr[i];
   int mx=INT_MAX;
   mx=min(mx,abs(arr[0]-arr[1])+abs(arr[1]-arr[2]));
   mx=min(mx,abs(arr[0]-arr[2])+abs(arr[1]-arr[2]));
   mx=min(mx,abs(arr[0]-arr[1])+abs(arr[0]-arr[2]));
   cout<<mx<<endl;


    return 0;
}


Measured memory_bytes: 3640
#include<iostream>
using namespace std;
 
int main(){
    int a, b, defer;
    cin >> a >> b;
    defer = b - a;
    if(defer > 0){ cout << "a < b" << endl; }
    else if(defer < 0){ cout << "a > b" << endl; }
    else{ cout << "a == b" << endl; }
    return 0;
}


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

using namespace std;

long euclid(long a,long b){
    if(a<b) swap(a,b);
    while(a%b!=0){
        long c = a % b;
        a = b;
        b = c;
    }
    return b;
}
int main(){
    int N;
    cin >> N;
    vector<long> A(N);
    for(long i=0;i<N;i++){
        cin >> A.at(i);
    }

    for(int i=0;i<N-1;i++){
        A.at(i+1) = euclid(A.at(i),A.at(i+1));
    }

    cout << A.at(N-1) << endl;

}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int dp[105][4][2];

int main() {
  // dp[i][j][k] i桁目まで見た時の、0でない数がj個ある数字の個数
  // k=0はpending、k=1はN以下が確定
  string S;
  int K;
  cin >> S >> K;
  int lenS = sz(S);
  dp[0][0][0] = 1;
  rep(i, lenS) rep(j, K+1) rep(k, 2) {
    int cd = S[i] - '0';
    rep(d, 10) {
      int nd = d, ni = i+1, nj = j, nk = k;
      if (nd != 0) nj++;
      if (nj > K) continue;
      if (k == 0) {
        if (nd > cd) continue;
        if (nd < cd) nk = 1;
      }
      dp[ni][nj][nk] += dp[i][j][k];
    }
  }
  int ans = dp[lenS][K][0] + dp[lenS][K][1];
  cout << ans << '\n';  
  return 0;
}
// 35

Measured memory_bytes: 3608
import java.util.Scanner;

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

        int W = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        System.out.println(solve(W, a, b));

        sc.close();
    }

    static int solve(int W, int a, int b) {
        if (b > a + W) {
            return b - (a + W);
        } else if (a > b + W) {
            return a - (b + W);
        } else {
            return 0;
        }
    }
}

Measured memory_bytes: 23636
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

class BinaryIndexedTree
{
    vector<int64_t> container;

public:
    BinaryIndexedTree(size_t size)
        : container(size + 1)
    {
        fill(container.begin(), container.end(), 0);
    }
    void add(size_t i, int64_t v)
    {
        size_t idx = i + 1;
        while (idx < container.size())
        {
            container[idx] += v;
            idx += idx & -idx;
        }
    }
    int64_t find(size_t i)
    {
        size_t idx = i;

        int64_t result = 0;
        while (idx != 0)
        {
            result = container[idx] + result;
            idx -= idx & -idx;
        }
        return result;
    }
    size_t lower_bound(int64_t v)
    {
        if (v == 0)
        {
            return 0;
        }
        int64_t w = v;
        size_t x = 0;
        for (size_t k = msb(container.size() - 1); k > 0; k >>= 1)
        {
            if (x + k < container.size() && container[x + k] < w)
            {
                w -= container[x + k];
                x += k;
            }
        }
        return x + 1;
    }

private:
    size_t msb(size_t x)
    {
        x |= x >> 1;
        x |= x >> 2;
        x |= x >> 4;
        x |= x >> 8;
        x |= x >> 16;
        return (x + 1) >> 1;
    }
};

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

    multiset<int> s;
    rep(i, 1 << n)
    {
        int a;
        cin >> a;
        s.insert(a);
    }

    vector<int> curr;
    curr.push_back(*prev(s.end()));
    s.erase(prev(s.end()));

    while (!s.empty())
    {
        int size = curr.size();
        rep(i, size)
        {
            auto it = s.lower_bound(curr[i]);
            if (it == s.begin())
            {
                cout << "No" << endl;
                return 0;
            }
            else
            {
                it--;
                curr.push_back(*it);
                s.erase(it);
            }
        }
    }
    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 13692
def main():
    N, K = (int(i) for i in input().split())
    H = [0] + [int(i) for i in input().split()]
    # 1-indexed
    if N == K:
        return print(0)
    elif K == 0:
        ans = 0
        for i in range(N):
            ans += max(H[i+1] - H[i], 0)
        return print(ans)
    dp = [[10**12]*(N-K+1) for _ in range(N+1)]

    for x in range(N+1):
        dp[x][1] = H[x]

    for y in range(2, N-K+1):
        for x in range(N+1):
            for i in range(1, x):
                dp[x][y] = min(dp[x][y], dp[i][y-1] + max(0, H[x] - H[i]))

    ans = dp[0][N-K]
    for i in range(1, N+1):
        ans = min(ans, dp[i][N-K])
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 42216
import java.util.*;

public class Main {

  public static void main(String args[])
  {
    	Scanner sc = new Scanner(System.in);
    	String input = sc.nextLine();
    	String[] inputs = input.split(" ");
    	int low = Integer.valueOf(inputs[0]);
    	int high  = Integer.valueOf(inputs[1]);
    	int count = 0 ;
		for( int i = low; i<=high ; i++) {
          	if ( checkPalindrome(i)){
            	count++;
            }
        }
    	System.out.println(count);	
  }
  
  private static boolean checkPalindrome(int num) {
    	String numString = String.valueOf(num);
    	int length = numString.length();
    	int parseLength = length%2==0?length/2:length/2+1;
    	
    	for( int i = 0 ; i<parseLength ; i++ ) {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false;
        }
        return true;
    
    
  }
}

Measured memory_bytes: 38252
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    String x = sc.next();
    int count = 0;
    if(x.charAt(0) == 'o')  count++;
    if(x.charAt(1) == 'o')  count++;
    if(x.charAt(2) == 'o')  count++;
    System.out.println(700 + count*100);
  }
}


Measured memory_bytes: 22868
#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cmath>
#include<climits>
//#include<>
using namespace std;

typedef long long ll;
#define rep(i,j) for(i=0;i<j;i++)
#define rep_a_to(a,i,j) for(i=a;i<=j;i++)
#define rev_rep(i,j) for(i=j;i>=0;i--)

/*

    0        1
  1   2    2   3
 3 4 5 6  4 5 6 7

k段目(k=1,2,3...)の左端は配列2^k番目(=data[2^k -1])
データ数n_とすると木の構築には2^(n_+1)個の配列が必要
nをn_<=2^kとなる最小の2^kとすると
全ノード数2n-1
一番下以外はn-1
ゆえにl(=0,1,2...)番目のデータはdata[l+n-1]にある
 */
const int INF=INT_MAX;
class Segment_Tree
{
public:

  int n;
  vector<int> data;

  Segment_Tree(int n_)
  {
    n=1;
    while(n<n_)n*=2;
    data.resize(2*n-1,INF);
  }

  //index k(=0,1,2...)の値をaにする。
  void update(int k,int a)
  {
    k+=n-1;
    data[k]=a;
    while(k>0){
      //親は1-index では k/2なので 0-indexでは (k+1)/2 - 1 = (k-1)/2
      k=(k-1)/2;
      data[k]=min(data[k*2+1],data[k*2+2]);
    }
  }

  int query(int a,int b)
  {
    return search(a,b+1,0,0,n);
  }
private:
  //[a,b)の最小値,kは今の場所,[l,r)はkの守備範囲
  int search(int a,int b,int k,int l,int r)
  {
    //目的範囲からずれた無効
    if(r<=a||b<=l)return INF;
    //目的範囲より狭くなったら終了
    if(a<=l&&r<=b)return data[k];
    else {
      //左の子側の範囲
      int vl=search(a,b,k*2+1,l,(l+r)/2);
      //右の子側の範囲
      int vr=search(a,b,k*2+2,(l+r)/2,r);
      return min(vl,vr);
    }
  }

};


int main()
{
  string cline;
  int n,q,i;
  cin>>n>>q;
  Segment_Tree ST(n);
  rep(i,q)
    {
      int com,x,y;
      cin>>com>>x>>y;
      if(com)
	cout<<ST.query(x,y)<<endl;
      else
	ST.update(x,y);
    }
  return 0;
}

Measured memory_bytes: 2060
/*
...........__________                                                                           ___  __
.............|       |                                                                           |   /
.............|       |                                                                           |  /
.............|       |                               |                         __                | /      _______
.............|_______|  _______            _______   |______   ________   /|  /  |               |/       |      |
.............| \               | |      | |          |      |          | / | /   |               |\       |
.............|  \       _______| |      | |_______   |      |   _______|   |/    |               | \      |
.............|   \      |      | |      |         |  |      |  |       |   |     |               |  \     |
...........__|    \__|  |______| |______| ________|  |      |_ |_______|   |     |__|           _|   \__ _|        .

*/
#include<bits/stdc++.h>
using namespace std ;
#define int                 long long
#define ull                 unsigned long long int
#define ld                  long double
#define vi                  vector<int>
#define vii                 vector<pair<int,int>>
#define vvi                 vector<vector<int>>
#define pii                 pair<int,int>
#define prec(x)             fixed<<setprecision(15)<<x
#define all(x)              x.begin(),x.end()
#define rall(x)             x.rbegin(),x.rend()
#define rev(x)              reverse(x.begin(),x.end())
#define mset(a,b)           memset(a,b,sizeof(a))
#define mcpy(a,b)           memcpy(a,b,sizeof(a))
#define fo0(i,n)            for(int i=0,i##end=n;i<i##end;i++)
#define fo1(i,n)            for(int i=1,i##end=n;i<=i##end;i++)
#define fo(i,a,b)           for(int i=a,i##end=b;i<=i##end;i++)
#define foe(i,x)            for(__typeof((x).end())i=(x).begin();i!=(x).end();++i)
#define fre(i,x)            for(__typeof((x).rend())i=(x).rbegin();i!=(x).rend();++i)
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0)
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
const int inf=1e18;const int mod=1e9+7;const int N=2e5+9;
void read_And_write(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}

void raushan_kumar(){
    int d=0,e=0,f=0,g=0,p=0,w=0,flag=0,ans=0,res=0,cnt=0,sum=0;double f1=0.0,f2=0.0,f3=0.0;
    string s;cin>>s;
    if(s[1]=='B'){
    	s[1]='R';
    }
    else
    	s[1]='B';
    cout<<s;
}

int32_t main()
{
    read_And_write();fast;int t=1;
    // cin>>t;
    while(t--){raushan_kumar();}
}

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

namespace ABC126A
{
    class Program
    {
        public static void Main()
        {
            var n = Console.ReadLine()
                    .Split(' ').Select(x => int.Parse(x))
                    .ToArray();
            var s = Console.ReadLine();

            var k = n[1] - 1;
            var ans = "";
            for (int i = 0; i < n[0]; i++) {
                ans += (i == k ? char.ToLower(s[i]) : s[i]);
            }
            Console.WriteLine(ans);
        }
    }
}


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

int main()
{
    int S;
    int h,m,s;
    int temp;

    cin >> S;

    h=S/3600;
    temp=S%3600;
    m=temp/60;
    s=temp%60;

    cout << h << ":" << m << ":" << s << endl;

    return 0;
}


Measured memory_bytes: 3100
N, Y = [int(x) for x in input().split()]

c10000 = -1
c5000 = -1
c1000 = -1

for a in range(N + 1):
    for b in range(N - a + 1):
        c = N - a - b
        total = 10000 * a + 5000 * b + 1000 * c
        if total == Y:
            c10000 = a
            c5000 = b
            c1000 = c
            break

print(str(c10000) + ' ' + str(c5000) + ' ' + str(c1000))

Measured memory_bytes: 9172
#include <iostream>

int main() {
    char s[4];
    std::cin >> s;
    char a_c = 0, b_c = 0;
    int a_n = 0, b_n = 0;
    for (int i = 0; i < 4; i++) {
        if (s[i] == a_c) {
            a_n++;
        } else if (s[i] == b_c) {
            b_n++;
        } else {
            if (a_c != 0 && b_c != 0) {
                std::cout << "No" << std::endl;
                return 0;
            } else if (a_c == 0){
                a_c = s[i];
                a_n = 1;
            } else {
                b_c = s[i];
                b_n = 1;
            }
        }
    }

    std::cout << ((a_n == 2 && b_n == 2) ? "Yes" : "No") << std::endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};


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

    int n,x;
    cin >> n >> x;
    vi l(n);
    rep(i,n){
        cin >> l[i];
    }
    int b = 1;
    int cur = 0;
    rep(i,n){
        cur += l[i];
        if(cur>x){break;}
        b++;

    }
    cout << b <<endl;
    return 0;
}

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

int main() {
    int d,t,s;
    cin >> d >> t >> s;

    if (d <= t * s) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3620