akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 100005;

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s;
    cin >> s;
    int cnt[26] = {};
    for( int i = 0; i < s.size(); ++i ) {
        ++cnt[s[i] - 'a'];

    }
    if( s.size() < 26 ) {
        bool flg = true;
        int pos = 0;
        while( flg )  {
            if( !cnt[pos] ) flg = false;
            ++pos;

        }
        cout << s << (char)('a' + pos - 1 ) << endl;

    } else {
        int pos = s.size() - 1;
        
        while( pos >= 1 && s[pos - 1] > s[pos] ) --pos;
        
        if( pos == 0 ) cout << -1 << endl;
        else {
            --pos;
            for( int i = 0; i < pos; ++i ) cout << s[i];

            for( int i = s.size() - 1; ; --i ) {
                if( s[i] > s[pos] ) {
                    cout << s[i];
                    break;

                }
            }
            cout << endl;
        }
    }

    return 0;
}



Measured memory_bytes: 256
typedef long long int ll;
typedef unsigned long long int ull;
#define fast  ios_base::sync_with_stdio(false); cin.tie(NULL);
#define MOD 1000000007
#define M_PI           3.14159265358979323846  /* pi */
#define sec second
#define fir first
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repe(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define entire(a) (a).begin(),(a).end()
#define pb push_back
#define pii pair<int,int>
#include<bits/stdc++.h>
using namespace std;

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	fast
	ll n;
	cin>>n;
	ll ans=0;
	for(int i=1;i<n;++i){
		for(int j=1;;++j){
			if(i*j<n){
				ans++;
				// cout<<i<<' '<<j<<endl;
			}else{
				break;
			}
		}
	}
	cout<<ans<<endl;
	return 0;

}


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

int main()
{
    int h, w;
    char s[50][51];
    int i, j, k, l;
    scanf("%d%d", &h, &w);
    for (i=0; i<h; i++)
    {
        scanf("%s", s[i]);
    }
    for (i=0; i<h; i++)
    {
        for (j=0; j<w; j++)
        {
            if (s[i][j] == '.') {
                int count = 0;
                for (k=-1; k<=1; k++) {
                    if (i+k<0 || i+k>=h) continue;
                    for (l=-1; l<=1; l++)
                    {
                        if (j+l<0 || j+l>=w) continue;
                        if (s[i+k][j+l] == '#') count ++;
                    }
                }
                s[i][j] = '0' + count;
            }
        }
    }
    for (i=0; i<h; i++)
    {
        printf("%s\n", s[i]);
    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	long long a, b, k;
	cin >> a >> b >> k;
	for (int i = 0; i < k; i++) {
		if (i % 2 == 0) {
			b += a / 2;
			a /= 2;
		}
		else {
			a += b / 2;
			b /= 2;
		}
	}
	cout << a << " " << b << endl;
	return 0;
}

Measured memory_bytes: 256
a, b, c = map(int, input().split())
k = int(input())

for _ in range(k):
    if c <= max(a, b): c *= 2
    elif a >= b: b *= 2
    if a<b<c:
        ans = 'Yes'
        break
else:
    ans = 'No'
print(ans)


Measured memory_bytes: 9104
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define PI 3.141592
#define MOD7 1000000007
#define LL_INF 9000000000000000000
#define LL_MINF -9000000000000000000
#define INT_INF 2000000000
#define INT_MINF -2000000000
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};


int main(){
    int A;
    ull B, N;
    cin >> A >> B >> N;
    
    cout << A * min(B - 1, N) / B << endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    string str1,str2;
    char s;
    cin>>str1>>str2;
    for(ll i=0;i<str1.length();i++){
        s=str1[str1.length()-1];
        str1.erase(str1.length()-1,1);
        str1=s+str1;
        if(str1==str2){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
    return 0;
}


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

typedef long long ll;
typedef vector<ll> vl;

const int MOD = (ll)1e9 + (ll)7;
int N;
string str;
vector<vl> dp;
vl s;

void input_init(void) {
	cin >> N >> str;
	dp.resize(N + 1, vl(N + 1, (ll)0));
	dp[1][1] = (ll)1;
	s.resize(N + 1, (ll)0);
}

void solve(void) {
	for (int i = 2; i <= N; ++i) {
		for (int j = 0; j <= i; ++j)
			s[j] = (ll)0;
		if (str[i - 2] == '<') {
			for (int j = 1; j < i; ++j)
				s[j + 1] = (s[j + 1] + dp[i - 1][j]) % MOD;
		}
		else {
			for (int j = 1; j < i; ++j) {
				s[j + 1] = (s[j + 1] + MOD - dp[i - 1][j]) % MOD;
				s[1] = (s[1] + dp[i - 1][j]) % MOD;
			}
		}
		for (int j = 1; j <= i; ++j) {
			s[j] = (s[j - 1] + s[j]) % MOD;
			dp[i][j] = s[j];
		}
	}
}

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

	input_init();
	solve();

	ll ans = (ll)0;
	for (int j = 1; j <= N; ++j)
		ans = (ans + dp[N][j]) % MOD;

	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 70784
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define endl '\n'
#define PI acos(-1)
typedef long long ll;
using namespace std;
template<class Int>
Int gcd(Int a, Int b)
{
    return (b == 0 ? abs(a) : gcd(b, a % b));
}
int main()
{
    cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
#endif
    int n;
    ll ans = 0;
    string s;
    vector<int> r, g, b;
    cin >> n >> s;
    for(int i = 0; i < n; i++)
        switch(s[i])
        {
        case 'R':
            r.push_back(i);
            break;
        case 'G':
            g.push_back(i);
            break;
        case 'B':
            b.push_back(i);
        }
    for(int i = 0; i < r.size(); i++)
        for(int j = 0; j < g.size(); j++)
        {
            int ri = max(r[i], g[j]), le = min(r[i], g[j]), tmp = b.size();
            vector<int>::iterator k;
            if(2 * ri - le < n)
            {
                k = lower_bound(b.begin(), b.end(), 2 * ri - le);
                if(k != b.end() && *k == 2 * ri - le)
                    tmp--;
            }
            if(2 * le - ri >= 0)
            {
                k = lower_bound(b.begin(), b.end(), 2 * le - ri);
                if(k != b.end() && *k == 2 * le - ri)
                    tmp--;
            }
            int md = (ri - le) / 2;
            if(2 * md == ri - le)
            {
                k = lower_bound(b.begin(), b.end(), md + le);
                if(k != b.end() && md + le == *k)
                    tmp--;
            }
            ans += tmp;
        }
    cout << ans;
}

Measured memory_bytes: 3696
import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int y = sc.nextInt();
    double a = (double)(2*x - (double)(y/2));
    double b = (double)(y - (2*x)) /2;
    // System.out.println(a);
    // System.out.println(b);
    if(a<0 || b<0){
      System.out.println("No");
    }else{
      if(a != (int)a || b != (int)b){
        System.out.println("No");
      }else{
        System.out.println("Yes");
      }
    }
  }
}


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

using namespace std;

# define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, int> pdi;
typedef pair<ll, ll> pll;

# define S second
# define F first
# define kill(x) return(cout << x << endl, 0)
# define debug(x) cerr<< #x << " : " << x << endl
# define ddebug(x, y) cerr<< #x << " : " << x  << ", " << #y << " : " << y << endl
# define sz(s) (int)s.size()
# define sq(x) (x) * (x)
# define PB(x) push_back(x)
# define smax(x, y) (x) = max((x), (y))
# define smin(x, y) (x) = min((x), (y))
# define all(x) x.begin(), x.end()
# define SP fixed << setprecision(10)

const int MAXN = 100 * 1000 + 10;
vector <int> adj[MAXN],
       ans;

bool mark[MAXN];
void dfs(int u)
{
	ans.PB(u);
	mark[u] = true;
	for (int v : adj[u])
		if (!mark[v])
		{
			dfs(v);
			return;
		}
}

int32_t main()
{	
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	int n, m;
	cin >> n >> m;
	int u, v;
	for (int i = 0; i < m; i ++)
	{
		cin >> u >> v;
		u --, v --;
		adj[u].PB(v);
		adj[v].PB(u);
	}

	mark[u] = mark[v] = true;
	dfs(u);
	reverse(all(ans));
	dfs(v);

	cout << sz(ans) << endl;
	for (int a : ans)
		cout << a + 1 << " ";
	cout << endl;

	return 0;
}


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

using namespace std;

int main(void)
{
    int n;
    cin >> n;
    vector<int> a(n);
    unordered_set<int> b(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        b.insert(a[i]);
    }


    cout <<( a.size() == b.size() ? "YES" : "NO") << endl;

    return 0;
}


Measured memory_bytes: 8832
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n;
    cin >> n;
    VLL a(n),b(n);
    REP(i,0,n) cin >> a[i];
    REP(i,0,n) cin >> b[i];
    LL l = 0, r = 0;
    VLL bb;
    REP(i,0,n) {
        if (a[i] >= b[i]) l += a[i] - b[i];
        // else r += a[i] - b[i] - (a[i] - b[i]) % 2; 
        else bb.push_back(b[i] - a[i]); 
    }
    //dump(l);
    //dump(r);
    //if (l >= r * 2) cout << "Yes" << endl;
    //else cout << "No" << endl;
    if (bb.size() == 0) {
        if (l == 0) cout << "Yes" << endl;
        else cout << "No" << endl;
        return;
    }
    REP(i,0,bb.size()-1) {
        l -=  bb[i] / 2;
    }
    //dump(l);
    if (l <= bb[bb.size()-1] / 2) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=1010;
bool w[N][N*5],s[2][N*5];
int fa[N],a[N],v[N],sz[N];
inline int gi() {
    int x=0,o=1;
    char ch=getchar();
    while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
    if(ch=='-') ch=getchar(),o=-1;
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
int main() {
    int n;
    cin>>n;
    for(int i=2;i<=n;i++) fa[i]=gi();
    for(int i=1;i<=n;i++) a[i]=gi(),w[i][0]=1;
    for(int i=n;i;i--) {
	int l=sz[i],r=a[i],x=fa[i],t=a[i];
	while(~t&&!w[i][t]) --t;
	if(t<0) return puts("IMPOSSIBLE"),0;
	l-=t;
	memset(s,0,sizeof(s));
	for(int j=0;j<=a[x];j++) {
	    if(w[x][j]) {
		if(j+l<=a[x]) s[0][j+l]=1;
		if(j+r<=a[x]) s[1][j+r]=1;
	    }
	    w[x][j]=(s[0][j]|s[1][j]);
	}
	sz[x]+=l+r;
    }
    puts("POSSIBLE");
    return 0;
}

Measured memory_bytes: 4864
# abc117_a.py
# https://atcoder.jp/contests/abc117/tasks/abc117_a

# A - Entrance Examination /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# 明日の入学試験に合格するために、太郎くんはあと T時間の勉強をする必要があります。
# 幸いにも、彼は今いる世界(世界A)の X倍の速度で時間が進む世界Bへ世界跳躍(ワールドリープ)することができます。
# 世界Bで (X×t)時間進むと、世界Aでは t時間進みます。
# 世界Bで T時間勉強したとき、世界Aでは何時間進んでいるでしょうか。

# 制約
#     入力は全て整数である。
#     1≤T≤100
#     1≤X≤100

# 入力
# 入力は以下の形式で標準入力から与えられる。
# T X

# 出力
# 世界Aでは何時間進んでいるかを出力せよ。
# なお、想定解答との絶対誤差または相対誤差が 10−3以下であれば正解として扱われる。

# 入力例 1
# 8 3

# 出力例 1
# 2.6666666667

# 3倍の速度で時間が進む世界Bで 8 時間勉強すると世界Aでは 2.6666...時間進んでいます。
# 10^−3以下の絶対誤差・相対誤差が許容されることに注意してください。

# 入力例 2
# 99 1

# 出力例 2
# 99.0000000000

# 入力例 3
# 1 100

# 出力例 3
# 0.0100000000


def calculation(lines):
    # X = lines[0]
    # N = int(lines[0])
    T, X = list(map(int, lines[0].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i+1]))

    result = T/X

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['8 3']
        lines_export = ['2.6666666667']
    if pattern == 2:
        lines_input = ['99 1']
        lines_export = ['99.0000000000']
    if pattern == 3:
        lines_input = ['1 100']
        lines_export = ['0.0100000000']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()


Measured memory_bytes: 9084
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cassert>

using namespace std;

using ll = long long;

ll g(ll x) {
    ll b = 2;
    
    ll ret = 0;
    for (int i = 0; i < 60; i++) {
        ll y = x % b;
        
        if (i == 0) {
            if (x % 4 == 1 || x % 4 == 2) {
                ret = 1;
            }
        } else if (y >= b / 2 && y % 2 == 0) {
            ret = ret | (1LL << i);
        }
        
        b *= 2;
    }
    
    return ret;
}

int main() {
    ll a, b;
    
    cin >> a >> b;
    
    ll ans = 0;
    
    if (a != 0) {
        ans ^= g(a - 1);
    }
    
    ans ^= g(b);
    
    cout << ans << endl;
}


Measured memory_bytes: 888
s = input().rstrip()
if 9 < len(s) or s.replace('A','') != 'KIHBR':
  print('NO')
else:
  if 'KIH' not in s:
    print('NO')
  elif 2 < (s.index('B') - s.index('H')) or 2 < (s.index('R') - s.index('B')):
    print('NO')
  elif ('AAK' in s) or ('RAA' in s):
    print('NO')
  else:
    print('YES')


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

int main () {
  string s,t;
  cin >> s >> t;
  string u="";
  for (int i=0;i<s.size();i++) {
    u+=t[i];
  }
  if (s==u) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3580
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<cmath>
#include<cctype>
#include<set>
#include<queue>
#include<vector>
#include<map>
using namespace std;
typedef long long LL;

inline int read() {
	int x=0,f=1;char ch=getchar();for(;!isdigit(ch);ch=getchar())if(ch=='-')f=-1;
	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';return x*f;
}

int deg[100];

int main() {
//	freopen("a.in", "r", stdin);
	for (int i= 1; i <= 3; ++i) {
		deg[read()] ++;
		deg[read()] ++;
	}
	for (int i = 1; i <= 4; ++i) {
		if (deg[i] >= 3) {
			puts("NO"); return 0;
		}
	}
	puts("YES");


	return 0;
}


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

int main(){
  vector<vector<int> > c = { 
    {0, 0, 0},
    {0, 0, 0},
    {0, 0, 0}
  };
  rep(i, 3){
    rep(j, 3){
      cin >> c[i][j];
    }
  }

  bool ans = false;
  int a1, a2, a3, b1, b2, b3;
  rep(i, 101){
    a1 = i;
    b1 = c[0][0] - a1;
    b2 = c[0][1] - a1;
    b3 = c[0][2] - a1;
    a2 = c[1][0] - b1;
    a3 = c[2][0] - b1;

    if ((c[1][1] == a2 + b2) &&
        (c[1][2] == a2 + b3) &&
        (c[2][1] == a3 + b2) &&
        (c[2][2] == a3 + b3)){
      ans = true;
          break;
    }
  }
  if (ans == true){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

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

int main() {
    int n, cnt4=0, cnt2=0, cnt1=0;
    cin >> n;
    vector<ll>a(n);
    rep(i, 0, n){
        cin >> a[i];
        if(a[i]%4 == 0){
            cnt4++;
            continue;
        }
        if(a[i]%2 == 0){
            cnt2++;
            continue;
        }
        cnt1++;
    }
    if(cnt4 >= cnt1){
    cout << "Yes" << endl;
    }
    else if(cnt1-cnt4==1 && cnt2 == 0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 1024
fn main() {
    let n = read::<usize>();
    let s = read::<String>();
    let s = &s;
    let v: Vec<&str> = s.matches("ABC").collect();
    println!("{}", v.len());
}

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

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

bool cmp (const string a, const string b)
{
    return a < b;
}

int main(int argc, char const *argv[])
{
    ios::sync_with_stdio(false);
    int n, l;
    cin >> n >> l;
    string in[200];
    for (int i = 0; i < n ;i++)
        cin >> in[i];
    sort(in, in + n, cmp);
    for (int i = 0; i < n; ++i) 
        cout << in[i];
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ctype.h>
#include <string>
using namespace std;
 
 
int main(){
    int N;
    cin>>N;
    vector<int> A(N);
    for(int i=0;i<N;i++)cin>>A.at(i);

    sort(A.begin(),A.end());
    cout<<A.at(N-1)-A.at(0)<<endl;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

    static class ABetweenTwoIntegers {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int a = in.nextInt(), b = in.nextInt(), c = in.nextInt();
            out.println(a <= c && c <= b ? "Yes" : "No");
        }

    }
}



Measured memory_bytes: 23764
from collections import Counter

N = int(input())
A = [int(a) for a in input().split()]
count = Counter(A)
all_sum = 0
for key, val in count.items():
    all_sum += val * (val - 1)
all_sum //= 2

for k in range(N):
    num = count[A[k]]
    before = num * (num - 1) // 2
    after = (num - 1) * (num - 2) // 2
    print(all_sum - before + after)

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

int main() {
    string s;
    int k;
    cin >> s >> k;
    char ans='1';
    for (int i=0;i<k;i++) {
        if (s[i]!='1') {
            ans=s[i];
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>

int main(){
    char s[4];
    scanf("%s",s);
    int counta = 0;
    int countb = 0;
    int countc = 0;
    for(int i = 0; i < 3; i++){
        if(s[i] == 'a'){
            counta++;
        }else if(s[i] == 'b'){
            countb++;
        }else if(s[i] == 'c'){
            countc++;
        }
    }
    if(counta == 1 && countb == 1 && countc == 1){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define endl '\n'

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

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

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

ll N, M;
std::priority_queue<ll> pque;

int main() {
  std::cin >> N >> M;

  rep( i, N ) {
    ll A;
    std::cin >> A;
    pque.emplace( A );
  }

  rep( i, M ) {
    ll a = pque.top(); pque.pop();
    a /= 2;
    pque.emplace( a );
  }

  ll ans = 0;

  rep( i, N ) {
    ans += pque.top();
    pque.pop();
  }

  std::cout << ans << endl;

  return 0;
}

Measured memory_bytes: 4292
import java.io.*;

class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();

    while(true){
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int H = Integer.parseInt(str2[0]);
    int W = Integer.parseInt(str2[1]);

    if(H == 0 && W == 0) {break;}

    for (int i = 0; i < H; i++){
      for (int j = 0; j < W; j++){
        if (i % 2 == 0 && j % 2 == 0){
          sb.append("#");
        }
        else if (i % 2 == 0 && j % 2 == 1){
          sb.append(".");
        }
        else if (i % 2 == 1 && j % 2 == 0){
          sb.append(".");
        }
        else if (i % 2 == 1 && j % 2 == 1){
          sb.append("#");
        }
      }
      sb.append("\n");
    }
    sb.append("\n");
    }
    System.out.print(sb);
  }
}

Measured memory_bytes: 25488
d = int(input())
*C, = map(int, input().split())
S = [list(map(int, input().split())) for i in range(d)]
T = [int(input()) - 1 for i in range(d)]
L = [-1 for j in range(26)]
score = 0
for i in range(d):
    score += S[i][T[i]]
    L[T[i]] = i
    score -= sum([C[j] * (i - L[j]) for j in range(26)])
    print(score)


Measured memory_bytes: 9328
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;

int main() {

	int n;
	cin >> n;
	map<int, int> s;
	rep(i, n){
		int d;
		cin >> d;
		s[d]++;
	}
	int m;
	cin >> m;
	map<int, int> k;
	rep(i, m){
		int t;
		cin >> t;
		k[t]++;
	}

	bool ok = true;
	for(auto x : k){
		if(x.second > s[x.first]){
			ok = false;
			break;
		}
	}
	if(ok){
		cout << "YES" << endl;
	}
	else{
		cout << "NO" << endl;
	}

    return 0;
}


Measured memory_bytes: 18944
#include <stdio.h>

using namespace std;

void outPut(int Array[],char mark){
	for(int i = 1; i <= 13; i++){
		if(Array[i] == 0) printf("%c %d\n",mark,i);
	}
}

int main(){
	char mark[2];
	int n,S[14],H[14],C[14],D[14],tmp;
	for(int i = 0; i < 14; i++) S[i] = H[i] = C[i] = D[i] = 0;
	scanf("%d",&n);

	for(int i = 0; i < n; i++){
		scanf("%s %d",mark,&tmp);
		switch(mark[0]){
		case 'S':
			S[tmp] = 1;
			break;
		case 'H':
			H[tmp] = 1;
			break;
		case 'C':
			C[tmp] = 1;
			break;
		case 'D':
			D[tmp] = 1;
			break;
		}
	}
	outPut(S,'S');
	outPut(H,'H');
	outPut(C,'C');
	outPut(D,'D');
}


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

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

    while(1){
        bool flag = true;
        for(int p=2; p*p<=n; p++){
            if(n % p == 0){
                n += 1;
                flag = false;
                break;
            }
        }
        if(flag == true){
            cout << n << endl;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

int main() {
  int n;
  cin >> n;
  
  cout << (n & 1 ? n * 2 : n) << endl;

  
  return 0;
}

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

int main()
{
  int n;
  cin >> n;
  vector<int> l(n);
  for(int i = 0; i < n; i++)
  {
    cin >> l[i];
  }
  sort(l.begin(), l.end());
  int sum;
  for(int i = 0; i < n - 1; i++)
  {
    sum += l[i];
  }
  if (l[n-1] < sum) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <ios> 
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <map>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define sz(c) ((int)(c).size())

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
//const int MAX=;

int N;
ll K;
int d[40];
ll f(ll x){
	ll s=0;
	rep(j,40){
		if((x>>j) & 1)s+=(ll)exp2(j)*(N-d[j]);
		else s+=(ll)exp2(j)*d[j];
	}
	return s;
}


int main(){
	cin>>N>>K;
	
	rep(j,40)d[j]=0;
	rep(i,N){
		ll a;
		cin>>a;
		rep(j,40)d[j]+=(a>>j) & 1;
	}
	ll ans=f(K);
	int k[40],l[40];
	rep(j,40){
		k[j]=(K>>j) & 1;
		l[j]=0;
	}
	
	for(int j=39;j>=0;j--){
		ll p=0;
		if(k[j]==0) continue;
		for(int a=39;a>=j;a--)p+=exp2(a)*l[a];
		rep(a,j)if(d[a]<=N/2)p+=exp2(a);
      	ll pa=f(p);
      	if(ans<pa)ans=pa;
		l[j]=1;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
  int s, w, e, n;
  s = w = e =n =0;
  char a;
  while (scanf("%c",& a)!=EOF){
  
    if (a == 'S'){
      s++;
    }else if (a == 'W'){
      w++;
    }else if (a == 'E'){
      e++;
    }else if (a == 'N'){
      n++;
    }
  
  }
  if (s==0&&n>0){
    printf("No");
  }else if (n==0&&s>0){
    printf("No");
  }else if(e==0&&w>0){
    printf("No");
  } else if (w==0&&e>0){
    printf("No");
  }else{
    printf("Yes");
  }
    
  return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
 
public class Main {
    static final long MOD = 1000000007L;
    static final int INF = 50000000;
    static final int NINF = -50000000;
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);
        
        int D = sc.ni();
        int T = sc.ni();
        int S = sc.ni();
        if (T*S>=D) {
        	pw.println("Yes");
        } else {
        	pw.println("No");
        }
        pw.close();
    }
 
    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
 
        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int ni() {
            return Integer.parseInt(next());
        }
 
        long nl() {
            return Long.parseLong(next());
        }
 
        double nd() {
            return Double.parseDouble(next());
        }
 
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

Measured memory_bytes: 32864
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

#define rep(i, a, n) for(int i = a; i < (n); ++i)
#define ll long long

template<class T, class U>
struct P { T a; U b; };

bool Comp(P<ll, ll>& a, P<ll, ll>& b)
{
  return a.a < b.a;
}

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

  vector<P<ll, ll>> ab(n);
  rep(i, 0, n) cin >> ab[i].a >> ab[i].b;
  sort(ab.begin(), ab.end(), Comp);
  
  ll a, b, ans = 0;
  rep(i, 0, n)
  {
    a = ab[i].a; 
    b = ab[i].b;
    if (m <= b)
    {
      ans += m * a;
      break;
    }
    if (m > b)
    {
      m -= b;
      ans += a * b;
    }
  }
  printf("%lld\n", ans);
}

Measured memory_bytes: 1792
#include <iostream>
#include <math.h>

using namespace std;

int main(){
    string s, t;
    cin >> s >> t;
    int N = s.size(), ans = 0;
    for(int i = 0; i < N; i++){
        if(s[i] != t[i]) ans++;
    }
    cout << ans << endl;
    return(0);
}

Measured memory_bytes: 3916
#include <iostream>
#include <climits>
#include <algorithm>
using namespace std;
typedef long long ll;

// 入力
ll n, W;
ll weight[110], value[110];

// DPテーブル
ll dp[110][101000];

int main() {
	cin >> n >> W;
	for (int i = 0; i < n; i++) cin >> weight[i] >> value[i];

	// DPループ　前から今ではなく、今から次を考えるときはiは0~n-1の範囲を動くようにする
	for (int i = 0; i < n; i++) {
		for (ll w = 0; w <= W; w++) {
			if (w < weight[i]) {
				dp[i + 1][w] = dp[i][w];
			}
			else {
				dp[i + 1][w] = max(dp[i][w - weight[i]] + value[i], dp[i][w]);
			}
		}
	}

	cout << dp[n][W] << endl;
}


Measured memory_bytes: 79360
#include <cstdio>

char G[55][55];

int h,w;
bool judge(int x,int y){
	if(G[x-1][y] == '#') return 1;
 	if(G[x][y-1] == '#') return 1;
	if(G[x+1][y] == '#') return 1;
 	if(G[x][y+1] == '#') return 1;
	return 0;
}
int main(){
	scanf("%d%d",&h,&w);
	for(int i = 1;i <= h;i++){
		scanf("%s",G[i]);
	}
	for(int i = 1;i <= h;i++){
		for(int j = 1;j <= w;j++){
			if(G[i][j] != '#') continue;
			else {
				if(judge(i,j)) continue;
				else {
					printf("No");
					return 0;
				};
			}
		}
	}	
	printf("Yes");
	return 0;
} 

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

//--> definitions
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=b-1;i>=a;i--)

//--> typedef
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<pii,int> piii;
typedef tuple<int,int,int> tiii;

#define MP make_pair
#define PB push_back
#define fi first
#define se second
#define INF 1e9

const int maxN = 1e4+11;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
    
    int a,b,c;
    cin>>a>>b>>c;
    int cnt1=0,cnt2=0;
    if(a==5) cnt1++;
    if(b==5) cnt1++;
    if(c==5) cnt1++;
    if(a==7) cnt2++;
    if(b==7) cnt2++;
    if(c==7) cnt2++;
    
    if(cnt1==2 && cnt2==1) cout<<"YES\n";
    else cout<<"NO\n";


	return 0;
}

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

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PI;

int main() {
	int n;
	cin >> n;
	map<char, LL> mp;
	char c[5] = { 'M','A','R','C','H' };
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		mp[s[0]]++;
	}

	LL ans = 0;
	for (int i = 0; i < 5; i++) {
		for (int j = i + 1; j < 5; j++) {
			for (int k = j + 1; k < 5; k++) {
				ans += mp[c[i]] * mp[c[j]] * mp[c[k]];
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
vector<int> G[100100];
vector<int> color(100100, 0);
vector<int> memo(100100, -10);

void dfs(int v, int d, int c) {
    if(memo[v] >= d) return;
    if(d < 0) return;

    if(!color[v]) color[v] = c;
    memo[v] = d;
    for(int to : G[v]) {
        dfs(to, d - 1, c);
    }
}

int main() {
    int N, M;
    cin >> N >> M;
    for(int i=0; i<M; ++i) {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    int Q;
    cin >> Q;
    vector<int> v(Q), d(Q), c(Q);
    for(int i=Q - 1; i>=0; --i) {
        cin >> v[i] >> d[i] >> c[i];
    }
    
    for(int i=0; i<Q; ++i) {
        dfs(v[i], d[i], c[i]);
    }

    for(int i=1; i<=N; ++i) cout << color[i] << endl;
    return 0;
}

Measured memory_bytes: 8440
#include<bits/stdc++.h>
#define ll long long int 
#define mod 1000000007
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	ll n;
	cin>>n;
	double nn,ans;
	nn=n;
	ans=nn/3;
	cout<<fixed<<setprecision(10);
	cout<<ans*ans*ans;
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int A=sc.nextInt();
		int B=sc.nextInt();
		int a=0;
		for(int i=A;i<=B;i++) {
			if(i/1000==i%10*10+i%100/10) {
				a=a+1;
			}
		}
		System.out.println(a);
	}
}

Measured memory_bytes: 23124
#include <iostream>
#include <sstream>
#include <bitset>
#include <memory>
#include <string>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <deque>
#include <algorithm>
#include <random>
#include <iomanip>

using namespace std;

int main(int argc, char *argv[]) {
	int x, y, a, b, c;
	cin >> x >> y >> a >> b >> c;
	vector<long long int> va, vb, vc;
	for (int i = 0; i < a; i++) {
		long long int t;
		cin >> t;
		va.push_back(t);
	}
	for (int i = 0; i < b; i++) {
		long long int t;
		cin >> t;
		vb.push_back(t);
	}
	for (int i = 0; i < c; i++) {
		long long int t;
		cin >> t;
		vc.push_back(t);
	}
	sort(va.begin(), va.end(), greater<long long int>());
	sort(vb.begin(), vb.end(), greater<long long int>());
	long long int res = 0;
	res = accumulate(va.begin(), va.begin() + x, res);
	res = accumulate(vb.begin(), vb.begin() + y, res);
	priority_queue<long long int, vector<long long int>, greater<long long int>> pqa(va.begin(), va.begin() + x), pqb(vb.begin(), vb.begin() + y);
	for (int i = 0; i < c; i++) {
		if (vc[i] > min(pqa.top(), pqb.top())) {
			if (pqa.top() < pqb.top()) {
				res += vc[i] - pqa.top();
				pqa.pop();
				pqa.push(vc[i]);
			} else {
				res += vc[i] - pqb.top();
				pqb.pop();
				pqb.push(vc[i]);
			}
		}
	}
	cout << res << endl;

}









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

template <typename T> T gcd(T x, T y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}

template <typename T> T lcm(T x, T y) {
  if (x == 0 || y == 0)
    return 0;
  return x / gcd(x, y) * y;
}

int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}

vector<int> p;
vector<int> r;

void init(int n) {
  p.reserve(n);
  r.reserve(n);
  for (int i = 0; i < n; i++) {
    p[i] = i;
    r[i] = 0;
  }
}

int root(int x) { return p[x] == x ? x : p[x] = root(p[x]); }

bool same(int x, int y) { return root(x) == root(y); }

void unite(int x, int y) {
  x = root(x);
  y = root(y);
  if (x == y)
    return;

  if (r[x] < r[y])
    p[x] = y;
  else {
    p[y] = x;
    if (r[x] == r[y])
      r[x]++;
  }
}

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  long cnt = 0;
  for (auto &x : a) {
    cin >> x;
    int tmp = x;
    while (tmp > 0 && tmp % 2 == 0) {
      cnt++;
      tmp /= 2;
    }
  }
  cout << cnt << endl;
}


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

class Program
{

    static void Main(string[] args)
    {
        ProblemC(args);
    }

    static void ProblemC(string[] args)
    {
        bool[] S = System.Console.ReadLine().Select(
            (c) => {
                if(c == '1')
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }).ToArray();
        int length = S.Length;

        bool[] pattern0 = MakePattern(length, false);
        bool[] strXor0 = StrXor(S, pattern0);
        int count0 = strXor0.Count((b) => b );

        bool[] pattern1 = MakePattern(length, true);
        bool[] strXor1 = StrXor(S, pattern1);
        int count1 = strXor1.Count((b) => b);

        int ans = Math.Min(count0, count1);
        System.Console.WriteLine(ans.ToString());

    }

    static bool[] StrXor(bool[] s1, bool[] s2)
    {
        bool[] ans = new bool[s1.Length];
        for(int i = 0; i<s1.Length; i++)
        {
            ans[i] = s1[i] ^ s2[i];
        }

        return ans;
    }

    static bool[] MakePattern(int length, bool first)
    {
        bool[] ans = new bool[length];
        bool item = first;
        for (int i = 0; i < length; i++)
        {
            ans[i] = item;
            item ^= true; 
        }

        return ans;
    }
}

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

//#include "rubo.h"
//#define mp make_pair
//#define pb push_back
#define in int
#define ll long long
#define vc vector
#define SQ(j) (j)*(j)
//#define x first
//#define y second

//#define ld long double
#define dbl  long double
#define pll pair<long long,long long>
#define pii pair<int,int>
#define all(j) j.begin(), j.end()
#define loop(xxx, yyy) for(int xxx = 0; xxx < yyy; xxx++)
//#define printf(fmt, ...) (0)
//#define HOME
//#define y0 ngacaleiebinvoaeu
//#define y1 gnarpipipaigare
#define j1 adsfndnasfafoasp

#define db(x) cout << #x << " = " << x << endl
#define dbCont(x) cout << #x << ": "; for(auto shun: x) cout << shun << ' '; cout << endl;

typedef long double ld;

using namespace std;


const int N = 3000+5;

string s,t;
int dp[N][N];


int main() {

    cin >> s >> t;


    s = "#"+s;
    t = "#"+t;

    int len = 0;

    for(int i = 1; i < s.length(); i++){
        for(int j = 1; j < t.length(); j++){
            dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
            if(s[i] == t[j]) dp[i][j] = max(dp[i][j],dp[i-1][j-1]+1);

            len = max(len, dp[i][j]);

//            cout << dp[i][j] << ' ';
        }
//        cout << endl;
    }

    int i = s.length()-1;
    int j = t.length()-1;

    string res = "";

    while(! (j == 0 && i == 0)){

        if(i-1 >= 0 && j-1 >= 0 && dp[i-1][j-1]+1 == dp[i][j] && s[i] == t[j]){
            res.push_back(s[i]);
            i--,j--;
        } else if(i-1 >= 0 && dp[i-1][j] == dp[i][j]){
            i--;
        } else {
            j--;
        }
    }

//    cout << len << endl;

    reverse(all(res));
    cout << res << endl;


    // qwertyuiopasdfghjklzxcvbnmqwertyuiopqwertyuiopasdfghjklzxcvbnmqwertyuiopqwertyuiopasdfghjklzxcvbnmqwertyuiopqwertyuiopasdfghjklzxcvbnmqwertyuiopqwertyuiopasdfghjklzxcvbnmqwertyuiopqwertyuiopasdfghjklzxcvbnmqwertyuiopqwertyuiopasdfghjklzxcvbnmqwertyuiopqwertyuiopasdfghjklzxcvbnmqwertyuiop

    return 0;
}


Measured memory_bytes: 35456
io = STDIN
$n=io.gets.to_i
$c,$s,$f=[],[],[]
($n-1).times do |i|
  $c[i],$s[i],$f[i]=io.gets.split.map(&:to_i)
end
def calc(t,i)
  if t<$s[i]
    $s[i]+$c[i]
  elsif (t-$s[i])%$f[i]==0
    t+$c[i]
  else
    $s[i]+$f[i]*((t-$s[i])/$f[i]+1)+$c[i]
  end
end
(0...($n-1)).each do |i|
  t=0
  (i...($n-1)).each do |j|
    t=calc(t,j)
  end
  puts t
end
puts 0

Measured memory_bytes: 1788
import java.util.HashSet;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        
        HashSet<String> set = new HashSet<>();
        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < n; i++){
            String command = sc.next();
            switch (command) {
                case "insert":
                    set.add(sc.next());
                    break;
                case "find":
                    if(set.contains(sc.next())){
                        sb.append("yes").append(System.lineSeparator());
                    }else{
                        sb.append("no").append(System.lineSeparator());
                    }
                    break;
            }
        }
        
        System.out.print(sb);
    }
}


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



int calc(int n){
	int count=0;
	int head=2;
	int len=(n+1);
	int sq=sqrt((double)n);
	int *L=(int*)malloc(len*sizeof(int));

	for(int i=0;i<len;i++){
		L[i]=1;
	}
	L[0]=-1;
	L[1]=-1;

	
	for(int i=2;i<=sq;i++){
		if(L[i]==1){
			for(int j=(i*2);j<len;j+=i){
				L[j]=-1;
			}
		}
	}

	for(int i=0;i<len;i++){
		if(L[i]==1){count++;}
	}

	return count;
}

int main(void){
	int n;

	while(scanf("%d",&n)!=EOF){
		printf("%d\n",calc(n));
	}

    return 0;
}


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

#define INF 999999999
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define MOD(x) (x%(mod))
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int>pi;

/*---------------------------------------------------*/

int change(string s){
  int sum=0;
  rep(i,s.size()){
    if(s[i]!='m'&&s[i]!='c'&&s[i]!='x'&&s[i]!='i'){
      int tmp=s[i]-'0';
      if(i+1<s.size()){
	if(s[i+1]=='m'){tmp*=1000;i++;}
	else if(s[i+1]=='c'){tmp*=100;i++;}
	else if(s[i+1]=='x'){tmp*=10;i++;}
	else if(s[i+1]=='i'){tmp*=1;i++;}
      }
      sum+=tmp;
    }else{   
      if(s[i]=='m')sum+=1000;
      else if(s[i]=='c')sum+=100;
      else if(s[i]=='x')sum+=10;
      else if(s[i]=='i')sum+=1;
    }
  }
  return sum;
}

void mcxi(int n){
  char c[4]={'m','c','x','i'};
  int num[4]={0};
  for(int i=3;i>=0;i--){
    num[i]=n%10;
    n/=10;
  }
  for(int i=0;i<4;i++){
    if(num[i]!=0){
      if(num[i]!=1)cout<<num[i]<<c[i];
      else cout<<c[i];
    }
  }
  cout<<endl;
}

int main(){
  int n;
  string s,ss;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>s>>ss;
    int a=change(s);
    int b=change(ss);
    mcxi(a+b);
  }
  return 0;
}

Measured memory_bytes: 3040
# -*- coding:shift-jis -*-

class Dice:

	def __init__(self):
		self.top = 1
		self.south = 2
		self.north = 5
		self.east = 3
		self.west = 4
		self.bottom = 6

	def rotate(self,operation):
		if operation == "North":
			self.top,self.north,self.bottom,self.south = self.south,self.top,self.north,self.bottom
		elif operation == "East":
			self.top,self.east,self.bottom,self.west = self.west,self.top,self.east,self.bottom
		elif operation == "West":
			self.top,self.east,self.bottom,self.west = self.east,self.bottom,self.west,self.top
		elif operation == "South":
			self.top,self.north,self.bottom,self.south = self.north,self.bottom,self.south,self.top
		elif operation == "Right":
			self.north,self.east,self.south,self.west = self.west,self.north,self.east,self.south
		elif operation == "Left":
			self.north,self.east,self.south,self.west = self.east,self.south,self.west,self.north,

n = int(input())

while n!=0:
	inputs = [input() for _ in range(n)]
	value = 1
	d = Dice()
	for i in inputs:
		d.rotate(i)
		value += d.top
	print(value)
	n = int(input())

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

int main()
{
	int K, X;
	scanf("%d%d", &K, &X);
	for (int i{X - K + 1}; i < X + K; i++)
		printf("%d%c", i, i + 1 == X + K? '\n': ' ');

	return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
student = [tuple(map(int, input().split())) for _ in range(n)]
check_points = [tuple(map(int, input().split())) for _ in range(m)]
for a, b in student:
    dst_min = float('inf')
    ans = float('inf')
    for i, (c, d) in enumerate(check_points):
        now = abs(a - c) + abs(b - d)
        if now < dst_min:
            dst_min = now
            ans = i + 1
    print(ans)


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

#define lpsbd(i, s, b, d) for(size_t i = (s); i < (b); i+=(d))
#define lpsb(i, s, b) for(size_t i = (s); i < (b); i++)
#define lpn(i, n) for(size_t i = 0; i < (n); i++)
#define fa(i, x) for(auto &i: x)
#define vcd(t, n, d) vector<t>(n, d)
#define vc(t, n) vector<t>(n)
#define all(x) (x).begin(), (x).end()

using namespace std;
using ll = long long;

const ll MOD = 1000000007;

int main(void)
{
    int N;
    cin >> N;
    auto ans = (double)((N+1)/2)/(double)N;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
"use strict";
    
const isUpperCase = c => {
  return /^[A-Z]+$/g.test(c)
}

const main = arg => {
    arg = arg.trim().split("\n");
    const A = (arg[0].split(" ")[0]);

    console.log(isUpperCase(A) ? "A" : "a");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 29680
#include <cstdio>
#include <cmath>
#include <cstring>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int bit[100100];
int N, P;

void add(int k, int x)
{
    for (; k <= N + 1; k += k & -k){
        bit[k] = (bit[k] + x) % P;
    }
}

int sum(int k)
{
    int ret = 0;
    for (; k; k &= (k - 1)){
        ret = (ret + bit[k]) % P;
    }
    return (ret);
}

bool radix(int a, int b)
{
    if ((int)log10(a) == (int)log10(b)) return (a < b);
    return (to_string(a) < to_string(b));
}

int main()
{
    int A, B;
    int v[100000];

    while (scanf("%d %d %d", &A, &B, &P) && A){
       memset(bit, 0, sizeof(bit));
       N = B - A + 1;
       add(N + 1, 1);

       for (int i = 0; i < N; i++){
           v[i] = A + i;
        }

       sort(v, v + N, radix);

       for (int i = N - 1; i >= 0; i--){
           int nv = (sum(N + 1) - sum(v[i] - A) + P) % P;
           add(v[i] - A + 1, nv);
       }

       printf("%d\n", sum(N));
    }

    return (0);
}

Measured memory_bytes: 1908
/* while(!cin.eof()) */
 
#include<bits/stdc++.h>
using namespace std; 
#define int long long 
#define mod 998244353
#define endl '\n'
#define MAXI (int)(3e17+10)
#define N 1000005


// Driver code to test above functions
int32_t main()
{
  
     
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);

    int n, ans = 0;
    cin >> n;
    map<int, int> mp;
    for(int i=1;i<=n;i++)
    {
        int x;
        cin >> x;

        ans += mp[i-x];

        mp[i+x]++;
    }

    cout << ans;

    return 0;

} 


Measured memory_bytes: 26392