akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,n,s) for(int i = s; i < (n); ++i)
#define rsrep(i,n,s) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<x<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;

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

    ll ans = 0;
    if (n*2 <= m) {
        ans += n;
        m -= n*2;
        ans += m/4;
    } 
    else {
        ans += m/2;
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdint>
int main()
{
	uint64_t n = 0;
    std::cin >> n;
	uint64_t result = 0;
	for (uint64_t i = 1; i <= n; ++i) {
		if (i % 3==0) continue;
		if (i % 5 == 0) continue;
		result += i;
	}
	std::cout << result << std::endl;
	return 0;
}


Measured memory_bytes: 3192
#include<stdio.h>
#include<stdlib.h>
int N,I[30][2],i,h;
int c(const void *a,const void *b)
{
	int *x=(int*)a;
	int *y=(int*)b;
	return x[1]==y[1]?x[0]-y[0]:x[1]-y[1];
}
int main()
{
	for(;scanf("%d",&N),N;)
	{
		for(i=0;i<N;i++)
			scanf("%d%d",&I[i][0],&I[i][1]);
		qsort(I,N,sizeof(int[2]),c);
		for(i=h=0;i<N&&h+I[i][0]<=I[i][1];)
			h+=I[i++][0];
		puts(i==N?"Yes":"No");
	}
	return 0;
}

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

using namespace std;
using ll  = long long;
template <typename T> T In() {
    T t;
    cin >> t;
    return t;
}
template <typename T> vector<vector<T>> Vec2(int i, int j, T ini = 0) {
    vector<vector<T>> vec(i, vector<T>(j, ini));
    return move(vec);
}
template <typename T> vector<vector<vector<T>>> Vec3(int i, int j, int k, T ini = 0) {
    vector<vector<vector<T>>> vec(i, vector<vector<T>>(j, vector<T>(k, ini)));
    return move(vec);
}

int main() { 
    int N = In<int>();
    int D = In<int>();
    cout << (N + 2 * D) / (2 * D + 1) << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String str;
        int i,num;
        int a;
        int[] s = new int[13];
        int[] h = new int[13];
        int[] c = new int[13];
        int[] d = new int[13];
        str = scan.nextLine();
        a = Integer.valueOf(str);
        for(i = 0; i < a; i++){
            str = scan.nextLine();
            String[] card = str.split(" ", 0);
            num = Integer.valueOf(card[1]);
            switch(card[0]){
                case "S":
                    s[num-1] = 1;
                    break;
                case "H":
                    h[num-1] = 1;
                    break;
                case "C":
                    c[num-1] = 1;
                    break;
                case "D":
                    d[num-1] = 1;
                    break;
            }
        }

        for(i = 0; i < 13; i++){
            if(s[i] != 1){
                System.out.println("S "+(i+1));
            }
        }
        for(i = 0; i < 13; i++){
            if(h[i] != 1){
                System.out.println("H "+(i+1));
            }
        }
        for(i = 0; i < 13; i++){
            if(c[i] != 1){
                System.out.println("C "+(i+1));
            }
        }
        for(i = 0; i < 13; i++){
            if(d[i] != 1){
                System.out.println("D "+(i+1));
            }
        }
        //System.out.println();
        scan.close();
    }
}


Measured memory_bytes: 26144
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>
#include <cstdlib>
#include <map>
#include <queue>
#include <algorithm>
#include <stack>
#include <functional>
#define rep(i,j,n) for(i=j;i<(n);i++)
#define rrep(i,j,n) for(i=j;i>(n);i--)
typedef long long int lli;
#define N 1000000007

using namespace std;

//lli gcd(lli a,lli b){
//    lli x,y;
//    x=max(a,b);
//    y=min(a,b);
//    if(x%y==0){
//        return y;
//    }
//    else{
//        return gcd(y,x%y);
//    }
//}
//
//lli lcm(lli a,lli b){
//    lli x,y;
//    x=max(a,b);
//    y=min(a,b);
//    return x*y/gcd(x,y);
//}

int main(){
    lli n,l,ans=0;
    vector<lli> vec;
    lli i,j,k;
    cin>>n;
    rep(i,0,n){
        cin>>l;
        vec.push_back(l);
    }
    sort(vec.begin(),vec.end(),greater<>());
    rep(i,0,n-2){
        rep(j,i+1,n-1){
            rep(k,j+1,n){
//                cout<<vec[i]<<" "<<vec[j]<<" "<<vec[k]<<endl;
                if(vec[i]<vec[j]+vec[k]){
                    ans++;
                }
                else{
                    break;
                }
            }
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int c[4][4];
  for(int i=1;i<=3;i++)for(int j=1;j<=3;j++)cin>>c[i][j];
  for(int i=-500;i<=500;i++){
    for(int j=1;j<=3;j++){
      int a1=i;int b1=c[1][1]-a1,b2=c[1][2]-a1,b3=c[1][3]-a1;int a2=c[2][j]-b1,a3=c[3][j]-b1;
      if(a2+b1==c[2][1]&&a3+b1==c[3][1]&&a2+b2==c[2][2]&&a2+b3==c[2][3]&&a3+b2==c[3][2]&&a3+b3==c[3][3]){
        cout<<"Yes"<<endl;
        return 0;
      }
    }
  }
  cout<<"No"<<endl;
}

Measured memory_bytes: 256
'use strict'
function main(input) {
  input = input.trim().split('\n')
  const HW = input.shift().split(' ').map(v => Number(v))
  input = input.map(r => r.split(''))
  const newArray = new Array(HW[0]).fill(new Array(HW[1]).fill(0));
  const L = JSON.parse(JSON.stringify(newArray)) 
  const R = JSON.parse(JSON.stringify(newArray))
  const U = JSON.parse(JSON.stringify(newArray))
  const D = JSON.parse(JSON.stringify(newArray))
  let max = 0
  for (let h = 0; h < HW[0]; h++) {
    for (let w = 0; w < HW[1]; w++) {
      if (input[h][w] === '.') {
        L[h][w] = w === 0 ? 1 : L[h][w-1] + 1
        U[h][w] = h === 0 ? 1 : U[h-1][w] + 1
      }
    }
  }
  for (let h = HW[0] - 1; h >= 0; h--) {
    for (let w = HW[1] - 1; w >= 0; w--) {
      if (input[h][w] === '.') {
        R[h][w] = w === HW[1] - 1 ? 1 : R[h][w+1] + 1
        D[h][w] = h === HW[0] - 1 ? 1 : D[h+1][w] + 1

        const sum = L[h][w] + R[h][w]+ U[h][w] + D[h][w] - 3
        if (sum > max) max = sum
      }
    }
  }
  console.log(max)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


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

using namespace std;

int main() {
    int n, m;

    cin >> n >> m;

    vector<vector<int>> to(n);

    int l, r;

    for(int i = 0; i < m; ++i) {
        cin >> l >> r;
        to.at(l - 1).push_back(r);
        to.at(r - 1).push_back(l);
    }

    vector<int> p(n);
    queue<int> q;
    p.at(0) = -1;
    q.push(1);
    int room = n;

    while(!q.empty()) {
        for(int next: to.at(q.front() - 1)) {
            if(p.at(next - 1) == 0) {
                p.at(next - 1) = q.front();
                q.push(next);
            }
        }
        q.pop();
        --room;
    }

    if(room != 0) printf("No\n");
    else {
        printf("Yes\n");
        for(int i = 1; i < n; ++i) printf("%d\n", p.at(i));
    }
    
    return 0;
}

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

main(){
  string S ;
  cin >> S ;
  if(S[0] == S[1]){
    if(S[0] == S[2]){
      cout << "No" ;
      return 0 ;
    }
  }
  cout << "Yes" ;
  return 0 ;
}

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

using namespace std;

#define pb push_back
#define endl "\n"
#define all(x) x.begin(), x.end()
#define ll long long

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

	int n;
	cin >> n;
	vector<int> v(n);
	for(int i = 0; i < n; i++) {
		cin >> v[i];
	}
	int cnt = 0;
	for(int i = 1; i < n - 1; i++) {
		if(v[i] < v[i - 1] && v[i] > v[i + 1]) {
			cnt++;
		} else if(v[i] > v[i - 1] && v[i] < v[i + 1]) {
			cnt++;
		}
	}
	cout << cnt << "\n";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define MOD 1000000007
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define ALL(v) v.begin(), v.end()
typedef long long ll;



int main(){
    int x;cin >> x;
    if(x<1200)cout << "ABC" <<endl;
    else cout << "ARC" << endl;
    return 0;
}



Measured memory_bytes: 256
function Main(input) {
  let args = input.trim().split("\n");

  let n = args.length;
  for (let i = 0; i < n; i++) {
    let tmp = args[i].split(" ").map((x) => parseInt(x, 10));
    let x = tmp[0];
    let y = tmp[1];
    if (x === 0 && y === 0) {
      break;
    }
    if (x > y) {
      // 分割代入による swap
      [x, y] = [y, x];
    }
    console.log(x, y);
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 20980
#include <bits/stdc++.h>
using namespace std;
#define ld double
#define ll long long
#define pb emplace_back
#define mk make_pair
#define mod 1000000007
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) x.begin(),x.end()
ll power(ll a, ll b) {ll res = 1; a = a % mod; while (b) {if (b & 1)res = (res * a) % mod; a = (a * a) % mod; b /= 2;} return res;}
ll invmod(ll a) {return power(a, mod - 2);}
int main(void)
{
	FIO
	int t = 1;
	// cin >> t;
	while (t--)
	{
		ll n, x, T;
		cin >> n >> x >> T;
		x = (n + x - 1) / x;
		T *= x;
		cout << T << '\n';
	}
	return 0;
}

Measured memory_bytes: 3608
#include<iostream>
using namespace std;
int main()
{
  string a;
  getline(cin,a);
  int length=a.length();
  for(int i=0;i<length;i++)
  {
        if(i==0)
      {
          cout<<a[i];
      }
      else if(a[i]==' ')
         {
           cout<<a[i+1];
         }
  }








    return 0;
}


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


int main(){
    char c;cin>>c;
    int a=c-'A';
    if(a>=0&&a<=25){
        cout<<'A'<<endl;
        
    }
    else cout<<'a'<<endl;
    
}

    









Measured memory_bytes: 3632
#include "bits/stdc++.h"
using namespace std;

int main() {
	string s;
	cin >> s;
	int a = count(s.begin(), s.end(), 'a');
	int b = count(s.begin(), s.end(), 'b');
	int c = count(s.begin(), s.end(), 'c');
	
	if (a == b) {
		if (c == a || c == a + 1 || c == a - 1) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	else if (b == c) {
		if (a == b || a == b + 1 || a == b - 1) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	else if (c == a) {
		if (b == a || b == a + 1 || b == a - 1) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	else {
		cout << "NO" << endl;
	}
}

Measured memory_bytes: 512
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)

int main()
{
    int S;
    cin >> S;
    if (0 < S / 100 && S / 100 < 13)
    {
        if (0 < S % 100 && S % 100 < 13)
        {
            cout << "AMBIGUOUS";
        }
        else
        {
            cout << "MMYY";
        }
    }
    else if (0 < S % 100 && S % 100 < 13)
    {
        cout << "YYMM";
    }
    else
    {
        cout << "NA";
    }
}

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

#define sz(x) int(x.size())
#define pii pair<int, int>
#define Task "abc"
#define For(i, a, b) for(int i = (a), _b = (b); i <= b; ++i)
#define Debug(X) cout << #X << " = " << X << '\n'
#define All(x) (x).begin(), (x).end()
#define mp make_pair

typedef unsigned long long ull;
typedef long long ll;

const int maxn = 1e5 + 10;
const int inf = 0x3f3f3f3f;
const ll mod = 1e9 + 7;

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
//  freopen(Task".inp", "r", stdin);
//  freopen(Task".out", "w", stdout);
  string s;
  cin >> s;
  map<char,int> m;
  for (auto c : s) m[c]++;
  if ((int)m.size() == 2) cout << "Yes";
  else cout << "No";

}



Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int N;
int A[10000], B[10000];
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N;
  long long X = 0;
  rep(i, N) cin >> A[i], X -= A[i];
  rep(i, N) cin >> B[i], X += B[i];
  rep(i, N) {
    int t = A[i];
    if (A[i] < B[i]) t = B[i]+((A[i]+B[i])%2);
    X -= t-B[i];
  }
  cout << (X>=0?"Yes":"No") << "\n";
  return 0;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> P(N);
  for(int i=0;i<N;i++){
    cin >> P.at(i);
  }
  sort(P.begin(),P.end());
  int sum = 0;
  for(int i=0;i<N;i++){
    if(i == N-1)
      sum += P.at(N-1)/2;
    else
    sum += P.at(i);
  }
  cout << sum;
}

Measured memory_bytes: 256
/*
	
	@Raghul
*/
#include <bits/stdc++.h> 
using namespace std; 
#define ll long long
ll ans[100005];
ll fastpow(ll a,ll b){
	if(b==0)
		return 1LL;
	ll temp=fastpow(a,b/2);
	temp=temp*temp;
	if(b%2==1)
		temp=temp*a;
	return temp;
}	
int main(){ 
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    if(n==3||n==5||n==7){
    	cout<<"YES";
    }
    else	cout<<"NO";
    return 0;
} 

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

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

    int n, s;
    cin >> n >> s;
    vector<int> a(n);
    REP(i, n) cin >> a[i];

    vector<vector<ll> > dp(n + 1, vector<ll>(s + 1, 0));

    dp[0][0] = 1;

    REP(i, n) REP(j, s + 1) {
        dp[i + 1][j] += dp[i][j] * 2;
        dp[i + 1][j] %= 998244353;
        if (j + a[i] <= s) {
            dp[i + 1][j + a[i]] += dp[i][j];
            dp[i + 1][j + a[i]] %= 998244353;
        }
    }

    cout << dp[n][s] << '\n';
    return 0;
}


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

typedef long long llong;
int n, k;
int T[100000];
int check(llong p)
{
    int i = 0;
    for(int j=0; j<k; j++)
    {
        int s = 0;
        while(s + T[i] <= p)
        {
            s += T[i];
            i++;
            if(i == n)    return n;
        }
    }
    return i;
}
int solve()
{
    llong left = 0;
    llong right = 100000*10000;
    llong mid;
    while(right - left > 1)
    {
        mid = (left+right)/2;
        int v = check(mid);
        if(v >= n)   right = mid;
        else         left = mid;
    }
    return right;
}
int main()
{
    cin >> n >> k;
    for(int i=0; i<n; i++)
        cin >> T[i];
    llong ans = solve();
    cout << ans << endl;
}

Measured memory_bytes: 3496
#include <iostream>
#include <cmath>
#include <limits>
using namespace std;

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

  long result = 1;
  long denom = pow(10, 9) + 7;

  for (int i=1; i<=N; i++) {
    result *= i;
    result %= denom;
  }
  cout << result << endl;
}


Measured memory_bytes: 256
N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])

dp = [0, 1]
for i in range(N):
    if i+1 in A: dp.append(0)
    else: dp.append(dp[i]+dp[i+1])
print(dp[N+1]%1000000007)

Measured memory_bytes: 460020
#include<iostream>
#include<cstring>
#include<vector>
#include <set>
#include<algorithm>
using namespace std;
long int a[200005];
long int n,k;
int main()
{
	cin >> n >> k;
	for (long int i = 1; i <= n; i++)
		cin >> a[i];
	for (long long int i = 1; i <= n; i++)
	{
		if (a[i] < a[i + k])
			cout << "Yes" << endl;
		if (a[i] >= a[i + k])
			cout << "No" << endl;
		if (i + k > n-1)
			break;
	}
}


Measured memory_bytes: 5184
// In the name of god

#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
typedef long long                   ll;
typedef long double                 ld;
typedef pair<int,int>               pii;
typedef pair<ll,ll>                 pll;
typedef pair<double,double>         pdd;
typedef pair<ld,ld>                 pld;
typedef pair<string , string>       pss;
#define pb(x)                       push_back(x)
#define ts(x)                       to_string(x)
#define ti(x)                       stoi(x)
#define all(x)                      (x).begin(),(x).end()
#define F                           first
#define S                           second
#define Mp                          make_pair
#define tab                         '\t'
#define sep                         ' '
#define mine(v)                     *min_element(all(v))
#define maxe(v)                     *max_element(all(v))
#define error(x)                    cerr << #x << " = " << x << endl
#define fast_io                     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io                     freopen("in.txt" , "r+" , stdin) ; freopen("out.txt" , "w+" , stdout);
#define endl                        "\n"
inline ll input(){ll n; cin >> n ; return n;}
ll poww(ll a, ll b, ll md) {
    return (!b ? 1 : (b & 1 ? a * poww(a * a % md, b / 2, md) % md : poww(a * a % md, b / 2, md) % md));
}

const int MAXN = 1e6 + 10;
const int MAXLG = 18;
const int MOD = 1e9 + 7;
const int MOD2 = 998244353;
const ll INF = 8e18;
ll a,b,c,d,e;
int main()
{
    cin >> a >> b >> c >> d >> e;
    b += a * 60;
    d += c * 60;
    d -= b;
    d -= e;
    cout << d << endl;
}



Measured memory_bytes: 3640
#define TEST_SNO	1
#define TEST_ENO	1
#define ll			long long

#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

typedef struct data {
	int a;
	int b;
} data;

FILE *in, *ans;
int tno;

int out(const char *s) {
#ifdef TEST
	char buf[8192];
	fgets(buf, sizeof(buf), ans);
	if (strcmp(buf, s)) {
		printf("err\n");
	}
#else
	printf(s);
#endif
	return 0;
}

int outi(int i) {
	char s[128];
	sprintf(s, "%d\n", i);
	out(s);
	return 0;
}

int outll(ll l) {
	char s[128];
	sprintf(s, "%lld\n", l);
	out(s);
	return 0;
}

int geti() {
	int i;
	fscanf(in, "%d", &i);
	return i;
}

ll getll() {
	ll l;
	fscanf(in, "%lld", &l);
	return l;
}

int getstr(char *s) {
	fscanf(in, "%s", s);
	return 0;
}

int fnc() {

	int i;

	int a = geti();
	int b = geti();

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

	outi(s);

	return 0;
}

int main() {
#ifdef TEST
	for (tno = TEST_SNO; tno <= TEST_ENO; tno++) {
		char str[128];
		sprintf(str, "test%d.txt", tno);
		in = fopen(str, "r");
		sprintf(str, "ans%d.txt", tno);
		ans = fopen(str, "r");
		fnc();
		fclose(in);
		fclose(ans);
	}
	printf("end\n");
#else
	in = stdin;
	fnc();
#endif

	return 0;
}


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

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main() {
    let n = read::<i64>();
    let mut xn = read_vec::<i64>();
    let sub = xn.clone();

    xn.sort();
    let num = ((n - 2 ) /2) as usize;
    let f_ans = xn[num];
    let a_ans = xn[num+1];
    for i in 0..n{
        if sub[i as usize] <= f_ans {
            println!("{}",a_ans);
        } else {
             println!("{}",f_ans);
        }
    }
}

Measured memory_bytes: 10928
import java.util.*;

public class Main {

	public static void main (String[] args)  {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = Integer.MAX_VALUE;
		for (int i = 0; i <= n; i++) {
			int count = 0;
			int six = i;
			while (six > 0) {
				count += six % 6;
				six /= 6;
			}
			int nine = n - i;
			while (nine > 0) {
				count += nine % 9;
				nine /= 9;
			}
			if (min > count) {
				min = count;
			}
		}
		System.out.println(min);
	}
}


Measured memory_bytes: 23636
n, a, b = [int(i) for i in input().split()]
border = a + b
foreign_pass = 0
passed = 0
s = input()
for x in s:
    if passed >= border:
        print('No')
        continue
    if x == 'a':
        print('Yes')
        passed += 1
    elif x == 'b' and foreign_pass < b:
        print('Yes')
        passed += 1
        foreign_pass += 1
    else:
        print('No')


Measured memory_bytes: 9232
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<utility>


#define rep(i,x) for(int i=0;i<(int)(x);i++)
#define reps(i,x) for(int i=1;i<=(int)(x);i++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define rreps(i,x) for(int i=((int)(x));i>0;i--)

#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define INF 2e9

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef std::pair<ll, ll> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;}

using namespace std;

bool pairCompare(const P& firstElof, const P& secondElof)
{
    return firstElof.second > secondElof.second;
}

int main()
{
    ll n;
    cin >> n;
    vector<P> p0(100005), p1(100005);
    rep(i, 100005){
        p0[i].first = i;
        p0[i].second = 0;
        p1[i].first = i;
        p1[i].second = 0;
    }

    rep(i, n/2){
        ll tmp0, tmp1;
        cin >> tmp0 >> tmp1;
        p0[tmp0].second++;
        p1[tmp1].second++;
    }

    sort(all(p0), pairCompare);
    sort(all(p1), pairCompare);

    ll ans = 0;
    if(p0[0].first != p1[0].first){
        ans = n - (p0[0].second + p1[0].second);
    }else{
        ll m = max(p0[0].second+p1[1].second, p0[1].second+p1[0].second);
        ans = n - m;
    }
    cout << ans;
}

Measured memory_bytes: 3328
#include <iostream>

using namespace std;

int main() {
    string S;
    cin >> S;
    string out = "Yes";
    if(S.length() % 2 != 0){
        out = "No";
    }else{
        for(int i = 0; i < S.length(); i++){
            if(i % 2 == 0){
                if(S[i] != 'h'){
                    out = "No";
                    break;
                }
            }else{
                if(S[i] != 'i'){
                    out = "No";
                    break;
                }
            }
        }
    }
    cout << out << endl;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use itertools::Itertools;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

fn main() {
    input! {
        a: i64, v: i64,
        b: i64, w: i64,
        t: i64,
    }
    let d = v - w;
    if d <= 0 {
        println!("NO");
    } else if ((a - b).abs() + d - 1) / d <= t {
        println!("YES");
    } else {
        println!("NO");
    }
}


Measured memory_bytes: 2136
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt(), b=sc.nextInt();
   if(a+b>=10){
     System.out.println("error");
   }else{
     System.out.println(a+b);
   }
  }
}

Measured memory_bytes: 23252
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

template <typename T>
void printv(const vector<T> &v)
{
    int sz = v.size();
    for (int i = 0; i < sz; i++)
    {
        cout << v[i] << " \n"[i == sz - 1];
    }
}

int le[2000][2000], ri[2000][2000], up[2000][2000], down[2000][2000];

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

    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    for (int i = 0; i < h; i++)
    {
        cin >> s[i];
    }
    for (int i = 0; i < h; i++)
    {
        if (s[i][0] != '#')
            le[i][0] = 1;
        for (int j = 1; j < w; j++)
        {
            if (s[i][j] != '#')
                le[i][j] = le[i][j - 1] + 1;
        }
    }
    for (int i = 0; i < h; i++)
    {
        if (s[i][w - 1] != '#')
            ri[i][w - 1] = 1;
        for (int j = w - 2; j >= 0; j--)
        {
            if (s[i][j] != '#')
                ri[i][j] = ri[i][j + 1] + 1;
        }
    }
    for (int j = 0; j < w; j++)
    {
        if (s[0][j] != '#')
            up[0][j] = 1;
        for (int i = 1; i < h; i++)
        {
            if (s[i][j] != '#')
                up[i][j] = up[i - 1][j] + 1;
        }
    }
    for (int j = 0; j < w; j++)
    {
        if (s[0][j] != '#')
            down[h - 1][j] = 1;
        for (int i = h - 2; i >= 0; i--)
        {
            if (s[i][j] != '#')
                down[i][j] = down[i + 1][j] + 1;
        }
    }
    int ret = 0;
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if (s[i][j] == '#')
                continue;
            ret = max(ret, le[i][j] + ri[i][j] + up[i][j] + down[i][j] - 3);
        }
    }
    cout << ret << endl;
}


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

int main() {
    int data[3][3];

    for (int i = 0; i < 3; ++i) {
        cin >> data[i][0] >> data[i][1] >> data[i][2];
    }
    int n{};
    cin >> n;

    for (int i = 0; i < n; ++i) {
        int num;
        cin >> num;

        for (int i = 0; i < 3; ++i) {
            for (int j = 0; j < 3; ++j) {
                if (data[i][j] == num) {
                    data[i][j] = -1;
                }
            }
        }
    }

    bool bingo = false;
    int tate1[3]{};
    int naname_left_top = 0;
    int naname_right_top = 0;

    for (int y = 0; y < 3; ++y) {
        int yoko = 0;
        for (int x = 0; x < 3; ++x) {
            if (data[y][x] == -1) {
                yoko++;
                tate1[x]++;
                if (y == x) {
                    naname_left_top++;
                }
                switch (y) {
                case 0:
                    if (x == 2) naname_right_top++;
                    break;
                case 1:
                    if (x == 1) naname_right_top++;
                    break;
                case 2:
                    if (x == 0) naname_right_top++;
                    break;
                }

            }
        }

        if (yoko == 3) {
            bingo = true;
            break;
        }
    }

    for (auto& it : tate1) {
        if (it == 3) {
            bingo = true;
            break;
        }
    }
    if (naname_left_top == 3) {
        bingo = true;
    }
    if (naname_right_top == 3) {
        bingo = true;
    }


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

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
using namespace boost::multiprecision;
int gcd(int a,int b){
    if(a%b==0)return b;
    else return gcd(b,a%b);
}
int lcm(int a,int b){
    return a*b/gcd(a,b);
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
    int cnt[100000];
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,q;
    string s;
    cin>>n>>q>>s;
    rep(i,n-1){
        if(s[i]=='A'&&s[i+1]=='C')cnt[i+1]++;
        cnt[i+1]+=cnt[i];
    }
    rep(i,q){
        int l,r;
        cin>>l>>r;
        printf("%d\n",cnt[r-1]-cnt[l-1]);
    }
}


Measured memory_bytes: 1488
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
using namespace std;
typedef long long ll;

int dp[305][305];

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	while(1){
		int n; cin >> n;
		if(n==0)break;
		vector<int> w(n);
		for(int i=0;i<n;i++){
			cin >> w[i];
		}
		for(int i=0;i<=n;i++){
			for(int j=0;j<=n;j++){
				dp[i][j]=0;
			}
		}
		for(int i=2;i<=n;i++){
			for(int j=0;j<n;j++){
				if(j+i-1>=n)continue;
				if(dp[j+1][j+i-2]==i-2&&abs(w[j]-w[i+j-1])<=1){
					dp[j][j+i-1]=i;
				}
				for(int k=j;k<j+i-1;k++){
					dp[j][i+j-1]=max(dp[j][i+j-1],dp[j][k]+dp[k+1][i+j-1]);
				}
			}
		}
		printf("%d\n",dp[0][n-1]);
	}
}


Measured memory_bytes: 3536
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AtCoder
{
    class Program
    {
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        static int Solve(int M)
        {
            var values = new List<int> { 1 };
            for (int i = 6; i <= M; i *= 6) { values.Add(i); }
            for (int i = 9; i <= M; i *= 9) { values.Add(i); }
            var memo = Enumerable.Repeat(int.MaxValue, M + 1).ToArray();
            var q = new Queue<int>();
            memo[0] = 0;
            q.Enqueue(0);
            while (q.Count > 0)
            {
                int i = q.Dequeue();
                foreach (var value in values)
                {
                    if (i + value <= M && memo[i] + 1 < memo[i + value])
                    {
                        memo[i + value] = memo[i] + 1;
                        q.Enqueue(i + value);
                    }
                }
            }
            return memo[M];
        }
        static void Main(string[] args)
        {
            int N = ReadInt();
            Console.WriteLine(Solve(N));
        }
    }
}


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

int main(){
  int r,g,b;
  cin>>r>>g>>b;
  int n;
  cin>>n;
  ll ans=0;
  for(int i=0; i*r<=n; i++){
    for(int j=0; i*r+j*g<=n; j++){
      if((n-(i*r+j*g))%b==0)ans++;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 3624
from sys import stdin
def main():
    n = int(input())
    ab = [list(map(int, stdin.readline().split())) for i in range(n)]
    ab.sort(key=lambda x:x[1])
    now = 0
    cnt = 0

    for a, b in ab:
        now += a
        if now > b: break
    else:
        print("Yes")
        return 0
    print("No")


if __name__=="__main__": main()


Measured memory_bytes: 53608
#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    double d = 0.0;
    int n;
    int p[8][2];

    cin >> n;
    for(int i = 0; i < n; ++i)
        cin >> p[i][0] >> p[i][1];

    for(int i = 0; i < n - 1; ++i)
        for(int j = i + 1; j < n; ++j) {
            double x = p[i][0] - p[j][0];
            double y = p[i][1] - p[j][1];
            d += sqrt(x * x + y * y);
        }
    
    cout << fixed << setprecision(10) << 2 * d / n;
  	return 0;
}


Measured memory_bytes: 256
using System;

namespace ABC069C
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] bufs = Console.ReadLine().Split(' ');

            int div4 = 0;
            int even = 0;
            int odd = 0;

            for (int i = 0; i < N; i++)
            {
                int a = int.Parse(bufs[i]);
                if (a % 4 == 0)
                {
                    div4++;
                }
                else if (a % 2 == 0)
                {
                    even++;
                }
                else
                {
                    odd++;
                }
            }

            if (div4 >= (N / 2))
            {
                Console.WriteLine("Yes");
            }
            else
            {
                int req = N - div4 * 2;
                if (even >= req)
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }

        }
    }
}


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

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

int main() {
	long long int n;
	cin >> n;
	long long int res=0;
	for(int i=1; i<=n; i++){
	    for(int j=1; j<=n; j++){
	        for(int k=1; k<=n; k++){
	            res += gcd(gcd(i, j), gcd(j, k));
	        }
	    }
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    int w, h, x, n, y, a;
    cin >> w >> h >>n;

    int xmin=0, xmax=w, ymin=0, ymax=h;
    for(int i=0; i<n; i++){
        cin >> x >> y >> a;
        switch (a) {
            case 1 : xmin = max(x, xmin); break;
            case 2 : xmax = min(x, xmax); break;
            case 3 : ymin = max(y, ymin); break;
            case 4 : ymax = min(y, ymax); break;
            default : break;
        }
    }

    x= xmax-xmin; y = ymax-ymin;

    cout << (x<0 || y<0 ? 0 : x * y) << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#define LL long long
using namespace std;

LL req;
LL cost[5];

int main()
{

    for(int i=0;i<4;i++) scanf("%lld",&cost[i]);
    scanf("%lld",&req);
    for(int i=1;i<4;i++) cost[i] = min(cost[i],2*cost[i-1]);
    req*=4;
    LL port = 8;
    LL ans = 0;
    for(int i=3;i>=0;i--)
    {
        LL make = req/port;
        ans += make*cost[i];
        req = req%port;
        port/=2;
    }
    printf("%lld\n",ans);
    return 0;
}


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

#define all(s) s.begin(), s.end()
#define pb push_back
#define ii pair<int, int>
#define x first
#define y second
#define bit(x, y) ((x >> y) & 1)

const int N = 505;

int n, dp[N][N];
int dx[] = {0, 0, -1, 1};
int dy[] = {-1, 1, 0, 0};
ii ord[N * N];
int a[N][N];
bool emp[N][N];

bool inG(int x, int y) {
    return (x >= 1 && x <= n && y >= 1 && y <= n);
}


int main() {
    ios::sync_with_stdio(false); cin.tie(0); 
    cout.tie(0);
    cin >> n;
    int id = 0;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            emp[i][j] = 1;
            id++;
            int foo;
            cin >> foo;
            ord[id] = {(foo - 1) / n + 1, (foo - 1) % n + 1};
            a[ord[id].x][ord[id].y] = id;
            dp[i][j] = min({i, j, n + 1 - i, n + 1 - j});
        }
    }
    // for (int i = 1; i <= n; i++) {
    //     for (int j = 1; j <= n; j++) cout << a[i][j] << ' ';
    //     cout << endl;
    // }
    vector<vector<bool>> check(n + 1, vector<bool>(n + 1, 0));
    int ans = 0;
    for (int i = 1; i <= n * n; i++) {
        queue<ii> q;
        q.push(ord[i]);
        //cout << ord[i].x <<  ' ' << ord[i].y << endl;
        emp[ord[i].x][ord[i].y] = 0;
        stack<ii> st;
        st.push(ord[i]);
        check[ord[i].x][ord[i].y] = 1;
        while (!q.empty()) {
            ii u = q.front(); q.pop();
            dp[u.x][u.y]--;
            //cout << '(' << u.x << ' ' << u.y << ')' << ' ';
            for (int j = 0; j < 4; j++) {
                int x = u.x + dx[j];
                int y = u.y + dy[j];
                if (!inG(x, y)) continue;
                if (check[x][y]) continue;
                if (dp[x][y] == dp[u.x][u.y] + 1 + emp[x][y]) {
                    check[x][y] = 1;
                    q.push({x, y});
                    st.push({x, y});
                }
            }
        }
        while (!st.empty()) {
            auto u = st.top(); st.pop();
            check[u.x][u.y] = 0;
        }
        //cout << endl;
        //if (dp[ord[i].x][ord[i].y]) cout << ord[i].x <<' ' << ord[i].y << ' ' << dp[ord[i].x][ord[i].y] << endl;
        ans += dp[ord[i].x][ord[i].y];
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 9944
#include <stdio.h>
#define MAX 2000000

int H,A[MAX + 1];

void maxHeapify(int i){
  int l,r,largest,tmp;
  l = 2*i;
  r = 2*i + 1;

  if(l <= H && A[l] > A[i]) largest = l;
  else largest = i;
  if(r <= H && A[r] > A[largest]) largest = r;
  if(largest != i){
    tmp = A[i];
    A[i] = A[largest];
    A[largest] = tmp;
    maxHeapify(largest);
  }
}

int main(){
  int i;

  scanf("%d",&H);
  for(i = 1;i <= H;i++) scanf("%d",&A[i]);
  for(i = H/2;i >= 1;i--) maxHeapify(i);
  for(i = 1;i <= H;i++){
    if(i > 0) printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
  return 0;
}

Measured memory_bytes: 2552
#include <iostream>

using namespace std;

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

    if(a == 1){
        a = a + 13;
    }
    if(b == 1){
        b = b + 13;
    }

    if(a > b){
        cout << "Alice" << endl;
    }
    else if(a < b){
        cout << "Bob" << endl;
    }
    else{
        cout << "Draw" << endl;
    }
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rept(k,i,n) for(int i = (k); i < (int)(n); i++)

typedef long long ll;
typedef pair<int,int> Pii;

int n;
vector<vector<int>> e;

int main() {
    cin>>n;
    e.assign(n,vector<int> (0,0));
    rep(i,n){
        string a;cin>>a;
        rep(j,n) if(a[j]=='1') e[i].push_back(j);
    }
    int ans=-1;
    rep(i,n){
        vector<int> ck(n,0);
        ck[i]=1;
        queue<Pii> q;
        q.push(Pii(i,1));
        int ma=-1;
        bool f=false;
        while(!q.empty()){
            Pii p=q.front();
            q.pop();
            for(int x: e[p.first]){
                if(ck[x]!=0&&ck[x]!=p.second+1&&ck[x]!=p.second-1){f=true;break;}
                else if(ck[x]!=0) continue;
                q.push(Pii(x,p.second+1));
                ck[x]=p.second+1;
               // cout<<x<<' '<< ck[x]<<endl;
                ma=max(ma,ck[x]);
            }
            if(f) break;
        }
        if(f) continue;
        ans=max(ma,ans);

    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 512
#include<cstdio>
#include<list>
#include<cstring>

using namespace std;

const int MAX = 20;

list<int> l;

int main()
{
	int n;
	while(~scanf("%d", &n))
	{
		while(n--)
		{
			char s[MAX];
			scanf("%s", s);
			if(!strcmp(s, "insert"))
			{
				int tmpnum;
				scanf("%d", &tmpnum);
				l.push_back(tmpnum);
			}
			else if(!strcmp(s, "delete"))
			{
				int tmpnum;
				scanf("%d", &tmpnum);
				int len = l.size();
				list<int>::iterator iter = l.end();
				iter--;
				for(;len >= 1; iter--, len--)
				{
					if((*iter) == tmpnum)
					{
						l.erase(iter);
						break;
					}
				}
			}
			else if(!strcmp(s, "deleteFirst"))
			{
				list<int>::iterator it = l.end();
				it--;
				l.erase(it);
			}
			else
			{
				list<int>::iterator it = l.begin();
				l.erase(it);
			}
		}
		int len = l.size();
		for(list<int>::reverse_iterator it = l.rbegin(); it != l.rend(); it++, len--)
		{
			printf("%d", *it);
			if(len == 1)
				printf("\n");
			else
				printf(" ");
		}
	}
	return 0;
}



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

int channel_time[30][200005] = {0};
int time_schedule[200005] = {0};

int main() {
    int N, C, s, t, c, imos, max_rec = 0;
    cin >> N >> C;

    for (int i = 0; i < N; i++) {
        cin >> s >> t >> c;
        channel_time[c-1][s * 2] = 1;
        channel_time[c-1][t * 2 + 1] = -1;
    }

    for (int i = 0; i < 30; i++) {
        imos = 0;
        for (int j = 1; j < 200005; j++) {
            channel_time[i][j] += channel_time[i][j - 1];
        }
        for (int j = 1; j < 200005; j++) {
            if (channel_time[i][j] != 0 && channel_time[i][j] != 1) channel_time[i][j] = 1; 
        }
    }

    for (int i = 0; i < 200005; i++) {
        for (int j = 0; j < 30; j++) {
            time_schedule[i] += channel_time[j][i];
        }
    }

    for (int i = 0; i < 200005; i++) {
        max_rec = max(max_rec, time_schedule[i]);
    }

    cout << max_rec << endl;

    return 0;
}

Measured memory_bytes: 24448
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNextInt()){
			int n = sc.nextInt();
			int x = 1;
			for(int i = 1; i <= n; i++)
				x += i;
				
				System.out.println(x);
		}
}
}

Measured memory_bytes: 18052
from sys import stdin
import sys
import itertools
import math

N = int(input())
if N == 1 or N == 2:
    print(N)
    sys.exit()
ans = 0
temp = []
if N > 1000:
    x = 2*int(math.sqrt(2*N))
    # print(x)
    y=[i for i in range(1,x)]
    # print(sum(y))
else:
    x = N
for i in range(1, x):
    ans += i
    temp.append(i)
    if ans >= N:
        f = ans-N
        # print("f=", f)
        for k in range(len(temp)):
            if temp[-1] <= f:
                f = f-temp[-1]
                temp.pop()
                continue
            print(temp[-1])
            temp.pop()
            # print(ans, i)


Measured memory_bytes: 3828
/**
 * @jakestrj
 */

//#pragma warning(disable:4996)
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")
#include "bits/stdc++.h"
using namespace std;
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define rep(i, j, k) for(int i=(j);i<(k);++i)
#define repi(i, j, k) for(int i=(j);i<=(k);++i)
#define per(i, j, k) for(int i=(j);i>(k);--i)
#define peri(i, j, k) for(int i=(j);i>=(k);--i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).begin(),(x).end(), greater<int>()
#define mem(a, b) memset(a, (b), sizeof(a))
#define mem2(a, b) memset(a, (b), sizeof(a[0][0])*len(a)*len(a[0]))
#define sz(x) ((int)(x).size())
#define len(x) (int)(sizeof(x)/sizeof(x[0]))
#define endl "\n"
#define INF 1e18
#define EPS 1e-9
#define PI 2*acos(0)
#define MOD 1000000007
typedef long long ll;
typedef long double ld;
typedef tuple<int, int, int> trio;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef map<int,int> mpii;
typedef set<int> si;

const int MN = 1e5+10;
int dp[MN][3], c[MN][3];
int n;

int go(int type, int day){
	if(day==n) return 0; //breaks last day
	if(dp[day][type]!=-1) return dp[day][type];
	if(type==0){ //A
		dp[day][type] = max(go(1, day+1) + c[day][1], go(2, day+1) + c[day][2]);
	}else if(type==1) { //B
		dp[day][type] = max(go(0, day+1) + c[day][0], go(2, day+1) + c[day][2]);
	}else{
		dp[day][type] = max(go(1, day+1) + c[day][1], go(0, day+1) + c[day][0]);
	}
}

struct C {
	void solve(std::istream& cin, std::ostream& cout) {
		cin >> n;
		mem(dp, -1);
	    //no day overlap
	    rep(i, 0, n){
	    	rep(j, 0, 3){
	    		cin >> c[i][j];
	    	}
	    }
	    //each mem(dp, -1) NOT NEEDED
	    cout << max({go(0, 0), go(1, 0), go(2, 0)}) << endl;
	}
};


int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	C solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

string x[4] = {"dream", "dreamer", "erase", "eraser"};

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

    reverse(s.begin(), s.end());
    rep(i, 4) reverse(x[i].begin(), x[i].end());

    bool can = false;
    for(int i = 0; i < s.size();) {
        bool can2 = false;
        rep(j, 4) {
            if(s.substr(i, x[j].size()) == x[j]) {
                can2 = true;
                i += x[j].size();
            }
        }
        if(!can2) break;
        if(i == s.size()) can = true;
    }

    cout << (can ? "YES" : "NO") << endl;

    return 0;
}

Measured memory_bytes: 512
#include<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

int n, k, c;
char s[200005];
vector<int> ans, ans2;

int main() {
  scanf("%d %d %d", &n, &k, &c);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    if (s[i] == 'o') {
      ans.push_back(i);
      i += c;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == 'o') {
      ans2.push_back(i);
      i -= c;
    }
  }
  if (ans.size() == k) {
    for (auto x: ans) {
      if (binary_search(ans2.rbegin(), ans2.rend(), x)) {
        printf("%d\n", x + 1);
      }
    }
  }
}


Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
const int Inf = 1 << 30;
const int maxx = 2e5 + 7;
char s[maxx], t[maxx];
map <char, int> mp1;
map <char, int> mp2;
int t1[maxx], t2[maxx];

int main() {
	while(scanf("%s %s", s, t) != EOF) {
		mp1.clear();
		mp2.clear();
		memset(t1, 0, sizeof(t1));
		memset(t2, 0, sizeof(t2));
		int l = strlen(s);
		for(int i = 0; i < l; i++) mp1[s[i]]++;
		for(int i = 0; i < l; i++) mp2[t[i]]++;
		for(int i = 1; i <= 26; i++) t1[i] = mp1[i + 'a' - 1];
		for(int i = 1; i <= 26; i++) t2[i] = mp2[i + 'a' - 1];
		sort(t1 + 1, t1 + 27);
		sort(t2 + 1, t2 + 27);
		bool flg = 1;
		for(int i = 1; i <= 26; i++) {
			if(t1[i] != t2[i]) {
				flg = 0; break;
			}
		}
		if(flg) puts("Yes");
		else puts("No");
	}
}

Measured memory_bytes: 2176
using System;

public class Program
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var nums = 0;
        for (int i = 1; i <= n; i += 2)
        {
            var count = 0;
            for (int j = 1; j <= i; j++)
            {
                if (i % j == 0)
                {
                    count++;
                }
            }

            if (count == 8)
            {
                nums++;
            }
        }

        Console.WriteLine(nums);
    }
}


Measured memory_bytes: 13140