akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

#define __m int mid=(l+r)>>1
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1

template<class T>
inline bool rd(T &num) {
    char in;
    bool IsN = false;
    while(in = getchar(), in != '-' && (in < '0' || in > '9'))if(in == EOF)return false;
    in == '-' ? (IsN = true, num = 0) : num = in - '0';
    while(in = getchar(), in >= '0' && in <= '9')num = num * 10 + in - '0';
    return IsN ? num = -num : num, true;
}

#define rep(i,a,b) for(register int i = (a); i< (b); i++)
#define per(i,a,b) for(register int i = (a); i> (b); i--)
#define clr(a) memset(a,0,sizeof(a))
#define inf(a) memset(a,0x3f,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define rd2(a,b) rd(a)&&rd(b)
#define rd3(a,b,c) rd(a)&&rd(b)&&rd(c)
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

string nico;
#ifdef LOCAL
#define bug(x) cout<<#x<<" : "<<x<<endl
#define infile(x) freopen(x,"r",stdin)
#define outfile(x) freopen(x,"w",stdout)
#else
#define bug(x)
#define infile(x)
#define outfile(x)
#endif

const int maxn = 4e6 + 7;
const int inf  = 0x3f3f3f3f;
const LL linf  = (LL)inf << 32 | inf;
const int mod  = 1e9 + 7;

int main(){
    int n;
    cin>>n;
    LL ans=0;
    rep(i,0,n){
        int k;
        cin>>k;
        ans+=k;
    }
    cout<<ans-n<<endl;
    return 0;
}



Measured memory_bytes: 256
n, m = map(int,input().split())
store = [list(map(int,input().split())) for _ in range(n)]
store = sorted(store, key=lambda x: x[0])

i = 0
ans = 0
while True:
    if store[i][1] < m:
        ans += store[i][0]*store[i][1]
        m -= store[i][1]
        i += 1
    else:
        ans += m*store[i][0]
        break
print(ans)


Measured memory_bytes: 29304
/*
 *  author : Atul Anand   
 *  created on : Fri Apr 03 2020
 */

import java.io.*;
import java.util.*;

public class Main{

    public static void main(String[] args) throws IOException {
        int r = in.nextInt();
        println(3*r*r);
        
        in.close();
        out.close();
    }

    static int MIN = Integer.MIN_VALUE;
    static int MAX = Integer.MAX_VALUE;
    static Reader in = new Reader();
    static PrintWriter out = new PrintWriter(System.out);

    static void read(int arr[], int N) throws IOException { 
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    }
    
    static void read(long arr[], int N) throws IOException { 
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    }
    
    static void read(String arr[], int N) throws IOException { 
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    }
    
    static void print(Object O) {  
    	out.print(O); 
    }
    
    static void println(Object O) { 
    	out.println(O); 
    }
    
    static void println(int arr[]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i]+" "); 
    	} 
    	println(""); 
    }

    static void println(int arr[][]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		println(arr[i]); 
    	}
    }
    
    static void debug(Object O) { 
    	System.out.println(O); 
    }
}

class Reader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    Reader() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException { 
        return Integer.parseInt(next()); 
    }
    
    double nextDouble() throws IOException { 
        return Double.parseDouble(next());
    }
    
    long nextLong() throws IOException { 
        return Long.parseLong(next()); 
    }
    
    String nextLine() throws IOException { 
        return reader.readLine(); 
    }
    
    void close() throws IOException { 
        reader.close(); 
    }
}

Measured memory_bytes: 22612
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <string>
#include <utility>
using namespace std;

#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define RFOR(i, a, b) for (int i = a; i > b; --i)
#define REP(i, n) for (int i = 0; i < n; ++i)

const int kMaxN = 50;

int n;
int a[kMaxN];
// int ans = 0;
int ans_pair[2*kMaxN][2];
int ans_pair_i = 0;

int main() {
  cin >> n;
  REP(i, n) { cin >> a[i]; }

  int max_abs_i = 0;
  REP(i, n) { if (abs(a[i]) > abs(a[max_abs_i])) { max_abs_i = i; } }
  if (a[max_abs_i] == 0) {
    cout << 0 << endl;
    return 0;
  }

  REP(i, n) {
    if (i != max_abs_i) {
      a[i] += a[max_abs_i];
      ans_pair[ans_pair_i][0] = max_abs_i;
      ans_pair[ans_pair_i][1] = i;
      ++ans_pair_i;
    }
  }

  if (a[max_abs_i] > 0) {
    REP(i, n-1) {
      if (a[i] > a[i+1]) {
        a[i+1] += a[i];
        ans_pair[ans_pair_i][0] = i;
        ans_pair[ans_pair_i][1] = i+1;
        ++ans_pair_i;
      }
    }
  } else {
    RFOR(i, n-1, 0) {
      if (a[i-1] > a[i]) {
        a[i-1] += a[i];
        ans_pair[ans_pair_i][0] = i;
        ans_pair[ans_pair_i][1] = i-1;
        ++ans_pair_i;
      }
    }
  }

  cout << ans_pair_i << endl;
  REP(i, ans_pair_i) {
    cout << ans_pair[i][0]+1 << " " << ans_pair[i][1]+1 << endl;
  }
  return 0;
}


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

int main() {
	int N, M;
	bool g[9][9];
	for (int i = 0; i < 9; i++) {
		for (int j = 0; j < 9; j++) {
			g[i][j] = false;
		}
	}
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		int a, b;
		cin >> a >> b;
		g[a][b] = g[b][a] = true;
	}

	int ans = 0;
	int j = 1;
	vector<int> v;
	for (int i = 2; i <= N; i++) {
		v.push_back(i);
	}

	do {
		j = 1;
		int i;
		for (i = 0; i < N - 1; i++) {
			if (!g[j][v[i]]) {
				break;
			}
			j = v[i];
		}
		if (i == N - 1) {
			ans++;
		}
	} while (next_permutation(v.begin(), v.end()));

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
vector<int> wt, val;
LL dp[101][100001];
int n,w;

LL knapsack(int pos, int w) {
	if(pos==n || w==0) return 0;
//	if(w==0) return 0;
	if(dp[pos][w]!=INT_MIN) return dp[pos][w];
	if(wt[pos]<=w) dp[pos][w] =  max(knapsack(pos+1, w-wt[pos]) + val[pos], knapsack(pos+1, w));
	else dp[pos][w] = knapsack(pos+1, w);
	return dp[pos][w]; 
}

int main() {
	cin>>n>>w;
	wt.assign(n,0);
	val.assign(n,0);
//	dp.assign(n, INT_MIN);
//	dp.assign(vector<int> (n), INT_MIN);
	for(int i=0;i<100;i++) {
		for(int j=0;j<100001;j++) dp[i][j] = INT_MIN;
	}
	for(int i=0; i<n; i++) {
		cin>>wt[i]>>val[i];
	}
	LL res = knapsack(0, w);
	cout<<res<<"\n";
	return 0;
	
}

Measured memory_bytes: 78464
package main

import (
	"fmt"
)

func main() {
	for {
		var h, w int
		fmt.Scan(&h)
		fmt.Scan(&w)

		if h == 0 && w == 0 {
			break
		}

		for i := 0; i < h; i++ {
			for j := 0; j < w; j++ {
				c := "."
				if (i+j)%2 == 0 {
					c = "#"
				}
				fmt.Print(c)
			}
			fmt.Print("\n")
		}
		fmt.Print("\n")
	}
}

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

#ifdef BTK
#define DEBUG if(1)
#else
#define DEBUG if(0)
#define CIN_ONLY if(1)
struct cww{cww(){
    CIN_ONLY{
        ios::sync_with_stdio(false);cin.tie(0);
    }
}}star;
#endif

#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define REC(ret, ...) std::function<ret (__VA_ARGS__)>
template <typename T>inline bool chmin(T &l,T r){bool a=l>r;if(a)l=r;return a;}
template <typename T>inline bool chmax(T &l,T r){bool a=l<r;if(a)l=r;return a;}
template <typename T>istream& operator>>(istream &is,vector<T> &v){for(auto &it:v)is>>it;return is;}

constexpr char ln = '\n';
constexpr int mod = 1e9+7;
const string ok = "Yes";
const string ng = "No";


int main(){
    int R,G;
    cin>>R>>G;
    cout<<2*G-R<<endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
public class Program {
  public static void Main() {
    int N = int.Parse(Console.ReadLine());
    int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    int ans = 0;
    for (int i = 0; i < N; i++) {
      while (a[i] % 2 == 0) {
        a[i] /= 2;
        ans++;
      }
    }
    Console.WriteLine(ans);
  }
}


Measured memory_bytes: 14176
from functools import reduce
from fractions import gcd
n = int(input())
L = [int(i) for i in input().split()]
def lcm(x,y):return x*y//gcd(x,y)
def lcmm(l):return reduce(lcm,l)
ans = 0
m = lcmm(L)-1
ans = sum([m%i for i in L])
print(ans)

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

int main(){
  int n,i,j,k,min,suma,sumb;

  cin>>n;

  vector<int> vec(n);
  for(i=0;i<n;i++)
  cin>>vec.at(i);

  min=vec.at(0);
  for(i=0;i<n-1;i++){
    min=vec.at(i);
    k=i;
    for(j=i+1;j<=n-1;j++){
      if(vec.at(i)<vec.at(j)){
        vec.at(i)=vec.at(j);
        k=j;
      }
    }
    vec.at(k)=min;
  }

  suma=0;
  sumb=0;

  for(i=0;i<n;i+=2)
  suma+=vec.at(i);
  for(i=1;i<n;i+=2)
  sumb+=vec.at(i);

  cout<<suma-sumb<<endl;

}


Measured memory_bytes: 256
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx")
//#undef LOCAL
#include <bits/stdc++.h>

using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;

#ifdef LOCAL
#define show(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl
#else
#define show(x) true
#endif

template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    return os << "P(" << p.first << ", " << p.second << ")";
}

template <class T> ostream& operator<<(ostream& os, const V<T>& v) {
    os << "[";
    for (auto d : v) os << d << ", ";
    return os << "]";
}

struct P {
    ll x, y;
    char ty;
};
ostream& operator<<(ostream& os, const P& p) {
    return os << p.ty << "(" << p.x << ", " << p.y << ")";
}

const int MN = 502;
int n;
ll cost[MN][MN];
ll rcost[MN][MN];
ll cost_sm[MN][MN];
ll rcost_sm[MN][MN];

ll memo[MN][MN][MN];
ll calc(int a, int b, int c) {
    /*
    [0, a) : 2
    [a, b) : 1
    [b, c) : 0
     */
    if (c == n) return 0;
    if (memo[a][b][c] != -1) return memo[a][b][c];
    ll ans = TEN(18);
    /*
      c = 0
      prohibit
      2 <- 0
      0 -> 0
     */
    ans = min(ans, cost_sm[c][a] + (rcost_sm[c][c] - rcost_sm[c][b]) + calc(a, b, c + 1));
    /*
      c = -1
      prohibit
      1 <- -1      
     */
    ans = min(ans, (cost_sm[c][b]) + calc(b, c, c + 1));

    return memo[a][b][c] = ans;
}


int main() {
    memset(memo, -1, sizeof(memo));
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i == j) continue;
            cin >> cost[i][j];
            rcost[j][i] = cost[i][j];
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cost_sm[i][j + 1] = cost_sm[i][j] + cost[i][j];
            rcost_sm[i][j + 1] = rcost_sm[i][j] + rcost[i][j];
        }
    }


    cout << calc(0, 0, 0) << endl;
    return 0;
}



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

int main(){
	int A, B, M;
	cin >> A >> B >> M;
	int a[A+1], b[B+1], x[M], y[M], c[M];
	rep(i,A) cin >> a[i+1];
	rep(i,B) cin >> b[i+1];
	rep(i,M) cin >> x[i] >> y[i] >> c[i];
	int ans = 200000;

	rep(i,M) {
		int price = a[x[i]] + b[y[i]] - c[i];
		ans = min(ans, price);
	}
	sort(a+1,a+A+1);
	sort(b+1,b+B+1);
	ans = min(ans,a[1]+b[1]);

	cout << ans << endl;	

	return 0;
}


Measured memory_bytes: 5488
import os,re,sys,operator,math
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy
import heapq
import string

setrecursionlimit(10**6)

s=stdin.readline().rstrip()
t="AGTC"
cnt,ans=0,0
for i in s:
    if i in t:
        cnt+=1
    else:
        ans=max(ans,cnt)
        cnt=0
ans=max(ans,cnt)
print(ans)

Measured memory_bytes: 38640
#include <algorithm>
#include <bits/stdc++.h>
#include<iostream>
#include<string>
using namespace std;
#define rep(i, n) for (int i = 0; i <(int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
int main(){
int x,y,z;cin>>x>>y>>z;
cout<<z<<" "<<x<<" "<<y<<endl;
}

Measured memory_bytes: 3636
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#include<stdio.h>
#include <string.h>
#include<algorithm>
#include <queue>
typedef long long ll;
typedef unsigned long long ull;
const int mod=998244353;
const int maxn=1e6+5;
const ll INF=100000000000000005;
const double eps=1e-10;
using namespace std;
ll n,m,p;
char mp[305][305];
int dp[305][305];
int main()
{
    int cot=0;
    scanf("%lld%lld%lld",&n,&m,&p);
    for(int i=1;i<=n;i++) scanf("%s",mp[i]+1);
    for(int i=1;i<=n;i++)
    {
        for(int k=1;k<=m;k++)
        {
            if(mp[i][k]=='#')
            {
                cot++;
                int z=k-1;
                dp[i][k]=cot;
                while(mp[i][z]=='.'&&z>=1)
                {
                    dp[i][z]=cot;
                    z--;
                }
                z=k+1;
                while(mp[i][z]=='.'&&z<=m)
                {
                    dp[i][z]=cot;
                    z++;
                }
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        if(dp[i][1])
        {
            int z=i-1;
            while(z>=1&&!dp[z][1])
            {
                for(int k=1;k<=m;k++)
                    dp[z][k]=dp[i][k];
                z--;
            }
            z=i+1;
            while(z<=n&&!dp[z][1])
            {
                for(int k=1;k<=m;k++)
                    dp[z][k]=dp[i][k];
                z++;
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        for(int k=1;k<=m;k++)
            printf("%d ",dp[i][k]);
        printf("\n");
    }
    return 0;
}
/***
2
3 5
12
12
13
***/


Measured memory_bytes: 1152
#include <cstdio>
#include <iostream>
#include <cmath>

using namespace std;

int main(){
	int x, y, s;
	while(1){
		cin >> x >> y >> s;
		if(x == 0 && y == 0 && s == 0) break;
		int max = -1;
		for(int i = 1; i < s; i++){
			for(int j = 1; j < s; j++){
				int m, n ,o;
				m = (i * (100 + x)) / 100;
				n = (j * (100 + x)) / 100;
				o = m + n;
				if(o == s){
					int b;
					b = (i * (100 + y) / 100) + (j * (100 + y) / 100);
					if(b > max) max = b;
				}
			}
		}
		cout << max << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
N = int(input())
A = list(map(int, input().split()))

No = 0
N2 = 0
N4 = 0

for i in A:
    if i % 4 == 0:
        N4 += 1
    elif i % 2 == 0:
        N2 += 1
    else:
        No += 1

ans = "No"

if N2 == 0 and No <= N4+1:
    ans = "Yes"
elif No <= N4:
    ans = "Yes"

print(ans)

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

int main(){
  ll x;
  cin>>x;
  ll l;
  ll k=1e18;
  for(int i=1;i<=sqrt(x);i++){
    if(x%i==0){
      l=i+x/i-2;
      k=min(k,l);
    }
  }
  cout<<k<<endl;
  
  
}


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

using ll = long long;
template <typename T> constexpr T inf = numeric_limits<T>::has_infinity ? numeric_limits<T>::infinity() : numeric_limits<T>::max() / 4;

#define REP(i, stop) FOR(i, 0, stop)
#define FOR(i, start, stop) for (ll i = start, i##_len = stop; i < i##_len; ++i)
#define RREP(i, n) for (ll i = n; i-- > 0;)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define COMP(key) [](const auto& a, const auto& b) { return a.key < b.key; }

template<typename T, typename U> istream& operator>>(istream& is, pair<T, U>& a) { return is >> a.first >> a.second; }
template<typename T> istream& operator>>(istream& is, vector<T>& a) { for (T& x : a) is >> x; return is; }

template<typename T> using pop_max = std::priority_queue<T>;
template<typename T> using pop_min = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<typename T> void LOG(const T& x) { cerr << x << "\n"; }
template<typename T> void LOG(const vector<T>& a) { for (const T& x : a) cerr << x << " "; cerr << "\n"; }
template<typename T> void LOG(const vector<vector<T>>& a) { for (const auto& x : a) LOG(x); }
template<typename T, std::size_t S> void LOG(const T (&a)[S]) { REP(i, S) cerr << a[i] << " "; cerr << "\n"; }
template<typename T, std::size_t S, std::size_t R> void LOG(const T (&a)[S][R]) { REP(i, S) { REP(j, R) cerr << a[i][j] << " "; cerr << "\n"; } }

ll ceil(ll a, ll b) { return a > 0 ? (a - 1) / b + 1 : a / b; }
ll gcd(ll a, ll b) { while (b != 0) { ll t = b; b = a % b; a = t; } return a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll gcd(const vector<ll>& v) { return accumulate(v.begin(), v.end(), 1LL, static_cast<ll(*)(ll, ll)>(gcd)); }
ll lcm(const vector<ll>& v) { return v.empty() ? 0LL : accumulate(v.begin() + 1, v.end(), v[0], static_cast<ll(*)(ll, ll)>(lcm)); }
ll pow(ll x, ll y, ll z) { ll a = 1; while (y > 0) { if (y & 1) a = a * x % z; x = x * x % z; y /= 2; } return a; }
ll inv(ll x, ll m) { return pow(x, m - 2, m); }

template<typename T> bool chmax(T& x, const T& y) { return x < y ? x = y, true : false; }
template<typename T> bool chmin(T& x, const T& y) { return x > y ? x = y, true : false; }

struct InitCpp { InitCpp() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); } } init_cpp;

const ll INF = inf<ll>;
using P = pair<ll, ll>;
const ll M = 1000000007;
signed main() {
  string s,t,u;
  ll a,b;
  cin>>s>>t>>a>>b>>u;
  if(u==s){
    cout<<(a-1)<<" "<<b<<endl;
  }else{
    cout<<a<<" "<<(b-1)<<endl;
  }
}


Measured memory_bytes: 764
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> llP;

int main() {
  int n;
  cin>>n;
  map<string,int> memo;
  string s[n];
  bool ans=true;
  for(int i=0;i<n;i++){
    cin>>s[i];
    memo[s[i]]++;
    if(i==0) continue;
    if(memo[s[i]]==2) ans=false;
    if(s[i-1].at(s[i-1].size()-1)!=s[i].at(0)) ans=false;
    if(!ans) break;
  }
  if(ans) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
 
K = int(input())
A = list(map(int, input().split()))

ans = ( A[1]//K ) - ( A[0]//K ) 
#print(ans)

if ( A[0]%K==0 or A[1]%K==0 ):
  print("OK")
elif ( ans>0 ):
  print("OK")
else:
  print("NG")

Measured memory_bytes: 9180
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;
typedef int64_t ll;

int main() {
    int K;
    string S;
    cin >> K >> S;
    if (K >= S.size()){
        cout << S << endl;
    }
    else {
        for (int i = 0; i < K; i++){
            cout << S.at(i);
        }
        cout << "..." << endl;
    }
}

Measured memory_bytes: 3624
import java.awt.Event;
import java.awt.geom.Point2D;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.channels.FileChannel;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.IntStream;

public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args){
		new Main();
	}
	public Main(){
		new TestA().doIt();
	}
	class TestA{
		void doIt() {
			String str = sc.next();
			if(str.equals("AAA") || str.equals("BBB")) {
				System.out.println("No");
			}else {
				System.out.println("Yes");
			}
		}
	}
}


Measured memory_bytes: 22612
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
using namespace std;
#define mp make_pair
#define pb push_back
#define pf push_fron
#define INF 1000000000
typedef long long ll;

bool edge[55][55],flag[55];

void dfs(int node) {
	if (flag[node])return;

	flag[node] = true;
	for (int i = 0; i < 55; i++) {
		if (edge[node][i]) {
			dfs(i);
		}
	}
}

int main(){
	for (int i = 0; i < 55; i++)for (int j = 0; j < 55; j++)edge[i][j] = false;

	int n, m, ans=0;
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		--a; --b;
		edge[a][b] = true; edge[b][a] = true;
	}

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			for (int i = 0; i < 55; i++) flag[i] = false;
			if (edge[i][j]) {
				edge[i][j] = false;
				dfs(0);
				for (int i = 0; i < n; i++) {
					if (flag[i] == false) {
						ans++; break;
					}
				}
				edge[i][j] = true;
			}
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
# ABC135C - City Savers
# greedy algorithm
def main():
    n = int(input())
    A = tuple(map(int, input().split()))
    B = tuple(map(int, input().split()))
    ans, a1 = 0, A[0]
    for a2, b in zip(A[1:], B):
        cnt1 = min(a1, b)
        cnt2 = min(a2, b - cnt1)
        ans += cnt1 + cnt2
        a1 = a2 - cnt2  # a2 becomes a1 in next turn
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 19244
//
//  main.cpp
//  20190813homework
//
//  Created by Priscilla Leang on 8/14/19.
//  Copyright © 2019 Priscilla Leang. All rights reserved.
//

#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
    int a, b, c, n, m;
    int k , x;
/*
    cin>> a>>b>>c >>n;
    m = a+b  -c;
    m = n - m;
    if (m <=0){
        cout << "-1";
    }
    else {
        cout << m;
    }*/
  
    //next  problem

    cin>> k >> x;
    for (int i =k - 1; i >= 0; i--){
        cout << x - i << " ";
    }
    for (int i =1; i <= k - 1; i++){
        cout << x + i << " ";
    }
/*
    cin>> a >> b;
    char a1[a][b];
    int a2[5];
    int a3[b]; //value points

    for (int i = 0; i< 5; i++){
        a2[i] = 0;
    }

    for (int i = 0; i < a ; i++){
        for (int j = 0; j< b; j++){
            cin >> a1[i][j];
        }
    }

    for (int j = 0; j< b; j++){
        cin >> a3[j];
    }
    n = 0;
    for (int j = 0;j < b; j++){ //each question
        m = 0;

        for (int i = 0; i< a; i++){  //check each answer
            for (int i = 0; i< 5; i++){
                a2[i] = 0;
            }
            for (int k = 65; k<=69; k++){
                if (a1[i][j] == k ){
                    a2[k - 65]++;
                }
            }


        }
        m = 0;
        m = 0;
        for (int k = 0; k< 5; k++){
            if (a2[k] >m){
                m = a2[k];
            }
        }

        n += m*a3[j];


    }

    cout << n;*/
    return 0;
}


Measured memory_bytes: 256
N=int(input())
A=[int(input()) for i in range(N)]
r=0
for i in range(N-1,0,-1):
    if A[i-1]<A[i]-1:
        r=-1
        break
    elif A[i-1]==A[i]-1:
        r+=1
    else:
        r+=A[i]
print(-1 if A[0]!=0 else r)

Measured memory_bytes: 11052
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
//import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int k = parseInt(sc.next());
		long[] x = new long[n];
		ArrayList<Long> p = new ArrayList<>();  
		ArrayList<Long> m = new ArrayList<>(); 
		p.add(0L);
		m.add(0L);
		for(i=0;i<n;i++) {
			x[i] = parseLong(sc.next());
			if(x[i]==0) k--;
			if(x[i]<0) {
				m.add(-x[i]);
			} else {
				p.add(x[i]);
			}
		}
		sc.close();
		Collections.sort(m);
//		out.println(m.toString());
//		out.println(p.toString());
		long mn = 300000000;
		long tmp = 0;
		for(i = 0; i <= k; i++) {
//			out.printf("%d:%d%n",p.size(),i+1);
			if(p.size() < i+1) continue;
//			out.printf("%d:%d%n",m.size(), k-i+1);
			if(m.size() < k-i+1) continue;
			tmp = p.get(i) + m.get(k-i) + Math.min(p.get(i), m.get(k-i));
//			out.printf("%d:%d%n",i,tmp);
			if(tmp < mn) mn = tmp;
		}
		out.println(mn);
	}
}


Measured memory_bytes: 47796
#include <iostream>
#include <vector>
#include <cstring>
#include <memory.h>
#include <queue>

using namespace std;

int maxw,maxh;
int lsx,lsy;
int rsx,rsy;

const int dxl[] = {1,0,-1,0};
const int dxr[] = {-1,0,1,0};
const int dyl[] = {0,1,0,-1};
const int dyr[] = {0,1,0,-1};

typedef pair<int,int> PP;
typedef pair< PP,PP > P;

bool visited[55][55][55][55] = {};

int main(void)
{
	while(1)
	{
		char fieldl[55][55];
		char fieldr[55][55];
		memset(visited,0,sizeof(visited));
		memset(fieldl,0,sizeof(fieldl));
		memset(fieldr,0,sizeof(fieldr));
		cin >> maxw >> maxh;
		if(maxw==0&&maxh==0)
			return 0;
		for(int y=1;y<=maxh;++y){
			for(int x=1;x<=maxw;++x){
				cin >> fieldl[y][x];
				if(fieldl[y][x] == 'L'){
					lsy = y;lsx = x;
					fieldl[y][x] = '.';
				}
				if(fieldl[y][x] == 'R'){
					rsy = y;rsx = x;
					fieldl[y][x] = '.';
				}
			}
			for(int x=1;x<=maxw;++x){
				cin >> fieldr[y][x];
				if(fieldr[y][x] == 'L'){
					lsy = y;lsx = x;
					fieldr[y][x] = '.';
				}
				if(fieldr[y][x] == 'R'){
					rsy = y;rsx = x;
					fieldr[y][x] = '.';
				}
			}
		}

		queue<P> q;
		bool isGoal = false;
		q.push(P(PP(lsy,lsx),PP(rsy,rsx)));
		visited[lsy][lsx][rsy][rsx] = true;
		while(!q.empty()){
			P p = q.front();q.pop();
			for(int i=0;i<4;++i){
				bool f=false;
				PP tol = PP(p.first.first+dyl[i],p.first.second+dxl[i]);//y,x
				PP tor = PP(p.second.first+dyr[i],p.second.second+dxr[i]);//y,x
				if(visited[tol.first][tol.second][tor.first][tor.second])
					continue;
				if(fieldl[tol.first][tol.second] == '%' && fieldr[tor.first][tor.second] == '%'){
					isGoal = true;
					break;
				}
				else if(fieldl[tol.first][tol.second] == '%' || fieldr[tor.first][tor.second] == '%')
					continue;
				PP l = PP(p.first.first,p.first.second);
				PP r = PP(p.second.first,p.second.second);
				if(fieldl[tol.first][tol.second] == '.'){
					l = tol;
					f=true;
				}
				if(fieldr[tor.first][tor.second] == '.'){
					r = tor;
					f=true;
				}
				if(!f)
					continue;
				if(visited[l.first][l.second][r.first][r.second])
					continue;
				visited[l.first][l.second][r.first][r.second] = true;
				q.push(P(l,r));
			}
			if(isGoal)
				break;
		}
		(isGoal?cout<<"Yes"<<endl:cout<<"No"<<endl);
	}
}

Measured memory_bytes: 11076
#include<bits/stdc++.h>
#define f first
#define s second
#define ll long long
#define vi vector<int>
#define pii pair<int, int>
#define si set<int>
#define y1 yy
#define debug if(printDebug)
using namespace std;
bool printDebug=false;
int main(){
    //printDebug=true;
    /*freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);//*/
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);//*/
    map<string, int> veredicts;
    int cases;
    cin >> cases;
    string str;
    while(cases--){
    	cin >> str;
    	veredicts[str]++;
    }
    cout << "AC x " << veredicts["AC"] << "\n";
    cout << "WA x " << veredicts["WA"] << "\n";
    cout << "TLE x " << veredicts["TLE"] << "\n";
    cout << "RE x " << veredicts["RE"] << "\n";
    return 0;
}


Measured memory_bytes: 3604
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

	    List<Stock> stockList = new ArrayList<Stock>();

		for(int i = 0; i < n; i++) {
			int v = sc.nextInt();
			int w = sc.nextInt();
			int t = (int)sc.next().charAt(0);
			long d = sc.nextLong();
			String s = sc.next();

			Stock st = new Stock(v, w, t, d, s);

			stockList.add(st);
		}

	    Comparator<Stock> comparator = Comparator.comparing(Stock::getValue)
	    		.thenComparing(Stock::getWeight)
	    		.thenComparing(Stock::getType)
	    		.thenComparing(Stock::getDate)
	    		.thenComparing(Stock::getName);

		Collections.sort(stockList, comparator);

		for(int i = 0; i < n; i++) {
			System.out.println(stockList.get(i).getValue() + " " + stockList.get(i).getWeight() + " "
		+ (char)stockList.get(i).getType() + " " + stockList.get(i).getDate() + " " + stockList.get(i).getName());
		}
	}
}

class Stock {
	private int value;
	private int weight;
	private int type;
	private long date;
	private String name;

	Stock(int a, int b, int c, long d, String s) {
		this.value = a;
		this.weight = b;
		this.type = c;
		this.date = d;
		this.name = s;
	}

	public int getValue() {
		return this.value;
	}

	public int getWeight() {
		return this.weight;
	}

	public int getType() {
		return this.type;
	}

	public long getDate() {
		return this.date;
	}

	public String getName() {
		return this.name;
	}
}


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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  set<int> s;
  vector<int> vi(1001,0);
  vector<int> vi2(1001,0);
  char c;
  int a,b;
  string str;
  stringstream ss;
  while(getline(cin,str)){
    if(str.size() == 0) break;
    ss << str;
    ss >> a >> c >> b;
    ss.clear();
    s.insert(a);
    vi[a]++;
  }
  while(cin >> a >> c >> b){
    vi2[a]++;
  }
  for(auto it = s.begin(); it != s.end();++it ){
    if( vi[*it] != 0 && vi2[*it] != 0){
      cout << *it << " " << vi[*it]+vi2[*it]<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 3184
package main

import "fmt"

func main() {
	var k, a, b int
	fmt.Scanf("%d", &k)
	fmt.Scanf("%d %d", &a, &b)

	for i := a; i <= b; i++ {
		if i%k == 0 {
			fmt.Println("OK")
			return
		}
	}

	fmt.Println("NG")
}


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

int main(){
    int h, w;
    cin >> h >> w;
    vector<vector<char>> M;
    vector<char> mi(w, 0);
    rep(hi, h){
        rep(wi, w){
            cin >> mi.at(wi);
        }
        M.push_back(mi);
    }
    rep(hi, h){
        rep(wi, w){
            if (M[hi][wi] == '.'){
                int cnt = 0;
                // diagonally upper left
                if (hi-1 > -1 && wi-1 > -1 && M[hi-1][wi-1] == '#') cnt ++;
                // diagonally upper right
                if (hi-1 > -1 && wi+1 < w && M[hi-1][wi+1] == '#') cnt ++;
                // diagonally lower left
                if (hi+1 < h && wi-1 > -1 && M[hi+1][wi-1] == '#') cnt ++;
                // diagonally lower right
                if (hi+1 < h && wi+1 < w && M[hi+1][wi+1] == '#') cnt ++;
                // above
                if (hi-1 > -1 && M[hi-1][wi] == '#') cnt ++;
                // under
                if (hi+1 < h && M[hi+1][wi] == '#') cnt ++;
                // right
                if (wi+1 < w && M[hi][wi+1] == '#') cnt ++;
                // left
                if (wi-1 > -1 && M[hi][wi-1] == '#') cnt ++;
                string i = to_string(cnt);
                char ci = i[0];
                M[hi][wi] = ci;
            }
        }
    }
    rep(hi, h){
        rep(wi, w){
            cout << M[hi][wi];
        }
        cout << endl;
    }
}

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

int main(){
    int N, M, L, R, count;
    int maxL, minR;
    cin >> N >> M;
    for(int i=0; i<M; i++){
        cin >> L >> R;
        if(i == 0){
            maxL = L;
            minR = R;
        }
        else{
            if(minR > R){
                minR = R;
            }
            if(maxL < L){
                maxL = L;
            }
        }
    }
    count = 0;
    for(int i=maxL; i<=minR; i++){
        count++;
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
mod = 10 ** 9 + 7

A = 0
C = 1
G = 2
T = 3

dp = [ [[[0 for c3 in range(4)]  for c2 in range(4)]  for c1 in range(4)] for n in range(N+1)]

dp[0][3][3][3] = 1

for n in range(N):
  for c1 in range(4):
    for c2 in range(4):
      for c3 in range(4):
        for new in range(4):
          if c2 == A and c1 == G and new == C: continue
          if c2 == A and c1 == C and new == G: continue
          if c2 == G and c1 == A and new == C: continue
          if c3 == A and c1 == G and new == C: continue
          if c3 == A and c2 == G and new == C: continue

          dp[n+1][c2][c1][new] += dp[n][c3][c2][c1]      

ans = 0
for c1 in range(4):
  for c2 in range(4):
    for c3 in range(4):
      ans += dp[N][c1][c2][c3]

print(ans % mod)

Measured memory_bytes: 47472
#include<bits/stdc++.h>
#define ll long long int
#define ul unsigned long long int
#include<vector>
#define endl "\n"
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
using namespace std;

int main(){
	fio
	ll n;
	cin>>n;
	cout<<(n/500)*1000+((n%500)/5)*5<<endl;
return 0;
}

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




namespace ConsoleApplication1 {

    

    class ClassMain {


        public static int[] pattern = new int[1001];
        static void makePat() {
            for (int i = 1; i < 1001; i++) {
                int sum = i;
                for (int add = i+1; sum < 1001; add++) {
                    sum += add; 
                    if (sum >= 1001) { break; }
                    pattern[sum]++;
                }
            }
        }


        public static void Main(String[] args) {
            makePat();
            string line;
            while ((line = Console.ReadLine()) != null) {
                //int[] ints = line.Split(' ').Select(int.Parse).ToArray();
                //int n = ints[0];
                int n = int.Parse(line);                
                if (n == 0) { break; }

                Console.WriteLine(pattern[n]);

                
                    
              //Console.WriteLine();
                    
                



            }
        }
    }
}

Measured memory_bytes: 5624
#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
const ll MOD = 1'000'000'007LL; /*998'244'353LL;*/
#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)++)
const int dx[4]={ 1,0,-1,0 };
const int dy[4]={ 0,1,0,-1 };

struct SegmentTree{
private:
    int N;
    vector<pair<long long, long long>> node;
    vector<long long> lazy;
    vector<bool> lazyFlg;
public:
    void init(int n){
        N = 1;
        while(N < n) N = (N<<1);
        for(int i=0; i<2*N-1; i++){
            node.push_back({ -i,i });
            lazy.push_back(0LL);
            lazyFlg.push_back(false);
        }
    }
    void eval(int k, int l, int r){
        if(lazyFlg[k]){
            node[k].first = lazy[k];
            node[k].second = l;
            if(r-l > 1){
                lazy[(k<<1)+1] = lazy[k];
                lazyFlg[(k<<1)+1] = true;
                lazy[(k<<1)+2] = lazy[k];
                lazyFlg[(k<<1)+2] = true;
            }
            lazy[k] = 0LL;
            lazyFlg[k] = false;
        }
    }
    void update(int a, long long x){
        update(a, a+1, x);
    }
    void update(int a, int b, long long x, int k=0, int l=0, int r=-1){
        if(a >= b) return;
        if(r == -1) r = N;
        eval(k, l, r);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b){
            lazy[k] = x;
            lazyFlg[k] = true;
            eval(k, l, r);
        }
        else{
            update(a, b, x, (k<<1)+1, l, (l+r)>>1);
            update(a, b, x, (k<<1)+2, (l+r)>>1, r);
            if(node[(k<<1)+1].first + node[(k<<1)+1].second < node[(k<<1)+2].first + node[(k<<1)+2].second){
                node[k] = node[(k<<1)+1];
            }
            else{
                node[k] = node[(k<<1)+2];
            }
        }
    }
    long long min(int a, int b, int k=0, int l=0, int r=-1){
        if(r == -1) r = N;
        if(b <= l || r <= a) return LLONG_MAX;
        eval(k, l, r);
        if(a <= l && r <= b) return node[k].first + node[k].second;
        return std::min(min(a, b, (k<<1)+1, l, (l+r)>>1), min(a, b, (k<<1)+2, (l+r)>>1, r));
    }
};

int H, W;
int A[200000], B[200000];

SegmentTree st;

signed main(){
    cin >> H >> W;
    rep(i, H){
        cin >> A[i] >> B[i];
        A[i]--;
    }

    st.init(W);
    rep(i, H){
        ll c;
        if(A[i] == 0) c = 1e18L;
        else c = st.min(A[i]-1, A[i]);
        st.update(A[i], B[i], c-A[i]+1);

        ll ans = st.min(0, W) + i + 1;
        if(ans < 1e17L) cout << ans << endl;
        else cout << -1 << endl;
    }
}

Measured memory_bytes: 21268
import math
def main():
	N = int(input())
	if N%2 == 1 or N==0:
		print(0)
	else:
		N = N//2
		P = int(math.log(N,5))
		ans = [ N//(5**p) for p in range(1,P+1)]
		print(sum(ans))

if __name__ == '__main__':
	main()

Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
#ifdef DEBUG
#define line() cerr << "[" << __LINE__ << "] ";
#define dump(i) cerr << #i ": " << i << " ";
#define dumpl(i) cerr << #i ": " << i << endl;
#else
#define line(i)
#define dump(i)
#define dumpl(i)
#endif
using namespace std;

void initquery(string &s, vector<string> &q)
{
    string t = "";
    rep(i, 1, s.size())
    {
        if (s[i] != '.')
        {
            t += s[i];
        }
        else
        {
            q.push_back(t);
            t = "";
        }
    }
    q.push_back(t);
}

int getindent(string &s)
{
    int ret = 0;
    while (s[ret] == ' ')
        ret++;
    return ret;
}

bool strcmpwithindent(string &s, string &line, int indent)
{
    rep(i, s.size())
    {
        if (s[i] != line[indent + i])
        {
            return false;
        }
    }
    return line[indent + s.size()] == ':';
}

string property(string &s)
{
    int i;
    //cerr << "*" << s << endl;
    string t = "";
    while (s[i] != ':')
    {
        i++;
    }
    i += 2;
    for (; i < s.size(); i++)
    {
        t += s[i];
    }
    return t;
}

int main(int argc, char const *argv[])
{
    string s;
    getline(cin, s);
    vector<string> query;
    initquery(s, query);
    vector<string> yaml;
    while (getline(cin, s))
    {
        yaml.push_back(s);
        //cerr << s << endl;
        //cin >> s;
    }
    //cerr << query[1] << endl;
    //cerr << "ok" << endl;
    int cur = 0;
    int curindent = 0;
    rep(i, yaml.size())
    {
        string line = yaml[i];
        int thislinesindent = getindent(line);
        if (thislinesindent < curindent)
        {
            cout << "no such property" << endl;
            return 0;
        }
        if (thislinesindent != curindent)
        {
            continue;
        }
        if (strcmpwithindent(query[cur], line, curindent))
        {
            if (cur == query.size() - 1)
            {
                string ans = property(line);
                if (ans == "")
                {
                    cout << "object" << endl;
                    return 0;
                }
                else
                {
                    cout << "string \"" << ans << "\"" << endl;
                    return 0;
                }
            }
            else
            {
                cur++;
                string tmp = property(line);
                if (tmp != "")
                {
                    cout << "no such property" << endl;
                    return 0;
                }
                else
                {
                    curindent = getindent(yaml[i + 1]);
                }
            }
        }
    }
    cout << "no such property" << endl;

    return 0;
}



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

int gcd(int x, int y){
  if(x < y){
    int k = y;
    y = x;
    x = k;
  }
  while(y > 0){
    int r = x % y;
    x = y;
    y = r;
  }
  return x;
}

int main(){
  int x, y;
  cin >> x >> y;

  cout << gcd(x, y) << endl;
}



Measured memory_bytes: 3100
solve :: Int -> Int -> [(Int, Int, Int)]
solve n y =
  [(a,b,c) |
      a <- [0..n]
    , b <- [0..n-a]
    , let c = n - a - b
    , c >= 0
    , 10000*a + 5000*b + c*1000 == y] ++ [(-1,-1,-1)]

main = do
  [n, y] <- map read . words <$> getLine :: IO [Int]
  let (a,b,c) = head $ solve n y
  putStr $ show a ++ " "
  putStr $ show b ++ " "
  putStrLn $ show c


Measured memory_bytes: 508
#!/usr/bin/env python3
from collections import Counter
import copy
n, *a = map(int, open(0).read().split())
b = dict(Counter(a))
d = copy.deepcopy(b)
for i in b:
    b[i] = b[i] * (b[i]-1)//2
c = sum(b.values())
for k in a:
    print(c - d[k] + 1)



Measured memory_bytes: 32912
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m); (i) > (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define R cin>>
#define repr(i, n) REPR(i, n, 0)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define in(a) insert(a)
#define P(p) cout<<(p)<<endl;
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SORT(a) sort((a).begin(), (a).end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
template<typename T> void co(T e){cout << e << "\n";}
template<typename T> void co(const vector<T>& v){for(const auto& e : v)
    { cout << e << " "; } cout << "\n";}
ll gcd(ll a, ll b) {
    if (a < b)swap(a, b);
    if (b == 0) return a;
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}
ll lcm(ll a, ll b) {
    ll g = gcd(a, b);
    return a * b / g;
}
bool prime(ll n) {
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n%i == 0)return false;
    }
    return n != 1;
}

Vec fac, finv;

ll PowMod(ll a, ll n){
    if(n == 1) return a;
    if(n%2 == 0) return PowMod(a*a%MOD, n/2);
    return a*PowMod(a*a%MOD, n/2)%MOD;
}

ll combi(ll n, ll k){
    if(k>n) return 0;
    return fac[n]*finv[k]%MOD*finv[n-k]%MOD;
}

int main(){
    int a, b, c;
    R a >> b >> c;
    co(a * b / 2);
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>

#ifdef PRINTERS
#include "printers.hpp"
using namespace printers;
#define tr(a)		cerr<<#a<<": "<<a<<endl;
#else
#define tr(a)    
#endif

#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b)	for(int i=a;i<b;i++)
using namespace std;
vi adj[100005];
int dfs(int u,int p){
	int cur=0;
	for(auto i:adj[u])if(i!=p){
		cur^=dfs(i,u);
	}
	return cur+1;
}
void solve(){
	int N;
	cin>>N;
	rep(i,1,N){
		int a,b;
		cin>>a>>b;
		adj[a].pb(b);
		adj[b].pb(a);
	}
	if(dfs(1,0)-1==0){
		cout<<"Bob";
	}
	else{
		cout<<"Alice";
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
//	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}

Measured memory_bytes: 10368
#include <bits/stdc++.h>
using namespace std;
#define AC 0
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s,t;
	cin>>s>>t;
	int ans=2e9;
	for(int i=0;i<=s.size()-t.size();i++) {
		int sum=0;
		for(int j=i;j<i+t.size();j++)
			if(s[j]!=t[j-i])
				sum++;
		ans=min(ans,sum);
	}
	cout<<ans<<'\n';
	return AC;
}


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

#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>

using namespace std;

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//#ifndef ONLINE_JUDGE
	////freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	//#endif
	int r;
	cin>>r;
	cout<<r*r<<endl;
	return 0;
}

Measured memory_bytes: 256
s = gets.chomp
i = s.size - 1

while i > 0
    if s[i - 4 .. i] =~ /dream|erase/
        i -= 5
    elsif s[i - 5 .. i] =~ /erase/
        i -= 6
    elsif s[i - 6 .. i] =~ /dreamer/
        i -= 7
    else
        puts "NO"
        exit
    end
end

puts "YES"

Measured memory_bytes: 3836