akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define print(s) cout << s << endl
#define acc(v) accumulate(v.begin(), v.end(), 0)
#define cinv(n, v) rep(i, n) cin >> v[i]
using namespace std;
const int INF = 1e9;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
int x_pos[4] = {1, 0, -1, 0}, y_pos[4] = {0, 1, 0, -1};
int ctoi(char c)
{
	if (c >= '0' && c <= '9')
	{
		return c - '0';
	}
	return 0;
}

char upper(char c)
{
	return c - 0x20;
}

char lower(char c)
{
	return c + 0x20;
}

void unique_vector(vector<int> &v)
{
	sort(all(v));
	v.erase(unique(all(v)), v.end());
}

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val)
{
	std::fill((T *)array, (T *)(array + N), val);
}

//ユークリッドの互除法
//最大公約数
ll gcd(ll x, ll y)
{
	if (y == 0)
		return x;
	return gcd(y, x % y);
}

//最小公倍数
ll lcm(ll x, ll y)
{
	ll g = gcd(x, y);
	return x / g * y;
}

ll myPow(ll x, ll n, ll m)
{
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return myPow(x * x % m, n / 2, m);
	else
		return x * myPow(x, n - 1, m) % m;
}

//素因数分解
map<ll, ll> prime_factor(ll n)
{
	map<ll, ll> ret;
	for (ll i = 2; i * i <= n; i++)
	{
		while (n % i == 0)
		{
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1)
		ret[n] = 1;
	return ret;
}

int main()
{
	int a, b;
	cin >> a >> b;
	cout << (a < 10 && b < 10 ? a * b : -1) << endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
int data[3];
int temp;
for(int i=0;i<3;i++){
cin>>data[i];
}
for(int i=0;i<2;i++){
for(int j=0;j<2-i;j++){
if(data[j]>data[j+1]){
temp=data[j];
data[j]=data[j+1];
data[j+1]=temp;
}
}
}
cout<<data[0]<<' '<<data[1]<<' '<<data[2]<<endl;
return 0;
}

Measured memory_bytes: 3080
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication48
{
    class Program
    {
        static void Main(string[] args)
        {
            double[] a = Console.ReadLine().Split().Select(double.Parse).ToArray();
            double b = a[0] - a[2];
            double c = a[1] - a[3];
            b = b * b;
            c = c * c;
            double d = b + c;
            d = Math.Sqrt(d);
            Console.WriteLine(d);
        }
    }
}

Measured memory_bytes: 9644
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cmath>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main() {
  string s;
  cin >> s;
  bool c = false, f = false;
  rep (i, s.size()) {
    if (s[i] == 'C')
      c = true;
    if (c && s[i] == 'F') {
      f = true;
      break;
    }
  }
  if (c && f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define ENDL '\n'
#define all(a) begin(a), end(a)
#define sz(a) (int)(a.size())
#define deb(a) cout << #a << ": " << a << ENDL
#define fore(i, a, b) for(int i(a), ThkMk(b); i < ThkMk; ++i)
#define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long lli;
typedef long double ld;
typedef unsigned long long ulli;
typedef pair<lli, lli> ii;
typedef vector<lli> vi;

int main()
{   _
    lli n; cin >> n;
    fore(i, 0, n) cout << "ACL";
    return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <string>
#include <cstring>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>
#include <tuple>

using namespace std;
mt19937_64 rng(58);

typedef long long ll;

ll n, k;
ll a[200001];
map<ll, ll> dist;
map<ll, ll> step;

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A>
string to_string(A v) { bool first = true; string res = ""; for (const auto &x : v) { if (!first) res += ", "; first = false; res += to_string(x); } return "{" + res + "}"; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); }
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        a[i]--;
        debug(i, a[i]);
    }
    dist[0] = 0;
    step[0] = 0;
    ll curr = 0;
    while (true) {
        ll next = a[curr];
        debug(curr, next);
        if (dist[curr] + 1 == k) {
            cout << next + 1 << "\n";
            return 0;
        }
        if (dist.find(next) == dist.end()) {
            dist[next] = dist[curr] + 1;
            step[dist[curr] + 1] = next;
            curr = next;
        } else { // found
            ll loop_length = dist[curr] + 1 - dist[next];
            if (loop_length == 0) {
                cout << next - 1 << "\n";
                return 0;
            }
            ll step_next = (k - dist[next]) % loop_length + dist[next];
            debug(loop_length, dist[next], step_next);
            cout << step[step_next] + 1 << "\n";
            return 0;
        }
    }
}

Measured memory_bytes: 24780
#include <iostream>

int main()
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  
  long n;
  std::cin >> n;
  long long p = 0;
  long r = 0;
  for(long i = 0; i < n; ++i)
  {
    long a;
    std::cin >> a;

    if(a > 0)
    {
      a -= r;
      p += r;
    }
    r = a & 1;
    p += a >> 1;
  }
  
  std::cout << p;
      
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int n, a, b, c;
	cin >> n;
	a=n/100;
	b=(n/10)%10;
	c=n%10;
	if(a==7||b==7||c==7){
		cout << "Yes" <<endl;
	}
	else {
		cout << "No" <<endl;
	}
}

Measured memory_bytes: 3624
#include<stdio.h>
int main(void)
{
    while(1){
        int i=0;
        int sum=0;
        char num[1001]={};
        scanf("%s",num);
        if(num[0]-'0'==0){break;}
        while(num[i])
        {
            sum+=num[i]-'0';
            i++;
        }
        printf("%d\n", sum);
    }
    return 0;
}

Measured memory_bytes: 536
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
using namespace std;

int N; map<string,int> M;
void input()
{
    cin>>N;
}

void solve()
{
    for(int i=0;i<N;++i){
        string s; cin>>s; M[s]++;
    }
    cout<<"AC x "<<M["AC"]<<"\n";
    cout<<"WA x "<<M["WA"]<<"\n";
    cout<<"TLE x "<<M["TLE"]<<"\n";
    cout<<"RE x "<<M["RE"]<<endl;
}

int main()
{
    cin.tie();
    ios::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

Measured memory_bytes: 3668
import numpy as np

Q, H, S, D = map(int, input().split())
# values = np.array([min(2*min(2*Q, H), S), D])
# # 評価値
# capacities = np.array([1.0, 2.0])
# eval = values / capacities
N = int(input())
# nums = np.zeros(2)
#
# sorted_eval_index = np.argsort(eval)
#
# # N = 0.25 * Q_n + 0.5 * H_n + 1 * S_n + 2 * D_n
#
# for index in list(sorted_eval_index):
#     if N/capacities[index] >= 1:
#         nums[index] += int(N/capacities[index])
#         N -= nums[index] * capacities[index]
#
# print(int(np.sum(values*nums)))

print(int(int(N/2)*(min(2*min(2*min(2*Q, H), S), D))+(N % 2)*(min(2*min(2*Q, H), S))))

Measured memory_bytes: 12420
n,T = map(int,input().split())
ct = [list(map(int,input().split())) for _ in range(n)]
cost = 9999
for i in range(n):
    c,t = ct[i][0],ct[i][1]
    if t<=T:
        cost = min(cost,c)
print(cost if cost != 9999 else 'TLE')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define SORT(v) sort(v.begin(),v.end())
#define fori(i,a,b) for(ll i=a;i<b;i++)
#define M 1000000007
#define deb(x) cout<< #x << " " << x << endl;

double pi=3.14159265358979323846;

typedef pair<int,int> pii;
typedef pair<long long int, long long int>pll;
typedef vector<int>vi;
typedef vector<long long int>vl;
#define MAXN 10000001
 
int main ()
{
    ll T;
    T=1;
   //cin>>T;
    while(T--)
    {	
    string s,t;
    cin>>s>>t;
    ll c=0;
    fori(i,0,s.length()){if(s[i]!=t[i]){c++;}}
  cout<<c<<endl;
    }
    
  
    
    return 0;
}


Measured memory_bytes: 3852
N, L = int(input()), [int(v) for v in input().split()]
L.sort()
ans = 0
for i in range(N):
    for j in range(i):
        for k in range(j):
            if L[k] != L[j] and L[j] != L[i] and L[k] + L[j] > L[i]:
                    ans += 1

print(ans)

Measured memory_bytes: 9168
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <unordered_map>
using namespace std;


int main() {
	int a;
	cin >> a;
	int hh, mm, ss;
	hh = a / 3600;
	mm = (a % 3600) / 60;
	ss = a % 60;
	cout << hh << ":" << mm << ":" << ss << endl;
}

Measured memory_bytes: 1168
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define qrep(i, q) for(auto i : q)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int maxn = 100005;
const int inf = 0x3f3f3f3f;
ll ans = 0;
int N,M,Q;
int s[maxn], a[maxn], b[maxn], c[maxn];
ll d[maxn];
void dfs(int n, int lim){
	if(n > N){
		ll t = 0;
		rep(i, 0, Q){
			if(s[b[i]]-s[a[i]] == c[i]) t += d[i];
		}
		ans = max(ans, t);
		return;
	}
	rep(i, lim, M+1){
		s[n] = i;
		dfs(n+1, i);
	}
	return;
}
int main()
{
	//std::ios::sync_with_stdio(false);
    //std::cin.tie(0);
	cin >> N >> M >> Q;
	rep(i, 0, Q) cin >> a[i] >> b[i] >> c[i] >> d[i];
	dfs(1, 1);
	cout << ans << endl;
	return 0;
}


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

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

int64_t gcd(int64_t a, int64_t b);
int64_t lcm(int64_t a, int64_t b);

int main(){
  int64_t a, b;
  cin >> a >> b;

  int64_t ans=lcm(a, b);
  cout << ans;
  
}


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

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

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

int main(){
	string str;
	string rev;
	int ans = 0;
	while (cin >> str) {
		rev = str;
		reverse(rev.begin(), rev.end());
		if (str == rev) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
  int n,a,b;
  cin>>n;
  cin>>a>>b;
  int f=0;
  for(int i=a;i<=b;i++){
    if(i%n==0){
      cout<<"OK";
      f=1;
      break;
  //    return 0;
    }
  }
  if(!f)
  cout<<"NG";

}


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

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = ReadLong();
            var num = new long[5];
            for (int i = 0; i < 5; i++)
            {
                num[i] = ReadLong();
            }
            var max = 0L;
            var ans = 0L;
            for (int i = 0; i < 5; i++)
            {
                var cnt = N % num[i] == 0 ? N / num[i] : N / num[i] + 1;
                if (i == 0)
                {
                    ans = cnt;
                    max = cnt;
                }
                else
                {
                    if (num[i] >= num[i - 1])
                    {
                        if (cnt < max)
                        {
                            if ((i + max) > ans) ans = i + max;
                        }
                        else
                        {
                            ans = i + cnt;
                            max = cnt;
                        }
                    }
                    else
                    {
                        if (cnt < max)
                        {
                            if ((i + max) > ans) ans = i + max;
                        }
                        else
                        {
                            ans = i + cnt;
                            max = cnt;
                        }
                    }
                }
            }

            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <sstream>
#include <numeric>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
long long gcd(long long a,long long b){if(a%b==0){return b;}else return gcd(b,a%b);}
long long lcm(long long a,long long b){if(a==0){return b;} return a/gcd(a,b)*b;}
long long MOD; template<class T> void mod(T &n){MOD=n;}
#define sym cout<<"---------"<<endl;
#define ll long long
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl
#define WHITE 1
#define BLACK 2
#define GRAY 1
#define RE return 0
#define int ll

vector<int> plu,minu;

signed main(){
  int n,k; cin>>n>>k;
  
  for(int i=0; i<n; i++){
    int a; cin>>a;
    if(a<0) minu.push_back(abs(a));
    else plu.push_back(a);
  }
  minu.push_back(0);
  plu.push_back(0);
  sort(plu.begin(), plu.end());
  sort(minu.begin(), minu.end());
  
  int ans=INF;
  for(int i=0; i<minu.size(); i++){
    if(k-i+1>plu.size()) continue;
    ans=min(ans,2*minu[i]+plu[k-i]);
  }
  for(int i=0; i<plu.size(); i++){
    if(k-i+1>minu.size()) continue;
    ans=min(ans,2*plu[i]+minu[k-i]);
  }
  cout<<ans<<en;
}



Measured memory_bytes: 1656
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <cstdio>
#include <functional>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
using namespace std;
// #define int long long
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(int i=0;i<(n);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--)
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
const int INF = (((1<<30)-1)<<1)+1;
const int nINF = 1<<31;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<char, int> pci;

/////////////////////////////////////////////////////////////////////

const int N = 1010, M = 1e9+7;
int R, C, a[N][N];
ll dp[N][N];

ll add(ll a, ll b) {return (a+b)%M;}

ll rec(int r, int c) {
	if(r == 0 || c == 0 || a[r][c] == 0) return 0;
	ll& memo = dp[r][c];
	if(memo != -1) return memo;
	ll res = 0;
	res = add(res, rec(r-1, c));
	res = add(res, rec(r, c-1));
	return memo = res;
}

signed main() {
    ios::sync_with_stdio(false);
    //cout << fixed << setprecision(7);
    memset(dp, -1, sizeof(dp));
    dp[1][1] = 1;
    cin >> R >> C;
    FOR(i, 1, R) {
    	FOR(j, 1, C) {
    		char ch;
    		cin >> ch;
    		a[i][j] = (ch != '#');
    	}
    }
    cout << rec(R, C) << endl;

    return 0;
}

// Easy things to check:
// - LONG LONGS (WA)
// - const int N is correct (WA, RTE)
// - .size()-k underflow (WA, RTE, TLE)
// - small n edge cases (WA)

// Rare mistakes made in the past:
// - division by 0 (WA)
// - integer division (WA)
// - setprecision (WA)
// - INF not big enough using ll (WA)
// - setting min to 0 instead of -INF (WA)
// - outputting debug (WA)
// - allocating too much memory (locRTE, MLE)
// - stack size (locRTE)


Measured memory_bytes: 12288
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
#include <string.h>
#include <numeric>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(i,v) for(auto &(i):(v))
#define eachr(i,v) for(auto &(i)=(v).rbegin();(i)!=(v).rend();(i)++)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define endl "\n"

//typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
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;}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
    oreno_initializer() {
        cin.tie(0);
        ios::sync_with_stdio(0);
    }
} oreno_initializer;



int n, m, l, r, s[200200], res;

signed main() {
    cin >> n >> m;
    rep(i,m) {
        cin >> l >> r;
        s[l]++, s[r+1]--;
    }
    reps(i,1,n+1) {
        s[i] += s[i-1];
        if (s[i]==m) res++;
    }
    cout << res << endl;
}


Measured memory_bytes: 640
module Main where

import Data.List
import Control.Monad
import Debug.Trace
import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)


readTuple2 :: IO (Int, Int)
readTuple2 = do
    [a, b] <- map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
    return (a, b)

readTuple3 :: IO (Int, Int, Int)
readTuple3 = do
    [a, b, c] <- map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
    return (a, b, c)

readInt :: IO Int
readInt = fst . fromJust . BC.readInt <$> BC.getLine

readInts :: IO [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

split :: (a -> Bool) -> [a] -> [[a]]
split f [] = []
split f as = let
    (fo, la) = span f as
    las = case la of
        [] -> []
        xs -> split f $ tail xs
    in
        case fo of
            [] -> las
            xs -> xs : las
    

main = do
    n <- readInt
    print $ 180 * (n - 2)


Measured memory_bytes: 380
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	scanf("%d",&n);
	int tmp,tp,ans;
	tp=n%1000;
	tmp=n/1000;
	if(tp!=0){
		ans=(tmp+1)*1000-n;
	} 
	else ans=0;
	printf("%d",ans);
}

Measured memory_bytes: 3824
MAX_LEN = 1001
c = Array.new(MAX_LEN) { Array.new MAX_LEN }
gets.to_i.times do
  x, y = gets.chomp.chars, gets.chomp.chars
  m, n = x.size, y.size
  for i in 0..m
    c[i][0] = 0
  end
  for j in 0..n
    c[0][j] = 0
  end
  for i in 1..m
    for j in 1..n
      a, b = c[i][j - 1], c[i - 1][j]
      c[i][j] = (a > b ? a : b)
      if x[i - 1] == y[j - 1]
        c[i][j] = c[i - 1][j - 1] + 1
      end
    end
  end
  p c[m][n]
end


Measured memory_bytes: 14764
x, y = map(int, input().split())

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9 + 7
N = 10**6+1
g1 = [1, 1] #
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


if (x + y) % 3 == 0:
    count = (x+y)//3
    x -= count
    y -= count
    ans = 0
    if x >= 0 and y >= 0:
        print(cmb(x+y, x, mod))
    else:
        print(0)

else:
    print(0)


Measured memory_bytes: 123896
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const int INF=1e9;
typedef pair<int,int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
vector<vector<bool>> used(21,vector<bool>(50001,false));
vector<vector<int>> mem(21,vector<int>(50001));
 vector<int> A;
int N,M;

int dfs(int i,int j){
    if(j==N)return 0;
    if(i==M||j>N)return INF;
    if(used.at(i).at(j))return mem.at(i).at(j);
    used.at(i).at(j)=true;
    int a=dfs(i,j+A.at(i))+1;
    int b=dfs(i+1,j);
    return mem.at(i).at(j)=min(a,b); 
}


int main(){
  cin>>N>>M;
  A.resize(M);
  for(int i=0;i<M;i++){
      cin>>A.at(i);
  }
 int ans=dfs(0,0);
  cout<<ans<<endl;
}


Measured memory_bytes: 9432
#include <iostream>

void DisableIOSync() {
	std::cin.tie(0);
	std::cout.tie(0);
	std::ios::sync_with_stdio(false);
}
int main() {
	DisableIOSync();
	std::string str;
	std::getline(std::cin, str);

	const int L = str.length();
	std::string res;
	res.resize(L/2+1);
	auto* ptr = const_cast<char*>(res.data());
	auto* src = str.c_str();
	bool flag = true;
	for(;;) {
		const auto c = *src++;
		if(c == 0)
			break;
		if(flag)
			*ptr++ = c;
		flag ^= 1;
	}
	res.resize(ptr - res.data());
	std::cout << res << std::endl;
	return 0;
}


Measured memory_bytes: 576
#include<cstdio>
using namespace std;
long long i,j,n,m,add,mo;
int main()
{
	scanf("%lld",&m);
	puts("50");
	add=m/50;
	mo=m%50;
	if (!mo)
	{
		for (i=1;i<=50;++i)
			printf("%lld ",49+add);
		return 0;
	}
	for (i=1;i<=50-mo;++i)
		printf("%lld ",50-mo-1+add);
	for (i=1;i<=mo;++i)
		printf("%lld ",50-mo+i+add);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
main(){
    int K, A, B; cin >> K >> A >> B;
    if (B-A<=2){
        cout << K+1;
        exit(0);
    }
    int ans = A;
    K -= (A-1);
    ans += (K/2) * (B-A);
    ans += K%2;
    cout << ans;
}


Measured memory_bytes: 256
#include <stdio.h>

int main() {
  int H,N,judge=0;
  scanf("%d %d",&H,&N);
  int A[N];
  for(int i=0;i<N;i++) {
    scanf("%d",&A[i]);
  }
  for(int i=0;i<N;i++) {
    H-=A[i];
    if(H<=0) {
      printf("Yes");
      judge++;
      break;
    }
  }
  if(judge==0) {
    printf("No");
  }
  return 0;
}

Measured memory_bytes: 2036
def d_MixingExperiment(N, Ma, Mb, Medicine):
    # 解説通り
    INF = float('inf')
    A = []
    B = []
    C = []
    for a, b, c in Medicine:
        A.append(a)
        B.append(b)
        C.append(c)
    a_max = max(A)
    b_max = max(B)
    dp = [[[INF for k in range(N * b_max + 1)]
           for j in range(N * a_max + 1)] for i in range(N + 1)]
    dp[0][0][0] = 0
    for i in range(N):
        for ca in range(N * a_max + 1):
            for cb in range(N * b_max + 1):
                if dp[i][ca][cb] == INF:
                    continue
                dp[i + 1][ca][cb] = min(dp[i + 1][ca][cb], dp[i][ca][cb])
                dp[i + 1][ca + A[i]][cb + B[i]
                                     ] = min(dp[i + 1][ca + A[i]][cb + B[i]], dp[i][ca][cb] + C[i])
    ans = INF
    for ca in range(1, N * a_max + 1):
        for cb in range(1, N * b_max + 1):
            if ca * Mb == cb * Ma:
                ans = min(ans, dp[N][ca][cb])
    if ans == INF:
        ans = -1
    return ans

N,Ma,Mb=[int(i) for i in input().split()]
Medicine=[[int(i) for i in input().split()] for j in range(N)]
print(d_MixingExperiment(N, Ma, Mb, Medicine))

Measured memory_bytes: 59984
#

import sys
from collections import deque
from itertools import combinations_with_replacement
input=sys.stdin.readline

def main():
    N,M,Q=map(int,input().split())
    g=[i for i in range(1,M+1)]
    abcds=[tuple(map(int,input().split())) for i in range(Q)]
    maxp=0
    for A in combinations_with_replacement(g, N):
        p=0
        for abcd in abcds:
            if A[abcd[1]-1]-A[abcd[0]-1]==abcd[2]:
                p+=abcd[3]
        maxp=max(maxp,p)
    print(maxp)
    
    
if __name__=="__main__":
    main()


Measured memory_bytes: 9376
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
  cin>>s;
  long long int cnt=0;
  map<char,int>m;
  char c='1';
  for(int i=1;i<=10;i++)
  {
    m[c]=i;
    c+=1;
  }
  for(int i=0;i<s.size();i++)
  {
    cnt+=m[s[i]];
  }
  if(cnt%9==0)
    cout<<"Yes";
  else
    cout<<"No";
	return 0;
}


Measured memory_bytes: 3728
#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 X first
#define Y second
#define all(x) x.begin(), x.end()
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
	enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
	ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
	*this << "[";
	for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

const int mod = (int)1e9 + 7;
const int MX = (int)1e5 + 10;

void add_self(int &x, int y){x += y; if(x >= mod) x -= mod;}
void sub_self(int &x, int y){x -= y; if(x < 0) x += mod;}
void mul(int &x, int y){x = x * 1LL * y % mod;}

int main(){

	cin.tie(0); cout.tie(0);
	ios_base::sync_with_stdio(0);
	
	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	for(auto &x : a) cin >> x;

	double res = 0;
	double cur = 0;
	for(int i = 0; i < n; ++i){
		if(i >= k) cur -= (a[i - k] + 1) / 2.0;
		cur += (a[i] + 1) / 2.0;
		if(i + 1 >= k) res = max(res, cur);
	}

	cout << fixed << setprecision(10) << res << endl;

	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
    using namespace std;
    signed main(){
    double a,b,c,d;
    int e=0;
    cin>>a>>b>>c>>d;
    if(a/2==c&&b/2==d){
    e=1;
    }
    a=a*b;
    c=c*d;
    cout<<a/2<<" "<<e<<"\n";
    return(0);
    }


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
struct china
{
	int q;
	int h;
}p[100010];
int cam1(china x,china y)
{
	return x.q<y.q;
}
int cam2(china x,china y)
{
	return x.h<y.h;
}
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)cin>>p[i].q;
	sort(p,p+n,cam1);
	for(int i=0;i<n-1;i++)
	{
		if(2*p[i].q>p[n-1].q)p[i].h=p[n-1].q-p[i].q;
		else p[i].h=p[i].q;
	}
	p[n-1].h=p[n-1].q;
	sort(p,p+n,cam2);
	cout<<p[n-1].q<<" "<<p[n-2].q;
	return 0;
} 

Measured memory_bytes: 1024
H, W = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(H)]

result = []
y = 0
while y < H:
    x = 0
    while x < W:
        if a[y][x] % 2 == 1:
            if x == W - 1:
                if y == H - 1:
                    break
                else:
                    result.append('%d %d %d %d' % (y + 1, x + 1, y + 2, x + 1))
                    a[y + 1][x] += 1
            else:
                result.append('%d %d %d %d' % (y + 1, x + 1, y + 1, x + 2))
                a[y][x + 1] += 1
        x += 1
    if y == H - 1:
        break
    y += 1
    x = W - 1
    while x >= 0:
        if a[y][x] % 2 == 1:
            if x == 0:
                if y == H - 1:
                    break
                else:
                    result.append('%d %d %d %d' % (y + 1, x + 1, y + 2, x + 1))
                    a[y + 1][x] += 1
            else:
                result.append('%d %d %d %d' % (y + 1, x + 1, y + 1, x))
                a[y][x - 1] += 1
        x -= 1
    y += 1

print(len(result))
print('\n'.join(result))
#print(*result, sep='\n')


Measured memory_bytes: 24164
def segfunc(x,y):return min(x,y)
ide_ele=10**18
class segtree():
  def __init__(self,init_val,segfunc,ide_ele):
    n=len(init_val)
    self.segfunc=segfunc
    self.ide_ele=ide_ele
    self.num=1<<(n-1).bit_length()
    self.tree=[ide_ele]*2*self.num
    for i in range(n):
      self.tree[self.num+i]=init_val[i]
    for i in range(self.num-1,0,-1):
      self.tree[i]=self.segfunc(self.tree[2*i], self.tree[2*i+1])
  def query(self,l,r):
    res=self.ide_ele
    l+=self.num
    r+=self.num+1
    while l<r:
      if l&1:
        res=self.segfunc(res,self.tree[l])
        l+=1
      if r&1:
        res=self.segfunc(res,self.tree[r-1])
      l>>=1
      r>>=1
    return res
n,x=map(int,input().split())
a=list(map(int,input().split()))
a+=a
st=segtree(a,segfunc,ide_ele)
ans=10**18
for k in range(n):
  cnt=k*x
  for i in range(n):
    cnt+=st.query(i,i+k)
  ans=min(ans,cnt)
print(ans)

Measured memory_bytes: 75548
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#define ll long long
#define ull unsigned long long
using namespace std;


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

	int h, w;
	cin >> h >> w;
	vector<vector<char>> V(h, vector<char>(w));
	vector<vector<int>> DP(h, vector<int>(w));
	
	for (auto &a : V) for (char &c : a) cin >> c;
	for (int i = 0; i < w && V.at(0).at(i) != '#'; i++){
		DP.at(0).at(i) = 1;
	}
	for (int i = 0; i < h && V.at(i).at(0) != '#'; i++){
		DP.at(i).at(0) = 1;
	}
	int mod = 1e9 + 7;
	for (int i = 1; i < h; i++){
		for (int j = 1; j < w; j++){
			if (V.at(i).at(j) == '.'){
				DP.at(i).at(j) = (DP.at(i - 1).at(j) + DP.at(i).at(j - 1)) % mod;
			}
		}
	}

	cout << DP.back().back();

	return 0;
}


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

using namespace std;

template <class T>inline T updmax(T& a, T b) {return a = max(a, b);}
template <class T>inline T updmin(T& a, T b) {return a = min(a, b);}

class Solution {
public:
	void solve() {
		int n;
		cin >> n;
		
		vector<int> a(n, 0);
		vector<int> b(n, 0);
		vector<int> c(n, 0);
		for(int i=0; i<n; i++)cin >> a[i];
		for(int i=0; i<n; i++)cin >> b[i];
		for(int i=0; i<n-1; i++)cin >> c[i];
		int ret = 0;
		for(int i=0; i < n; i++){
			ret += b[i];
			if(i != 0 && a[i] == a[i-1] + 1){
				ret+=c[a[i]-2];
			}
		}
		cout << ret << "\n";
		
		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

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

int main(){
  int n; cin >> n; int w[n], sum=0, sum2=0, an=1e9;
  for(int i=0; i<n; i++) {cin >> w[i]; sum+=w[i];}
  for(int i=0; i<n; i++) {sum2 += w[i]; an = min(an, abs(sum-2*sum2));};
  cout << an << endl;
}

Measured memory_bytes: 256
def calc(a, y, o)
  results = o.map do |soc, air, aoc|
    r = a
    if soc == 0
      i = 0
      y.times do
        i += (r * air).to_i
        r -= aoc
      end
      r += i
    else
      y.times do
        r += (r * air).to_i - aoc
      end
    end
    r
  end
  results.max
end
gets.to_i.times do
  a = gets.to_i
  y = gets.to_i
  o = []
  gets.to_i.times do
    l = gets.split
    o.push([l[0].to_i, l[1].to_f, l[2].to_i])
  end
  puts calc(a, y, o)
end

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

#define gc( ) std::getchar( )
#define pc( i ) std::putchar( i )
#define space ' '
#ifdef ONLINE_JUDGE
#define enter '\n'
#else
#define enter std::endl
#endif
#define RE cout << "Passing [" << __FUNCTION__ << "] on " << __LINE__ << enter
#define DEBUG(...) for( auto &i: __VA_ARGS__ ) cout << i << " "; cout << enter
using std::make_pair;

template < typename T >
inline T read( )
{
 T x = 0;
 char ch = gc( );
 bool f = 0;
 while( !std::isdigit( ch ) )
 {
  f = ( ch == '-' );
  ch = gc( );
 }
 while( std::isdigit( ch ) )
 {
  x = x * 10 + ( ch - '0' );
  ch = gc( );
 }
 return f ? -x : x;
}

template < typename T >
void print( T x )
{
 if( x < 0 )
 {
  x = -x;
  pc( '-' );
 }
 if( x < 10 )
 {
  pc( x + 48 );
  return;
 }
 print < T > ( x / 10 );
 pc( x % 10 + 48 );
 return ;
}

namespace Solution
{
#define IOS std::ios::sync_with_stdio( false ), std::cin.tie( 0 ), std::cout.tie( 0 )
#define Rep( i, j, k ) for( int i = j; i >= k; --i )
#define rdi( ) read < int > ( )
#define rdl( ) read < long long > ( )
#define pti( i ) print < int > ( i ), putchar( space )
#define ptl( i ) print < long long > ( i ), putchar( space )
#define For( i, j, k ) for( int i = j; i <= k; ++i )
 using std::cin;
 using std::cout;
 using std::endl;
 using std::vector;
 using std::map;
 using std::queue;
 using std::deque;
 using std::set;
 using std::pair;
 const int N = 5005, mod = 1e9 + 7;
 int n, k, a[ N ], f[ N ];
 void Fakemain( )
 {
  IOS;
  cin >> n >> k;
  For( i, 1, n )
   cin >> a[ i ];
  std::sort( a + 1, a + 1 + n, std::less < int > ( ) );
  int ans = n;
  f[ 0 ] = 1;
  Rep( i, n, 1 )
  {
   Rep( j, k - 1, 0 )
   {
    if( f[ j ] && j + a[ i ] >= k )
     ans = std::min( i - 1, ans );
    if( j >= a[ i ] )
     f[ j ] |= f[ j - a[ i ] ];
   }
  }
  cout << ans; 
  return;
 }

} // namespace Solution

int main( int argc, char* argv[] )
{
 Solution::Fakemain( );
 return 0;
}

Measured memory_bytes: 3688
#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 MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;

int main(){
    int n;cin>>n;
    vector<int> a(n+1);
    ll sum=0;
    rep(i,n+1){
        cin >> a[i];
        sum += a[i];
    }
    //cout << sum << endl;
    vector<int> b(n);
    rep(i,n) cin >> b[i];
    ll ans = 0;
    rep(i,n){
        if(b[i]>=a[i]){
            b[i] -= a[i];
            a[i] = 0;
            //cout << "e1" << endl;
            //cout << b[i] << endl;
            if(b[i]>0){
                if(b[i]-a[i+1]>=0){
                    //cout << "e2" << endl;
                    a[i+1] = 0;

                }else{
                    //cout << "e3" << endl;
                    a[i+1] -= b[i];
                }
            }
        }
        else{
            //cout << "e4" << endl;
            a[i] -= b[i];
            b[i] = 0;
        }
    }
    ll sum2=0;
    rep(i,n+1){
        sum2 += a[i];
    }
    //cout << endl;
    //cout << sum2 << endl;
    cout << sum - sum2 << endl;
}

Measured memory_bytes: 1024
import java.util.*;
public class Main {
	public static void main(String[] args)
	{
		//変数
		int count=0;
		boolean sw=false;
		//int answer=0;
		long answer=0;
		//double answer=0;
		//String answer="NO";
		//List<Integer> h=new ArrayList<Integer>();
		//int af=Integer.MAX_VALUE;
		long K=0;
		long A=0;
		long B=0;
		int max=0;
		int min=0;
		int sum=0;
		long e=0;
		long f=0;
		long g=0;
		long h=0;
		//int sub=0;
		//int a=0;
		//int t[]=new int[(int)Math.pow(10,5)];
		
		//入力
		Scanner sc = new Scanner(System.in);
		K=sc.nextInt();
		A=sc.nextInt();
		B=sc.nextInt();
		//X=sc.nextDouble();
		//for(int i=0;i<3;i++)
		//{
		//	a[i]=sc.nextInt();
		//}
		//String S=sc.next();
		
		//処理
		if(B-A<2)
		{
			answer=K+1;
			//System.out.println("c1");
		}else if(A>=K)
		{
			answer=K+1;
			//System.out.println("c2");
		}else
		{
			e=A-1;
			f=(K-e)/2;
			g=(K-e)%2;
			h=B-A;
			answer=1+e+(f*h)+g;
		}
		
		// 出力
		//System.out.println(Arrays.toString(X))
		//System.out.println(Arrays.deepToString(td));
		System.out.println(answer);
	}
}

Measured memory_bytes: 22740
#include<cstdio>
#include<queue>
using namespace std;
int main() {
    int n,cur=2,x;
    long long ans;
    scanf("%d",&n);
    scanf("%lld",&ans);
    ans--;
    for(int i=1;i<n;i++) {
        scanf("%d",&x);
        if(x==cur) cur++;
        else ans+=x/cur-(x%cur==0);
    }
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using VI = vector<int>;
using VVI = vector<VI>;
const lint MOD = 1e9 + 7;
int N;
string s;
VVI dp(5010, VI(5010));

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  cin >> N >> s;
  dp[0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j <= i + 1; j++) {
      dp[i + 1][j] = ((j != 0 ? dp[i][j - 1] : dp[i][j]) + 2LL * dp[i][j + 1]) % MOD;
    }
  }
  cout << dp[N][s.size()] << '\n';
  return 0;
}

Measured memory_bytes: 98560
#include<cstdio>
#include<cstring>
#include<cctype>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;
int read(){
    char c;int s=0,t=1;
    while(!isdigit(c=getchar()))if(c=='-')t=-1;
    do{s=s*10+c-'0';}while(isdigit(c=getchar()));
    return s*t;
}
/*------------------------------------------------------------*/
const int inf=0x3f3f3f3f;
const char p[]={'Y','A','K','I'};
int n;
char s[20];

int main(){
    scanf("%s",s);
    bool ok=1;
    if(strlen(s)<4)ok=0;else
    for(int i=0;i<4;i++)if(s[i]!=p[i])ok=0;
    if(ok)printf("Yes");else printf("No");
    return 0;
}

Measured memory_bytes: 256
ans = [0] * 100100
ans[0] = 0

n = int(input())
#n = 127
for i in range(1,n+1):
    cand1 = ans[i-1]
    cand2 = 100001
    cand3 = 100001
    x = 6
    while (x<=i):
        cand2 = min(ans[i-x], cand2)
        x=6*x
    y = 9
    while (y<=i):
        cand3 = min(ans[i-y], cand3)
        y=9*y
    ans[i] = min(cand1,cand2,cand3) + 1


print(ans[n])


Measured memory_bytes: 3828
using System;

namespace Watch
{
    class Program
    {
        static int[] Div(int a, int b)
        {
            return new int[2] { a / b, a % b };
        }

        static void Main(string[] args)
        {
            int i = int.Parse(Console.ReadLine());
            int[] _t = Div(i, 60 * 60);
            int h = _t[0];
            int[] _m = Div(_t[1], 60);
            Console.WriteLine("{0}:{1}:{2}", h, _m[0], _m[1]);
        }
    }
}

Measured memory_bytes: 9180
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
//        sc.useDelimiter("\n");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        
        String s = sc.next();
        pw.println(s.equals("AAA") || s.equals("BBB") ? "No" : "Yes");
        
        pw.flush();
    }
}

Measured memory_bytes: 21844
import java.util.*;

import static java.lang.System.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();

        int[] A = new int[M];
        int[] B = new int[M];
        for (int i = 0; i < M; i++) {
            A[i] = sc.nextInt();
            B[i] = sc.nextInt();
        }

        // UnionFindTreeを使うため、橋を増やしていくことを考える
        UnionFindTree tree = new UnionFindTree(N+1);
        long[] ans = new long[M];
        ans[M-1] = (long)N*(N-1)/2;
        for(int m = M-1; m >= 1; m--){
            if(!tree.same(A[m], B[m])) {
                ans[m-1] = ans[m] - (long)tree.size(A[m]) * tree.size(B[m]);
                tree.union(A[m], B[m]);
            } else {
                ans[m-1] = ans[m];
            }
        }

        for(int i = 0; i < M; i++) {
            out.println(ans[i]);
        }
    }
}

// https://gist.github.com/keitin/e5ba4ba4ccd6cd3afb3485c5ea85846c#file-union-find-java
class UnionFindTree {
    int[] parent; //インデックスとノードを対応させ、そのルートノードのインデックスを格納
    int[] size;   //インデックスとノードを対応させ、同じグループに属する頂点数を格納
    int[] rank;   //parentと同様に、木の高さを格納

    public UnionFindTree(int size) {
        this.parent = new int[size];
        this.size = new int[size];
        this.rank = new int[size];

        for (int i = 0; i < size; i++) {
            makeSet(i);
        }
    }

    public void makeSet(int i) {
        parent[i] = i;
        size[i] = 1;
        rank[i] = 0; //集合の高さ
    }

    public void union(int x, int y) {
        int xRoot = find(x);
        int yRoot = find(y);

        //xが属する木の方が大きい場合
        if (rank[xRoot] > rank[yRoot]) {
            parent[yRoot] = xRoot; //yの親をxに更新
            size[xRoot] = size[xRoot] + size[yRoot];
        } else if(rank[xRoot] < rank[yRoot]) {
            parent[xRoot] = yRoot;
            size[yRoot] = size[xRoot] + size[yRoot];
        } else if (xRoot != yRoot){
            parent[yRoot] = xRoot;
            rank[xRoot]++; //同じ高さの木がルートの子として着くから大きさ++;
            size[xRoot] = size[xRoot] + size[yRoot];
        }
    }

    //引数の属する木のルートのidを返す
    public int find(int i) {
        if (i != parent[i]) {
            parent[i] = find(parent[i]);
        }
        return parent[i];
    }

    //引数の属する木のサイズを返す
    public int size(int i){
        if(i != parent[i]){
            size[i] = size(find(i));
        }
        return size[i];
    }

    //同じ木に属しているか
    public boolean same(int x, int y) {
        return find(x) == find(y);
    }
}


Measured memory_bytes: 91572
a,b,c,x,y = map(int,input().split())
ab = 2*c
if ab < a+b:
    if x <= y:
        print(min(c*2*(max(x,y)),ab*x+b*(y-x)))
    else:
        print(min(c*2*(max(x,y)),ab*y+a*(x-y)))
else:
    print(a*x+b*y)

Measured memory_bytes: 9120
import java.util.*;

public class Main {

    static int NOT_FOUND = 99999999;
    static int M = 1046527;

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Integer[] intArr = new Integer[M];
        for (int i = 0; i < n; i++) {
            String command = sc.next();
            String value = sc.next();
            if (command.equals("insert")) {
                insert(intArr, toInt(value));
            } else {
                if (search(intArr, toInt(value)).equals(NOT_FOUND)) {
                    System.out.println("no");
                } else {
                    System.out.println("yes");
                }
            }

        }
    }

    static int getChar(char ch) {
        if (ch == 'A') {
            return 1;
        } else if (ch == 'C') {
            return 2;
        } else if (ch == 'G') {
            return 3;
        } else if (ch == 'T') {
            return 4;
        } else {
            return 0;
        }
    }

    static int toInt(String s) {
        int sum = 0;
        char[] arr = s.toCharArray();
        for (int i = 0; i < arr.length; i++) {
            sum += Math.pow(5, i) * getChar(arr[i]);
        }
        return sum;
    }

    static int h1(int key) {
        return key % M;
    }

    static int h2(int key) {
        return 1 + (key % (M - 1));
    }

    static int h(int key, int i) {
        return (h1(key) + i * h2(key)) % M;
    }

    static int insert(Integer[] arr, int key) {
        int i = 0;
        while (true) {
            int j = h(key, i);
            if (arr[j] == null) {
                arr[j] = key;
                return j;
            } else {
                i++;
            }
        }
    }

    static Integer search(Integer[] arr, int key) {
        int i = 0;
        while (true) {
            int j = h(key, i);
            if (arr[j] == null || i >= M) {
                return NOT_FOUND;
            } else if (key == arr[j]) {
                return j;
            } else {
                i++;
            }
        }
    }

}



Measured memory_bytes: 294028
# coding: utf-8
# Your code here!
n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
pos = []
for i in range(2**n):
    a = 0
    for j in range(n):
        if ((i>>j)&1):
            a += A[j]
    pos.append(a)
for m in M:
    if m in pos:
        print('yes')
    else:
        print('no')


Measured memory_bytes: 43084
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <map>
#include <set>
#include <cstring>
#include <string>
#include <cctype>
#include <cassert>
#include <queue>
#include <complex>

using namespace std;

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,b,e) for(int i = (b); i <= (e); i++)
#define INF (1001001001)
#define EPS (1e-15)

#define pr(x) do{cerr << (#x) << " = " << (x) << endl;}while(0)
#define pri(x,i) do{cerr << (#x) << "[" << i << "] = " << (x[i]) << endl;}while(0)
#define pra(x,n) rep(__i,n) pri(x,__i);
#define prar(x,b,e) repr(__i,b,e) pri(x,__i);

typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;

ll MOD = 998244353;

int in() {
	int a;
	scanf("%d ", &a);
	return a;
}

int main() {
	int N = in();
	typedef complex<double> P;
	vector<P> a(N);
	rep(i,N) {
		int x = in();
		int y = in();
		a[i] = P(x, y);
	}
	
	vector<ll> twop(220);
	twop[0] = 1;
	repr(i,1,210)twop[i] = twop[i-1] * 2 % MOD;
	
	vector<ll> hoge(220);
	rep(i,210) {
		if (i < 3) hoge[i] = 0;
		else hoge[i] = (twop[i] - 1 - i - i * (i - 1) / 2 + MOD) % MOD;
	}
	
	vint cnt(N+10);
	rep(p,N) {
		vint found(N);
		repr(q,p+1,N-1) {
			P l = a[q] - a[p];
			int temp = 2;
			repr(r,q+1,N-1) {
				if (found[r]) continue;
				P m = a[r] - a[p];
				if (l.imag() * m.real() == l.real() * m.imag()) {
					temp++;
					found[r] = 1;
				}
			}
			if (temp >= 3) {
				cnt[temp]++;
			}
		}
	}
	for (int i = 3; i < 201; i++) pri(cnt, i);
	for (int i = 200; i >= 3; i--) {
		for (int k = i - 1; k >= 3; k--) {
			cnt[k] -= cnt[i];
		}
	}
	for (int i = 3; i < 201; i++) pri(cnt, i);
	
	ll ans = hoge[N];
	for (int i = N; i >= 3; i--) {
		ans = (ans - cnt[i] * hoge[i]);
		while (ans < 0) ans += MOD;
	}
	
	if (N <= 2) ans = 0;
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main() {
	int i;
	char string[101];
	scanf("%s", string);
	printf("%c", string[0]);
	for (i = 1; i<101; i++) {
		if (string[i] == '\0') break;
	}
	printf("%d", i-2);
	printf("%c\n", string[i - 1]);
	return 0;
}

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

int main() {
    int i,n;
    int m=0,mm=0;
    int *a;
    int *flag;
    cin >> n;
    a=new int[n];
    for (i=0;i<n;i++){
        cin >> a[i];
        m=max(m,a[i]);
    }
    flag=new int[m+2];
    for (i=0;i<n;i++){
       if(a[i]==0) {
           flag[a[i]]++;
           flag[a[i]+1]++;
       }
       else {
           flag[a[i]-1]++;
           flag[a[i]]++;
           flag[a[i]+1]++;
       }
    }
    for (i=0;i<m+2;i++)mm=max(mm,flag[i]);
    cout << mm <<endl;
    return 0;
}

Measured memory_bytes: 1024