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

using namespace std;

typedef long long LL;

const int nmax = 100010; const LL mod = 1000000007;

LL N,H,ans,a[nmax];

inline void Solve(){
   int i,j,x,y,l,r,u;
   cin >> N;
   for(i = 1; i <= N; ++i)
      cin >> a[i];
   if(N == 1){
      cout << "1\n";
      return;
   }
   u=-1;
   if(a[1] == a[2])u=0;
   if(a[1] < a[2])u=1;
   ans=1;

   for(i = 3; i <= N; ++i){
      if(u == 1){
         if(a[i] < a[i-1]){
            ans++;
            if(i == N)break;
            if(a[i+1] == a[i])u=0;
            if(a[i+1] < a[i])u=-1;
         }
      }
      else if(u == 0){
         if(a[i] > a[i-1])
            u = 1;
         else if(a[i] < a[i-1])
            u=-1;
      }
      else if(u == -1){
         if(a[i] > a[i-1]){
            ans++;
            if(i == N)break;
            if(a[i+1] == a[i])u=0;
            if(a[i+1] < a[i])u=-1;
            if(a[i+1] > a[i])u=1;
         }
      }
   }
   cout << ans << '\n';
}

inline void Reset(){

}

int main(void){
   int tests;
//   freopen("txt.in","r",stdin);
//   freopen("txt.out","w",stdout);
   ios::sync_with_stdio(false);

   tests=1;
  for(int j = 1; j <= tests; ++j){
      Solve();
      Reset();
  }
    return 0;
}


Measured memory_bytes: 1024
use std::io::*;
use std::str::FromStr;
use std::cmp;
use std::collections::HashMap;
use std::collections::HashSet;
use std::char;
use std::cmp::{min, max};
use itertools::{Itertools, enumerate};
use std::ops::{Add, AddAssign};
use num_integer::{Integer, gcd, lcm};
use std::collections::VecDeque;
use smallvec::alloc::collections::LinkedList;
use regex::internal::Char;
use std::iter::once;

fn read<T: FromStr>(stdin: &mut StdinLock) -> T {
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn read_tuple2<T: FromStr, S: FromStr>(stdin: &mut StdinLock) -> (T, S) {
    let a = read(stdin);
    let b = read(stdin);
    (a, b)
}

fn read_tuple3<T: FromStr, S: FromStr, R: FromStr>(stdin: &mut StdinLock) -> (T, S, R) {
    let a = read(stdin);
    let b = read(stdin);
    let c = read(stdin);
    (a, b, c)
}

fn lower_bound<T: Copy, F>(v: &Vec<T>, f: F) -> Option<usize> where
    F: Fn(T) -> bool
{
    let mut left = 0;
    let mut right = v.len() - 1;
    if !f(v[left]) {
        return None;
    }
    if f(v[right]) {
        return Some(right);
    }
    loop {
        if right - left == 1 {
            return Some(left);
        }
        let mid = (left + right) / 2;
        if f(v[mid]) {
            left = mid;
        } else {
            right = mid;
        }
    }
}


fn main() {
    // template
    let stdin = stdin();
    let mut stdin = stdin.lock();
    let out = stdout();
    let mut out = BufWriter::new(out.lock());
    // template ends
    let n:u32 = read(&mut stdin);
    let a_list:Vec<u32> = (0..n).map(|_|read(&mut stdin)).collect();
    let mut ans = 0;
    for (index, a) in a_list.iter().enumerate() {
        if index % 2 ==0 && a % 2 == 1 {
            ans += 1;
        }
    }
    write!(out, "{}", ans);
}



Measured memory_bytes: 2164
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef pair<int, int> P;

class State{
public:
    int y, x, f, c;
    State(){}
    State(int y, int x, int f, int c): y(y), x(x), f(f), c(c) {}
    bool operator < (const State &s) const{
        return c > s.c;
    }
};

const int INF = 1e7;
int w, h;
int a[61][31], d[61][31][2];
priority_queue<State> q;
int dy[9] = {-2, -1, -1, 0, 0, 0, 1, 1, 2};
int dx[9] = { 1,  1,  2, 1, 2, 3, 1, 2, 1};
 
bool contain(int y, int x){
    return (0 <= y && y < h && 0 <= x && x < w);
}

int dijkstra(){
    while(!q.empty()){
        State u = q.top(); q.pop();
        if(a[u.y][u.x] == -2) return d[u.y][u.x][u.f];
        // if(u.c > d[u.y][u.x][u.f]) continue;
        rep(i, 0, 9){
            int nf = (u.f + 1) % 2;
            int k = (u.f == 0 ? 1 : -1);
            int ny = u.y + dy[i];
            int nx = u.x + k * dx[i];
            
            if(!contain(ny, nx) || a[ny][nx] == -INF || d[ny][nx][nf] != INF) continue;
            int cost = d[u.y][u.x][u.f] + (a[ny][nx] == -2 ? 0 : a[ny][nx]);
            if(cost < d[ny][nx][nf]){
                d[ny][nx][nf] = cost;
                q.push(State(ny, nx, nf, cost));
            }
        }
    }
    return -1;
}

signed main(){
    while(cin >> w >> h && w + h){
        q = priority_queue<State>();
        rep(i, 0, 61) rep(j, 0, 31) rep(k, 0, 2) d[i][j][k] = INF;        
        rep(i, 0, h){
            rep(j, 0, w){
                char c;
                cin >> c;
                if(c == 'X') a[i][j] = -INF;
                else if(c == 'S'){
                    a[i][j] = -1;
                    rep(k, 0, 2){
                        q.push(State(i, j, k, 0));
                        d[i][j][k] = 0;
                    }
                }else if(c == 'T') a[i][j] = -2;
                else a[i][j] = c - '0';
            }
        }
        cout << dijkstra() << endl;
        // rep(k, 0, 2){
        //     rep(i, 0, h){
        //         rep(j, 0, w){
        //             printf("%8d ", d[i][j][k]);
        //         }
        //         cout << endl;
        //     }
        //     cout <<endl;
        // }
    }
}

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

int n,d[100003],ans;

int gya(int x){
	if(x == 1) return 0;
	else return 1;
}

int main(){
	while(1){
	scanf("%d",&n);
	int h[2][100004] = {0};
	ans = 0;
	if(n == 0)break;
	for(int i = 1;i <= n;i++){
		scanf("%d",&d[i]);
	}
	int pre = -1;
	for(int i = 1;i <= n;i++){
		if(i % 2 == 1){
			h[d[i]][i] = h[d[i]][i-1] + 1;
			h[gya(d[i])][i] = 0;
			if(d[i] == 0)ans++;
			pre = d[i];
		}else{
			if(pre == d[i]){
				if(d[i] == 0)ans++;
				h[d[i]][i] = h[d[i]][i-1] + 1;
				h[gya(d[i])][i] = 0;
				continue;
				pre = d[i];
			}
			int gyaku = gya(d[i]);
			int change = h[gyaku][i-1];
			if(d[i] == 0)ans += change + 1;
			else ans -= change;
			h[d[i]][i] = h[d[i]][i-change-1] + change + 1;
			pre = d[i];
		}
	}
	printf("%d\n",ans);
	}
	return 0;
}


Measured memory_bytes: 2364
import java.util.ArrayDeque;
import java.util.Scanner;
import java.util.Queue;

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

        char[][] grid = new char[h][w];

        for (int i=0; i<h; i++){
            String s = sc.next();
            grid[i] = s.toCharArray();
        }

        boolean[][] visited = new boolean[h][w];

        for (int i=0; i<h; i++){
            for (int j=0; j<w; j++){
                if (grid[i][j]=='#'){
                    visited[i][j] = true;
                }
            }
        }

        int[][] d = new int[h][w];

        long ans = 0;

        Queue<int[]> q = new ArrayDeque();

        int[] arr = {0, 0};

        for (int i=0; i<h; i++){
            for (int j=0; j<w; j++){
                if (grid[i][j]=='#'){
                    d[i][j] = 0;
                    int[] a = {i, j};
                    q.add(a);
                }
            }
        }
//        System.out.println(q.size());

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

        while (!q.isEmpty()){
            int[] tmp = q.poll();
            int y = tmp[0];
//            System.out.print(y);
            int x = tmp[1];
//            System.out.println(x);
            int cnt = d[y][x];
            for (int i=0; i<4; i++){
                if (0<=y+dy[i] && y+dy[i]<=h-1 && 0<=x+dx[i] && x+dx[i]<=w-1){
                    if (!visited[y+dy[i]][x+dx[i]] ){
                        visited[y+dy[i]][x+dx[i]] = true;
                        int[] add = {y+dy[i], x+dx[i]};
                        q.add(add);
                        d[y+dy[i]][x+dx[i]] = cnt+1;
//                        System.out.println(d[y+dy[i]][x+dx[i]]);
                    }
                }
            }
        }

        for (int i=0; i<h; i++){
            for (int j=0; j<w-1; j++){
//                System.out.print(d[i][j]);
            }
//            System.out.println(d[i][w-1]);
        }

        for (int i=0; i<h; i++){
            for (int j=0; j<w; j++){
                ans = Math.max(ans, d[i][j]);
            }
        }
        System.out.println(ans);


    }
}

Measured memory_bytes: 65900
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int n, m, a, b, q[51][51], r[51][51];
vector<int>p[50];
int main() {
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		cin >> a;
		for (int j = 0; j < a; j++) {
			cin >> b; p[i].push_back(b);
		}
		for (int j = 0; j < a; j++) {
			for (int k = 0; k < a; k++) {
				q[p[i][j]][p[i][k]] = 1;
			}
		}
	}
	cin >> m;
	for (int i = 0; i < m; i++) {
		cin >> a >> b; r[a][b] = 1; r[b][a] = 1;
	}
	int sum = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			if (q[i][j] == 1 && r[i][j] == 1) {
				sum++; break;
			}
		}
	}
	cout << sum << endl;
	return 0;
}

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


void solve(long long N, long long K, std::vector<long long> V){
    // A,右からとる回数
    // B,左から取る回数
    // A + B <= N, A + B <= K
    // C,マイナスを捨てる個数 A + B + C <= K
    
    long long ans = 0;
    for(int i = 0; i <= K && i <= N; i++){
        for(int j = 0; j <= K && i + j <= K && i+j <= N; j++){
            // 0からi個までと、K-1からj個まで加える
            vector<long long> v;
            int left=0;
            while(left < i){
                v.push_back(V[left]);
                left++;
            }
            int right = 0;
            while(right < j){
                v.push_back(V[V.size()-1-right]);
                right++;
            }
            sort(v.begin(), v.end());

            long long tmpans = 0;
            for(auto x:v){
                tmpans += x;
            }
            int cnt = 0;
            for(auto x:v){
                if(x > 0){
                    break;
                } else { 
                    if(i + j + cnt >= K){
                        break;
                    } else { 
                        tmpans -= x;
                        cnt++;
                    }
                }
            }

            if(tmpans > ans){
                ans = tmpans;
            }
        }
    }
    cout << ans << endl;

}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<long long> V(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&V[i]);
    }
    solve(N, K, std::move(V));
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<stdlib.h>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main()
{
	int a[3];
	for(int i=0;i<3;i++)
	{
		cin>>a[i];
	}
	int count=0;
	while(1)
	{
		if(a[0]==a[1]&&a[0]==a[2]&&a[1]==a[2])
		{
			break;
		}
		sort(a,a+3);
		 int max=a[2];
		if(a[0]==a[1])
		{
			count+=a[2]-a[0];
			a[0]=a[2];
			a[1]=a[2];
		}
		else
		{
			a[0]+=2;
			count++;
		}
	}
	cout<<count<<endl;
}

Measured memory_bytes: 256
import java.util.*;

/*
問題文
英大文字のみからなる文字列 S があります。
また、整数 N が与えられます。

S の各文字を、アルファベット順で N 個後の文字に置き換えた文字列を出力してください。

ただしアルファベット順で Z の 1 個後の文字は A とみなします。

制約
0≤N≤26
1≤|S|≤10^4
S は英大文字のみからなる

*/

public class Main {
    public static void main(String[] args){

        // 配列
        String item[] = {
            "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L","M", "N",
            "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
        };
        List<String> list = Arrays.asList(item); 

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();

        String temp[] = new String[s.length()];
        String ans = "";

        for (int i = 0; i < s.length(); i++) {
            temp[i] = String.valueOf(s.charAt(i));
        }

        for (int i = 0; i < temp.length; i++) {
            int place = list.indexOf(temp[i]);

            if (place + n <= 25) {
                ans += item[place + n];
            } else {
                ans += item[place + n-26];
            }
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 147156
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;

int main() {
    string s;
    int x, y;
    cin >> s >> x >> y;
    vec<ll> xs, ys;

    bool forx  = true;
    bool first = true;
    int now    = 0;
    for (auto e : s) {
        if (e == 'F') {
            ++now;
        } else {
            if (first) {
                x -= now;
                first = false;
            } else if (now > 0) {
                forx ? xs.push_back(now) : ys.push_back(now);
            }
            forx = !forx;
            now  = 0;
        }
    }
    if (first) x -= now;
    else
        forx ? xs.push_back(now) : ys.push_back(now);

    vec<vec<bool>> a(2, vec<bool>(8001, 0));
    a[0][0] = true;
    for (auto e : xs) {
        rep(i, 8000) {
            if (!a[0][i]) continue;
            a[1][abs(i - e)] = true;
            a[1][abs(i + e)] = true;
        }
        a[0] = a[1];
        a[1] = vec<bool>(8001, 0);
    }

    vec<vec<bool>> b(2, vec<bool>(8001, 0));
    b[0][0] = 1;
    for (auto e : ys) {
        rep(i, 8001) {
            if (!b[0][i]) continue;
            b[1][abs(i - e)] = true;
            b[1][abs(i + e)] = true;
        }
        b[0] = b[1];
        b[1] = vec<bool>(8001, 0);
    }
    if (a[0][abs(x)] && b[0][abs(y)]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, q; cin >> n >> q;
  string s; cin >> s;
  vector<int> psum(n);
  for(int i = 0; i < n - 1; i++) psum[i] = s[i] == 'A' && s[i + 1] == 'C';
  for(int i = 1; i < n; i++) psum[i] += psum[i - 1];
  for(int i = 0; i < q; i++){
    int l, r; cin >> l >> r; r--; l--;
    cout << psum[r - 1] - (l > 0 ? psum[l - 1] : 0) << endl;
  }
  return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MAX_INF 0x7f
#define MAX_INF_VAL 0x7f7f7f7f
#define pi 3.141592653589
#define eps 1e-6
//#define p 2173412051LL
//#define sz 2

using namespace std;

char s[ 100 ];

int main() {
	int n;
	scanf( "%s", s );
	n = strlen( s );
	if( n % 2 ) {
		printf( "No" );
		return 0;
	}
	for( int i = 0; i < n; i += 2 ) {
		if( s[ i ] == 'h' && s[ i + 1 ] == 'i' ) {
			continue;
		}
		printf( "No" );
		return 0;
	}
	printf( "Yes" );
	return 0;
}

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

#define MOD 1000000007

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main() {
    ll N, K; cin >> N >> K;
    ll ans = modpow(K, N, MOD);
    //cout << ans << endl;
    vector<ll> vec(K+1);
    for (int i = K; i >= 2; i--) {
        /*if (N%i == 0)*/ vec[i] = modpow(K/i, N, MOD);
        //else vec[i] = modpow(N/i + 1, N, MOD);
        for (int j = 2; i*j <= K; j++) {
            vec[i] = ((vec[i] + MOD) - vec[i*j]) % MOD;
        }
        ans += (vec[i] * (i-1)) % MOD;
        ans %= MOD;
    }
    //for (int i = 1; i <= K; i++) cout << " " << vec[i];
    //cout << endl;
    cout << ans << endl;
}


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

int main(){
    int n;
    cin>>n;
    vector<string> s(n);
    for(auto &t:s){
        cin>>t;
    }
    map<string,int> vote;
    for(auto &t:s){
        if(vote.count(t)){
            vote.at(t)+=1;
        }else{
            vote[t]=1;
        }
    }
    int max=0;
    for(auto &t:vote){
        if(max<t.second){
            max=t.second;
        }
    }
    for(auto &t:vote){
        if(max==t.second){
            cout<<t.first<<endl;
        }
    }
}

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

int main() {
    // 制約見て！！！デカかったらlong longにすること！
    int n, d, x;
    cin >> n >> d >> x;
    vector<int> a(n);
    rep(i, n) cin >> a[i];

    int choco = 0;
    rep(i, n) {
        choco += d / a[i] ;
        if(d%a[i]!=0 ) choco++;
    }

    cout << choco + x << endl;
}

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

using namespace std;

const int MAX_N = 100000, INDEX = 1;

int n, a[MAX_N + INDEX];

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

    cin >> n;

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

    int p = 0;
    for (int i = 1; i <= n; i++) {
        p += a[i];

        p %= 2;
    }

    if (p == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}


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

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

long long MOD = 1000000000 + 7;

bool compare(pii x, pii y){
  return x.second < y.second;
}

int main(){
  cout << setprecision(10);
  int N,M;
  cin >> N >> M;
  vector<pii> v(M);
  for(int i = 0; i < M; i++){
    int tmp1,tmp2;
    cin >> tmp1 >> tmp2;
    v.at(i) = make_pair(tmp1,tmp2);
  }

  sort(v.begin(), v.end(), compare);

  int ans = 1;
  int now = v[0].second;

  for(int i = 1; i < M; i++){
    if(v[i].first < now){
      continue;
    } else { 
      ans += 1;
      now = v[i].second;
    }
  }
  cout << ans << endl;



}


Measured memory_bytes: 1024
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

const long long int mod=1000000007,INF=9999999999999;

long long int dp[5500][5500]={};
long long int LDSmemo=0,dp2[200010],LISs[200005];

long long int GyakuLIS(long long int n,long long int s[]){
	LDSmemo=0;
	for(long long int i=0;i<n;i++){
		dp2[i]=INF;
		LISs[i]=s[n-i];
	}
	for(long long int i=0;i<n;i++){
		*lower_bound(dp2,dp2+n,LISs[i])=LISs[i];
	}
    
	return lower_bound(dp2,dp2+n,INF)-dp2;
}

long long int kaijyou[200005]={1};


long long int ruijyou(long long int a,long long int b){
	if(b==0)return 1;
	long long int res=ruijyou(a*a%mod,b/2);
	if(b & 1)res=res*a%mod;
	return res;
}
long long int combination(long long int a,long long int b){
	long long int res=kaijyou[a]*ruijyou(kaijyou[b],mod-2)%mod;
	res=res*ruijyou(kaijyou[a-b],mod-2)%mod;
	return res;
}

int main(){
	long long int n,m,s[200005]={},type,res=0;
	cin>>n>>m;
	for(long long int i=1;i<=2*n;i++){
		kaijyou[i]=i*kaijyou[i-1];
		kaijyou[i]%=mod;
	}
    
	for(int i=1;i<=n;i++){
		cin>>s[i];
	}
	type=GyakuLIS(n,s);
    
	if(type>2){cout<<"0"<<endl;return 0;}
    
	if(type==1){
		for(int i=n-m;i<=m;i++){
			res+=combination(n,i);
			res%=mod;
		}		
		cout<<res<<endl;
		
	}else{
		long long int before=0,mode=0,count1=0,count2=0,memo,mymax=0,used[5500]={};
		vector<pair<long long int,long long int> >vec;
		vec.push_back({0,0});
		for(int i=1;i<=n;i++){
            
            used[s[i]]=1;
            before=mode;
            mode=0;
            for(int j=1;j<=i;j++){
                if(used[j]==0){
                    
                    mode=1;
                }
            }
            
            if(mode==0){
                if(mymax>s[i]){count2++;}
                else{mymax=s[i];count1++;}
                vec.push_back({count1,count2});
                
                count1=0;
                count2=0;
            }else{
                
                    if(mymax>s[i]){count2++;}
                    else{mymax=s[i];count1++;}
                
                
            }
		}
        
		if(count1>0||count2>0){vec.push_back({count1,count2});}
		dp[0][0]=1;
		for(int i=1;i<vec.size();i++){
			for(int j=0;j<=m;j++){
				if(j+vec[i].first<=m){dp[i][j+vec[i].first]+=dp[i-1][j];}
				if(j+vec[i].second<=m){dp[i][j+vec[i].second]+=dp[i-1][j];}
				dp[i][j+vec[i].first]%=mod;
				dp[i][j+vec[i].second]%=mod;
			}
		}
        res=0;
		for(int i=n-m;i<=m;i++){
			res+=dp[vec.size()-1][i];
		}
		cout<<res%mod<<endl;
	}
}



Measured memory_bytes: 122628
package main

import "fmt"

func main() {
	var a int
	var b int
	fmt.Scan(&a)
	fmt.Scan(&b)
	if a < b {
		fmt.Println("a < b")
	} else if a > b {
		fmt.Println("a > b")
	} else {
		fmt.Println("a == b")
	}

}



Measured memory_bytes: 1108
#include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define P(x) cout << (x) << "\n"
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i));
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
const constexpr int MAX = 1e5;
vi G[MAX], prenum(MAX, 0), parent(MAX, 0), lowest(MAX, 0);
int n, timer{1};
vb visited(MAX, false);
inline void dfs(int current, int prev) {
	prenum[current] = lowest[current] = timer++;
	visited[current] = true;
	int next;
	rep(i, 0, len(G[current])) {
		next = G[current][i];
		if(!visited[next]) {
			parent[next] = current;
			dfs(next, current);
			lowest[current] = min(lowest[current], lowest[next]);
		} else if(next != prev) {
			lowest[current] = min(lowest[current], prenum[next]);
		}
	}
}
inline void art_points() {
	dfs(0, -1);
	set<int> ap;
	int np = 0, p;
	rep(i, 1, n) {
		p = parent[i];
		if(p == 0) ++np;
		else if(prenum[p] <= lowest[i]) ap.emplace(p);
	}
	if(np > 1) ap.emplace(0);
	for(auto it : ap) P(it);
}
int main() {
	int m; cin >> n >> m;
	int s, t;
	rep(i, 0, m) {
		cin >> s >> t;
		G[s].eb(t);
		G[t].eb(s);
	}
	art_points();
	return 0;
}

Measured memory_bytes: 7388
A = []
B = []
for i in range(5):
  A.append(int(input()))
for i in A:
  B.append((i+9) % 10)
c = B.index(min(B))
for i in range(5):
  if i == c: continue
  else:
    if A[i] % 10 == 0: continue
    else:
      A[i] = (A[i]//10 + 1) * 10

print(sum(A))


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

typedef long long ll; // -9,223,372,036,854,775,808 から 9,223,372,036,854,775,807

template <class T> using vec = std::vector<T>;
template <class T> using vec2 = vec<vec<T>>;
template <class T> using vec3 = vec<vec<vec<T>>>;

// #define DEBUG

void fixAt(int pos, vec<bool>& fixed, vec2<int>& derives){
    if(fixed.at(pos)){
        return;
    }

    fixed.at(pos) = true;
    for(auto iter: derives.at(pos)){
        fixAt(iter, fixed, derives);
    }

    return;

}

void solve(long long N, long long M, std::vector<long long> X, std::vector<long long> Y, std::vector<long long> Z){
    vec<ll> covered(N);
    vec2<int> derives(N);
    vec<bool> fixed(N);
    ll NumFixed = 0;
    ll cost = 0;

    // shift
    for(int i=0; i < M; i++){
        X.at(i)--;
        Y.at(i)--;
    }

    // 下準備
    // derivesをつくる
    for(int i=0; i < M; i++){
        derives.at(X.at(i)).push_back(Y.at(i));
        derives.at(Y.at(i)).push_back(X.at(i));
        covered.at(X.at(i))++;
        covered.at(Y.at(i))++;
    }

    #ifdef DEBUG
    printf("*START: hoge\n");
    for(auto iter: covered){
        cout << iter << " ";
    }
    cout << endl;
    for(int i=0; i < N; i++){
        cout << i << ": ";
        for(auto iter: derives.at(i)){
            cout << iter << ", "; 
        }
        cout << endl;
    }
    printf("*END: hoge\n");
    #endif

    vec<pair<ll, int>> covered2;
    for(int i=0; i < N; i++){
        covered2.push_back(pair<ll, int>(-covered.at(i), i));
    }
    sort(covered2.begin(), covered2.end());

    // solve
    for(auto iter: covered2){
        int pos = iter.second;
        if(fixed.at(pos)){
            continue;
        }

        cost++;
        fixAt(pos, fixed, derives);

        // // posを確定
        // fixed.at(pos) = true;
        // NumFixed++;
        // cost++;

        // // はせいして確定
        // for(auto iter2: derives.at(pos)){
        //     if(fixed.at(iter2)){
        //         continue;
        //     }
        //     fixed.at(iter2) = true;
        //     NumFixed++;
        // }
        #ifdef DEBUG
        printf("*START: hogehoge\n");
        printf("Pos %d is fixed\n", pos);
        for(auto iter: fixed){
            cout << iter << " ";
        }
        cout << endl;
        printf("*END: hogehoge\n");
        #endif
    }

    cout << cost << endl;

    
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> X(M);
    std::vector<long long> Y(M);
    std::vector<long long> Z(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&X[i]);
        scanf("%lld",&Y[i]);
        scanf("%lld",&Z[i]);
    }
    solve(N, M, std::move(X), std::move(Y), std::move(Z));
    return 0;
}


Measured memory_bytes: 15216
#define _USE_MATH_DEFINES
#define MAX_N 1000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>

using namespace std;

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

static const double eps = 1e-8;

const static double r = 6378.1;

int main(){
	double f1,g1,f2,g2;
	//ido,kedo
	while(~scanf("%lf %lf %lf %lf",&f1,&g1,&f2,&g2)){
		if(f1==g1 && g1==f2 && f2==g2 && g2 == -1) break;

		f1 = (90.0-f1) * M_PI / 180.0;
		g1 = g1 * M_PI / 180.0;

		f2 = (90.0-f2) * M_PI / 180.0;
		g2 = g2 * M_PI / 180.0;

		double x1 = r * sin(f1) * cos(g1);
		double y1 = r * sin(f1) * sin(g1);
		double z1 = r*cos(f1);

		double x2 = r * sin(f2) * cos(g2);
		double y2 = r * sin(f2) * sin(g2);
		double z2 = r*cos(f2);

		double dist = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) + (z1-z2)*(z1-z2);

		int res = r*acos(1-dist/(2*r*r))+0.50+eps;
		printf("%d\n",res);
	}
}

Measured memory_bytes: 3468
n,k = map(int,input().split())
s = list(input())

if s[k - 1] == 'A':
    s[k - 1] = 'a'
if s[k - 1] == 'B':
    s[k - 1] = 'b'
if s[k - 1] == 'C':
    s[k - 1] = 'c'
strA = ''.join(s)
print(strA)

Measured memory_bytes: 9192
l=[]

N,K=(int(x) for x in input().split())

for i in range(K):
    d=int(input())
    A=list(map(int, input().split()))
    l.extend(A)

j=list(range(1,N+1))

a=len(set(l))
b=len(set(j))
print(b-a)


Measured memory_bytes: 9188
package main

import (
	"fmt"
	"strings"
)

func main() {
	// Code for A - Can you get AC?
	var S string
	fmt.Scan(&S)

	if strings.Index(S, "AC") != -1 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


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

typedef long long int integer;

integer solve(integer e) {
  integer ans = 1100100100;
  for (integer z = 0; z*z*z <= e; z++) {
    for (integer y = 0; z*z*z + y*y <= e; y++) {
      ans = min(ans, (e-y*y-z*z*z) + y + z);
    }
  }
  return ans;
}

int main() {
  integer e;
  while (cin >> e and e != 0) {
    cout << solve(e) << endl;
  }
}

Measured memory_bytes: 1156
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
using namespace std;
#define MAX 2000000
#define INFTY (1 << 30)
  
int A[MAX + 1];
int H;
  
void maxHeapify(int i) {
  int left = 2 * i;
  int right = 2 * i + 1;
  int largest;
  
  if ( left <= H && A[left] > A[i] ) largest = left;
  else largest = i;
  
  if ( right <= H && A[right] > A[largest] ) largest = right;
  
  if ( largest != i ) {
    swap(A[i], A[largest]);
    maxHeapify(largest);
  }
}
  
void heapIncreaseKey(int i, int key) {
  if ( key < A[i] ) return;
  A[i] = key;
  while ( i > 1 && A[i / 2] < A[i] ) {
    swap(A[i], A[i / 2]);
    i /= 2;
  }
}
  
void insert(int key) {
  A[++H] = -INFTY;
  heapIncreaseKey(H, key);
}
  
int heapExtractMax() {
  if ( H < 1 ) return -INFTY;
  int max = A[1];
  A[1] = A[H--];
  maxHeapify(1);
  
  return max;
}
  
int main() {
  int key;
  char com[10];
  
  while ( 1 ) {
    scanf("%s", com);
    if ( com[0] == 'e' && com[1] == 'n' ) break;
    if ( com[0] == 'i' ) {
      scanf("%d", &key);
      insert(key);
    } else {
      printf("%d\n", heapExtractMax());
    }
  }
  
  return 0;
}

Measured memory_bytes: 7064
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;

int countACstring(string st){
	if(st.length() < 2) return 0;
	int length = st.length();
	//cout<<length<<endl;
	int ans = 0;
	for(int i = 0; i <= length - 2; i++){
		if(st[i] == 'A' && st[i+1] == 'C'){
			ans++;
		}
	}
	return ans;
}

int main()
{
	int N,Q;
	string s;
	cin>>N>>Q;
	cin>>s;
	int sum = countACstring(s);
	int *numArray = new int[N];
	numArray[0] = sum;
	//cout<<numArray[0]<<" ";
	for(int i =1; i < N; i++){
		if(s[i-1] == 'A' && s[i] == 'C'){
			sum--;
		}
		numArray[i] = sum;
		//cout<<numArray[i]<<" ";
	}
	//cout<<endl;
	rep(i,Q){
		int l,r;
		cin>>l>>r;
		cout<<numArray[l-1] - numArray[r-1]<<endl;
	}
	return 0;
}

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

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

    int ans = a*b/2;

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


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

#ifdef LOCAL
	#define D(a) cerr << #a << " = " << a << endl
#else
	#define D(a)
	#define cerr false && cerr
#endif
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define dforsn(i,s,n) for(int i=int(n-1);i>=int(s);i--)
#define forsn(i,s,n) for(int i=int(s);i<int(n);i++)
#define dforn(i,n) dforsn(i,0,n)
#define forn(i,n) forsn(i,0,n)
#define all(a) a.begin(),a.end()
#define si(a) int((a).size())
#define pb emplace_back
#define mp make_pair
#define snd second
#define fst first
#define endl '\n'
using pii = pair<int,int>;
using vi = vector<int>;
using ll = long long;

const int N = 1e5+2;
int n, dif[N];
vi adj[N];
bool vis[N];

int sum(int u) {
    vis[u] = true;
    int res = dif[u];

    for (int v : adj[u]) if (!vis[v]) res = (res + sum(v)) % 26;

    return res;
}

int main() {
	fastio;
	
    // leo string
    string s; cin >> s; 
    n = si(s); 
    s = 'a' + s + 'a';

    // calculo diferencias
    forn(i, n+1) dif[i] = (s[i+1] - s[i] + 26) % 26;

    // agrego arcos
    int k; cin >> k;
    while (k--) {
        int l, r; cin >> l >> r; l--;
        adj[l].pb(r), adj[r].pb(l);
    }
    forn(i, (n+1)/2) {
        int j = n-i;
        adj[i].pb(j), adj[j].pb(i);
    }

    // controlo suma
    bool can = true;
    forn(u, n+1) if (!vis[u] && sum(u) != 0) can = false;

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


Measured memory_bytes: 8812
#include <bits/stdc++.h>
#define ll long long
#define fori(n) for(long long i=0;i<n;i++)
#define forj(n) for(long long j=0;j<n;j++)
#define sp(n) setprecision(n)
#define mp make_pair
#define mt make_tuple
#define pi 3.14159265358979323846264
#define MOD 1000000007

using namespace std;
/*
int primeFactors(ll n)  
{  ll f=0;
    // Print the number of 2s that divide n  
    while (n % 2 == 0)  
    {  
        f++;
        n = n/2;  
    }  
  
    // n must be odd at this point. So we can skip  
    // one element (Note i = i +2)  
    for (int i = 3; i <= sqrt(n); i = i + 2)  
    {  
        // While i divides n, print i and divide n  
        while (n % i == 0)  
        {  
            f++; 
            n = n/i;  
        }  
    }  
  
    // This condition is to handle the case when n  
    // is a prime number greater than 2  
    if (n > 2)  
        f++;
        
 return f;        
}  
  
bool isPrime(long long k){
    if(k<=1){return false;}
    if(k==2){return true;}
    if(k%2==0){return false;}
    long long i = 3;
   while (i*i <= k) {if (k % i == 0) {return false;}i += 2;}
return true;
}
 
ll binomialCoeff(ll n, ll k){
    ll C[n + 1][k + 1];ll i, j;
    for (i = 0; i <= n; i++){
        for (j = 0; j <= min(i, k); j++){
            if (j == 0 || j == i){C[i][j] = 1;}
            else{C[i][j] = ((C[i - 1][j - 1] + C[i - 1][j]))%MOD;}}}
    return C[n][k];
 }
 
ll gcd(ll a, ll b){if (b == 0)
        return a;return gcd(b, a % b);}
 
ll expmod(ll n,ll k,ll m){
    ll ans;
    ans=1;
    fori(k){
        ans=(ans*n)%m;
    }
    return ans;
}
//define temp-functions below
 
 
//some definitions and global variables
vector<ll> primes;
void storePrime(ll n){
    fori(n){
        if(isPrime(i+1)&&(n%(i+1)==0)){primes.push_back(i+1);}
    }
}*/
 
int main(){ //make cin/cout faster
 ios_base::sync_with_stdio(false);
 cin.tie(NULL);cout.tie(NULL);
ll n,m;cin>>n>>m;
ll a[n];double p=0;
for(ll i=0;i<n;i++) {cin>>a[i];p=p+a[i];}
m=4*m;
p=p/m;ll x=0;
sort(a,a+n);
for(ll i=n-1;i>=0;i--){
    if(a[i]>=p) x++;
    else break;
}
m=m/4;
   if(x>=m) cout<<"Yes\n";
   else cout<<"No\n";
      
      
    

return 0;}

Measured memory_bytes: 256
#include <iostream>
#include <queue>

using namespace std;

typedef struct{
	string name;
	int time;
} Process;

int main(){
	queue<Process> processes;
	Process p;
	int n, q, i, elapsed = 0;
	cin >> n >> q;

	for(i = 0; i < n; i++){
		cin >> p.name >> p.time;
		processes.push(p);
	}

	while(processes.size() != 0){
		p = processes.front(); processes.pop();
		if(p.time <= q){
			elapsed += p.time;
			cout << p.name << ' ' << elapsed << endl;
		}else{
			p.time -= q;
			elapsed += q;
			processes.push(p);
		}
	}

	return 0;
}


Measured memory_bytes: 6240
from itertools import combinations

n, k = map(int, input().split())
a = list(map(int ,input().split()))

b = list(range(1, n))
c = combinations(b, k-1)

min_sum = 10**30
for i in c:
    sum = 0
    target = a[0] + 1
    for j in range(1, n):
        if j in i:
            if target >= a[j]:
                sum += (target - a[j])
                target += 1
            else:
                target = a[j] + 1
        elif j not in i and a[j] > target:
            target = a[j] + 1
    if sum < min_sum:
        min_sum = sum

print(min_sum)

Measured memory_bytes: 3064
//is there any case of -1 or any special corner cases ?
#include<bits/stdc++.h>
using namespace std;
#define int long long int 
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define vi vector<int>
#define pi pair<int,int>
#define all(v) v.begin(),v.end()
#define zeros(arr) memset(arr,0,sizeof(arr));
#define precise(num)  cout<<fixed; cout << std::setprecision(num)
#define nl cout<<"\n";
#define test int t;cin>>t;while(t--) 
const int maxx  = 3*1e5 , limit = 9*1e18 , MOD=1e9+7;
string binary(int n){bitset<60>b(n) ;string p =b.to_string();return p;}
int decimal(string n) { int dec_value = 0;  int base = 1;  for (int i = n.size() - 1; i >= 0; i--) { if (n[i] == '1') 
dec_value += base; base = base * 2; } return dec_value; } 
bool isPrime(int n){if (n <= 1) return false; if (n <= 3) return true;if (n % 2 == 0 || n % 3 == 0) return false;
for (int i = 5; i * i <= n; i = i + 6) if (n % i == 0 || n % (i + 2) == 0) return false; return true; }
int pow (int x, int n,int mod) {if (n == 0) return 1; int res = pow (x, n / 2,mod);res = (res * res) % mod;if (n % 2) res = (res * x ) % mod;return res;}
#define boost  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n';

int32_t main(){
    boost;
    
    int n;
    cin>>n;
    
    for(int i =1 ; i <= n ; i ++ ){
        
        int res = 0 ;
        for(int k = 1 ; k <= 130 ; k++){
             for(int j=k;j+k<=130;j++){
                for(int l = j ; l+j+k<=130; l++){
                    
                    int num  = pow((k+j+l),2) -k*j - k*l - l*j;
                    
                    if(num == i){
                        // cout<<k<<" "<<j<<" "<<l<<endl;
                        // cout<<num<<endl;
                        if(k==j && j == l){
                            res++;
                        }else if((k==j && j!=l)||(k==l && k!=j)|| (j==l && j!=k)){
                            res+=3;
                        }else{
                            res+=6;
                            
                        }
                        
                    }
                }
            }
        }
        cout<<res<<endl;
        
    }
    
    
}

Measured memory_bytes: 3604
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;
typedef long long ll;

int main() {
    ll S;
    cin >> S;

    if (S == 1000000000000000000) {
        cout << "0 0 " << 1000000000 << " " << 0 << " 0 " << 1000000000 << endl;
    } else {
        ll T = sqrt(S) + 1;
        ll diff = T*T - S;
        
        cout << "0 0 " << T << " " << diff << " 1 " << T << endl;
    }


}

Measured memory_bytes: 256
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	tmp = input[1].split(" ");
	//文字列から10進数に変換するときはparseIntを使います
	var a = parseInt(input[0], 10);
	
  	var odd_cnt = Math.ceil(a/2);
  	var odd_prob = odd_cnt/a;
  
  	console.log(odd_prob);
 
  
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7500
n = int(input())

word = []
for _ in range(n):
    w = input()
    word.append(w)

if len(set(word)) != n:
    print("No")
else:
    tail = word[0][-1]
    for i in range(1, n):
        if tail != word[i][0]:
            print("No")
            break
        else:
            tail = word[i][-1]
    else:
        print("Yes")


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

int main() {

    double l;
    cin >> l;

    double d = l/3;
    double ans = d * d * d;

    cout << fixed << setprecision(7) << ans << endl;

    return 0;
}

Measured memory_bytes: 256
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    N, P = map(int, input().split())
    A = factorization(P)

    B = []
    for a, b in A:
        if b >= N:
            B.append((a, b // N))

    ans = 1
    for a, b in B:
        ans *= a**b
    print(ans)


main()


Measured memory_bytes: 3188
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>    // bitset
#include <cctype>    // isupper, islower, isdigit, toupper, tolower
#include <cstdint>   // int64_t, int*_t
#include <cstdio>    // printf
#include <deque>     // deque
#include <iomanip>
#include <iostream> // cout, endl, cin
#include <map>      // map
#include <math.h>
#include <numeric>
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <string>        // string, to_string, stoi
#include <tuple>         // tuple, make_tuple
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <utility>       // pair, make_pair
#include <vector>        // vector
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int INF = 1001001001;
const int BG = 1000000007;

int main()
{
    int A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;

    set<int> waterSet, sugerSet;

    //水
    for (int i = 0; i <= 33; i++)
    {
        for (int j = 0; j <= 33; j++)
        {
            int w = 100 * (i * A + j * B);
            if (w <= F)
                waterSet.insert(w);
        }
    }

    //砂糖
    for (int i = 0; i < 3010; i++)
    {
        for (int j = 0; j <= 3010; j++)
        {
            int s = i * C + j * D;
            if (s <= F)
            {
                sugerSet.insert(s);
            }
        }
    }

    const double nLim = (double)E / (100 + E); //濃度の限界値
    double noudo = -1;
    int ans1 = 0, ans2 = 0;
    for (int s : sugerSet)
    {
        for (int w : waterSet)
        {
            int sum = s + w; //砂糖水
            if (sum == 0)
                continue;               //0除算を防ぐ
            double x = (double)s / sum; //作った砂糖水の濃度
            if (sum <= F && x <= nLim && x > noudo)
            {
                noudo = x;
                ans1 = sum;
                ans2 = s;
            }
        }
    }
    cout << ans1 << " " << ans2 << endl;

    return 0;
}


Measured memory_bytes: 384
/** 
If comrades that you trust gather around you, hope can take physical form and become visible. That’s what I believe.
*/
#include <bits/stdc++.h>
using namespace std;
/**
(▀̿Ĺ̯▀̿ ̿) (ง ͠° ͟ل͜ ͡°)ง
*/
auto solve() -> void {
    int x; cin >> x;
    cout << 1 - x << '\n';
}

auto main() -> int {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int tc = 1;
    while (tc--) {
        solve();
    }
    
    return 0;
}


Measured memory_bytes: 3644
<?php
//error_reporting(0);
//$N = trim(fgets(STDIN));
list($A,$B,$C,$D) =  explode(" ",trim(fgets(STDIN)));
//$a =  explode(" ",trim(fgets(STDIN)));

printf("%d\n",calc($B,$C,$D)-calc($A-1,$C,$D));

function calc($x,$c,$d) {
  $ret = $x;
  $ret -= intdiv($x,$c);
  $ret -= intdiv($x,$d);
  $ret += intdiv($x,lcm($c,$d));
  return $ret;
}

function gcd($a,$b) {
  if ($b == 0) return $a;
  return gcd($b,$a%$b);
}
function lcm($a,$b) {
  $l = gcd($a,$b);
  return $a / $l * $b;
}


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

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
    cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args&&... args) {
    const char *comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | ";
    __f(comma + 1, args...);
}
#define pi 3.141592653589
#define MOD 1000000007
#define to() int t; cin>>t; while(t--)
#define pb push_back
#define in insert
#define mp make_pair
#define ff first
#define ss second
#define si(s) s.size()
#define fori(it,v) for(it=v.begin();it!=v.end(); it++) 
#define for1(low,high,k) for(int i=low;i<high;i+=k)
#define for11(low,high,k) for(int j=low;j<high;j+=k)
#define for2(low,high,k) for(int i=low;i<=high;i+=k)
#define rev(high,low,k)  for(int i=high;i>=low ;i-=k)
#define all(x) x.begin(), x.end()
#define fil(x,i) memset(x,i,sizeof(x));
#define setbits(x) __builtin_popcount(x)
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define read freopen("input.txt","r",stdin)
#define write freopen("output.txt","w",stdout) 
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;


int main()
{
	boost;
	string s;
	cin>>s;
	int ans=0,cur=0;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='R')
			cur++;
		else{
			cur=0;
			}
		ans=max(cur,ans);
	}
	ans=max(ans,cur);
	cout<<ans<<endl;

return 0;
}


Measured memory_bytes: 3592
w, h, x, y = list(map(int, input().split()))
a = w * h / 2.0
if w & 1 == 0 and h & 1 == 0 and x == w // 2 and y == h // 2:
  b = 1
else:
  b = 0
print("%.6f %d" % (a, b))

Measured memory_bytes: 2940
#include<iostream>
#include<algorithm>
#include<cstring>

using namespace std;

typedef long long LL;

const int N = 2020, mod = 2019;

int main()
{
    int l, r;
    scanf("%d%d", &l, &r);
    
    if(r - r % 2019 > l)
    {
        puts("0");
        return 0;
    }
    
    l %= mod, r %= mod;
    if(r <= l)  r += mod;
    
    int res = l * r % mod;
    for(int i = l; i <= r; i ++)
        for(int j = i + 1; j <= r; j ++)
            res = min(res, i * j % mod);
    printf("%d", res);
    return 0;
}


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

long long int mod=1e9+7;

int main() {
   int n,m;
   cin>>n>>m;
   char s[n+1][m+1];
   for(int i=1;i<=n;i++)
      for(int j=1;j<=m;j++)
      cin>>s[i][j];
      
   int dp[n+1][m+1];
        dp[0][0]=0;
        for(int i=0;i<=n;i++){
            dp[i][0]=0;    
        }
        for(int i=0;i<=m;i++){
            dp[0][i]=0;
        }
        
        for(int i=1;i<=n;i++){
            int j;
            for( j=1;j<=m;j++){
               
               if(s[i][j]=='.'){
                  dp[i][j]=(dp[i-1][j]+dp[i][j-1])%mod;
                
               }
               else{
                  dp[i][j]=0;
                 }
               dp[1][1]=1;  
            }
            
        }
        cout<<dp[n][m]<<endl;
   
}


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

using namespace std;

int main(){
  int i = 0;
  long long N;
  vector<char> result(15);
  cin >> N;
  while(N){
    N--;
    char alp = N % 26 + 97;
    result.at(i) = alp;
    i++;
    N/= 26;
  }
  
  for(int j = i; j > 0; j--)
    cout << result.at(j-1);
  cout << endl;
  
  return 0;
}


Measured memory_bytes: 3624
#include<cstdio>

int main() {
	int n = 0x00;
	for( int i = 0; i < 3; ++i ) {
		int b;
		scanf("%d", &b);
		n |= b<<(2 - i);
	}
	printf( n==6 || n==1 ? "Open\n" : "Close\n" );
	
	return 0;
}

Measured memory_bytes: 1016