akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <stack>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int n;
ll ans = 0;
int main(int argc, char *argv[]) {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    for (int i = 0; i < n; i++) {
        ll t;
        cin >> t;
        ans += t;
    }
    ans -= ll(n);
    cout << ans;
    return 0;
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<=(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define rev(v) reverse(all(v))
#define minvec(v) *min_element(all(v))
#define maxvec(v) *max_element(all(v))
#define sumvec(v) accumulate(all(v),0)
#define mapmax(v) v.rbegin()->first
#define mapmin(v) v.begin()->first
#define pb push_back
#define pf push_front
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define INF ((1LL<<62)-(1LL<<31))
#define zero(x,n) setw(x) << setfill('0') << n

typedef long long ll;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;

typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;

const double pi = acos(-1.0);
const int mod=1000000007;
const int mod2=998244353;

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

template<class T>
inline bool chmax(T& a, T b){if(a<b){a=b;return true;} return false;}

template<class T>
inline bool chmin(T& a, T b){if(a>b){a=b;return true;} return false;}

void YES(bool b) {cout << (b?"YES\n":"NO\n");}
void Yes(bool b) {cout << (b?"Yes\n":"No\n");}
void yes(bool b) {cout << (b?"yes\n":"no\n");}
void Yay(bool b) {cout << (b?"Yay!\n":":(\n");}

ll gcd(ll x, ll y) {return __gcd(x,y);}
ll lcm(ll x, ll y) {return x/__gcd(x,y)*y;}

int main()
{
	ll n;
	cin >> n;
	vll a(n),b(n+1),ans;
	rep(i,n) cin >> a[i];
	for(ll i=n;i>0;i--){
		ll cnt=0;
		for(ll j=i+i;j<=n;j+=i){
			cnt^=b[j];
		}
		b[i]=cnt^a[i-1];
	}
	for(ll i=1;i<=n;i++){
		if(b[i]) ans.pb(i);
	}
	cout << SIZE(ans) << "\n";
	if(SIZE(ans)!=0){
		for(auto&& e:ans) cout << e << " ";
	}
	cout << "\n";
	return 0;
}

Measured memory_bytes: 4980
#include <bits/stdc++.h>
#define sc(x) scanf("%d", &x)
#define pr(x) printf("%d\n", x)
#define lowbit(x) (x & -x)
#define ll long long
#define memset(x) memset(x, 0, sizeof(x))
#define fre freopen(FILE".in", "r", stdin); freopen(FILE".out", "w", stdout);
#define FILE ""
using namespace std;
const int N = 200010;
char a[N];
int n, k, s, t, ans;
int main()
{
//	fre;
	scanf("%s", a + 1);
	n = strlen(a + 1);
	k = 1;
	while (k <= n)
	{
		if (a[k] != a[k - 1])
		{
			if (a[k] == 'S') 
			{
				ans += s >= t ? 0 : t - s;
				if (s >= t) s -= t, t = 0;
				else s = 0, t = 0;
				s++;
			}
			else t++;
		}
		else 
		{
			if (a[k] == 'S') s++;
			else t++;
		}
		k++;
	}
	if (a[n] == 'S') ans += s;
	else ans += s >= t ? s - t : t - s;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
using namespace std;
int cost[100001][4];
int dp[100001][4];
int main()
{
  int n; cin >> n;
  for (int i = 1; i <= n; i++)
  {
  	for (int j = 1; j <= 3; j++)
    {
      cin >> cost[i][j];
    }
  }
  dp[1][1] = cost[1][1];
  dp[1][2] = cost[1][2];
  dp[1][3] = cost[1][3];
  for (int i = 2; i <= n; i++)
  {
    dp[i][1] = max(dp[i - 1][2], dp[i - 1][3]) + cost[i][1];
    dp[i][2] = max(dp[i - 1][1], dp[i - 1][3]) + cost[i][2];
    dp[i][3] = max(dp[i - 1][1], dp[i - 1][2]) + cost[i][3];
  }
  cout << max(dp[n][1], max(dp[n][2], dp[n][3])) << endl;
  return 0;
}

Measured memory_bytes: 3328
S = input()
listkisuu = ['R','U','D']
listguusuu = ['L','U','D']

fumizuraiflg = 0

for i in range(len(S)):
    #奇数の時
    if (i+1) % 2 != 0:
        if S[i] not in listkisuu:
            fumizuraiflg = 1
    #偶数の時
    else:
        if S[i] not in listguusuu:
            fumizuraiflg = 1        
print('Yes' if fumizuraiflg == 0 else 'No')

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n; cin >> n;
string a, b, c; cin >> a >> b >> c;
ll ca=0;
rep(i,n){
if(a.at(i)==b.at(i)&&b.at(i)==c.at(i)){
continue;}
else if(a.at(i)==b.at(i)||b.at(i)==c.at(i)||c.at(i)==a.at(i)){
ca+=1;}
else ca+=2;}
cout << ca << endl;}

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

//体力nのモンスターを倒すのに必要な攻撃回数
lint solve(lint n) {
    if (n == 1) {
        return 1;
    } else {
        lint temp = solve(n / 2);
        return temp * 2 + 1;
    }
}

lint h;

int main() {
    cin >> h;
    cout << solve(h) << endl;
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define vec vector
#define ll long long

int main(void)
{
  int n, k;
  cin >> n >> k;
  vec<pair<ll, ll>> s(n);
  rep(i, n) cin >> s[i].second >> s[i].first;
  sort(s.begin(), s.end());
  reverse(s.begin(), s.end());

  ll m = 0;
  vec<ll> dp(n + 1, 0);
  ll p = 0;
  rep(i, k) {
    m += s[i].first;
    if (!dp[s[i].second]) p++;
    dp[s[i].second]++;
  }

  m += p * p;
  ll prev = m;
  //大きい順に追加、違う種類を入れる
  int cur = k;
  //小さい順に削除、種類が減らないやつを消す
  int rm = k - 1;

  for (int i = 1; p + i <= k; i++) {
    ll p_ = p + (ll)i;
    //１個以上あるやつを探す
    while(rm >= 0 && dp[s[rm].second] <= 1) rm--;
    if (rm < 0) break;
    ll temp = prev - s[rm].first + 2 * p_ - 1;
    dp[s[rm].second]--;
    rm--;
    //まだ含まれてないやつを探す
    while(cur < n && dp[s[cur].second]) cur++;
    if (cur >= n) break;
    temp += s[cur].first;
    dp[s[cur].second]++;
    cur++;

    if (temp > m) {
      m = temp;
    }
    prev = temp;
  }

 cout << m << endl;
  return 0;
}



Measured memory_bytes: 2560
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
	class Program
	{
		static void Main(string[] args)
		{
			var inputs = new List<long>();
			var n = long.Parse(Console.ReadLine());
			inputs.Add(long.Parse(Console.ReadLine()));
			inputs.Add(long.Parse(Console.ReadLine()));
			inputs.Add(long.Parse(Console.ReadLine()));
			inputs.Add(long.Parse(Console.ReadLine()));
			inputs.Add(long.Parse(Console.ReadLine()));
			var time = 0L;
			var maxBoardingTime = 0L;

			for (int i = 0; i < inputs.Count; i++)
			{
				// 運ぶ時間
				// 最大人数で運ぶ
				var boardingTime = n / inputs[i];
				// 端数を運ぶ
				boardingTime += n % inputs[i] == 0 ? 0 : 1;

				if (boardingTime > maxBoardingTime)
				{
					time += boardingTime - maxBoardingTime;
					maxBoardingTime = boardingTime;
				}
			}

			Console.WriteLine(time + 4);
		}
	}
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;

int main(){
    ll N, L; cin >> N >> L;
    vector<ll> A(N); for(int i = 0; i < N; i++) cin >> A[i];
    ll Max = 0;
    int idx = -1;
    for(int i = 0; i < N-1; i++) {
        ll temp = A[i]+A[i+1];
        if(Max < temp){
            Max = temp;
            idx = i;
        }
    }
    if(Max < L){
        cout << "Impossible" << endl;
        return 0;
    }
    cout << "Possible" << endl;
    idx++;
    for(int i = 1; i < idx; i++){
        cout << i << endl;
    }
    for(int i = N-1; i > idx; i--){
        cout << i << endl;
    }
    cout << idx << endl;

}


Measured memory_bytes: 1664
#include<iostream>
#include<cmath>
#include<string>
#include<utility>
#include<vector>
#include<array>

using namespace std;


long long gcd(long long i,long long j){
    long long buf;
    if(j>i){
        buf=i;
        i=j;
        j=buf;
    }
    if(j==0) return i;
    else{
        i=i%j;
        return gcd(i,j);
    }
}

int main(){
    long long  A,B;
    cin >> A >> B;
    long long  ans= A*B/gcd(A,B);
    cout <<ans<< endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		int l = 0;
		int r = 0;
		long cout = 0;
		int temp = a[0];
		while (l < n) {
			while (r < n - 1) {
				if ((temp ^ a[r + 1]) == temp + a[r + 1]) {
					temp += a[r + 1];
					r++;
				} else break;
			}
			cout += r - l + 1;
			temp -= a[l];
			l++;
		}
		System.out.println(cout);
	}
}

Measured memory_bytes: 82380
while(1):
    try:
        [a,b,c,d,e,f]=map(int,raw_input().split())
        det=a*e-d*b
        x,y=(e*c-b*f)/float(det) ,(-d*c+a*f)/float(det)
        xs,ys='%.3f'%x,'%.3f'%y
        xs,ys=['0.000' if t=='-0.000' else t for t in [xs,ys]]
        print xs,ys
    except:
        break

Measured memory_bytes: 6272
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
constexpr int mod=1000000007;
constexpr int mod1=998244353;
vector<int> dx={0,-1,0,1},dy={1,0,-1,0};


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;cin >> s;
	int n=s.size(),cnt=0;
	ll ans=0;
	rep(i,n-1){
		if(s.at(i)=='A') cnt++;
		else if(s.at(i)=='B' && s.at(i+1)=='C'){
			ans+=cnt;
			i++;
		}
		else cnt=0;
	}
	cout << ans << endl;
}


Measured memory_bytes: 720
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <algorithm>
#include <bitset>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#include <cassert>
#include <functional>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main() {
  int N, M;
  int s[5], c[5];

  scanf("%d%d", &N, &M);

  for (int i = 0; i < M; i++) {
    scanf("%d%d", s + i, c + i);
  }

  int l, r;

  if (N == 1) { l = 0, r = 10; }
  if (N == 2) { l = 10, r = 100; }
  if (N == 3) { l = 100, r = 1000; }

  for (int i = l; i < r; i++) {
    string si = to_string(i);

    bool ok = true;
    for (int j = 0; j < M; j++) {
      ok &= si[s[j] - 1] - '0' == c[j];
    }

    if (ok) {
      printf("%d\n", i);
      return 0;
    }
  }

  puts("-1");

  return 0;
}


Measured memory_bytes: 256
function Main(input) {
  input = input.split("\n");
  const X = parseInt(input[0].split(" ")[0]);
  const Y = parseInt(input[0].split(" ")[1]);

  if ((Y - X * 2) % 2 === 0 && X * 4 >= Y && X * 2 <=Y) {
    console.log("Yes");
  } else {
    console.log("No");
  }
}

// デバッグ用
function debug() {
  var input = document.getElementById("input").value;
  Main(input);
}

//* この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 30472
N, K = (int(i) for i in input().split())
D=[]
for i in input().split():
    D.append(i)

n=N
while True:
    queue=0
    nstr=str(n)
    for i in nstr:
        if i in D:
            queue=1
    if queue==0:
        print(n)
        break
    n+=1

Measured memory_bytes: 2940
// 20
/****************************************************
https://searleser97.gitlab.io/algorithms/template.cpp
****************************************************/

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define forr(_, x, n) for (int _ = x; _ > n; _--)
#define fos(_, x, n, s) for (int _ = x; _ < n; _ += s)
#define forn(_, x, n) fos(_, x, n, 1)
#define rep(_, n) forn(_, 0, n)
#define fi first
#define se second
#define pb push_back
#define pairii pair<int, int>
#define all(x) x.begin(), x.end()
#define cerr(s) cerr << "\033[48;5;196m\033[38;5;15m" << s << "\033[0m"
// typedef __int128_t lli;
typedef long long int li;
typedef long double ld;
// 12
void _main(int tc) {
  int n;
  cin >> n;
  li sumt = 0, suma = 0;
  rep(i, n) {
    li t, a;
    cin >> t >> a;
    if (i == 0) sumt = t, suma = a;
    else {
      // li m1 = ceil((double) sumt / t);
      // li m2 = ceil((double) suma / a);
      li m1 = sumt % t == 0 ? sumt / t : sumt / t + 1;
      li m2 = suma % a == 0 ? suma / a : suma / a + 1;
      li multi = max(m1, m2);
      sumt = t * multi, suma = a * multi;
    }
  }

  cout << sumt + suma << endl;
}

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  _main(0); return 0;
  int tc;
  cin >> tc;
  rep(i, tc) _main(i + 1);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int r,g,b,k,t=0; cin>>r>>g>>b>>k;
	while(r >= g){ g *= 2; t++; }
	while(g >= b){ b *= 2; t++; }
	puts(t > k? "No":"Yes");
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define pi 3.141592653589793
using namespace std;



int main() {
//    cout << setprecision(10);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n;
    cin >> n;
    int b[n];
    for (int i = 0; i < n - 1; i++) cin >> b[i];
    int ans = 0;
    for (int i = 0; i < n - 1; i++) {
        if (i) ans += min(b[i], b[i - 1]);
        else ans += b[i];
    }

    ans += b[n - 2];
    cout << ans;



}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    vector<int> a={0 , 1 , 3 , 1 , 2 , 1 , 2 , 1 , 1 , 2 , 1 , 2 , 1};
    int x,y; cin >> x >> y;
    cout << (a[x] == a[y] ? "Yes" : "No") << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 using namespace std;
int main(){ 
    long long  n,m; 
    cin >> n >> m; 
    vector<pair<long long,long long>> v;
     for(int i=0;i<n;i++){ 
        long long a,b; 
        cin >> a >> b; v.push_back(make_pair(a,b));
         } 
    sort(v.begin(),v.end());
     long long  purchaseNum = m;
     long long sum = 0; 
    for(int i=0;i<n;i++){ 
        if(purchaseNum>=v[i].second)
         sum += v[i].first*v[i].second; 
        else sum += v[i].first*purchaseNum; purchaseNum -= v[i].second; if(purchaseNum<=0)
         break; } 
    cout << sum << endl;
    return 0; } 


Measured memory_bytes: 5300
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
int main() {
  ll a, b, c;
  cin >> a >> b >> c;
  cout << (a + b + c >= 22 ? "bust":"win") << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String s = scanner.next();
    if(s.equals("AAA") || s.equals("BBB")) {
      System.out.println("No");
    } else {
      System.out.println("Yes");
    }
  }
}


Measured memory_bytes: 21844
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#define MOD (1000000007l)
#define rep(i, n) for(long i = 0; i < n; i++)

using namespace std;

void solve() {
  string a, b, c;
  cin >> a >> b >> c;

  string ans = "___";
  ans[0] = a[0] + 'A' - 'a';
  ans[1] = b[0] + 'A' - 'a';
  ans[2] = c[0] + 'A' - 'a';

  cout << ans << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  solve();
  return 0;
}


Measured memory_bytes: 256
# 129 B-Balance
N = int(input())
W =list(map(int, input().split()))
ans = 10000
for i in range(1,N):
    if abs(sum(W[0:i])-sum(W[i:N])) < ans:
        ans = abs(sum(W[0:i])-sum(W[i:N]))
print(ans)

Measured memory_bytes: 3060
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

n,m=MI()
sws=[]
for i in range(m):
    sws.append(list(map(int,input().split())))
#print(sws)
ps=LI()
ans=0
for i in range(2**n):
    count=0
    for j in range(m):
        sm=0
        for k in range(1,len(sws[j])):
            sm+= (i>>(sws[j][k]-1)) %2
        #print(sm)
        if sm%2==ps[j]:
            count+=1
    if count==m:
        ans+=1
print(ans)


Measured memory_bytes: 3064
#include <iostream>
#include <numeric>
#include <cmath>
#include <limits>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
ll Max(ll(a), ll(b), ll(c)) {
	return max(max(a, b), c);
}
ll Min(ll(a), ll(b), ll(c)) {
	return min(min(a, b), c);
}
ll kai(vector<ll> A, ll key) {
	ll an = 0;
	rep(i, A.size()) {
		an += (A.at(i) - 1) / key;
	}
	return an;
}
// index が条件を満たすかどうか
bool isOK(int index,vector<ll> A, int K) {
	if (kai(A,index) <= K) return true;
	else return false;
}

// 汎用的な二分探索のテンプレ
int binary_search(ll MA,vector<ll> A,ll K) {
	int left = 0; //「index = 0」が条件を満たすこともあるので、初期値は -1
	int right = MA; // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()

	/* どんな二分探索でもここの書き方を変えずにできる！ */
	while (right - left > 1) {
		int mid = left + (right - left) / 2;

		if (isOK(mid, A,K)) right = mid;
		else left = mid;
	}

	/* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
	return right;
}
vector<ll> fact, factinv, inv;
ll mod = 1e9 + 7;
void prenCkModp(ll n) {
	fact.resize(n + 5);
	factinv.resize(n + 5);
	inv.resize(n + 5);
	fact.at(0) = fact.at(1) = 1;
	factinv.at(0) = factinv.at(1) = 1;
	inv.at(1) = 1;
	for (ll i = 2; i < n + 5; i++) {
		fact.at(i) = (fact.at(i - 1) * i) % mod;
		inv.at(i) = mod - (inv.at(mod % i) * (mod / i)) % mod;
		factinv.at(i) = (factinv.at(i - 1) * inv.at(i)) % mod;
	}

}
ll nCk(ll n, ll k) {
	if (n < 0 || k < 0){
		return 1;
	}
	else if (n < k) {
		return 0;
	}
	return fact.at(n) * (factinv.at(k) * factinv.at(n - k) % mod) % mod;
}

ll dp[100002];
void res() {
	for (ll n = 0; n < 102; n++) {
		for (ll v = 0; v < 100002; v++) {
			dp[n] = 1e12;
		}
	}
}
int main() {
	ll D,S,T;
	string an = "Yes";
	cin >> D>>T>>S;
	if (S * T < D)an = "No";
	cout << an << endl;
}


Measured memory_bytes: 3628
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,j,n) for(int i = j; i < n; i++)
#define RFOR(i,j,n) for(int i = j-1; i >= n; i--)
#define PREC(n) fixed << setprecision(n)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define _LIBCPP_DEBUG 0
using namespace std;
int64_t MOD = 1000000007;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b;
  cin >> a >> b;
  if(a > b) a--;
  cout << a << endl;
  return 0;
}
//templete by private_yusuke

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  ll N, K;
  cin>>N>>K;
  ll bmap[K+1][K+1], wmap[K+1][K+1];
  for(int i=0;i<=K;++i) {
    for(int j=0;j<=K;++j) {
      bmap[i][j] = 0;
      wmap[i][j] = 0;
    }
  }
  ll x, y;
  char c;
  for(int i=0;i<N;++i) {
    cin>>x>>y>>c;
    if((x/K+y/K)%2==1) {
      if(c=='B') c = 'W';
      else c = 'B';
    }
    x %= K;
    y %= K;
    if(c=='B') bmap[x+1][y+1]++;
    else wmap[x+1][y+1]++;
  }
  for(int i=1;i<=K;++i) {
    for(int j=1;j<=K;++j) {
      bmap[i][j] += bmap[i-1][j]+bmap[i][j-1]-bmap[i-1][j-1];
      wmap[i][j] += wmap[i-1][j]+wmap[i][j-1]-wmap[i-1][j-1];
    }
  }
  /**
  for(int i=0;i<=K;++i) {
    for(int j=0;j<=K;++j) {
      cout<<bmap[i][j]<<" ";
    }
    cout<<endl;
  }
  cout<<endl;
  for(int i=0;i<=K;++i) {
    for(int j=0;j<=K;++j) {
      cout<<wmap[i][j]<<" ";
    }
    cout<<endl;
  }
  **/
  ll ans = 0;
  for(int i=0;i<=K;++i) {
    for(int j=0;j<=K;++j) {
      ans = max(ans, bmap[i][j]+bmap[K][K]-bmap[K][j]-bmap[i][K]+bmap[i][j]+wmap[i][K]-wmap[i][j]+wmap[K][j]-wmap[i][j]);
      ans = max(ans, wmap[i][j]+wmap[K][K]-wmap[K][j]-wmap[i][K]+wmap[i][j]+bmap[i][K]-bmap[i][j]+bmap[K][j]-bmap[i][j]);
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 19232
#include<cstdio>
#include<algorithm>
using namespace std;
bool selector(int a,int b){
	if(a>b)
		return true;
	return false;
}
int main(){
	int n;
	int kcost,kcal;
	int cost;
	int *cal;
	int max;

	scanf("%d",&n);
	cal = new int [n];
	scanf("%d %d",&kcost,&cost);
	scanf("%d",&kcal);
	for(int i=0;i<n;i++){
		scanf("%d",&cal[i]);
	}
	sort(cal,cal+n,selector);
	max = kcal/kcost;
	for(int i=0;i<n;i++){
		int scal=kcal;
		int scost=kcost;
		for(int j=0;j<=i;j++){
			scal+=cal[j];
		}
		scost += (i+1)*cost;
		if(scal/scost>max){
			max=scal/scost;
		}
	}
	printf("%d\n",max);
	return 0;
}

Measured memory_bytes: 1040
#include<bits/stdc++.h>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <cstdio>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
const int N=1e5+5;
#define ll long long
#define inf 0x3f3f3f3f
#define mem(x) memset(x,0,sizeof(x))
#define sca(x) scanf("%d",&x)
#define scall(x) scanf("%lld",&x)
#define eps 1e-6
int main()
{
	char s;cin>>s;
	if(s>='a'&&s<='z')
	cout<<"a"<<endl;
	else
	cout<<"A"<<endl; 
 } 

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

int main () {
  int N;
  cin >> N;
  vector<int> num(N);
  for (int i = 0; i < N; i++) cin >> num.at(i);
  int ans = 0;
  int min = 0;
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      min = num.at(i);
      ans++;
    }
    else if (num.at(i) <= min){
      min = num.at(i);
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 1024
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

BA = [b-a for a, b in zip(A, B) if b > a]
AB = sorted([a-b for a, b in zip(A, B) if a > b], reverse=True)
if len(BA) == 0:
  print(0)
else:
  S = sum(BA)
  Sd = 0
  for i, ab in enumerate(AB):
    Sd += ab
    if Sd >= S:
      break
  if Sd >= S:
    print(len(BA)+i+1)
  else:
    print(-1)


Measured memory_bytes: 18708
#include<bits/stdc++.h>
#include<iomanip>
#include<numeric>

using namespace std;
using ll = long long;
constexpr int mo = 1e9+7;
constexpr int  mod = mo;
constexpr ll inf = 1ll<<60;
int main(){
    int n;
    cin>>n;
    string s;
    cin>>s;
    int cur = 0;
    string ret;
    for(int i=0;i<n;++i){
        if(s[i] == '('){
            if(cur < 0){
                ret = string(-cur,'(') + ret;
                cur = 0;
            }
            cur++;
        }else {
            cur--;
        }
        ret.push_back(s[i]);
    }
    if(cur > 0 ) ret = ret + string(cur,')');
    else ret = string(-cur,'(') + ret;
    cout << ret << endl;
    return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>
#include <string.h>
#include <vector>

#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

typedef int64_t ll;

const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INTMAX = 2147483647;
const ll LLMAX = 9223372036854775807;

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; }
void SWAP(ll& a, ll& b) { a ^= b; b ^= a; a ^= b; }
void SWAP(int& a, int& b) { a ^= b; b ^= a; a ^= b; }

using namespace std;

typedef pair<int, int> tupii;

class C {
	int n;
	vector<tupii> x;
public:
	C()
	{
		cin >> n;
		x.reserve(n);
		int tmp;
		REP(i, n)
		{
			cin >> tmp;
			x.emplace_back(MP(tmp, i));
		}
	}

	void solve()
	{

		sort(ALL(x), [](const tupii& left, const tupii& right) { return left.first < right.first; });
		vector<int> ans(n);

		REP1C(i, n)
		{
			if (i <= n / 2)
				ans[x[i - 1].second] = x[n / 2].first;
			else
				ans[x[i - 1].second] = x[n / 2 - 1].first;
		}

		REP(i, n)
			cout << ans[i] << endl;

	}
};


int main()
{
	C solution;
	solution.solve();

	return 0;
}


Measured memory_bytes: 4480
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>

using namespace std;

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

    int res = 0;
    for (int i = 0; i < 4; i++) {
        if (s[i] == '+') {
            res++;
        } else {
            res--;
        }
    }

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007


int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	if(a <= c && c <= b) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))

def lower_bound(lis, target):
    left, right = 0, n  # NOT n-1 !!!!!!!!!!
    while left<right:
        mid = (left+right)//2
        if lis[mid]==target:
            return True
        elif target<lis[mid]:
            right = mid
        else:
            left = mid+1
    return False

cnt = 0
for i in range(q):
    cnt = cnt+1 if lower_bound(s, t[i]) else cnt
print(cnt)

Measured memory_bytes: 18712
#include <iostream>

using namespace std;

#define D_MAX_BUILDING 4
#define D_MAX_FLOOR 3
#define D_MAX_ROOM 10

int main(void)
{
    unsigned int uiInfoSum;
    unsigned int uiPersonSum[D_MAX_BUILDING][D_MAX_FLOOR][D_MAX_ROOM] = {};
    unsigned int uiBuildingNum;
    unsigned int uiFloorNum;
    unsigned int uiRoomNum;
    int iMovPersonNum;
    
    cin >> uiInfoSum;
    for(int i = 0; i < uiInfoSum; ++i) {
        cin >> uiBuildingNum
            >> uiFloorNum
            >> uiRoomNum
            >> iMovPersonNum;
        uiPersonSum[uiBuildingNum - 1][uiFloorNum - 1][uiRoomNum - 1] += iMovPersonNum;
    }
    for(int iBuildingCount = 0; iBuildingCount < D_MAX_BUILDING; ++iBuildingCount) {
        for(int iFloorCount = 0; iFloorCount < D_MAX_FLOOR; ++iFloorCount) {
            for(int iRoomCount = 0; iRoomCount < D_MAX_ROOM; ++iRoomCount) {
                cout << ' '
                     << uiPersonSum[iBuildingCount][iFloorCount][iRoomCount]
                     << flush;
            }
            cout << endl;
        }
        if(iBuildingCount != (D_MAX_BUILDING - 1)) {
            for(int i = 0; i < 20; ++i) {
            cout << '#'
                 << flush;
            }
            cout << endl;
        }
    }
    
    return 0;
}


Measured memory_bytes: 3072
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep2(i,a,n) for(int i = (a);i < (n);i++)
#define rep(i,n) rep2(i,0,n)
#define INF (1LL << 60)

int main(void){
    
    int l,r,d;cin >> l >> r >> d;
    int sum = 0;
    for(int i = l;i <= r;i++){
        if(i % d == 0)sum++;
    }
    cout << sum << endl;
    
}


Measured memory_bytes: 3628
#!/usr/bin/env python3
import sys
import math

def solve(K: int):
    answer = 0
    GCDLIST = [[1]*(K+1) for _ in range(K+1)]

    for i in range(1,K+1):
        for j in range(1,K+1):
            g = math.gcd(i,j)
            GCDLIST[i][j] = g
            GCDLIST[j][i] = g
    
    for i in range(1,K+1):
        for j in range(1,K+1): 
            for k in range(1,K+1):
                answer += GCDLIST[GCDLIST[i][j]][k]
    
    print(answer)
    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)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    solve(K)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9512
#include<bits/stdc++.h>
using lint=long long;
using real=long double;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint a,b;std::cin>>a>>b;
    if(a>b)std::swap(a,b);
    while(b--)std::cout<<a;
    std::cout<<'\n';
}


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

#define rep(i,z) for(int i = 0; i<(int)(z); i++)
#define rep1(i,z) for(int i = 1; i<=(int)(z); i++)
 
using namespace std;

typedef long long ll;
const ll MOD=1e9+7;
using pear = pair<int,int>;

int main(){
   int n,k; cin>>n>>k;
   vector<bool> having(n);
   rep(i,n)having[i]=false;
   rep(i,k){
       int d; cin>>d;
       rep(i,d){
           int a; cin>>a; a--;
           having[a]=true;
       }
   }
   int ans=0;
   rep(i,n) if(!having[i]) ans++;
   cout<<ans<<endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <string>
using namespace std;
#define rep(i,n) for(long long i=0;i<n;i++)

int main(){
    int a[3];
    rep(i,3) cin >> a[i];
    sort(a, a + 3);
    if ((a[0] == 5) && (a[1] == 5) && (a[2] == 7)) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, K;
    cin >> N >> K;
    ll answer = 0;
    while(N)
    {
        answer++;
        N /= K;
    }
    cout << answer << endl;
    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int> > mati;
typedef vector<vector<double> > matd;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef vector<pll> vpll;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back

inline void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

inline void OUT(void){
  cout << "\n";
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

int main(){
  ll N, L;
  IN(N,L);

  ll min_target = INFLL;
  ll sum_ = 0;
  REP(i,N){
    if(abs(min_target) > abs(L+i)) min_target = L+i;
    sum_ += L+i;
  }

  OUT(sum_-min_target);

  return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
int r, g, b;
int num;
int main()
{
    cin >> r >> g >> b;
    num = b + g * 10 + r * 100;
    if(num % 4 == 0)
        cout <<"YES" << endl;
    else
        cout << "NO" << 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);
    String source = sc.next();

    char[] type = new char[2];

    type[0] = source.charAt(0);

    int count = 1;
    for (int sceIdx = 1; sceIdx < source.length(); sceIdx++) {
      if (source.charAt(sceIdx) != type[0]) { // 0文字目と違う?
        type[1]=source.charAt(sceIdx);
      }else{
        count++;
      }
    }
    if(count!=2||type[1]=='\0'){
      System.out.println("No");
      return;
    }
    count = 0;
    for (int sceIdx = 1; sceIdx < source.length(); sceIdx++) {
      if (source.charAt(sceIdx) == type[1]) {
        count++;
      }
    }
    if(count != 2){
      System.out.println("No");
      return;
    }
    System.out.println("Yes");
    return;
  }

}

Measured memory_bytes: 21844
// スタックサイズ: 100MB

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
using namespace std;

typedef int64_t ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
const ll INF = 1000000000000000000;
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define fst first
#define snd second
ll pw(ll x, ll y) { ll r = 1;  rep(i, y) { r *= x; }; return r; }




int main() {
	
	ll N;
	cin >> N; ++N;
	vll t(N + 1, 0), x(N + 1, 0), y(N + 1, 0);
	fori(i, 1, N) cin >> t[i] >> x[i] >> y[i];

	ll flag = true;
	fori(i, 1, N) {
		ll sx = x[i - 1], sy = y[i - 1], gx = x[i], gy = y[i], tm = t[i] - t[i - 1];
		if (abs(gx - sx) + abs(gy - sy) <= tm && (abs(gx - sx) + abs(gy - sy)) % 2 == tm % 2);
		else flag = false;
	}
	cout << (flag ? "Yes" : "No") << endl;
}

Measured memory_bytes: 2560
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define FOR(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v),end(v)
#define debug(x) std::cerr<<#x<<": "<<x<<"\n"
#define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
#define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"

using ll=long long;
using vi=std::vector<int>;
using vvi=std::vector<vi>;
using vll=std::vector<ll>;
using vvll=std::vector<vll>;
template<typename T> using vvec=std::vector<std::vector<T>>;
template<typename T>
auto make_v(size_t sz){return std::vector<T>(sz);}
template<typename T,typename... Ts>
auto make_v(size_t sz,Ts...ts){return std::vector<decltype(make_v<T>(ts...))>(sz,make_v<T>(ts...));}
template<typename T>
void fill_v(T&var,const T&x){var=x;}
template<typename V,typename T>
void fill_v(V&v,const T&x){for(auto&& w:v){fill_v(w,x);}}

template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<std::vector<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<std::deque<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s, const std::set<T>&v){
  s<<"\n";for(auto&& elm:v){s<<elm<<"\t";}s<<"\n";return s;}

inline void scan(int&a){scanf("%d",&a);}
inline void scan(ll&a){scanf("%lld",&a);}
inline void scan(char&a){scanf(" %c",&a);}
inline void scan(double&a){scanf("%lf",&a);}
template<typename T>
inline void scan(std::vector<T>&v){for(auto&& sv:v){scan(sv);}}
template<typename First,typename...Args>
inline void scan(First&f,Args&...args){scan(f);scan(args...);}
inline void scan(std::string&s){char BUF[3000000];scanf(" %s",BUF);s=std::string(BUF);}
inline void print(int a){printf("%d\n",a);}
inline void print(ll a){printf("%lld\n",a);}
inline void print(double a){printf("%.12f\n",a);}
inline void print(std::string s){std::cout<<s<<"\n";}

using namespace std;

void solve() {
  int x, y, z;
  scan(x, y, z);
  printf("%d %d %d\n", z, x, y);

}

int main() {
  solve();
  return 0;
}


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

vector<ll> a;
vector<ll> p;

ll solve(ll n, ll x){
	if(n == 0 && x >= 1){
		return 1;
	}
	if(x <= 1){
		return 0;
	} else if (1 <= x && x <= 1 + a[n-1]){
		return solve(n-1, x-1);
	} else if (x == a[n-1] + 2){
		return p[n-1] + 1;
	} else if (2 + a[n-1] < x <= 2 + 2 *a[n-1]){
		return p[n-1] + 1 + solve(n-1, x-2-a[n-1]);
	} else if (x >= a[n-1] + 3){
		return 2 * p[n-1] + 1;
	}
}

int main(){
	ll n,x;
	cin >> n >> x;
	a.resize(n+1,0);
	p.resize(n+1,0);
	a[0] = 1;
	p[0] = 1;
	REP(i,n){
		a[i] = 2*a[i-1] + 3;
		p[i] = 2*p[i-1] + 1;
	}
	ll ans = solve(n, x);
	cout << ans << endl;
    return 0;
}

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

using namespace std;
using i64 = long long int;
using ui64 = unsigned long long int;
using EDGE = vector<int>;
using GRAPH = vector<EDGE>;

////////////////////////////////
struct unionfind{
    vector<int> data;
    unionfind(int n):data(n,-1){};
    int root(int idx){
        return data[idx]<0?idx:data[idx]=root(data[idx]);
    }
    bool same(int x,int y){
        return root(x)==root(y);
    }
    bool join(int x,int y){
        x = root(x); y = root(y);
        if(x==y)return false;
        if(data[x]>data[y])swap(x,y);
        data[x] += data[y];
        data[y] = x;
        return true;
    }
};

int main()
{
    int n,q;
    cin >> n >> q;
    unionfind uf(n);
    for(int i=0;i<q;i++){
        int c,x,y;
        cin >> c >> x >> y;
        if(c == 0)uf.join(x,y);
        else cout << (int)uf.same(x,y) << endl;
    }
}


Measured memory_bytes: 3128
n,k = gets.split.map(&:to_i)
arr = []
k.times do
  d = gets.to_i
  a = gets.split.map(&:to_i)
  arr << a
end
sunuke = Array.new(n,0)
arr.each do |a|
  a.each do |i|
    sunuke[i-1] += 1
  end
end
sum = 0
sunuke.each do |v|
  sum += 1 if v == 0
end
puts sum

Measured memory_bytes: 14332
import java.util.*;
import java.math.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int m = Math.max(a,Math.max(b,c));
        System.out.println(a+b+c-m);
    }
}

class io{
    public static void YesNo(boolean f) {
        System.out.println(f?"Yes":"No");
    }
    public static void YESNO(boolean f) {
        System.out.println(f?"YES":"NO");
    }
}

class Algo{
    public static boolean isOdd(int n){
        return n % 2 == 1;
    }
    public static boolean isEven(int n){
        return n % 2 == 0;
    }


}



Measured memory_bytes: 21844
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
int cmp(const void *a, const void *b);
typedef struct{
    ll x; ll y; double seta;
}point;
int main(void){
    ll N;
    point P[110];
    scanf("%lld", &N);
    rep(i, 0, N){
        scanf("%lld %lld", &P[i].x, &P[i].y);
        P[i].seta = atan2(P[i].y, P[i].x);
    }
    //P を偏角ソート
    qsort(P, N, sizeof(point), cmp);
    double ANS=0;
    rep(i, 0, N){
        ll sx=0, sy=0;
        rep(J, 0, N){
            ll j=(J+i)%N;
            sx += P[j].x;
            sy += P[j].y;
            chmax(ANS, hypot(sx,sy));
        }
    }
    printf("%.11f\n", ANS);
    return 0;
}
int cmp(const void *a, const void *b){
    double A=((point *)a)->seta, B=((point *)b)->seta;
    if(A==B)return 0;
    else return A>B ? 1:-1;//昇順ソート
}


Measured memory_bytes: 128
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;

constexpr ll LLINF {1001002003004005006};//ll = 9*LLINF
constexpr int INTINF {1000000000};//int = 2*INTINF

#define  rep(i,n)   for(int i = 0; i < (n); ++i)
#define rrep(i,n)   for(int i = 1; i <= (n); ++i)
#define drep(i,n)   for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for(int i = s; i < t;  ++i)

template<typename T>
void maxs(T& x, T&& y) {
  x=std::max(x,y);
}
template<typename T>
void maxs(T& x, T& y) {
  x=std::max(x,y);
}

template<typename T>
void mins(T& x, T&& y) {
  x=std::min(x,y);
}
template<typename T>
void mins(T& x, T& y) {
  x=std::min(x,y);
}

using P = std::pair<int, int>;
int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  int n;
  cin >> n;
  vector<string> S(n);
  rep(i, n) cin >> S[i];

  vector<P> X(n);
  rep(i, n) {
    int fi {}, se {};
    int pos {};
    for (const auto& e : S[i]) {
      if (e == ')') --pos;
      else ++pos;
      mins(fi, pos);
    }
    se = pos;
    X[i].first = fi;
    X[i].second = se;
  }
  vector<P> Plus_ans {};
  vector<P> Minus_ans {};
  rep(i, n) {
    if (X[i].second > 0) Plus_ans.push_back(X[i]);
    else Minus_ans.push_back(X[i]);
  }
  sort(Plus_ans.begin(), Plus_ans.end(), [](P& l, P& r){return l.first > r.first;});
  sort(Minus_ans.begin(), Minus_ans.end(), [](P&l, P& r){return (l.first-l.second < r.first-r.second);});

  int total {};
  for (const auto& e : Plus_ans) {
    if (total + e.first >= 0) {
      total += e.second;
    } else {
      cout << "No\n";
      return 0;
    }
  }
  for (const auto& e : Minus_ans) {
    if (total + e.first >= 0) {
      total += e.second;
    } else {
      cout << "No\n";
      return 0;
    }
  }
  if (total == 0) cout << "Yes\n";
  else cout << "No\n";
}


Measured memory_bytes: 50304
#include"iomanip"
#include"iostream"
#include"limits"
#include"cmath"
#include"vector"
#include"algorithm"
#include"list"
#include"queue"
#include"stack"
#include"set"
#include"unordered_set"
#include"map"
#include"unordered_map"
#include"string"
#include"cstring"
#include"assert.h"
using namespace std;
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define mp make_pair
#define pb push_back
#define mset(a,b) memset(a,b,sizeof(a))
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int a[4];
stack<char>st;
void df(int i,int s)
{
	if(i==4)
	{
		if(s==7)
		{
			char c=st.top();st.pop();
			char b=st.top();st.pop();
			char a1=st.top();st.pop();
			cout<<a[0]<<a1<<a[1]<<b<<a[2]<<c<<a[3]<<"=7\n";
			exit(0);
		}
		return;
	}
	st.push('+');
	df(i+1,s+a[i]);
	st.pop();
	st.push('-');
	df(i+1,s-a[i]);
	st.pop();
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	char xx,yy,zz,bb;
	cin>>xx>>yy>>zz>>bb;
	a[0]=xx-'0';a[1]=yy-'0';a[2]=zz-'0';a[3]=bb-'0';
	st.push(a[0]);
	df(1,a[0]);
}









Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func main() {
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush()

	A, B, C := nextInt(), nextInt(), nextInt()
	K := nextInt()
	count := 0

	for A >= B {
		B *= 2
		count++
	}

	for B >= C {
		C *= 2
		count++
	}

	if count <= K {
		fmt.Fprint(out, "Yes")
	} else {
		fmt.Fprint(out, "No")
	}
}


Measured memory_bytes: 1808