akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using lli = int_fast64_t;
using ulli = uint_fast64_t;
#define debug(x) cerr << #x << " : " << x << endl
#define debugv(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x << ", ";}cerr << endl
#define debugst(x) auto xt = x;cerr << #x << " : {";for(int i=0;i<x.size();i++){ cerr << xt.top() << ", ";xt.pop();}cerr << endl
#define debugvp(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x.first << " : " << value_of_x.second << ", ";}cerr << endl

const lli MOD = 1000000007;
const lli LIMIT = 1000000000000000000 * 5;
const int tenfive = 100000;

int main() {
	int N, K;
	cin >> N >> K;
	int allgcd = 0;
	int maxim = 0;
	for (int i = 0; i < N; i++) {
		int x;
		cin >> x;
		if (i == 0)
			allgcd = x;
		else
			allgcd = __gcd(allgcd, x);
		maxim = max(x, maxim);
	}
	if (K > maxim || K % allgcd != 0) {
		cout << "IMPOSSIBLE" << endl;
	}
	else {
		cout << "POSSIBLE" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(a) a.begin(),a.end()

int main(void){
    string s,t;
    cin>>s>>t;
    sort(all(s));
    sort(all(t));
    reverse(all(t));
    cout<<(s<t ? "Yes" : "No")<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void)
{
    char s;
    cin >> s;
    // char s = (S[0]);
    pr((char)(s+1));
}

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

using namespace std;

int64_t ans = 0;

void dfs(int64_t N, int64_t cur) {
    if (cur > N) {
        return;
    }

    string s = to_string(cur);
    int n7 = 0;
    int n5 = 0;
    int n3 = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '7') n7++;
        if (s[i] == '5') n5++;
        if (s[i] == '3') n3++;
    }
    if (n7 > 0 && n5 > 0 && n3 > 0) {
        ans++;
    }

    dfs(N, cur * 10 + 7);
    dfs(N, cur * 10 + 5);
    dfs(N, cur * 10 + 3);
}

int main(int argc, char *argv[]) {
    int64_t N;
    cin >> N;
    dfs(N, 0);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if (a < 10 && b < 10) {
			System.out.println(a * b);
		} else {
			System.out.println(-1);
		}

	}
}

Measured memory_bytes: 23764
#include<string>
#include<iostream>
using namespace std;
long long a,n,b,mn=1000000000000000000,mn1=100000000000000;
int main()
{
	cin>>n;
	for (int i=0;i<n;i++){
		cin>>a>>b;
		if (b<mn1){
			mn=a;
			mn1=b;
		}
	}
	cout<<mn1+mn;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/algorithm/sort.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using boost::irange;
using boost::sort;
using boost::adaptors::reversed;

int main() {
    int n;
    long cnt = 0;
    string s;
    vector<int> r, g, b;
    cin >> n;
    for (int i = 0; i < n; i++) {
        char c;
        cin >> c;
        s.push_back(c);
        switch (c) {
        case 'R':
            r.push_back(i);
            break;
        case 'G':
            g.push_back(i);
            break;
        case 'B':
            b.push_back(i);
            break;
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (s[i] == s[j]) continue;
            if ((s[i] == 'R' && s[j] == 'G') || (s[i] == 'G' && s[j] == 'R')) {
                cnt += b.end() - upper_bound(b.begin(), b.end(), j);
                if (binary_search(b.begin(), b.end(), j + j - i)) cnt -= 1;
            } else if ((s[i] == 'B' && s[j] == 'G') || (s[i] == 'G' && s[j] == 'B')) {
                cnt += r.end() - upper_bound(r.begin(), r.end(), j);
                if (binary_search(r.begin(), r.end(), j + j - i)) cnt -= 1;
            } else if ((s[i] == 'R' && s[j] == 'B') || (s[i] == 'B' && s[j] == 'R')) {
                cnt += g.end() - upper_bound(g.begin(), g.end(), j);
                if (binary_search(g.begin(), g.end(), j + j - i)) cnt -= 1;
            }
        }
    }




    cout << cnt << endl;

}


Measured memory_bytes: 3644
import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    static class Task {

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();
            int h = in.nextInt();
            int m = in.nextInt();

            // 计算夹角
            double mDegree = (m * 1.0 / 60) * 360;
            double hDegree = (h * 1.0 / 12) * 360 + (m * 1.0 / 60) * 30;
            double diffDegree = Math.abs(mDegree - hDegree);
            double sqrAns = a * a + b * b - 2 * a * b * Math.cos(Math.toRadians(diffDegree));
            out.println(Math.sqrt(sqrAns));
        }
    }

    private static void sort(double[] arr) {
        Double[] objArr = Arrays.stream(arr).boxed().toArray(Double[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void sort(int[] arr) {
        Integer[] objArr = Arrays.stream(arr).boxed().toArray(Integer[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void sort(long[] arr) {
        Long[] objArr = Arrays.stream(arr).boxed().toArray(Long[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task task = new Task();
        task.solve(1, in, out);
        out.close();
    }

    public static void main(String[] args) {
        new Thread(null, () -> solve(), "1", 1 << 26).start();
    }

    static class InputReader {

        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }

}

Measured memory_bytes: 34284
S = raw_input()
N = len(S)

for i in xrange(0, N):
    r = i + 1
    s = [set() for _ in xrange(N - i)]
    for j in xrange(N-i):
        for k in xrange(r):
            s[j].add(S[j + k])
    for j in xrange(1, N-i):
        s[0] &= s[j]
    if len(s[0]) > 0:
        print i
        exit()


Measured memory_bytes: 32924
#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;

int main() {
    int N, ans=0;
    cin >> N;
    int B[N+1];
    for (int i=1; i<=N-1; i++) cin >> B[i];
    B[0] = B[1];
    B[N] = B[N-1];

    for (int i=0; i<N; i++) ans += min(B[i], B[i+1]);
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static Scanner scanner =new Scanner(System.in);
    public static void main(String[] args) {
        int n=scanner.nextInt();
        int k=scanner.nextInt();
        int[] a =new int[n];
        int sum = 0;
        for(int i=0;i<n;i++)
        {
            a[i]=scanner.nextInt();
        }
        Arrays.sort(a);
        for(int i=0;i<k;i++)
        {
            sum+=a[i];
        }
        System.out.println(sum);

	// write your code here
    }
}


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

int main(){
  int N,K;
  cin >>N >>K;
  int x=1;
  for(int i=0; i<N;i++){
    if(x*2<(x+K))
      x*=2;
    else
      x+=K;
  }
  cout <<x <<endl;
}


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

int main() {
  int n, c, m;
  int a[25];
  while (1) {
    cin >> n;
    if (!n) break;
    for (int i=0; i<n; i++) {
      cin >> a[i];
    }
    c = 0;
    m = 32;
    while (m) {
      if (c & 1) {
        m -= a[(c/2)%n];
      } else {
        m -= (m-1)%5;
      }
      if (m <= 0) {
        m = 0;
      }
      cout << m << endl;
      ++c;
    }
  }

  return 0;
}

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

int YesNo(bool x){
	if (x)
	{
		cout << "Yes" << endl; 
	}else{
		cout << "No" << endl;
	}
	return 0;
}

int main(){
	string a;
	cin >> a ;
	YesNo(a.at(0) == a.at(2));
}

Measured memory_bytes: 256
#include<cmath>
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.sise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
typedef pair<int, int> P;
vector<pair<int,int>> V;
int p[105];
int main(){
    int x,n;
    cin >> x>> n;
    //p[x]++;
    rep(i,n){
        int q;
        cin >> q;
        p[q]++;
    }
    rep(i,102){
        if(p[i]==0){
            V.push_back(mp(abs(x-i),i));
        }
    }
    sort(V.begin(),V.end());
    int ans=V[0].se;
    cout<<ans<<endl;
    return 0;
}

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

typedef long long LL;
typedef unsigned int UI;

const int N=200000;

int n,a;
UI d;
struct mobs{
  UI x;
  int h;
}b[N+9];

bool cmp(const mobs &a,const mobs &b){return a.x<b.x;}

UI x[N+9];
int h[N+9],ad[N+9];
LL ans;

int main(){
  scanf("%d%u%d",&n,&d,&a);
  for (int i=1;i<=n;++i)
	scanf("%u%d",&b[i].x,&b[i].h);
  sort(b+1,b+n+1,cmp);
  for (int i=1;i<=n;++i) x[i]=b[i].x,h[i]=b[i].h;
  x[n+1]=x[n]+d*2+1;
  int add=0;
  for (int i=1;i<=n;++i){
	int r=upper_bound(x+1,x+n+2,x[i]+d*2)-x;
	h[i]+=add+=ad[i];
	if (h[i]<=0) continue;
	int t=h[i]%a?h[i]/a+1:h[i]/a;
	ans+=t;add-=t*a;ad[r]+=t*a;
  }
  printf("%lld\n",ans);
  return 0;
}

Measured memory_bytes: 4096
N,W = map(int,input().split())

dp = [0]*(W+1)

for i in range(N):
    v,w = map(int,input().split())
    for j in range(1,W+1):
        if j - w >= 0:
            dp[j] = max(dp[j],dp[j-w]+v)

print(dp[-1])


Measured memory_bytes: 5912
import java.io.*;
import java.math.*;
import java.util.*;
public class Main { 

	public static void main(String[] args) { //BRUH
		Scanner input = new Scanner(System.in);
		long X = input.nextLong();
		long Y = input.nextLong();
		long ans = 0;
		long mod = (long)(1e9+7);
		long[][] fact = new long[1000001][2]; //[Factorial,Inverse]
		fact[1][0]=1; fact[1][1]=1;
		for (long i = 2; i <= 1000000; i++) {
			fact[(int) i][0]=fact[(int) (i-1)][0]*i;
			fact[(int) i][0]%=mod;
			fact[(int) i][1]=FastExp(fact[(int) i][0],mod-2,mod); //Fermat's little theorem
		}
		if ((X+Y)%3==0) {
			long min = Math.min(X, Y);
			long max = Math.max(X, Y);
			if (max<=min*2) {
				if (max==min*2) ans=1;
				else {
					long diff = max-min;
					long sub = min-diff;
					long totalMoves = sub/3; //Each move increases sum of coordinates by 3
					totalMoves*=2; //Each move alters x AND y though so need to 
					//multiply by 2 to avoid WA
					max-=sub;
					min-=sub;
					totalMoves+=min;
					long chooseOptions = sub/3;//(3,3) requires one of each knight move
					ans=fact[(int) totalMoves][0];
					ans*=fact[(int) chooseOptions][1];
					ans%=mod;
					ans*=fact[(int) (totalMoves-chooseOptions)][1];
					ans%=mod;
				}
			}
		}
		System.out.println(ans);
	}	
	public static long FastExp(long base, long exp, long mod) {
		long ans = 1;
		while (exp>0) {
			if (exp%2==1) ans*=base;
			base*=base;
			exp/=2;
			base%=mod;
			ans%=mod;
		}
		return ans;
	}
}

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

int main(){
	LL x,y,z,a,b,c;
	cin >> x >> y >> z;
	a = (x * y) * (z / 2LL);
	a = abs(x * y * z - a - a);
	b = (x * z) * (y / 2LL);
	b = abs(x * y * z - b - b);
	c = (z * y) * (x / 2LL);
	c = abs(x * y * z - c - c);
	cout << min(a,min(b,c)) << endl;;
}

Measured memory_bytes: 256
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 100000001;
const ll mod = 1000000007;
int t[100010];
void ChocolateBar() {
	int n;
	cin >> n;
	int odd = n % 2;
	for (size_t i = 0; i < n; i++)
	{
		int v;
		cin >> v;
		if ((odd == 1) ^ (v % 2 == 0)) {
			cout << 0 << endl;
			return;
		}
		t[v]++;
		
		if (t[v] > 2) {
			cout << 0 << endl;
			return;
		}
	}
	
	if (t[0] > 1) {
		cout << 0 << endl;
		return;
	}
	ll res = 1;
	for (size_t i = 0; i < n / 2; i++)
	{
		res *= 2;
		res %= mod;
	}
	cout << res << endl;
}

int main() {
	ChocolateBar();

	return 0;
}



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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define has(c,i) ((c).find(i) != end(c))
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll n; cin >> n;
	vl a(n);
	FOR(i,0,n) cin >> a[i];
	sort(all(a));

	ll res = 0;
	FOR(i,0,n-1) res += 2*min(i+1,n-1-i)*(a[i+1]-a[i]);
	
	ll k = n/2;
	if (n%2 == 1) {
		res -= min(a[k]-a[k-1],a[k+1]-a[k]);
	} else {
		res -= a[k]-a[k-1];
	}
	cout << res << endl;
}



Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define maxheap priority_queue<int>
#define minheap priority_queue<int, vector<int>, greater<int> >
#define ll long long
const int inf = 1e8;
const ll INF = 1e18;
const int MAXN = 6e5 + 200;
const  long double eps = 1e-9;
const long double pi = acos(-1.0);
using namespace std;

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

string check(int a, int b){
    int zero = 0;
    int otr = 0;
    for (int i = a; i <= b; i++) {
        if (i < 0) otr++;
        if (i == 0) zero++;
    }
    if (zero > 0)
        return "Zero";
    if (otr % 2)
        return "Negative";
    return "Positive";
}
void solve() {
    int a, b;
    cin >> a >> b;
    cout << check(a, b);
}


int main(){
    ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
    cout.setf(ios::fixed), cout.precision(40);
    //freopen("inevit.in", "r", stdin);
    //freopen("inevit.out", "w", stdout);
    int step;
    step = 1;
    //cin >> step;
    for (int i = 1; i <= step; i++)
        solve();


}

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

int main() {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a!=c){
        cout<<1<<endl;
    }else{
   cout <<0<< endl;
}
    return 0;    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
	long long a,b,bj=0;
    cin>>a>>b;
    if((!((a+b)%3))||(!(b%3))||(!(a%3)))
		puts("Possible");
    else 
		puts("Impossible");
    return 0;
}

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

int main(){
  int n,m,x;
  cin >> n >> m >> x;
  int a[200];
  for(int i=0; i<m; i++){
    cin >> a[i];
  }
  int c=0;
  for(int i=0; i<m-1; i++){
    if(a[i] <= x){
      c++;
    }
  }
  if(c==0 || c==m){
    cout << 0 << endl;
  }
  else{
    cout << min(c,m-c) << endl;
  }
}

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

int main (){
	double w,h,x,y;
	cin>>w>>h>>x>>y;
	
	cout<<fixed<<setprecision(6)<<(w*h/2);
	if ((w/2==x&&h/2==y))
		cout<<" 1\n";
	else 
		cout<<" 0\n";
	return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"os"
	"strconv"
)

func main() {
	//入力を受け取る
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Scan()
	N, _ := strconv.Atoi(sc.Text())

	//スライスにレンガの値を格納する
	slice := make([]int, 0, N)
	num := 0
	for i := 0; i < N; i++ {
		sc.Scan()
		ai, _ := strconv.Atoi(sc.Text())
		slice = append(slice, ai)
		if ai == num+1 {
			num++
		}
	}

	//砕くレンガの数を計算
	ans := -1
	if num != 0 {
		ans = N - num
	}

	//結果を出力する
	writer := bufio.NewWriter(os.Stdout)
	writer.WriteString(strconv.Itoa(ans))
	writer.Flush()
}


Measured memory_bytes: 3840
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include <cmath>
#include <limits>
#include<set>
#include <iomanip>
#include <queue>
#pragma GCC optimize("Ofast")
using namespace std;
const long long INF=20000000000;
//setprecision(2) <<

const int MOD = 1000000007;

long long max(long long a,long long b){
	if(a<b)return b;
	else return a;	
}
long long min(long long a,long long b){
	if(a>b)return b;
	else return a;	
}
long long gcd(long long a,long long b){
	if(a<b)swap(a,b);
	if(a%b==0)return b;
	else return gcd(a%b,b);
}

long long lcm(long long a,long long b){
	return a*b/gcd(a,b);
}

long long com(long long n,long long k){
	
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	string s;
	cin>>s;
	if(s.length()<4){
		cout<<"No"<<endl;
		return 0;
	}
	bool ans=true;
	if(s[0]!='Y')ans=false;
	if(s[1]!='A')ans=false;
	if(s[2]!='K')ans=false;
	if(s[3]!='I')ans=false;
	
	if(ans)cout<<"Yes"<<endl;
	else 	cout<<"No"<<endl;
}

	


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

int main() {
  Int N, D;
  cin >> N >> D;
  Int cnt = 0;
  for (Int i = 0; i < N; i++) {
    Int X, Y;
    cin >> X >> Y;
    if (X * X + Y * Y <= D * D) {
      cnt++;
    }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		System.out.println((int)Math.pow(input(), 3));
		close();

	}

	public static int input() {

		return scanner.nextInt();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
}

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

long long gcd(long long x, long long y)
{
    return (y ? gcd(y, x % y) : x);
}

int main()
{
    long long a, b;
    cin >> a >> b;
    long long g = gcd(a, b);
    cout << a / g * b << endl;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using static System.Console;
class Program {
  static long[] a;
  static int[] d;
  static long[] s;
  static void Main() {
    ReadLine();
    a = ReadLine().Split().Select(long.Parse).ToArray();
    var gap0 = Init();
    if (d[3] == 4) { WriteLine(gap0); return; }
    var gapMin = Enumerable.Range(3, d[3] - 4).Min(_ => NextGap());
    WriteLine(Math.Min(gap0, gapMin));
  }

static long Init()
{
    d = new[] { 1, 2, 3, a.Length };
    s = new[] { a[0], a[1], a[2], a.Skip(3).Sum() };
    Flatten(2);
    return s.Max() - s.Min();
}

static long NextGap()
{
    Slide(1);
    Flatten(0);
    Flatten(2);
    return s.Max() - s.Min();
}

static void Flatten(int di)
{
    var di2 = di + 1;
    if (s[di] >= s[di2]) return;
    while (d[di] + 1 < d[di2])
    {
        var s1 = s[di] + a[d[di]];
        var s2 = s[di2] - a[d[di]];
        if (s1 <= s2) Slide(di);
        else
        {
            if (s1 - s2 < s[di2] - s[di]) Slide(di);
            break;
        }
    }
}

static void Slide(int di)
{
    s[di] += a[d[di]];
    s[di + 1] -= a[d[di]++];
}
}


Measured memory_bytes: 36368
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
typedef long long ll;

using namespace std;

template <typename T> void output(T, int);
int gcd(int a, int b);

int main() {
    // source
    ll s, c;
    cin >> s >> c;

    ll ans = 0;
    if (c >= s * 2) {
        ans += s;
        c -= s * 2;
        s = 0;
    } else {
        ans += c / 2;
        c = 0;
    }
    ans += c / 4;

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

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define SORT(x) sort(x.begin(),x.end())
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
#define No cout<<"No"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl;
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
    string s;
    cin>>s;
    int n=s.size();
    cout<<s[0]<<n-2<<s[n-1]<<endl;
    return 0;
}


Measured memory_bytes: 256
vals=input().split(' ')
N=int(vals[0])
Y=int(vals[1])

for s in range(N,-1,-1):
  for m in range(N-s,-1,-1):
    l=N-s-m
    if l*10000+5000*m+1000*s == Y:
      print (l,m,s)
      exit()
print (-1,-1,-1)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <array>
using namespace std;
int main(void)

{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int A;
	cin >> A;
	switch (A % 10)
	{
	case (2):
	case (4):
	case (5):
	case (7):
	case (9):
		cout << "hon";
		break;
	case (0):
	case (1):
	case (6):
	case (8):
		cout << "pon";
		break;
	case (3):
		cout << "bon";
		break;
	default:
		cout << "no";
	}
	return 0;
}


Measured memory_bytes: 3652
#include <iostream>
#include <vector>

using namespace std;

struct UnionFind {
    vector< int > data;

    UnionFind(int sz) {
        data.assign(sz, -1);
    }

    bool unite(int x, int y) {
        x = find(x), y = find(y);
        if(x == y) return (false);
        if(data[x] > data[y]) swap(x, y);
        data[x] += data[y];
        data[y] = x;
        return (true);
    }

    int find(int k) {
        if(data[k] < 0) return (k);
        return (data[k] = find(data[k]));
    }

    int size(int k) {
        return (-data[find(k)]);
    }
};

int main(void) {
    int N, M;
    cin >> N >> M;
    UnionFind uf(N);

    while(M--) {
        int X, Y, Z;
        cin >> X >> Y >> Z;
        if(uf.unite(--X, --Y)) --N;
    }

    cout << N << endl;
    return 0;
}


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

typedef long long ll;
int n, a[100001], ans = -100;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    cin >> n;
    
    for (int i = 0; i < n; i++) {
        int t;
        cin >> t;
        a[t]++;
    }
    
    
    for (int i = 0; i < 100001; i++) {
        //select value;
        int before = i -1;
        int next = i + 1;
        int count = a[i];
        
        if (before >= 0)
            count += a[before];
        if (next <= 100000)
            count += a[next];
        
        ans = max(ans, count);
    }
   
    cout << ans << endl;
    
    
    
    
    
    return 0;
}



Measured memory_bytes: 640
#include<bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll INF=(1LL<<62);
const ld pi=acosl((ld)-1);
const ll mod = 1000000007;
// const ll mod = 1234567;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"
#define TO_STRING(VariableName) # VariableName

template <typename T>ostream &operator<<(ostream &out,const vector<T> &v) {rep(i,(int)v.size()-1)cout<<v[i]<<endl;cout<<v[(int)v.size()-1];return out;}
template <typename T1, typename T2>ostream &operator<<(ostream &out, const map<T1, T2> &p) {out << "(" << p.first << ", " << p.second << ")";return out;}
template <typename T1, typename T2>ostream &operator<<(ostream &out, const pair<T1, T2> &p){out << "(" << p.first << ", " << p.second << ")";return out;}
template<class T>void debag(const T &obj){cout<<obj<<endl;}

struct UnionFind {
  vector< int > data;
 
  UnionFind(int sz) {
    data.assign(sz, -1);
  }
 
  bool unite(int x, int y) {
    x = find(x), y = find(y);
    if(x == y) return (false);
    if(data[x] > data[y]) swap(x, y);
    data[x] += data[y];
    data[y] = x;
    return (true);
  }
 
  int find(int k) {
    if(data[k] < 0) return (k);
    return (data[k] = find(data[k]));
  }
 
  int size(int k) {
    return (-data[find(k)]);
  }
};


bool solve(){
  ll n,m;cin>>n>>m;
  UnionFind uf(n);
  vector<ll>v[m];
  rep(i,n){
    ll k;cin>>k;
    rep(j,k){
      ll a;cin>>a;a--;
      v[a].push_back(i);
    }
  }

  rep(i,m){
    for(auto j:v[i]){
      uf.unite(v[i][0],j);
    }
  }

  cout<<(uf.size(0)==n ? "YES" : "NO")<<endl;
  return false;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout<<fixed<<setprecision(30);
    solve();
}


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

int main(){
    int a,b;
    cin >> a >> b;
    string ans = "Impossible";
    if(a % 3 == 0 || b % 3 == 0 || (a+b)%3 == 0) ans = "Possible";
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
using ll = long long;

int main(){
    ll n;
    cin >> n;
    if(n == 1){
        cout << 1 << endl;
        return 0;
    }
    vector<ll> x(n),y(n);
    for(int i = 0; i < n; i++) cin >> x[i] >> y[i];
    ll res = n;
    for(int i =0 ; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i == j) continue;
            ll dx = x[i] - x[j];
            ll dy = y[i] - y[j];
            ll sub = 0;
            for(int k = 0; k < n; k++){
                for(int l = 0; l < n; l++){
                    if(k == l)continue;
                    if(dx == x[l] - x[k] && dy == y[l] - y[k])sub++;
                }
            }
            res = min(res,n - sub);
        }
    }
    cout << res << endl;
}

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

using namespace std;

int main(int argc, char const *argv[])
{
	string s;
	cin >> s;
	if (s.size()==2) cout << s << endl;
	else {
		reverse(s.begin(), s.end());
		cout << s << endl;
	}
	return 0;
}

Measured memory_bytes: 256
class Dice:
    __slots__ = ['n_list', 'pair_list']

    def __init__(self, n_tup):
        self.n_list = list(n_tup)
        self.pair_list = [self.return_dice_round_pair(self.n_list, 2, 3, 5, 4),
                          self.return_dice_round_pair(self.n_list, 1, 4, 6, 3),
                          self.return_dice_round_pair(self.n_list, 1, 2, 6, 5),
                          self.return_dice_round_pair(self.n_list, 1, 5, 6, 2),
                          self.return_dice_round_pair(self.n_list, 1, 3, 6, 4),
                          self.return_dice_round_pair(self.n_list, 2, 4, 5, 3)
                          ]

    @staticmethod
    def roll_switch(n_list, from_idx_list, to_idx_list):
        n_list[from_idx_list[0] - 1], \
        n_list[from_idx_list[1] - 1], \
        n_list[from_idx_list[2] - 1], \
        n_list[from_idx_list[3] - 1] \
            = n_list[to_idx_list[0] - 1], \
              n_list[to_idx_list[1] - 1], \
              n_list[to_idx_list[2] - 1], \
              n_list[to_idx_list[3] - 1]
        return n_list

    def roll(self, direction):
        if direction == "N":
            self.n_list = self.roll_switch(self.n_list, [1, 2, 6, 5], [2, 6, 5, 1])

        elif direction == "E":
            self.n_list = self.roll_switch(self.n_list, [1, 3, 6, 4], [4, 1, 3, 6])

        if direction == "S":
            self.n_list = self.roll_switch(self.n_list, [1, 2, 6, 5], [5, 1, 2, 6])

        if direction == "W":
            self.n_list = self.roll_switch(self.n_list, [1, 3, 6, 4], [3, 6, 4, 1])

    @staticmethod
    def return_dice_round_pair(n_list, a, b, c, d):
        return [(n_list[a-1], n_list[b-1]),
                (n_list[b-1], n_list[c-1]),
                (n_list[c-1], n_list[d-1]),
                (n_list[d-1], n_list[a-1])]

    def return_right_num(self, top, forward):
        for i in range(6):
            if (top, forward) in self.pair_list[i]:
                return self.n_list[i]


dice = Dice([int(x) for x in input().split()])
cmd_cnt = int(input())

for i in range(cmd_cnt):
    top, forward = (int(x) for x in input().split())
    print(dice.return_right_num(top, forward))

Measured memory_bytes: 7876
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s: usize = iterator.next().unwrap().parse().unwrap();
    let w: usize = iterator.next().unwrap().parse().unwrap();

    return if w >= s {
        "unsafe".to_string()
    } else {
        "safe".to_string()
    }
}


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

int main(){
  int n; cin>>n;
  int num=0;
  for(int i=0; i<n; ++i){
    int p; cin>>p;
    if(p!=i+1)++num;
  }

  if(num==0 || num==2)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}


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

using namespace std;

int main()
{
 long long int n,i,s=0;
 cin>>n;
 vector<long long int> a(n),d(n);
 for (i=0;i<n;i++){
  cin>>a[i];
 }
 d[0]=0;
 d[1]=abs(a[1]-a[0]);
 for (i=2;i<n;i++){
   d[i]=min(abs(a[i]-a[i-2])+d[i-2],abs(a[i]-a[i-1])+d[i-1]);
 }
 cout<<d[n-1];
 return 0;
}

Measured memory_bytes: 1792
#include <iostream> // {{{
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <cstdio> // }}}

#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,s,n) for(int i=s; i<n; i++)

using namespace std;

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

    if (a == b) {
        cout << c << endl;
    } else if (b == c) {
        cout << a << endl;
    } else {
        cout << b << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int n,m;cin>>n>>m;
  int cnt[m+1];
  fill(cnt,cnt+m+1,0);
  for(int i=0;i<n;i++){
    int k;cin>>k;
    for(int j=0;j<k;j++){
      int a;cin>>a;
      cnt[a]++;
    }
  }
  int ans=0;
  for(int i=1;i<=m;i++){
    if(cnt[i]==n)ans++;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
X,Y = map(int,input().split())
flag = False

if X == 1:
    if (Y == 2) or (Y == 4):
        flag = True
        
for i in range(X+1):
    for j in range(X+1):
        if (i + j) == X:
            if 2*i+4*j == Y:
                flag = True
                break


if flag == True:
    print("Yes")
else:
    print("No")

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

#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif

#define rep(i, n) for (int i = 0; i < (n); i++)
#define mins(x, y) (x = min(x, y))
#define maxs(x, y) (x = max(x, y))
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;

// ll dp[100005][3];

void solve() {
  int n, k, r, s, p;
  cin >> n >> k;
  cin >> r >> s >> p;
  string t;
  cin >> t;
  auto f = [&](string& a) {
    int m = a.size();
    vvl dp(m, vl(3));
    dp[0][0] = a[0] == 's' ? r : 0; // r
    dp[0][1] = a[0] == 'p' ? s : 0; // s
    dp[0][2] = a[0] == 'r' ? p : 0; // p
    for (int i = 1; i < m; i++) {
      { // 次がr
        maxs(dp[i][0], dp[i - 1][1] + (a[i] == 's' ? r : 0));
        maxs(dp[i][0], dp[i - 1][2] + (a[i] == 's' ? r : 0));
      }
      { // 次がs
        maxs(dp[i][1], dp[i - 1][0] + (a[i] == 'p' ? s : 0));
        maxs(dp[i][1], dp[i - 1][2] + (a[i] == 'p' ? s : 0));
      }
      { // 次がp
        maxs(dp[i][2], dp[i - 1][0] + (a[i] == 'r' ? p : 0));
        maxs(dp[i][2], dp[i - 1][1] + (a[i] == 'r' ? p : 0));
      }
    }
    dump(a);
    dumpv(dp, m, 3);
    return max(dp[m - 1][0], max(dp[m - 1][1], dp[m - 1][2]));
  };
  ll ans = 0;
  rep(i, k) {
    string a;
    for (int j = i; j < n; j += k) a += t[j];
    ans += f(a);
  }
  cout << ans << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  // freopen("temp.1", "r", stdin);
  solve();
  return 0;
}

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

using namespace std;

int main() {
  int A,B,count=0;
  cin >> A >> B;

  for(int i=A; i<=B;i++){
    int t,m,n,l;
    t=i%10;
    m=i/10%10;
    n=i/1000%10;
    l=i/10000%10;
    if(t == l&& m==n){
      count++;
    }
  }
  cout << count << endl;
}


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

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

using namespace std;

int main()
{
	int t;
	cin >> t;
	while(t--){
		long n, k, ans;
		cin >> n >> k;
		vector<long> x(n), y(n-1);
		rep(i, n){
			cin >> x[i];
		}
		rep(i, n-1){
			y[i] = x[i+1] - x[i];
		}
		sort(y.rbegin(), y.rend());
		ans = x[n-1]-x[0];
		rep(i, k-1){
			if (i >= n-1) break;
			ans -= y[i];
		}
		cout << ans << endl;
	}
	return 0;
}


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

using namespace std;
using ll = int64_t;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using mii = map<int, int>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using tpi = tuple<int, int, int>;

using vqi = vector<queue<int>>;
using vpi = vector<pii>;
using bs = bitset<60>;
using vbi = vector<bs>;

ll gcd(ll a, ll b) {
    if (a < b) {
        swap(a, b);
    }

    /* ユークリッドの互除法 */
    ll r = a % b;
    while (r != 0) {
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

constexpr int64_t __pow_mod(int64_t n, int64_t p, int64_t mod) noexcept {
    if (p == 0) {
        return 1;
    }
    if (p % 2 == 0) {
        int64_t t = __pow_mod(n, p / 2, mod);
        return (t * t) % mod;
    }
    return (n * (__pow_mod(n, p - 1, mod) % mod)) % mod;
}

constexpr int64_t pow_mod(int64_t n, int64_t p, int64_t mod) noexcept {
    int64_t res = __pow_mod(n, p, mod);
    if (res == 0) {
        res = mod;
    }
    return res;
}

void solve(long long N, long long R) {
    if (N < 10) {
        ll ans = R + 100 * (10 - N);
        cout << ans << endl;
        return;
    } else {
        cout << R << endl;
        return;
    }

}

// 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 X,K;
    std::cin >> K>>X;
  if(K*500>=X){
    cout<<"Yes"<<endl;
  }else{
  cout<<"No"<<endl;
  }
    return 0;
}


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

#define ll long long
#define ull unsigned long long 
#define endl '\n'
const int MOD = 1e9+7;


int main(){
    ll n;
    cin >> n;
    ll ans=1;
    for(int i=1; i<=n; ++i){
        ans = (ans%MOD * i%MOD)%MOD;
    }
    cout << ans;
}


Measured memory_bytes: 3576
#include <cstdio>
#include <algorithm>
#define maxn 233
#define mod 1000000007
using namespace std;

int n,f[3][maxn][4],pos,flag;
long long ans=1;
char s[3][maxn];
int main()
{
	scanf("%d",&n);
	scanf("%s%s",s[1]+1,s[2]+1);
	if (s[1][1]==s[2][1])  ans=3,pos=2,flag=0;
	else ans=6,pos=3,flag=1;
	for (int i=pos;i<=n;)
	{
		if (flag==0)
		{
			if (s[1][i]==s[2][i]) ++i,flag=0;
			else i+=2,flag=1;
			ans=ans*2%mod;
		}
		if (flag==1)
		{
			if (s[1][i]==s[2][i]) ++i,flag=0;
			else i+=2,flag=1,ans=ans*3%mod;
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
using namespace std;
int main() {
	int n, k, a, b;
	cin >> n >> k;
	a = n - (k - 1);
	b = 1;

	if (k == 1) {
		cout << 0 << endl;
	}
	else {
		cout << a - b << endl;
	}
	return 0;
}

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

int main(){

  long long cnt = 0;
  long long x;
  long long m = 100;

  scanf("%lld", &x);

  while(1){
    cnt++;
    m = m + m*0.01;

    if(m >= x) break;
  }

  printf("%lld\n", cnt);

  return 0;
}


Measured memory_bytes: 1724
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF 1e18
#define MOD 1e9 + 7

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

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

    ll ans = 0;
    ans += (x / 11) * 2;
    x %= 11;
    ans += (x > 6) + (x > 0);

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
def rpn(p)
  st = []
  while p.size > 0
    x = p.shift
    case x
    when "+" then st.push(st.pop+st.pop)
    when "-" then st.push(-st.pop+st.pop)
    when "*" then st.push(st.pop*st.pop)
    when "/" then st.push(1.0/st.pop*st.pop)
    else st << x.to_f end
  end
  return st
end

while gets
  ln = $_.split.map(&:to_s)
  puts rpn(ln)
end

Measured memory_bytes: 8640
s = input()
ans = len(s)
f = 0
if len(s)==2 and len(set(s))==1:
  print(1)
  exit()

for i in range(len(s)-1):
  if f==1:
    f = 2
    continue
  if f==2:
    f = 0
    continue
  if s[i]==s[i+1]:
    ans -= 1
    f = 1
print(ans)

Measured memory_bytes: 3500
#include<cstdio>
#include<iostream>
using namespace std;
int n,m,a,b;
int main(){
	scanf("%d%d%d%d",&n,&m,&b,&a);
	if(a>n/2||b>m/2){printf("-1");return 0;}
	if(!a&&!b){
		for(int i=1;i<=n;i++,printf("\n"))
		for(int j=1;j<=m;j++) printf("1");return 0;
	}
	if(!b){
		for(int j=1;j<=a;j++,printf("\n"))
		for(int i=1;i<=m;i++)printf("1"); 
		
		for(int j=a+1;j<=n;j++,printf("\n"))
		for(int i=1;i<=m;i++)printf("0"); 
		return 0; 
	}
	if(!a){
		
		for(int j=1;j<=n;j++,printf("\n")){
			for(int i=1;i<=b;i++)printf("1"); 
		
		for(int i=b+1;i<=m;i++)printf("0"); 
		}
		
		return 0; 
	} 
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(i<=a&&j<=b) cout<<"1";
			else if(i>a&&j>b) cout<<"1";
			else cout<<"0";
		}cout<<endl;
	}	
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
ll dx[4] = { 0, 1, 0, -1 };
ll dy[4] = { 1, 0, -1, 0 };
const ll INF = 1e14;
const ll MOD = 1e9 + 7;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    // input
    ll N, M;
    cin >> N >> M;
    vector<vector<ll>> s(M);
    rep(i, M)
    {
        ll k;
        cin >> k;
        rep(j, k)
        {
            ll a;
            cin >> a;
            --a;
            s[i].push_back(a);
        }
    }
    vector<ll> p(M);
    rep(i, M) { cin >> p[i]; }

    ll ans = 0;
    for (int bit = 0; bit < (1 << N); ++bit) { // スイッチの組み合わせに関してbit全探索する
        bool ok = true; // すべてが点灯する
        rep(i, M)
        {
            int cnt = 0; // onになっているスイッチの個数
            for (auto v : s[i]) { // i番目に関してすべてのスイッチを探索する
                if (bit & (1 << v)) { // bitANDでonおときはcnt++
                    cnt++;
                }
            }
            if (cnt % 2 != p[i]) { // もしひとつでもp[i]と違っていればokじゃない
                ok = false;
            }
        }
        if (ok) { // もしすべて点灯するならans++(これをスイッチのすべての組み合わせに関して行う)
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
a, b = map(int, input().split())
G = []
white_num = 0
for i in range(a):
    s = list(input())
    white_num += s.count('.')
    G.append(s)
from collections import deque
def mazesearch(G, initial_h, initial_w, target_h, target_w):
    '''
    G is for example:
        G = [[1,0,1,1,1,1],
            [1,0,1,0,1,0],
            [1,0,1,0,1,1],
            [1,1,1,0,1,1]]
    '''
    steps = 0
    BLOCKED, ALLOWED   = '#', '.'
    UNVISITED, VISITED = 0, 1
    directions = [(0, -1), (0, 1), (-1, 0), (1, 0)]
    if G[initial_h][initial_w] == BLOCKED:
        return -1
    height, width = len(G), len(G[0])
    is_visited = [[UNVISITED for w in range(width)] for h in range(height)]
    is_visited[initial_h][initial_w] = VISITED
    queue = deque([(initial_h, initial_w, steps)])
    while queue:
        h, w, steps = queue.popleft()
        if h == target_h and w == target_w:
            return steps
        for dh, dw in directions:
            new_h = h + dh
            new_w = w + dw
            if not (0 <= new_h < height and 0 <= new_w < width):
                continue
            if G[new_h][new_w] == ALLOWED and is_visited[new_h][new_w] == UNVISITED:
                queue.append((new_h, new_w, steps + 1))
                is_visited[new_h][new_w] = VISITED
    return -1
steps = mazesearch(G, 0, 0, a-1, b-1)
if steps == -1:
    print(-1, flush=True)
else:
    print(white_num - steps - 1, flush=True)


Measured memory_bytes: 9500
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
string s1, s2;
int main() {
	cin >> s1 >> s2;
	cout << (s1 < s2 ? '<' : (s1 > s2 ? '>' : '=')) << endl;
	return 0;
}

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

int main(){
    string s;
    string even = "R";
    string odd = "L";
    string ans = "Yes";

    cin >> s;
    int length = s.length();
    for(int i=0; i<length; i++){
        if(i%2==0){
            if(s[i]=='L'){
                ans = "No";
            }
        }else{
            if(s[i]=='R'){
                ans = "No";
            }
        }
        //cout << ans <<endl;
    }
    cout << ans <<endl;

    return 0;
}

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

int main (void){
    int k, x;
    cin >> k >> x;
    if (x <= 500 * k){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,k,count=0;
    cin>>a>>b>>c>>k;
    while(a>=b)
    {
        b*=2;
        count++;
    }
    while(c<=b)
    {
        c*=2;
        count++;
    }
    if(count<=k)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}


Measured memory_bytes: 3584
//ヘッダー
#include<bits/stdc++.h>
using namespace std;

//型定義
typedef long long ll;

//定数
const int INF=1e+9;
const int MOD=1e+9+7;

//REPマクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--)

// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

//vectorの扱い
#define ALL(x) (x).begin(),(x).end() //sortなどの引数省略
#define SIZE(x) ((ll)(x).size()) //size
#define MAX(x) *max_element(ALL(x)) //最大値
#define MIN(x) *min_element(ALL(x)) //最小値

int main(){
    ll H1,M1,H2,M2,K;
    cin>>H1>>M1>>H2>>M2>>K;
    ll a,b;
    a=H1*60+M1;
    b=H2*60+M2;
    ll ans;
    ans=max((ll)0,b-a-K);
    cout<<ans<<endl;
}

Measured memory_bytes: 3600
/**
 * @author: Mackenzie
**/
#include <bits/stdc++.h>

using namespace std;

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main() {
#ifdef LOCAL
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#else
    fastIO;
#endif
    string s;
    cin >> s;
    forn(i, sz(s)) cout << 'x';
    cout << endl;
    return 0;
}

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

int main(){
  ll a, b, c, k;
  cin >> a >> b >> c >> k;

  ll ans = 0;
  if (k%2 == 0){
    ans = a - b;
  } else {
    ans = b - a;
  }
  
  if(ans > 10e18){
    cout << "Unfair";
    return 0;
  }
  
  cout << ans;
  return 0;
}

Measured memory_bytes: 256