akhauriyash/Code-Regression huggingface dataset:
import sys

# 実行環境(0:vscode, 1:atcoder)
MODE = 1

# 入力の次元
DIMENSION = 1

# int型に変換
INT_TYPE = 0

if not (MODE):
    with open("input.txt", "r") as f:
        s = f.read()
else:
    s = sys.stdin.read()

if DIMENSION == 0:
    if INT_TYPE == 1:
        s = int(s)
elif DIMENSION == 1:
    if INT_TYPE == 0:
        s = s.split()
    elif INT_TYPE == 1:
        s = [int(x) for x in s.split()]
elif DIMENSION == 2:
    if INT_TYPE == 0:
        s = [x.split() for x in s.splitlines()]
    elif INT_TYPE == 1:
        s = [[int(y) for y in x.split()] for x in s.splitlines()]

A = int(s[0])
B = s[1].split(".")
if len(B) == 1:
    B_x = int(B[0])
    print(A * B_x)
else:
    B_x = int(B[0])
    B_y = int(B[1])
    print(A * B_x + A * B_y // 100)


Measured memory_bytes: 9196
#include <iostream>

using namespace std;

#define N 8
#define FREE 0
#define NOT_FREE -1

bool BOARD[N][N] = { false };
int C_COL[N], C_ROW[N], C_DIAGONAL_L[2*N], C_DIAGONAL_R[2*N];

void printBoard() {
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (BOARD[i][j])
        if (C_ROW[i] != j) return;
    }
  }

  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      cout << (C_ROW[i] == j ? 'Q' : '.');
    }
    cout << endl;
  }
}

void solve(int i) {
  if (i == N) {
    printBoard();
    return;
  }

  for (int j = 0; j < N; j++) {
    if (C_COL[j] == NOT_FREE ||
        C_DIAGONAL_L[i+j] == NOT_FREE ||
        C_DIAGONAL_R[i-j+N-1] == NOT_FREE
        ) continue;

    C_ROW[i] = j;
    C_COL[j] = C_DIAGONAL_L[i+j] = C_DIAGONAL_R[i-j+N-1] = NOT_FREE;

    solve(i+1);

    C_ROW[i] = C_COL[j] = C_DIAGONAL_L[i+j] = C_DIAGONAL_R[i-j+N-1] = FREE;
  }

  //cout << "no solution for input" << endl;
  
}

int main() {
  for (int i = 0; i < N; i++) {
    C_COL[i] = C_ROW[i] = FREE;
    C_DIAGONAL_L[i] = C_DIAGONAL_R[i] = FREE;
    C_DIAGONAL_L[2*i] = C_DIAGONAL_R[2*i] = FREE;
  }
  
  int k; cin >> k;
  while (k--) {
    int r, c; cin >> r >> c;
    BOARD[r][c] = true;
  }

  solve(0);
}

Measured memory_bytes: 1152
#pragma region ヘッダー
#define _CRT_SECURE_NO_WARNINGS

#ifdef _____MY_DEBUG_____
#define VS_ENDPAUSE()	(system("pause"))
#define DEBUG_OUT(...)  (printf(__VA_ARGS__))
#else
#define VS_ENDPAUSE()
#define DEBUG_OUT(...)
#endif

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <math.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;
typedef signed char int8;
typedef signed short int16;
typedef signed int int32;
typedef signed long long int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;
#define int int64

#ifndef INT8_MIN
#define INT8_MIN	(-127)
#endif
#ifndef INT8_MAX
#define INT8_MAX	( 128)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX	( 255)
#endif
#ifndef INT16_MIN
#define INT16_MIN	(-32768)
#endif
#ifndef INT16_MAX
#define INT16_MAX	( 32767)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX	( 65535)
#endif
#ifndef INT32_MIN
#define INT32_MIN	(-2147483648)	// -2 * 10^9
#endif
#ifndef INT32_MAX
#define INT32_MAX	( 2147483647)	//  2 * 10^9
#endif
#ifndef UINT32_MAX
#define UINT32_MAX	( 4294967295)	//  4 * 10^9
#endif
#ifndef INT64_MIN
#define INT64_MIN	(-9223372036854775808)	// -9 * 10^18
#endif
#ifndef INT64_MAX
#define INT64_MAX	( 9223372036854775807)	//  9 * 10^18
#endif
#ifndef UINT64_MAX
#define UINT64_MAX	( 18446744073709551615)	// 18 * 10^18
#endif

void func(void);
#pragma endregion

int32 main(void)
{
    func();
    VS_ENDPAUSE();
    return 0;
}

void func(void)
{
//DEBUG_OUT("----\n");
    uint32 N;
    cin >> N;
    uint32 a = N/100;
    uint32 b = N%10;
    if(a==b){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return;
}



Measured memory_bytes: 256
import Control.Monad

main :: IO ()
main = do
    [a, b] <- getInts
    print $ if a - b == 0 then a + b else 2 * (max a b) - 1

getLines :: Int -> IO [String]
getLines n = replicateM n getLine

getLinesInt :: Int -> IO [Int]
getLinesInt n = fmap read <$> getLines n

getInts :: IO [Int]
getInts = map (read :: String -> Int) . words <$> getLine

Measured memory_bytes: 508
#include <bits/stdc++.h>
#define ll long long
#define maxn 200005 /*rem*/
#define mod 998244353
#define db double
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define fi first
#define se second
using namespace std;
ll ksm(ll a, ll b) {
   if (!b) return 1;
   ll ns = ksm(a, b >> 1);
   ns = ns * ns % mod;
   if (b & 1) ns = ns * a % mod;
   return ns;
}
struct nt {
	int ans;
	unordered_map<int, int> fa;
	unordered_map<int, int> fl;
	vector<pi> eg; 
	nt(){ans = 0;}
	int gfa(int a) {
		if (fa[a] == a) return a;
		return fa[a] = gfa(fa[a]);
	}
	void lk(int u, int v) {
		if (!fa[u]) fa[u] = u;
		if (!fa[v]) fa[v] = v;
		int uf = gfa(fa[u]), vf = gfa(fa[v]);
		if (uf == vf && fl[uf]) return ;
		eg.pb(mp(u, v));
		if (uf != vf && fl[uf] && fl[vf]) ans--;
		if (uf == vf) fl[uf] = 1;
		else {
			fa[uf] = vf;
			if (fl[uf]) fl[vf] = 1;
		}
		ans++; 
	}
};
vi eg[maxn];
int u[maxn], v[maxn];
int ans[maxn];
nt th[maxn];
void dfs(int a, int fa) {
	th[a].lk(u[a], v[a]);
//	cout << a << ' ' << th[a].ans << endl;
	for (auto x : eg[a]) {
		if (x == fa) continue;
		else {
			dfs(x, a);
			if (th[x].eg.size() > th[a].eg.size())
				swap(th[a], th[x]);
			for (auto q : th[x].eg)
				th[a].lk(q.fi, q.se);
		}
	}
	ans[a] = th[a].ans;
}
int main() {
	int n, k;
	cin >> n >> k;
	for (int i = 1; i < n; i++) {
		int x, y;
		scanf("%d%d", &x, &y);
		eg[x].pb(y), eg[y].pb(x); 
	}
	for (int i = 1; i <= n; i++)
		scanf("%d%d", &u[i], &v[i]);
	dfs(1, 0);
	for (int i = 1; i <= n; i++)
		printf("%d\n", ans[i]);
	return 0;
}



Measured memory_bytes: 157220
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
 
namespace ConsoleApplication13
{
    class Program
    {
        static void Main(string[] args)
        {
			int a =0;
			int[] b = new int[10];
			for
			(int c =0;c<10;c++)
			{b[c]= int.Parse(Console.ReadLine());
             a+=b[c];
}
Console.WriteLine(a);
}}}

Measured memory_bytes: 9052
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long m = sc.nextLong();
        long v = sc.nextLong();
        int p = sc.nextInt();
        long[] a = new long[n];
        
        Map<Long, Long> map = new HashMap<Long, Long>();
        
        for(int i = 0; i < n; i++){
            long tmp = sc.nextLong();
            a[i] = tmp;
            if(map.containsKey(tmp)){
                map.put(tmp,map.get(tmp)+1);
            }else{
                map.put(tmp,(long)1);
            }
        }
        Arrays.sort(a);
        long border = a[n-p];
        for(int i = 1; i < n; i++){
            a[i] += a[i-1];
        }
        Object[] mapkey = map.keySet().toArray();
        Arrays.sort(mapkey);
        
        long[] arr = new long[mapkey.length];
        arr[0] = (long)mapkey[0] * map.get((long)mapkey[0]);
        for(int i = 1; i < mapkey.length; i++){
            arr[i] = arr[i-1] + (long)mapkey[i] * map.get((long)mapkey[i]);
        }
        
        long backCnt = 0;
        for(int i = 0; i < mapkey.length; i++){
            long tmp = (long)mapkey[i];
            if(tmp+m < border){
                backCnt += map.get(tmp);
                continue;
            }else{
                long back = backCnt + map.get(tmp);
                long remPoint = Math.max(0,m*(v-(back + p-1)));
                if(n-p+1-back <= 0){
                    break;
                }
                long average = (a[n-p]-a[(int)(back-1)]+remPoint) / (n-p+1-back);
                if((a[n-p]-a[(int)(back-1)]+remPoint) % (n-p+1-back) != 0){
                    average += 1;
                }
                //System.out.println(tmp +" "+ (n-p+1-back) +" "+average + " " + (tmp + m) + " " + remPoint + " " + (a[n-p]-a[(int)(back-1)]+remPoint) );
                if(average > tmp+m){
                    backCnt += map.get(tmp);
                    continue;
                }else{
                    break;
                }
            }
            
        }
        System.out.println(n-backCnt);
    }
}
 

Measured memory_bytes: 72076
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acos(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memset(x,-1,sizeof(x))
#define MEM(x) memset(x,0,sizeof(x))
#define less Less
#define EPS 1e-4
#define arg ARG
#define cpdd const pdd
#define rank Rank
#define KK 500
#define N 100005
#define MXN 200005
int main(){
    char c[10005];
    scanf("%s",c);
    int n=0,s=0,e=0,w=0;
    for(int i = 0;c[i]!=0;i++){
        if(c[i]=='N')n=1;
        if(c[i]=='S')s=1;
        if(c[i]=='E')e=1;
        if(c[i]=='W')w=1;
    }
    if(n==s&&e==w){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<cctype>
#define ld long double
#define ll long long int
#define ull unsigned long long int
using namespace std;
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;}
const long long INF=1LL<<60;
//set<int>::iterator it;



int main(void){
	ios::sync_with_stdio(false); cin.tie(0);
	
	ll a,b,c;
	cin>>a>>b>>c;
	if(a%2==0||b%2==0||c%2==0){
		cout<<0<<endl;
		return 0;
	}
	cout<<min(a*b,min(a*c,b*c))<<endl;
	
	
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include<cctype>
 
int main(){
  char ch;
 
  while(1){
    scanf("%c", &ch);
    if( isalpha(ch) ){
      if( islower(ch) ) printf("%c", toupper(ch));
      else printf("%c", tolower(ch));
    } else printf("%c", ch);
 
    if( ch == '\n' ) break;
  }
   
  return 0;
}

Measured memory_bytes: 2688
n = gets.strip.to_i
nums = gets.strip.split(' ').map(&:to_i)

if nums.group_by(&:itself).all?{|k,v| k ==0 ? v.count==1 : v.count==2}
  c = 2 ** (nums.size / 2)
  puts c % (10 ** 9 + 7)
else
  puts 0
end

Measured memory_bytes: 15620
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
struct edge{ll to,cost;};
const int inf = 1<<28;
const ll INF = 1LL<<53;
const int COMBMAX = 500005;
const ll MOD = 1e9+7;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<n;++i)
#define repf(i,n) for(int i=0;i<=n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define eachdo(v, e) for(const auto& e : v)
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (ll)distance(v.begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (ll)distance(v.begin(), upper_bound((v).begin(), (v).end(), e))
ll mpow(ll a, ll n,ll mod=MOD){ll res=1;while(n>0){if(n&1)res=res*a%mod;a=a*a%mod;n>>=1;}return res;}
template<class T1, class T2> ll bcount(T1 v, T2 a){return upper_index(v,a)-lower_index(v,a);} 
template<class T> bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
template<class T> void debug2(T v){rep(i,v.size()){rep(j,v[i].size())cout<<v[i][j]<<" ";cout<<endl;}}
template<class T> void rdv(T &v){rep(i,v.size())cin>>v[i];}
template<class T> void rdvv(T &v){rep(i,v.size()){rep(j,v[i].size())cin>>v[i][j];}}

int main(){
    string S;cin >> S;
    ll Q ; cin >> Q;
    string be = "",af = "";
    ll cnt = 0;
    rep(i,Q){
        ll qu;cin >> qu;
        if (qu==1){
            cnt = (cnt + 1)%2;
        }else{
            ll g;cin >> g;
            string c;cin >> c;
            if ((g-1+cnt)%2==0){
                be += c;
            }else{
                af += c;
            }
        }
    }
    string ans ="";
    if (cnt == 0){
        reverse(all(be));
        ans += be;
        ans += S;
        ans += af;
    }else{
        reverse(all(S));
        reverse(all(af));
        ans += af;
        ans += S;
        ans += be;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1348
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

int pi[2333];

int main()
{
	int n,x,y; scanf("%d%d%d",&n,&x,&y);
	for(int i=1; i<n; i++) for(int j=i+1; j<=n; j++)
	{
		int sum=j-i;
		sum=min(sum,abs(i-x)+1+abs(y-j));
		sum=min(sum,abs(i-y)+1+abs(x-j));
		pi[sum]++;
	}
	for(int i=1; i<n; i++) printf("%d\n",pi[i]);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    int min=100000;
    for(int i=0;i<n;i++){
        int num=v[i];
        int r=num%2;
        int cnt=0;
        while(r==0){
            num/=2;
            r=num%2;
            cnt++;
        }
        if(min>cnt){
            min=cnt;
        }
    }
    cout<<min<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <vector>

using namespace std;

typedef struct {
    int x;
    int y;
    int num;
} Point;

typedef struct {
    int location;		// P?????????????????????
    int l;			// ???????????????????????????
    int r;			// ???????????????????????????
} Node;

bool sortByX(const Point &left, const Point &right)
{
    return ( left.x < right.x );
}

bool sortByY(const Point &left, const Point &right)
{
    return ( left.y < right.y );
}

#define MAX_N (500010)
#define NIL (-1)

Point P[MAX_N];
Node T[MAX_N];
int n;
int q;
int np;

int make2DTree(int l, int r, int depth)
{
    if ( l >= r ) return NIL;
    int mid = (l + r) >> 1;
    int t = np++;

    if ( (depth % 2) == 0 ) {		// x??§?????????
	sort(P + l, P + r, sortByX);
    }
    else {			// y??§?????????
	sort(P + l, P + r, sortByY);
    }

    T[t].location = mid;
    T[t].l = make2DTree(l, mid, depth + 1);
    T[t].r = make2DTree(mid + 1, r, depth + 1);

    return t;
}


void find(int v, int sx, int tx, int sy, int ty, int depth, vector<int> &ans)
{
    Point a = P[T[v].location];
    int x = a.x;
    int y = a.y;
    int num = a.num;

    if ( sx <= x && x <= tx && sy <= y && y <= ty ) {
	ans.push_back(num);
    }

    if ( (depth % 2) == 0 ) {
	if ( T[v].l != NIL ) {
	    if ( sx <= x ) { 
		find(T[v].l, sx, tx, sy, ty, depth + 1, ans);
	    }
	}

	if ( T[v].r != NIL ) {
	    if ( x <= tx ) {
		find(T[v].r, sx, tx, sy, ty, depth + 1, ans);
	    }
	}
    }
    else {
	if ( T[v].l != NIL ) {
	    if ( sy <= y ) { 
		find(T[v].l, sx, tx, sy, ty, depth + 1, ans);
	    }
	}

	if ( T[v].r != NIL ) {
	    if ( y <= ty ) {
		find(T[v].r, sx, tx, sy, ty, depth + 1, ans);
	    }
	}
    }
}


int main()
{
    scanf("%d", &n);

    for ( int i = 0; i < n; i++ ) {
	Point a;
	scanf("%d %d", &a.x, &a.y);
	a.num = i;
	P[i] = a;
	T[i].l = T[i].r = T[i].location = NIL;
    }

    np = 0;

    int root = make2DTree(0, n, 0);

    for ( int i = 0; i < n; i++ ) {
	Point a = P[T[i].location];
    }

    scanf("%d", &q);

    for ( int i = 0; i < q; i++ ) {
	int sx, tx, sy, ty;
	vector<int> ans;

	scanf("%d %d %d %d", &sx, &tx, &sy, &ty);

	find(root, sx, tx, sy, ty, 0, ans);

	sort(ans.begin(), ans.end());
	
	for ( int j = 0; j < ans.size(); j++ ) {
	    printf("%d\n", ans[j]);
	}

	printf("\n");
    }
    
    return 0;
}

Measured memory_bytes: 12596
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,s,f) for(i=s;i<f;i++)
#define db cout<<'h'<<'i'<<endl 
#define pb push_back
#define pii pair<int,int>
#define F first
#define S second
#define B begin()
#define E end()
#define vi vector<int>
#define vii vector<pair<int,int>>
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define PI 3.14159265
#define mod 1000000007
#define mod2 998244353
#define space 100005
//<<fixed << setprecision(9)

int main()
{
    int n,i,j,t;
    boost;

    cin>>n;
    int arr[n];
    rep(i,0,n)cin>>arr[i];

    int cur=0,ans=0;
    for(i=n-2;i>=0;i--)
    {
        if(arr[i]>=arr[i+1])
        {
            cur++;
        }
        else
        {
            cur=0;
        }
        ans=max(ans,cur);
    }

    cout<<ans;
    return 0;
}



Measured memory_bytes: 640
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(N: int, K: int, S: int):
    ans = [S]*K
    ans.extend([10**9-1]*(N-K))

    print(' '.join(map(str, ans)))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    S = int(next(tokens))  # type: int
    solve(N, K, S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 12668
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include<numeric>
#include<cmath>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
using pll = pair<ll,ll>;
using vvii = vector<vector<int> >;
using vvll =  vector<vector<ll> >;
const ll mod = 1e9 + 7;
const int max_r = 1000000;

const ll inf = 1LL << 60;

struct mint{
    ll x;
    mint(ll x = 0): x((x % mod + mod)%mod){}

    
    mint& operator+=(const mint a){
        if((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a){
        if((x += mod-a.x) >= mod)  x -= mod;
        return *this;
    }
    mint& operator*=(const mint a){
        (x *= a.x) %= mod;
        return *this;
    }
    
    mint operator+(const mint a) const{ //クラスのメンバを変更しない
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const{ //クラスのメンバを変更しない
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const{ //クラスのメンバを変更しない
        mint res(*this);
        return res*=a;
    }

    mint pow(ll n)const{
        if(n == 0)return 1;
        mint a = pow(n>>1);
        a *= a;
        if(n & 1)a *= (*this);
        return a;
    }

    mint inv() const{
        return pow(mod-2);
    }
    mint& operator/=(const mint a){
        return (*this) *= a.inv();
    }
    mint operator/(const mint a)const{
        mint res(*this);
        return res/=a;
    }
    
};

ostream& operator<<(ostream &os, const mint &m){
    os << m.x;
    return os;
}

struct Combination{
    vector<mint> fact,ifact;
    Combination(int n): fact(n+1),ifact(n+1){
        fact[0] = 1;
        for(int i = 1; i<=n; i++)fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for(int i = n; i>= 1; i--){
            ifact[i-1] = ifact[i] * i;
        }
    }

    mint comb(int n, int k){
        if(k < 0 || n < k)return 0;
        return fact[n]*ifact[k]*ifact[n-k];
    }
};

int main(){
    cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
    int r1,r2,c1,c2;
    cin >> r1 >> c1 >> r2 >> c2;
    mint ans = 0;
    Combination C(2*max_r + 10);
    ans = C.comb(r2+c2+2, r2+1) - C.comb(r2+c1+1, r2+1) - C.comb(r1+c2+1, r1) + C.comb(r1+c1, r1);
    cout << ans << endl;
}

Measured memory_bytes: 34572
#include<stdio.h>
#include<math.h>
int main(void){
  int n,j;
  scanf("%d",&n);
  int a[n],b[n],i;
  double ans=0;
  for(i=0;i<n;i++){
  scanf("%d%d",&a[i],&b[i]);
  }
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
       ans+=sqrt(pow(a[i]-a[j],2)+pow(b[i]-b[j],2));
    }
  }
  printf("%f",ans*2/n);
  return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

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

    x *= 2;
    y *= 2;

    int result = numeric_limits<int>::max();
    irep(k, max(x, y))
    {
        int i = max(0L, (x - k + 1) / 2), j = max(0L, (y - k + 1) / 2);
        int cost = a * i + b * j + c * k;
        result = min(result, cost);
    }
    cout << result << endl;

    return 0;
}

Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0

for i in range(A+1):
    a = i * 500
    for j in range(B+1):
        b = j * 100
        for k in range(C+1):
            c = k * 50
            if a + b + c == X:
                ans += 1

print(ans)


Measured memory_bytes: 3060
#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
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; }
template<typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define print(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define print(...)
#endif

ll dp[1000001][2];

int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

	string N; cin >> N;
	N.insert(N.begin(), '0');

	rep(i, N.size()+1) rep(j, 2) dp[i][j] = LLINF;
	dp[0][0] = 0;
	rep(i, N.size()){
		int d = N[i] - '0';
		rep(j, 2){
			rep(k, 2){
				if(dp[i][j] == LLINF) continue;
				if(j == 0 && k == 0){
					chmin(dp[i+1][k], dp[i][j] + d);
				}
				else if(j == 0 && k == 1){
					chmin(dp[i+1][k], dp[i][j] + d+1);
				}
				else if(j == 1 && k == 0){
					chmin(dp[i+1][k], dp[i][j] + (10 - d));
				}
				else if(j == 1 && k == 1){
					chmin(dp[i+1][k], dp[i][j] + (9 - d));
				}
			}
		}
	}

	ll ans = LLINF;
	chmin(ans, dp[N.size()][0]);
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 17028
N = int(input())
dic = dict()
for i in range(N):
    S = input()
    if S in dic:
        dic[S] += 1
    else:
        dic[S] = 1
    Start  = S[0]
    if i != 0:
        if Start != End or dic[S] > 1:
            print("No")
            exit()
    End = S[len(S)-1]
print("Yes")

Measured memory_bytes: 9176
import java.util.*;
class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int[] a = new int[N];
        for(int i = 0; i < N; i++){
            a[i] = sc.nextInt() + 1;
        }

        int count = 0;
        if( N > 2){
            for(int i = 0; i < N - 3; i++){
                if(a[i] == a[i+1]){
                    a[i+1] = (a[i+2] + 1)  % 10000; 
                    count++;
                }
            }
            if(a[N-3] == a[N-2] || a[N-2] == a[N-1]){
                count++; 
            }
        }
        else{
            if(a[0] == a[1]){
                count = 1;
            }
        }

        System.out.println(count);


    }
}

Measured memory_bytes: 23508
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int main()
{
    int N, D; cin >> N >> D;
    vector<vector<int>> X(N, vector<int>(D));
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < D; j++) {
            cin >> X[i][j];
        }
    }
    int ans = 0;
    for (int i = 0; i < N; i++) {
        for (int j = i + 1; j < N; j++) {
            Int d2 = 0;
            for (int k = 0; k < D; k++) {
                d2 += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]);
            }
            Int d = sqrt(d2);
            if (d * d == d2) {
                ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
// Nihesh Anderson - knandy

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; // find_by_order, order_of_key
ll MOD=1000000007;

#define endl '\n'
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
ll INF = 2000000000000000001;
long double EPS = 1e-9;
ll power(ll a, ll n, ll md){if(n==0){return 1;}else{int res=power(a,n/2,md);res=(res*res)%md;if(n%2!=0){res=(res*a)%md;}return res;}}
random_device rndm;
mt19937 grndm(rndm());
void mix(int* a, int* b){shuffle(a,b,grndm);}

int main(){
	fast_cin();
	// freopen("input.in","r",stdin);
	// freopen("output.out","w",stdout);
	int x; cin >> x;
	cout << 1 - x << endl;
	return 0;
}




















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

int H, W;
bool grid[55][55];

void island(int h, int w) {
  grid[h][w] = 0;

  for(int i = -1; i <= 1; ++i) {
    for(int j = -1; j <= 1; ++j) {
      if(i == 0 && j == 0) continue;
      int nh = h + i;
      int nw = w + j;
      if(0 <= nh && nh < H && 0 <= nw && nw < W && grid[nh][nw]) island(nh, nw);
    }
  }
}

int main(){
  while(true) {
    cin >> W >> H;
    if(W == 0 && H == 0) break;

    for(int i=0; i < H; ++i) 
      for(int j=0; j < W; ++j) cin >> grid[i][j];

    int ans = 0;
    for(int i=0; i < H; ++i) {
      for(int j=0; j < W; ++j) {
        if(grid[i][j]) {
          island(i,j);
          ++ans;
        }
      }
    }
    cout << ans << '\n';
  }

  return 0;
}


Measured memory_bytes: 3264
#include<stdio.h>


int main()
{   int r,g,b;
    scanf("%d %d %d",&r,&g,&b);
    int p=r*100+g*10+b;
    if(p%4==0){
        printf("YES\n");

    }else{
    printf("NO\n");

    }


    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define endl '\n'

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

	int n, w;
	cin >> n >> w;
	ll dp[n+1][w+1] = {}, wi, vi;

	for(int i=1; i<=n; i++)
	{
		cin >> wi >> vi;
		for(int j=0; j<wi; j++)
			dp[i][j] = dp[i-1][j];
		for(int j=wi; j<=w; j++)
			dp[i][j] = max( dp[i-1][j] , vi + dp[i-1][j-wi] );
	}
	cout << dp[n][w];
	return 0;
}

Measured memory_bytes: 79104
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.nextLine();
		int[][] x = new int[Integer.valueOf(N.split(" ")[0]) + 1][2];
		String M = sc.nextLine();
		int i = 1;
		for (String y : M.split(" ")) {
			x[i][0] = Integer.valueOf(y);
			i++;
		}
		int e = Integer.valueOf(N.split(" ")[1]);
		HashMap<Integer, List<Integer>> map = new HashMap<Integer, List<Integer>>();
		while (e-- > 0) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			
			setEdge(map, a, b);
		}
		for (int j = 1; j < x.length; j++) {
			List<Integer> l = map.get(j);
			if (l != null) {
				for (int k : l) {
					if (x[j][0] > x[k][0]) {
						x[k][1] = -1;
					} else {
						x[j][1] = -1;
					}
				}
			}
		}
		i = 0;
		for (int j = 1; j < x.length; j++) {
			if(x[j][1] != -1) {
				i++;
			}
		}
		System.out.println(i);

	}

	public static void setEdge(HashMap<Integer, List<Integer>> map, int a, int b) {
		List<Integer> l = map.get(a);
		if (l != null) {
			l.add(b);
			map.put(a, l);
		} else {
			l = new ArrayList<Integer>();
			l.add(b);
			map.put(a, l);
		}
		
		List<Integer> l1 = map.get(b);
		if (l1 != null) {
			l1.add(a);
			map.put(b, l1);
		} else {
			l1 = new ArrayList<Integer>();
			l1.add(a);
			map.put(b, l1);
		}
	}

}


Measured memory_bytes: 86064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int>ad[100005];
bool vis[100005];
map<int,int>mp[100005];
ll maxi=0;
void dfs(int node, int par)
{
    vis[node]=true;
    int chld;
    int x=mp[node][par];
    int j=1;
    for (int i=0;i<ad[node].size();i++)
    {
        chld=ad[node][i];
        if (vis[chld])
            continue;
        if (j!=x && vis[chld]==false)
        {
            mp[node][chld]=j;
            mp[chld][node]=j;
        }
        else if (vis[chld]==false)
        {
            mp[node][chld]=j+1;
            mp[chld][node]=j+1;
            j++;
        }

        j++;
    }

    for (int i=0;i<ad[node].size();i++)
    {
        chld=ad[node][i];
        if (vis[chld]==false)
        {
            vis[chld]=true;
            dfs(chld,node);
        }
    }

    //cout<<node<<endl;
    return ;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin>>n;
    int x[100005],y[100005];
    for (int i=0;i<n-1;i++)
    {
        cin>>x[i]>>y[i];
        ad[x[i]].push_back(y[i]);
        ad[y[i]].push_back(x[i]);
        maxi=max(maxi, (ll) ad[x[i]].size());
        maxi=max(maxi, (ll) ad[y[i]].size());
    }
    dfs(1,0);
    //cout<<mp[1][2]<<mp[2][1]<<endl;
    cout<<maxi<<endl;
    for (int i=0;i<n-1;i++)
    {
        cout<<mp[x[i]][y[i]]<<endl;
    }
    return 0;
}


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

#define rep(i, a, b) for (ll i = (a); i < (b); i++)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

const char UNDEF=-1;
signed main() {
    ll N;
    string s;
    cin>>N>>s;

    rep (k,0,4){
        // 羊=1, オオカミ=0
        vector<ll> ans(N, UNDEF);
        switch(k){
            case 0: ans[0]=1; ans[1]=1; break;
            case 1: ans[0]=1; ans[1]=0; break;
            case 2: ans[0]=0; ans[1]=1; break;
            case 3: ans[0]=0; ans[1]=0; break;
        }
        rep(i,2,N){
            if (ans[i-1] && s[i-1]=='o') ans[i] = ans[i-2];
            else if (ans[i-1] && s[i-1]=='x') ans[i] = 1-ans[i-2];
            else if (!ans[i-1] && s[i-1]=='o') ans[i] = 1-ans[i-2];
            else ans[i]=ans[i-2];
        }

        bool valid=true;
        rep(i,0,N){
            if      ( ans[(i+1)%N]  && s[(i+1)%N]=='o' && ans[i] == ans[(i+2)%N]) ;
            else if ( ans[(i+1)%N]  && s[(i+1)%N]=='x' && ans[i] != ans[(i+2)%N]) ;
            else if (!ans[(i+1)%N]  && s[(i+1)%N]=='o' && ans[i] != ans[(i+2)%N]) ;
            else if (!ans[(i+1)%N]  && s[(i+1)%N]=='x' && ans[i] == ans[(i+2)%N]) ;
            else
                valid=false;
        }
        if (!valid)
            continue;
        rep(i,0,N){
            cout<<(ans[i]==1?"S":"W");
        }
        cout<<endl;
        return 0;
    }
    cout<<-1<<endl;
    return 0;
}


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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if(b-a==c-b) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int _b=(b),i=(a);i<=_b;++i)
#define ROF(i, b, a) for(int _a=(a),i=(b);i>=_a;--i)
#define REP(n) for(int _n=(n);_n--;)
#define _1 first
#define _2 second
#define PB(x) push_back(x)
#define SZ(x) int((x).size())
#define ALL(x) (x).begin(), (x).end()
#define MSET(m,v) memset(m,v,sizeof(m))
#define MAX_PQ(T) priority_queue<T>
#define MIN_PQ(T) priority_queue<T,vector<T>,greater<T>>
#define IO(){ios_base::sync_with_stdio(0);cin.tie(0);}
#define cint1(a) int a;cin>>a
#define cint2(a,b) int a,b;cin>>a>>b
#define cint3(a,b,c) int a,b,c;cin>>a>>b>>c
typedef long long int ll; typedef pair<int,int> PII;typedef unsigned long long int ull;
typedef vector<int>VI; typedef vector<ll> VL; typedef vector<PII> VP;
template<class A,class B>inline bool mina(A &x,const B &y){return(y<x)?(x=y,1):0;}
template<class A,class B>inline bool maxa(A &x,const B &y){return(x<y)?(x=y,1):0;}
string s;
int n;
ll ans = 0;

void solve(int x, ll y) {
	if (x == n) {
		ans += y;
		return;
	}
	ll cur = 0;
	FOR(i, x, n - 1) {
		cur = cur * 10 + (s[i] - '0');
		solve(i+1, y+cur);
	}
}



int main() {
	IO();
	cin >> s;
	n = s.size();
	solve(0, 0);
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef pair<double,int> P;
int main(){
  P p;
  vector<P> v,v2;
  int i,j,k;
  for(j=0;j<3;j++){
    for(i=0;i<8;i++){
      cin >> p.second >> p.first; 
      v.push_back(p);
    }
    sort(v.begin(),v.end());
    printf("%d %.2f\n",v[0].second,v[0].first);
    printf("%d %.2f\n",v[1].second,v[1].first);
    for(i=2;i<8;i++) v2.push_back(v[i]);
    v.clear();
  }
  sort(v2.begin(),v2.end());
  printf("%d %.2f\n",v2[0].second,v2[0].first);
  printf("%d %.2f\n",v2[1].second,v2[1].first);
  return 0;
}

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

const int N = (int) 1e5 + 10;
const int inf = (int) 2e9 + 10;

long long arr[N];
int n;

int bs(long long s, int lo) {
    int ret = -1, hi = n, mid;
    while (lo <= hi) {
        mid = (lo + hi) / 2;
        if (arr[mid] < s) {
            ret = mid;
            lo = mid + 1;
        } else {
            hi = mid - 1;
        }
    }
    return ret;
}

int main() {
//    freopen("in.txt", "r", stdin);
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        scanf("%lld", &arr[i]);
    }
    sort(arr + 1, arr + 1 + n);
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
        for (int j = i + 1; j <= n; j++) {
            int indx = bs(arr[i] + arr[j], j + 1);
            if (indx > j) {
                ans += indx - j;
            }
        }
    }
    printf("%lld\n", ans);
    return 0;
}


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

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

sort(a,a + N, greater<int>());
int Alice = 0;
int Bob = 0;
for(int i = 0;i < N; ++i){
if(i % 2 == 0){
Alice += a[i];
}else{
Bob += a[i];
}
}
cout << Alice - Bob << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define double long double
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define sp(p) cout<<setprecision(16)<<fixed<<p<<endl;
#define debug(x) cerr<<#x<<": "<<x<<endl;
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define rsort(a) sort(all(a),greater<>())
#define debg(a) cout<<#a<<" "<<a<<endl;
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
template<class T>inline int out(const T &t){ print(t); putchar('\n'); return 0; }
template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> V;
const long long MOD=1000000007;
const long long INF = 1e18;
clock_t time_ini = clock();
double time_diff(){
  ll time_tmp = clock();
  const double time = static_cast<double>(time_tmp - time_ini) / CLOCKS_PER_SEC * 1000.0;
  return time;
}
#define saiaku if(time_diff() > 1990)
vector <ll> dp;

const string YES = "Yes";
const string NO = "No";

void solve(long long N, std::vector<long long> t, std::vector<long long> x, std::vector<long long> y){
    bool flg = false;
    for (ll i = 0; i < N; i++) {
        // ll dt = t[i] + t[i-1];
        ll dt = (i ? t[i] - t[i-1] : t[i]);
        // ll d = x[i] + y[i];
        ll d = (i ? abs(x[i] - x[i-1]) + abs(y[i] - y[i-1]) : abs(x[i]) + abs(y[i]));
        if (d <= dt && ((dt%2) == (d%2)) ) {
            flg = true;
        } else {
            flg = false;
            break;
        }
    }
    cout << (flg ? YES : NO) << "\n";
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> t(N);
    std::vector<long long> x(N);
    std::vector<long long> y(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&t[i]);
        scanf("%lld",&x[i]);
        scanf("%lld",&y[i]);
    }
    solve(N, std::move(t), std::move(x), std::move(y));
    return 0;
}


Measured memory_bytes: 2560
import java.util.Scanner;

public class Main{
	static int cnt = 0;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[]A = new int[n];
		for(int i = 0; i < n; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();

		bubbleSort(A, n);
		disp(A, n);
		System.out.println(cnt);
	}
	static void bubbleSort(int[]A, int n) {
		boolean flag = true;
		while(flag) {
			flag = false;
			for(int i = n - 1; i >= 1; i--) {
				if(A[i] < A[i - 1]) {
					int t = A[i];
					A[i] = A[i - 1];
					A[i - 1] = t;
					flag = true;
					cnt ++;
				}
			}
		}
	}
	static void disp(int[]A, int n) {
		for(int i = 0; i < n; i++) {
			if(i == n - 1) {
				System.out.println(A[i]);
			}else {
				System.out.print(A[i] + " ");
			}
		}
	}
}


Measured memory_bytes: 26400
class BinomialCoefficient:
    def __init__(self, N, mod):
        '''
        Preprocess for calculating binomial coefficients nCr (0 <= r <= n, 0 <= n <= N)
        over the finite field Z/(mod)Z.
        Input:
            N (int): maximum n
            mod (int): a prime number. The order of the field Z/(mod)Z over which nCr is calculated.
        '''
        self.mod = mod
        self.fact = {i: None for i in range(N+1)}                # n!
        self.inverse = {i: None for i in range(1, N+1)}      # inverse of n in the field Z/(MOD)Z
        self.fact_inverse = {i: None for i in range(N+1)} # inverse of n! in the field Z/(MOD)Z
        
        # preprocess
        self.fact[0] = self.fact[1] = 1
        self.fact_inverse[0] = self.fact_inverse[1] = 1
        self.inverse[1] = 1
        for i in range(2, N+1):
            self.fact[i] = i * self.fact[i-1] % self.mod
            q, r = divmod(self.mod, i)
            self.inverse[i] = (- (q % self.mod) * self.inverse[r]) % self.mod
            self.fact_inverse[i] = self.inverse[i] * self.fact_inverse[i-1] % self.mod
    
    def binom(self, n, r):
        if n < r or n < 0 or r < 0:
            return 0
        else:
            return self.fact[n] * (self.fact_inverse[r] * self.fact_inverse[n-r] % self.mod) % self.mod
        
N, A, B, K = map(int, input().split())
MOD = 998244353

ans = 0
bc = BinomialCoefficient(N, MOD)
for red, i in [(A*i, i) for i in range(N+1)]:
    if K < red:
        break
    j, rem = divmod(K - red, B)
    if rem == 0:
        ans += (bc.binom(N, i) * bc.binom(N, j)) % MOD
        ans = ans % MOD
print(ans)

Measured memory_bytes: 137952
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(){
    char ste[4];
    scanf("%s",ste);
    if (strcmp(ste,"AAA")==0 || strcmp(ste,"BBB")==0)
    {
        printf("No");
    }else{
        printf("Yes");
    }
    
    return 0;
    
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
using namespace std;

typedef long long ll;


int main() {
	int n; cin >> n;
	vector<int> a(n + 2);
	for (int i = 0; i < n; i++) cin >> a[i];
	a[n] = 0;
	int r = -1, curr = 0, curl = 0;
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		while (curr == curl && r < n) {
			r++;
			curr ^= a[r];
			curl += a[r];
		}
		ans += r - i;
		curr ^= a[i];
		curl -= a[i];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <stack>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 28)
template<typename T>
void remove(vector<T>& vector, unsigned int index){
vector.erase(vector.begin() + index);
}
vector<string> split(const string &s, char c);
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void){
    int N, A;
    cin >> N >> A;

    cout << N*N-A << endl;

    return 0;
}

int StrToInt(string s){
    stringstream ss;
    ss << s;
    int val;
    ss >> val;
    return val;
}
string IntToStr(int i){
    stringstream ss;
    ss << i;
    return ss.str();
}

vector<string> split(const string &s, char delim) {
    vector<string> elems;
    string item;
    for (int i = 0; i < s.size(); i++) {
        char ch = s[i];
        if (ch == delim) {
            if (!item.empty())
                elems.push_back(item);
            item.clear();
        }
        else {
            item += ch;
        }
    }
    if (!item.empty())
        elems.push_back(item);
    return elems;
}


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


int R;

int main() {
    cin >> R;
    if (R < 1200) cout << "ABC" << endl;
    else if (1200 <= R && R < 2800) cout << "ARC" << endl;
    else cout << "AGC" << endl;
    return 0;
}

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> count(N);
  for (int i = 0; i < M; i++) {
    int L1, L2;
    cin >> L1 >> L2;
    for (int j = 0; j < N; j++) {
      if (j + 1 == L1) count.at(j)++;
      if (j + 1 == L2) count.at(j)++;
    }
  }
  for (int i = 0; i < N; i++) cout << count.at(i) << endl;
}


Measured memory_bytes: 256
n = int(input())
List = list(map(int,input().split()))
odd = [1 for _ in range(n)]
for item in List:
  if item % 2 == 0:
    odd.append(2)
  else:
    odd.append(1)
odd_factor = 1
for item in odd:
  odd_factor *= item
Answer = 3**n -odd_factor
print(Answer)

Measured memory_bytes: 3188
#include <cmath>
#include <cstdio>
#include <vector>
#include <list>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <stack>
#include <fstream>
#include <queue>
#include <iomanip>
#include <iterator>
#include <map>
#include <unordered_map>
#include <set>
#define fast ios_base::sync_with_stdio(false)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vvi vector<vi >
#define pi pair<ll,ll>
#define vvpi vector<vector<pi > >
#define vpi vector<pi >
#define vppi vector<pair<ll,pi > >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define fs first
#define se second
#define crz(v,n,c) v.clear(),v.resize(n,c)
#define print(v) for(ll it=0;it<v.size();it++) cout<<v[it]<<" ";cout<<endl
#define printp(v) for(ll it=0;it<v.size();it++) cout<<v[it].first<<" "<<v[it].second<<endl
using namespace std;
int main(){
	ld a,b,x,s,y;
	cin>>a>>b>>x;
	y=2*x/(a*a)-b;
	if(y<0.0) s=atan(a*b*b/(2.0*x));
	else s=atan((b-y)/a);
	s*=180.0/3.14159265359;
	printf("%.9Lf\n",s);
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip> // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple> // get<n>(xxx)
#include <queue>
#include <stack>
#include <map> // if (M.find(key) != M.end()) { }
#include <set> // S.insert(M);
// if (S.find(key) != S.end()) { }
// for (auto it=S.begin(); it != S.end(); it++) { }
// auto it = S.lower_bound(M);
#include <random> // random_device rd; mt19937 mt(rd());
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib> // atoi(xxx)
using namespace std;

#define DEBUG 0 // change 0 -> 1 if we need debug.
// insert #if<tab> by my emacs. #if DEBUG == 1 ... #end

typedef long long ll;

const int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};

// const int C = 1e6+10;
// const ll M = 1000000007;

int H, W;
string S[100];

int valid(int x, int y) {
  if (0 <= x && x < H && 0 <= y && y < W && S[x][y] == '#') {
    return 1;
  } else {
    return 0;
  }
}

int main () {
  cin >> H >> W;
  for (auto i = 0; i < H; ++i) {
    cin >> S[i];
  }
  for (auto i = 0; i < H; ++i) {
    for (auto j = 0; j < W; ++j) {
      if (S[i][j] == '.') {
        int cnt = 0;
        for (auto k = 0; k < 8; ++k) {
          int nx = i + dx[k];
          int ny = j + dy[k];
          cnt += valid(nx, ny);
        }
        S[i][j] = (char)('0' + cnt);
      }
    }
  }
  for (auto i = 0; i < H; ++i) {
    cout << S[i] << endl;
  }
}


Measured memory_bytes: 256
n,k=map(int,input().split())

a=list(map(int,input().split()))
a_reverse=list(reversed(a))
b=sorted(a)
s=sum(a)

ans=[]

for i in range(k+1):
  if i>n:
    I=i-n
    for j in range(I): 
      if j<n:
        ans1=s-b[j]
    ans.append(ans1)
  elif i==n:
    ans.append(s)
  elif i==0:
    ans.append(0)
  else:
    for h in range(i+1):
      H=i-h
      c=[]
      for x in range(h):
        c.append(a[x])
      for y in range(H):
        c.append(a_reverse[y])
        
      c.sort()
      S=sum(c)
      for g in range(1,k-i+1):
        if g<=i:
          if c[g-1]<0:
            S-=c[g-1]

      ans.append(S)
      
print(max(ans))

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

int main(){
  string s;
  cin >> s;
  bool ans=false;
  int i;
  for(i=0;i<s.size();++i){
    if(s.at(i)=='C') break;
  }
  for(int j=i+1;j<s.size();++j){
    if(s.at(j)=='F'){
      ans=true;
      break;
    }
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
def resolve():
    A = []
    for i in range(3):
        aa = map(int, input().split())
        A.append(list(aa))

    N = int(input())
    B = []
    for i in range(N):
        bb = int(input())
        B.append(bb)

    ans = 'No'

    for bbb in list(B):
        for i in range(3):
            if A[i][0] == bbb:
                A[i][0] = 1000
            if A[i][1] == bbb:
                A[i][1] = 1000
            if A[i][2] == bbb:
                A[i][2] = 1000

    for i in range(3):
        if A[i][0] == 1000 and A[i][1] == 1000 and A[i][2] == 1000:
            ans = 'Yes'

    for i in range(3):
        if A[0][i] == 1000 and A[1][i] == 1000 and A[2][i] == 1000:
            ans = 'Yes'

    if A[0][0] == 1000 and A[1][1] == 1000 and A[2][2] == 1000:
        ans = 'Yes'
    if A[0][2] == 1000 and A[1][1] == 1000 and A[2][0] == 1000:
        ans = 'Yes'

    print(ans)


resolve()

Measured memory_bytes: 3064