akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	// AtCoder Beginner Contest 118
	// https://atcoder.jp/contests/abc118/tasks
	public static void main(String[] args) {
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] foods = new int[m+1];
		int res = 0;
		
		for (int i = 0; i < n; i++) {
			int k = sc.nextInt();
			
			for (int j = 0; j < k; j++) {
				int f = sc.nextInt();
				foods[f]++;
			}
		}
		
		for (int i = 1; i <= m; i++) {
			if (foods[i] == n) {
				res++;
			}
		}
		
		System.out.println(res);
	}
	
	static class FastReader { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() { 
            br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
  
        String next() { 
            while (st == null || !st.hasMoreElements()) { 
                try { 
                    st = new StringTokenizer(br.readLine()); 
                } catch (IOException  e) { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() { 
            String str = ""; 
            try{ 
                str = br.readLine(); 
            } catch (IOException e) { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
}


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

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    int N; cin >> N;
    double P[N+1]; rep(i, N) cin >> P[i+1];
    double dp[N+1][N+1]; //dp[i][j]: 1からiでj個表になる確率
    dp[0][0] = 1.0;
    double acc = 1.0;

    for(int i = 1; i <= N; i++){
        acc *= (1.0 - P[i]);
        dp[i][1] = 1.0 - acc;
    }
    for(int j = 2; j <= N; j++) dp[1][j] = 0.0;
    for(int i = 2; i <= N; i++){
        for(int j = 2; j <= N; j++){
            dp[i][j] = dp[i-1][j]*(1.0-P[i]) + dp[i-1][j-1]*P[i]; 
        }
    }
    int st = N/2 + 1;
    printf("%.10f\n", dp[N][st]);
    return 0;
}

Measured memory_bytes: 70528
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using bint = boost::multiprecision::cpp_int;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repSE(i,s,n) for (int i = (s); i < (n); i++)
#define ssort(v) sort(v.begin(), v.end())
#define gsort(v) sort(v.rbegin(), v.rend())
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }

int main()
{
    int N, K;
    cin >> N >> K;
    vector<int> d(K);
    vector<int> S(N);
    vector<vector<int>> A;
    rep(i,K) {
        cin >> d[i];
        vector<int> di(d[i]);
        rep(j,d[i]) {
            int Aidi;
            cin >> Aidi; Aidi--;
            di[j] = Aidi;
            S[Aidi] ++;
        }
    }
    int ans = 0;
    rep(i,N) {
        if (S[i] == 0) ans++;
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int main () {
 int l;
 int x,f=0,o=0,c=0;
 cin>>l;
 int s[l];
 for (int i=0;i<l;i++)
 {
     cin>>x;
     if (x%2==0)
     {
        s[c]=x;
        o++;
        c++;
     }

 }
 for (int i=0;i<o;i++)
 {
     if (s[i]%3==0||s[i]%5==0)f++;
 }
 if (f==o)cout<<"APPROVED";
 else
    cout<<"DENIED";

return 0;
}


Measured memory_bytes: 256
import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    s = L()
    t = L()
    s.sort()
    t.sort(reverse = True)
    print("Yes" if s < t else "No")


Measured memory_bytes: 9080
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int rgb = Integer.parseInt(String.join("", scanner.nextLine().split(" ", 3)));
        if (rgb % 4 == 0) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}


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



int main() {

    string s;
    cin>>s;


    int cnt=0,cnt_max=0;
    for(int i=0;i<s.size();i++){
      if(s.at(i)=='A'||s.at(i)=='C'||s.at(i)=='G'||s.at(i)=='T'){
        cnt++;
        cnt_max=max(cnt_max,cnt);
      }
      else
        cnt=0;
    }

    cout<<cnt_max<<endl;

    return 0;
}

Measured memory_bytes: 256
X,K,D=map(int,input().split())

ans=0
if X==0:
    if K%2==0:
        ans=0
    else:
        ans=D
else:
    cnt=abs(X)//D
    goal1=abs(X)%D
    goal2=abs(goal1-D)

    if cnt>K:
        ans=abs(X)-D*K
    else:
        amari=K-cnt
        if amari%2==0:
            ans=goal1
        else:
            ans=goal2

print(ans)

Measured memory_bytes: 9184
function Main(input) {
    const args = input.split(' ');
    const m = parseInt(args[0], 10);
    const d = parseInt(args[1], 10);
    var count = 0;
    for(var i = 1; i <= m; i++){
        for(var j = 20; j <= d; j++){
            var d1 = j % 10;
            var d10 = (j-d1) / 10;
            if(d1 * d10 == i && d1 >= 2){
                count++;
            }
        }
    }
    
    console.log(count);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
#include<set>
#include<cstring>
using namespace std;
long long int mod = 1e9 + 7;
int inf = 1e9;

int main() {
  int n, z, w; cin >> n >> z >> w;
  vector<int> a(n);
  for(int i=0; i<n; i++) cin >> a[i];
  if(n == 1) {
    cout << abs(w-a[0]) << endl;
    return 0;
  }
  cout << max(abs(w-a[n-1]), abs(a[n-1]-a[n-2])) << endl;

  return 0;
}


//EOF


Measured memory_bytes: 256
import numpy as np

N, M = map(int, input().split())
P = []
Y = []
for _ in range(M):
    p, y = map(int, input().split())
    P.append(p)
    Y.append(y)
P = np.array(P)
Y = np.array(Y)
PY = np.c_[P, Y]
sort_ind = np.argsort(Y)

PY_sort = PY[sort_ind]
count = [0] * (int(1e+5) + 1)
id_list = []
for p, y in PY_sort:
    count[p] += 1
    id_list.append(str(p).zfill(6) + str(count[p]).zfill(6))

id_list = np.array(id_list)
id_list = id_list[np.argsort(sort_ind)]
for city_id in id_list:
    print(city_id)

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

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

	int cnt = 0;
	bool zero = false;
	vector<long long> a(n);

	REP(i, n) {
		cin >> a[i];
	}

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

	REP(i, n) {
		if (a[i] < 0)		cnt++;
		if (a[i] == 0)		zero = true;
	}

	long long sum = 0;
	long long mini = 999999999999999;

	REP(i, n) {
		sum += abs(a[i]);
		mini = min(abs(a[i]), mini);
	}

	if (cnt % 2 == 0 || zero) {
		cout << sum << endl;

	}
	else 
		cout << sum - 2*mini << endl;
}


Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<set>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<map>
#include<queue>
#include<iomanip>
#define INF 1e9
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using ll = long long;
using namespace std;
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; }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i]; if (i < len - 1) s << "\t";
  }
  return s;
}

template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
  s << vv[i] << endl;
  }
  return s;
}

int n,k;
signed main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cin >> n >> k;
  vector<ll> num(k,0);
  for(int i = 1 ; i <= n ; i++){
    num[i%k]++;
  }
  ll ret = 0;
  for(size_t a = 0; a < k ; a++){
    int b = (k - a) % k;
    int c = (k - a) % k;
    if((b + c) % k != 0){
      continue;
    }
    ret += num[a] * num[b] * num[c];
  }
  cout << ret << endl;

  return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
void yes(){ cout << "Yes" << endl; }
void no(){ cout << "No" << endl; }

int main(){
    int n; cin >> n;
    rep(i,3){
        if(n % 10 == 7){
            yes();
            return 0;
        }
        n /= 10;
    }
    no();
    return 0;
}


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

using namespace std;

typedef long long ll;

const ll MOD = 1000000007;
const ll INF = 1LL<<60;
//int INF = numeric_limits<int>::max();

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

Measured memory_bytes: 3924
n = int(input())
a = list(map(int,input().split()))

a = sorted(a)

info= []
count = 0
for i in range(len(a)-1):
  if a[i+1]==a[i]:
    count +=1
  else:
    if count !=0:
      info.append(count)
    count = 0

if count !=0:
  info.append(count)

print(n-sum(info) if sum(info)%2==0 else n-sum(info)-1)

Measured memory_bytes: 14396
from functools import reduce 
from operator import mul
N = int(input())
A = sorted(list(map(int,input().split())),reverse = True)

lim = 10 ** 18
ans = 1

if A[-1] == 0:
  print(0)
else:
  for i in A:
    ans *= i
    if ans > lim:
      ans = -1
      break
  print(ans)

Measured memory_bytes: 22764
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let s: String = sc.read();

    let n: usize = s.len();
    let mut tmp = 0;
    let result = s.chars().into_iter().map(|c| {
        if c == 'A' || c == 'C' || c == 'G' || c == 'T' {
            tmp += 1;
        } else {
            tmp = 0;
        }
        tmp
    }).max().unwrap();
    println!("{}", result);
}

//snippet from kenkoooo
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self.stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_line(&mut self) -> String {
        use std::io::Read;
        let buf = self.stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b'\n' || b == b'\r')
            .take_while(|&b| b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
while true
	n,x = gets.split.map(&:to_i)
	if n == 0 && x == 0
		break
	end
	a = 1
	b = 1
	c = 0
	cnt = 0
	for a in 1..(n-2) do
		for b in (a+1)..(n-1) do
			c = x - a - b
			if c <= n && c > b && a != b
				cnt += 1
			end
		end
	end
	puts cnt
end

Measured memory_bytes: 6104
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<queue>

using namespace std;
#define int long  long int
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

signed main()
{
	int N, D;
	cin >> N >> D;
	if (N % (2 * D + 1) == 0)cout << N / (2 * D + 1);
	else cout << N / (2 * D + 1) + 1;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n, m;
#define INF 2 << 22
class Graph {

private:
	int V;
	vector< list<int> > adjList;

public:
	Graph(int const &V);
	void addEdge(int const &u, int const &v);
	void BFS(int const &s);
};
Graph::Graph(int const &V) {
	this->V = V;
	adjList.resize(V);
}
void Graph::addEdge(int const &u, int const &v) {
	adjList[u].push_back(v);
}
void Graph::BFS(int const &s) {

	int *dist = new int[V];
	int *parent = new int[V];

	for (int v = 0; v < V; ++v) {
		dist[v] = INF;
		parent[v] = -1;
	}

	dist[s] = 0;
	queue<int> Q;
	Q.push(s);


	while (!Q.empty()) {
		int u = Q.front();
		Q.pop();
		list<int>::iterator it;
		for (it = adjList[u].begin(); it != adjList[u].end(); ++it) {
			if (dist[*it] == INF) {
				Q.push(*it);
				dist[*it] = dist[u] + 1;
				parent[*it] = u;
			}
		}
	}
		if (dist[n] != INF && dist[n]<3 && dist[n]>0) {
			cout << "POSSIBLE" << endl;
		}
		else {
			cout << "IMPOSSIBLE" << endl;
		}
}



int main() {

	
	cin >> n >> m;
	Graph *g = new Graph(max(2*m,n));
	for (int i = 0; i < m; i++)
	{
		int a, b;
		cin >> a >> b;
		g->addEdge(a, b);
		g->addEdge(b, a);
	}
	g->BFS(1);
	return 0;
}

Measured memory_bytes: 22656
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#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++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
const int inf=1e9+7;
const ll INF=1e18;

int MAX_V=210;

vvin g(MAX_V);//グラフの隣接リスト表現
vin match(MAX_V);//マッチングのペア
vbo used(MAX_V);

void add_edge(int u,int v){
    g[u].push_back(v);
    g[v].push_back(u);
}

//増加パスをdfsで探す
bool dfs(int v){
    used[v]=true;
    for(auto u:g[v]){
        int w=match[u];
        if(w<0||(!used[w]&&dfs(w))){
            match[v]=u;
            match[u]=v;
            return true;
        }
    }
    return false;
}

//二部グラフの最大マッチングを求める
int max_matching(int v){//vは頂点数
    int res=0;
    fill(all(match),-1);
    rep(i,v){
        if(match[i]<0){
            fill(all(used),false);
            if(dfs(i))res++;
        }
    }
    return res;
}

int main(){
    int n;cin>>n;
    vin a(n),b(n),c(n),d(n);
    rep(i,n)cin>>a[i]>>b[i];
    rep(i,n)cin>>c[i]>>d[i];
    rep(i,n)rep(j,n){
        if(a[i]<c[j]&&b[i]<d[j])add_edge(i,j+n);
    }
    cout<<max_matching(2*n)<<endl;
}

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

int main() {
    int N, M; cin >> N >> M;
    map<int, int> A;
    for (int i = 0; i < N; i++) {
        int K; cin >> K;
        for (int j = 0; j < K; j++) {
            int a; cin >> a;
            A[a]++;
        }
    }
    int ans = 0;
    for (auto x : A) {
        if (x.second == N) {
            ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <complex>
#include <string>
#include <sstream>

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>

using namespace std;

#define all(c) c.begin(),c.end()
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

typedef long long ll;
typedef vector<int> vi;

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& val){
    os << "[ ";
    for(typename vector<T>::const_iterator it=val.begin();
        it != val.end();++it){
        os << *it << " ";
    }
    os << "]";
    return os;
}
// 買うべき鶏肉の量の下限 q1、予算 b、このお肉屋さんでの会津地鶏100グラムの値段 c1、ふつう の鶏肉100グラムの値段 c2、
// 会津地鶏を一人が買える量の上限 q2 を入力とし、一郎君が買う会津地 鶏とふつうの鶏肉の量を100グラム単位で出力するプログラムを作成してください。
// ただし、このお 肉屋さんではお母さんの指示通りに買えない場合には、「NA」と出力してください。
// string solve(ll q1,ll b,ll c1,ll c2,ll q2){
//     ll low = 1;
//     ll high = q2;
//     for(int k=0;k<1000;k++){
//         ll mid = (low + high) / 2;
//         ll rest = q1 - mid;
//         ll need = mid * c1;
//         if(rest > 0){
//             need += rest * c2;
//         }
//         if(need <= b){
//             low = mid;
//         }else{
//             high = mid;
//         }
//     }
//     if(low == 1){
//         ll rest = q1 - low;
//         ll need = low * c1;
//         if(rest > 0){
//             need += rest * c2;
//         }
//         if(need > b){
//             return "NA";
//         }
//     }
//     if(low < high){
//         low++;
//         ll rest = q1 - low;
//         ll need = low * c1;
//         if(rest > 0){
//             need += rest * c2;
//         }
//         if(need > b){
//             low--;
//         }
//     }
//     stringstream ss;
//     ss << low << " " << (b - low*c1) / c2;
//     return ss.str();
// }
string solve(ll q1,ll b,ll c1,ll c2,ll q2){
    for(ll buy=q2;buy>=1;buy--){
        ll need = buy * c1;
        ll rest = q1 - buy;
        if(rest > 0){
            need += rest * c2;
        }
        if(need <= b){
            stringstream ss;
            ss << buy << " " << (b-buy*c1) / c2;
            return ss.str();
        }
    }
    return "NA";
}

int main(){
    while(true){
        ll q1,b,c1,c2,q2;
        cin >> q1;
        if(q1 == 0) break;
        cin >> b >> c1 >> c2 >> q2;
        cout << solve(q1,b,c1,c2,q2) << endl;
    }
    return 0;
}

Measured memory_bytes: 1216
N = int(input())
A = [int(_) for _ in input().split()]

cs = [0] * N

for i in range(N):
    j = N - i
    cs[j - 1] = (A[j-1] + sum(cs[j - 1::j])) % 2

rs = []
for i, v in enumerate(cs):
    if v:
        rs.append(i + 1)

print(len(rs))
print(*rs)



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

int main()
{
	//freopen("kai.cpp", "r", stdin);
	string ans;
	getline(cin, ans);
	for (int i = 0; i < ans.length(); i++)
		if (ans[i] == ',')
			ans[i] = ' ';
	cout << ans << endl;
}

Measured memory_bytes: 256
from collections import Counter,defaultdict,deque
import sys
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
    
def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return sorted([list(map(int, input().split())) for _ in range(n)])


def main():
    n = inp()
    p = inplm(n)
    q = [0 for _ in range(n)]
    for i in range(n):
        q[p[i]-1] = i
    x = 1
    y = 1
    for i in range(n-1):
        if q[i]<q[i+1]:
            x += 1
        else:
            y = max(x,y)
            x = 1
    print(n-max(x,y))

if __name__ == "__main__":
    main()

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

int main() {

    int N,A,B;
    cin >> N >> A >> B;

    int ans = 0;
    for(int i=0; i<N; i++){
	int in; cin >> in;
	if( A<= in and in < B ) continue;
	ans++;
    }
    cout << ans <<endl;
				    
	


}


Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import groupby, accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()
A = [k for k, g in groupby(A)]
N = len(A)
i = 1
ans = 0

while i < N-1:
	if A[i-1] < A[i] > A[i+1] or A[i-1] > A[i] < A[i+1]:
		ans += 1
		i += 1
	i += 1

print(ans+1)


Measured memory_bytes: 16340
#include <bits/stdc++.h>
#define double long double
//↓TLE,MLE魔!!!
#define int long long
//↑TLE,MLE魔!!!
#define inf 1000000007 //10^9+7
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
signed main() {
	int cnta,cntb;
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++){
		if(s[i]=='A'){
			cnta=i;
			break;
		}
	}
	for(int i=s.size()-1;i>=0;i--){
		if(s[i]=='Z'){
			cntb=i;
			break;
		}
	}
	cout<<cntb-cnta+1<<endl;
}


Measured memory_bytes: 640
using System;

namespace Project
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			int[] a = new int[n];
			int count;
			int countp = 0;
			for (int i = 0; i < n; i++)
			{
				a[i] = int.Parse(Console.ReadLine());
			}
			foreach (var x in a)
			{
				if (x == 2) countp++;
				else
				{
					count = 0;
					for (int i = 2; i < Math.Sqrt((double)x) + 1; i++)
					{
						if (x % i == 0)
						{
							count++;
							break;
						}
					}
					if (count == 0) countp++;
				}
			}
			Console.WriteLine(countp);
		}
	}
}

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


typedef long long ll;

int main() { 
    int n;

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

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

int N;
string s;

long long dp[5][100099], dp2[100099], pwr3[100099];
long long mod = 1000000007;

bool match(char ch1, char ch2) {
  if(ch2 == '?') return true;
  return ch1 == ch2;
}

int main() {
  //freopen("input.in","r",stdin);
  //freopen("output.out","w",stdout);

  cin >> s;
  N = s.size();
  pwr3[0] = 1;
  for(int i = 1;i <= N;i++) pwr3[i] = (3 * pwr3[i-1]) % mod;

  if(s[0] == 'A' || s[0] == '?') dp[0][0] = 1;
  if(s[0] == '?') dp2[0] = 1;

  for(int j = 1;j < N;j++) {
    if(match('A', s[j])) {
      dp[0][j] = (dp[0][j] + dp[0][j-1] + pwr3[dp2[j-1]]) % mod;
      dp[1][j] = (dp[1][j] + dp[1][j-1]) % mod;
      dp[2][j] = (dp[2][j] + dp[2][j-1]) % mod;
    }
    if(match('B', s[j])) {
      dp[0][j] = (dp[0][j] + dp[0][j-1]) % mod;
      dp[1][j] = (dp[1][j] + dp[1][j-1] + dp[0][j-1]) % mod;
      dp[2][j] = (dp[2][j] + dp[2][j-1]) % mod;
    }
    if(match('C', s[j])) {
      dp[0][j] = (dp[0][j] + dp[0][j-1]) % mod;
      dp[1][j] = (dp[1][j] + dp[1][j-1]) % mod;
      dp[2][j] = (dp[2][j] + dp[2][j-1] + dp[1][j-1]) % mod;
    }

    if(s[j] == '?') dp2[j] = dp2[j-1] + 1;
    else dp2[j] = dp2[j-1];
  }

  /*
  for(int i = 0;i < 3;i++) {
    for(int j = 0;j < N;j++) {
      cout << dp[i][j] << " ";
    } cout << endl;
  }*/

  cout << dp[2][N-1] << endl;

  return 0;
}


Measured memory_bytes: 4608
#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
#include <iomanip>
#include <iostream>
using namespace std;
 
int main(){
    
    int a,b,x;
    cin >> a >> b;

    x = a*b;

    if(x%2==0){
        cout << "Even" << endl;
    }else{
        cout << "Odd" << endl;
    }
    
    return 0;
}

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

int main() {
string S; cin>>S;
  string Z="CODEFESTIVAL2016";
  int A=0;
  for(int i=0; i<16; i++){
    if(S.at(i)==Z.at(i)) continue;
    else A++;
  }
  cout<<A<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int u32;
typedef pair<int, int> p;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int Inf = (1<<30);
ll inf = (1LL<<60);
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() { // さっき出したやつ嘘解法やった(n=3で数列が2,1,2とかアウト)
	int n;
	cin >> n;
	int i;
	int count = 0;
	int subcount = 0;
	int notcount = 0;
	for (i = 0; i < n; i++) {
		int a;
		cin >> a;
		if (a % 4 == 0) count++;
		else if (a % 2 == 0) subcount++;
		else notcount++;
	}
	if (subcount) count--;
	if (count + 1 >= notcount) cout << "Yes";
	else cout << "No";
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int>A(N);
    for(int i = 0;i <N;i++){
      cin >> A.at(i);
    }
  sort(A.begin(),A.end());
  cout << A.at(0) << " " << A.at(N-1) << " ";
  long long s = 0;
  for(int i = 0;i <N;i++){
    s += A.at(i);
  }
  cout << s <<endl;

     
  }
  
  


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

int main() {
  int n; cin >> n;
  vector<vector<pair<int, int>>> v(n);
  for (int i = 0; i < n; i++) {
    int a; cin >> a;
    for(int j = 0; j < a; j++) {
      int x, y;
      scanf("%d %d", &x, &y);
      v[i].push_back(make_pair(x - 1, y));
    }
  }
  
  int ans = 0;
  for (int tmp = 0; tmp < (1 << n); tmp++) {
    bitset<15> s(tmp);
    bool tsujitsuma = true;
    for(int i = 0; i < n; i++) {
      if(s.test(i)) {
        for(int j = 0; j < v[i].size(); j++) {
          if(v[i][j].second != s.test(v[i][j].first)) {
            tsujitsuma = false;
            break;
          }
        }
      }
      if(!tsujitsuma) break;
    }
    int cnt = s.count();
    if(tsujitsuma) ans = max(ans, cnt);
  }
  cout << ans;
}

Measured memory_bytes: 3700
#include<bits/stdc++.h>
	using namespace std;
	bool smit(pair<string,int>v1 , pair<string,int>v2){
		 if(v1.first == v2.first)	return v1.second > v2.second;
		 else						return v1.first < v2.first;
	}
	int main(){
		long long int n;	cin >> n;
		vector<pair<string,int>> v;
		string s;
		int p;
		for(int i=1; i<=n ; i++){
			cin >> s >> p;
			v.push_back(make_pair(s,p));
		}
		
		vector<pair<string,int>> v1(v);
		sort(v.begin(),v.end(),smit);
		
		for(int i=0; i<n; i++){
			pair<string,int> p = make_pair(v[i].first,v[i].second);
			for(int j= 0; j<n ; j++){
				if(v1[j].second==p.second && v1[j].first==p.first)	cout << j+1 << endl;
			}
		}
		
	}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const int INF = 2e9;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
  ll h, w;
  cin >> h >> w;
  if(h==1||w==1){
    print(1);
    return 0;
  }
  ll ans = ((h * w + 1) / 2);
  print(ans);
}

Measured memory_bytes: 3640
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
#include<cassert>
#include<complex>
#include<list>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
#define ceil(a, b) a / b + !!(a % b)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)

class UnionFind {
public:
    vector<int> Parent;
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    int size(int A) {
        return -Parent[root(A)];
    }
    bool connect(int A, int B) {
        A = root(A);
        B = root(B);
        if (A == B) {
            return false;
        }
        if (size(A) < size(B)) swap(A, B);
        Parent[A] += Parent[B];
        Parent[B] = A;
        return true;
    }
};

int main() {
    int n, m; cin >> n >> m;
    UnionFind uni(n);
    while (m--) {
        int x, y, z; cin >> x >> y >> z; x--; y--; z--;
        uni.connect(x, y);
    }
    set<int> s;
    rep(i, n) s.insert(uni.root(i));
    cout << s.size() << endl;
}


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

int main(){
  
  int n, ans = -1;
  cin >> n;

  vector<int> v;

  rep(i, n){
    int a;
    cin >> a;
    v.push_back(a);
  }

  rep(i, 10e9){
    ans++;
    rep(j, n){
      if(v[j] % 2 == 0){
        v[j] /= 2;
      }
      else{
        goto end;
      }
    }
  }
  end:
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N = 101;
const int K = 100001;
const int mod = 1000000007; 

int arr[N];
int n,k; 


void solve()
{
       cin >> n >> k;
      
       //cout << " n " << n << " k " << k << endl; 
       for(int i = 0 ; i < n; i ++) cin >> arr[i]; 
        vector< int >  pre(k+2,0),t(k+2);
        
        pre[1] = 1 ; 
        
        auto print = [&]() 
        {
            for(int i = 0 ; i <= k+1 ; i ++)
               cout << pre[i] << " ";
            cout << endl; 
        };
        for(int i = 1 ; i <= n ; i ++ )
        {    
            
            // find the prefix sum. 
            for(int ii = 1 ; ii <= k+1 ; ii ++) pre[ii] = ( 0l + pre[ii]+pre[ii-1] ) % mod; 

            for(int j = 0; j <= k ; j ++)
            {
               // memo[i][j] = sum(memo[i-1][j-k]) for k = 0 to a[i].
               
               int l = j-min(j,arr[i-1]);
               t[j+1] = ( 0l + pre[j+1] - pre[l] + mod ) % mod ; 
    
               
                /**
               for(int k = 0 ; k <= min(j,arr[i]) ; k ++)
               {
                   memo[i][j] += memo[i-1][j-k]];
               }

               */

            }

            pre = t; 
            //print(); 
         
         }


        //print(); 
        cout << pre[k+1]; 
        //cout << find(0,k);
}

int main()
{

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

	 solve();
	 return 0;
}

Measured memory_bytes: 3968
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<functional>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cassert>
#include<ctime>
using namespace std;

#define mind(a,b) (a>b?b:a)
#define maxd(a,b) (a>b?a:b)
#define absd(x) (x<0?-(x):x)
#define pow2(x) ((x)*(x))
#define rep(i,n) for(int i=0; i<n; ++i)
#define repr(i,n) for(int i=n-1; i>=0; --i)
#define repl(i,s,n) for(int i=s; i<=n; ++i)
#define replr(i,s,n) for(int i=n; i>=s; --i)
#define repf(i,s,n,j) for(int i=s; i<=n; i+=j)
#define repe(e,obj) for(auto e : obj)

#define SP << " " <<
#define COL << " : " <<
#define COM << ", " <<
#define ARR << " -> " <<
#define PNT(STR) cout << STR << endl
#define POS(X,Y) "(" << X << ", " << Y << ")"
#define DEB(A) " (" << #A << ") " << A
#define DEBREP(i,n,val) for(int i=0; i<n; ++i) cout << val << " "; cout << endl
#define ALL(V) (V).begin(), (V).end()
#define INF 1000000007
#define INFLL 1000000000000000007LL
#define EPS 1e-9

typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define P_TYPE int
typedef pair<P_TYPE, P_TYPE> P;
typedef pair<P, P_TYPE> PI;
typedef pair<P_TYPE, P> IP;
typedef pair<P, P> PP;
typedef priority_queue<P, vector<P>, greater<P> > pvqueue;

multiset<int> se;

int main() {
  int n;
  cin >> n;
  rep(i, n) {
    int a; cin >> a;
    auto it = se.lower_bound(-a+1);
    if(it != se.end()) {
      se.erase(it);
    }
    se.insert(-a);
  }
  cout << se.size() << endl;
  return 0;
}


Measured memory_bytes: 4992
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>

using namespace std;

#define sz			size()
#define lgt			length()
#define rep(i,n)	for (int i = 0; i < n; i++)
#define ALL(X)		(X).begin(),(X).end()
#define RALL(X)		(X).rbegin(),(X).rend()
#define pb			push_back
#define SORT(a)		sort(ALL(a));
#define RSORT(a)	sort(RALL(a));
#define mp			make_pair
#define dump(x)		cerr<<#x<<" = "<<(x)<<endl;
#define fir			first
#define sec			second

typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<string> vs;

int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
vs form(string a,char s){vs v;string b;rep(i,a.lgt){if(a[i]==s){v.pb(b);b="";}else b+=a[i];}v.pb(b);return v;}
vi formint(string a,char s){vi v;string b;rep(i,a.lgt){if(a[i]==s){v.pb(toInt(b));b="";}else b+=a[i];}v.pb(toInt(b));return v;}

const double EPS=1e-10,PI=acos(-1.0);
const int INF=2100000000;

vi v;
int d, n, m, tmp;

int bs(int num)
{
	int a = 0, b = n + 1;
	while (b - a > 1){
		int t = (a + b) / 2;
		if (v[t] > num) b = t;
		else a = t;
	}

	return min(num - v[a], v[a+1] - num);
}

int main(void)
{
	while (cin >> d, d){
		cin >> n >> m;
		v.clear();
		v.pb(0);
		for (int i = 0; i < n - 1; i++){
			cin >> tmp;
			v.pb(tmp);
		}
		v.pb(d);
		SORT(v);
		int res = 0;
		for (int i = 0; i < m; i++){
			cin >> tmp;
			res += bs(tmp);
		}
		cout << res << endl;
	}
	
	
	return 0;
}

Measured memory_bytes: 1436
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
    string s;
    int n,ac=0,wa=0,tle=0,re=0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> s;
        if (s == "AC")
        {
            ac++;
        }
        else if (s == "WA")
        {
            wa++;
        }
        else if (s == "TLE")
        {
            tle++;
        }
        else if (s == "RE")
        {
            re++;
        }
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;
}

Measured memory_bytes: 3636
import sys
from sys import stdin

N,X,mod = map(int,input().split())

db = [ [0] * 40 for i in range(mod) ]
s = [ [0] * 40 for i in range(mod) ]

for i in range(mod):

    db[i][0] = i*i%mod
    s[i][0] = i


for j in range(1,40):
    for i in range(mod):

        db[i][j] = db[db[i][j-1]][j-1]
        s[i][j] = s[i][j-1] + s[db[i][j-1]][j-1]

now = X
ans = 0

#print (db[0:10])

for i in range(39,-1,-1):

    #print (now)
    if N & (2**i) > 0:
        ans += s[now][i]
        now = db[now][i]

print (ans)


Measured memory_bytes: 144860
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// --------------------------------------------------------
#define FOR(i,l,r) for (int i = (l); i < (r); ++i)
#define REP(i,n) FOR(i,0,n)
#define SORT(c) sort((c).begin(), (c).end())
#define RSORT(c) sort((c).rbegin(), (c).rend())
#define SZ(c) ((int)(c).size())
#define debug(x) cerr << #x << " = " << (x) << '\n';
using P = pair<int,int>;
using VS = vector<string>;
using VI = vector<int>;
using VVI = vector<VI>;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const ll MOD = 1e+9 + 7;
// --------------------------------------------------------


const int MAX_N = 1e+5;
VI dp(MAX_N, 0);

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);

    int N; cin >> N;
    VI h(N); FOR(i,0,N) cin >> h[i];

    dp[1] = dp[0] + abs(h[1] - h[0]);
    FOR(i,2,N) {
        dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i] - h[i-2]));
    }

    cout << dp[N-1] << '\n';

    return 0;
}

// https://atcoder.jp/contests/dp/tasks/dp_a


Measured memory_bytes: 3940
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define MOD 1000000007
#define INF 1<<30
#define LINF 1LL<<62
#define MAX 510000
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;
const int mod = 1e9 + 7;

int main(){
    ll a,b; cin >> a >> b;
    if(a%3==0 || b%3==0 || (a+b)%3==0) puts("Possible");
    else puts("Impossible");

}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;

class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(in, out);
        out.close();
    }

    static class Task {
        int N, A, B;
        String ans;

        void solve(InputReader in, PrintWriter out) {
            N = in.nextInt();
            A = in.nextInt();
            B = in.nextInt();

            ans = (B - A - 1) % 2 == 1 ? "Alice" : "Borys";

            out.println(ans);
        }
    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

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

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

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

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

        int[] nextIntArray(int n) {
        	int[] arr = new int[n];
        	for (int i = 0; i < n; ++i) {
        		arr[i] = nextInt();
        	}
        	return arr;
        }

        long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; ++i) {
                arr[i] = nextLong();
            }
            return arr;
        }
    }
}


Measured memory_bytes: 21460
n = int(input())
lst = []
for i in range(n):
  s = list(input())
  s = sorted(s)
  lst.append(s)
lst = sorted(lst)
lst.append(["dummy"])

sum_ = 0
count = 1
for i in range(1, n+1):
  if lst[i] == lst[i-1]:
    count += 1
  else:
    sum_ += count * (count-1)//2
    count = 1
    
print(sum_)


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

A=list(map(int,input().split()))
B=list(map(int,input().split()))

k=sum(B)-sum(A)

ka=0
kb=0
for i in range(n):
    if A[i]>B[i]:
        kb+=A[i]-B[i]
    elif A[i]<B[i]:
        ka+=(B[i]-A[i]+1)//2
        kb+=(B[i]-A[i])%2

if k>=ka and k>=kb:
    print("Yes")
else:
    print("No")

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

using namespace std;

const double EPS = 1e-9;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long a;
    double b;
    cin >> a >> b;
    int c = b * 100 + EPS;
    long long ans = (a * c) / 100;
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3760
/* You are being watched. */


//~ while (clock() <= 69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")

#include <bits/stdc++.h>

//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")

using namespace std;

//~ #include <ext/pb_ds/assoc_container.hpp>
//~ #include <ext/pb_ds/tree_policy.hpp>
//~ using namespace __gnu_pbds;
//~ template <typename T>
//~ using ordered_set =
  //~ tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(x) (x).begin(), (x).end()
#define show(x) cerr << __LINE__ << " says: " << #x << " = " << (x) << "\n"
#define FastIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
//using li = __int128;
//using uli = unsigned __int128;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

double getTime() {
  return clock() / (double) CLOCKS_PER_SEC;
}

void read() {};

template<typename T, typename... Args>
void read(T& a, Args&... args) {
  cin >> a;
  read(args...);
}

void print() {};

template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " \n"[sizeof...(args) == 0];
  print(args...);
}

void solve() {
  string s; cin >> s;
  int ans = 0;
  for(int i = 0; i < 3; i++) {
    int cur = 0;
    while(i < 3 and s[i] == 'R') i++, cur++;
    ans = max(ans, cur);
  }
  print(ans);
}

int main() {
  int t; t = 1;
  while(t--) solve();
}

Measured memory_bytes: 3600
#include <iostream>
#include<vector>
#include<algorithm>
#include<queue>

using namespace std;
typedef long long ll;

ll BIG_NUM = 100000000;

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


    vector<int> d(h + 1, BIG_NUM);
    d[0] = 0;

    priority_queue<pair<double, pair<int, int>>> magic;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        magic.push(make_pair((1.0 * a) / b, make_pair(a, b)));
    }

    while (!magic.empty())
    {
        pair<int, int> m = magic.top().second;
        int a = m.first;
        int b = m.second;
        magic.pop();

        for (int j = a; j <= h; j++) {
            d[j] = min(d[j - a] + b, d[j]);
        }

        for (int j = max(h - a, 0); j < h; j++) {
            d[h] = min(d[j] + b, d[h]);

        }


    }


    cout << d[h] << endl;

}


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

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<utility>
#include<map>
#include<stack>
#include<queue>
#include<math.h>

using namespace std;




bool possible(long long int mid, long long int arr[], long long int n, long long int k)
{	if (mid <= 0)
		return false;
	for (long long int i = 0; i < n; i++)
	{	long long int p = arr[i];

		if (k >= (p - 1) / mid)
		{
			k -= (p - 1) / mid;
		}
		else {
			return false;
		}

	}
	return true;

}




int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	long long int n;
	cin >> n;
	long long int k;
	cin >> k;
	long long int arr[n];
	for (long long int i = 0; i < n; i++)
		cin >> arr[i];
	long long int start = 0;
	long long int end = 1000000001;
	while (start < end)
	{
		long long int mid = start + (end - start) / 2;
		if (possible(mid, arr, n, k))
		{
			end = mid;
		}
		else {
			start = mid + 1;
		}
	}

	cout << end << endl;



	return 0;


}


Measured memory_bytes: 5200
N = int(input())
A = [int(input()) for i in range(N)]

ans = 0
for i in range(N-1):
    if A[i]+1 < A[i+1]:
        print(-1)
        exit(0)
if A[0] != 0:
    print(-1)
    exit(0)
for i in range(1, N):
    if A[i-1] >= A[i]:
        ans += A[i-1]
ans += A[-1]
print(ans)


Measured memory_bytes: 11048
#include<stdio.h>
int main(){
int w,h,x,y,r;
scanf("%d %d %d %d %d",&w,&h,&x,&y,&r);
int d = 2 * r ;
if(x>=r && x<=(w-r) && y>=r && y<= (h-r) && d<=w && d<=h)
{
printf("Yes\n");

}

else printf("No\n");


return 0;
}


Measured memory_bytes: 2120
#include <bits/stdc++.h>
#define rg register
#define ll long long
using namespace std;
const int N=2e5+5,Inf=1e9+7;
inline ll read(){
	rg ll x=0; rg char c=getchar();
	while(c<'0'||c>'9') c=getchar();
	while(c>='0'&&c<='9') x=(x<<1)+(x<<3)+c-'0',c=getchar();
	return x; 
}
struct Bag{
	ll ballx,bally;
	inline bool operator < (const Bag &bg) const{ return ballx<bg.ballx; }
}bag[N];
ll x[N],y[N],mx[N],mn[N],n,cnt,ans=Inf,amax,amin=Inf,bmax,bmin=Inf;
int main(){
	n=read();
	for(rg int i=1;i<=n;++i){
		bag[i].ballx=read(); bag[i].bally=read(); 
		if(bag[i].ballx>bag[i].bally) swap(bag[i].ballx,bag[i].bally);
		amin=min(amin,bag[i].bally); amax=max(amax,bag[i].bally);
		bmin=min(bmin,bag[i].ballx); bmax=max(bmax,bag[i].ballx);
	}
	cnt=(amax-amin)*(bmax-bmin); sort(bag+1,bag+n+1); mn[1]=mx[1]=bag[1].bally;
	for(rg int i=2;i<n;++i){
		mn[i]=min(mn[i-1],bag[i].bally); mx[i]=max(mx[i-1],bag[i].bally);
		ans=min(ans,max(mx[i],bag[n].ballx)-min(mn[i],bag[i+1].ballx));
	}
	return printf("%lld\n",min(ans*(amax-bmin),cnt))&0;
}

Measured memory_bytes: 7680