akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <stack>
#include <bitset>

using namespace std;

#define FSIO  ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define DEBUG(a)   cout<<"DEBUG: "<<(a)<<endl;
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define MP make_pair
#define X  first
#define Y  second
#define REP(i,st,ed)    for(int i=st;i<=ed;++i)
#define IREP(i,st,ed)   for(int i=st;i>=ed;--i)
#define TCASE(T)    cin>>T;while(T--)

const int MAXN = 100005;
const ll MOD = 1e9+7 ;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int INF = 1e9+7;
const double PI = acos(-1.0);
const double EPS = 1e-8;

int _;

using namespace std;




int main()
{
    //freopen("test.in","r+",stdin);
    //freopen("test.out","w+",stdout);
    FSIO;
    int N, K;
    while(cin>>N>>K)
    {
        if((N+1)/2>=K)  cout<<"YES"<<endl;
        else    cout<<"NO"<<endl;
    }
    return 0;
}


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

typedef long long ll;

int main()
{
	int n;
	ll t;
	scanf("%d%lld",&n,&t);
	
	ll start = 0, endt = 0;
	ll ans = 0;
	for (int i=1;i<=n;i++)
	{
		ll cur;
		scanf("%lld",&cur);
		if (endt < cur)
		{
			ans += endt - start;
			start = cur, endt = cur + t;
		}
		else endt = cur + t;
	}
	ans += endt - start;
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, A: int, B: int, C: int, s: "List[int]"):
    v = [A, B, C]
    ans = []
    for i in range(N):
        l, r = s[i]
        if v[l] + v[r] == 0:
            return None
        if v[l] > v[r] or v[l] == v[r] and i != N - 1 and r in s[i + 1]:
            ans.append(r)
            v[l] -= 1
            v[r] += 1
        else:
            ans.append(l)
            v[l] += 1
            v[r] -= 1
    return ans


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    def s2index(s: "List[str]"):
        return [ord(c)-ord('A') for c in s]

    def index2s(i: int):
        return chr(i + ord('A'))

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    s = [s2index(next(tokens)) for _ in range(N)]  # type: "List[int]"
    ans = solve(N, A, B, C, s)

    if ans == None:
        print(NO)
    else:
        print(YES)
        print("\n".join(list(map(index2s, ans))))


if __name__ == '__main__':
    main()


Measured memory_bytes: 94760
/*
    Author - Param Kothari
    Ah shit, here we go again
*/
 
#include <bits/stdc++.h>
 
using namespace std;
 
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define mp make_pair 
 
typedef long long ll;
typedef long double ld;

void solve(){
    ll n = 0, k = 0;
    cin >> n >> k;
    int res = 0;
    while(n > 0){
        n = n / k;
        res++;
    }
    cout << res << "\n";
    return;
}
 
int main(){
    IOS;
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
    return 0;
}

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

int main() {

    int N;
    cin >> N;

    vector<int> L(110);
    rep(i, N) {
        cin >> L[i];
    }

    int cnt = 0;

    for (int i = 0; i < N; ++i)
    {
        for (int j = i+1; j < N; ++j)
        {
            for (int k = j+1; k < N; ++k)
            {
                if ((L[i] != L[j] and L[j] != L[k] and L[k] != L[i]) and (L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[i]+L[k]>L[j])) {
                    cnt++;
                }
            }
        }
    }

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 3620
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 10e9;
const int MAX_V = 201;

void Minesweeper() {
	int h, w;
	cin >> h >> w;
	string s[51];
	for (size_t i = 0; i < h; i++)
	{
		cin >> s[i];
	}
	int tx[3] = { 0,1,-1 };
	for (size_t i = 0; i < h; i++)
	{
		for (size_t j = 0; j < w; j++)
		{
			int c = 0;
			if (s[i][j] == '#')continue;
			for (size_t k = 0; k < 3; k++)
			{
				for (size_t m = 0; m < 3; m++)
				{

					int x = i + tx[k];
					int y = j + tx[m];
					if (x < 0 || y < 0 || x >= h || y >= w) continue;
					c += (s[x][y] == '#');
				}
			}
			s[i][j] = c + '0';
		}
		cout << s[i] << endl;
	}


}

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



Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
string s;
bool ok = false;
void dfs( int pos ){

    if( pos == (int)s.size() ){
        ok = true;
        return;
    }
    if( pos+5 <= (int)s.size() && s.substr( pos, 5 ) == "erase" ){
        dfs( pos+5 );
    }
    if( pos+5 <= (int)s.size() && s.substr( pos, 5 ) == "dream" ){
        dfs( pos+5 );
    }
    if( pos+7 <= (int)s.size() && s.substr( pos, 7 ) == "dreamer" ){
        dfs( pos+7 );
    }
    if( pos+6 <= (int)s.size() && s.substr( pos, 6 ) == "eraser" ){
        dfs( pos+6 );
    }
}

int main(){

    cin >> s;
    dfs(0);
    if( ok ){
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }

}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
int n;
string s;
int main(void){
    cin>>n>>s;
    if(s.size()>n){
        for(int i=0;i<n;i++){
            cout<<s[i];
        }
        cout<<"..."<<endl;
    }else{
        cout<<s<<endl;
    }
    
    
}


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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)
#define debug(vari) cerr << #vari << " = " << (vari) << endl;

int count(int n)
{
    int cnt = 0;
    while (n / 2)
    {
        cnt++;
        n /= 2;
    }
    return cnt;
}

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];

    sort(all(a));
    cout << a[n - 1] - a[0] << endl;
    return 0;
}


Measured memory_bytes: 256
def sosu(a):
    import math
    if a == 2:
        return True
    elif (a < 2) or (a % 2 == 0):
        return False
    i = 3
    while i <= round(math.sqrt(a)):
        if a % i == 0:
            return False
        else:
            i+=1
            continue
    return True
x = int(input())
while not sosu(x):
    x+=1
print(x)

Measured memory_bytes: 3060
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();

		int sum = 0;
		int [] a = new int[n];
		for(int i = 0;i < n; i++) {
			a[i] = stdIn.nextInt();
		}

		for(int i = 0; i < n-1; i++) {
			for(int j = i+1;  j < n; j++) {
				sum+=a[i]*a[j];
			}
		}

		System.out.println(sum);


	}

}


Measured memory_bytes: 23124
s = input()
t = input()
n = len(s) - len(t) + 1
ans = len(t)
for i in range(n):
    temp = 0
    for j in range(len(t)):
        if t[j] != s[j+i]:
            temp += 1
    ans = min(temp,ans)
print(ans)

Measured memory_bytes: 67496
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

#define rep(i, a, b) for(auto (i)=a;i<b;i++)
#define list(i, N) for(auto (i)=0;i<N;i++)

typedef long long ll;
typedef vector <ll> vi;
typedef pair <ll, ll> pi;
#define mp make_pair
#define pb push_back
#define eb emplace_back

#define int ll
#define INF 1e18+5
#define mod 1000000007

template<class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int32_t main() {

    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int k, s; cin >> k >> s;
    int ans = 0;
    list(x,k+1){
        list(y,k+1){
            int z = s-x-y;
            if(z>=0 and z<=k) ans++;
        }
    }

    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
import math
n,m= map(int,input().split())
al= list(map(int,input().split()))
twos = set()
for c in al:
    temp,tempc=0,c
    while tempc%2==0:
        tempc//=2
        temp+=1
    twos.add(temp)
if len(twos)>1:print(0)
else:
    lcmv=al[0]
    for i in range(1,n):lcmv = lcmv*al[i] // math.gcd(lcmv,al[i])
    print(max(0,1 + (m-lcmv//2)//lcmv))


Measured memory_bytes: 20168
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		int max = 0;
		int ans = 0;
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
			if (max <= H[i]) {
				max = H[i];
				ans++;
			}
		}
		sc.close();
		System.out.println(ans);
	}

}


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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 1e5+23;
const int mod = 1e9+7;

string s;
int dp[N][13];

int rek(int pos, int m) {
  if (pos == s.size()) return m == 5;
  if (s[pos] != '?') return rek(pos+1, (m*10+s[pos]-'0')%13);
  int &ret = dp[pos][m];
  if (ret != -1) return ret;
  ret = 0;
  for (int i = 0; i <= 9; ++i) {
    ret = (ret+rek(pos+1, (m*10+i)%13))%mod;
  }
  return ret;
}

void solve() {
  cin >> s;
  int m = 0;
  memset(dp, -1, sizeof(dp));
  cout << rek(0, 0);
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 14988
#include<iostream>
using namespace std;
int main() {
	while(1) {
		int h, w;
		cin >> h >> w;
		if(h == 0 && w == 0)
			return 0;
		for(int i = 0; i < h; ++i) {
			for(int j = 0; j < w; ++j) {
				if(i % 2 == 0) {
					if(j % 2 == 0)
						cout << '#';
					else cout << '.';
				}
				if(i % 2 == 1) {
					if(j % 2 == 0)
						cout << '.';
					else cout << '#';
				}
			}
			cout << endl;
		}
		cout << endl;
	}
}


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

int main() {
  string n;
  cin >> n;
  int n_size = (int)n.length();
  int digit_val[n_size];
  
  transform(begin(n), end(n), digit_val, [](char c){return c - '0';});
  
  int digit_sum = 0;
  for (int i = 0; i < n_size; i++) {
  	digit_sum += digit_val[i];
  }
  
  if (atoi(n.c_str()) % digit_sum == 0) {
  	cout << "Yes" << endl;
  } else {
  	cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main (void)
{
  string s;
  cin>>s;
  int i,n,ans=1000,sum;;
  n=s.size();
  for(i=0;i<n-2;i++)
  {
    sum=0;
    sum+=(s[i]-'0')*100;
    sum+=(s[i+1]-'0')*10;
    sum+=s[i+2]-'0';
    ans=min(ans,abs(sum-753));
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3584
//Dragon_warrior7(IITK)
#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 ll long long
#define pb push_back
#define nl cout << '\n'
#define sor(x) sort(x.begin(), x.end())
#define rev(v) reverse(v.begin(), v.end())
#define lb(v, temp) lower_bound(v.begin(), v.end(), temp)
#define ub(v, temp) upper_bound(v.begin(), v.end(), temp)
#define fi first
#define se second
#define llmax 1000000000000000000
#define deb(x) cout << #x << " " << x << "\n"
#define pll pair<ll, ll> 
#define vll vector<ll> 
#define rub cout << "\n------------------------------------\n"
typedef  tree < int ,  null_type ,  greater<int> ,  rb_tree_tag ,  tree_order_statistics_node_update > oset;
void read(vector<ll> &v)
{
	for (int i = 0; i < v.size(); i++)
		cin >> v[i];
}

void print(vector<ll> v)
{
	for (int i = 0; i < v.size(); i++)
		cout << v[i] << " ";
}
ll n,m,a,b,c,t,temp,x,y;
string str;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n;
	cin>>m;
	vll v(m);
	read(v);
	sor(v);
	//print(v);
	//nl;
	if(m==1)
	{
	    cout<<0;
	    return 0;
	}
	ll dis[m-1];
	ll sum=0;
	for(int i=0;i<m-1;i++)
	{
	   dis[i]=max(v[i+1]-v[i]-1,(ll)0);
	}
	sum=v[m-1]-v[0]+1;
	sum-=n;
	//cout<<sum;
	//nl;
	sort(dis,dis+m-1,greater<>());
// 	for(int i=0;i<m-1;i++)
// 	{
// 	    cout<<dis[i]<<' ';
// 	}
// 	nl;
	for(int i=0;i<min(n-1,m-1);i++)
	{
	    sum-=dis[i];
	}
	cout<<max(sum,(ll)0);
	
	
	
	
	
	
	
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
const int inf = 1e9;
const int mx = 100005;
int h, w, dx[] = {0,0,1,-1}, dy[] = {1,-1,0,0};
char s[105];
struct edge{int t, c, r;};
vector<edge> G[mx];
bool used[mx];

void add_edge(int f, int t, int c = 1){
	G[f].push_back((edge){t,c,(int)G[t].size()});
	G[t].push_back((edge){f,0,(int)G[f].size()-1});
}

void connect(int a, int b, int c = 1){
	add_edge(a,b+h*w,c); add_edge(b,a+h*w,c);
}

int dfs(int v, int t, int f){
	if(v == t) return f;
	used[v] = true;
	for(auto &it: G[v]) if(!used[it.t] && it.c){
		int d = dfs(it.t, t, min(f,it.c));
		if(d){
			it.c -= d;
			G[it.t][it.r].c += d;
			return d;
		}
	}
	return 0;
}

int max_flow(int s, int t){
	int res = 0, f = 1;
	while(f){
		fill(used,used+mx,0);
		f = dfs(s,t,inf);
		res += f;
	}
	return res;
}

int main(){
	scanf("%d%d", &h, &w);
	rep(i,h){
		scanf("%s", s);
		rep(j,w){
			add_edge(i*w+j+h*w, i*w+j, 1);
			rep(k,4){
				int x = i + dx[k], y = j + dy[k];
				if(0 <= x && x < h && 0 <= y && y < w) connect(i*w+j, x*w+y);
				else if(s[j] == 'X') return 0*puts("-1");
				else add_edge(i*w+j, 2*h*w+1, inf);
			}
			if(s[j] == 'X') add_edge(2*h*w, i*w+j, inf);
		}
	}
	printf("%d\n", max_flow(2*h*w, 2*h*w+1));
}

Measured memory_bytes: 6528
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = null;
		try {
            input = br.readLine();
		        
		} catch (IOException e) {
        }
		String[] abc = input.split(" ");
		int a = Integer.parseInt(abc[0]);
		int b = Integer.parseInt(abc[1]);
		int c = Integer.parseInt(abc[2]);
		int count = 0;
        for(int i = a; i <= b; i++){
            if(c % i == 0){
	            count++;
	        }
        }
        System.out.println(count);
	}
}


Measured memory_bytes: 24460
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;

int main(){
	double N;
	double K;
	double ans=0;
	cin>>N>>K;
	REP(i,N){
		int A=i+1;
		double now=1;
		while(A<K){
			now/=2.0;
			A*=2;
		}
		//cout<<now<<endl;
		ans+=now;
	}
	cout<<fixed<<setprecision(12)<<ans/N<<endl;
}

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

typedef ostringstream OSS; typedef istringstream ISS;
typedef long long LL;
typedef pair<int, int> PII;  typedef pair<LL, LL> PLL;
typedef vector<int>    VI;   typedef vector<VI>   VVI;   typedef vector<VVI>   VVVI;
typedef vector<LL>     VLL;  typedef vector<VLL>  VVLL;  typedef vector<VVLL>  VVVLL;
typedef vector<double> VD;   typedef vector<VD>   VVD;   typedef vector<VVD>   VVVD;
typedef vector<string> VS;   typedef vector<VS>   VVS;   typedef vector<VVS>   VVVS;
typedef vector<bool>   VB;   typedef vector<VB>   VVB;   typedef vector<VVB>   VVVB;
typedef vector<PII>    VPII; typedef vector<VPII> VVPII; typedef vector<VVPII> VVVPII;
typedef vector<PLL>    VPLL; typedef vector<VPLL> VVPLL; typedef vector<VVPLL> VVVPLL;

typedef unsigned int  UI;
typedef vector<UI>    VUI;
typedef vector<VUI>   VVUI;

#define fst first
#define snd second
// #define Y first
// #define X second
#define MP make_pair
#define PB push_back
#define EB emplace_back 
#define ALL(x)  (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
#define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
#define rep(i, N)  for (int i = 0; i < (int)(N); i++)
#define rrep(i, N) for (int i = N - 1; i >= 0; i--)
#define REP(i, init, N)  for (int i = (init); i < (int)(N); i++)
#define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
#define MAXUD(orig, target) orig = max(orig, target)
#define MINUD(orig, target) orig = min(orig, target)
#define DUMP(x) cerr << #x << " = " << (x) << endl

template < typename T > inline T fromString(const string &s) { T res; ISS iss(s); iss >> res; return res; };
template < typename T > inline string toString(const T &a)   { OSS oss; oss << a; return oss.str(); };

template<typename T=int> inline void dump(vector<T> vs, bool ent=false) { rep(i, vs.size()) cout << vs[i] << (i+1==vs.size() ? '\n' : ' '); if (ent) cout << endl; }
template<typename T = int> inline void dump(vector<vector<T>> vs, bool ent=false) { rep(i, vs.size()) dump<T>(vs[i]); if (ent) cout << endl; }

const int    INF  = 0x3f3f3f3f;
const LL     INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
const int    DX[] = {1,  0, -1, 0};
const int    DY[] = {0, -1,  0, 1};
const double EPS  = 1e-12;
// const double PI   = acos(-1.0);

template<typename T = int> inline T in() { T x; cin >> x; return x; }
template<typename T = int> inline vector<T> in(int n) { vector<T> xs(n); rep(i, n) cin >> xs[i]; return xs; }
template<typename T = int> inline vector<vector<T>> in(int n, int m) { vector<vector<T>> xs(n, vector<T>(m)); rep(i, n) rep(j, m) cin >> xs[i][j]; return xs; }

int main(void) {
    LL x;
    int n = in();
    int k = in();
    x = k;
    REP(i, 1, n) {
        x *= (k - 1);
    }
    cout << x << endl;

    return 0;
}



Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String str = br.readLine();
            int ans = 0;
            for (int i = 0; i < str.length(); i++) {
                char ch = str.charAt(i);
                if (ch == '+') {
                    ans++;
                } else {
                    ans--;
                }
            }
            System.out.println(ans);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}


Measured memory_bytes: 21076
// {{{
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
// }}}

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;

static constexpr int mod = (int)1e9 + 7;
static constexpr int inf = 100100100;
static constexpr ll linf = 1e18;
static constexpr double eps = 1e-9;
static constexpr double pi = 3.14159265359;

#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rrep(i, n) for (ll i = n; i >= 0; --i)
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define pb push_back
#define ist insert
#define fst first
#define snd second


int main() {
    // cin.tie(0);
    // ios_base::sync_with_stdio(false);
    string S;
    cin >> S;
    sort(all(S));
    if (S == "abc") {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 512
#include"bits/stdc++.h"
//#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define print(x) cout<<x<<endl;
typedef long long ll;
const int mod = 1e9 + 7;



int main() {
	string s;
	cin >> s;
	if (s == "a" || s == "i" || s == "u" || s == "e" || s == "o") {
		print("vowel");
	}
	else { print("consonant"); }
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long x,k,d;
    cin>>x>>k>>d;
    x=abs(x);
    if(k>x/d){
        long long c = x/d;
        k-=c;
        long long ans = x - c*d;
        ans = abs(ans -(k&1)*d);
        cout<<ans<<endl;
    }
    else{
        cout<<x-k*d<<endl;
    }
}


Measured memory_bytes: 3608
import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int n=scn.nextInt();
        int max=0;
        int min=0;
        for(int i=0;i<n;i++){
            int buf=scn.nextInt();
            if(i==0){
                max=min=buf;
            }else{
                max=Math.max(buf,max);
                min=Math.min(buf,min);
            }
        }
        System.out.println(max-min);
    }
}


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

int Keisan (int n){
  int sum = 0;
  while (n>0){
    sum += n%10;
    n/=10;
  }
  return sum;
}

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int total = 0;
  for (int i = 1; i <= N; ++i) {
    int sum = Keisan(i);
    if ( sum>=A && sum<=B){
      total+=i;
    }
  }
  cout << total << endl;
}
      

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
using namespace std;
// bitset<8>set1(p);
// __builtin_popcountll(x);
// bitset<100> b("1010");
long long power(long long a, long long b) {
    //a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
    }
  ll int binomial(ll int n, ll int k) 
{ 
    ll int C[k+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1;  // nC0 is 1 
  
    for (ll int i = 1; i <= n; i++) 
    { 
        // Compute next row of pascal triangle using 
        // the previous row 
        for (int j = min(i, k); j > 0; j--) 
            C[j] = C[j] + C[j-1]; 
    } 
    return C[k]; 
} 
  vector<int> pr;
  bool prime[10000000];
void Sieve(ll int n) 
{ 
    memset(prime, true, sizeof(prime)); 
    prime[1]=false;
  
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            pr.push_back(p);
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
}
 

int gcd(int a, int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
  
// Function to find gcd of array of 
// numbers 
int find(int arr[], int n) 
{ 
    int result = arr[0]; 
    for (int i = 1; i < n; i++) 
    { 
        result = gcd(arr[i], result); 
  
        if(result == 1) 
        { 
           return 1; 
        } 
    } 
    return result; 
} 


//It reurns Fn,Fn+1
pair<int, int> fib (int n) {
    if (n == 0)
        return {0, 1};

    auto p = fib(n >> 1);
    int c = p.first * (2 * p.second - p.first);
    int d = p.first * p.first + p.second * p.second;
    if (n & 1)
        return {d, c + d};
    else
        return {c, d};
}
void reverse(string& str) 
{ 
    int n = str.length(); 
  
    // Swap character starting from two 
    // corners 
    for (int i = 0; i < n / 2; i++) 
        swap(str[i], str[n - i - 1]); 
} 

string fun(string s)
{
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='O' || s[i]=='o')
        {
            s[i]='0';
        }
        else if(s[i]=='l' || s[i]=='I' || s[i]=='L' || s[i]=='i')
        {
            s[i]='1';
        }
        else if(isupper(s[i]))
        {
            s[i]=tolower(s[i]);
        }
    }
    return s;
}
  
int main() {
    ios;
   ll int l,r,d;
   cin>>l>>r>>d;
  int p=0;
  for(int i=l;i<=r;i++)
  {
      if(i%d==0)
      {
          p++;
      }
  }
  cout<<p<<endl;
}


Measured memory_bytes: 3616
#pragma GCC optimize("O3")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>

#define mp make_pair
#define all(c) (c).begin() , (c).end()
#define sz(c) ((long long)((c).size()))
#define phb push_back
#define ppb pop_back
#define phf push_front
#define ppf pop_front

using namespace __gnu_pbds;
using namespace std;

#define int ll

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define x first
#define y second

template
<
    class key,
    class val=null_type,
    class comp=less<key>
>
using ord_set=tree
<
    key,
    val,
    comp,
    rb_tree_tag,
    tree_order_statistics_node_update
>;

const int N=1e5+100;

pii p[N];
int pl[N],pr[N],sl[N],sr[N];

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

    int n;
    cin>>n;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        cin>>p[i].x>>p[i].y;
        ans=max(ans,p[i].y-p[i].x+1);
        if(p[i].y<p[1].y||p[i].y==p[1].y&&p[i].x>p[1].x)
            swap(p[i],p[1]);
    }
    sort(p+2,p+n+1);
    pl[0]=-1,pr[0]=1e10;
    for(int i=1;i<=n;i++)
        pl[i]=max(pl[i-1],p[i].x),
        pr[i]=min(pr[i-1],p[i].y);
    sl[n+1]=-1,sr[n+1]=1e10;
    for(int i=n;i>=1;i--)
        sl[i]=max(sl[i+1],p[i].x),
        sr[i]=min(sr[i+1],p[i].y);
    ans+=max(0ll,pr[n]-pl[n]+1);
    for(int i=1;i<=n-1;i++)
        ans=max(ans,pr[i]-pl[i]+1+sr[i+1]-sl[i+1]+1);
    cout<<ans;
}


Measured memory_bytes: 4992
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a;
    cin>>a;
    long long list[100];
    list[0] = 2LL;
    list[1] = 1LL;
    for(int i=2;i<=a;i++){
        list[i] = list[i-2] + list[i-1];
    }
    cout << list[a] << endl;
}


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

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

Measured memory_bytes: 3580
n = int(input())
a = list(map(int,input().split()))
def gcd(x,y):
    if x<y:
        x,y = y,x
    if y==0:
        return x
    if x%y==0:
        return y
    else:
        return gcd(y,x%y)
ans = a[0]
for i in a:
    ans = gcd(ans,i)
print(ans)

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

using namespace std;
using ll =long long;
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
#define leftunique(a) {sort((a).begin(),(a).end());(a).erase(unique((a).begin(),(a).end()),(a).end());}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
static const ll INF = 1LL << 60;
//Write From this Line

int h, w;
vector<string> field(1010);
const int dy[4] = {-1,0 ,0 ,1 };
const int dx[4] = {0 ,1 ,-1,0 };
int main()
{
	cin >> h >> w;
	//field = vector<string>(h);
	rep(i,h) cin >> field[i];
	vector<vector<ll>> dist(h,vector<ll>(w,INF));
	queue<pair<int,int>> que;
	rep(i,h){
		rep(j,w){ 
			if(field[i][j] == '#'){
				dist[i][j] = 0;
				que.push(make_pair(i,j));
			}
		}
	}
	while(!que.empty())
	{
		int y = que.front().first;
		int x = que.front().second;
		que.pop();

		rep(i,4) {
			int ny = y + dy[i];
			int nx = x + dx[i];
			if(ny < 0 || ny >= h || nx < 0 || nx >= w) continue;
			if(chmin(dist[ny][nx],dist[y][x]+1) ) {
				que.push(make_pair(ny,nx));
			}
		}
	}
	ll ans = 0;
	rep(i,h){
		rep(j,w){
			ans = max(ans,dist[i][j]);
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 17296
#include<bits/stdc++.h>
using namespace std;
int X[5];
int main(){
    cin>>X[0]>>X[1]>>X[2]>>X[3]>>X[4];
    for(int i=0;i<5;i++)if(X[i]==0){cout<<i+1<<endl;return 0;}
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef pair<int,int> P;
int N, M;
int X[100010];
int v[100010];
vector<P> mod[100010];
int modsum[100010];
int main(){
  cin >> N >> M;
  
  REP(i,N){
    cin >> X[i];
    v[ X[i] ]++;
  }
  REP(i, 100010){
    if( v[i] > 0 ){
      mod[ i % M ].emplace_back( v[i], i );
      modsum[ i % M ] += v[i];
    }
  }
  int ans = 0;
  ans += modsum[0] / 2;
  if( M % 2 == 0 ){
    ans += modsum[ M / 2 ] / 2;
  }
  for(int i = 1; i < M - i; i++ ){
    int j = M - i;
    int mutch = min( modsum[i] , modsum[j] );
    //cout << "mutch=" << mutch << endl;
    ans += mutch;
    int d = abs( modsum[i] - modsum[j] );
    if( d == 0 ) continue;
    if( modsum[j] < modsum[i] ){
      // modsum[j] の方が大きくなるようにする
      j = i;
    }
    // 奇数のものの個数を調べる
    int od = 0;
    REP( k, mod[j].size() ){
      if( mod[j][k].first % 2 == 1 ) od++;
    }
    if( mutch >= od ){
      ans += (modsum[j] - mutch) / 2;
    }else{
      ans += (modsum[j] - od) / 2;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
    using namespace std;
     
    long long n,m;
     
    int main() {
     	scanf("%lld%lld",&n,&m);
      	if (n == 1) {
          if (m == 1) printf("1\n"); else printf("%lld\n",m-2); 
        } else if (m == 1) {
          if (n == 1) printf("1\n"); else printf("%lld\n",n-2); 
        } else if (n == 2 || m == 2) printf("0\n"); else printf("%lld\n",(n-2)*(m-2));
    }

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

int main(){
    int N,K;
    int *A;

    int div[2][200001]={0};
    for(int i=1;i<=200000;i++){
        div[0][i]=i;
        //div[1][i]=0;
    }
    cin >> N >> K;
    A=new int[N];
    for(int i=0;i<N;i++){
        cin >> A[i];
        div[1][A[i]]++;
    }
    int diversity=0;
    int bucket[200001]={0};
    for(int i=1;i<=200000;i++){
        if(div[1][i]!=0) diversity++;
        bucket[div[1][i]]++;
    }
    //for(int i=1;i<6;i++) cout << bucket[i] << " ";
    int index=1;
    int change=0;
    for(int i=diversity;diversity>K;diversity--){
        while(bucket[index]==0){
            index++;
        }
            change+=index;
            bucket[index]--;
    }

    cout << change;
    delete[] A;
    return 0;
}

Measured memory_bytes: 3328
N = int(input())
t = [int(Ti) for Ti in input().split()]
v = [int(Vi) for Vi in input().split()]

v_max = [0]
for ti, vi in zip(t, v):
    v_max[-1] = min(v_max[-1], vi)
    for _ in range(2*ti):
        v_max.append(vi)

for i in range(len(v_max)-1):
    v_max[i+1] = min(v_max[i] + 0.5, v_max[i+1])

v_max[-1] = 0
for i in range(len(v_max)-2, -1, -1):
    v_max[i] = min(v_max[i], v_max[i+1] + 0.5)

area = 0
for i in range(len(v_max) - 1):
    area += 0.5 * 0.5 * (v_max[i] + v_max[i+1])

print(area)


Measured memory_bytes: 3540
#aaa
N = int(input())
L = input().split(" ")
#print(L)
vec = [int(i) for i in L ]
#print(vec)
vec.sort()
#print(vec)
ans = 0

for i in range(N):
  for j in range(N):
    if j < i :
      for k in range(N):
        if k < j:
          if vec[k] != vec[j] and vec[i] != vec[j] and vec[j]+vec[k] > vec[i]:
            ans += 1
            
print(ans)


Measured memory_bytes: 9136
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

// increment
#define rep_n(_1, _2, _3, NAME, ...) NAME
#define rep_2(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep_3(i, initial, n) for (int i = (int)(initial); i < (int)(n); ++i)
#define repeat(...) rep_n(__VA_ARGS__, rep_3, rep_2, rep_1)(__VA_ARGS__)
// decrement
#define rep_r_n(_1, _2, _3, NAME, ...) NAME
#define rep_r_2(i, n) for (int i = (int)(n); i > 0; i--)
#define rep_r_3(i, initial, n) for (int i = (int)(initial); i > (int)(n); i--)
#define repeat_r(...) rep_r_n(__VA_ARGS__, rep_r_3, rep_r_2)(__VA_ARGS__)
// define variable
using namespace std;
typedef long long ll;
using mpint = boost::multiprecision::cpp_int; // 多倍長整数（任意精度）
typedef pair<int, int> P;
const double EPS = numeric_limits<double>::epsilon();
// 最大公約数
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
// 最小公倍数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// char -> int
int ctoi(char c) { return (int)(c - '0'); }
// 素因数分解
vector< pair<ll, ll> > prime_factorize(ll n) {
	vector< pair<ll, ll> > p;
	for(ll i = 2; i*i <= n; i++) {
		if ((n % i) != 0) continue;
		p.push_back(make_pair(i, 0));

		while((n % i) == 0) {
			n /= i;
			p.back().second += 1;
		}
	}

	if (n != 1) p.push_back(make_pair(n, 0));
	return p;
}

int main() {
	ll A, B;
	cin >> A >> B;
 
	ll d = gcd(A, B);
	
	vector< pair<ll, ll> > p = prime_factorize(d);
	
	cout << (p.size() + 1) << endl;
	return 0;
}

Measured memory_bytes: 256
typedef long long ll;
typedef long double ld;
#define mod 1000000007
#define INF 1000000000
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int k;
	string s;
	cin >> k >> s;
	int len = s.length();
	string ans = s.substr(0, k);
	if (k < len) {
		ans += "...";
	}
	cout << ans << '\n';
	
	return 0;
}


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

using namespace std;

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

const int MOD = 1000000007;

int main() {
    int a, b;
    cin >> a >> b;
    cout << max(a + b, max(a - b, a * b)) << endl;

    return 0;
}



Measured memory_bytes: 256
from itertools import accumulate
import sys
input = lambda: sys.stdin.readline().rstrip()

MAX = 10 ** 5

def eratosthenes(n):
    is_prime = [1] * (n+1)
    is_prime[0] = 0
    is_prime[1] = 0

    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]:
            continue
        for j in range(i*2, n+1, i):
            is_prime[j] = 0
    return is_prime        


Q = int(input())

is_prime = eratosthenes(MAX)

a = [0] * (MAX+1)
for i in range(MAX+1):
    if is_prime[i] and is_prime[(i+1)//2]:
        a[i] = 1
s = [0] + a
s = list(accumulate(s))

for i in range(Q):
    l, r = map(int, input().split())
    print(s[r+1]-s[l])

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

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

	ll alpha=a+b;
	ll k=n/alpha;
	ll ans=k*a;
	ll l=n%alpha;

	if (l>=a)
	{
		ans=ans+a;
	}
	else
	{
		ans=ans+l;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Math;
class Z { static void Main() => new K(); }
class K
{
	int F => int.Parse(Str);
	long FL => long.Parse(Str);
	int[] G => Strs.Select(int.Parse).ToArray();
	long[] GL => Strs.Select(long.Parse).ToArray();
	string Str => ReadLine();
	string[] Strs => Str.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
	const int MOD = 1000000007;
	public K()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		Out.Flush();
	}
	void Solve()
	{
		var N = F;
		var t = new Pair[N];
		for (var i = 0; i < N; i++) { var I = GL; t[i] = new Pair(I[0], I[1]); }
		Array.Sort(t, (x, y) => -(x.X + x.Y).CompareTo(y.X + y.Y));
		var ans = 0L;
		for (var i = 0; i < N; i++)
		{
			if (i % 2 == 0) ans += t[i].X;
			else ans -= t[i].Y;
		}
		WriteLine(ans);
	}
}
struct Pair
{
	public readonly long X, Y;
	public Pair(long x, long y) { X = x; Y = y; }
}

Measured memory_bytes: 18864
#include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#define Endl endl
#define mp make_pair
#define rep(N) for(int i=0;i<N;i++)
#define repj(N) for(int j=0;j<N;j++)
#define ll long long 
#define pii pair<int,int>
#define pll pair<ll,ll>
#define For(I,N) for(int I=0;I<N;I++)
#define cinone(N) int N;cin>>N;
#define scanfone(N) int N;cin>>N;
#define cinng(N,M) int N[M];for(int yiuytvnm=0;yiuytvnm<M;yiuytvnm++) cin>>N[yiuytvnm];
#define scanfng(N,M) int N[M];for(int qrwuoiq=0;qrwuoiq<M;qrwuoiq++) scanf("%d",&N[qrwuoiq]);
#define over(A) {cout<<A<<endl;exit(0);}
#define all(A) A.begin(),A.end()
#define ceil(a,b) ((a-1)/b+1)
typedef unsigned long long ull;
const int inf=1039074182;
using namespace std;
ll dp[(1<<16)];
ll a[16][16];
ll cost[(1<<16)];
int n;

int main()
{
//	freopen("input.txt","r",stdin);
	cin>>n;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			cin>>a[i][j];
		}
	}
	for(int mask=0;mask<(1<<n);mask++)
	{
		for(int i=0;i<n;i++)
		{
			if(!((1<<i) & mask)) continue;
			for(int j=i+1;j<n;j++)
			{
				if(!((1<<j) & mask)) continue;
				cost[mask]+=a[i][j];
			}
		}
	}
	for(int i=0;i<(1<<n);i++)
	{
		dp[i]=cost[i];
		for(int mask=i;;mask--)
		{
			if(mask==-1) break;
			mask&=i;
//			cout<<((mask==0)||((i^mask)==0))<<endl;
			if(mask==0 || (i^mask)==0) continue;
			dp[i]=max(dp[i],dp[mask]+cost[i^mask]);
		}
	}
	cout<<dp[(1<<n)-1]<<endl;
	return 0;
}

Measured memory_bytes: 1280
n, k = map(int, input().split())
A_list  =[]
import numpy as np
nuske = np.zeros(n)

for _ in range(k): 
    d = input()
    a = list(map(int, input().split()))
    for i in a:
        nuske[ i-1] +=1

p =0

for i in range(len(nuske)):
    if nuske[i] ==0:
        p+=1

print(p)

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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

typedef long long LL;

int main(){
  int t,d,l;
  while(cin>>t>>d>>l,t){
    int x[100002]={};
    for(int i=0;i<t;i++){
      int r;cin>>r;
      if(r>=l){
        x[i]++;
        x[min(t-1,i+d)]--;
      }
    }
    for(int i=1;i<=t;i++){
      x[i]+=x[i-1];
    }
    int cnt=0;
    for(int i=0;i<t;i++){
      if(x[i]>0)cnt++;
    }
    cout<<cnt<<endl;
  }
  return 0;
}



Measured memory_bytes: 3484
x,k,d = map(int,input().split())

if abs(x) // d + 1 > k:
    print(abs(x) - k*d)
else:
    y = abs(x) // d
    if y % 2 == 0:
        if k % 2 == 0:
            print(abs(x) - y*d)
        else:
            print(abs(abs(x) - (y+1)*d))
    else:
        if k % 2 == 1:
            print(abs(x) - y*d)
        else:
            print(abs(abs(x) - (y+1)*d))

Measured memory_bytes: 9196
// Problem : B - Multiple of 9
// Contest : AtCoder - AtCoder Beginner Contest 176
// URL : https://atcoder.jp/contests/abc176/tasks/abc176_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#pragma GCC optimize("O2")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define mod 1000000007
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
int main()
{
	fast;
	ll t = 1;
	// cin >> t;
	while (t--)
	{
		string s;
		cin>>s;
		ll res = 0;
		for(auto i:s)
			res += i - '0';
		if(res%9)
			cout<<"No\n";
		else
			cout<<"Yes\n";
	}
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

#define fi first
#define se second


#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define REP(...) _overload3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__)

#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)

#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))

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

#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl

int main(){
    int n,m;
    cin>>n>>m;
    vector<vector<bool>> e(n,vector<bool>(n));
    vector<P> el;
    vector<bool> label(n);

    REP(i,m){
        int a,b;
        cin>>a>>b;
        a--,b--;
        e[a][b]=1;
        e[b][a]=1;
        el.push_back({a,b});
    }
    int ans=0;
    REP(i,m){
        e[el[i].fi][el[i].se]=0;
        e[el[i].se][el[i].fi]=0;

        fill(all(label),false);
        queue<int> Q;
        Q.push(el[i].fi);
        label[el[i].fi]=true;
        while(Q.size()){
            int x=Q.front();Q.pop();
            REP(j,n){
                if(e[x][j] && !label[j]){
                    label[j]=true;
                    Q.push(j);
                }
            }
        }
        if(!label[el[i].se]){
            ans++;
            //cerr<<el[i].fi<<" "<<el[i].se<<endl;
        }

        e[el[i].fi][el[i].se]=1;
        e[el[i].se][el[i].fi]=1;

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


Measured memory_bytes: 256
#include <stdio.h>
#include <vector>
 
using namespace std;
 
struct Node{
    Node(){
        parent = -1;
        depth = num_of_children = 0;
    }
    int parent;
    int depth;
    vector<int> children;
    int num_of_children;
};
 
void calcDepth(Node nodes[],int root_id){
    for(int i = 0;i < nodes[root_id].num_of_children;i++){
        nodes[nodes[root_id].children[i]].depth = nodes[root_id].depth+1;
        calcDepth(nodes,nodes[root_id].children[i]);
    }
}
 
int main(){
    int n,id,k,child_id,root_id;
    scanf("%d",&n);
    Node nodes[n];
 
    for(int i = 0; i < n; i++){
        scanf("%d %d",&id,&k);
        for(int j = 0; j < k; j++){
            scanf("%d",&child_id);
            nodes[id].children.push_back(child_id);
            nodes[id].num_of_children++;
            nodes[child_id].parent = id;
        }
    }
 
    for(root_id = 0; root_id < n; root_id++){
        if(nodes[root_id].parent == -1) break;
    }
 
    calcDepth(nodes,root_id);
 
    for(int i = 0; i < n; i++){
        if(nodes[i].parent == -1){
            printf("node %d: parent = -1, depth = 0, root, ",i);
        }else if(nodes[i].num_of_children == 0){
            printf("node %d: parent = %d, depth = %d, leaf, ",i,nodes[i].parent,nodes[i].depth);
        }else{
            printf("node %d: parent = %d, depth = %d, internal node, ",i,nodes[i].parent,nodes[i].depth);
        }
        printf("[");
        for(int j = 0; j < nodes[i].num_of_children-1; j++){
            printf("%d, ",nodes[i].children[j]);
        }
        if(nodes[i].num_of_children > 0){
            printf("%d",nodes[i].children[nodes[i].num_of_children-1]);
        }
        printf("]\n");
    }
}


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

int main(){
	string s;
	cin >> s;
	vector<ll> a(s.size()+1);
	ll cnt=0;
	for(int i=1;i<=s.size();i++){
		if(s.at(i-1)=='<')
			cnt++;
		if(s.at(i-1)=='>')
			cnt=0;
		a[i]=cnt;
	}
	cnt=0;
	for(int i=s.size()-1;i>=0;i--){
		if(s.at(i)=='>')
			cnt++;
		if(s.at(i)=='<')
			cnt=0;
		a[i]=max(a[i],cnt);
	}
	ll sum=0;
	for(int i=0;i<=s.size();i++){
		sum+=a[i];
	}
	cout << sum << endl;
    return 0;
}

Measured memory_bytes: 4740
let () =
  let rec loop b = function
      0 -> Printf.printf "%d\n" b
    | i -> let p = (float b) *. 1.05 in
           let rm = (int_of_float p) mod 1000 in
           loop ((int_of_float p) + (if rm = 0 then 0 else 1000-rm)) (i-1)
  in loop 100000 (read_int ());;

Measured memory_bytes: 2116
import java.io.*;
import java.io.IOException;
import java.util.*;

@SuppressWarnings({"rawtypes", "unchecked"})
class Main {
    final static int INF = 1 << 28;
    final static long LNF = 1L << 60;
    final static double EPS = 1e-9;
    final static double GOLDEN_RATIO = (1.0 + Math.sqrt(5)) / 2.0;

    static final long MOD = 1_000_000_007;

    public static void main(String[] args) throws Exception {
        final MyScanner sc = new MyScanner();
        long A;
        A = sc.nextLong();
        long B;
        B = sc.nextLong();
        solve(A, B);
    }

    static void solve(long A, long B){
        System.out.println(6 - A - B);
    }


    static class MyScanner {
 
        BufferedReader br;
        StringTokenizer st;
 
        MyScanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }
 
        MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        String nn() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        String next() {
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }
 
        char nextChar() {
            return nn().charAt(0);
        }
 
        int nextInt() {
            return Integer.parseInt(nn());
        }
 
        long nextLong() {
            return Long.parseLong(nn());
        }
 
        double nextDouble() {
            return Double.parseDouble(nn());
        }
 
        Integer[] niArr0(int n) {
            Integer[] ar = new Integer[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Integer[] niArr1(int n) {
            Integer[] ar = new Integer[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Long[] nlArr0(int n) {
            Long[] ar = new Long[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
 
        Long[] nlArr1(int n) {
            Long[] ar = new Long[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
    }

}


Measured memory_bytes: 21204
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

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

    int i = 0;
    int j = n - 1;
    int ans = 0;
    for(;;){
        while(i < j && s[i] != 'W')
            ++ i;
        while(i < j && s[j] != 'R')
            -- j;
        if(i == j)
            break;
        swap(s[i], s[j]);
        ++ ans;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3744