akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;

#define all(container) container.begin(), container.end()
#define sortall(container) (sort(container.begin(), container.end()))
#define yn(cond) ((cond) ? (cout << "yes" << endl) : (cout << "no" << endl))
#define Yn(cond) ((cond) ? (cout << "Yes" << endl) : (cout << "No" << endl))
#define YN(cond) ((cond) ? (cout << "YES" << endl) : (cout << "NO" << endl))

typedef long long       ll;

typedef vector<int>     vi;
typedef vector<ll>      vll;
typedef vector<double>  vd;
typedef vector<bool>    vb;
typedef vector<char>    vc;
typedef vector<string>  vs;
typedef pair<int, int>  pii;
typedef pair<ll, ll>    pll;
typedef vector<vi>		vvi;
typedef vector<vll>		vvll;
typedef vector<vd>		vvd;
typedef vector<vb>		vvb;
typedef vector<vc>		vvc;
typedef vector<vs>		vvs;
typedef vector<pii>     vpii;
typedef vector<pll>     vpll;

typedef struct edge_ {
	ll to;
	ll cost;
} edge;

typedef struct point_ {
	ll x, y;
	point_(ll x = 0, ll y = 0) : x(x), y(y) {}
} point;

template <typename T>
using mat2d = vector<vector<T>>;

constexpr double	PI = 3.14159265358979323846;
constexpr ll		INF = 1 << 15;
constexpr ll		MOD = (ll)1e9 + 7;
constexpr double	EPS = 1e-7;
constexpr int		dy4[4] = { 0, 1, 0, -1 };
constexpr int		dx4[4] = { 1, 0, -1, 0 };
constexpr int		dy8[8] = { 0, 1, 1, 1, 0, -1, -1, -1 };
constexpr int		dx8[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
	for (T& x : vec) is >> x;
	return is;
}

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
	for (const T& x : vec) os << x << " ";
	return os;
}

template<typename S, typename T>
istream& operator >> (istream& is, pair<S, T>& p) {
	is >> p.first >> p.second;
	return is;
}

istream& operator >> (istream& is, point& p) {
	is >> p.x >> p.y;
	return is;
}

template<typename S, typename T>
ostream& operator << (ostream& os, const pair<S, T>& p) {
	os << "{" << p.first << " : " << p.second << "}";
	return os;
}

template<typename T>
ostream& operator << (ostream& os, const set<T>& s) {
	for (const T& x : s) os << x << " ";
	return os;
}

ostream& operator << (ostream& os, const edge e) {
	os << "{to: " << e.to << ", cost: " << e.cost << "}";
	return os;
}

ostream& operator << (ostream& os, const point& p) {
	os << "(" << p.x << " " << p.y << ")";
	return os;
}

/******************************************************************************/
/**********************         Don't make WA !!         **********************/
/******************************************************************************/

int main()
{
	int W, a, b;
	cin >> W >> a >> b;
	cout << max(0, max(a, b) - min(a + W, b + W)) << endl;;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;using ll=int_fast64_t;using ld=long double;using pll=pair<ll,ll>;using pld=pair<ld,ld>;
const ll INF=1LL<<60;void solve();int main(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(10);solve();}
#define foreach(i,a) for(auto &i:a)
#define SELECTOR(_1,_2,_3,_4,SELECT,...) SELECT
#define rep(...) SELECTOR(__VA_ARGS__,_rep2,_rep1,_rep0)(__VA_ARGS__)
#define _rep0(i,n) for(ll i=0;i<n;++i)
#define _rep1(i,k,n) for(ll i=k;i<n;++i)
#define _rep2(i,k,n,d) for(ll i=k;d!=0&&d>0?i<n:i>n;i+=d)
template<class T> vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<class... Ts> auto make_v(size_t a,Ts... ts){return vector<decltype(make_v(ts...))>(a,make_v(ts...));}
template<class T> inline bool chmax(T &a,const T &b){if(a<b){a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a,const T &b){if(a>b){a=b; return 1;} return 0;}

using M=vector<vector<ll>>;
ll m;

ll modpow(ll a,ll p){
  ll res=1;
  ll power = a;
  while(p){
    if(p&1) (res*=power)%=m;
    (power*=power)%=m;
    p>>=1;
  }
  return res;
}

M mat_mul(const M& A, const M& B){
  M C{{0,0,0},{0,0,0},{0,0,0}};
  rep(i,3)rep(j,3)rep(k,3) {
    (C[i][j]+=A[i][k]*B[k][j])%=m;
  }
  return C;
}

void solve(){
  ll l,a,b; cin>>l>>a>>b>>m;
  vector<ll> C(19,0);
  rep(d,1,19){
    if((ll)pow(10,d)-1-a>=0){
      C[d]=((ll)pow(10,d)-1-a)/b+1;
    } else {
      C[d]=0;
    }
  }
  rep(d,18,0,-1) C[d]-=C[d-1];
  rep(d,1,19){
    C[d]=min(l,C[d]);
    l-=min(l,C[d]);
  }

  M A{{1,0,0},{0,1,0},{0,0,1}};
  rep(d,1,19){
    M res{{1,0,0},{0,1,0},{0,0,1}};
    M power{{modpow(10,d),1,0},{0,1,b%m},{0,0,1}};
    ll p=C[d];
    while(p){
      if(p&1) res=mat_mul(res,power);
      power=mat_mul(power,power);
      p>>=1;
    }
    A=mat_mul(res,A);
  }
  ll ans=0;
  ans+=(a%m)*(A[0][1])%m;
  ans+=A[0][2];
  cout<<ans%m<<"\n";
}

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

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

  string T,P;
  cin >> T;
  cin >> P;
  for(int it=0;it<T.length();it++) {
    int s = T.find(P,it);
    if(s != string::npos) {
      cout << s << "\n";
      it = s;
    }
    else {
      return 0;
    }
  }
}

Measured memory_bytes: 2704
n = int(input())
xy = []
for i in range(n):
  x,y = map(int, input().split())
  xy.append([x,y])

s = 0
for i in range(n-1):
  for j in range(i+1, n):
    s += ((xy[i][0] - xy[j][0]) ** 2 + (xy[i][1] - xy[j][1]) ** 2) ** 0.5

print(s * 2 / n)

Measured memory_bytes: 3060
import java.util.*;

public class Main {
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		final int MAX = 123456 * 2;
		boolean [] isprime = new boolean[MAX+1];
		for(int i = 2; i <= MAX; i++){
			isprime[i] = true;
		}
		for(int i = 2; i * i <= MAX; i++){
			if(isprime[i]){
				for(int j = i + i; j <= MAX; j += i){
					isprime[j] =false;
				}
			}
		}
		while(true){
			int n = sc.nextInt();
			if(n == 0) break;
			int count = 0;
			for(int i = n+1; i <= 2 * n; i++){
				if(isprime[i]) count++;
			}
			System.out.println(count);
		}
			
		
	}
	public static void main(String[] args) {
		Main obj = new Main();
		obj.doit();
	}
}

Measured memory_bytes: 13000
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<iostream>
const int M = 300005 ;
using namespace std ;
inline int read(){
	int x = 0, w = 1 ; char c = getchar() ;
	while(c>'9'||c<'0'){ if(c=='-') w=-1; c=getchar();}
	while(c>='0'&&c<='9'){ x = x*10+c-'0';c=getchar();}
	return x*w ;
}
int n;
char p[M];
int l[M],r[M];
int Ans ;
int main(){
	n = read();
	scanf("%s",p+1);
	for(int i=1;i<=n;i++)
	  if(p[i]=='E')
	    l[i] = l[i-1]+1;
	  else l[i] = l[i-1] ;
	for(int i=n;i>=0;i--)
	  if(p[i]=='W')
	    r[i] = r[i+1] +1 ;
	  else r[i] = r[i+1] ;
	for(int i=1;i<=n;i++){
		Ans = max(Ans,l[i]+r[i]) ;
	}
	printf("%d\n",n-Ans);
	return 0;
}

Measured memory_bytes: 2944
from string import ascii_lowercase


def new_val(cnt, base, target):
    diff = min(cnt // base, target)
    cnt -= diff * base
    target -= diff
    return cnt, target


def main():
    h, w = map(int, input().split())
    count = {s: 0 for s in ascii_lowercase}
    for _ in range(h):
        row = input()
        for j in range(w):
            count[row[j]] += 1
    target_4 = (h // 2) * (w // 2)
    target_1 = (h % 2) * (w % 2)
    target_2 = (w // 2) * (h % 2) + (h // 2) * (w % 2)
    ans = "Yes"
    for chr, cnt in count.items():
        count[chr], target_4 = new_val(cnt, 4, target_4)
    if target_4:
        ans = "No4"
    for chr, cnt in count.items():
        count[chr], target_2 = new_val(cnt, 2, target_2)
    if target_2:
        ans = "No2"
    if sum(count.values()) != target_1:
        ans = "No"
    print(ans)


if __name__ == '__main__':
    main()



Measured memory_bytes: 9944
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

const int N = 200010;

int par1[N], par2[N], sz[N];

void init(int n){
    REP(i,n){
        par1[i] = i;
        par2[i] = i;
        sz[i] = 1;
    }
}

int find(int *par, int x){
    if (par[x] == x){
        return x;
    }else{
        return par[x] = find(par, par[x]);
    }
}

bool same(int *par, int x, int y){
    return find(par, x) == find(par, y);
}

void merge(int *par, int x, int y){
    x = find(par, x);
    y = find(par, y);
    if (x==y) return;
    par[x] = y;
}

void merge(int *par, int *sz, int x, int y){
    x = find(par, x);
    y = find(par, y);
    if (x==y) return;
    sz[y] += sz[x];
    par[x] = y;
}

int main() {
    int n, k, l;
    cin >> n >> k >> l;
    init(n);
    REP(i,k){
        int x, y;
        scanf("%d %d", &x, &y);
        x--;
        y--;
        merge(par1,x,y);
    }
    REP(i,l){
        int x, y;
        scanf("%d %d", &x, &y);
        x--;
        y--;
        merge(par2, x, y);
    }

    map<P, int> mp;

    REP(i,n){
        mp[make_pair(find(par1, i), find(par2, i))]++;
    }

    REP(i,n) printf("%d ", mp[make_pair(find(par1, i), find(par2, i))]);
    cout << endl;

    return 0;
}

Measured memory_bytes: 14336
#include<cstdio>
#include<algorithm>
using namespace std;
#define Mod 1000000007
#define ll long long
inline char tc(void){
	static char fl[10000],*A=fl,*B=fl;
	return A==B&&(B=(A=fl)+fread(fl,1,10000,stdin),A==B)?EOF:*A++;
}
inline int read(void){
	int a=0;static char c;
	while((c=tc())<'0'||c>'9');
	while(c>='0'&&c<='9')a=a*10+c-'0',c=tc();
	return a;
}
ll fac[8005],inv[8005],n,f[4005][4005],x[200005],y[200005],ans,b[4005][4005];
inline ll C(ll n,ll m){
	return (fac[n]*inv[m]%Mod)*inv[n-m]%Mod;
}
int main(void){
	register int i,j;
	fac[0]=inv[0]=inv[1]=1;
	for(i=2;i<=8004;++i)	
		inv[i]=(Mod-Mod/i)*inv[Mod%i]%Mod;
	for(i=1;i<=8004;++i)
		fac[i]=fac[i-1]*i%Mod,inv[i]=inv[i-1]*inv[i]%Mod;
	n=read();
	for(i=1;i<=n;++i)
		x[i]=read(),y[i]=read(),++f[2001-x[i]][2001-y[i]],++b[2001+x[i]][2001+y[i]];
	for(i=1;i<=4004;++i)
		for(j=1;j<=4004;++j){
			f[i][j]=(f[i][j]+f[i-1][j]+f[i][j-1])%Mod;
			if(b[i][j])ans=(ans+b[i][j]*f[i][j]%Mod)%Mod;
		}
	for(i=1;i<=n;++i)
		ans=(((ans-C((x[i]+y[i])*2,x[i]*2)))%Mod+Mod)%Mod;
	printf("%d",ans*inv[2]%Mod);
	return 0;
}

Measured memory_bytes: 192640
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>
#define FASTIO ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define rep(i, l, r) for (ll i = (l); i < (r); ++i)
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define pii pair<ll, ll>
#define pll pair<ll, ll>
#define pli pair<ll, ll> 
#define pdd pair<ld, ld> 
#define pb push_back
#define reset(x,v) memset(x,v,sizeof(x))
#define mod 1000000007
using namespace std;
ll power(ll x, ll y, ll c)  
{  
if(y == 0)
	return 1;
    ll res = 1;     // Initialize result  
  
    x = x % c; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % c;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % c;  
    }  
    return res;  
}
ll solve(ll n){
	if(n == 0)
	return 0;
	ll t = n, c = 0;
	while(t > 0){
		if(t % 2)
			c++;
		t /= 2;
	}
	return 1 + solve(n % c);
}
int main(){
	FASTIO
	int n;
	cin >> n;
	string x;
	cin >> x;
	int c = 0;
	rep(i, 0, n){
		if(x[i] == '1')
			c++;
	}
	
	ll num = 0, f = 1, f1 = 1, f2 = 1, num1 = 0, num2 = 0, c1 = c + 1, c2 = c - 1;
	for(int i = n - 1; i >= 0; i--){
		if(x[i] == '1'){
//			num = c > 0(num + f) % c;
			num1 = (num1 + f1) % c1;
			num2 = c2 > 0 ? (num2 + f2) % c2 : 0;
		}
		
//		f = (f * 2) % c;
		f1 = (f1 * 2) % c1;
		f2 = c2 > 0 ? (f2 * 2) % c2 : 1;
	}
	
	rep(i, 0, n){
		if(x[i] == '1'){
			if(c2 == 0){
				cout << 0 << endl;
			}
			else {
			ll h = power(2LL, n - i - 1, c2);
			ll ans = (num2 - h + c2) % c2;
//				cout << i <<": " << num2 << " "<< ans << " ";
			cout << 1 + solve(ans) << endl;
			}
		}
		else{
			ll h = power(2LL, n - i - 1, c1);
			ll ans = (num1 + h) % c1;
//				cout << num1 << " " << ans << " ";
			cout << 1 + solve(ans) << endl;
		}
		
	}
	
    return 0;
}

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


public class Contest
{
	public static void Main()
	{

/*
		int n = a[0];
		int[][] e = new int[n][];
		for(int i=0; i<n; i++) e[i] = Array.ConvertAll(Console.ReadLine().Split(' '), new Converter<string,int>(zzz => int.Parse(zzz)));
*/

 //       long a,b,c,d,e,f;
 //       MyRead.Multi(out a, out b, out c, out d, out e, out f);
        long a,b;
        MyRead.Multi(out a, out b);

		string s = (a+b)%2==0?((a+b)/2).ToString():"IMPOSSIBLE";


		Console.WriteLine(s);
	}
	
	private static int calc_main(int[] a,int[] b,int[] c,int[] d) {



		return 0;
	}




}

public static class MyRead
{
	private static bool eq<T, U>() => typeof(T).Equals(typeof(U));
	private static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
	private static T cv<T>(string s) => eq<T, int>()    ? ct<T, int>(int.Parse(s))
	                                  : eq<T, long>()   ? ct<T, long>(long.Parse(s))
	                                  : eq<T, double>() ? ct<T, double>(double.Parse(s))
	                                  : eq<T, char>()   ? ct<T, char>(s[0])
	                                                    : ct<T, string>(s);
	public static string[] Multi<T>(out T a) {
		var ar = Console.ReadLine().Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries); 
		a = cv<T>(ar[0]);
		return ar;
	}
	public static string[] Multi<T, U>(out T a, out U b) {
		var ar = Multi<T>(out a); 
        b = cv<U>(ar[1]);
		return ar;
	}
	public static string[] Multi<T, U, V>(out T a, out U b, out V c) {
		var ar = Multi<T, U>(out a, out b); 
        c = cv<V>(ar[2]);
		return ar;
	}
	public static string[] Multi<T, U, V, W>(out T a, out U b, out V c, out W d) {
		var ar = Multi<T, U, V>(out a, out b, out c); 
        d = cv<W>(ar[3]);
		return ar;
	}
	public static string[] Multi<T, U, V, W, X>(out T a, out U b, out V c, out W d, out X e) {
		var ar = Multi<T, U, V, W>(out a, out b, out c, out d); 
        e = cv<X>(ar[4]);
		return ar;
	}
	public static string[] Multi<T, U, V, W, X, Y>(out T a, out U b, out V c, out W d, out X e, out Y f) {
		var ar = Multi<T, U, V, W, X>(out a, out b, out c, out d, out e); 
        f = cv<Y>(ar[5]);
		return ar;
	}
}




Measured memory_bytes: 11220
#include <stdio.h>
int digits(int x) {
   int count = 0;
   while(x>0) {
      x /= 10;
      count++;
   }
   return(count);
}
int main(void) {
   int a, b;
   int sum;
   while( scanf("%d %d", &a, &b) !=EOF) { 
      sum = a + b;
      printf("%d\n", digits(sum));
   }
   return (0);
}

Measured memory_bytes: 600
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.NoSuchElementException;

public class Main {
	//FastScannerクラス、普通の Scannerクラスだとメモリと時間を大幅に喰らうので高速化する内部クラス。
	
	public static void main(String[]args) {
		FastScanner sc = new FastScanner(System.in);
		int n= Integer.valueOf(sc.next());
		int []a  = new int[n];
		for(int i = 0;i<n;i++)a[i] = Integer.valueOf(sc.next());
		
		Deque<Integer>queue = new ArrayDeque<Integer>();
		
		int uraomo = 0;
		queue.addLast(a[0]);
		for(int i = 1;i<n;i++) {
			if(uraomo==0) {
				queue.addLast(a[i]);
				uraomo=1;
			}else {
				queue.addFirst(a[i]);
				uraomo=0;
			}
		}
		
		for(int i = 0;i<n;i++) {
			System.out.println(uraomo==0?queue.removeFirst():queue.removeLast());
		}
		
			
		
		
		
		
		
		
	}
	
	static class FastScanner {
		 
		private final InputStream in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;
 
		public FastScanner(InputStream source) {
			in = source;
		}
 
		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}
 
		private int readByte() {
			if (hasNextByte()) return buffer[ptr++];
			else return -1;
		}
 
		private static boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}
 
		private void skipUnprintable() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
		}
 
		public boolean hasNext() {
			skipUnprintable();
			return hasNextByte();
		}
 
		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
 
		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while (true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
	}

}


Measured memory_bytes: 72004
#include <bits/stdc++.h>
using namespace std;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define rfor(i,a,b) for(ll (i) = (a); (i) > (b); --(i))
#define ll long long
#define mod (1000000007)
#define pf(x) cout << (x) << endl;
#define all(x) (x).begin(),(x).end()

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

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

ll factorial(ll n){
    ll t = 1;
    rep1(i, n)t *= i;
    return t;
}

ll combinations(ll n, ll k) {
    ll r = 1;
    rep1(i, k)r = r * n-- / i;
    return r;
}

int main()
{
    ll q;
    cin >> q;
    vector<ll> l(q),r(q);
    rep0(i, q)cin >> l[i] >> r[i];
    
    vector<bool> sieve(1e5 + 2,true),like(1e5 + 2,false);
    sieve[1] = false; sieve[0] = false;
    vector<ll> cnt(1e5 + 2,0);
    for(ll i = 2; i <= 1e5; ++i)if(sieve[i])for(ll j = 2; j * i <= 1e5; ++j)sieve[j * i] = false;
    rep1(i, 1e5)if(i % 2 == 1 && sieve[i] && sieve[(i + 1) / 2]) like[i] = true;
    rep1(i, 1e5){
        cnt[i] = cnt[i - 1];
        if(like[i])++cnt[i];
    }
    rep0(i, q)pf(cnt[r[i]] - cnt[l[i] - 1])
    return 0;
}


Measured memory_bytes: 3072
//                             In The Name Of Allah
#include <bits/stdc++.h>
#define ss second
#define ff first
#define use_fast ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ret(n) return cout << n, 0
#define se(n) cout << setprecision(n) << fixed
#define pb push_back
#define int long long
#define ld long double
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;

const int N = 4e6 + 100, T = 2e3 + 100, OO = 1e12 + 10, M = 1e9 + 7, P = 49157, sq = 360, lg = 30;
typedef pair <int, int> pii;
int dp[T][T];
int fac[N], inv[N];
 
int pw(int x, int y) {
	if(y == 0)
		return 1;
	int cnt = pw(x, y / 2);
	cnt = (cnt * cnt) % M;
	cnt = (cnt * (y % 2 == 1 ? x : 1)) % M;
	return cnt;
}
 
void prepro() {
	fac[0] = 1;
	for(int i = 1; i <= N - lg; i++) 
		fac[i] = (fac[i - 1] * i) % M;
	inv[N - lg] = pw(fac[N - lg], M - 2);
	for(int i = N - lg - 1; i > -1; i--) 
		inv[i] = (inv[i + 1] * (i + 1)) % M;
}
 
int c(int x, int y) {
	if(x == y || y == 0)
		return 1;
	return ((fac[x] * inv[y] % M) * inv[x - y]) % M;
}

int32_t main() {
	use_fast;
	prepro();
	int n, k;
	cin >> n >> k;
	if(k == 1)
		return cout << 1, 0;
	dp[0][0] = 1;
	for(int i = 1; i <= n; i++) {
		for(int j = i; j >= 1; j--) 
			dp[i][j] = (dp[i][j + 1] + (dp[i - 1][j - 1] * i) % M * c(i * k - 1 - j, k - 2)) % M;
		dp[i][0] = dp[i][1];
	}
	cout << dp[n][0] << endl;
	return 0;
} 	
/*
be carefull :
1- if not solve after 20 min, read again twice
2- after submit read the code again
3- fun with contest
4- ... 
*/

Measured memory_bytes: 96512
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string S;
    int flag[3] = {0, 0, 0};
    char c_flag[3] = {'a', 'b', 'c'};
    cin >> S;
    for (int i=0; i<3; i++)
    {
        for (int j=0; j<3; j++)
        {
            if (S[i] == c_flag[j]) flag[j] = 1;
        }
    }
    if (flag[0]+flag[1]+flag[2] == 3) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdlib.h>
#include <stdio.h>
int MIN(int a,int b){
    return a<b?a:b;
}
int main()
{   int n;
    scanf("%d",&n);
    int w[n],arr1[n];
    for(int i=0;i<n;i++){
        scanf("%d",&w[i]);
        if(i==0)arr1[i]=w[i];
        else arr1[i]=arr1[i-1]+w[i];
    }
    int sum=arr1[n-1],arr2[n];
    for(int i=0;i<n;i++){
        arr2[i]=sum-arr1[i];
    }
    int ans=114514;
    for(int i=0;i<n;i++){
        ans=MIN(ans,abs(arr1[i]-arr2[i]));
    }
    printf("%d",ans);

    return 0;
}


Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main()
{
    int i, N, T, A;
    cin >> N >> T >> A;
    int temp, minp, mini, delta;
    
    minp=10000*1000;
    
    int H[N];
    
    for(i=0;i<N;i++)
    {
        cin >> H[i];
    }
    
    for(i=0;i<N;i++)
    {
        temp=T*1000-H[i]*6;
        
        delta=abs(1000*A-temp);
                
        if(delta<=minp)
        {
            mini=i+1;
            minp=delta;
        }
    }
    
    cout << mini << endl;
}

Measured memory_bytes: 256
import numpy as np

a,b,x = map(int,input().split())
if a*a*b > x*2:
    print(90-np.rad2deg(np.arctan(2*x/(a*b*b))))
else:
    print(np.rad2deg(np.arctan(2*(a*a*b-x)/(a**3))))

Measured memory_bytes: 12420
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define LB(c, x) lower_bound(c.begin(), c.end(), x)
#define UB(c, x) upper_bound(c.begin(), c.end(), x)
#define LI(c, x) distance(c.begin(), LB(c, x))
#define UI(c, x) distance(c.begin(), UB(c, x))

// functions
template <class T> T ceil(T a, T b) {
    return (a + b - 1) / b;
}
template <class T> T round(T a, T b) {
    return (a + b / 2) / b;
}
template <class T> T gcd(T a, T b) {
    return b ? gcd(b, a % b) : a;
}
template <class T> T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}
template <class T> bool amax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
ll modpow(ll a, ll b, ll m) {
    if (b == 0) {
        return 1;
    } else if (b % 2 == 0) {
        ll h = modpow(a, b / 2, m);
        return h * h % m;
    } else {
        return a * modpow(a, b - 1, m) % m;
    }
}
ll comb(ll a, ll b, ll m) {
    if (b > a - b) {
        return comb(a, a - b, m);
    }
    ll c = 1, d = 1;
    REP(i, b) {
        c *= (a - i);
        d *= (b - i);
        c %= m;
        d %= m;
    }
    return c * modpow(d, m - 2, m) % m;
}

// main
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int A, B;
    cin >> A >> B;
    if (A % 2 != B % 2) {
        cout << "IMPOSSIBLE" << endl;
    } else {
        cout << (A + B) / 2 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl "\n"
#define ll long long int
#define mod 1000000007
#define mem(a,val) memset(a,val,sizeof(a))

using namespace std;
int main()
{
	std::ios::sync_with_stdio(false);
	long double r;
	cin>>r;
	cout<<3.14159265358979*2*r;
	return 0;
}


Measured memory_bytes: 3800
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
void debug() {cout<<endl;}
template<typename T,typename... Args>
void debug(T x,Args... args) {cout<<x<<" ";debug(args...);}
#define forn(i,a,b) for(int i=a;i<b;++i)
#define pb push_back
#define F first
#define S second
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;



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

int n;
cin >> n;
vector<int> v(n), c(n);
forn(i, 0, n)cin >> v[i];
forn(i, 0, n)cin >> c[i];
ll ans = 0;
forn(i, 0, n){
	if(v[i] > c[i]){
		ans += v[i];
		ans -= c[i];
	}
}
cout << ans << endl;



}




Measured memory_bytes: 3660
void main(){
  import std.stdio, std.string, std.conv, std.algorithm;
  
  int n; rd(n);
  int a; rd(a);

  if(n%500<=a) writeln("Yes");
  else writeln("No");
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf = 1012345678;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

int a[30];

bool comp(int a, int b, int c){
  if((a < b && b < c) ||( a > b && b > c)){
    return true;
  }
  else return false;
}

int main(){
  int N;
  cin >> N;
  rep(i,N){
    cin >> a[i];
  }
  int ans = 0;
  for(int i = 1; i<N-1; i++){
    if(comp(a[i-1],a[i],a[i+1])) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>

using namespace std;

const int N = 200005, P = 1e9 + 7;

typedef long long LL;

int n, K;

int ans = 0;

int main() {
	scanf("%d%d", &n, &K);
	for (int k = K; k <= n + 1; k++) {
		ans = (ans + (LL)(n - k + 1 + n) * k / 2 - (LL)k * (k - 1) / 2 + 1) % P;
	}
	printf("%d\n", ans);
	return 0;
}



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

main(){

  ll n;
  cin>>n;
  vector<vector<pair<ll,ll>>> adj(n);
  rep(i,n-1){
    ll u,v,w;
    cin>>u>>v>>w;
    u--;v--;
    adj[u].emplace_back(v,w);
    adj[v].emplace_back(u,w);
  }

  using pll=pair<ll,ll>;
  priority_queue<pll,vector<pll>,greater<>> que;
  vector<ll> dist(n,INF);
  que.emplace(0,0);
  while(!que.empty()){
    ll cost,now_v;
    tie(cost,now_v)=que.top();
    que.pop();
    if(dist[now_v]<=cost)continue;
    dist[now_v]=cost;
    for(const auto& edge:adj[now_v]){
      ll to,wei;
      tie(to,wei)=edge;
      if(dist[to]>wei+cost){
        que.emplace(wei+cost,to);
      }
    }
  }

  for(auto x:dist)cout<<x%2<<endl;


}


Measured memory_bytes: 8704
#include <stdio.h>
#define MAX 100
static const int INFTY = (1<<21);
int n,A[MAX][MAX];

void dikusutora();

int main(){
  int i,j,m,k,d,h;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      A[i][j]=INFTY;
    }
  }
  for(i=0;i<n;i++){
    scanf("%d",&m);
    scanf("%d",&k);
    for(j=0;j<k;j++){
      scanf("%d",&d);
      scanf("%d",&h);
      A[m][d]=h;
    }
  }
  dikusutora();
  return 0;
}
void dikusutora(){
  int min,i,e,v;
  int g[MAX],a[MAX];

  for(i=0;i<n;i++){
    g[i]=INFTY;
    a[i]=0;
  }
  g[0]=0;
  a[0]=1;
  
  while(1){
    min=INFTY;
    e=-1;
    for(i=0;i<n;i++){
      if(min>g[i]&&a[i]!=2){
	e=i;
	min=g[i];
      }
    }
    if(e==-1)
      break;
    a[e]=2;
    for(v=0;v<n;v++){
      if(a[v]!=2&&A[e][v]!=INFTY){
	if(g[v]>g[e]+A[e][v]){
	  g[v]=g[e]+A[e][v];
	  a[v]=1;
	}
      }
    }
  }
  for(i=0;i<n;i++){
    printf("%d",i);
    printf(" ");
    if(g[i]==INFTY)
      printf("-1");
    else printf("%d",g[i]);
    printf("\n");
  }
}



Measured memory_bytes: 2716
N = int(input())
donuts = 7
cakes = 4
answer = 0
def calc1():
  for a in range(0,26):
    for b in range(0,26):
      if donuts * a + cakes * b == N:
        return 'Yes'
      elif donuts * a + cakes * b  > N:
        break
  return 'No'

print(calc1())

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;
typedef pair<ll, ll> PL;
typedef pair<P, ll> PPL;

#define INF INT_MAX/3

#define MAX_N 1000

#define mod 1000000007

ll n;
ll dp[1010100];
ll sum=0;

int main(){
	cin.sync_with_stdio(false);
  cin>>n;
  dp[n-1]=n;
  for(int i=n-2;i>=0;i--){
    dp[i]=(n*(n-1)%mod+dp[i+1]+sum)%mod;
    dp[i]=(dp[i]-max(0LL,(n-i-3))+mod)%mod;
    sum=(sum+dp[i+2])%mod;
  }
  cout<<dp[0]<<endl;
	return 0;
}



Measured memory_bytes: 8064
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <iomanip>
#include <stack>
#include <set>
#include <bitset>
#include <functional>
using namespace std;
const constexpr int INF = 1e9;
//typedef std::pair<std::string,double> P;

#define FOR(i, a, n) for (ll i = (ll)a; i<(ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef vector<int> VI;
const constexpr ll MOD = 1e9+7;
 
struct Less {
    bool operator()(const pair<int, int>& x, const pair<int, int>& y) const {
        return x.first > y.first;
    }
};

ll GCD(ll a, ll b){
    if(b==0) return a;
    return GCD(b, a%b);
}


//グラフの隣接リスト
VI g[200010];
//頂点の入次数を管理
int h[100010];
int H, W;
vector<string> field;
int dist[51][51];
int dxy[5]={-1, 0, 1, 0, -1};
int bfs(){
    for(int i=0; i<H; ++i){
        for(int j=0; j<W; ++j){
            dist[i][j] = -1;
        }
    }
    
    queue<pair<int, int> > q;
    q.push({0, 0});
    dist[0][0]=1;
    while(!q.empty()){
        pair<int, int> p = q.front(); q.pop();
        for(int i=0; i<4; ++i){
            int nx = p.second + dxy[i],
                ny = p.first + dxy[i+1];
            if(ny>=0&&ny<H&&nx>=0&&nx<W&&field[ny][nx]=='.'&&dist[ny][nx]==-1){
                q.push({ny, nx});
                dist[ny][nx] = dist[p.first][p.second]+1;
            }
        }  
    }
    return dist[H-1][W-1];
}
int main(void) {
    cin >> H >> W;
    cin.ignore();
    for(int i=0; i<H; ++i){
        string s; getline(cin, s);
        field.push_back(s);
    }
    int c=0;
    for(int i=0; i<H; ++i){
        for(int j=0; j<W; ++j){
            if(field[i][j]=='#') c++;
        }
    }
    int ans = bfs();
    
    if(ans!=-1){
        cout << W*H-ans-c << endl;
    }else cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 4992
#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
#define modbig (10*10*10*10*10*10*10*10*10+7)
using namespace std;

int main(){
  ll n,ans=0;
  cin>>n;
  ll a[n];
  rep(i,n){
    cin>>a[i];
  }
  map<ll,ll> mp;
  rep(i,n){
    mp[a[i]]++;
  }
  for(auto p: mp){
    ll x=p.second;
    ans+=x*(x-1)/2;
  }
  rep(i,n){
    ll m=mp[a[i]];
    cout<<ans-m+1<<"\n";
  }
}


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

using namespace std;
typedef long long ll;
int n,m;
typedef pair<int,ll> P;
const ll INF = 1e13;
vector<P> g[100005];
ll dist[100005];

void dfs(int v, int prev, ll x) {
  dist[v] = x;

  for(int i = 0; i < g[v].size(); i++) {
    int u = g[v][i].first;
    ll c = g[v][i].second;
    if(u == prev) continue;
    if(dist[u] != INF) {
      if(x + c != dist[u]) {
	cout << "No" << endl;
	exit(0);
      }
    }
    else dfs(u,v,x+c);
  }
}
  
int main() {
  cin >> n >> m;
  for(int i = 0; i < m; i++) {
    int l,r;
    ll d;
    cin >> l >> r >> d;
    g[l].push_back(P(r,d));
    g[r].push_back(P(l,-d));
}

  fill(dist,dist+n+1,INF);

  for(int i = 0; i < n; i++) {
    if(dist[i] != INF) continue;
    dfs(i,-1,0);
  }

  cout << "Yes" << endl;
}


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

int N ;
cin >> N ;
rep(i,10) {
  if( N%i==0 && N/i <=9 ){
    cout << "Yes" << endl;
    return 0 ;
  }
}
cout << "No" << endl;  
}

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

int main() {
	long long n,i,a[1000],j,ans=0;
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	for(i=0;i<n-1;i++) {
		for(j=i+1;j<n;j++) {
			ans+=(a[i]*a[j]);
		}
	}
	cout<<ans;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define MP make_pair
#define PB push_back
#define ff first
#define ss second
#define TR(it,c) for( typeof(c.begin()) it = c.begin(); it != c.end(); ++it )
#define TRR(it,c) for( typeof(c.rbegin()) it = c.rbegin(); it != c.rend(); ++it
#define REP(i,a) for (int i = 0; i < (a); i++)
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORD(i,a,b) for (int i = (a); i >= (b); i--)

#define DRI(a) int a; scanf("%d", &a);
#define DRII(a, b) int a, b; scanf("%d %d", &a, &b);
#define DRIII(a, b, c) int a, b, c; scanf("%d %d %d", &a, &b, &c);
#define RI(a) scanf("%d", &a);
#define RII(a, b) scanf("%d %d", &a, &b);
#define RIII(a, b, c) scanf("%d %d %d", &a, &b, &c);
#define MM(arr, num) memset((arr), (num), sizeof((arr)))
#define DEB(x) cerr << ">>> " << (#x) << " -> " << (x) << endl;
#define DEBA(x,n) cerr << (#x) << " "; deba((x),(n));
void deba(int * a, int n){ cerr << "| "; REP(i,n) cerr << a[i] << " "; cerr << "|" << endl;}


inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }

const int INF = 1<<30;
typedef long long ll;
typedef unsigned long long ull;
/*******************************************************/

ll mod = 1e9 + 7;
int a[123456];


int main() {

  DRI(n);
  REP(i,n) RI(a[i]);
  ll out = 1;

  ll lv = 0;

  REP(i,n){
    if(i>0){
        int len = a[i];
        int p = (i+1)-lv;
        if( len- p < len/2 ){
            out*= p;
            out%= mod;
            lv++;
        }
    }
  }

  FORD(i, n-lv, 1) {out*= i; out%= mod; }

  cout << out << endl;

  return 0;
}


Measured memory_bytes: 640
#include <stdio.h>

int main(){
    int n, i;
    int data[1000];
    
    scanf("%d\n", &n);
    
    for(i=0;i<n;i++){
        scanf("%d ", &data[i]);    
    }
    
    for(i=n-1;i>=0;i--){
        printf("%d", data[i]);
        if (i!=0){printf(" ");}
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 2104
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(int i=(a); i<(b); ++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+b,(a).begin()+c // コンテナ a の 要素 b から c へのイテレータ
#define MOD 1000000007
// typedef
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

void ans(unordered_map<int, unordered_set<int>> &tree, VI &cnt, int t, int parent) {
    // if (tree[t].empty()) return;

    for (int s : tree[t]) {
        if (s == parent) continue; // 親で出てたらcontinue
        cnt[s-1] += cnt[t-1];
        ans(tree, cnt, s, t);
    }
}

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

int N, Q; cin >> N >> Q;
VP ab(N-1), px(Q);
rep(i,0,N-1) cin >> ab[i].first >> ab[i].second;
rep(i,0,Q) cin >> px[i].first >> px[i].second;

unordered_map<int, unordered_set<int>> tree;
rep(i, 0, N-1){
    tree[ab[i].first].insert(ab[i].second);
    tree[ab[i].second].insert(ab[i].first); // 親か子かわからないので，双方向に記録
}

// sort(ALL(px));

VI cnt(N, 0);
rep(i, 0, Q){
    cnt[px[i].first - 1] += px[i].second;
}

ans(tree, cnt, 1, -1);

rep(i, 0, N) cout << cnt[i] << ' ';
cout << endl;

return 0;
}

// 境界，出力文字列 チェック



Measured memory_bytes: 58312
def main() -> None:
    N, M, C = map(int, input().split())
    b = tuple(map(int, input().split()))
    l = [tuple(map(int, input().split())) for _ in range(N)]
    # print(b)
    # print(l)
    ans = 0
    for a in l:
        s = 0
        for i in range(len(a)):
            s += a[i] * b[i]
        if s + C > 0:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
n=int(input())
def gcd(a, b):
  while b:
    a, b = b, a % b
  return a

def lcm(a, b):
  return (a * b) // gcd(a, b)
num = 1
for i in range(n):
  num = lcm(num, int(input()))

print(num)

Measured memory_bytes: 3060
#coding:utf-8
n = int(input())
t = list(map(int, input().split()))
m = int(input())

for i in range(m):
    ans = t[:]
    p, x = map(int, input().split())
    ans[p-1] = x
    #print(ans, sum(ans))
    print(sum(ans))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define maxn 100005
#define MOD 998244353
using namespace std;
#define ll long long

#define pii pair<ll, ll>
#define piii pair<ll, pii>

#define ft first
#define sd second

void fast(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}


ll power(ll a, ll b){
    if(b==0) return 1;
    ll R =1, k=a;
    for (ll j=b;j>0;j/=2){
        if (j&1) R=(R*k)%MOD;
        k=(k*k)%MOD;
    }
    return R;
}

void solve(){

    string s;
    cin >> s;
    if(s == "AAA" || s == "BBB") cout << "No\n";
    else cout << "Yes\n";

}

int main()
{


    ll t = 1;//cin >> t;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b,c;
  cin>>a>>b>>c;
  if(a==b)
  {
    if(a!=c)
      cout<<"Yes";
    else
      cout<<"No";
  }
  else if(a==c)
  {
    if(a!=b)
      cout<<"Yes";
    else
      cout<<"No";
  }
  else if(b==c)
    {
    if(a!=b)
      cout<<"Yes";
    else
      cout<<"No";
  }
  else
    cout<<"No";
}


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

int		main(void)
{
	char	a;
	cin >> a;
	if (a == 'A' || a == 'T')
		cout << (a == 'A' ? "T" : "A") << endl;
	else
		cout << (a == 'C' ? "G" : "C") << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
#define int long long
using namespace std;
using cd = complex <double>;
 
typedef pair <int, long long> pii;
 
const long long INF = 1e18;
const int mod = 998244353;//1000000007;
const double Pi = acos(-1);
 
void Fastio()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int n, m;
int Dist[100005];
vector <pii> Adj[100005];
priority_queue <pair <int, int>, vector <pii>, greater <pii> > pq;

signed main()
{
	cin >> n >> m;
	Dist[1] = 0;
	for(int i = 2; i <= n; i++)
	{
		Dist[i] = INF;
		Adj[i].eb(mp(i - 1, 0));
	}
	for(int i = 1; i <= m; i++)
	{
		int u, v, w;
		cin >> u >> v >> w;
		Adj[u].eb(mp(v, w));
		Adj[v].eb(mp(u, w));
	}
	pq.push(mp(0, 1));
	while(pq.empty() == false)
	{
		int node = pq.top().se, d = pq.top().fi;
		pq.pop();
		if(d == Dist[node])
		{
			for(auto x : Adj[node])
			{
				if(Dist[x.fi] > x.se + Dist[node])
				{
					Dist[x.fi] = x.se + Dist[node];
					pq.push(mp(Dist[x.fi], x.fi));
				}
			}
		}
	}
	if(Dist[n] == INF)
	{
		Dist[n] = -1;
	}
	cout << Dist[n];
}

Measured memory_bytes: 13304
d[1001],c;main(w,n,i,C,W,b){for(;scanf("%d%d",&w,&n),w;printf("Case %d:\n%d\n%d\n",++c,d[w],b),bzero(d,4004))for(;n--;)for(i=w,scanf("%d,%d",&C,&W);i>=W;i--)d[i]=fmax(d[i],d[i-W]+C),b=d[i]-d[w]?b:i;}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);i++)
#define debug(x) cout<<#x<<"="<<x<<endl;
#define LL long long 
#define pll pair<LL ,LL >
#define fi first
#define se second
using namespace std;
const int MAX=55;
pll pt[MAX];
int xa[MAX];
int ya[MAX];
int main(void)
{
	int n,m;
	scanf("%d%d",&n,&m);
	rep(i,0,n)
	{
		scanf("%lld%lld",&pt[i].fi,&pt[i].se);
		xa[i]=pt[i].fi;
		ya[i]=pt[i].se;
	}
	sort(xa,xa+n);
	sort(ya,ya+n);
	LL mx=1e19; 
	rep(i,0,n)
	{
		rep(j,i,n)
		{
			rep(k,0,n)
			{
				rep(l,k,n)
				{
					int cnt=0;
					rep(tmp,0,n)
					{
						if(pt[tmp].fi>=xa[i]&&pt[tmp].fi<=xa[j]&&pt[tmp].se>=ya[k]&&pt[tmp].se<=ya[l])cnt++;
					}
					if(cnt>=m)mx=min(mx,(xa[j]-xa[i])*1ll*(ya[l]-ya[k]));
				}
			} 
		} 
	}
	printf("%lld",mx);
	return 0;
} 

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int long long
#define inf 1000000007
#define LINF 1000000000000000007LL
#define ll long long
using namespace std;
signed main(){
	int n,l,t;
	cin>>n>>l>>t;
	vector< pair<int,int> > ant;
	for(int i=0;i<n;i++){
		int x,w;
		cin>>x>>w;
		if(w==2)w=-1;
		ant.pb( mp(x,w) );
	}
	vector<int> last;
	for(int i=0;i<n;i++){
		int za = ( ant[i].first + t*ant[i].second + l*inf) % l;
		last.pb(za);
	}
	//for(int i=0;i<last.size();i++)cout<<last[i]<<" "; cout<<endl;
	int onepos = -1;
	if( ant[0].second == 1){
		int cnt = 0;
		vector<int> gyaku;
		for(int i=1;i<n;i++){
			if( ant[0].second != ant[i].second ){
				int sa = ant[i].first - ant[0].first;
				gyaku.pb(sa);
			}
		}
		int tm = 2 * t;
		cnt += (tm/l)*gyaku.size();
		tm = tm%l;
		cnt += upper_bound( gyaku.begin(), gyaku.end(), tm-1 ) - gyaku.begin();
		//cout<<"cnt"<<cnt<<endl;
		onepos = cnt%n;
	}
	else{
		int cnt = 0;
		vector<int> gyaku;
		for(int i=1;i<n;i++){
			if( ant[0].second != ant[i].second ){
				int sa = l + ant[0].first - ant[i].first;
				gyaku.pb(sa);
			}
		}
		reverse( gyaku.begin(), gyaku.end() );
		int tm = 2 * t;
		cnt += (tm/l)*gyaku.size();
		tm = tm%l;
		cnt += upper_bound( gyaku.begin(), gyaku.end(), tm-1 ) - gyaku.begin();
		//cout<<"cnt"<<cnt<<endl;
		onepos = (n-cnt)%n;
	}
	int good = last[0];
	sort(last.begin(),last.end());
	int start;
	if( ant[0].second==1 )start = lower_bound( last.begin(), last.end(), good ) - last.begin();
	else start = upper_bound( last.begin(), last.end(), good ) - last.begin() - 1;
	for(int i=0;i<n;i++){
		cout<<last[ (start-onepos+n+i)%n ]<<endl;
	}
	return 0;
}

Measured memory_bytes: 4592
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
 char c1[2],c2[2];
 int h,m,ic[2],f[2],i,k;
 int g[7][7]={{0,300,500,600,700,1350,1650}, {300,0,350,450,600,1150,1500}, {500,350,0,250,400,1000,1350},
 {600,450,250,0,250,850,1300}, {700,600,400,250,0,600,1150}, {1350,1150,1000,850,600,0,500},{1650,1500,1350,1300,1150,500,0}};
 while(true) {
	 for (i=0;i<2;i++) {
		 cin >> ic[i];
		 if (ic[i]==0) return 0;
		 ic[i]--;
		 cin >> c1 >> c2;
		 h=(c1[0]-'0')*10+(c1[1]-'0');
		 m=(c2[0]-'0')*10+(c2[1]-'0');
		 f[i]=(h==17 && m>29) || (h==18) || (h==19 && m<31);  
		 }
	 k=g[ic[0]][ic[1]];
	 if(k<1350) 
		 if (f[0]+f[1]>0) k=k % 100>0 ? k/2+25:k/2;
	 cout << k << endl;
 }
return 0;
 }

Measured memory_bytes: 1164
#include<iostream>
#include<math.h>

using namespace std;

int main(){

   while(1){
      int D, E;
      cin>> D>> E;
      if(!(D||E)) break;

      double R=1e8;
      for(int i=0; i<=D; i++){
         R=min(R, max(E-sqrt(i*i+(D-i)*(D-i)), sqrt(i*i+(D-i)*(D-i))-E));
      }
      printf("%.15f\n", R);

   }
   return 0;
}

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

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


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

using namespace std;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15);
  }
} initializer;

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  cout << max(min(b, d) - max(a, c), 0) << endl;
}



Measured memory_bytes: 892
# coding=utf-8

###
### for python program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
# print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
# print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
# print(" {}".format(i), end="")

# def printA(A):
#     for i, n in enumerate(A):
#         print(n, end='')
#         if i != N-1:
#             print(' ', end='')
#     print()

# リスト内包表記 ifあり
# [x-k if x != 0 else x for x in C]

# ソート
# N = N.sort()

# 10000個の素数リスト
# P = mymath.pnum_eratosthenes(105000)

def get_input():
    N = []
    while True:
        try:
            N.append(input())
            #N.append(int(input()))
            #N.append(float(input()))
        except EOFError:
            break
    return N

def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

def dist(A, B):
    d = 0
    for i in range(len(A)):
        d += (A[i]-B[i])**2            
    d = d**(1/2)
    return d

S = get_input()

ans = 0

for s in S[1:-1]:
    a = S[0].upper()
    for b in [x for x in s.split()]:
        if a == b.upper():
            ans += 1
    
print(ans)



Measured memory_bytes: 5648
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(int X = 0; X < N; X++)
#define PI (acos(-1.0))
#define sorta(V) sort(V.begin(), V.end())
#define pback push_back
#define mpair make_pair

using namespace std;


int main(){

    ll x,y;
    cin >> x >> y;

    int ans = 0;

    while(x <= y){
        x = x * 2;
        ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256