akhauriyash/Code-Regression huggingface dataset:
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops")
#include<iostream>
#include<algorithm>
#include<ctime>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#include<numeric>
#include<queue>
#include<deque>
#include<cfloat>
#include<functional>
#include<tuple>
#include<math.h>
#include<bitset>
#include<stack>
#include<set>
#include<random>
#include<stdlib.h>
#define rip(i,n) for(ll i=0;i<n;i++)
#define Rip(i,n) for(ll i=1;i<n;i++)
#define all(V) V.begin(),V.end()
#define ll long long
#define ld long double
#define MOD 1000000007
#define mod MOD
#define sec setprecision
constexpr double eps = 1e-9;
constexpr double PI = 3.141592653589793238462643383279;
ll gcd(ll a, ll b) {
	if (a % b == 0)	return(b);
	else return(gcd(b, a % b));
}
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
void cominit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (ll i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}
vector<ll> soinnsuubunnkai(ll n) {
	vector<ll>a;
	while (n % 2 == 0) {
		a.push_back(2);
		n /= 2;
	}
	ll f = 3;
	while (f * f <= n) {
		if (n % f == 0) {
			a.push_back(f);
			n /= f;
		}
		else f += 2;
	}
	if (n != 1)
		a.push_back(n);
	return(a);
}
long long com(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
ll pow(ll a, ll b) {
	a = a % mod;
	if (b == 0)return(1);
	else if (b % 2 == 0)return(pow((a * a) % mod, b / 2));
	else return(a * (pow(a, b - 1)));
}
void solve() {
}
int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (max(a, b) >= c && min(a, b) <= c)cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 256
/* {{{ */
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
/* }}} */

fn main() {
    input! {
        s: chars,
        t: chars
    }
    println!("{}",
        s.iter().zip(t.iter()).filter(|&t| t.0 == t.1).count());
}
/* vim:set foldmethod=marker: */


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define ll long long

const ll mod = 1000000007 ;

using namespace std ;

int main()
{
	ll n;
	cin>>n;
	ll A[n];
	for(ll i=0 ; i<n;  i++)
		cin>>A[i];
	ll total= 0 ;
	ll h=-1 ;
	for(ll i=0 ; i<n; i++)
	{
		h = max(h,A[i]);
		total+=(h-A[i]);
	}
	cout<<total;
}


Measured memory_bytes: 5152
#include <stdio.h>

int main(void){

  char s[101];
  int s_end = -1;
  char t[101];
  int t_end = -1;
  for (int i = 0; i < 100; i++) {
    scanf("%c", &s[i]);
    if (s[i] < 'a' || s[i] > 'z') {
      break;
    }
    s_end++;
  }
  scanf("%s", t);

  printf("%s", t);
  for (int i = 0; i <= s_end; i++) {
    printf("%c", s[i]);
  }
  printf("\n");

  return 0;
}

Measured memory_bytes: 128
#include<stdio.h>

int main(){
  int N, X, m, min = 100001, count;
  
  scanf("%d %d", &N, &X);
  for (int i = 0; i < N; i++){
    scanf("%d", &m);
    if(min > m){
      min = m;
    }
    X -= m;
  }
  
  count = N + X/min;
  printf("%d\n", count);
  
  return 0;
}

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

int abs(int n){
    return n>0? n:-n;
}

int main(){
    char S[11];
    scanf("%s",S);
    int i,min=753,t;
    for(i=0;S[i+2]!='\0';i++){
        t = abs(-753 + 100*(S[i]-'0') + 10*(S[i+1]-'0') + (S[i+2]-'0') );
        min = t>min? min:t;
    }
    printf("%d",min);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define mp make_pair
#define bit(n) (1LL<<(n))
#define F first
#define S second
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;

ll GetDigit(ll num){
    ll mat=0;
  	ll dig=0;
    while(num!=0){
        num /= 10;
        mat+=num;
      	dig++;
    }
  	return mat;
}
ll sumup(ll num){
  	ll ret=0;
  	while(num!=0){
      	ret+=num%10;
      	num/=10;
    }
  	return ret;
}

int main() {
    ll m;
  	cin >> m;
    ll sum=0;
    ll dsum=0;
    rep(i,m){
        ll d,c;
        cin >> d >> c;
        sum+=d*c;
        dsum+=c;
    }
  	ll digi=sum;
  	ll digda=0;
  	while(true){
    	ll nd=GetDigit(digi);
      	digda+=nd;
      	digi=sumup(digi);
      	if(!nd)break;
    }
    cout << digda+dsum-1;
}

/*



 */




Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <vector>
#include <tuple>
#include <queue>
#include <stack>
#include <set>
#include <map>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
typedef long long ll;

int N,M,H,W,K,A,B;
string S;
string alpha = "abcdefghijklmnopqrstuvwxyz";
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int gcd(int n,int m) {
  if(m == n) return m;
  int q = n%m;
  if(q == 0) return m;
  return gcd(m,q);
}
int main() {
    vector<int> c(3,0);
    rep(i,3) cin>>c[i];
    cin>>N;
    sort(begin(c),end(c));
    reverse(begin(c),end(c));
    ll ans = 0;
    ll temp;
    int t1,t2,t3;
    int gc = gcd(c[1],c[2]);
    int lcm = (c[1]*c[2])/gc;
    rep(i,N+1){
        t1 = c[0]*i;
        if( t1> N) break;
        rep(j,N+1){
            t2 = c[1]*j;
            if(N-t1-t2 < 0) break;
            if((N-t1-t2)%c[2] == 0){
                //cout<<N-t1-t2<<endl;
                temp = ((N-t1-t2) / lcm) + 1;
                //cout<<temp<<endl;
                ans += temp;
                //cout << ans << endl;
                break;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
using System;

class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(' ');
        var a = Convert.ToInt32(input[0]);
        var b = Convert.ToInt32(input[1]);
        var c = Convert.ToInt32(input[2]);
        var d = Convert.ToInt32(input[3]);

        if (a * b >= c * d) Console.WriteLine(a * b);
        else Console.WriteLine(c * d);
    }
}

Measured memory_bytes: 13268
#include<iostream>
#include<vector>
using namespace std;
int main(){
  int i;
  int n,k,q,a;
  cin>>n>>k>>q;
  vector<int> p(n,k);
  for(i=0;i<q;++i){
    cin>>a;
    p.at(a-1)+=1;
  }
  for(i=0;i<n;++i){
    p.at(i)-=q;
    //cout<<p.at(i)<<" ";
    if(p.at(i)>=1)cout<<"Yes"<<endl;
    else if(p.at(i)<1)cout<<"No"<<endl;
  }
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	int a,b,c; cin>>a>>b>>c;
	cout<<(c/a*b)<<endl;
	
	return 0;
}

Measured memory_bytes: 3596
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define N 100010
inline int read(){
    int x=0,f=1;
    char c=getchar();
    while(c<'0'||c>'9'){
        if(c=='-')f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9'){
        x=(x<<3)+(x<<1)+c-'0';
        c=getchar();
    }
    return x*f;
}
int n,i,a[N],pos;
char s[N];
int main(){
	scanf("%s",s+1);
	n=strlen(s+1);
	i=0;
	while(i<n){
		int cntl=0,cntr=0;
		while(s[i+1]=='R')cntr++,i++;
		pos=i;
		while(s[i+1]=='L')cntl++,i++;
		int t=(cntl+cntr)>>1;
		a[pos]=a[pos+1]=t;
		if((cntl+cntr)&1){
			a[pos]+=(cntr&1);
			a[pos+1]+=(cntl&1);
		}
	}
	for(int i=1;i<=n;i++){
		printf("%d ",a[i]);
	}
	return 0;
}


Measured memory_bytes: 896
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	m := make(map[int]int)
	for i := 0; i < n; i++ {
		var a int
		fmt.Scan(&a)
		m[a-1]++
		m[a]++
		m[a+1]++
	}

	ans := 0
	for _, v := range m {
		if ans < v {
			ans = v
		}
	}

	fmt.Println(ans)
}


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

typedef long long ll;

void solve() {
  ll N;
  cin >> N;
  ll res = 0;
  for (int i = 0; i < N; i++) {
    ll l, r;
    cin >> l >> r;
    res += (r - l) + 1;
  }
  cout << res << endl;
}

int main() {
  solve();
}

Measured memory_bytes: 256
#pragma optimize("unroll-loops,no-stack-protector")
#include <bits/stdc++.h>
using namespace std;
// using namespace __gnu_pbds;
// #include <ext/pb_ds/assoc_container.hpp>
// typedef tree<int,null_type,less<int>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_set;
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(ll i=a;i>=b;i--)
#define Max(a,b,c) max(a,max(b,c))
#define Min(a,b,c) min(a,min(b,c))
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define pc(x)  __builtin_popcount (x)
#define vl vector< ll >
#define sorts(v) sort(v.begin(),v.end())
#define sortg(v) sort(v.begin(),v.end(),greater<ll>())
#define ss second
#define ff first
#define ll long long
#define ld long double
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1e18)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod 1000000007
#define mem(x,y) memset(x,y,sizeof(x))
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
#define flush fflush(stdout) 
#define gcd __gcd
#define primeDEN 727999983
#define nx_pe next_permutation(s.begin(),s.end())
#define cl cout<<"\n"
#define sp(x) setprecision(x)



void solve()
{
   string s,t;
   cin>>s>>t;
   ll n=s.size();
   ll ans=t.size();
   rep(i,s.size())
   {
       ll temp=0;
       f(j,i,i+t.size())
       {
           if(j>=n)
           {
               temp=n;
               break;
           }
           if(s[j]!=t[j-i])temp++;
       }
       ans=min(ans,temp);
   }
   cout<<ans<<"\n";
}


    
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin) ;
    freopen("ouput.txt", "w", stdout) ;
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL) ; cout.tie(NULL) ;
    std::ios::sync_with_stdio(false);
    ll te=1;
    // cin>>te;
    while(te--){
        solve();
    }
    
}


Measured memory_bytes: 3656
#include "bits/stdc++.h"
using namespace std;
int main()
{
	int a,b,c,d;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	if(a+b>c+d)
	{
		printf("Left\n");
	}
	else if(a+b==c+d)
	{
		printf("Balanced\n");
	}
	else
	{
		printf("Right\n");
	}
	return 0;
}

Measured memory_bytes: 256
import sys
from heapq import heappush,heappop

n,m = map(int,input().split())
ab = []
for line in sys.stdin:
    a,b = map(int,line.split())
    if a <= m:
        ab.append((a,b))
ab.sort(reverse=1)

stock = []
ans = 0
for i in range(1,m+1):
    while ab and ab[-1][0] <= i:
        a,b = ab.pop()
        heappush(stock,-b)
    if stock:
        ans += -heappop(stock)

print(ans)

Measured memory_bytes: 17208
#include<bits/stdc++.h>
using namespace std;
int n;
int a[1000];
int main()
{
    cin>>n;  int sum=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    sort(a,a+n);
    sum-=a[n-1];
    if(sum>a[n-1])
        cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 256
using System;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {

            int a, b, A, B, C, max;

            var word = Console.ReadLine().Split(' ');
            a = int.Parse(word[0]);
            b = int.Parse(word[1]);

            A = a + b;
            B = a - b;
            C = a * b;

            max = 0;
            if (A >= B && A >= C)
                max = A;
            else if (B >= A && B >= C)
                max = B;
            else if (C>=A && C>=B)
                max = C;


            Console.WriteLine(max);

            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 11092
#include <algorithm>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
/* clang-format on */

#ifndef __int128
#define __int128 ll
#endif

class KnapsackBBSolver {
 private:
  using P = pair<ll, ll>;
  ll W, best;
  vector<P> ps;

 public:
  KnapsackBBSolver(ll W_) : W(W_) {}

  void addItem(ll v, ll w, ll m) {
    ll num = m;
    for (ll k = 1; num > 0; k <<= 1) {
      ll mul = min(num, k);
      if (mul <= W / w) ps.emplace_back(mul * v, mul * w);
      num -= mul;
    }
  }

  ll solve() {
    optimize();
    best = 0;
    dfs(0, 0, W);
    return best;
  }

 private:
  void optimize() {
    sort(ps.begin(), ps.end(), [&](const P& a, const P& b) {
      auto x = __int128(a.fst) * b.snd;
      auto y = __int128(b.fst) * a.snd;
      if (x != y) return x > y;
      return a.fst > b.fst;
    });
  }

  pair<ll, bool> upper_bound(int i, ll W) {
    ll res = 0;
    bool integer = true;
    for (; i < ps.size() && W > 0; i++) {
      if (ps[i].snd > W) {
        res += __int128(ps[i].fst) * W / ps[i].snd;
        integer = false;
      } else {
        res += ps[i].fst;
      }
      W -= ps[i].snd;
    }
    return make_pair(res, integer);
  }

  void dfs(int i, ll V, ll W) {
    if (W < 0) return;
    if (i >= ps.size()) {
      if (V > best) best = V;
      return;
    }
    auto ub = upper_bound(i, W);
    if (V + ub.fst <= best) return;
    if (ub.snd) {
      best = V + ub.fst;
      return;
    }
    dfs(i + 1, V + ps[i].fst, W - ps[i].snd);
    dfs(i + 1, V, W);
  }
};

int main() {
  int N;
  ll X, D;
  while (cin >> N >> X >> D) {
    vector<ll> m(N);
    cin >> m[0];
    vec<int, 2> G(N);
    for (int i = 1; i < N; i++) {
      int p;
      cin >> m[i] >> p;
      --p;
      G[p].push_back(i);
    }
    vector<int> sz(N);
    vector<ll> msum(N);
    function<void(int)> dfs = [&](int v) {
      sz[v] = 1;
      msum[v] = m[v];
      for (int u : G[v]) {
        dfs(u);
        sz[v] += sz[u];
        msum[v] += msum[u];
      }
    };
    dfs(0);
    KnapsackBBSolver solver(X);
    for (int i = 0; i < N; i++) {
      ll lim = D;
      if (i == 0) lim = X / msum[0];
      solver.addItem(sz[i], msum[i], lim);
    }
    cout << solver.solve() << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
#include <iomanip>
#include <utility>
#include <math.h>

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
#define lol long long
#define mp make_pair
#define fi first
#define se second
#define pu push_back
#define SYOU(x) setprecision(x+1)
#define abs(x,y) (max(x,y)-min(x,y))

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int a,b;
    char c;

    while(cin>>a>>c>>b,c!='?'){
	if(c=='+'){
	    cout<<a+b<<'\n';
	}
	else if(c=='-'){
	    cout<<a-b<<'\n';
	}
	else if(c=='*'){
	    cout<<a*b<<'\n';
	}
	else{
	    cout<<a/b<<'\n';
	}
    }
    return 0;
}



Measured memory_bytes: 3112
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>

using namespace std;

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

Measured memory_bytes: 256
#include <cstdio>

int main()
{
    int deck[50] = {}, tam[50] = {}, num, times, p, c;

    while (1)
    {
        scanf("%d %d", &num, &times);
        if (num == 0 && times == 0)
        {
            break;
        }
        for (int i = 0; i < num; i++)
        {
            deck[i] = num - i;
        }

        for (int i = 0; i < times; i++)
        {
            scanf("%d %d", &p, &c);
            for (int j = 0; j < p - 1; j++)
            {
                tam[j] = deck[j];
            }
            for (int j = 0; j < c; j++)
            {
                deck[j] = deck[j + p - 1];
            }
            for (int j = 0; j < p - 1; j++)
            {
                deck[c + j] = tam[j];
            }
        }
        printf("%d\n", deck[0]);
    }
}


Measured memory_bytes: 2564
#include <iostream>
using namespace std;
 
int main(void){
	int m, f, r;
	string g;

	while (cin >> m >> f >> r, m != -1 || f != -1 || r != -1){
		int s = m + f;
		if (m==-1 || f==-1) g =  'F';
		else if(80 <= s)  g = "A";
		else if(65 <= s && s< 80)  g = "B";
		else if(50 <= s && s< 65)  g = "C";
		else if(30 <= s && s< 50)
		if (50 <= r) g = "C";
		else g = "D";
		else if(s <  30)  g = "F";
		cout << g << endl;
	}
	return 0;
}

Measured memory_bytes: 1188
#include<bits/stdc++.h>
//#pragma GCC optimize("Ofast","no-stack-protector","unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx")
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
#define F(i,L,R) for (int i = L; i < R; i++)
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define getI(a) scanf("%d", &a)
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define VgetI(n) int (n); scanf("%d",&(n))
#define VgetII(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define VgetIII(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define debug(x) cout<<(#x)<<"="<<x<<"\n";
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define f first
#define s second
#define ll long long
#define INF 2000000000
ll a[100005];
int main(){
        int n;
        while(~getI(n)){
                ll k,q;
                scanf("%lld%lld",&k,&q);
                FE(i,1,n) a[i]=k;
                F(i,0,q){
                        VgetI(x);
                        a[x]++;
                }
                FE(i,1,n) printf("%s\n",a[i]>q?"Yes":"No");
        }
}


Measured memory_bytes: 1408
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

#define LE(x,y) ((x)-(y)<EPS)
typedef vector<double> vd;

vs split(string str, string delim) {
	vs result;
	int pos;

	while((pos = str.find_first_of(delim)) != str.npos) {
		if(pos > 0) {
			result.push_back(str.substr(0, pos));
		}
		str = str.substr(pos+1);
	}
	if(str.length() > 0) {
		result.push_back(str);
	}

	return result;
}

double diff(int r1, int r2) {
	return 2*sqrt(r1*r2)-r1+r2;
}

int main() {
	string line;
	while(getline(cin, line)) {
		vs data = split(line, " ");
		double size = toInt(data[0]);
		int n = data.size()-1;
		vi r(n);
		REP(i, n) {
			r[i] = toInt(data[i+1]);
		}

		vector<vd> dp(1<<n, vd(n, INF));
		REP(i, n) {
			dp[1<<i][i] = 2*r[i];
		}
		REP(i, 1<<n) {
			REP(j, n) {
				if(i&(1<<j)) {
					REP(k, n) {
						int ni = i|(1<<k);
						if(i != ni) {
							dp[ni][k] = min(dp[ni][k], dp[i][j]+diff(r[j], r[k]));
						}
					}
				}
			}
		}

		bool ok = false;
		REP(i, n) {
			if(LE(dp[(1<<n)-1][i], size)) {
				ok = true;
			}
		}

		cout << (ok ? "OK" : "NA") << endl;
	}

	return 0;
}

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

int main() {
  int n, m;
  cin >> n >> m;
  if (n==m) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)

struct INIT{
    INIT(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(0);
        cout << fixed << setprecision(13);
    }
}INIT;

int n, m;
vector<int> Graph[101010];
bool used[101010];

bool is_not_end(int x){
    for(auto to : Graph[x]){
        if(!used[to])return true;
    }
    return false;
}

int main(){
    cin >> n >> m;
    REP(i, m){
        int a, b;
        cin >> a >> b;
        a--, b--;
        Graph[a].emplace_back(b);
        Graph[b].emplace_back(a);
    }
    deque<int> ans;
    ans.push_front(0);
    used[0] = true;
    int cur = 0;
    while(is_not_end(cur)){
        for(auto to : Graph[cur]){
            if(!used[to]){
                ans.push_front(to);
                used[to] = true;
                cur = to;
                break;
            }
        }
    }
    cur = 0;
    while(is_not_end(cur)){
        for(auto to : Graph[cur]){
            if(!used[to]){
                ans.push_back(to);
                used[to] = true;
                cur = to;
                break;
            }
        }
    }
    cout << (int)ans.size() << endl;
    cout << ans.front() + 1;
    ans.pop_front();
    while(!ans.empty()){
        cout << " " << ans.front() + 1;
        ans.pop_front();
    }
    cout << endl;
}

Measured memory_bytes: 6784
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
P = np.array(read().split(), np.int32)

K = 40000
A = K * np.arange(N) + 10
x = np.argsort(P)
B = A[::-1] + x

print(' '.join(map(str, A.tolist())))
print(' '.join(map(str, B.tolist())))

Measured memory_bytes: 29640
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <climits>
#include <set>
#include <unordered_set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <complex>
#include <regex>
#include <locale>
#include <random>
#include <type_traits>

using namespace std;

#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

using LL = long long;

//~~~~~~~~~~~~~~~~~~~~~_(＾～＾ ｣ ∠)_~~~~~~~~~~~~~~~~~~~~~

int main() {

    int N;
    cin >> N;

    vector<int> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];

    multiset<int> mst;
    for (int i = 0; i < N; i++) {
        auto it = mst.lower_bound(A[i]);
        if (it == mst.begin()) {
            mst.insert(A[i]);
        } else {
            it--;
            mst.erase(it);
            mst.insert(A[i]);
        }
    }

    cout <<mst.size() << endl;

}
























Measured memory_bytes: 5376
import java.util.Scanner;

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

    int N = scanner.nextInt();
    int M = scanner.nextInt();
    char[][] A = new char[N][N];
    char[][] B = new char[M][M];
    for (int i = 0; i < N; i++) A[i] = scanner.next().toCharArray();
    for (int i = 0; i < M; i++) B[i] = scanner.next().toCharArray();
    for (int x = 0; x <= N - M; x++) {
      for (int y = 0; y <= N - M; y++) {
        boolean match = true;
        for (int i = 0; i < M; i++) {
          for (int j = 0; j < M; j++) {
            match &= A[x + i][y + j] == B[i][j];
          }
        }
        if (match) {
          System.out.println("Yes");
          return;
        }
      }
    }
    System.out.println("No");
  }
}


Measured memory_bytes: 23892
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>

using namespace std;

const int N = 555;

int n, x[N], a[N * N];
int ptr = 1;

int go(int times, int who) {
	int first = -1;
	for (int i = 0; i < times; i++) {
		while (a[ptr] != -1) ptr++;
		a[ptr] = who;
		if (first == -1) first = ptr;
	}
	return first;
}

int main() {
	scanf("%d", &n);
	vector<pair<int, int> > pos;
	for (int i = 1; i <= n; i++) {
		scanf("%d", &x[i]);
		pos.push_back({x[i], i});
	}
	fill(a + 1, a + n * n + 1, -1);
	sort(pos.begin(), pos.end());
	for (auto p : pos) {
		int where = p.first, who = p.second;
		go(who - 1, who);
		if (a[where] != -1) {
			// printf("%d %d\n", where, who);
			puts("No");
			return 0;
		}
		a[where] = who;
	}
	for (auto p : pos) {
		int where = p.first, who = p.second;
		if (n - who && go(n - who, who) < where) {
			puts("No");
			return 0;
		}
	}
	puts("Yes");
	for (int i = 1; i <= n * n; i++) {
		printf("%d%c", a[i], "\n "[i < n * n]);
	}
	return 0;
}


Measured memory_bytes: 2176
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
using namespace std;
int main(){
    int A,B,e,t,result;
    double E,T;
    double i=1;
    bool TB = false;
    cin>>A>>B;
    for(;i<=B*10000;i++){
      E=i*0.08;
      T=i*0.1;
      e=E;
      t=T;
      if(e==A&&t==B&&e!=0&&t!=0){
        TB=true;
        break;
      }
    }
    result=i;
    if(TB){
      cout<<i;
    }
    else{
      cout<<"-1";
    }
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define ALL(x) (x).begin(),(x).end()
using namespace std;

//素因数分解
vector<pair<ll,int>> factorize(ll n){
    vector<pair<ll,int>>res;
    for(ll i=2;i*i<=n;i++){
        if(n%i)continue;
        res.emplace_back(i,0);
        while (n%i == 0)
        {
        n /= i;
        res.back().second++;
        }
        
    }
    if(n != 1) res.emplace_back(n,1);
    return res;
}

int main(){
    ll N;
    ll ans = 1e13;
    cin >> N;
    for(ll i=1;i*i<=N;i++){
        if(N%i == 0){
            ll j= N/i;
            ans = min(ans,i+j-2);
        }
    }
    cout << ans << endl;
}


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

int main(){
	char str[15];
	scanf("%s",&str);
	char temp[15];
	int index=0,len=strlen(str);
	for(int i=0;str[i] != '\0';i++){
		if(str[i]=='0'){
			temp[index] = '0';
			//printf("index[%d] : %s\n",index,temp);
			index++;
		} 
		else if(str[i]=='1'){	
			temp[index] = '1';
			//printf("index[%d] : %s\n",index,temp);
			index++;
		} 				//01B0 temp =     --0
		else if(str[i]=='B'){
			//printf("index[%d] : %s\n",index,temp);
			if(index != 0) index--;
		}
	}
	//printf("%d\n",index);
	temp[index]='\0';
	printf("%s\n",&temp);
	
	
	
	return 0;
}

Measured memory_bytes: 1644
#include <cstdio>
#include <cstring>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#define rep(i, s, g) for ((i) = (s); (i) < (g); ++(i))
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1e18) + 1;

int main(void)
{
    int n, d, a;
    vector<P> monster;
    int x, h;
    int i, j;
    int tx, th;
    int mid;
    ll count;
    ll ans = 0;
    queue<P> bomb; //位置、ダメージ
    ll damage = 0;

    cin >> n >> d >> a;

    monster.emplace_back(0, 0);

    rep(i, 1, n + 1)
    {
        cin >> x >> h;
        monster.emplace_back(x, h);
    }

    sort(monster.begin(), monster.end());

    rep(i, 1, n + 1)
    {
        tx = monster[i].first;
        th = monster[i].second;

        while (bomb.size() && monster[i].first > bomb.front().first + d * 2)
        {
            damage -= bomb.front().second;
            bomb.pop();
        }

        th -= damage;

        if (monster[i].second - damage > 0)
        {
            count = (th + a - 1) / a;

            bomb.push(P(tx, count * a));

            damage += count * a;

            ans += count;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 6512
N,A=map(int,input().split())
x=sorted(list(map(int,input().split())))

xn=[x[i]-A for i in range(len(x)) if x[i]<A]
xn.reverse()
x0=[0 for i in range(len(xn),len(x)) if x[i]==A]
xp=[x[i]-A for i in range(len(xn)+len(x0),len(x)) if x[i]>A]

sxn=[0]
sxn_n=[1]
for x in xn:
  sxn_add=[]
  sxn_n_i=[]
  for j in range(len(sxn)):
    sxn_tmp=sxn[j]+x
    for k in range(len(sxn)):
      if sxn[k]==sxn_tmp or k==len(sxn)-1:
        if sxn[k]==sxn_tmp:
          sxn_n_i.append([k,sxn_n[j]])
        else:
          sxn_add.append([sxn_tmp,sxn_n[j]])
        break
  for l in sxn_n_i:
    sxn_n[l[0]]+=l[1]  
  for k in sxn_add:
    sxn.append(k[0])
    sxn_n.append(k[1])
  

sxp=[0]
sxp_n=[1]
for x in xp:
  sxp_add=[]
  sxp_n_i=[]
  for j in range(len(sxp)):

    sxp_tmp=sxp[j]+x

    for k in range(j,len(sxp)):
      if sxp[k]==sxp_tmp or k==len(sxp)-1:

        if sxp[k]==sxp_tmp:
          sxp_n_i.append([k,sxp_n[j]])
        else:
          sxp_add.append([sxp_tmp,sxp_n[j]])
        break
  for l in sxp_n_i:
    sxp_n[l[0]]+=l[1]
  for k in sxp_add:
    sxp.append(k[0])
    sxp_n.append(k[1])




an=0
for i in range(1,len(sxp)):
  for j in range(1,len(sxn)):

    if sxp[i]==-sxn[j]:
      an+=sxp_n[i]*sxn_n[j]
      break


print(2**len(x0)-1+an*2**(len(x0)))

Measured memory_bytes: 3192
def partition(A, p, r):
    x = A[r]
    i = p - 1

    for j in range(p, r):
        if A[j] <= x:
            i += 1
            A[i], A[j] = A[j], A[i]

    A[i + 1], A[r] = [A[r]], A[i + 1]
    q = i + 1

    return q


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

q = partition(A, 0, n - 1)
print(*A)


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

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using mii = map<int, int>;
using msi = map<string, int>;
using pii = pair<int, int>;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;

    bool a[10] = {false};
    REP(i, k) {
        int m;
        cin >> m; 
        a[m] = true;
    }
    while(true) {
        int m = n;
        bool f = true;
        while(m) {
            if(a[m % 10]) {
                f = false;
                break;
            }
            m /= 10;
        }
        if(f) break;
        n++;
    }
    cout << n << endl;
    return 0;
}

Measured memory_bytes: 256
n=gets.to_i
a=gets.split.map(&:to_i)
puts a*' '
(1..n-1).each do |i|
  j = i
  while j>=1 && a[j]<a[j-1]
    a[j-1], a[j] = a[j], a[j-1]
    j-=1
  end
  puts a*' '
end

Measured memory_bytes: 6112
<?php
fscanf(STDIN, "%d", $N);
$B = explode(" ", trim(fgets(STDIN)));
$ans = 0;
array_unshift($B, $B[0]);
array_push($B, $B[$N - 1]);
for ($i = 0; $i < $N; $i++) {
    $ans += min($B[$i], $B[$i + 1]);
}
echo $ans;


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

using namespace std;

void Main()
{
    int a, b;
    cin >> a >> b;

    int ret = 0;
    for (int i = 0; i < 2; ++i)
    {
        ret += max(a, b);
        if (a > b)
            a--;
        else
            b--;
    }

    cout << ret;
}

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

    std::cout << std::fixed << std::setprecision(10);

#ifdef DEBUG_BUILD
    while (true)
    {
        Main();
        cout << std::endl;
    }
#endif

    Main();
    cout << endl;

    return 0;
}

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

int main(){
	int a,b,c;
	cin >> a >> b >> c;
	int ans = max(0,c-a+b);
	cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int max =0,ans =0;
    for (int i=1; i<20; i++) {
      max = (A - 1) * i + 1;
      if (max >= B) {
        ans = i; 
        break;
      }
    }
    if (B == 1) {
      System.out.println(0);
    } else {
      System.out.print(ans);
    }
  }
}

Measured memory_bytes: 22740
#include <stdio.h>
int main(void)
{
    int pas[3],ju1,ju2,i,box1,box2;
    for(i=0;i<3;i++)
        scanf("%d",&pas[i]);
    scanf("%d%d",&ju1,&ju2);
    if(pas[0]<pas[1]&&pas[0]<pas[2])
        box1=pas[0];
    else if(pas[0]<pas[1]&&pas[0]>pas[2])
        box1=pas[2];
    else if(pas[0]>pas[1]&&pas[0]<pas[2])
        box1=pas[1];
    else
    {
        if(pas[1]<pas[2])
            box1=pas[1];
        else
            box1=pas[2];
    }
    if(ju1<ju2)
        box2=ju1;
    else
        box2=ju2;
    printf("%d\n",box1+box2-50);
    return 0;
}

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

#define int long long

const int MaxN = 1e5 + 6.66;
int arr[MaxN];

int32_t main() {
  int N, M, v, p; cin >> N >> M >> v >> p;
  for(int i = 0; i < N; i++) cin >> arr[i];
  sort(arr, arr + N);
  int tot = p;
  long long sum = arr[N - p];
  int mx = arr[N - p];
  for(int i = N - p - 1; i > -1; --i) {
    if(mx > arr[i] + M) {
      break;
    }
    if(1ll * (arr[i] + M) * max(0ll, N - i - p) - sum >= 1ll * max(0ll, v - i - p) * M) tot++; 
    sum += arr[i];
  }
  cout << tot << endl;
  return 0;
}


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

#define lld long long
#define pi pair<int,int>
#define pl pair<lld,lld>
#define mem0(x) memset(x,0,sizeof(x))
#define fillnum(x,n) fill(begin(x),end(x),n)
#define asort(x) sort(x.begin(),x.end())
#define dsort(x,t) sort(x.begin(),x.end(),greater<t>())

lld cnt[10001];

void solved(lld x,lld y,lld z){
    lld ans = x*x + y*y + z*z + x*y + y*x + z*x;
    if(ans > 10000) {
        cout << x << endl;
        return;
    }
    cnt[ans]++;
    solved(x+1,y,z);
}

int main() {
    lld N;
    cin >> N;
    mem0(cnt);
    for (int i = 1; i < 101; i++) {
        for (int j = 1; j < 101; j++) {
            for (int k = 1; k < 101; k++) {
                lld ans = i*i + j*j + k*k + i*j + j*k + i*k;
                if(ans <= 10000){
                    cnt[ans]++;
                }
            }
        } 
    }
    for (int i = 0; i < N; i++) {
        cout << cnt[i+1] << endl;
    }
}

Measured memory_bytes: 3728
#pragma region head
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define len(x) ((ll)(x).size())
#define debug(var) cout << "[" << #var << "]\n" << var << endl
#define test(s) \
  if (!(s))     \
    cout << "Line " << __LINE__ << ": [" << #s << "] is false" << endl;
#define int long long
typedef long long ll;
#define double long double
typedef double ld;
const int INF = 1001001001001001001ll;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;
const double EPS = 1e-9;
const double PI = acos(-1.0);

template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << ' ';
  }
  return s;
}

template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1)
      s << '\n';
  }
  return s;
}

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

__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
#pragma endregion

signed main() {
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i, N) {
    cin >> A[i];
  }
  sort(all(A), greater<int>());
  int ans = 0;
  rep(i, N - 1) {
    ans += A[(i + 1) / 2];
  }
  cout << ans << endl;
}

Measured memory_bytes: 4848
#include <bits/stdc++.h>
using namespace std;
int main(){
	string S;
	cin >> S;
	bool res = false;
	for (int k = 0; k <S.length()-1;k++){
		if (S[k]==S[k+1]){
			res = true;
			cout << k+1 <<" "<< k+1+1 << endl;
			break;
		}
		if (k < S.length()-2){
			if(S[k]==S[k+2]){
				res = true;
				cout<<k+1<<" "<< k+3<<endl;
				break;
			}
		}
	} 
	if(!res){
		cout<<"-1 -1"<<endl;
	}


	return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <iostream>

using namespace std;

int main() {
	int H[10];
	for (int i = 0; i < 10; i++) {
		cin >> H[i];
	}

	for (int i = 1; i < 10; i++) {
		int v = H[i];
		int j = i - 1;
		while (j >= 0 && H[j] < v) {
			H[j + 1] = H[j];
			j--;
		}
		H[j + 1] = v;
	}

	for (int i = 0; i < 3; i++) {
		cout << H[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 2972
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(ll i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
typedef tuple<ll,ll,ll> Tu;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const double PI=3.14151926535;
const ll INFl=(ll)9223372036854775807/2;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
const ll tMOD=(ll)998244353;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
//int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
int mdx[8]={0,1,0,-1,1,1,-1,-1},mdy[8]={-1,0,1,0,1,-1,1,-1};


template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

string s;
int main(){
	cin>>s;
	int ans=0;
	for(int i=0;i<s.size()/2;i++){
		if(s[i]!=s[s.size()-1-i]){
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import heapq

N,T = map(int, input().split())
A = [int(a) for a in input().split()]

l = A[0]
l_idx = 0
r = []
for i in range(1, N):
    heapq.heappush(r, (-A[i], i))

b = -r[0][0] - l
h = []
heapq.heappush(h, (-b, l_idx, r[0][1]))
for i in range(1, N-1):
    while r[0][1] <= i:
        heapq.heappop(r)
    if l > A[i]:
        l = A[i]
        l_idx = i
    if b <= -r[0][0]-l:
        b = -r[0][0]-l
        heapq.heappush(h, (-b, l_idx, r[0][1]))
        
used1 = [0]*N
used2 = [0]*N
while h:
    t = heapq.heappop(h)
    if -t[0] < b:
        break
    if used1[t[2]] == 1:
        used1[t[2]] = -1
        used2[t[2]] = -1
    if used2[t[1]] == 1:
        used1[t[1]] = -1
        used2[t[1]] = -1
    if used1[t[1]] == 0:
        used1[t[1]] = 1
    if used2[t[2]] == 0:
        used2[t[2]] = 1
    
cnt1 = 0
cnt2 = 0
for i in range(N):
    cnt1 += max(0, used1[i])
    cnt2 += max(0, used2[i])
    
print(min(cnt1, cnt2))

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

int main() {
    int M = 0;
    string str;
    cin >> str;
    int w = 0;
    for(int i=0;i<str.length();i++) {
        if(str[i]=='R') {
            w++;
        } else {
            w=0;
        }
        M = max(M,w);
    }
    cout << M << endl;
    return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n; cin >> n;
    int prev = INT_MAX, cur = 0, ans = 0;
    for(int i = 0; i < n - 1; i++) {
        cin >> cur;
        ans += min(cur, prev);
        prev = cur;
    }
    cout << ans + cur << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
    int x,y,z,tmp;
    scanf("%d%d%d",&x,&y,&z);
    tmp=x; x=y; y=tmp;
    tmp=x; x=z; z=tmp;
    printf("%d %d %d\n",x,y,z);
    return 0;
}

Measured memory_bytes: 1724
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define pb push_back
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
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;
}
//グリッド：（典型）dp,dfs,bfs,最短経路,その他
const int mod = 1000000007;
struct mint {
ll x;
mint(ll x=0):x((x%mod+mod)%mod){}
mint operator-() const { return mint(-x);}
mint& operator+=(const mint a) {
if ((x += a.x) >= mod) x -= mod;
return *this;
}
mint& operator-=(const mint a) {
if ((x += mod-a.x) >= mod) x -= mod;
return *this;
}
mint& operator*=(const mint a) {
(x *= a.x) %= mod;
return *this;
}
mint operator+(const mint a) const {
mint res(*this);
return res+=a;
}
mint operator-(const mint a) const {
mint res(*this);
return res-=a;
}
mint operator*(const mint a) const {
mint res(*this);
return res*=a;
}
mint pow(ll t) const {
if (!t) return 1;
mint a = pow(t>>1);
a *= a;
if (t&1) a *= *this;
return a;
}
mint inv() const {
return pow(mod-2);
}
mint& operator/=(const mint a) {
return (*this) *= a.inv();
}
mint operator/(const mint a) const {
mint res(*this);
return res/=a;
}
};
struct combination {
vector<mint> fact, ifact;
combination(int n):fact(n+1),ifact(n+1) {
assert(n < mod);
fact[0] = 1;
for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
ifact[n] = fact[n].inv();
for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
}
mint operator()(int n, int k) {
if (k < 0 || k > n) return 0;
return fact[n]*ifact[k]*ifact[n-k];
}
};
int main(){
    ll h,w,a,b;cin>>h>>w>>a>>b;
    combination c(220000);
    mint ans=0;
    for(ll i=0;i<=h-a-2;i++){
        ans+=c(b+i,b)*c(w-b-2+h-i-1,w-b-2);
    }
    //cout<<ans.x<<endl;
    ans+=c(h-a-1+b,b)*c(w-b-1+a,a);
    cout<<ans.x<<endl;
    return 0;
}

Measured memory_bytes: 3840
#include<bits/stdc++.h>
using namespace std;
string S;
bool f;
int main(){
	cin>>S;
	for(int i=0;i<S.length();i++){
		if(S[i]=='C')
			f=true;
		if(f&&S[i]=='F'){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>

using namespace std;
int main(){
    string sumo;
    cin >> sumo;
    int count=0;
    for(int i=0;i<sumo.length();i++){
        if(sumo[i]=='o'){
            count++;
        }
    }
    int siai =15-sumo.length(); 
    
    if(count+siai >=8){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    
        
    
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include <algorithm>
#include <functional>

using namespace std;

int main (void){
    int N;
    vector<int> A;
    int temp;
    int max = 1;
    int max_past = 1;
    int index = -1;

    cin >> N;
    for(int i=0; i < N ; i++){
        cin >> temp;
        A.push_back(temp);
        if(max < temp){
            max_past = max;
            max = temp;
            index = i;
        }
        else if(max_past < temp){
            max_past = temp;
        } 
    }

    for(int i=0; i<N;i++){
        if(i == index) cout << max_past << endl;
        else            cout << max << endl;
    }
    return 0; 
}

Measured memory_bytes: 2548