akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

public class Main {
	class Pazzle {
		int y, x;
		int[][] board;
		Pazzle(int y, int x, int[][] board) {
			this.y = y;
			this.x = x;
			this.board = new int[N][N];
			for (int i = 0; i < N; i++)
				for (int j = 0; j < N; j++)
					this.board[i][j] = board[i][j];
		}
		Pazzle(Pazzle p) {
			this.y = p.y;
			this.x = p.x;
			board = new int[N][N];
			for (int i = 0; i < N; i++)
				for (int j = 0; j < N; j++)
					board[i][j] = p.board[i][j];
		}
		String boardToString() {
			String str = "";
			for (int i = 0; i < N; i++) {
				for (int j = 0; j < N; j++) {
					str += Integer.toString(board[i][j]);
				}
			}
			return str;
		}
		void swapBoard(int ny, int nx) {
			int tmp = board[y][x];
			board[y][x] = board[ny][nx];
			board[ny][nx] = tmp;
			y = ny;
			x = nx;
		}
		void printDebug() {
			for (int i = 0; i < N; i++) {
				for (int j = 0; j < N; j++)
					System.out.print(board[i][j] + " ");
				System.out.println();
			}
			System.out.println();
		}
	}
	final int N = 3;
	int[][] board;
	void run() {
		Scanner scan = new Scanner(System.in);

		board = new int[N][N];
		int y = 0, x = 0;
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				board[i][j] = scan.nextInt();
				if (board[i][j] == 0) {
					y = i;
					x = j;
				}
			}
		}
		Queue<Pazzle> que = new LinkedList<Pazzle>();
		HashSet<String> hash = new HashSet<String>();
		que.add(new Pazzle(y, x, board));
		String ansPazzle = "123456780";
		int ans = 0;
		int[] dy = { 1, 0, -1, 0 };
		int[] dx = { 0, 1, 0, -1 };
		while (!que.isEmpty()) {
			int length = que.size();
			for (int i = 0; i < length; i++) {
				Pazzle p = que.poll();
				String boardStr = p.boardToString();
				if (boardStr.equals(ansPazzle)) {
					System.out.println(ans);
					return;
				}
				hash.add(boardStr);
				for (int j = 0; j < 4; j++) {
					int ny = p.y + dy[j];
					int nx = p.x + dx[j];
					if (ny >= 0 && nx >= 0 && ny < N && nx < N) {
						Pazzle np = new Pazzle(p);
						np.swapBoard(ny, nx);
						if (hash.contains(np.boardToString()))
							continue;
						que.add(np);
					}
				}
			}
			ans++;
		}
	}
	public static void main(String[] args) {
		new Main().run();
	}
}


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

int main(){
	int N;
	string str;
	cin>>N>>str;
	vector<bool> s(N+1),a(N+2);
	rep(i,N) s[i] = str[i]=='o';
	s[N] = s[0];
	rep(x,2)rep(y,2){
		a[0]=x, a[1]=y;
		rep1(i,N) a[i+1] = a[i-1]==(a[i]==s[i]);
		if(a[0]==a[N] && a[1]==a[N+1]){
			rep(i,N)cout<<"WS"[a[i]];
			cout<<endl;
			return 0;
		}
	}
	cout<<-1<<endl;
	return 0;
}


Measured memory_bytes: 512
#include<stdio.h>

int main(void)
{
int A,B,K,C,p,q,kotae,i;

        scanf("%d%d%d",&A,&B,&K);

        if(A>B) C=A;
        else C=B;

        for(i=C; i>0; i--){
           p=A%i;
           q=B%i;
                if((p==0) && (q==0)){
                        kotae++;
                if(K==kotae){ printf("%d\n",i);
        return 0;}
        }
}

        return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;

main() {
    int64_t n, k;
    cin >> n >> k;

    vector<int64_t> h(n);
    for (auto&& hh : h) {
        cin >> hh;
    }

    vector<int64_t> cost(n);
    for (auto i : irange(1L, n)) {
        cost[i] = cost[i - 1] + abs(h[i] - h[i - 1]);
        for (auto j : irange(2L, k + 1)) {
            if (i >= j) {
                cost[i] = min(cost[i], cost[i - j] + abs(h[i] - h[i - j]));
            }
        }
    }

    cout << cost[n - 1] << endl;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string S,T;
    cin >> S >> T;

    int count=0;

    for(int i=0,j=0;i<S.size(),j<T.size();i++,j++)
    {
        if(S[i]!=T[j])
            count++;
    }

    cout << count << endl;

    return 0;
}

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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define POSSIBLE cout << ((n) ? "POSSIBLE\n" : "IMPOSSIBLE\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int32 n;
  cin >> n;
  vector<int32> a(3*n);
  REP(i,3*n)cin >> a[i];
  vector<int32> frt(n+1),bck(n+1);

  priority_queue<int32,vector<int32>,greater<int32>> p;
  REP(_,2){  
    int64 sum = 0;
    REP(i,n){
      sum += a[i];
      p.push(a[i]);
    }
    frt[0]=sum;
    REP(i,n){
      sum += a[n+i];
      p.push(a[n+i]);
      sum -= p.top();
      p.pop();
      frt[i+1] = sum;
    }

    swap(frt,bck);
    reverse(ALL(a));
    REP(i,3*n)a[i] *= -1;
  }
  // REP(i,n+1)cout << frt[i] << " ";
  // cout << endl;
  // REP(i,n+1)cout << bck[i] << " ";
  // cout << endl;
  int64 ans = -LLINF;
  REP(i,n+1)ans = max(ans, frt[i] + bck[n-i]);
  ANS(ans);
  return 0;
}

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

typedef long long ll;

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

  int n;
  cin>>n;

  ll sum = 0;

  for(int i=1; i<=n; i++){
    if(i%3==0 || i%5==0)continue;
    sum+=i;
  }

  cout<<sum<<"\n";

  return 0;
}


Measured memory_bytes: 3632
#include<iostream>

#include<cmath>
#include<string>
#include <algorithm> 
using namespace std;

int main()
{
    string s1,s2,s3;
    cin >> s1 >> s2 >> s3 ;

    cout << s1.substr(0,1) + s2.substr(1,1) + s3.substr(2,1) << endl;
}

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

//#define int long long
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define rep11(i, n) for (int i = 1; i < (int)(n); ++i)
#define repo(i, o, n) for (int i = o; i < (int)(n); ++i)
#define repm(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1002000007
#define INF LONG_LONG_MAX
int main(){
    int a,b;
    cin>>a;
    cin>>b;
    rep1(i,3){
        if (i!=a & i!=b){
            cout<< i << endl;
        }
    }
    return 0;
}
   

Measured memory_bytes: 256
//a.c A-Five Antennas
#include<stdio.h>

int main(void){
    int buf[5];
    for(int i=0;i<5;++i){
        scanf("%d",&buf[i]);
    }
    int k;
    scanf("%d",&k);
    if(buf[4]-buf[0]>k){
        printf(":(\n");
    }else{
        printf("Yay!\n");
    }
    return 0;
}

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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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

const ll INF = 1e9;
const ll MOD = 1e9+7;
const ll LINF = 1e18;

ll len[55], pat[55];

ll rec(ll k, ll x){
  if(x==len[k]) return pat[k];
  
  ll ans=0;
  
  x--;
  
  if(x>0){
    ll l=min(x, len[k-1]);
    ans+=rec(k-1, l);
    x-=l;
  }
  
  if(x>0) ans++;
  x--;
  
  if(x>0){
    ll l=min(x, len[k-1]);
    ans+=rec(k-1, l);
  }
  
  return ans;
}

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  
  ll n,x; cin>>n>>x;
  
  len[0]=pat[0]=1;
  reps(i,n){
    len[i]=len[i-1]*2+3;
    pat[i]=pat[i-1]*2+1;
  }
  
  cout<<rec(n,x)<<endl;
  
}

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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	
	int best = 1e9;

	int N; cin >> N;
	vector<vi> oarr (2, vi (N));
	F0R(i, N) cin >> oarr[1][i];
	F0R(i, N) cin >> oarr[0][i];

	for (int b = 0; b < (1 << N); ++b) {
		vector<vi> arr = oarr;
		
		int ans = 0;
		bool fail = false;
		vi newnums (N);
		vi col (N, 1);
		vi mask (N);
		F0R(i, N) mask[i] = (b & (1 << i)) > 0;

		F0R(i, N) newnums[i] = arr[mask[i]][i];
		sort(newnums.begin(), newnums.end());
	
		F0R(i, N) {
			int j = i;
			while (j < N) {
				int ncol = ((j-i)%2) ? 1 - col[j] : col[j];
				if ((newnums[i] == arr[mask[j]][j]) && (ncol == mask[j])) break;
				++j;
			}
			if (j == N) {
				fail = true; break;
			}

			for (int k = j - 1; k >= i; --k) {
				++ans;
				swap(arr[0][k+1], arr[0][k]);
				swap(arr[1][k+1], arr[1][k]);
				swap(mask[k+1], mask[k]);
				swap(col[k], col[k+1]);
				col[k] = 1 - col[k];
				col[k+1] = 1 - col[k+1];
			}
		}
		if (!fail) best = min(best, ans);
	}
	print((best < 1e9) ? best : -1);
}

Measured memory_bytes: 3664
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;


long long dp[30];

int main() {
    
    int N;
    long long K;
    cin >> N >> K;
    
    vector< pair<long long, long long> > P(N);
    
    for ( int i = 0; i < N; i++ ) {
        long long a,b;
        cin >> a >> b;
        P[i] = make_pair( a, b );
    }
    
    long long s = 0;
    for ( int i = 0; i < N; i++ ) {
        if ( ( K | P[i].first ) == K ) { s += P[i].second; }
    }
    
    vector<int> Y;
    for ( int i = 30; i >= 0; i-- ) {
        if ( !( K & (1<<i) ) ) { continue; }
        
        long long X = ( 1 << i ) - 1;
        
        for ( auto& a : Y ) {
            X |= (1<<a);
        } 
        
        Y.push_back(i);
        
        long long s1 = 0;
        for ( int i = 0; i < N; i++ ) {
            if ( ( X | P[i].first ) == X ) { s1 += P[i].second; }
        }
        
        s = max( s, s1 );
    }
    
    cout << s << endl;
    
    return 0;
}

Measured memory_bytes: 1920
#include<stdio.h>
int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
signed main(void)
{
  int N=IN(),a=0,i=0,j,max=0;char DP[1000001]={0};
  while(i<N){a=IN();DP[a]++;max=a>max?a:max;i++;}a=0;
  for(i=1;i<=max;i++)
  {
    if(!DP[i])continue;
    else
    {
      if(DP[i]==1){a++;}else{DP[i]=0;}
      for(j=2*i;j<=max;j+=i)DP[j]=0;
    }
  }
  return printf("%d\n",a),0;
}

Measured memory_bytes: 2580
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <cmath>

using namespace std;
using ll = long long;

void Students1B()
{
	int N;
	ll K;
	cin >> N >> K;
	vector<int> Ai(N);
	for (auto& x : Ai)
		cin >> x;
	vector<int> orderedAi(Ai);
	sort(orderedAi.begin(), orderedAi.end());

	ll ct1 = 0;
	vector<int> v;
	for (int i = N - 1; i > -1; --i)
	{
		int j = distance(v.cbegin(), lower_bound(v.cbegin(), v.cend(), Ai[i]));
		ct1 += j;
		v.push_back(Ai[i]);
		sort(v.begin(), v.end());
	}
	ct1 %= 1000000007;
	ct1 *= K;
	ct1 %= 1000000007;

	ll ct2 = 0;
	for (int i = 0; i < N; ++i)
	{
		auto j = distance(orderedAi.cbegin(), lower_bound(orderedAi.cbegin(), orderedAi.cend(), Ai[i]));
		ct2 += j;
	}
	ct2 %= 1000000007;
	bool isEven = K % 2 == 0;
	ct2 *= isEven ? (K - 1) : (K - 1) / 2;
	ct2 %= 1000000007;
	ct2 *= isEven? K/2 : K;
	ct2 %= 1000000007;



	ll ct = ct1 + ct2;
	ct %= 1000000007;
	cout << ct << endl;
}

int main()
{
	Students1B();
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(long long i = 0; i < (long long)(N); i++)
#define repr(i,N) for(long long i = (long long)(N) - 1; i >= 0; i--)
#define rep1(i,N) for(long long i = 1; i <= (long long)(N) ; i++)
#define repr1(i,N) for(long long i = (N) ; (long long)(i) > 0 ; i--)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
using namespace std; void solve();
using ll = long long; template<class T = ll> using V = vector<T>;
using vi = V<int>; using vl = V<>; using vvi = V< V<int> >;
constexpr int inf = 1001001001; constexpr ll infLL = (1LL << 61) - 1;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(7);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cerr << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,N) do { cerr << #v << " = "; array_out(v , N);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
  int main(){solve();}
#endif
 
#define inc(...) char __VA_ARGS__; in(__VA_ARGS__)
#define in2(N,s,t) rep(i,N){in(s[i] , t[i]);}
#define in3(N,s,t,u) rep(i,N){in(s[i] , t[i] , u[i]);}
using vd = V<double>; using vs = V<string>; using vvl = V< V<> >;
template<typename T>using heap = priority_queue< T , V<T> , greater<T> >;
 
using P = pair<ll,char>; using vp = V<P>;
constexpr int MOD = /** 1000000007; //*/ 998244353;
//////////////////

void solve(){
  inl(N , A , B , C , D);
  // 幅N-1 = X
  ll X = N - 1;

  // 自明
  ll ma = A + X * D;
  ll mi = A - X * D;
  if(ma < B || mi > B) die("NO");

  ll E = D - C;
  // X個先は、下からX * Eがok、(X + 1)C - (X - 1)DがNG...が繰り返される
  if((X + 1) * C - (X - 1) * D <= 0) die("YES");
  ll loop = X * E + (X + 1) * C - (X - 1) * D;
  ll nya = (B - mi) % loop;
  out(nya <= X * E ? "YES" : "NO");

}

Measured memory_bytes: 256
import static java.util.Arrays.deepToString;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}
	void tr(Object... os) {
		System.err.println(deepToString(os));
	}

	Scanner sc = new Scanner(System.in);
	public void run() {
		boolean[] isnp = new boolean[10000000];
		for (int i = 2; i * i <= isnp.length; i++)
			if (!isnp[i])
				for (int j = i * i; j < isnp.length; j += i)
					isnp[j] = true;
		List<Integer> ans = new ArrayList<Integer>();
		for (int i = 13; i < isnp.length; i++) {
			if (!isnp[i] && !isnp[i-2] && !isnp[i-6] && !isnp[i-8] ) {
				ans.add(i);
			}
		}
		for (;sc.hasNext();) {
			int n = sc.nextInt();
			if (n == 0) break;
			int idx = Collections.binarySearch(ans, n);
			if (idx >= 0) System.out.println(ans.get(idx));
			else System.out.println(ans.get(-idx-2));
		}
	}
}

Measured memory_bytes: 35092
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	//min(a,b)...a,bの小さいほう
	//max(a,b)...     大きいほう
	int a;
	int b;
	//int c;
	//int d;
	int e;
	cin >> a >> b;
	//string s;
	//std::cin >> s;
	cout << a * a - b << "\n";
	std::cin >> e;
}

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

int main()
{
  int n;
  cin >> n;

  int k;

  cin >> k;

  long long hyoten = 0;

  vector<long long> a(n);
  vector<long long> tensu(n);

  rep(i, n)
  {
    cin >> a.at(i);
  }

  rep(i, n - k)
  {
    if (a.at(k + i) > a.at(k + i - k))
      cout << "Yes" << endl;
    else
    {
      cout << "No" << endl;
    }
  }
}


Measured memory_bytes: 6376
"use strict";

const main = arg => {
    const A = parseInt(arg.split("\n")[0].split(" ")[0]);
    const B = parseInt(arg.split("\n")[0].split(" ")[1]);
    const C = parseInt(arg.split("\n")[0].split(" ")[2]);
    console.log(Math.floor(B / A) >= C ? C : Math.floor(B / A));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 9420
#include <stdio.h>


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

    char str[a];
    scanf("%s", str);
    int flag = 1;
    for (int i=0; i<a/2; i++){
        if (str[i] == str[i+(a/2)]){
            continue;
        }
        else{
            flag = 0;
        }
    }

    
    if(a%2 != 0){
        printf("No\n");
    }
    else{
        if (flag){
            printf("Yes\n");
        }
        else{
            printf("No\n");
        }
    }
    
    
    return 0;
}

Measured memory_bytes: 1656
#include <stdio.h>

int main(){
	long long int n,i,j,a,b,c;
	scanf("%lld%lld%lld",&n,&a,&b);
	j = 1+n/(a+b);
	if(n-(j-1)*(a+b)>a) printf("%lld\n",j*a);
	else printf("%lld\n",(j-1)*a+n-(j-1)*(a+b));
}

Measured memory_bytes: 128
import System.IO
import qualified Data.Text.Lazy as L

main :: IO()
main = do
    iline <- getLine
    iline <- getLine
    let itext = L.pack iline
    let nums = map readNum (L.words itext)
    print (gGcd nums)

readNum str = read (L.unpack str) :: Int

gGcd (x:y:[]) = gcd x y
gGcd (x:xs) = gcd x (gGcd xs)


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

int main() {
	int n, a, b;
	cin >> n >> a >> b;
	int ma, mi;
	ma = min(a, b);
	if (a + b >= n) {
		mi = (a + b) - n;
	}
	else {
		mi = 0;
	}
	cout << ma << " " << mi << endl;
	return(0);
}

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

int main(){
	int A[100001]={};
	int N;
	int b,i,count=0,even=0;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%d",&b);
		A[b]++;
	}
	for(i=0;i<100001;i++){
		if (A[i]==0){
			count+=0;
			}
		else if(A[i]%2==1){
			count++;
		}
		else{
			count++;
			even++;
		}
	}
	if(even%2==1) count--;
	printf("%d\n",count);
	return 0;
}


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

#ifndef DEBUG
#define DEBUG false
#endif

#define REP(t,i,a,b) for(t i = a; i < b; ++i)

typedef long long ll;

int main (void) {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    int a,b;
    std::cin >> a >> b;

    int count = 0;
    int tap = 1;
    while(tap < b) {
        tap += a - 1;
        count ++;
    }
    std::cout << count << std::endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//#pragma GCC optimize("Ofast","no-stack-protector","unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx")
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
#define F(i,L,R) for (int i = L; i < R; i++)
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define getI(a) scanf("%d", &a)
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define VgetI(n) int (n); scanf("%d",&(n))
#define VgetII(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define VgetIII(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define debug(x) cout<<(#x)<<"="<<x<<"\n";
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define f first
#define s second
#define ll long long
#define INF 2000000000
char a[1005],b[1005];
int main(){
        int n,m;
        while(~scanf("%s",a)){
                if(a[0]=='S') puts("Cloudy");
                if(a[0]=='C') puts("Rainy");
                if(a[0]=='R') puts("Sunny");
        }
}

Measured memory_bytes: 256
let id x = x

let s = 1000000007
let inv2 = 500000004

let repeat f =
  let rec aux accu = function
    | 0 -> accu
    | n -> aux (f () :: accu) (n - 1) in
  aux []

let ( +% ) a b = let c = a + b in if c > s then c - s else c
let ( -% ) a b = if a > b then a - b else s + a - b
let ( *% ) a b = a * b mod s

let pow k =
  let rec aux accu k = function
  | 0 -> accu
  | n when n mod 2 = 0 -> aux accu (k*%k) (n/2)
  | n -> aux (accu*%k) (k*%k) (n/2) in
  aux 1 k

let inv k = pow k (s-2)

let rec dontimes f = function
  | 0 -> ()
  | n -> f (); dontimes f (n-1)

let () =
  let n = Scanf.scanf "%d\n" id in
  let l = repeat (fun () -> Scanf.scanf "%d %d\n" (fun a b -> (a,b))) n in
  let (maxa, maxb) = List.fold_left (fun (c,d) (a,b) -> (max a c, max d b)) (0, 0) l in
  let factbl = Array.make (2*maxa+2*maxb+1) 1 in
    for i = 1 to 2*maxa+2*maxb do Array.unsafe_set factbl i ((Array.unsafe_get factbl (i-1)) *% i) done;
  let ifactbl = Array.make (2*maxa+2*maxb+1) 0 in
    ifactbl.(2*maxa+2*maxb) <- inv factbl.(2*maxa+2*maxb);
    for i = 2*maxa+2*maxb-1 downto 0 do Array.unsafe_set ifactbl i ((Array.unsafe_get ifactbl (i+1)) *% (i+1)) done;
  let bc n k = factbl.(n) *% ifactbl.(k) *% ifactbl.(n-k) in
  let sal = List.sort (fun (a,_) (c,_) -> compare c a) l in
  let dp = Array.make (1 + 2 * maxb) 0 in
  let update () = for i = 1 to 2 * maxb do Array.unsafe_set dp i (Array.unsafe_get dp i +% Array.unsafe_get dp (i-1)) done in
  let rec solve m = function
     | [] -> dontimes update (maxa+1-m)
     | (a, b) :: tl when a = maxa-m -> dp.(maxb-b) <- (dp.(maxb-b) +% 1); solve m tl
     | sl -> update (); solve (m+1) sl in
  solve 0 sal;
  let rec accum accu = function
    | 0 -> accu +% dp.(0) *% dp.(2*maxb)
    | k -> accum (accu +% (dp.(k) -% dp.(k-1)) *% dp.(2*maxb-k)) (k-1) in
  let sum = accum 0 (2*maxb) in
  let x = List.fold_left (fun x (a,b) -> x +% bc (2*a+2*b) (2*a)) 0 l in
    print_int ((sum -% x) *% inv2)

Measured memory_bytes: 30080
#include <stdio.h>

int main(void)
{
    int N, A;
    int i;
    int n1;
    int max1;
    
    scanf("%d", &N);
    
    max1 = n1 = 0;
    for (i = 1; i <= N; i++){
        scanf("%d", &A);
        if (A == 1){
            n1++;
        }
        else {
            n1 = 0;
        }
        if (max1 < n1){
            max1 = n1;
        }
    }
    
    printf("%d\n", max1 + 1);
    
    return (0);
}



Measured memory_bytes: 2136
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <algorithm>
#include <unordered_map>

#define rep(i, a, b) for (ll i = a; i < b; i++)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef unordered_map<string, ll> u_map;

// input
void input() {}
template <class Head, class... Tail>
void input(Head &&a, Tail &&... b)
{
    cin >> a;
    input(forward<Tail>(b)...);
}

template <class V>
void input(vector<V> &v)
{
    for_each(v.begin(), v.end(), [](auto &i) { input(i); });
}

// output
template <class V>
void output(vector<V> &v)
{
    for_each(v.begin(), v.end(), [](auto &x) { cout << x << " "; });
    cout << endl;
}

// math functions
ll mpow(ll a, ll n, ll p)
{
    ll x = 1;
    while (n > 0)
    {
        if (n & 1)
        {
            x = a * x % p;
        }
        a = a * a % p;
        n >>= 1;
    }

    return x;
}

ll mfact(ll n, ll p)
{
    ll res = 1;
    for (ll i = 2; i <= n; i++)
    {
        res = res * i % p;
    }
    return res;
}

ll mcomb(ll n, ll r, ll p)
{
    if (n == 0 && r == 0)
    {
        return 1;
    }
    if (n < r || n < 0 || r < 0)
    {
        return 0;
    }

    ll a = mfact(n, p);
    ll b = mfact(n - r, p);
    ll c = mfact(r, p);
    return (((a * mpow(b, p - 2, p)) % p) * mpow(c, p - 2, p)) % p;
}

ll gcd(ll a, ll b)
{
    if (a < b)
    {
        a ^= b;
        b ^= a;
        a ^= b;
    }
    return b ? gcd(b, a % b) : a;
}

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

int main()
{
    const int coins[6] = {500, 5, 100, 50, 10, 1};
    int X;
    input(X);

    int a = 0, b = 0;
    rep(i, 0, 6)
    {
        int z = X / coins[i];
        X -= z * coins[i];
        if (i == 0)
        {
            a = z;
        }

        if (i == 1)
        {
            b = z;
        }
    }

    cout << (a * 1000 + b * 5) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <unordered_map>
#include <string>

using namespace std;

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

  // vector<int> v(n);
  unordered_map<int, int> m;
  int idx = 1;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    m[a] = idx++;
  }

  string result;
  for (int i = 1; i <= n; i++) {
    if (i != 1) {
      result += " ";
    }
    result += to_string(m[i]);
  }
  

  cout << result << endl;
  
  return 0;
}


Measured memory_bytes: 6052
//     _/    _/  _/                        _/                
//    _/    _/      _/_/_/      _/_/_/  _/_/_/_/    _/_/_/   
//   _/_/_/_/  _/  _/    _/  _/    _/    _/      _/    _/    
//  _/    _/  _/  _/    _/  _/    _/    _/      _/    _/     
// _/    _/  _/  _/    _/    _/_/_/      _/_/    _/_/_/ 
// C++ Conpetitive Programming Template 
// Ver 1.0 (codename: Hinata)
// Last Modified : 2019-05-27
// Created       : 2019-05-25
// Auther        : shirataki3
#include <bits/stdc++.h>
using namespace std;
// typename alias
template <class T> using vec = vector<T>;
template <class T, class U> using vep = vec<pair<T,U> >;
template <class T> using PQ = priority_queue<T>;
using ll = long long;
using vll = vec<ll>;
using pll = pair<ll, ll>;
using vpll = vec<pll>;
using str = string;
// あくまのちから
//#define int ll

// const
static const long long INF = 1LL<<59;
static const long long MOD = (ll)1e9+7;
static const double PI = 3.14159265358979323846;

// accelerate stdin, stdout
#define endl "\n"
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
// repeat macro
#define FOR(i, a, b) for(ll (i)=(a);(i)<=(b);i++)
#define rFOR(i, a, b) for(ll (i)=(b);(i)>=(a);i--)
#define REP(i, n) for(ll i=0;i<n;i++)
// vector macro
#define WHOLE(v) (v).begin(), (v).end()
#define ASC(v) sort(WHOLE(v))
#define DESC(v) sort((v).rbegin(), (v).rend())
#define INV(v) reverse(WHOLE(v))
#define FOLDL(src, dst, lambda) partial_sum(WHOLE(src), (dst).begin(), lambda)
#define FOLDR(src, dst, lambda) INV(src);partial_sum(WHOLE(src), (dst).begin(), lambda);INV(dst)
#define CUMSUML(src, dst) FOLDL(src, dst, [](auto a, auto b) {return a+b;})
#define CUMSUMR(src, dst) FOLDR(src, dst, [](auto a, auto b) {return a+b;})
#define ACCUM(v, d0, lambda) accumulate(WHOLE(v), d0, lambda)
#define SUM(v, d0) ACCUM(v, d0, [](auto a, auto b) {return a+b;})
#define ERASE(v, i) v.erase(v.begin() + i)
#define UNIQ(v) ASC(v);v.erase(unique(v.begin(), v.end()), v.end())

template <typename T>void debug(T t) {cerr << t << endl;}
template <typename T, typename ...Args>void debug(T t, Args ...args) {cerr << t << " ";debug(args...);}
template <typename T>void out(T t) {cout << t << endl;}
template <typename T, typename ...Args>void out(T t, Args ...args) {cout << t << " ";out(args...);}

void solve() {
    ll N, f = 0;
    cin >> N;
    vll vp(N);
    REP(i, N) {
        ll a, b;
        cin >> a >> b;
        vp.push_back(a+b);
        f += b;
    }
    DESC(vp);
    ll ans = 0;
    for(int i = 0; i < N; i+=2) {
        ans+=vp[i];
    }
    out(ans-f);
}

signed main() {
    fast_io;
    cout << setprecision(20) << fixed;
    solve();
    return 0;
}

Measured memory_bytes: 1792
x,k,d=map(int,input().split())
if x<0:
    x=-x
t=x//d
if k<=t:
    print(int(x-(d*k)))
else:
    if (k-t)%2==1:
        print(int(abs(x-(d*t)-d)))
    else:
        print(int(x-(d*t)))

Measured memory_bytes: 61664
#include <iostream>
#include <ctype.h>
using namespace std;

int main()
{
//    string str="abAA, k";
    //    getline(cin, str);
    //    cout << str.size();
    string str;
    getline(cin, str);
    for(int i=0;i<str.size();i++)
    {
        if(isupper(str[i]))
        {
//            cout << "大文字です。" << endl;
            cout.put(tolower(str[i]));
        } else if(islower(str[i])) {
//            cout << "小文字です。" << endl;
            cout.put(toupper(str[i]));
        } else {
//            cout << "アルファベット以外です。" << endl;
            cout.put(str[i]);
        }
    }
    cout << endl;
    return 0;
}



Measured memory_bytes: 3108
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
typedef pair<int,int> PP;
typedef long long ll;
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; }
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE cout << -1 << endl;return 0
#define MM <<" "<<
#define Endl endl

signed main(void){
    int N;
    int P[57];
    cin >> N;
    int sum=0;
    REP(i,N){
        cin >> P[i];
        if(P[i]!=i+1){
            sum++;
        }
    }
    if(sum<=2){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#define my_abs(x) ((x) < 0 ? -(x) : (x))
#define mp std::make_pair
#define pb push_back
typedef long long ll;
int row[605][605], col[605][605], app[605];
bool arr[605][605];
char str[605];
int main()
{
	// freopen("TK1-E.in", "r", stdin);
	int n, m;
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; i++)
	{
		scanf("%s", str);
		for (int j = 0; j < m; j++)
		{
			if (str[j] == '#')
				arr[i + j][i - j + m] = true;
		}
	}
	n += m;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			row[i][j] = (j ? row[i][j - 1] : 0) + arr[i][j];
			col[i][j] = (i ? col[i - 1][j] : 0) + arr[i][j];
		}
	}
	ll ans = 0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (!arr[i][j])
				continue;
			for (int k = j + 1; k < n; k++)
			{
				if (!arr[i][k])
					continue;
				int d = k - j;
				if (i + d < n)
					ans += row[i + d][k - 1] - row[i + d][j];
				if (i - d >= 0)
					ans += row[i - d][k - 1] - row[i - d][j];
			}
		}
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (!arr[i][j])
				continue;
			for (int k = i + 1; k < n; k++)
			{
				if (!arr[k][j])
					continue;
				int d = k - i;
				if (j + d < n)
					ans += col[k - 1][j + d] - col[i][j + d];
				if (j - d >= 0)
					ans += col[k - 1][j - d] - col[i][j - d];
			}
		}
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (!arr[i][j])
				continue;
			memset(app, 0, sizeof(app));
			for (int k = 0; k < n; k++)
			{
				if (j == k || !arr[i][k])
					continue;
				app[my_abs(k - j)]++;
			}
			for (int k = 0; k < n; k++)
			{
				if (i == k || !arr[k][j])
					continue;
				ans += app[my_abs(k - i)];
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 3456
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define CHAL_BC_APNE_BAAP_KO_MAT_SIKHA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define fr first
#define se second 
signed main()
{
	CHAL_BC_APNE_BAAP_KO_MAT_SIKHA;		
	int n;
	cin>>n;
	int ans=0;
	for(int i=1;i*i<=n;i++){
		if(n%i==0){
			ans=i;
		}
	}
	cout<<ans-1+n/ans-1<<endl;
}


Measured memory_bytes: 256
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
count = 0
ans = 0

X = int(input())

if X >= 400 and X < 600:
    print(8)
if X >= 600 and X < 800:
    print(7)
if X >= 800 and X < 1000:
    print(6)
if X >= 1000 and X < 1200:
    print(5)
if X >= 1200 and X < 1400:
    print(4)
if X >= 1400 and X < 1600:
    print(3)
if X >= 1600 and X < 1800:
    print(2)
if X >= 1800 and X < 2000:
    print(1)


Measured memory_bytes: 9160
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/



int main() {
	char a, b;
	cin >> a >> b;
	if (a == 'H') {
		if (b == 'H') {
			cout << 'H' << endl;
		}
		else {
			cout << 'D' << endl;
		}
	}
	if (a == 'D') {
		if (b == 'H') {
			cout << 'D' << endl;
		}
		else {
			cout << 'H' << endl;
		}
	}
}


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

using namespace std;

int main(void) {
    long n;
    cin >> n;

    vector<long> a(n), b(n);
    for(auto &x: a) cin >> x;
    for(auto &x: b) cin >> x;

    long c = 0, r = 0;
    for(int i=0; i<n; i++)
        if(a[i] == b[i]) c++;

    set<long> s;
    for(int i=0; i<n; i++)
        if(a[i] != b[i] && b[i] > b[(i-1+n)%n] + b[(i+1)%n])
            s.insert(i);

    while(!s.empty()) {
        long i = *s.begin(); s.erase(i);
        long ai = (i-1+n)%n, bi = i%n, ci = (i+1)%n;

        if(a[i] == b[i]) continue;
        if(b[bi] <= b[ai] + b[ci]) continue;
        if((b[i] - a[i]) / (b[ai] + b[ci]) == 0) continue;

        r += (b[i] - a[i]) / (b[ai] + b[ci]);
        b[i] = a[i] + ((b[i] - a[i]) % (b[ai] + b[ci]));

        if(b[ai] > b[bi] + b[(ai-1+n)%n]) s.insert(ai);
        if(b[ci] > b[bi] + b[(ci+1+n)%n]) s.insert(ci);

        if(a[i] == b[i]) {
            c++;
            continue;
        }
        if(b[bi] > b[ai] + b[ci]) s.insert(bi);
    }

    cout << (c == n ? r : -1) << endl;
}


Measured memory_bytes: 8064
//#pragma GCC optimize "trapv"
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rand rng
#define fios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define M_PI 3.14159265358979323846
typedef long long ll;



int main() {
	//fios;
	string s, t;
	cin >> s >> t;
	int n1 = s.length(), n2 = t.length();
	int ans = n1;

	for(int i = 0; i + n2 - 1 < n1; i++) {
		int tmp = 0;
		for(int j = 0; j < n2; j++) {
			if(s[i+j] != t[j]) tmp++;
		}
		ans = min(ans, tmp);
	}
	cout << ans << endl;

}

Measured memory_bytes: 3628
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 200000


int main(){
	int x;
	int n, k;
	scanf("%d", &n);
    k=-n;
	for (int i = 0; i < n; i++){
		scanf("%d", &x);
      k+=x;
	}

	printf("%d\n", k);

	return 0;
}

Measured memory_bytes: 128
#define _USE_MATH_DEFINES 
#include<iomanip> 
#include<cmath>  
#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<bitset>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<queue>
#include<deque>
#include<stack>
using namespace std;
typedef long long ll;
#define repi(i,a,b) for(ll i = (ll)(a) ; i < (ll)(b) ; i++)
#define repd(i,a,b) for(ll i = (ll)(a) ; i > (ll)(b) ; i--)
#define rd(x) cin >> x
#define wr(x)  cout << x
#define wrln(x) cout << x << endl
#define wl() cout << endl
const ll MAX_10p5 = 100010;
const ll MAX_10p9 = 1000000010;
const ll MAX_10p18 = 1000000000000000010;
const ll MOD = 1000000007;
const ll m4x[4] = { 1,0,-1,0 };
const ll m4y[4] = { 0,1,0,-1 };
const ll m8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const ll m8y[8] = { 0,1,1,1,0,-1,-1,-1 };
const ll m9x[9] = { 1,1,0,-1,-1,-1,0,1,0 };
const ll m9y[9] = { 0,1,1,1,0,-1,-1,-1,0 };

struct edge {
	ll from, to, cost;
	bool operator<(const edge& right) const {
		return cost < right.cost;
	}
};
struct point {
	ll x, y;
	bool operator<(const point& right) const {
		return x == right.x ? y < right.y : x < right.x;
	}
};

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

ll n, m, x, ansL, ansR;
bool a[110];

int main() {
	cin >> n >> m >> x;
	repi(i, 0, m) {
		ll temp;
		rd(temp);
		a[temp] = true;
	}
	repd(i, x, 0) if (a[i]) ansL++;
	repi(i, x, n) if (a[i]) ansR++;
	wrln(min(ansL, ansR));
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PP;
#define MOD 1000000007
//#define MOD 998244353
#define INF 2305843009213693951
//#define INF 810114514
#define PI 3.141592653589
#define setdouble setprecision
#define REP(i,n) for(ll i=0;i<(n);++i)
#define OREP(i,n) for(ll i=1;i<=(n);++i)
#define RREP(i,n) for(ll i=(n)-1;i>=0;--i)
#define all1(i) begin(i),end(i)
#define GOODBYE do { cout << "-1" << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl
#define debug false
#define debug2 false

int main(void){
    ll N;
    ll X=1,Y=1,Z=1;
    cin >> N;
    
    REP(i,N){
        X=(X*10)%MOD;
        Y=(Y*9)%MOD;
        Z=(Z*8)%MOD;
    }
    
    ll Ans=0;
    
    Ans=(Ans+X)%MOD;
    Ans=(Ans-Y+MOD)%MOD;
    Ans=(Ans-Y+MOD)%MOD;
    Ans=(Ans+Z)%MOD;
    
    cout << Ans << endl;
    
    return 0;
}



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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF INT_MAX/3

int n,a,b;

int main(){
  cin>>n>>a>>b;
	cout<<min(a*n,b)<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
typedef long long ll;
using namespace std;
int main(void){
    ll num[3];
    int k;
    for(int i=0;i<3;i++){
        cin>>num[i];
    }
    cin>>k;
    sort(num,num+3);
    ll ans=0;
    while(k--){
        num[2]*=2;
    }
    for(int i=0;i<3;i++){
        ans+=num[i];
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
def main():
    m_MAX = 0.0
    m_MIN = 0.0
    count = 0
    while True:
        try:
            m = float(input())
            if count == 0:
                m_MAX = m_MIN = m
            if m > m_MAX :
                m_MAX = m
            elif m < m_MIN :
                m_MIN = m
            count += 1
        except EOFError:
            break
    print(abs(m_MAX - m_MIN))

if __name__ == '__main__':
    main()


Measured memory_bytes: 5572
#include <bits/stdc++.h>
#include <cstdlib>  // abs() for integer 驍ｨ・ｶ陝・ｽｾ陋滂ｽ､雎弱ｅ・∫ｹｧ繝ｻ笆ｽ
#include <cmath>    // abs() for float, and fabs()
#include <algorithm>
#include <vector>
#include <string>
#define rep(i,n) for(int i = 0; i < (n);i++)
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
using namespace std;
#define INF 2000000000
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; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;

int main(){
  int t;cin>>t;
  vector<int> a(t);
  rep(i,t){
    cin>>a[i];
  }
  int ans = a[1]-a[0];
  int m=a[0];
  for(int j = 1 ; j < t ; j++){
    chmin(m,a[j-1]);
    chmax(ans , a[j]-m);
  }
  cout << ans << endl;
}

 


Measured memory_bytes: 3600
# Derangement
N = int(input())
p = list(map(int, input().split()))

q = []
for i in range(N):
    if i+1==p[i]:
        q.append(i)
num  = len(q)

cnt = 0
i = 0
while i < num-1:
    if (q[i+1]-q[i]==1):
        cnt+=1
        i+=2
    else:
        i+=1

print(num-cnt)

Measured memory_bytes: 14004
#include<iostream>
#define _USE_MATH_DEFINES
#include<math.h>
#include<vector>
#include<array>
#include<algorithm>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vector<ll>> mat;
typedef pair<ll,ll> P;
typedef map<ll,ll> MP;
typedef priority_queue<ll> PQ;
typedef stack<ll> ST;
typedef queue<ll> QUE;
#define pb push_back
#define st first
#define nd second
#define SZ(x) ((int)(x).size())
#define FOR(i,s,n) for(int i=(int)(s); i< (int)(n); i++)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define each(x,c) for(auto x: (c))
#define LB(x,a) lower_bound(all(x), a)
#define UB(x,a) upper_bound(all(x), a)
const ll mod=1e9+7;
const ll INF=1e18;
const double EPS=1.0e-10;
const double PI=M_PI;

int main(){
    int N; cin>>N;
    string S; cin>>S;
    stack<char> st;
    rep(i,N){
        if(S[i]=='('){
            st.push(S[i]);
        }
        else{
            if(st.empty()) st.push(S[i]);
            else{
                char c=st.top();
                if(c==')') st.push(S[i]);
                else st.pop();
            }
        }
    }
    int r=0,l=0;
    while(!st.empty()){
        char c=st.top(); st.pop();
        if(c=='(') r++;
        else       l++;
    }
    rep(i,l) S='('+S;
    rep(i,r) S+=')';
    cout<<S<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,l=0,c=1,ans=0;
    string s;
    cin>>n>>k>>s;
    for(int i=1;i<n;++i)
    {
        if(s[i]==s[i-1]) ++c;
        else
        {
            ++l;
            ans+=(c-1);
            c=1;
        }
    }
    ans+=(c-1);++l;
    if(l/2 <= k) ans+=(l-1);
    else ans+=(2*k);
    cout<<ans<<'\n';
    return 0;
}


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

ll dp[51][51][2501];

main() {
  int N, A; cin >> N >> A;
  vector<int> x(N); for (int i = 0; i < N; i++) cin >> x[i];

  int X = *max_element(begin(x), end(x));
  X = max(X, A);

  dp[0][0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N + 1; j++) {
      for (int k = 0; k < j * X + 1; k++) {
        dp[i + 1][j][k] = dp[i][j][k];
        if (j > 0 && k >= x[i]) dp[i + 1][j][k] += dp[i][j - 1][k - x[i]];
      }
    }
  }

  ll ans = 0;
  for (int k = 1; k < N + 1; k++) ans += dp[N][k][k * A];
  cout << ans << endl;
}


Measured memory_bytes: 49280
from collections import defaultdict

N = int(input())
l = [list(map(int, input().split())) for _ in range(N)]

for x, y, h in l:
    if h == 0:
        continue
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            ans = True
            H = abs(Cx-x) + abs(Cy-y) + h
            for xx, yy, hh in l:
                if hh != max(H - abs(Cx-xx) - abs(Cy-yy), 0):
                    ans = False
            if ans:
              print(Cx, Cy, H)
              exit()

            

Measured memory_bytes: 3316
import sys
input = sys.stdin.readline
n, k = [int(x) for x in input().split()]
h = [int(input()) for _ in range(n)]
h.sort()
ans = 10 ** 10
for i in range(n):
    if i + k - 1 >= n:
        break
    ans = min(ans, h[i + k - 1] - h[i])
print(ans)
    

Measured memory_bytes: 44124