akhauriyash/Code-Regression huggingface dataset:
/*
     ▄▀▀▀▄
▄███▀░◐░░░▌
    ▌░░░░░▐

    ▌░░░░░▐▄▄
    ▌░░░░▄▀▒▒▀▀▀▀▄
   ▐░░░░▐▒▒▒▒▒▒▒▒▀▀▄
   ▐░░░░▐▄▒▒▒▒▒▒▒▒▒▒▀▄
    ▀▄░░░░▀▄▒▒▒▒▒▒▒▒▒▒▀▄
      ▀▄▄▄▄▄█▄▄▄▄▄▄▄▄▄▄▄▀▄
           ▌▌░▌▌
           ▌▌░▌▌
         ▄▄▌▌▄▌▌ */
#include <iostream>
#include <set>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <queue>
#include <stack>
#include <cstring>
#include <ctime>

#define pb push_back
#define re return
#define fi first
#define se second
#define ll long long

using namespace std;

map <int, int> mx, m[10010];
set <int> sx, s[10010];
int a[10010], b[1000000];
vector <int> v;



int main()
{
    ll sm=0, n, k;
    int a[200010];
    cin >> n >> k;
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    sort(a, a+n);
    for(int i=0; i<n-k; i++){
        sm+=a[i];
    }
    cout << sm;

}


Measured memory_bytes: 3840
#include <iostream>

using namespace std;

int main()
{
    double a,b;
    cin>>a>>b;
    int sign=0;
   for(int i=1;i<=1250;i++)
   {
       if((int)(i*0.08)==a&&(int)(i*0.10)==b)
       {
           sign=i;
           break;
       }
   }
   if(sign==0)
   {
       cout<<-1;
   }
   else
     cout<<sign;

}


Measured memory_bytes: 256
import sys
def sieve(N):
    if N<2:
        prime = [False for i in range(N+1)]
        return prime
 
    prime = [True for i in range(N+1)]
    prime[0] = False
    prime[1] = False
 
    for i in range(2, int(N**0.5)+1):
        if prime[i]:
            for j in range(i*2, N+1, i):
                prime[j] = False
 
    return prime

l=sieve(100057)
x=int(input())
while True:
    if l[x]==True:
        print(x)
        sys.exit()
    x+=1

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

using namespace std;

//using Matrix = vector< vector<int> >;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9 + 10;
//const ll INF = 1e18 + 10LL;
int dx[5] = {0, 0, 1, -1, 0}, dy[5] = {1, -1, 0, 0, 0};
const double EPS = 1e-10;
bool cmp(P a, P b) { return a.second < b.second; } //End sort (Interval scheduling problem)

int n, L, T;
int x[100010], w[100010];

int main(void){
	cin>>n>>L>>T;
	for (int i = 0; i < n; i++) cin>>x[i]>>w[i];

	vector<ll> tmp(n);
	for (int i = 0; i < n; i++) {
		if (w[i] == 1) tmp[i] = (x[i] + T) % L;
		else tmp[i] = ((x[i] - T) % L + L) % L;
	}

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

	ll cnt = 0;
	for (int i = 0; i < n; i++) {
		if (w[i] == 1) cnt -= (T - (L - x[i]) + L) / L;
		else cnt += (T - (x[i] + 1) + L) / L;
	}
	cnt = (cnt % n + n) % n;
	vector<ll> res(n);

	for (int i = 0; i < n; i++) res[(i + cnt) % n] = tmp[i];
	for (int i = 0; i < n; i++) cout<< res[i] <<endl;

	
	return 0;
}

Measured memory_bytes: 3584
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

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

const ll mod = 1000000007;

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

  ll n, m, d;
  cin >> n >> m >> d;

  ll expect = 0;
  if (d == 0) expect = n * (m - 1);
  else expect = (n - d) * 2 * (m - 1);

  double ans = (double) expect / (double) (n * n);

  cout << setprecision(16) << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

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

    string s;
    cin >> s;
    ll n = s.size();
    map<ll, ll> mp;
    REP(i, n){
        mp[s[i]]++;
    } 
    if(mp[s[0]] == mp[s[1]] && mp[s[1]] == mp[s[2]] && mp[s[2]] == mp[s[3]] && mp[s[0]] == 2){
        cout << "Yes" << endl;
    }
    else cout << "No" << endl;
    return 0;
}

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

int h,w;
char map[99][99];
int dp[99][99];

int move(int i,int j)
{

  if(dp[i][j]!=-1)
    return dp[i][j];
  
  int ans=map[i][j]-'0';
  
  int tmp1=999999;
  int tmp2=999999;
  if(i+1==h && j+1==w)
      return ans;
  if(i+1<h)
    tmp1=move(i+1,j);
  if(j+1<w)
    tmp2=move(i,j+1);

  if(tmp1>tmp2)
    ans+=tmp2;
  else
    ans+=tmp1;
  dp[i][j]=ans;
  //cout<<i<<" "<<j<<" "<<ans<<endl;
  return ans;
}

int main()
{
  cin>>h>>w;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
      {
	cin>>map[i][j];
	dp[i][j]=-1;
      }
  int ans = move(0,0);
  cout<<ans<<endl;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
#define int long long
#pragma GCC optimize("O3,Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("avx,avx2,sse")
using namespace std;

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

    int n, x;
    cin >> n >> x;
    vector<int> kek(n);
    int now = 0;
    int cnt = 1;
    for (int i = 0; i < n; i++) {
        cin >> kek[i];
        now += kek[i];
        if (now <= x) {
            cnt++;
        }
    }
    cout << cnt << '\n';

    fflush(stdout);
    return 0;
}


Measured memory_bytes: 3600
def fourcount(List):

	num = 0
	tmp = 1
	l = len(List)

	for i in range(1,l):

		if (List[i-1] == List[i]) and (tmp < 4):
			tmp += 1

		elif tmp == 4:
			num += 1
			tmp = 1

		else:
			tmp = 1

	if tmp == 4:
		num += 1
		
	return num
		

def twocount(List):

	num = 0
	tmp = 1
	l = len(List)

	for i in range(1,l):

		if (List[i-1] == List[i]) and (tmp < 2):
			tmp += 1

		elif tmp == 2:
			num += 1
			tmp = 1

		else:
			tmp = 1

	if tmp == 2:
		num += 1
		
	return num

def decision(H,W,num4,num2):

	if H == 1:
		if (W % 2 == 0) and (num2 == W/2):
			print("Yes")
		elif (W % 2 == 1) and (num2 == (W-1)/2):
			print("Yes")
		else:
			print("No")

	elif W == 1:
		if (H % 2 == 0) and (num2 == H/2):
			print("Yes")
		elif (H % 2 == 1) and (num2 == (H-1)/2):
			print("Yes")
		else:
			print("No")

	elif H == 0 or W == 0:
		print("Yes")

	elif H > W:
		if (H % 2 == 0) and (H / 2 <= num4):
			same = H/2
			decision(H,W-2,num4-same,num2-same*2)
		elif (H % 2 == 1) and ((H-1) / 2 <= num4 ) and (num2-(H-1) >= 1):
			same =  (H-1) /2
			decision(H,W-2,num4-same,num2-same*2-1)
		else:
			print("No")

	elif W > H:
		if (W % 2 == 0) and (W / 2 <= num4):
			same= W/2
			decision(H-2,W,num4-same,num2-same*2)
		elif (W % 2 == 1) and ((W-1) / 2 <= num4) and (num2-(W-1) >= 1):
			same =  (W-1) /2
			decision(H-2,W,num4-same,num2-same*2-1)
		else:
			print("No")

	elif W == H:
		if (H % 2 == 0) and (H - 1) <= num4 :
			same = H-1
			decision(H-2,W-2,num4-same,num2-same*2)
		elif (H % 2 == 1) and (H - 2) <= num4 and (num2-2*(H-2) >= 2):
			same = H-2
			decision(H-2,W-2,num4-same,num2-same*2-2)
		else :
			print("No")



H,W = map(int,input().split(" "))
a = []
b = []

for i in range(H):
	a = list(input())
	a = a[0:W]
	for string in a:
		b.append(string)

b.sort()

num4 = fourcount(b)
num2 = twocount(b) 

decision(H,W,num4,num2)

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ip;
#define MOD 1000000007


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll d,t,s;
    cin>>d>>t>>s;
    if(ld(d)/ld(s)<=ld(t))
    cout<<"Yes"<<"\n";
    else
    cout<<"No"<<"\n";
    return 0;
}

Measured memory_bytes: 3648
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;
public class MainClass
{
	public const long Giri = 1000000007;
	public const long DpInf = 99999999999999;
	
	public static void Main(string[] args)
	{
		var p = Input().ToInt();
		var l = p[0];
		var r = p[1];
		var d = p[2];
		var q = r/d - ((l-1) / d);
		Console.WriteLine(q);
	}
	
	
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str, int offset = 0)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt() + offset;
		return r;
	}
}

Measured memory_bytes: 27528
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        if (s.contains("a") && s.contains("b") && s.contains("c"))
            System.out.println("Yes");
        else
            System.out.println("No");

    }
}


Measured memory_bytes: 35632
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int n;
    int sum = 0;
    cin >> n;
    int orig = n;
    int a[8];
    for(int i = 7; i >= 0 ; i--) {
        int p = std::pow(10, i);
        a[i] = n / p;
        n = n % p;
        sum += a[i];
    }
    if(orig % sum == 0) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
    return 0;
}




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

void solve(){
	
	int n ;
	cin>>n; 

	ll arr[n] ;

	unordered_map<ll,int> mp ;

	for(int i=0;i<n;i++){
		cin>>arr[i] ;
		mp[arr[i]]++ ;
	}

	ll sum=0 ;

	for(int i=0;i<n;i++){
		sum+=arr[i] ;
	}

	int q ;
	cin>>q ;

	for(int i=0;i<q;i++){
	
		ll l,r ;
		cin>>l>>r ;

		ll temp=mp[l] ;
		mp[l]=0 ;
		mp[r]+=temp ;

		sum=sum-(l*temp)+(r*temp) ;
		cout<<sum<<"\n" ;
	
	}

}	

int main(){
	
	int y ;

	y=1 ;
	//cin>>y ;

	while(y--)
	{	
		solve() ;
	}

}

Measured memory_bytes: 7716
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n;
cin>>n;
ll dp[n+1][3];
dp[0][0]=0;
dp[0][1]=0;
dp[0][2]=0;
ll cost [n][3];
for (ll e=0;e<n;e++)
cin>>cost[e][0]>>cost[e][1]>>cost[e][2];
dp[1][0]=cost[0][0];
dp[1][1]=cost[0][1];
dp[1][2]=cost[0][2];
for (ll e=2;e<=n;e++)
{
dp[e][0]=cost[e-1][0]+max(dp[e-1][1],dp[e-1][2]);
dp[e][1]=cost[e-1][1]+max(dp[e-1][0],dp[e-1][2]);
dp[e][2]=cost[e-1][2]+max(dp[e-1][0],dp[e-1][1]);
}
ll m=max(dp[n][0],dp[n][1]);
m=max(m,dp[n][2]);
cout<<m;

}


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

struct node{
  struct node *right;
  struct node *left;
  struct node *p;
  int key;
};
typedef struct node * Node;

#define NIL NULL

Node root;

/*
Node treeMinimum(Node x){


}

Node treeMaximum(Node x){


}



Node treeSuccessor(Node x){


}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



}
*/
Node treeSearch(Node u, int k){
  while(u != NIL && k != u->key){
    if(k < u->key)
      u = u->left;
    else
      u = u->right;
  }
  return u;
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key)
      x = x->left;
    else
      x = x->right;
  }
  z->p = y;
  
  if(y == NIL){
    root = z;
  }else if(z->key < y->key){
    y->left = z;
  }else{
    y->right = z;
  }
}

void inorder(Node u){
  if(u == NIL)return;
  inorder(u->left);
  printf(" %d", u->key);
  inorder(u->right);
}
void preorder(Node u){
  if(u == NIL)return;
  printf(" %d", u->key);
  preorder(u->left);
  preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);
  
  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else  if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }

  return 0;
}



Measured memory_bytes: 20468
n = int(raw_input())
S = map(int, raw_input().strip().split(' '))
q = int(raw_input())
T = map(int, raw_input().strip().split(' '))

def search(S,k):
    for s in S:
        if s == k:
            return True
    return False

c = 0
for t in T:
    if search(S,t): c += 1

print c

Measured memory_bytes: 6976
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll N=1e6+5,inf=1e18,mod=1e9+7;
#define test ll testcases;cin>>testcases; while(testcases--)
#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define vld vector<ld>
#define pll pair<ll,ll> 
#define pld pair<ld,ld> 
#define vpll vector<pll>
#define vpld vector<pld>
#define all(X) X.begin(),X.end()
#define sz(x) ((ll)((x).size()))
const ld pi=3.141592653589793238;

bool check_prime(ll n)
{
	ll flag=0,i;
	for(i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			flag=1;
			break;
		}
	}
	if(n==1)
	{
		return false;
	}
	else if(flag==0 || n==2 || n==3)
	{
		return true;
	}
	else
	{
		return false;
	}
}

ll fastexpo(ll a,ll b,ll MOD) 
{
	ll result=1;
	while(b>0)
	{
		if(b%2==1)
		{
			result=(result*a)%MOD;
		}
		a=(a*a)%MOD;
		b=b/2;
	}
	return result;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,p;
    cin>>n;
    if(n%2==0)
    {
    	n/=2;
    	p=0;
    	while(n>0)
    	{
    		p+=(n/5);
    		n=n/5;
    	}
    	cout<<p<<"\n";
    }
    else
    {
    	cout<<"0\n";
    }
	return 0;
}

Measured memory_bytes: 3544
#include<stdio.h>
void insertionSort(int A[], int N);
void printArray(int A[], int N);
int main(void){
    int A[100];
    int N,i;
    scanf("%d",&N);
    for(i=0;i<N;i++){
        scanf("%d",&A[i]);
    }
    insertionSort(A, N);
}


void insertionSort(int A[], int N){
    int i,j,v;
    for(i=1;i<N;i++){
        printArray(A, N);
        v = A[i];
        j = i - 1;
        while(j >= 0 && A[j] > v){
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;
    }
    printArray(A, N);
}


void printArray(int A[], int N){
    int k = 0;
    while(k < N){
        printf("%d",A[k]);
        if(k < N-1){
            printf(" ");
        }else{
            printf("\n");
        }
        k++;
    }
}


Measured memory_bytes: 2032
#include<iostream>
#include<vector>
#include<climits>
#include<algorithm>

using namespace std;

int main() {
  int n, a;
  cin >> n;
  vector<int> input;
  for (int i=0; i<n; ++i) {
    cin >> a;
    input.push_back(a);
  }
  vector<int> dp(201, 0);
  for(int i=0; i<input.size(); ++i) {
    for(int j=0; j<dp.size(); ++j) {
      dp[j] += ((input[i] - (j-100)) * (input[i] - (j-100)));
    }
  }
  int res = INT_MAX;
  for (auto&e : dp) {
    res = min(res, e);
  }
  cout << res << 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  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
typedef long long ll;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int main(){
    string S;
    cin >> S;
    if (S == "AAA" | S == "BBB"){
        cout << "No" << endl;
    }
    else{
        cout << "Yes" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <vector>
#include <math.h>
#include <map>
#include <queue>
#include <set>
#define Pll make_pair
using namespace std;
typedef long long ll;
const int MAXN=1e5+50;
const int inf=0x3f3f3f3f;
const int mod=1e9+7;
const int phi=1e9+6;
char ch[MAXN];
int main()
{
    scanf("%s",ch+1);
    int len=strlen(ch+1);
    while(len--){
        printf("x");
    }
    printf("\n");
    return 0;
}
/*

 */

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

const int sz = 100005;

typedef long long int ll;

const int inf = 1000000009;

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n,W;
    cin>>n>>W;

    vector<int>w(n),v(n);
    
    for(int i=0;i<n;i++){
        cin>>w[i]>>v[i];
    }

    vector<vector<int> >dp(n+1,vector<int>(sz,inf));

    for(int i=0;i<n;i++)dp[i+1][0] = 0;

    dp[0][0] = 0;

    for(int i=0;i<n;i++){
        for(int j=1;j<sz;j++){
            if(j>=v[i])
            dp[i+1][j] = min(dp[i][j] , w[i] + dp[i][j-v[i]]);

            else dp[i+1][j] = dp[i][j];
        }
    }

    int ans = 0;

    for(int i=1;i<sz;i++){
        if(dp[n][i] <= W){
            ans = i;
        }
    }

    cout<<ans;

    // cout<<dp[1][30];

    return 0;

}

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

#define ll long long
#define ull unsigned long long 

int main(){
    ull a, b, c;
    cin >> a >> b >> c;
    if(!(a&1) || !(b&1) || !(c&1)){
        cout << 0;
        return 0;
    }
    else{
        cout << min(a*b, min(b*c, a*c));
    }
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define X first
#define Y second
#define pb push_back
#define CL(x) (x << 1)
#define CR(x) ((x << 1) + 1)
#define sqr(x) ((x) * (x))
#define Task ""

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pii;
const int N = 100005;
vector <int> e[N];
bool le[N], chan[N];
int n, m;
int res;
bool was[N];
int odd, even;
bool ok;
void dfs(int u, int p) {
    was[u] = true;
    if (le[u]) odd++;
    if (chan[u]) even++;
    if (le[u] && chan[u]) ok = true;
    for (auto v: e[u])
        if (v != u) {
            le[v] = le[v] | (chan[u] & 1);
            chan[v] = chan[v] | (le[u] & 1);
            if (!was[v]) dfs(v, u);
        }
}
int main() {
    std :: ios_base :: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    //freopen("input.inp", "r", stdin);
    //-------------------------------------------------------------------------------------------------------
    cin >> n >> m;
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        e[u].pb(v);
        e[v].pb(u);
    }
    le[1] = 1;
    dfs(1, -1);
    for (int i = 1; i <= n; i++)
        ok = ok | (le[i] && chan[i]);
    if (ok) cout << 1ll * n * (n - 1) / 2 - m;
    else {
        cc tmp = 0;
        for (int i = 1; i <= n; i++) {
            if (chan[i]) tmp += 1ll * even - 1;
            if (le[i]) tmp += 1ll * odd - 1;
        }
        cout << max(0ll, 1ll * n * (n - 1) / 2 - m - tmp / 2);
    }
    //-------------------------------------------------------------------------------------------------------
    return 0;
}


Measured memory_bytes: 6912
package main

import "fmt"

func main() {

	var n int
	fmt.Scan(&n)

	for i:=1; i<=n; i++ {
		
		x := i
		if (x%3)==0 {
			fmt.Printf(" %d",i) 
			continue
		}
		for (x%10)==3 || (x/10)!=0 {
			if (x%10)==3 {
				fmt.Printf(" %d",i) 
				break
			} else if (x/10)!=0 {
				x = x/10
			}
		}
	}
	fmt.Println()
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define read cin >>
#define echo cout <<
#define fin << '\n'
#define _ << ' ' <<
#define in :
#define var auto&&
#define let const auto

signed main ( ) {

    int h;
    read h;

    int cnt = 1;
    while ( h >= 1 ) {
        cnt <<= 1;
        h >>= 1;
    }
    echo cnt-1 fin;

    return 0;
}

Measured memory_bytes: 256
a=int(input())
List=[]
for i in range(a):
  p,q=map(int,input().split())
  List.append([p-q,p+q])
List=sorted(List, key=lambda x:x[1])
ans=0
t=-10000000000
for i in range(a):
  if t<=List[i][0]:
    ans+=1
    t=List[i][1]
print(ans)

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

using lli = long long int;
using Vint = vector<int>;
using Vlli = vector<lli>;
using Wint = vector<Vint>;
using Wlli = vector<Vlli>;
using pii = pair<int, int>;
using pll = pair<lli, lli>;

const int MOD = 1e9 + 7;
const int INFi = 2e9 + 1;
const lli INFl = (lli)(9e18) + 1;
const vector<pii> DXDY = {make_pair(1, 0), make_pair(-1, 0), make_pair(0, 1), make_pair(0, -1)};

#define FOR(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
#define FOReq(i, a, b) for(int (i) = (a); (i) <= (b); (i)++)
#define rFOR(i, a, b) for(int (i) = (b); (i) >= (a); i--)
#define REP(i, n) FOR(i, 0, n)
#define rREP(i, n) rFOR(i, 0, (n-1))
#define vREP(i, vec) for(auto &(i) : (vec))


template <class T> inline int argmin(vector<T> vec){return min_element(vec.begin(), vec.end()) - vec.begin();}
template <class T> inline int argmax(vector<T> vec){return max_element(vec.begin(), vec.end()) - vec.begin();}
template <class T> inline void chmax(T &a, T b){a = max(a, b);}
template <class T> inline void chmin(T &a, T b){a = min(a, b);}


// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


const int MAX_SIZE = 1e5 + 10;

int main(void){
  int n, c; cin >> n >> c;
  Wint IMOS(c, Vint(MAX_SIZE, 0));
  int S, T, C;
  REP(i, n){
    cin >> S >> T >> C;
    // (S - 0.5, T] ---> (S - 1 ~ T] と考える
    //  1 ~ 2, 2 ~ 3のとき(0, 2], (1, 3]と考えられるが, 高々 1なので消せばいい
    IMOS[C - 1][S - 1]++;
    IMOS[C - 1][T]--;
  }
  REP(i, c) FOR(j, 1, MAX_SIZE) IMOS[i][j] += IMOS[i][j - 1];
  int res_MAX = 0;
  REP(i, MAX_SIZE){
    int cnt = 0;
    REP(j, c) if(IMOS[j][i] != 0) cnt++;
    chmax(res_MAX, cnt);
  }
  cout << res_MAX << '\n';
  return 0;
}

Measured memory_bytes: 12416
package main

import "fmt"

func main() {
	var r, g, b, n int
	fmt.Scan(&r, &g, &b, &n)

	ans := 0
	for i := 0; i*r <= n; i++ {
		for j := 0; j*g+i*r <= n; j++ {
			if (n-j*g-i*r)%b == 0 {
				ans++
			}
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1788
import sys
sys.setrecursionlimit(100000)

X = 10**9+7
N,M = list(map(int,input().split()))
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n;

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])%X

    return result%X


ans = 1
for val,dupes in factorize(M):
    ans *= cmb(N+dupes-1,N-1)
    ans = ans % X
print(ans%X)

Measured memory_bytes: 3064
/*input
10
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
*/

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

int main() {
    int N;
    cin >> N;
    vector<string> S(N);
    rep(i, N) cin >> S[i];
    vector<int> C(4);
    rep(i, N) {
        if (S[i] == "AC") C[0]++;
        if (S[i] == "WA") C[1]++;
        if (S[i] == "TLE") C[2]++;
        if (S[i] == "RE") C[3]++;
    }
    printf("AC x %d\nWA x %d\nTLE x %d\n RE x %d\n", C[0], C[1], C[2], C[3]);
}

Measured memory_bytes: 6400
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
const ll N = 105, INF = 1e18;
int n, source, sink;
ll a[N], par[N];
ll cap[N][N];
vector<int> adj[N];
 
ll bfs(int source, int sink) {
	memset(par, -1, sizeof par);
	par[source] = -2;
	queue<pair<int, ll>> q;
	q.push({source, INF});
	while(!q.empty()) {
		ll u = q.front().first, flow = q.front().second;
		q.pop();
		for(auto& v : adj[u]) {
			if(par[v] == -1 && cap[u][v]) {
				par[v] = u;
				ll new_flow = min(flow, cap[u][v]);
				if(v == sink) return new_flow;
				q.push({v, new_flow});
			}
		}
	}
	return 0;
}

ll maxflow(int source, int sink) {
	ll flow = 0;
	ll newFlow;
	while((newFlow = bfs(source, sink))) {
		flow += newFlow;
		int u = sink;
		while(u != source) {
			int v = par[u];
			cap[v][u] -= newFlow;
			cap[u][v] += newFlow;
			u = v;
		}
	}
	return flow;
}
 
int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> n;
	source = n+1; sink = n+2;
	ll ideal = 0;
	for(int i = 1; i <= n; i++)
		cin >> a[i], ideal += (a[i]>0)?a[i]:0;
	memset(cap, 0, sizeof cap);
	for(int i = 1; i <= n; i++) {
		if(a[i] < 0) adj[source].push_back(i), adj[i].push_back(source), cap[source][i] = -a[i];
		else adj[i].push_back(sink), adj[sink].push_back(i), cap[i][sink] = a[i];
	}
	for(int i = 1; i <= n; i++) {
		for(int j = 2*i; j <= n; j+=i)
			adj[i].push_back(j), adj[j].push_back(i), cap[i][j] = INF;
	}
	ll mf = maxflow(source, sink);
	ll ans = ideal - mf;
	cout << ans << '\n';
	return 0;
}

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

int main() {
  int a;
  
  cin >> a;
  
  int b = a - a / 100 * 100;
  int c = b - b / 10 * 10;
  
  cout << a / 100 + b / 10 + c << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  
  int long a, b, k;
  
  scanf("%ld %ld %ld",&a, &b, &k);
  
  if(a + b <= k){
    printf("0 0\n");
  }
  else if(a > k){
    printf("%ld %ld\n", a - k, b);
  }
  else{
    printf("%ld %ld\n", 0, b - (k - a));
  }
  
  return 0;
}


Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;

class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;
    Func cin2;
    void calc()
    {
        cin = new Scanner();
        cin2 = new Func();
        int[] NK=cin.ArrayInt(2,0);
        int N=NK[0];
        int K=NK[1];
        int ans=0;
        if(K==1)ans=0;
        else ans=N-K;
        Console.WriteLine(ans);
        
    }
}



class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Answer
{
    public static void Int2DArrayAns(int[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }//Answer.IntArrayAns(x);
    public static void Char2DArrayAns(char[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
}

class Func
{
    public long GCDLong(long a, long b)
    {
        while(a!=0)
        {
          long t=a;
          a=b%a;
          b= t;
        }
      
        return b;        
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int n;
    while(cin >> n, n){
        vector<string> u(n);
        for (int i = 0; i < n; ++i) {
            string s;
            cin >> u[i];
        }
        vector<int> contained(n);
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                if(i == j) continue;
                if(u[i].size() < u[j].size() && u[j].find(u[i]) != string::npos) {
                    contained[i] = 1;
                }
            }
        }

        vector<string> v;
        for (int i = 0; i < n; ++i) {
            if(!contained[i]) v.emplace_back(u[i]);
        }
        int m = v.size();
        vector<vector<int>> dp(m, vector<int>(1<<m, MOD)), dq(m, vector<int>(m, 0));
        for (int i = 0; i < m; ++i) {
            dp[i][1<<i] = v[i].size();
        }
        for (int i = 0; i < m; ++i) {
            for (int j = 0; j < m; ++j) {
                for (int l = 1; l <= min(v[i].size(), v[j].size()); ++l) {
                    int ok = 1;
                    if(v[j].substr(0, l) == v[i].substr((int)v[i].size()-l, l)){
                        dq[i][j] = max(dq[i][j], l);
                    }
                }
            }
        }

        for (int i = 0; i < (1 << m); ++i) {
            for (int j = 0; j < m; ++j) {
                if(i & (1<<j)){
                    for (int k = 0; k < m; ++k) {
                        if(k != j && i & (1<<k)){
                            dp[j][i] = min(dp[j][i], dp[k][i^(1<<j)]+(int)v[j].size()-dq[k][j]);
                        }
                    }
                }
            }
        }
        int ans = MOD;
        for (int i = 0; i < m; ++i) {
            ans = min(ans, dp[i].back());
        }
        cout << ans << "\n";
    }

    return 0;
}


Measured memory_bytes: 3924
#include <iostream>
#include <string>
#include <cctype>

using namespace std;

int main(){
	
	string str;
	int q;
	cin >> str;
	cin >> q;
	
	string cmd;
	int a,b;
	string str_insert;
	
	for (int i=0; i<q; i++){
		cin >> cmd >> a >> b;
		
		if (cmd == "replace"){
			cin >> str_insert;
			str.replace(a ,b-a+1 , str_insert);
		}
		else if (cmd == "reverse"){
			for (int j=0; j<=1000; j++){
				if (a+j >= b-j) break;
				char d = str[a+j];
				str[a+j] = str[b-j];
				str[b-j] = d;
			}
		}
		else if (cmd == "print"){
			cout << str.substr(a,b-a+1) << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1220
#include <iostream>
#include <string>

using namespace std;

int main(){
	string ch;
	int i;

	getline(cin, ch);

		for(i=0; i<ch.size(); i++){

		if(isalpha(ch[i])){
			ch[i] = toupper(ch[i]);
		}
	}

	cout << ch << endl;
}

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

#define ll long long
const int mod=1e9+7;

ll K(ll x,ll y=mod-2){
    ll t=1;
    for (;y;y>>=1,x=x*x%mod)
        if (y&1) t=t*x%mod;
    return t;
}

ll n, ans=0;
int main(){
    cin>>n;
    for (int i=1;i<=n;++i){
        ans=(ans+K(K(3,i)*(n-i+1)%mod))%mod;
    }
    cout<<ans*K(n)%mod<<endl;
}

Measured memory_bytes: 256
public class Main{
  static int N = 1000000;
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
    int[] a, b, c;
    int i, j, n;

    a = new int[180];
    b = new int[N]; c = new int[N];

    for(i = 0;i < N;i++){
      b[i] = N; c[i] = N;
    }
    for(i = 1;i * (i + 1) * (i + 2) / 6 < N;i++){
      a[i - 1] = i * (i + 1) * (i + 2) / 6;
      b[a[i - 1] - 1] = 1;
      if((i * (i + 1) * (i + 2) / 6) % 2 == 1)c[a[i - 1] - 1] = 1;
    }

    for(i = 0;i < N;i++){
      for(j = 0;j < 180;j++){
        if(i + a[j] < N && b[i + a[j]] > b[i] + 1)b[i + a[j]] = b[i] + 1;
        if(a[j] % 2 == 1 && i + a[j] < N
        && c[i + a[j]] > c[i] + 1)c[i + a[j]] = c[i] + 1;
      }
    }

    for(;;){
      n = sc.nextInt();
      if(n == 0)break;
      out.println(b[n - 1] + " " + c[n - 1]);
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
}

Measured memory_bytes: 30272
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-19;




signed main() {
    string s;
    cin >> s;
    if (s == "A") mes("T");
    if (s == "T") mes("A");
    if (s == "G") mes("C");
    if (s == "C") mes("G");
    
    
    
}


Measured memory_bytes: 3584
#include<iostream>
#include<queue>
#include<utility>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;

int main(){
    int n,k;cin >> n >> k;
    vector<pair<int,int> > in(n);  
    for(int i=0;i<n;i++){
        int a,b;cin >> a >> b;
        a --;
        in[i] = make_pair(b,a);
    }
    sort(in.begin(),in.end());
    reverse(in.begin(),in.end());
    priority_queue<int> removable;
    set<int> used;
    long long sum = 0;
    for(int i=0;i<k;i++){
        int f = in[i].first;
        int s  =in[i].second;
        sum += f;
        if(used.count(s) > 0){
            removable.push(-f);
        }
        else{
            used.insert(s);
        }
    }
    long long tmp;
    long long x = used.size();
    long long ans = sum + x*x;
    tmp = ans;
    for(int i=k;i<n;i++){
        if(removable.empty()){
            break;
        }
        int f = in[i].first;
        int s = in[i].second;
        if(used.count(s) > 0){
            continue;
        }
        used.insert(s);
        x ++;
        long long diff = f + removable.top() + x*x - (x-1)*(x-1);
        removable.pop();

        tmp = tmp + diff;
        if(tmp > ans){
            ans = tmp;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4096
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include <cstdint>
#include <utility>
#include <tuple>
#include <map>    
#include <queue> 
#include <set>  
#include <stack> 
#include <deque>  
#include <unordered_map> 
#include <unordered_set> 
#include <bitset>

using namespace std;

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

	int64_t c = 0;
	vector<int> a(N);
	for (int i = 0; i < N; i++) {
		cin >> a.at(i);
		c ^= a.at(i);
	}

	if (c == 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
//make_tuple emplace_back next_permutation push_back make_pair second first

#if MYDEBUG
#define DBG(...) {string dst__=#__VA_ARGS__;dbgsplit(dst__);stringstream dss__; dss__<<dst__; debug(dss__,__VA_ARGS__);}
#else
#define DBG(...)
#endif
void debug(stringstream& ds){cerr<<endl;return;}
template<typename F, typename... R>void debug(stringstream& ds,const F& f, const R&... r){string n; ds>>n; cerr<< n <<'='<<f<<' '; debug(ds,r...);}
void dbgsplit(string &s){int l=s.length(),n=0;for(int i=0; i<l; ++i){if(s[i]=='(')++n;if(s[i]==')')--n;if(s[i]==','&&!n)s[i]=' ';}}
using LL = long long;
constexpr long long LINF=334ll<<53; constexpr int INF=15<<26; constexpr long long MOD=1E9+7;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    map<int,int> mp;
    for(int i=0; i<n; ++i){
        int tmp;
        cin >> tmp;
        mp[tmp]++;
    }
    int ans=0;
    for(auto x : mp){
        if(x.second>=1){
            ans^=(x.second-1)%2;
        }
    }
    cout << mp.size()-ans <<"\n";




    return 0;
}



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

int V, E, R, S[500010], T[500010], D[500010];
const int Inf = 10000*100000+100;
int C[100010];

int main(){
  cin >> V >> E >> R;
  for (int i=0; i<E; i++)
    cin >> S[i] >> T[i] >> D[i];
  for (int i=0; i<V; i++)
    C[i] = Inf;
  C[R] = 0;
  for (int t=0; t<V; t++){
    bool update = false;
    for(int i=0; i<E; i++){
      int s = S[i], t = T[i], d = D[i];
      if (C[s] < Inf && C[t] > C[s]+d){
	C[t] = C[s]+d;
	update = true;
      }
    }
    if (!update) break;
  }
  for (int i=0; i<V; i++){
    if (C[i]<Inf)
      cout << C[i] << endl;
    else 
      cout << "INF" << endl;
  }
}

Measured memory_bytes: 7372
#include <algorithm>
#include <iostream>
#include <cstring>
#include <complex>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <vector>  
#include <string>
#include <cmath>
#include <ctime>
#include <queue>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <ext/pb_ds/assoc_container.hpp>    // PBDS
#include <ext/pb_ds/tree_policy.hpp>      // PBDS

using namespace std;
using namespace __gnu_pbds;                 // PBDS

/* typedef starts */

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> PBDS_INT;               // PBDS for int
typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> PBDS_LL;    // PBDS for long long

/* typedef ends */

/* macro starts */

#define PI acos(-1)
#define EPS 1e-9
#define INF 1e9
#define fastIO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define sinD(degree) sin((degree * PI) / 180.0)
#define cosD(degree) cos((degree * PI) / 180.0)
#define tanD(degree) tan((degree * PI) / 180.0)
#define cotD(degree) (1.0 / tanD(degree))
#define secD(degree) (1.0 / cosD(degree))
#define cosecD(degree) (1.0 / sinD(degree))
#define asinD(value) (asin(value) * 180.0) / PI
#define acosD(value) (acos(value) * 180.0) / PI
#define atanD(value) (atan(value) * 180.0) / PI
#define forn(i,n) for(int i=0;i<n;i++)
#define value_at_index(x) find_by_order(x)
#define index_of(x) order_of_key(x)
#define pb push_back
#define set0(add) memset(add,0,sizeof(add))
#define max(a,b) a>b ? a : b
#define forr(i,a,b) for(int i=a;i<b;i++)

/* macro ends */

/* function starts */

/// calculates n-th (0-based) Gray Code
template<typename dataType>
dataType nthGrayCode(dataType n)
{
    return (n ^ (n >> 1));
}

/// generates all possible subsets for the given set
//template<typename dataType>
// void generateAllSubset(vector<dataType> &data)
// {
//     int i, j, n;
//     n = data.size();

//     for (i = 0; i < (1 << n); i++) {
//         for (j = 0; j < n; j++) {
//             if (i & (1 << j)) {
//                 cout << data[j] << " ";
//             }
//         }
//         cout << "\n";
//     }
// }


void swap(ll a, ll b){
	ll temp;
	temp=a;
	a=b;
	b=temp;
}


ll fact(ll n){
	ll ans=1;
  for(ll i=1;i<=n;i++){
    ans=((ans%1000000007)*(i%1000000007))%1000000007;
  }
  return ans;
}


void solve(){
 int x;
 cin >> x;
 if(x==0)cout << "1\n";
 else cout << "0\n";
}





int main()
{
  #ifndef ONLINE_JUDGE
       freopen("in.txt", "r", stdin);
       freopen("out.txt", "w", stdout);
  #endif
  fastIO;
    int t=1;
   // cin >> t;
    while(t--){
     solve();
    }
    return 0;
    }

Measured memory_bytes: 3608
#pragma GCC optimize ("O3")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
#include<cstring>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	int dig = ((tmp & ma0) ^ ma0) ? 68 - __builtin_ctzll((tmp & ma0) ^ ma0) : 0;
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci += (64 - dig >> 3);
	while ((ct = *ci++) >= '0') tmp = tmp * 10 + ct - '0';
	return tmp;
}

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


	int A[200000], B[200000];
	int N = getint();
	rep(i, N) {
		A[i] = getint();
		B[i] = getint();
	}

	nth_element(A, A + N / 2, A + N);
	nth_element(B, B + N / 2, B + N);
	if (N % 2) {
		printf("%d\n", B[N / 2] - A[N / 2] + 1);
	}
	else {
		int a = *max_element(A, A + N / 2);
		int b = *max_element(B, B + N / 2);
		printf("%d\n", b + B[N / 2] - a - A[N / 2] + 1);
	}

	Would you please return 0;
}

Measured memory_bytes: 3292
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;

int main(){
  char c;
  cin >> c;
  
  cout << (char)(c+1) << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        if (n % 2 == 1) {
            System.out.println("No");
            return;
        }
        char[] t = s.toCharArray();
        for (int i = 0 ; i < n / 2 ; i++) {
            if (t[i] != t[i + n/2]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }

}

Measured memory_bytes: 22100
#include <bits/stdc++.h>
#define maxn 200001
#define maxa 2000005
#define MOD  998244353 //1000000007
#define INF 1000000000000000000

using namespace std;

#define int int64_t
#define ll long long
#define pii pair<ll, ll>
#define piii pair<pii, ll>
#define ft first
#define sd second
#define pb push_back
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n-1; i >= 0; i--)
#define mem(a, b) memset(a, b, sizeof(a))
#define all(v) v.begin(), v.end()
#define edge(v, x, y) v[x].pb(y); v[y].pb(x);
#define popcount __builtin_popcount

void fast(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout << setprecision(10) << fixed;
}
ll ceil(ll a, ll b){ return (a+ b-1)/b; }
void flaged(bool flag){
    if(flag) cout << "Yes\n";
    else cout << "No\n";
}
// power and modulo inverse
ll power(ll a, ll b = MOD-2){
    if(b == 0) return 1;
    ll r = power(a, b/2);
    r = (r*r)%MOD;
    if(b%2 == 1) r = (r*a)%MOD;
    return r;
}
// factorial
ll fact[maxa], finv[maxa];
void calf(){
    fact[0] = finv[0] = 1;
    for(ll i = 1; i < maxa; i++){fact[i] = (fact[i-1]*i) %MOD;finv[i] = (finv[i-1]*power(i))%MOD;}
}
// nCr
ll ncr(ll N, ll R){ if(R > N) return 0; return (fact[N]*((finv[R]*finv[N-R])%MOD))%MOD;}



void solve(){
    ll n, m;
    cin >> n >> m;
    ll s = 0, x;
    for(ll i = 0; i < m; i++){
    cin >> x;
    s += x;
    }
    if(s > n)cout << "-1";
    else cout << n-s;
}

main(){
    ll t = 1; //cin >> t;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 3676
/* Never Say Die. */
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <ctime>
#include <cstdlib>
using namespace std;
int _c = 0;
template <class _T> inline void read(_T &_a) {
	_a = 0; bool _f = 0;
	while (_c < '0' || _c > '9') _f |= _c == '-', _c = getchar();
	while (_c >= '0' && _c <= '9') _a = _a * 10 + _c - '0', _c = getchar();
	if (_f) _a = -_a;
}
typedef long long LL;
typedef long double LD;

#define MAXN 200005

LL n;
LL a[MAXN], sum = 0;

int main() {
	read(n);
	if (n == 1) return puts("YES"), 0;
	for (int i = 1; i <= n; i++) {
		read(a[i]); sum += a[i];
	}
	LL hh = LL(1 + n) * n / 2;
	LL cnt = sum / hh; if (hh * cnt != sum) return puts("NO"), 0;
	a[0] = a[n];
	LL ans = 0;
	for (int i = 1; i <= n; i++) {
		if (a[i] < cnt) return puts("NO"), 0;
		LL dis = a[i] - a[i - 1];
		LL dd = cnt - dis;
		if (dd % n) return puts("NO"), 0; 
		ans += dd / n;
	}
	puts("YES");
	return 0;
}



Measured memory_bytes: 1024
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<array>
using namespace std;

int main(){

    int n;
    cin >> n;

    vector<int> h(n);

    for(int i = 0;i < n; ++i){
        cin >> h[i];
    }

    int count = 1;

    for(int i = 1;i < n; ++i){

        bool f = true;

        for(int j = 0; j < i; ++j){
            if(h[j] > h[i])f = false;
        }

        if(f)++count;

    }

    cout << count << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;




public class Main {

    public static void main(String[] args) {

    	Main main=new Main();

    	main.run();

    }

    void run() {
    	Scanner sc=new Scanner(System.in);

    	int X=sc.nextInt();

    	for(int i=1;i<=X;i++) {

    		int max=i*(i+1)/2;

    		if(X<=max) {
    			System.out.println(i);
    			return;
    		}

    	}

    }


}



Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll a, b, c;
  in3(a, b, c);
  out(c);
  hina;
  out(a);
  hina;
  out(b);
  memi;
}

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

int main(){
    int N;
    cin >> N;
    if(N%6==0){
        cout << N/3 << endl;
    }
    else if(N%6<3){
        cout << (N/6)*2 << endl;
    }
    else{
        cout << (N/6)*2+1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256