akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define double long double
#define REP(i,x,n) for(int i=x;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
#define sp(p) cout<<setprecision(16)<<fixed<<p<<endl;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(a))
#define UNIQ(a) unique(all(a))
#define vout(v) for(int i=0;i<(int)v.size()-1;i++){cout<<v[i]<<" ";}cout<<v[v.size()-1]<<"\n";
#define vmin(v) *min_element(all(v))
#define vmax(v) *max_element(all(v))
#define debg(a) cerr<<#a<<" "<<a<<endl;
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
template<class T>inline int out(const T &t){ print(t); putchar('\n'); return 0; }
template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> V;
// const long long MOD=1000000007;
const long long INF = 1e18;
vector <ll> dp;


void solve(long long A, long long B){
    ll val=A-B*2;
    if(val<0){val=0;}
    cout << val << "\n";
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(A, B);
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#pragma warning(disable:4996)
using namespace std;

struct UnionFind {
	vector<int> data;
	UnionFind(int size) : data(size, -1) { }
	bool unionSet(int x, int y) {
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int main() {
	int N,K;cin>>N>>K;
	vector<int>v(N);
	for(int i=0;i<N;++i)cin>>v[i];

	bool ok=true;
	vector<int>anss;
	vector<int>used(N);
	for (int rest = K; rest >= 0; --rest) {
		vector<pair<int,int>>ps;
		for (int i = 0; i < N; ++i) {
			if (!used[i]) {
				ps.emplace_back(v[i],i);
			}
		}
		sort(ps.begin(),ps.end(),greater<pair<int,int>>());
		for (int i = 0; i < ps.size(); ++i) {
			int place=ps[i].second;
			if (v[place] == 0) {
				ok=false;
			}
			else {
				v[place]--;
				anss.push_back(place);
			}
		}
		fill(used.begin(),used.end(),0);
		used[ps.back().second]=true;
	}
	if (ok) {
		cout<<anss.size()<<endl;
		for (int i = 0; i < anss.size(); ++i) {
			cout<<anss[i]+1;
			if(i==anss.size()-1)cout<<endl;
			else cout<<" ";
		}
	}
	else {
		cout<<-1<<endl;
	}
	return 0;
}

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

int main() {
  int N; cin >> N;
  vector<int> L(N);
  for (int i = 0; i < N; i++) cin >> L[i];

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

  int ans = L[N - 1];
  for (int i = 0; i < N - 1; i++) ans -= L[i];

  if (ans >= 0) cout << "No" << endl;
  else cout << "Yes" << endl;
}

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

const int N = 21;
const int MOD = 1e9 + 7;

int can[N][N];

int cnt(int x)
{
	int ret = 0;
	while (x)
	{
		if (x % 2 == 1)
			ret++;
		x /= 2;
	}
	return ret;
}

void add(int &a, int b)
{
	a += b;
	if (a >= MOD)
		a -= MOD;
}

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

	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
			cin >> can[i][j];
	}
	vector<int> dp(1 << n);
	dp[0] = 1;

	for (int mask = 0; mask < (1 << n) - 1; mask++)
	{
		int a = cnt(mask);
		for (int j = 0; j < n; j++)
		{
			if (!(mask & (1 << j)) && can[a][j])
			{
				add(dp[mask ^ (1 << j)], dp[mask]);
			}
		}
	}

	cout << dp[(1 << n) - 1] << "\n";
}



Measured memory_bytes: 8448
n = int(input())
s = str(input())
S = []
for t in s:
    S.append(t)

ans = 0
for i in range(n):
    left = S[:i]
    right = S[i:]
    count = len(set(left) & set(right))
    if count >= ans:
        ans = count

print(ans)


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

int main() {
  int a,b,c;
  cin >> a >> b >>c;
  int cnt;
  while(b >= a){
    cnt++;
    b-=a;
    if(cnt == c) break;
  }
cout << cnt << endl;
}
  


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

using ll=long long;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int ans = 0;
  s = s.substr(0, s.size()-1);
  while(!ans){
    int l = s.size();
    if(l%2==0) {
      string s1 = s.substr(0, l/2);
      string s2 = s.substr(l/2, l/2);
      if(s1==s2) ans = s.size();
      else s = s.substr(0,l-2);
    }
    if(l%2==1) s = s.substr(0, l-1);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;



public class Main {
  public static void main (String[] args) {
    Scanner reader = new Scanner(System.in);
    int A = reader.nextInt();
    int B = reader.nextInt();
    if (A % 2 == 0 ||B % 2 == 0  ) {
    	System.out.print("No");
    }else {
    	System.out.print("Yes");
    }
}
  
}

Measured memory_bytes: 21716
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)4e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	LL A,B,C;
	cin >> A >> B >> C;
	if( A==B){
		cout << C << endl;
	}else if( A==C ){
		cout << B << endl;
	}else{
		cout << A << endl;
	}
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

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

using namespace std;

#define fore(i, s, e) for(int i = s; i < e; i++)

const int N = 4000;

typedef long long ll;

int dp[N][N];

string s, t;

int calc(int i, int j) {
    if(i == s.size() || j == t.size()) return 0;

    int &r = dp[i][j];
    if(r != -1) return r;

    if(s[i] == t[j]) return r = 1 + calc(i + 1, j + 1);

    int res = max(calc(i, j + 1) ,calc(i + 1, j));
    return r = res;
}
int main() {
    cin >> s >> t;
    memset(dp, -1, sizeof dp);
    int m = calc(0, 0);
    int i = 0, j = 0;
    string res;
    while(m) {
        if(s[i] == t[j]) { res += s[i], i++, j++, m--; }
        else if(dp[i + 1][j] > dp[i][j + 1]) i++;
        else j++;
    }
    cout << res << endl;
}

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

using namespace std;

const int Nmax = 1e6;
long long ans=0;
int n, a[Nmax], i;

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

    scanf("%d", &n);
    for(i=1; i<=3*n; ++i)
        scanf("%d", &a[i]);

    sort(a+1, a+3*n+1);

    for(i=1; i<=n; ++i)
        ans += a[3*n+1-2*i];

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

    return 0;
}


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

#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i,a,n) for(int i=a ; i<(int)n ; i++)
#define rf(i,n,a) for(int i=n ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define fill(a,v) memset(a,v,sizeof(a))
#define d1(a) cout << a << "\n"
#define d2(a,b) cout << a << " " << b << "\n"
#define d3(a,b,c) cout << a << " " << b << " " << c << "\n"
#define d4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << "\n"
#define fast ios:: sync_with_stdio(false),cin.tie(nullptr);

typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;

const int inf = 1e9;
const int inf64 = 1e18;
const int MOD = inf + 7;

int32_t main(){
	fast;
	int n,m;
	cin >> n >> m;
	
	int ans = m*(m-1)/2 + n*(n-1)/2;
	cout << ans;
}

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

const int N = 101010;

struct Node {
    long long l, r, b, w;
    inline bool operator < (const Node &o) const {
        return w > o.w;
    }
}a[N];

long long X, D, sum[N];
int n;

long long cal(long long x, long long y)
{
    if(x <= a[y].b)
        return x * a[y].l;
    return a[y].b * a[y].l + (x - a[y].b) * a[y].r;
}

inline bool check(long long k)
{
    long long ans = 0, r = k % X, t = k / X;
    if(t >= n)
        return sum[n];
    for(int i = 1; i <= n; i++)
	{
        if(i <= t)
			ans = std::max(ans, cal(r, i) + sum[t + 1] - a[i].w);
        else
            ans = std::max(ans, cal(r, i) + sum[t]);
    }
    return ans >= D;
}

int main()
{
    
    scanf("%d%lld", &n, &X);
    for(int i = 1; i <= n; i++)
	{
        scanf("%lld%lld%lld", &a[i].b, &a[i].l, &a[i].r);
        a[i].w = a[i].b * a[i].l + (X - a[i].b) * a[i].r;
        D += a[i].b * a[i].l;
    }
    std::sort(a + 1, a + n + 1);
    for(int i = 1; i <= n; i++)
        sum[i] = sum[i - 1] + a[i].w;
    long long l = 0, r = 1e12;
    while(l < r)
	{
        long long mid = (l + r) >> 1;
        if(check(mid))
            r = mid;
        else
            l = mid + 1;
    }
    printf("%lld\n", r);
    return 0;
}

Measured memory_bytes: 7696
#include <cstdio>
#include <iostream>
using namespace std;
const int maxn = 1e5 + 10;
int n, ans = 0, l, r;
int main(){

    cin >> n;
    for(int  i = 0; i < n; i++){
        cin >> l >> r;
        ans += (abs(l - r) + 1);
    }
    cout << ans << endl;

}


Measured memory_bytes: 256
import math
import queue
A,B,M = list(map(int,input().split(" ")))
As = list(map(int,input().split(" ")))
Bs = list(map(int,input().split(" ")))
xycs  =[list(map(int,input().split(" "))) for _ in range(M)]
ans = min(As) + min(Bs)
for temp in xycs:
    x,y,c = temp
    ans = min(ans,As[x-1] + Bs[y-1] - c)
print(ans)

Measured memory_bytes: 39452
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional>
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
//小数点以下　cout << fixed << setprecision(10) << num << endl;
//桁数はlog10(mid)でやれ　log(mid)/log(10)はWA
//long*long<0で判定するな
//開区間と閉区間
//アルファベットが何番目かは x=s[i]-'a'
//bfsはmain()内で　rep(i,h)rep(j,w)rep(i,4)でバグ
//切り上げ：(a+(b-1))/b
//32bit以上は 1ull<<j
// map 初期値0 for(auto itr=mp.begin();itr!=mp.end();++itr) itr->fi itr->se で全探索
// for(auto u:mp) u.fi u.se も可能
//n個のgcd,lcmは一つずつみて更新していく
//大きな数を扱うときは素因数分解した形で持っておく
// (l/a[i]) = l*powmod(a[i],MOD-2)%MOD;
//auto itr=lower_bound(ALL(a),key) a[itr-a.begin()]
const ll MOD = 1000000007;

signed main(){
    int n,c; cin >> n >> c;
    int d[c][c],e[n][n];
    int num[c][3];
    memset(num,0,sizeof(num));
    rep(i,c)rep(j,c) cin >> d[i][j];
    rep(i,n)rep(j,n){
        cin >> e[i][j];
        e[i][j]--;
        num[e[i][j]][(i+j+2)%3]++;
    }
    int ans=1001001001;
    rep(i,c){
        rep(j,c){
            if(i==j) continue;
            rep(k,c){
                if(i==k||j==k) continue;
                //i,j,kで塗る
                int res=0;
                rep(a,c){
                    res+=num[a][0]*d[a][i];
                    res+=num[a][1]*d[a][j];
                    res+=num[a][2]*d[a][k];
                }
                chmin(ans,res);
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1280
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.*;
import java.util.Map.Entry;

public class Main {

  public static void main(String[] args) throws IOException {
    // File file = new File("input.txt");
    // Scanner in = new Scanner(file);
    Scanner in = new Scanner(System.in);

    int N = in.nextInt();
    HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();

    for (int i = 0; i < N; i++) {
      int a = in.nextInt();
      Integer count = map.get(a);
      if (count == null)
        map.put(a, 1);
      else
        map.put(a, count + 1);
    }

    List<Entry<Integer, Integer>> listEntries = new ArrayList<Entry<Integer, Integer>>(map.entrySet());

    int ans = 0;
    for (int i = 0; i < listEntries.size(); i++) {
      Entry e = listEntries.get(i);
      int k = (int) e.getKey();
      int v = (int) e.getValue();
      if (k < v)
        ans += v - k;
      else if (k > v)
        ans += v;
    }

    System.out.println(ans);
  }
}

Measured memory_bytes: 60308
#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<stack>
#include<cmath>
#include<algorithm>
#include<map>
typedef long long ll;
using namespace std;
#define INF 0x3f3f3f3f
/**
*超时有可能是输入的问题
*注意边界
*仔细读题
*没思路试试逆向思维
**加油，奥利给！！！ 
**/
queue<int>q;
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
map<int,int>p;
/*struct knd{
	int x,y,z;
}s[200000];*/ 
char a[200000];
int main()
{
	int m,n,i,j,t,k,s=0;
	cin>>a;
	k=strlen(a);
	if(a[k-1]=='s')
	cout<<a<<"es";
	else cout<<a<<"s";
 } 

Measured memory_bytes: 3652
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define printd(x) printf("%.20f\n", x);
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;

const ll MOD = 998244353;

ll a, b, c, d;

vector<vector<ll>> dp(3005, vector<ll>(3005, -1));

ll rec(ll i, ll j) {
	if (dp[i][j] != -1) return dp[i][j];
	if (i == a && j == b) return dp[a][b] = 1;
	if (i > a && j > b) {
		ll res = 0;
		return dp[i][j] = (rec(i-1,j)*j%MOD + rec(i,j-1)*i%MOD +MOD-(rec(i-1,j-1)*(i-1))%MOD*(j-1)%MOD) % MOD;
	}
	if (i == a) return dp[i][j] = rec(i,j-1)*i%MOD;
	if (j == b) return dp[i][j] = rec(i-1,j)*j%MOD;
}

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

	dp[a][b] = 1;

	rec(c, d);

	cout << dp[c][d] << endl;
	return 0;
}


Measured memory_bytes: 74224
#include<bits/stdc++.h>
using namespace std;
int main()
{
    char s[100];
    char G[100],H[100];
    cin>>G>>s>>H;
    G[0]-=32;
    s[0]-=32;
    H[0]-=32;
    cout<<G[0]<<s[0]<<H[0];
    
    return 0;
}

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

typedef long long ll;
#define pii pair<int , int>
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAXX 1005

int a , b , c;

int main()
{
    _FastIO;
    cin >> a >> b >> c;
    c = min(c , b / a);
    cout << c << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long ll;
typedef pair<int,int> P;

int main(void){
	int i;

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

	int N,A,B;
	cin >> N >> A >> B;
	int ans=0;
	for(i=1;i<=N;i++){
		int t;
		cin >> t;
		if(A>t || t>=B) ans++;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pr(s) std::cout << s << std::endl
#define prb(s) std::cout << s
using namespace std;



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


  int n, q, l, r;
  string s;
  cin >> n >> q >> s;

  vector<int> pos({0});
  int count = 0;
  for (int i = 0; i < s.length() - 1; i++) {
    if (s[i] == 'A' && s[i + 1] == 'C') {
      count++;
    }
    pos.push_back(count);
  }

  for (int i = 0; i < q; i++) {
    cin >> l >> r;
    
    pr(pos[r - 1] - pos[l - 1]);
  }


  return 0;
}


Measured memory_bytes: 1480
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define sf scanf
#define pf printf
#define pb push_back
#define MP make_pair
#define llu unsigned long long
#define U unsigned int
#define ff first
#define ss second
#define SIZE 100005
#define pie 3.14159265358979323
#define minuss 1e-6
#define pair pair<ll,ll>
#define fast_cin ios_base::sync_with_stdio(false);cin.tie(NULL)
#define BIG 1000000000
#define INF 1000000000000005
#define N 10000
vector<ll>vec;
map<string,ll> mps;
map<ll,string> mpss;
set<ll>s1;
set<string>s2;
map<string,ll>::iterator str;
set<ll>::iterator itr;
/*
std::cout << std::fixed;
std::cout << std::setprecision(1);
std::cout << VALUE NAME<<endl;
*/
ll tra[100006],tra1[100006];
ll n,m;
ll upperBound(ll a[],ll key)
{
    ll left=0,right=n-1,index=-1,mid;
    while(left<=right)
    {
        mid=(left+right)/2;
        if(a[mid]==key)
        {
            index=mid;
            right=mid-1;
        }
        else if(a[mid]>key)
            right=mid-1;
        else
            left = mid + 1;
    }
    return left-1;
}

int main()
{
    fast_cin;
    ll t;

    map<ll,ll>mp;
    map<ll,ll>::iterator it;
    string s,s1;
    ll lock=0,sum=0,co=0;

    cin>>n;
    ll str[n+4];
    for(int i=0; i<n; i++)
        cin>>str[i];

    sort(str,str+n);


    ll save=0;
    for(int i=0; i<n; i++)
    {
        save=str[i];
        for(int j=i+1; j<n; j++)
        {
            co=str[j];
            ll ans=upperBound(str,(co+save));
            sum+=ans-j;
        }
    }
    cout<<sum<<endl;

    s1.clear();
    vec.clear();

}
/*
7
218 786 704 233 645 728 389
*/


Measured memory_bytes: 256
// Author: getharshkumar

#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
const ll N = 1e6 + 6, M = 1e9 + 7;
ll a[N];
int main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr);
    ll n, m = 0, c = 0;
    cin >> n >> a[0];
    for (ll i = 1; i < n; i++)
    {
        cin >> a[i];
        if (a[i] > a[i - 1])
            c = 0;
        else
            c++;
        m = max(m, c);
    }
    cout << m;
    return 0;
}

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

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

    int count = 0;
    size_t i = 0;
    while (i < S.size()) {
        if ((S[i] == 'A') && ((i+2) < S.size())) {
            if ((S[i+1] == 'B') && (S[i+2] == 'C')) {
                count++;
                i += 3;
            }
            else {
                ++i;
            }
        }
        else {
            ++i;
        }
    }
    cout << count << endl;
}


Measured memory_bytes: 256
class UnionFind:
    def __init__(self, n):
        self.parents = [-1] * (n + 1)

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return -self.parents[self.find(x)]


N, M, K = map(int, input().split())
uf = UnionFind(N)
friends = [0] * (N + 1)
blocks = [0] * (N + 1)
for _ in range(M):
    A, B = map(int, input().split())
    uf.union(A, B)
    friends[A] += 1
    friends[B] += 1

for _ in range(K):
    C, D = map(int, input().split())
    if uf.same(C, D):
        blocks[C] += 1
        blocks[D] += 1

print(" ".join([str(uf.size(i) - friends[i] - blocks[i] - 1) for i in range(1, N + 1)]))

Measured memory_bytes: 15556
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
using namespace std;
#define ll long long
#define mod 1000000007;

ll gcd(ll a, ll b){
	return (b > 0)? gcd(b, a % b) : a ;
}

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

int main() {
    ll a,b;
    cin >> a >>b;
    cout << lcm(a,b)<<endl;
    return 0;
}


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

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

    cout << (N + 1) / 2 << endl;

    return 0;
}

Measured memory_bytes: 764
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>

using namespace std;

class BIT{
public:
  int size;
  int* bit;

  BIT(int _size = 0){
    size = _size;
    bit = new int[size];
    for(int i = 0; i < size; i++) bit[i] = 0;
  }

  ~BIT(){delete[] bit;}

  /*
    En: returns sum of [from bit[0] to bit[i]].
    Ja: bit[0]からbit[i]までの合計をかえす。
   */
  int sum(int i){
    int s = 0;
    while(i > 0){
      s += bit[i];
      i -= i&-i;
    }
    return s;
  }

  /*
    En: add x at bit[i].
    Ja: bit[i]にxを加える。
   */
  void add(int i, int x){
    while(i<size){
      bit[i] += x;
      i += i&-i;
    }
  }
};

vector<int> make(const vector<int> v){
  vector<int> tmp = v;
  sort(tmp.begin(), tmp.end());

  int cnt = 1;
  map<int,int> M;
  for(int i = 0; i < (int)tmp.size(); i++){
    if(M.count(tmp[i])) continue;
    M[tmp[i]] = cnt++;
  }

  vector<int> vec(v.size());
  for(int i = 0; i < (int)v.size(); i++) vec[i] = M[v[i]];
  return vec;
}

int main(){

  int n;
  cin >> n;
  vector<int> v(n);
  for(int i = 0; i < n; i++) cin >> v[i];
  v = make(v);
  BIT bit(n+1);
  long long ans = 0;
  for(int i = 0; i < n; i++){
    ans += i - bit.sum(v[i]);
    bit.add(v[i],1);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 13412
S = input()
T = input()

LS = len(S)
LT = len(T)

ans = float('inf')
for i in range(LS - LT + 1):
    cnt = 0
    for k in range(LT):
        if S[i+k] != T[k]:
            cnt += 1
    ans = ans if ans < cnt else cnt
print(ans)


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

using namespace std;

int main(int argc, char **argv)
{
	int y, m, d, tmp;
	string str;
	
	while(cin >> y >> m >> d){
		if(y < 1868){
			cout << "pre-meiji" << endl;
			continue;
		} else if(y < 1912){
			if(y == 1868){
				if((m < 9) || (m == 9 && d < 8)){
					cout << "pre-meiji" << endl;
					continue;
				}
			}
			tmp = 1867;
			str = "meiji ";
		} else if(y < 1926){
			if(y == 1912 && (m < 7 || (m == 7 && d < 30))){
				str = "meiji ";
				tmp = 1867;
			} else {
				str = "taisho ";
				tmp = 1911;
			}
		} else if(y < 1989){
			if(y == 1926 && (m < 12 || (m == 12 && d < 25))){
				str = "taisho ";
				tmp = 1911;
			} else {
				str = "showa ";
				tmp = 1925;
			}
		} else {
			if(y == 1989 && (m == 1 && d < 8)){
				str = "showa ";
				tmp = 1925;
			} else {
				str = "heisei ";
				tmp = 1988;
			}
		}
		
		cout << str << (y-tmp) << " " << m << " " << d << endl;
	}
	
	return 0;
}

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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

void solve() {
    ll N, A;
    cin >> N >> A;
    N %= 500;
    cout << (N <= A ? "Yes\n" : "No\n");
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif
#ifdef FILEOUTPUT
    ofstream ofs("./in_out/output.txt");
    cout.rdbuf(ofs.rdbuf());
#endif
    solve();
    cout << flush;
    return 0;
}

Measured memory_bytes: 256
S = list(input())

s = S.pop()
count = 1
while S:
    if s == S[-1]:
        if len(S) >= 2:
            S.pop()
            S.pop()
            count+=1
            if S:
                s = S.pop()
                count+=1
        else:
            break        
    else:
        s = S.pop()
        count+=1
        
print(count)

Measured memory_bytes: 4840
import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

double calc(int n, int k) {
    double ans = 0;
    foreach (i; 1..n+1) {
        // 得点が K 以上になるまで表を出し続ける
        int score = i;
        double t = 1.0 / n;
        while (score < k) {
            score *= 2;
            t *= 0.5;
        }
        ans += t;
    }
    return ans;
}

void main() {
    int n, k; scan(n, k);
    writefln("%.9f", calc(n, k));
}


Measured memory_bytes: 256
#include<cstdlib>
#include<cmath>
#include<iomanip>
#include<iostream>

using namespace std;

int main(){
    int a,b,h,m;
    double ang,rad,ans;
    static const double pi = 3.141592653589793;
    
    cin>>a>>b>>h>>m;
    
    ang=30*h+0.5*m-6*m;
    
    if(ang==0){
        ans=a-b;
        cout<<fixed<<setprecision(10)<<ans<<endl;
    }else if(ang==180 || ang==-180){
        ans=a+b;
        cout<<fixed<<setprecision(10)<<ans<<endl;
    }else{
        rad=ang*pi/180;
        ans=pow(a,2.0)+pow(b,2.0)-2.0*a*b*cos(rad);
        cout<<fixed<<setprecision(10)<<sqrt(ans)<<endl;
    }
}

Measured memory_bytes: 4196
arr = [0, 0, 0, 0]
for _ in range(int(input())):
  s = input()
  arr[{"AC": 0, "WA": 1, "TLE": 2, "RE": 3}[s]] += 1
print("AC x", arr[0])
print("WA x", arr[1])
print("TLE x", arr[2])
print("RE x", arr[3])

Measured memory_bytes: 69908
#include <bits/stdc++.h>
using namespace std;
#define modulo 998244353
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000

int main(){
    
	int N,X;
	cin>>N>>X;
	
	vector<vector<vector<int>>> dp(2,vector<vector<int>>(512,vector<int>(512,0)));
	dp[0][0][0] = 1;
	
	for(int i=0;i<N;i++){
		for(int j=0;j<512;j++){
			for(int k=1;k<512;k++){
				dp[0][j][k] = mod(dp[0][j][k] + dp[0][j][k-1]);
			}
		}
		
		for(int j=0;j<512;j++){
			for(int k=0;k<512;k++){
				dp[1][j][k] = dp[0][j^k][k];
			}
		}
		swap(dp[0],dp[1]);
	}
	
	int ans = 0;
	
	for(int i=0;i<=X;i++){
		ans = mod(ans + dp[0][X][i]);
	}
	
	cout<<ans<<endl;
	
    return 0;
}



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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define POSSIBLE cout << ((n) ? "POSSIBLE\n" : "IMPOSSIBLE\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int32 r;
    cin >> r;
    cout << fixed << setprecision(20) << M_PI * r * 2 << endl;
    return 0;
}

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

bool flag;
char s[110];

int main() {
	scanf("%s", s);
	for (int i = 0; i < strlen(s); ++i) {
		if ((s[i] == 'F') && (flag)) {
			puts("Yes");
			return 0;
		}
		if (s[i] == 'C') flag = true;
	}
	puts("No");
	return 0;
}

Measured memory_bytes: 256
import numpy as np
n,m = [int(i) for i in input().split()]

a = np.array(list(map(int,input().split())))

neg = a[a < 0][::-1]
pos = a[a >= 0]

ans = 1000000000000000000
if len(neg) == 0:
    print(pos[m-1])
    exit()
else:
    for i in reversed(range(len(pos) + 1)):
        if i > m:
            continue
        elif m - i > len(neg):
            break
        if i == m:
            ans = min(ans, pos[i - 1])
        elif i == 0:
            ans = min(ans, abs(neg[m - 1]))
        else:
            ans = min(ans, pos[i-1]*2 + abs(neg[m-i-1]), abs(neg[m-i-1] * 2) + pos[i-1])

print(ans)

Measured memory_bytes: 23084
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <iterator>
#include <cmath>
#include <set>
#include <deque> 
#include <string>


using namespace std;

struct Require {
	int start;
	int end;
	int diff;
	int score;
};

Require rs[60];
int n, m, q;
int maxScore;
int a[20];

void doSearch(int depth, int startPos) {
	if (depth > n) {
		int curScore = 0;
		for (int i = 0 ; i < q ; i++) {
			int start = rs[i].start;
			int end = rs[i].end;
			int curDiff = a[end] - a[start];
			if (curDiff == rs[i].diff)
				curScore = curScore + rs[i].score;
		}
		
		if (maxScore < curScore)
			maxScore = curScore;
	} else {
		for (int i = startPos ; i <= m ; i++) {
			a[depth] = i;
			doSearch(depth + 1, i);
		}
	}
}

int main()
{
	scanf("%d%d%d", &n, &m, &q);
	
	for (int i = 0 ; i < q ; i++) {
		scanf("%d%d%d%d", &(rs[i].start), 
			&(rs[i].end), 
			&(rs[i].diff), 
			&(rs[i].score));
	}
	
	maxScore = 0;
	doSearch(1, 1);
	
	printf("%d\n", maxScore);

	return 0;
}


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

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;

string n;
int stoi(const string s) {
    int res;
    stringstream ss;
    ss << s;
    ss >> res;
    return res;
}
bool flag;
void split(string s,string& a, string& b) {
    int i=0;
    while(s[i]!='.'&&i<s.size()) {
        a+=s[i];
        i++;
    }
    i++;
    while(i<s.size()) b+=s[i],i++;

}
string decode1(string s) {
    string res="";
    int a = stoi(s);
    rep(i,8) {
        if(a&1) res+="1";
        else res+="0";
        a>>=1;
    }
    if(a!=0) flag=false;
    reverse(all(res));
    return res;
}

double func(string s) {
    double a;
    stringstream ss;
    ss<<s;
    ss>>a;
    return a;
}
string decode2(string s) {
    if(s=="") return "0000";
    string res="";
    int a = stoi(s);
    if(a==0) return "0000";
    double b = func("0."+s);

    rep(i,4) {
        b*=2;
        if(b>=1) res += "1",b-=1;
        else res+="0";
    }
    if(b != 0.0) flag=false;

    return res;
}
void solve() {
    flag=true;
    string a,b;
    split(n,a,b);
    string ans = decode1(a)+"."+decode2(b);
    if(flag) {
        cout<<ans<<endl;
    }
    else {
        cout<<"NA"<<endl;
    }

}
int main() {
    while(cin>>n) {
        if(func(n) < 0) break;
        solve();
    }
    return 0;
}

Measured memory_bytes: 1264
/*input
30
DMCDMCDMCDMCDMCDMCDMCDMCDMCDMC
4
5 10 15 20
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define YY cout<<"YES\n"
#define NN cout<<"NO\n"
#define yy cout<<"Yes\n"
#define nn cout<<"No\n"
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}

//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}

int main()
{
	IOS;
	ll n;
	cin>>n;
	string s;
	cin>>s;
	ll q;
	cin>>q;
	while(q--){
		ll k;
		cin>>k;

		ll ans=0;

		ll mcnt=0,ccnt=0;
		ll cur=0;
		REP(i,k){
			if(s[i]=='M') mcnt++;
			else if(s[i]=='C'){
				ccnt++;
				cur+=mcnt;
			}
		}
		REP(i,n){
			//cout<<i<<' '<<ccnt<<' '<<mcnt<<' '<<cur<<'\n';
			if(s[i]=='D'){
				ans+=cur;
			}

			if(s[i]=='M'){
				cur-=ccnt;
				mcnt--;
			}
			else if(s[i]=='C') ccnt--;


			if(i+k<n&&s[i+k]=='M'){
				mcnt++;
			}
			else if(i+k<n&&s[i+k]=='C'){
				cur+=mcnt;
				ccnt++;
			}
		}


		cout<<ans<<'\n';
	}

	return 0;
}


Measured memory_bytes: 1948
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+5;
int a[N];
int xor_sum[N];
int dp[N];
ll sum[N];
int n;
inline int bin_chop(int rp){
	int l=1,r=rp;
	while(l<=r){
		int mid=l+r>>1;
		if((xor_sum[mid-1]^xor_sum[rp])==sum[rp]-sum[mid-1])
			r=mid-1;
		else l=mid+1;
	}
	return l;
}
ll ans=0;
int main(){
	cin>>n;
	for(int i=1;i<=n;++i){
		cin>>a[i];
		sum[i]=sum[i-1]+a[i];
		xor_sum[i]=xor_sum[i-1]^a[i];
	}
	for(int i=1;i<=n;++i) dp[i]=bin_chop(i);
	for(int i=1;i<=n;++i) ans+=i-dp[i];
	ans+=n;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 4096
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iomanip>
using namespace std;
using ll = long long;

unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

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

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}


int main() {
    int a;
    cin >> a;
    int ans = 0;
    vector<int>z(a);
    for (int i = 0; i < a; i++) {
        cin >> z.at(i);
        int x = 1;
        for (int j = 0; j < i; j++) {
            if (z.at(i) < z.at(j))x = 0;
        }
        ans += x;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    char ch;
    scanf("%c", &ch);
    if(ch >= 'A' && ch <= 'Z')
    {
        printf("A");
    }
    else if(ch >= 'a' && ch <= 'z')
    {
        printf("a");
    }
    return 0;
}


Measured memory_bytes: 1576
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>

using namespace std;
using ll = long long;


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

    vector<int> red_apples(a);
    for (int i = 0; i < a; i++)
    {
        cin >> red_apples[i];
    }
    sort(red_apples.begin(), red_apples.end(), greater<int>());
    
    vector<int> green_apples(b);
    for (int i = 0; i < b; i++)
    {
        cin >> green_apples[i];
    }
    sort(green_apples.begin(), green_apples.end(), greater<int>());

    vector<int> apples(x + y + c);
    for (int i = 0; i < x; i++)
    {
        apples[i] = red_apples[i];
    }
    for (int i = 0; i < y; i++)
    {
        apples[x + i] = green_apples[i];
    }
    for (int i = 0; i < c; i++)
    {
        cin >> apples[x + y + i];
    }
    sort(apples.begin(), apples.end(), greater<int>());

    ll total = 0;
    for (int i = 0; i < x + y; i++)
    {
        total += apples[i];
    }
    
    cout << total << endl;
}


Measured memory_bytes: 2176
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
#include <sstream>
#include <cctype>
#include <queue>
using namespace std;
 
int main(){

    int n, k;
    cin >> n >> k;

    int ans = 1;

    for(int i = 0; i < n; i++){
        if(i == 0){
            ans *= k;
        }else{
            ans *= k - 1;
        }
    }

    cout << ans;

}


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

#define ll long long
#define ar array
#define vi vector<int>
#define INF 1000000000

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	string s, t;
	cin >> s >> t;
	int n = s.length();
	bool match = true;
	for(int i=0; i < n; i++){
		if(s[i] != t[i]) match = false;
	}
	if(match) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;	
}


Measured memory_bytes: 3608
#include <string>
#include <iostream>
using namespace std;
string s; int r;
int main() {
	cin >> s;
	for(int i = 1; i < s.size(); i++) {
		if(s[i - 1] != s[i]) r++;
	}
	if(r % 2 == 1) cout << 'o' << endl;
	else cout << s[0] << endl;
}

Measured memory_bytes: 3124
#include <stdio.h>

void Division(int Fa, int Fb, int* Fd, int* Fr, double* Ff)
{
    *Fd = Fa/Fb;
    *Fr = Fa%Fb;
    *Ff = (double)Fa/Fb;
}

int main()
{
    int a,b,d,r;
    double f;
    
    scanf("%d", &a);
    scanf("%d", &b);
    
    Division(a,b,&d,&r,&f);
    
    printf("%d %d %f\n" ,d ,r ,f );
    
    return 0;
}


Measured memory_bytes: 2108
#include <bits/stdc++.h>
#define X first
#define Y second
#define LL __int128
#define MP make_pair
#define PB push_back
#define SZ(a) (LL)(a.size())
const LL INF = 1000 * 1000 * 1000 + 47;
const LL LINF = INF * (LL)INF;
using namespace std;
const LL MAX = 1000005;
const LL MAGIC = 50;
LL cnt[MAX];
LL f[MAX];
int main() 
{
	int n;
	cin >> n;
	LL ans = 0;
	for(int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		cnt[x]++;
		ans -= x;
	}
	for(int i = MAX - 1; i >= 1; i--)
	{
		LL Suma = 0;
		for(int j = i; j < MAX; j += i)
			Suma += cnt[j] * j ;
		f[i] = Suma * Suma;
		for(int j = i + i; j < MAX; j += i)
			f[i] -= f[j];
		ans += f[i] / i;
		
	}
	ans /= 2;
	cout << (int)(ans % 998244353);
	return 0;
}


Measured memory_bytes: 31488
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define pb push_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
typedef long long ll;
typedef pair<ll,ll> P;
#define se second
#define fi first
struct PP{ll fi;ll se;ll th;};
typedef multiset<ll> S;
typedef priority_queue<ll> PQ;
typedef tuple<ll,ll,ll,ll> PPP;
typedef priority_queue<PPP,vector<PPP>,greater<PPP>> SPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
bool chmin(auto &a,auto b){if(a>b){a=b;return true;}return false;}
bool chmax(auto &a,auto b){if(a<b){a=b;return true;}return false;}
void outvi(vi v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<endl;}
void outvvi(vvi v){rep(i,v.size()){rep(j,v[i].size()){if(j)cout<<' ';cout<<v[i][j];}cout<<endl;}}
int main(){
    ll n,a,b,ansa=0,ansb=0;cin>>n>>a>>b;
    if((b-a)%2){
        cout<<min(a,n-b+1)+(b-a-1)/2<<endl;
    }
    else cout<<(b-a)/2<<endl;
}

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

int main(){
  int n, m, l;
  long int mat1[100][100]={};
  long int mat2[100][100]={};
  long int ans[100][100]={};

  cin >> n >> m >> l;

  for(int i=0; i<n; i++){
    for(int j=0; j<m; j++){
      cin >> mat1[i][j];
    }
  }
  for(int j=0; j<m; j++){
    for(int k=0; k<l; k++){
      cin >> mat2[j][k];
    }
  }
  for(int i=0; i<n; i++){
    for(int j=0; j<l; j++){
      for(int k=0; k<m; k++){
        ans[i][j] += mat1[i][k]*mat2[k][j];
      }
      if(j==l-1) cout << ans[i][j] << endl;
      else cout << ans[i][j] << " ";
    }
  }
}


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

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

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << (x) << endl;


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


int main(){
  char s[SIZE];
  int n;
  
  scanf("%s",s);
  n = strlen(s);

  int r = n-1;
  int ans = 0;
  
  for(int i=0;i<n;i++){
    if(i == r || i > r){
      break;
    }

    if(s[i] == s[r]){
      r--;
      continue;
    }

    if(s[i] == 'x'){
      ans++;
      continue;
    }else if(s[r] == 'x'){
      r--;
      i--;
      ans++;
    }else{
      puts("-1");
      return 0;
    }
    
  }

  printf("%d\n",ans);
  
  return 0;
}



Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	char c;
	cin >> c;

	if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
		cout << "vowel" << endl;
	}
	else {
		cout << "consonant" << endl;
	}
	}



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

typedef long long ll;

#define M 1000000007

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<ll> v(n);
	for (int i = 0; i < n; ++i) {
		cin >> v[i];
	}
	//set<pair<pair<ll, ll>, ll>> used;
	int c = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; ++j) {
			for (int k = j + 1; k < n; ++k) {
				ll s = v[i] + v[j] + v[k];
				ll m = max(v[i], max(v[j], v[k]));
				//pair<pair<ll, ll>, ll> p = { {v[i], v[j]}, v[k] };
				if (v[i] != v[j] && v[i] != v[k] && v[j] != v[k] && m < s - m) {
					//cout << i << " " << j << " " << k << endl;
					//used.insert(p);
					c++;
				}
			}
		}
	}
	cout << c;

	return 0;
}

Measured memory_bytes: 3660
#include <iostream>
#include <math.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <stdlib.h>
#include <deque>  
#include <iomanip>

using namespace std;

int main(){
    int A,B;
    cin>>A>>B;
    if((A-B)%2==0) cout<<(A+B)/2<<endl;
    else cout<<"IMPOSSIBLE"<<endl;
    return 0;
}

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

#define FLASH ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long int
#define MAX 1e9
#define MIN -1e9
#define mod 1000000007
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr<<#x<<'='<<(x)<<endl;
#define mxn 300005
using namespace std;

int main()
{
    FLASH
    ll n;
    cin >> n;
    cout << n + n * n + n * n * n;
    return 0;
}


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

const int N = 1 << 19, M = 100005, LIM = 550;

int n, q, lim;
long long v[N], w[N], f[LIM][M];
vector<pair<int, long long> > vec[N];

long long solve (int u, int l) {
	if (u <= lim) return f[u][l];
	if (l >= w[u]) return max(solve(u >> 1, l), solve(u >> 1, l - w[u]) + v[u]);
	else return solve(u >> 1, l);
}

int main () {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) scanf("%lld%lld", &v[i], &w[i]);
	for (int i = 0; i < M; i++) f[1][i] = 0ll;
	for (int i = w[1]; i < M; i++) f[1][i] = v[1];
	lim = (int)sqrt(n);
	
	for (int i = 2; i <= lim; i++) {
		for (int j = 0; j < M; j++) {
			f[i][j] = f[i >> 1][j];
			if (j >= w[i]) f[i][j] = max(f[i][j], f[i >> 1][j - w[i]] + v[i]);
		}
	}
	scanf("%d", &q);
	for (int i = 1; i <= q; i++) {
		int u, l;
		scanf("%d%d", &u, &l);
		printf("%lld\n", solve(u, l));
	}
	return 0;
}

Measured memory_bytes: 419448
import java.util.Scanner;

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

Measured memory_bytes: 21844
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define MOD 1000000007
#define ll long long
#define int long long 
#define INF 1e18
#define ar array
#define f first
#define s  second
#define REP(i,n) for (int i=0;i<(n);i++)
#define wt(x) int x;cin>>x;while(x--)
#define watch(x) cerr << "\n" << (#x) << " is " << (x) << endl
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>; 

void  c_p_c(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  #ifndef ONLINE_JUDGE
  freopen("input1.txt","r",stdin);

  freopen("output1.txt","w",stdout);
#endif
}

int power(int a,int b,int mod){
  a=a%mod;
  if(a==0){
    return 1;
  }
  int res=1;
  while(b){
    if(b&1){
      res=(res*a)%mod;
    }
    b>>=1;
    a=(a*a)%mod;
  }
  return res;
}

int  MMI(int p){
  return power(p,MOD-2,MOD);

}

int32_t main()
{
 c_p_c();
 int x;
 cin>>x;
 if(x>=30){
  cout<<"Yes\n";
 }
 else{
  cout<<"No\n";
 }




return 0;

}








   



   








Measured memory_bytes: 3656