akhauriyash/Code-Regression huggingface dataset:
/***********************************************
 *                   _ooOoo_                   *
 *                  o8888888o                  *
 *                  88" . "88                  *
 *                  (| -_- |)                  *
 *                  O\  =  /O                  *
 *               ____/`---'\____               *
 *             .'  \\|     |//  `.             *
 *            /  \\|||  :  |||//  \            *
 *           /  _||||| -:- |||||-  \           *
 *           |   | \\\  -   * |    |           *
 *           | \_|  ''\---/''  |   |           *
 *           \  .-\__  `-`  ___/-. /           *
 *         ___`. .'  /--.--\  `. . __          *
 *      ."" '<  `.___\_<|>_/___.'  >'"".       *
 *     | | :  `- \`.;`\ _ /`;.`/ - ` : | |     *
 *     \  \ `-.   \_ __\ /__ _/   .-` /  /     *
 *======`-.____`-.___\_____/___.-`____.-'======*
 *                   `=---='                   *
 *^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

             佛祖保佑       永无BUG

   本程序已经经过开光处理，绝无可能再产生bug
 **********************************************/
#include<algorithm>
#include <iostream>
#include  <cstdlib>
#include  <cstring>
#include   <string>
#include   <vector>
#include   <cstdio>
#include    <queue>
#include    <stack>
#include    <ctime>
#include    <cmath>
#include      <map>
#include      <set>
#define ll long long
#define INF 0x3f3f3f3f
#define db1(x) cout<<#x<<"="<<(x)<<endl
#define db2(x,y) cout<<#x<<"="<<(x)<<", "<<#y<<"="<<(y)<<endl
#define db3(x,y,z) cout<<#x<<"="<<(x)<<", "<<#y<<"="<<(y)<<", "<<#z<<"="<<(z)<<endl
using namespace std;

char s[110];

int main(void)
{
    #ifdef test
    freopen("in.txt","r",stdin);
    //freopen("in.txt","w",stdout);
    clock_t start=clock();
    #endif //test

    int L;scanf("%d",&L);
    double l=(L*1.0)/3.0;
    printf("%f\n",l*l*l);

    #ifdef test
    clockid_t end=clock();
    double endtime=(double)(end-start)/CLOCKS_PER_SEC;
    printf("\n\n\n\n\n");
    cout<<"Total time:"<<endtime<<"s"<<endl;        //s为单位
    cout<<"Total time:"<<endtime*1000<<"ms"<<endl;    //ms为单位
    #endif //test
    return 0;
}


// ━━━━━━神兽出没━━━━━━
//      ┏┓       ┏┓
//     ┏┛┻━━━━━━━┛┻┓
//     ┃           ┃
//     ┃     ━     ┃
//     ????━????   ┃
//     ┃           ┃
//     ┃    ┻      ┃
//     ┃           ┃
//     ┗━┓       ┏━┛
//       ┃       ┃
//       ┃       ┃
//       ┃       ┗━━━┓
//       ┃           ┣┓
//       ┃           ┏┛
//       ┗┓┓┏━━━━━┳┓┏┛
//        ┃┫┫     ┃┫┫
//        ┗┻┛     ┗┻┛
//
// ━━━━━━感觉萌萌哒━━━━━━


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	while(1){
		int n,p[1000],q[1000],r[1000],i[1000];
		cin>>n;
		if(n==0)break;
		for(int k=0;k<n;k++){
			cin>>i[k]>>p[k]>>q[k]>>r[k];
	}
		int P,Q,R,C,c=0;
		cin>>P>>Q>>R>>C;
		for(int k=0;k<n;k++){
		if(p[k]<=P&&q[k]<=Q&&r[k]<=R&&4*p[k]+9*q[k]+4*r[k]<=C){
			cout<<i[k]<<endl;
			c++;
		}
		}
		if(!c)cout<<"NA"<<endl;
	}
	return 0;
}

Measured memory_bytes: 1176
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define N 200010
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return x*f;
}
int n,m,a[N],b[N];
int main(){
	n=read(),m=read();
	for(int i=1;i<=n;++i){
		a[i]=read();
	}
	for(int T=1;T<=m;++T){
		memset(b,0,sizeof(b));
		for(int i=1;i<=n;++i){
			b[max(1,i-a[i])]++,b[min(n+1,i+a[i]+1)]--;
		}
		bool ok=true;
		for(int i=1;i<=n;++i){
			b[i]+=b[i-1];
			if(b[i]<n)ok=false;
		}
		swap(a,b);
		if(ok)break;
	}
	for(int i=1;i<=n;++i){
		printf("%d ",a[i]);
	}
	return 0;
}


Measured memory_bytes: 5264
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#define mp make_pair
#define pb push_back
#define ll long long
#define kl k<<1
#define kr k<<1|1
using namespace std;
inline ll read(){ll s=0,w=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();return s*w;}
void put1(){ puts("YES") ;}void put2(){ puts("NO") ;}void put3(){ puts("-1"); }
ll qp(ll a,ll b, ll p){ll ans = 1;while(b){if(b&1){ans = (ans*a)%p;--b;}a =
(a*a)%p;b >>= 1;}return ans%p;}

const int manx=1e5+5;
const int mo=998244353;

map<pair<ll,ll>,ll>gc;

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

int main(){
    ll n=read(),ans=0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            for(int k=1;k<=n;k++){
                ll x=gcd(i,j);
                ll y=gcd(x,k);
                ans+=y;
            }
        }
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 3160
N = int(input())
A = [int(_) for _ in input().split()]
B = [int(_) for _ in input().split()]
C = [int(_) for _ in input().split()]

ans = 0
i_ = 20

for k in range(N):
    i = A[k] - 1
    ans += B[i - 1]
    if i == i_ + 1:
        ans += C[i_]
    
    i_ = i

print(ans)

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    int n,m;
    cin>>n>>m;
    vll a(n);rep(i,n)cin>>a[i].F>>a[i].S;
    sort(all(a));
    ll sum=0,cnt=0,fin=0;
    rep(i,n){
        sum+=a[i].F*a[i].S;cnt+=a[i].S;fin=i;
        if(cnt>=m)break;
    }
    while(cnt>m){
        cnt--;
        sum-=a[fin].F;
    }
    cout<<sum;
}

Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int sum = 0;

		//数値を文字列に変換
		String str = String.valueOf(N);

		for (int i = 0; i < str.length(); i++) {
			String sub = str.substring(i,i+1);
			int x = Integer.parseInt(sub);

			sum = sum + x;
		}

		if (N%sum == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 23124
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>

#define range(i, n) for (int i = 0; i < n; i++) 
#define rrange(i, n) for(int i = n-1; i>=0; i--)

typedef long long int ll;


using namespace std;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

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

	ll N, M, C;
	ll A[25][25];
	ll B[25];

	cin >> N >> M >> C;

	range(i, M) {
		cin >> B[i];
	}

	ll d = 0;
	ll count = 0;
	range(i, N) {
		d = 0;
		range(k, M) {
			cin >> A[i][k];
			d += A[i][k] * B[k];
		}
		d += C;
		if (d > 0) count++;
	}


	cout << dec << count;


	return 0;
}


Measured memory_bytes: 256
S = input()
a = list(S)
L = int(len(a))
t = int(L // 2)
k = int(t // 2)
p = int(t + 2)

while L % 2 == 0:
    S = input()
    a = list(S)
    L = int(len(a))
    t = int(L // 2)
    k = int(t // 2)
    p = int(t + 2)

for i in range(t) :
    if a[i] == a[L - 1 - i]:
        continue
    else:
        print('No')
        break
else:
    for i in range(k):
        if a[i] == a[t - 1 - i]:
            continue
        else:
            print('No')
            break
    else:
        for i in range(k):
            if a[p - 1 + i] == a[L - 1 - i]:
                continue
            else:
                ptint('No')
                break
        else:
            print('Yes')


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;

template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

vector<int>A, v;
int cnt = 0;
int x = 0;
int dfs(int k = 0) {
	if (v[k] > -1)return x=v[k];
	v[k] = cnt;
	cnt++;
	dfs(A[k] - 1);
	return x;
}

int main() {
	init();

	int N; cin >> N;
	ll K; cin >> K;
	A.resize(N);
	rep(i, 0, N) {
		cin >> A[i];
	}
	v.resize(N, -1);
	int x = dfs();
	if (x == 0) {
		K %= cnt;
		rep(i, 0, N) {
			if (v[i] == K)cout << i + 1 << "\n";
		}
	}
	else {
		if (K < cnt) {
			rep(i, 0, N) {
				if (v[i] == K)cout << i + 1 << "\n";
			}
		}
		else {
			K -= (ll)cnt ;
			int a = cnt - x;
			K %= a;
			rep(i, 0, N) {
				if ((v[i]-x)==K)cout << i + 1 << "\n";
			}
		}
	}
	return 0;
}

Measured memory_bytes: 7948
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define Graph vector<vector<int>>
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000007;

int main(){
    int H, W;
    cin >> H >> W;
    vector<string> S(H);
    rep(i, H) cin >> S[i];
    Graph U(H, vector<int>(W, 0)), L(H, vector<int>(W, 0));

    rep(i, H){
        rep(j, W){
            if(S[i][j] == '#') continue;
            
            if(j == 0) L[i][j] = 1;
            else L[i][j] = L[i][j - 1] + 1;

            if(i == 0) U[i][j] = 1;
            else U[i][j] = U[i - 1][j] + 1;
        }
    }

    Graph D(H, vector<int>(W)), R(H, vector<int>(W));


    for(int i = H - 1; i >= 0; i--){
        for(int j = W - 1; j >= 0; j--){
            if(S[i][j] == '#') continue;
            
            if(j == W - 1) R[i][j] = 1;
            else R[i][j] = R[i][j + 1] + 1;

            if(i == H - 1) D[i][j] = 1;
            else D[i][j] = D[i + 1][j] + 1;
        }
    }

    int ans = 0;

    rep(i, H){
        rep(j, W){
            if(S[i][j] == '#') continue;
            int tmp = U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3;
            ans = max(ans, tmp);
        }
    }

    cout << ans << endl;
    
}

Measured memory_bytes: 67200
#include <iostream>

using namespace std;

int main()
{
   int n;
   cin >> n;
   if(n <= 9)
   cout << n;
   else if(n <= 99)
   cout << 9;
   else if (n <= 999)
   cout << n - 90;
   else if(n <= 9999)
   cout << 909;
   else if(n <= 99999)
   cout << n - 9090;
   else
   cout << 90909; 
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
  	int t = 0;
 	cin>>t;
  	int arr[4]= {0,0,0,0};
  	while(t--)
    {
      	string s;
      	cin>>s;
      	switch(s[0])
        {
          case 'A':	    arr[0]++;
            			break;
          case 'W':	    arr[1]++;
            			break;
		  case 'T':	    arr[2]++;
            			break;
          case 'R':	    arr[3]++;
            			break;
        }
    }
    cout<<"AC x "<<arr[0]<<endl;
    cout<<"WA x "<<arr[1]<<endl;
    cout<<"TLE x "<<arr[2]<<endl;
    cout<<"RE x "<<arr[3]<<endl;
}

Measured memory_bytes: 3592
import java.io.*;
import java.util.*;
public class Main {
	public static class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
	}

	public static int abs(int x) { if (x < 0) return -x; return x; }

	public static void main(String[] args) {
		FS in = new FS();
		
		int sum = 6;
		for (int i = 0; i < 2; i++)
			sum -= in.nextInt();
		System.out.println(sum);
	}
}


Measured memory_bytes: 19156
#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <vector>
#include <iomanip>
#include <sstream>
#include <utility>
#include <iterator>
#include <algorithm>
#include <functional>
#define rep(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define pq priority_queue<int,vector<int>,greater<int>>
#define ll long long
//#define int long long

using namespace std;

typedef pair<int, int> pi;
int n, m, c[26];
string s;
int main() {
	cin >> s;
	rep(i, s.size()) {
		c[s[i] - 'a']++;
	}
	rep(i, 26) {
		if (c[i] == 0) {
			cout << char('a' + i) << endl;
			return 0;
		}
	}
	cout << "None" << endl;
	return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF = 100000000;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
ll n,ans;
vector<int> abcd(4);

  
int main(){
  vector<int> price={500,100,50,10,5,1};
  while(1){
    int x;
    cin >> x;
    if(x==0)break;
    int y = 1000-x;
    int coins=0;
    rep(i,6){
      int t = y/price[i];
      y -= t*price[i];
      coins += t;
    }
    cout << coins << endl;
  }
  return 0;
}


Measured memory_bytes: 3092
import java.util.Scanner;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    int k = scan.nextInt();
    int sum = 0;

    for (int i = 0; i < num; i++){
      int s = scan.nextInt();
      if(s >= k){
        sum+=1;
      }
    }
    System.out.println(sum);
  }
}


Measured memory_bytes: 46532
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric>
#include<vector>
#include<map>
using namespace std;

int main(){
  long long n;
  cin >> n;
  long long a[n];
  for (int i=0;i<n;i++){
    cin >> a[i];
  }
  int count = 0;
  for (int i=0;i<n;i++){
    while(a[i]%2 == 0){
      a[i] /= 2;
      count += 1;
    }
  }

  cout << count << endl;
  return 0;
}


Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main()
{
    int s;
    int m;
    int h;
    cin >>s;
    h=s/3600;
    m=(s%3600)/60;
    s=(s%3600)%60;
     cout << h << ":" << m << ":" << s << endl;
    
    return 0;
}


Measured memory_bytes: 3104
def t(A):
    ret = []
    for i in range(len(A[0])):
        r = []
        for j in range(len(A)):
            r.append(A[j][i])
        ret.append("".join(r))
    return ret

def d(A):
    ret = []
    for r in A:
        if r.count("#") > 0:
            ret.append(r)
    return ret

H, W = map(int, input().split())
A = [input() for _ in range(H)]

A = t(d(A))
A = t(d(A))
for r in A:
    print(r)


Measured memory_bytes: 3064
fn main() {
    let (_, k) = {
        let tmp: Vec<i32> = read_vec();
        (tmp[0], tmp[1])
    };

    let h: Vec<i32> = read_vec();
    let ans = h.into_iter().filter(|&x| x >= k).count();

    println!("{}", ans);
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

Measured memory_bytes: 4352
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
# include <cstdlib>
# include <tuple>
# include <array>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define RALL(qpqpq)           (qpqpq).rbegin(),(qpqpq).rend()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define RFOR(i,tptpt,ypypy)  for(LL i=(tptpt);i>=(ypypy);i--)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int n, m;
LL x[101010], y[101010], z[101010];


int main() {
	cin >> n >> m;
	REP(i, n) {
		cin >> x[i] >> y[i] >> z[i];
	}
	LL ans = -LINF;
	REP(k, 8) {
		vector<LL> v;
		REP(i, n) {
			LL num = 0;
			if (1 << 2 & k)num += x[i];
			else num -= x[i];
			if (1 << 1 & k)num += y[i];
			else num -= y[i];
			if (1 << 0 & k)num += z[i];
			else num -= z[i];
			v.emplace_back(num);
		}
		sort(ALL(v));
		reverse(ALL(v));
		LL sum = 0;
		REP(i, m) {
			sum += v[i];
		}
		ans = max(ans, sum);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
  int n, m;
  cin >> n >> m;
  char a[51][51], b[51][51];
  for (int i = 0; i < n; i++)
  {
    scanf("%s", a[i]);
  }
  for (int j = 0; j < m; j++)
  {
    scanf("%s", b[j]);
  }
  bool flag = false;
  for (int i = 0; i <= n - m; i++)
  {
    for (int j = 0; j <= n - m; j++)
    {
      bool f = true;
      for (int k = 0; k < m; k++)
      {
        for (int l = 0; l < m; l++)
        {
          if (a[i + k][j + l] != b[k][l])
          {
            f = false;
            k = l = m;
          }
        }
      }
      if (f)
      {
        flag = true;
        i = j = n;
      }
    }
  }
  cout << (flag ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;


int main() {
    double n, m;
    cin >> n >> m;
    double count = 0;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
        count += a.at(i);
    }
    sort(a.rbegin(), a.rend());
    bool x = false;
    for (int i = 0; i < m; i++) {
        if (a.at(i) < count / (4 * m)) {
            x = true;
        }
    }
    if (x) {
        cout << "No" << endl;
    }
    else {
        cout << "Yes" << endl;
    }


}

Measured memory_bytes: 3760
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))


def solve():
    n = ri()
    A = rl()
    A.sort(reverse=True)

    ans = 0
    pos = 0
    for i in range(1, len(A)):
        # print (i, pos, A[pos])
        ans += A[pos]
        if i % 2 == 1:
            pos += 1
    print (ans)






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()


Measured memory_bytes: 105764
N, Y = map(int, input().split())
 
#10000:a, 5000:b, 1000:c
for a in range(N+1):
    for b in range(N+1-a):
        c = N - a - b
        if 10000 * a + 5000 * b + 1000 * c == Y:
            print(a, b, c)
            exit()
print(-1, -1, -1)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i = 0; i < N; i++) cin >> A.at(i);
    sort(A.begin(), A.end());
    reverse(A.begin(), A.end());
    
    int a = 0, b = 0;
    for(int i = 0; i < N-1; i++) {
        if(A.at(i)==A.at(i+1)) {
            b = a;
            a = A.at(i);
            i++;
        }
        if(a!=0 && b!=0) break;
    }
    
    cout << (long long)a*b << endl;
}


Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n,cnt=0;
  bool b_mi,a_mi,b_ma,a_ma;
  cin >> n;
  int p[n];
  for(int i=0;i<n;i++){
    cin >> p[i];
  }
  for(int i=1;i<n-1;i++){
    if((p[i]<p[i+1]&&p[i-1]<p[i])||(p[i]>p[i+1]&&p[i]<p[i-1]))cnt++;
  }
  cout <<cnt<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int INF=10000000;
const int mod=1e9+7;
int a[100005];
int n;
int extgcd(int a,int b,int& x,int& y)
{
    int d=a;
    if(b!=0)
    {
        d=extgcd(b,a%b,y,x);
        y-=(a/b)*x;
    }
    else
    {
        x=1;
        y=0;
    }
    return d;
}
void trace()
{
    for(int i=0;i<n;i++)
    {
        if(i)
            printf(" ");
        printf("%d",a[i]);
    }
    printf("\n");
}
void ins()
{
    int tmp,j;
    for(int i=1;i<n;i++)
    {
        tmp=a[i];
        j=i-1;
        while(j>=0&&a[j]>tmp)
        {
            a[j+1]=a[j];
            j--;
        }
        a[j+1]=tmp;
        trace();
    }
}
int main()
{
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    trace();
    ins();
    return 0;
}



Measured memory_bytes: 3208
#include <bits/stdc++.h>
using namespace std;
const int maxn=100000+10;
int n,m,ans,a[maxn],b[maxn];

int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) b[i]=1;
	a[1]=1;int x,y;
	while(m--){
		scanf("%d%d",&x,&y);
		if(a[x]==1){
			if(b[x]==1) a[x]=0;
			a[y]=1;
		}
		b[x]--;b[y]++;
	}
	for(int i=1;i<=n;i++)
		if(a[i]&&b[i]) ans++;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
	static Scanner src = new Scanner(System.in);
	public static void main(String[] args) {
		int k = src.nextInt();
		String str = src.next();
		if(str.length() > k) {
			str = str.substring(0, k) + "...";
		}
		System.out.println(str);
	}
}


Measured memory_bytes: 38652
#include<bits/stdc++.h>
using namespace std;
#define int unsigned long long int

signed main(){
    int a,b,c;
    cin >> a >> b >> c;
    int ans = 0;
    ans += (b / c);
    ans -= (a / c);
    if(a % c == 0)
    ans++;
    cout << ans << endl;
}

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

int main() {
    string s;
    cin >> s;
    int a, b;
    a = b = -1;
    if (s[0] == s[1]) {
        a = 1;
        b = 2;
    } 
    for (int i = 2; i < s.size(); i++) {
        if (s[i-2] == s[i]) {
            a = i-2 + 1;
            b = i + 1;
            break;
        } else if (s[i-1] == s[i]) {
            a = i - 1 + 1;
            b = i + 1;
            break;
        }
    }
    printf("%d %d\n", a, b);
    return 0;
}

Measured memory_bytes: 512
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b) {
  return b ? GCD(b,a%b) : a;
}


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




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

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll n;
  cin>>n;
  vector<ll> v(n);
  rep(i,n) cin>>v[i];
  set<ll> st;
  rep(i,n){
    st.insert(v[i]);
  }
  if(st.size()==n) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}

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

using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pair<int, int> > vp;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define out(n) cout << (n) << endl;

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  out(a <= c && b >= c ? "Yes" : "No")
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	ll N,A[5];
	scan(N);
	rep(i,5) scan(A[i]);
	sort(A,A+5);
	ll minA=A[0];
	prin(N/minA+(N%minA!=0)+4);

	return 0;
}


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

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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; }

typedef long long ll;
typedef pair<ll, ll> p;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int k, n;
  cin >> k >> n;
  vector<ll> v(n);
  rep(i, n) cin >> v[i];

  // ll res = 0;
  // ll index = -1;
  ll maxd = k-v[n-1]+v[0];
  for (int i = 0; i < n-1; ++i) {
    maxd = max(maxd, v[i+1]-v[i]);
    // if(v[i+1] - v[i] > maxd){
    //   maxd = v[i+1] - v[i];
    //   // index = i;
    // }
  }
  // cout << maxd << endl;
  cout << k - maxd << endl;
}


Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int main() {
  int a, b, n, i, s;
  while (cin >> a >> b >> n) {
    s = 0;
    a %= b;
    for (i = 0; i < n; i++) { a *= 10; s += (a / b) % 10; a %= b; }
    cout << s << endl;
  }
}

Measured memory_bytes: 1156
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>

using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	int N, K;
	cin >> N >> K;
	cout << (N % K != 0) << endl;

	return 0;
}


Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Sagor
 */

#include <fstream>
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <deque>
#include <stack>
#include <vector>
#include <iomanip>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>

#define gap                        ' '
#define EPS                        1e-9
#define P_INF                      2e9+17
#define N_INF                     -2e9-17
#define MOD                        1000000007
#define PI                         2*acos(0.0)
#define All(x)                     x.begin(),x.end()
#define Mem(Name, type)            memset(Name, type, sizeof(Name))

template<typename T>
T GCD(T a, T b) { return a ? GCD(b % a, a) : b; }

template<typename T>
T LCM(T a, T b) { return (a * b) / GCD(a, b); }

template<typename T>
std::ostream &operator<<(std::ostream &os, const std::vector<T> &v) {
    for (auto ob : v) os << ob << " ";
    return os;
}

template<typename T, typename S>
std::ostream &operator<<(std::ostream &os, const std::map<T, S> &v) {
    for (auto ob : v) os << ob.first << " : " << ob.second << std::endl;
    return os;
}

using ld = double;
using ll = long long int;
using ul = unsigned long long int;
using namespace std;

class ATakoyaki {
public:
    void solve(std::istream &in, std::ostream &out) {
        int n, x, t;
        in >> n >> x >> t;
        int p = (int) ceil((double) n / x);
        out << p * t << endl;
    }
};


int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    ATakoyaki solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 3652
#include <iostream>
#include <cmath>
#include <string>
#include <typeinfo>
#include <climits>
#include <algorithm>
#include <cctype>
#include <stdio.h>
#include <cstdlib>
using namespace std;

int main(){
    char s[5];
    cin >> s;
    if(s[0]==s[1]&&s[1]==s[2]){
        cout << "Yes";
    }else if(s[1]==s[2]&&s[2]==s[3]){
        cout << "Yes";
    }else{
        cout << "No";
    }

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//Fast io
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
//Class shorthands
#define ll long long
#define db long double
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mi map<int,int>
#define mii map<pii,int>
//Function Shorthands
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define mp make_pair
#define po pop_back
#define eb emplace_back
//Code Shorthands
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repe(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=b;i>=a;i--)
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
//Constants
#define hell 1000000007
#define PI acos(-1.0)
using namespace std;

void solve(){
	int n;
	cin>>n;
	int a[n];
	rep(i,0,n) cin>>a[i];
	int mh = a[0];
	ll ans = 0;
	for(auto i:a){
		if(mh<i) mh = i;
		if(i<mh){
			ans+=(mh-i);
		}
	}
	cout<<ans<<endl;
}

int main(){
	io;
	int t = 1;
	//cin>>t;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 4432
while True:
    array = input().strip().split()
    x=int(array[0])
    y=int(array[2])
    if array[1]=="+":
        z=x+y
    elif array[1]=="*":
        z=x*y
    elif array[1]=="-":
        z=x-y
    elif array[1]=="/":
        z=x//y
    else:
        break
    print(z)


Measured memory_bytes: 5596
#include<stdio.h>

void swap(int *x,int *y);

int main(void){
  int a,b,c,temp,i;

  scanf("%d %d %d",&a,&b,&c);

  while(a>b || b>c){
  
    if(b>c){
      swap(&b,&c);
    }
    if(a>b){
      swap(&a,&b);
    }

  }
  
  
  printf("%d %d %d\n",a,b,c);

}


void swap(int *x,int *y){
  int temp;
  temp=*x;
  *x=*y;
  *y=temp;
}
  
  
    



Measured memory_bytes: 2032
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>

using namespace std;

int main()
{
    int64_t N, M;
    std::cin >> N >> M;

    std::vector<int64_t> balls(N, 1);
    std::unordered_set<int64_t> S;

    S.insert(0);
    for (size_t i = 0; i < M; ++i) {
        int64_t x, y;
        std::cin >> x >> y;
        x--;
        y--;

        balls[x]--;
        balls[y]++;

        if (S.find(x) != S.end()) {
            S.insert(y);
            if (balls[x] == 0) {
                S.erase(x);
            }
        }

    }
    std::cout << S.size() << std::endl;

    return 0;
}


Measured memory_bytes: 5156
#include<stdio.h>

int main()
{
  double a, b;
  
  scanf("%lf", &a);
  scanf("%lf", &b);
  
  if(a > b)	puts("GREATER");
  else if(a < b)	puts("LESS");
  else if(a = b)	puts("EQUAL");
  return 0;
}

Measured memory_bytes: 128
from datetime import date

M1,D1=map(int, input().split())
M2,D2=map(int, input().split())

dt1 = date(2019,M1,D1)
dt2 = date(2019,M2,D2)

d = dt2 - dt1
d = d.days

if d != 1:
    print(0)
else:
    if M1 == 1 and D1 == 31:
        print(1)
    elif M1 == 2 and D1 == 28:
        print(1)
    elif M1 == 3 and D1 == 31:
        print(1)
    elif M1 == 4 and D1 == 30:
        print(1)
    elif M1 == 5 and D1 == 31:
        print(1)
    elif M1 == 6 and D1 == 30:
        print(1)
    elif M1 == 7 and D1 == 31:
        print(1)
    elif M1 == 8 and D1 == 31:
        print(1)
    elif M1 == 9 and D1 == 30:
        print(1)
    elif M1 == 10 and D1 == 31:
        print(1)
    elif M1 == 11 and D1 == 30:
        print(1)
    elif M1 == 12 and D1 == 31:
        print(1)
    else:
        print(0)

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

using namespace std;

typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	float r;
	cin >> r;
//	float x = 
//	cout << x << "\n";
	double c=3.1415926535897932384626433832795;
	cout << fixed << setprecision(20) << 2*c*r << "\n";
}



Measured memory_bytes: 3792
# -*- coding: utf-8 -*-

import sys
import os
import math


N = int(input())

E = []
E.append([])
d = [-1] * (N + 1)

for i in range(N):
    lst = list(map(int, input().split()))
    nodes = lst[2:]
    E.append(nodes)
#print(E)

q = []
q.append(1)

visited = [False] * (N + 1)
d[1] = 0
visited[1] = True

while q:
    index = q.pop(0)

    # ???????????????????????´???
    for v in E[index]:
        if not visited[v]:
            q.append(v)
            d[v] = d[index] + 1
            visited[v] = True

#print(d)
for i in range(1, N + 1):
    print(i, d[i])

Measured memory_bytes: 7748
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#include <vector>

typedef long long ll;
#define fi first
#define se second

const ll mod = 1000000007;
//              123456789

using namespace std;

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

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


int a[212345];
int N;

int main(){
  
  cin>>N;
  int i;
  
  for( i = 0; i < N; i++ ){
  	scanf("%d", a+i);
  }
  
  for( i = N-1; i >= 0; i -= 2 ){
  	if( i != N-1 ) printf(" ");
  	printf("%d", a[i]);
  	
  }
  
  for( i = N%2; i < N; i += 2){
  	printf(" %d", a[i]);
  }

  
  return 0;
}

Measured memory_bytes: 2944
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int n, l, t, a[100001], cnt;
int main(int argc, char const *argv[])
{
    scanf("%d%d%d", &n, &l, &t);
    for (int i = 1; i <= n; i++)
    {
        int op;
        scanf("%d%d", &a[i], &op);
        a[i] += op == 1 ? t : -t;
        cnt += a[i] / l;
        if (a[i] % l < 0)
        {
            cnt--;
        }
        a[i] = (a[i] % l + l) % l;
    }
    sort(a + 1, a + n + 1);
    cnt = (cnt % n + n) % n;
    for (int i = cnt + 1; i <= n; i++)
    {
        printf("%d\n", a[i]);
    }
    for (int i = 1; i <= cnt; i++)
    {
        printf("%d\n", a[i]);
    }
    return 0;
}

Measured memory_bytes: 4084
using System;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int inputNumber = int.Parse(Console.ReadLine());
            int[] inputValues = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            int maxContinuousDecrease = 0;
            int currentContinuousDecrease = 0;
            int lastHeight = 0;
            for (int i = 0; i < inputNumber; i++)
            {
                if (lastHeight >= inputValues[i])
                {
                    currentContinuousDecrease++;
                }
                else
                {
                    maxContinuousDecrease = Math.Max(maxContinuousDecrease, currentContinuousDecrease);
                    currentContinuousDecrease = 0;
                }
                lastHeight = inputValues[i];
            }
            maxContinuousDecrease = Math.Max(maxContinuousDecrease, currentContinuousDecrease);

            Console.WriteLine(maxContinuousDecrease.ToString());
        }
    }
}


Measured memory_bytes: 30300
#include<stdio.h>
int main(void)
{
	int b,a;
	char op;
	scanf("%d %c",&b,&op);
	while(op!='=')	{
	
		if(op=='+')	{
			scanf("%d",&a);
			b+=a;
		}
		if(op=='-')	{
			scanf("%d",&a);
			b-=a;
		}
		if(op=='*')	{
			scanf("%d",&a);
			b*=a;
		}
		if(op=='/')	{
			scanf("%d",&a);
			b/=a;
		}
		scanf("%c",&op);
	}
	
	printf("%d\n",b);
	return 0;	
}

Measured memory_bytes: 1024
#include<iostream>
#define looop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

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

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

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
//------------------------------------------

//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define in(x) cin >> x
#define co(x) cout << x << endl
#define dump(x)  cout << #x << " = " << (x) << endl
//------------------------------------------

int main() {
  LL N;
  in(N);
  co(1110-N);
  
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h" 
using namespace std;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define rerep(i,a,n) for(ll i=n;i>=a;i--)
#define elif else if
#define all(s) s.begin(),s.end()
typedef long long ll;
int gcd(int a,int b){
    if(a<b)swap(a,b);
    if(a%b==0)return b;
    else return gcd(b,a%b);
}
const ll INF = 10e9;
int main(){
    ll k;
    cin>>k;
    string s;
    cin>>s;
    if(k>=s.size())cout<<s<<endl;
    else{
        rep(i,0,k){
            cout<<s[i];
        }
        cout<<"..."<<endl;
    }

}

Measured memory_bytes: 3628
#include <stdio.h>
#include <stdlib.h>

int main()
{
	int i, N;
	long long A[200001];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%lld", &(A[i]));
	
	long long sum = 0, total = 0, cost;
	for (i = 1; i <= N; i++) total += A[i];
	for (i = 1; sum < total / 2; i++) sum += A[i];
	if (sum * 2 == total) cost = 0;
	else if (sum * 2 - total < total - (sum - A[i-1]) * 2) cost = sum * 2 - total;
	else cost = total - (sum - A[i-1]) * 2;
	
	printf("%lld\n", cost);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long int
struct goods{
    ll x, y, val;
};
ll dp[3001][3001][4], val[3001][3001];
int main(){
    ll r, c, n, x, y, ans=0;
    cin>>r>>c>>n;
    for (ll i=1; i<=n; i++) cin>>x>>y, cin>>val[x][y];
    for (ll i=1; i<=r; i++){
        for (ll j=1; j<=c; j++){
            for (ll k=3; k>=0; k--){
                dp[i][j][k]=max(dp[i][j][k], max(dp[i-1][j][3], dp[i][j-1][k]));
                if (k!=3) dp[i][j][k+1]=max(dp[i][j][k+1], dp[i][j][k]+val[i][j]);
            }
        }
    }
    for (ll i=0; i<=3; i++) ans=max(ans, dp[r][c][i]);
    cout<<ans<<endl;
}

Measured memory_bytes: 355000
n=int(input())
a = list(input() for i in range(n))
a = [int(i) for i in a]
inc = 0
inc2 = 0

a.sort()

for i in range(n) :
    if inc2 == 0 :
        inc += 1
    
    if i == n -1 :
        break
    if a[i] == a[i+1] :
        inc2 = 1
    else :
        inc2 = 0

print(inc)

Measured memory_bytes: 3064
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b = LI()
    if a + b >= 10:
        print("error")
    else:
        print(a + b)
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()


Measured memory_bytes: 38512
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;


int main(){
  ll r; cin >> r;
  cout << r*r << endl;
}

Measured memory_bytes: 256
import java.util.Arrays; 
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char[] input = sc.nextLine().toCharArray();
		
		
		int j_count = 0, o_count = 0, i_count = 0;
		int stat = 0;
		
		int max = 0;
		
		for(int i = 0; i < input.length; i++){
			//System.out.println(j_count + " " + o_count + " " + i_count);
			
			switch(stat){
			case 0:
				if(input[i] == 'J'){
					j_count++;
				}else if(input[i] == 'O'){
					o_count = 1;
					stat = 1;
				}else{
					stat = 0;
					j_count = 0;
					o_count = 0;
					i_count = 0;
				}
				break;
			case 1:
				if(input[i] == 'O'){
					o_count++;
				}else if(input[i] == 'I'){
					i_count = 1;
					stat = 2;
				}else if(input[i] == 'J'){
					stat = 0;
					j_count = 1;
					o_count = 0;
					i_count = 0;
				}else{
					stat = 0;
					j_count = 0;
					o_count = 0;
					i_count = 0;
				}
				break;
			case 2:
				if(input[i] == 'I'){
					i_count++;
				}else if(input[i] == 'J'){
					stat = 0;
					if(o_count <= i_count && o_count <= j_count){
						max = Math.max(max, o_count);
					}
					j_count = 1;
					o_count = 0;
					i_count = 0;
				}else{
					stat = 0;
					if(o_count <= i_count && o_count <= j_count){
						max = Math.max(max, o_count);
					}
					j_count = 0;
					o_count = 0;
					i_count = 0;
				}
				break;
			}
		}
		
		if(o_count <= i_count && o_count <= j_count){
			max = Math.max(max, o_count);
		}
		System.out.println(max);
	}
}

Measured memory_bytes: 18000