akhauriyash/Code-Regression huggingface dataset:
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define SORTD(a) sort(a.rbegin(), a.rend());
#define UNIQUE(a) unique(a.begin(), a.end())
#define ll long long
#define INF 1000000000000000000
#define INT_MAX 2147483647

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <cctype>
#include <numeric>
#include <algorithm>
#include <queue>
#include <set>
#include <utility>
#include <ios>
#include <iomanip>

using namespace std;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;


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

	vl a(n);

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

	SORT(a);

	vector<pll> bc(m);
	ll b, c;

	REP(i, m) {
		cin >> b >> c;
		bc[i] = make_pair(c, b);
	}

	sort(bc.begin(), bc.end());

	ll ans = 0;
	int aidx = n - 1, bidx = m - 1;
	while (n > 0) {
		if (aidx >= 0 && bidx >= 0) {
			if (a[aidx] <= bc[bidx].first) {
				if (n > bc[bidx].second) {
					ans += bc[bidx].first*bc[bidx].second;
					n = n - bc[bidx].second;
					bidx--;
				}
				else {
					ans += bc[bidx].first*n;
					n = 0;
				}
			}
			else {
				ans += a[aidx];
				aidx--;
				n--;
			}
			
		}
		else if (aidx >= 0) {
			ans += a[aidx];
			aidx--;
			n--;
		}
		else if (bidx >= 0) {
			if (n > bc[bidx].second) {
				ans += bc[bidx].first*bc[bidx].second;
				n = n - bc[bidx].second;
				bidx--;
			}
			else {
				ans += bc[bidx].first*n;
				n = 0;
			}
		}
	}
	cout << ans << endl;

}

Measured memory_bytes: 2560
// 

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <ios>
#include <iomanip>
#include <string>
#include <numeric>

using namespace std;

int abs(int a, int b) {
    if (a < b) {
        return b - a;
    }
    return a - b;
}

int main() {
    int n;
    cin >> n;
    int W[n];
    for (int i = 0; i < n; i++) {
        cin >> W[i];
    }

    // T = 0 .. n-2

    int head = 0;
    int tail = 0;
    int min = 294967294;

    for (int T = 0; T < n - 1; T++) {
        for (int i = 0; i <= T; i++) {
            head += W[i];
        }
        for (int j = T + 1; j < n; j++) {
            tail += W[j];
        }
        if (abs(head, tail) < min) {
            min = abs(head, tail);
        }
        head = 0;
        tail = 0;
    }

    cout << min << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

signed main(){
	int a,b;
	cin >> a >> b;
	if(a <= b) cout << a << endl;
	else cout << a - 1 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>

using namespace std;

int main(){
    
    int N;
    cin >> N;
    
    int i;
    
    double A;
    double sum = 0;
    
    for(i=0;i<N;i++){
        
        cin >> A;
        
        sum += 1/A;
    }
    
    sum = 1/sum;
    
    cout << setprecision(16) << sum << endl;
    
        
    
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>



using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const double EPS = (1e-10);
long long const MOD = 1000000007;

long long mod_pow(long long x, long long n) {
    long long res = 1;
    for(int i = 0;i < 60; i++){
        if(n >> i & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

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

void fastInput() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int compress(vector<int> &X, map<int, int> &zip, vector<int> &unzip) {
    sort(X.begin(), X.end());
    X.erase(unique(X.begin(), X.end()), X.end());
    for (int i = 0; i < X.size(); i++) {
        zip[X[i]] = i;
        unzip.push_back(X[i]);
    }
    return X.size();
}

int main(void) {
    int N, M; cin >> N >> M;
    vector<pair<int, int>> C(N);
    vector<int> CX(N);
    vector<int> CY(N);
    for (int i = 0; i < N; i++) {
        cin >> C[i].first >> C[i].second;
        CX[i] = C[i].first;
        CY[i] = C[i].second;
    }
    CX.push_back(-1000000001);
    CY.push_back(-1000000001);

    vector<vector<int>> Q(M, vector<int>(4));
    for (int i = 0; i < M; i++) {
        cin >> Q[i][0] >> Q[i][1] >> Q[i][2] >> Q[i][3];
    }
    map<int, int> zipX;
    vector<int> unzipX;
    map<int, int> zipY;
    vector<int> unzipY;
    int W = compress(CX, zipX, unzipX);
    int H = compress(CY, zipY, unzipY);

    vector<vector<int>> field(W, vector<int>(H));

    for (int i = 0; i < N; i++) {
        int x = zipX[C[i].first];
        int y = zipY[C[i].second];
        field[x][y]++;
    }
    for (int x = 0; x < W; x++) {
        for (int y = 1; y < H; y++) {
            field[x][y] += field[x][y-1];
        }
    }
    for (int x = 1; x < W; x++) {
        for (int y = 0; y < H; y++) {
            field[x][y] += field[x-1][y];
        }
    }

    vector<int> ans(M);
    for (int i = 0; i < M; i++) {
        int lx = lower_bound(unzipX.begin(), unzipX.end(), Q[i][0]) - unzipX.begin() - 1;
        int ux = upper_bound(unzipX.begin(), unzipX.end(), Q[i][2]) - unzipX.begin() - 1;
        int ly = lower_bound(unzipY.begin(), unzipY.end(), Q[i][1]) - unzipY.begin() - 1;
        int uy = upper_bound(unzipY.begin(), unzipY.end(), Q[i][3]) - unzipY.begin() - 1;

        int cnt = field[ux][uy] - field[lx][uy] - field[ux][ly] + field[lx][ly];
        ans[i] = cnt;
    }
    for (auto &i : ans) {
        cout << i << endl;
    }
}


Measured memory_bytes: 130624
#include <stdio.h>
int main(void){
    int i,j,H,W;
    while(scanf("%d %d\n",&H,&W) != EOF){
        if(H == 0 && W == 0){
            break;
        }
        for(i=0; i<H; i++){
            for(j=0; j<W; j++){
                printf("#");
            }
            printf("\n");
        }
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2104
#include<stdio.h>
#define MAX 100

int main(){
  int i, j, n, min, count=0, save;
  int A[MAX];

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  for(i=0;i<n-1;i++){
    min = i;
    for(j=i;j<n;j++){
      if(A[j] < A[min]){
        min = j;
        
      }
    }
    if(min != i) count++;
    save = A[i];
    A[i] = A[min];
    A[min] = save;
  }

  for(j=0;j<n;j++){
    printf("%d", A[j]);
    if(j != n-1) printf(" ");
  }
  printf("\n%d\n", count);

  return 0;
}






Measured memory_bytes: 2100
#include <cstdio>
#include <algorithm>

using namespace std;

const int SN = 10000 + 10;

int a[SN], n, ans, vis[SN],cnt;

int main() {
	scanf("%d",&n);
	
	for(int i = 1; i <= n; i++) scanf("%d",&a[i]);
	
	for(int i = 1; i <= n; i++) {
		if(a[i]>=1 && a[i]<=399) vis[1]++;
		else if(a[i]>=400 && a[i]<=799) vis[2]++;
		else if(a[i]>=800 && a[i]<=1199) vis[3]++;
		else if(a[i]>=1200 && a[i]<=1599) vis[4]++;
		else if(a[i]>=1600 && a[i]<=1999) vis[5]++;
		else if(a[i]>=2000 && a[i]<=2399) vis[6]++;
		else if(a[i]>=2400 && a[i]<=2799) vis[7]++;
		else if(a[i]>=2800 && a[i]<=3199) vis[8]++;
		else if(a[i]>=3200) cnt++;
	}
	
	for(int i = 1; i <= 8; i++) if(vis[i]) ans++;
	
	cnt = cnt + ans;
	
	ans = max(ans, 1);	
	
	printf("%d %d\n",ans, cnt);
	
	return 0;
	
}

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

int main()
{
	//freopen("t.txt","r",stdin);
	string s;
	cin>>s;
	if (s=="abc") {cout<<"Yes";return 0;}
	if (s=="acb") {cout<<"Yes";return 0;}
	if (s=="bac") {cout<<"Yes";return 0;}
	if (s=="bca") {cout<<"Yes";return 0;}
	if (s=="cab") {cout<<"Yes";return 0;}
	if (s=="cba") {cout<<"Yes";return 0;}
	{cout<<"No";return 0;}
	
}

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

int main() {
    LL a, b, c;

    cin >> a >> b >> c;

    LL lhs = a * b * 4;
    LL rhs = (c - a - b)*(c - a - b);

    if (lhs < rhs && c - a - b >= 0)
        cout << "Yes\n";
    else
        cout << "No\n";
}


Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include <algorithm>
using namespace::std;
int main(){
 
int A;
int B;
int C;

cin>>A;
cin>>B;
cin>>C;

int sum;
sum=A+B+C;
if(A>=B&&A>=C){
	cout<<sum-A;
}else if(B>=A&&B>=C){
	cout<<sum-B;
}else if(C>=B&&C>=A){
	cout<<sum-C;
}
	
		

}

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

public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        long[] AB = new long[N + 1];
        long ans = 0;
        long a = 0;
        long c = 1;
        AB[0] = 0;
        for (int i = 1; i <= N; i++) {
            A[i - 1] = sc.nextLong();
            AB[i] = A[i - 1] + AB[i - 1];
        }
        Arrays.sort(AB);
        lavel:
        for (int i = 1; i <= N; i++) {
            if (AB[i] == AB[i - 1]) {
                c++;
            } else {
                ans += c * (c - 1) / 2;
                c = 1;
            }
        }
        ans += c * (c - 1) / 2;
        System.out.println(ans);
    }
}


Measured memory_bytes: 92368
void main() {
  import std.stdio, std.string, std.conv, std.algorithm;

  int n;
  rd(n);
  auto x = new int[](n), y = new int[](n), h = new long[](n);
  foreach (i; 0 .. n)
    rd(x[i], y[i], h[i]);

  long min_h = 10 ^^ 9, max_h = 0;
  foreach (i; 0 .. n) {
    min_h = min(min_h, h[i]);
    max_h = max(max_h, h[i]);
  }
  min_h = max(1, min_h - 200);
  max_h = max_h + 200;
  import std.math : abs;

  for (int cx = 0; cx <= 100; cx++) {
    for (int cy = 0; cy <= 100; cy++) {
      for (long height = min_h; height <= max_h; height++) {
        foreach (i; 0 .. n) {
          if (max(0, height - abs(x[i] - cx) - abs(y[i] - cy)) != h[i]) {
            goto hell;
          }
        }
        writeln(cx, " ", cy, " ", height);
        return;
      hell:;

      }
    }
  }
}

void rd(T...)(ref T x) {
  import std.stdio : readln;
  import std.string : split;
  import std.conv : to;

  auto l = readln.split;
  assert(l.length == x.length);
  foreach (i, ref e; x)
    e = l[i].to!(typeof(e));
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
 
#define endl '\n'
#define loop(i, m, n) for (ll i = m; i < n; i++)
#define loope(i, m, n) for (ll i = m; i <= n; i++)
#define epool(i, m, n) for (ll i = m; i >= n; i--)
#define mod 1000000007
#define mod2 998244353
#define vi vector<ll>
#define fi first
#define se second
#define pb push_back
#define MP make_pair
#define empf emplace_front
#define empb emplace_back
#define ret(x) return cout << x,0;
#define all(v) v.begin(),v.end()
const ll INF=1e18;
const double PI=4*atan(1);

#define SpeedForce                    \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
using namespace std;

ll mpow(ll base,ll exp);
void solve();
ll POW(ll base,ll exp);
ll gcd(ll a,ll b);

int32_t main(){
    SpeedForce
    ll i = 0,j = 0;

    int t;
    t=1;
    //cin >> t;
    while (t--){
        //cout << fixed << setprecision(10);
        solve();
    }
}

void solve(){
    ll a;
    cin >> a;
    cout << a+a*a+a*a*a;
    

}

ll POW(ll base,ll exp){
    ll result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((ll)result * base);
        base = ((ll)base * base);
        exp >>= 1;
    }
    return result;
}

ll mpow(ll base, ll exp){
    base %= mod;
    ll result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((ll)result * base) % mod;
        base = ((ll)base * base) % mod;
        exp >>= 1;
    }
    return result;
}

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

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define siz(v) (ll)(v).size()
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, x, n) for (ll i = x; i < (ll)(n); i++)
#define lb lower_bound
#define ub upper_bound
typedef pair<ll, ll> P;
typedef pair<ll, ll> PL;
const ll mod = 1000000007;
const ll INF = 100000000000000099;
const ll LINF = (ll)(1e18 + 99);
vector<ll> dx = {-1, 1, 0, 0}, dy = {0, 0, -1, 1};
//cin.tie(0);ios::sync_with_stdio(false);



template<typename T>
T gcd(T a,T b){//最大公約数を求める
    if(a<b){
        swap(a,b);
    }

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

template<typename T>
vector<T> finddivisor(T x){//整数xの約数が入ったvectorを返すよ(xを含む)  
    vector<T> divisor;
    for(T i=2; (i*i)<=x ;i++)
    {
        if(x%i==0){
            divisor.push_back(i);
            if(i*i!=x){
                divisor.push_back(x/i);
            }//約数はペアを持つことを利用

        }
    }
    sort(divisor.begin(),divisor.end());
    if(x!=1)divisor.push_back(x);
    return divisor;
}

signed main()
{
    ll a,b,ans=1;cin>>a>>b;
    vector<ll> div;

    div=finddivisor(gcd(a,b));
    
    //rep(i,siz(div))cout<<div[i]<<endl;

    rep(i,siz(div)){
        ans++;
        repi(j,i+1,siz(div)){
            if(div[j]%div[i]==0){
                div.erase(div.begin()+j);
                j--;
            }
        }
    }

    cout<<ans<<endl;

}

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

using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> B(M);
  for (int i = 0; i < M; i++) {
    cin >> B[i].first >> B[i].second;
  }
  sort(B.begin(), B.end(), [](pair<int, int> &a, pair<int, int> &b) {
    return a.second < b.second;
  });
  int ans = 0;
  int removed = -1;
  for (auto b : B) {
    if (b.first <= removed) continue;
    ans++;
    removed = b.second - 1;
  }
  cout << ans << endl;

  return 0;
}
/* vim:set fdm=marker: */


Measured memory_bytes: 1024
num = int(input())

def factors(x):
  a = []
  for i in range(1, x + 1):
      if x % i == 0:
          a.append(i)
  return a

f = (factors(num))

if (len(f) != 2): 
  while (len(f) != 2): 
    num += 1
    f = factors(num)
  print (num)
else: 
  print (num)

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

#define sz(x) int(x.size())
#define pii pair<int, int>
#define Task "abc"
#define For(i, a, b) for(int i = (a), _b = (b); i <= b; ++i)
#define Debug(X) cout << #X << " = " << X << '\n'
#define All(x) (x).begin(), (x).end()
#define mp make_pair

typedef unsigned long long ull;
typedef long long ll;

const int maxn = 1e5 + 10;
const int inf = 0x3f3f3f3f;

char s[maxn];
pair<int,int> sto[maxn];
int n, k, m;

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
//  freopen(Task".inp", "r", stdin);
  cin >> n >> k;
  cin >> s + 1;
  int l = 1, r = 1;
  if (s[1] == '0') sto[++m] = mp(1, 1);

  for (; l <= n; ++l){
    if (s[l] == '0') continue;
    r = l;
    while (r + 1 <= n && s[r + 1] == '1') ++r;
    sto[++m] = mp(l, r);
    l = r;
  }

  if (s[n] == '0') sto[++m] = mp(n, n);
  int ma = 0;
  for (int i = 1; i <= m; ++i){
    ma = max(ma, sto[min(i + k, m)].second - sto[i].first + 1);
  }
  cout << ma;
return 0;
}



Measured memory_bytes: 768
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;

class Solver {
    Scanner sc = new Scanner();

    public void Solve() {
        int N = sc.nextInt();
        var V = sc.ArrayInt(N);
        var C = sc.ArrayInt(N);
        int ans = 0;

        for (int i = 0; i < N; i++) {
            var tmp = V[i] - C[i];
            if (tmp > 0) {
                ans += tmp;
            }
        }
        WriteLine(ans);

    }
}


class Scanner {
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner() {
        s = new string[0];
        i = 0;
    }

    public string next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt() {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0) {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong() {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0) {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble() {
        return double.Parse(next());
    }

    public double[] ArrayDouble(int N, double add = 0) {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Program {
    static void Main(string[] args) {
        Solver s = new Solver();
        s.Solve();
    }
}


Measured memory_bytes: 13140
//code by: @thesagniksaha
    #include<bits/stdc++.h>
    #include "chrono"
    #include "random"

    #define ll long long int
    #define mkp make_pair
    #define pb push_back
    #define ff first
    #define ss second
    #define makefast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    #define rep(i,n) for(int i=0;i<n;i++)
    #define repre(i,a,b)for(int i=a;i<=b;i++)
    #define clr1(arr) memset(arr,-1,sizeof(arr));
    #define clr0(arr) memset(arr,0,sizeof(arr));

    using namespace std;

    int main()
    {
        makefast
        int n; cin >> n;
        if(n == 1) cout << 0 << endl;
        else if(n == 0) cout << 1 << endl;
        return 0;
    }


Measured memory_bytes: 3612
#include <iostream>
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b)
{
	if(a==0)return b;
	else return gcd(b%a, a);
}
ll lcm(ll a, ll b)
{
	return a*b/gcd(a,b);
}

int main() {
	ll A,B,C,D;
	cin>>A>>B>>C>>D;
	A--;

	ll nB = (B-B/C-B/D+B/lcm(C,D));
	ll nA = (A-A/C-A/D+A/lcm(C,D));

	cout<< nB-nA <<endl;
	
	return 0;
}

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

int M[105][100005];
int A[105];

void filly(int n, int k)
{
    for(int i = 1; i < n; i++)
    {
        M[i][0] = 1;
        for(int j = 1; j <= k; j++)
        {
                M[i][j] = M[i][j-1];
                M[i][j] += (M[i-1][j] - (j - A[i] - 1 >= 0 ? M[i-1][j - A[i] - 1] : 0) + 1000000007) % 1000000007;
                M[i][j] %= 1000000007;
        }
    }
}

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

    for(int i = 0; i < n; i++)
        cin >> A[i];
    for(int i = 0; i <= A[0]; i++)
        M[0][i] = i+1;
    for(int i = A[0]+1; i <= k; i++)
        M[0][i] = M[0][A[0]];

    filly(n, k);
    cout << (M[n-1][k] - M[n-1][k-1] + 1000000007) % 1000000007;

    return 0;
}


Measured memory_bytes: 41216
def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def primes(N):
    is_prime = [True]*(N+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, N+1):
        if is_prime[i]:
            for j in range(2*i, N+1, i):
                is_prime[j] = False
    return [i for i, p in enumerate(is_prime) if p and i%5 == 1]


def solve():
    N = read_int()
    some_primes = primes(2000)
    print(*some_primes[:N])


if __name__ == '__main__':
    solve()


Measured memory_bytes: 64536
import java.util.Scanner;

class Main
{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		float T=(float)(sc.nextInt());
		float A=(float)(sc.nextInt());
		float[] unko=new float[N];
		for(int i=0; i<N; i++) {
			unko[i]=(float)(sc.nextInt());
		}
		double[] sa=new double[N];
		for(int i=0; i<N; i++) {
			sa[i]=Math.abs(T-unko[i]*0.006-A);
		}

		int a=0;
		double min=114514810;

		for(int i=0; i<N; i++) {
			//System.out.println(i+" "+sa[i]);
			if(min>sa[i]) {
				min=sa[i];
				a=i;
			}
		}
		System.out.println(a+1);
	}
}

Measured memory_bytes: 23380
from itertools import accumulate as acc

N, K = map(int, input().split())
P = list(map(int, input().split()))

p = [(1+p_i)/2 for p_i in P]

l = [0] + list(acc(p))

max_num = 0
for i in range(N-K+1):
    s = l[i+K] - l[i]
    max_num = max(s, max_num)

print(max_num)

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

int main(void){
    int i, j, k, l, N, a[10][10], judge=0;
    for(i=1;i<=9;i++){
        for(j=1;j<=9;j++){
            a[i][j]=i*j;
        }
    }
    scanf("%d", &N);
    for(k=1;k<=9;k++){
        for(l=1;l<=k;l++){
            if(N==a[k][l]){
                judge=1;
                break;
            }
        }
    }
    if(judge==1){
        printf("Yes");
    }else{
        printf("No");
    }
}

Measured memory_bytes: 128
fun main(args: Array<String>) {
    agc034b()
}

fun agc034b() {
    val s = readLine()!!

    var answer = 0L
    var left = 0
    while (left < s.lastIndex) {
        var right = left + 1
        if (s[left] == 'A') {
            var aCount = 1L
            while (right < s.lastIndex) {
                if (s[right] == 'A') {
                    right++
                    aCount++
                } else if (s[right] == 'B' && s[right + 1] == 'C') {
                    right += 2
                    answer += aCount
                } else {
                    break
                }
            }
        }
        left = right
    }

    println(answer)
}


Measured memory_bytes: 34440
import bisect

def sieve(n):
    is_prime =[1]*n
    is_prime[0]=0

    for i in range(2,int((n**0.5)//1+2)):
        if is_prime[i-1]:
            j=i*2
            while j<=n:
                is_prime[j-1]=0
                j+=i
    table=[i for i in range(3,n+1) if is_prime[i-1] and is_prime[i//2]]
    return table

q=int(input())
L=sieve(10**5+1)
ans=[]

for i in range(q):
    l,r=map(int,input().split())
    ans.append(bisect.bisect_right(L,r)-bisect.bisect_left(L,l))

print(*ans,sep="\n")

Measured memory_bytes: 14732
#include <iostream>
#include <vector>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> v;
    for(int i = 0; i < n; ++i){
        int input;
        cin >> input;
        v.push_back(input);
    }

    for(int i = 0; i < n; ++i){
        cout << v[n - 1 - i];
        if(n - 1 != i){
            cout << " ";
        }
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 3096
a = gets.to_i
b = gets.split.map(&:to_i)
hash = {}
a.times do |a|
  hash[a] = b[a]
end

hash = hash.sort_by{ |_, value| value}
hash.each_with_index do |h, i|
  print "#{(h[0] + 1).to_s.chomp}"
  print " "if i != hash.size-1
end


Measured memory_bytes: 23896
#include <bits/stdc++.h>
using namespace std;
int main()
{
  string s; cin >> s;
  sort(s.begin(), s.end());
  if (s[0] == s[1] and s[2] == s[3] and s[1] != s[2])
  {
    cout << "Yes" << endl;
  }
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n, k, q;
    cin >> n >> k >> q;
    vector<ll> a(n);
    set<ll> sa;
    rep(i, n) {
        cin >> a[i];
        sa.insert(a[i]);
    }
    ll ans = LONG_LONG_MAX;
    for(auto &x : sa) {
        vector<ll> tmp;
        priority_queue<ll, vector<ll>, greater<ll>> pq;
        rep(i, n) {
            if (a[i] < x) {
                sort(all(tmp));
                rep(j, sz(tmp) - k + 1) {
                    pq.push(tmp[j]);
                }
                tmp.clear();
            }
            else {
                tmp.push_back(a[i]);
            }
        }
        {
            sort(all(tmp));
            rep(j, sz(tmp) - k + 1) {
                pq.push(tmp[j]);
            }
            tmp.clear();
        }
        if (sz(pq) < q) continue;
        rep(j, q - 1) pq.pop();
        ans = min(ans, pq.top() - x);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3800
/**
    * @Author:Monk78
    * @Topic:I-Coins
**/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll>Vl;
typedef pair<ll,ll>PII;
typedef vector<PII>Vll;
typedef vector<pair<ll,pair<ll,ll> > >Vlll;
typedef priority_queue<ll>PQL;
typedef map<ll,ll>MP;
#define S second;
#define F first;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end));i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define mp make_pair
#define ms(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define mod 1000000009
#define MAX 100005
#define f(i,a,b) for(int i=(a);i<(b);i++)
#define rf(i,a,b) for(int i=(a);i>=b;i--)
#define sl(n) scanf("%lf",&n)
#define pl(n) printf("%lf",n)
#define vpshVar() int main()
vpshVar(){
    ll N;
    cin>>N;
    double prob;
    //dp means i head so far.........
    vector<double>dp(N+1);
    dp[0]=1;
    for(ll coin=1;coin<=N;coin++){
        sl(prob);
        for(ll i=coin;i>=0;i--){
            dp[i]=(i==0 ? 0:dp[i-1]*prob)+dp[i]*(1-prob);
        }
    }
    double ans=0;
    for(ll head=0;head<=N;head++){
        ll tail=N-head;
        if(head>tail){
            ans+=dp[head];
        }
    }
    printf("%.10lf",ans);
return 0;
}


Measured memory_bytes: 256
#include <iostream>

int main() {
  int N, i;
  std::cin >> N;
  
  int A[N];
  for (i = 0; i < N; i++) {
    std::cin >> A[i];
  }
  
  bool T = true;
  for (i = 0; i < N; i++) {
    if (A[i] % 2 == 0) {
      if ((A[i] % 3 != 0) && (A[i] % 5 != 0)) {
        T = false;
      }
    }
  }
  
  if (T) {
    std::cout << "APPROVED" << std::endl;
  } else {
    std::cout << "DENIED" << std::endl;
  }
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

template <class T>
struct Node {
    T value;
    size_t parent, left, right;
    Node(): value(), parent(-1), left(-1), right(-1) {}
    Node(T v): value(v), parent(-1), left(-1), right(-1) {}
};

template <class T>
struct BinarySearchTree {
    vector<Node<T>> nodes;
    size_t root;
    BinarySearchTree(): root(-1) {}
    void insert(T v) {
        Node<T> z(v);
        nodes.push_back(z);

        size_t x=root, y=-1;
        while (~x) {
            y = x;
            if (v < nodes[x].value) {
                x = nodes[x].left;
            } else {
                x = nodes[x].right;
            }
        }

        nodes.back().parent = y;

        if (!~y) {
            root = 0;
        } else if (v < nodes[y].value) {
            nodes[y].left = nodes.size()-1;
        } else {
            nodes[y].right = nodes.size()-1;
        }
    }
    template <class Functor>
    void walk_inorder(Functor F, size_t x=0) {
        if (!~x) return;

        walk_inorder(F, nodes[x].left);
        F(nodes[x]);
        walk_inorder(F, nodes[x].right);
    }
    template <class Functor>
    void walk_preorder(Functor F, size_t x=0) {
        if (!~x) return;

        F(nodes[x]);
        walk_preorder(F, nodes[x].left);
        walk_preorder(F, nodes[x].right);
    }
};

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

    auto output=[](Node<int> &x)->void {
        printf(" %d", x.value);
    };

    BinarySearchTree<int> tree;
    for (size_t i=0; i<n; ++i) {
        char buf[1<<3];
        scanf("%s", buf);
        string instr(buf);

        if (instr == "insert") {
            int key;
            scanf("%d", &key);
            tree.insert(key);
        } else if (instr == "print") {
            tree.walk_inorder(output);
            printf("\n");
            tree.walk_preorder(output);
            printf("\n");
        }
    }

    return 0;
}

Measured memory_bytes: 18924
import java.io.*;
import java.util.*;
import java.util.regex.*;


public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static long cnt=0;
	public static PrintWriter pw = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception {
		solutionA(args);
		if(in!=null){
			in.close();
		}
		pw.flush();
		pw.close();
	}

	public static void solutionA(String[] args) throws Exception{

		int N = nextInt();
		int[] a = nextInts();

		long l=a[0],r=0;
		for(int i=1;i<N;i++) {
			r+=a[i];
		}
		long ans = Math.abs(l-r);
		for(int i=2;i<N-1;i++) {
			l+=a[i-1];
			r-=a[i-1];
			ans = Math.min(ans,Math.abs(l-r));
		}
		pw.println(ans);

	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}

}



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

int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;

  int64_t sum = 0;
  unordered_map<int, int> m;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    m[x]++;
    sum += x;
  }

  int q;
  cin >> q;
  for (int i = 0; i < q; ++i) {
    int b, c;
    cin >> b >> c;
    if (b != c) {
      sum += int64_t(m[b]) * (c - b);
      m[c] += m[b];
      m[b] = 0;
    }
    cout << sum << endl;
  }
  return 0;
}



Measured memory_bytes: 6924
N = int(input())
A = list()
B = list()
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
A.sort()
B.sort()
if N%2 == 1:
    print(B[(N+1)//2 - 1] - A[(N+1)//2 - 1] + 1)
else:
    print((B[(N+1)//2 - 1] - A[(N+1)//2 - 1]) + (B[(N+1)//2] - A[(N+1)//2]) + 1)


Measured memory_bytes: 25408
//
//  main.cpp
//  H
//
//  Created by 譚?髣サ霎セ on 15/2/24.
//  Copyright (c) 2015蟷エ 譚?髣サ霎セ. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstring>

int n,m,a,b[130],dp[2100][2100],v[15];
int dfs(int s1,int s2){
    if(dp[s1][s2]!=dp[2099][2099])return dp[s1][s2];
    int cnt=0;
    for(int i=0;i<m;i++)
        if((b[i]&s1)==s2)cnt++;
    if(cnt<=1)dp[s1][s2]=0;
    else{
        for(int i=0;i<n;i++)
            if(!(s1&v[i]))
                dp[s1][s2]=std::min(dp[s1][s2],std::max(dfs(s1|v[i],s2),dfs(s1|v[i],s2^v[i]))+1);
    }
    return dp[s1][s2];
}

int main(int argc, const char * argv[]) {
    
    for(int i=0;i<15;i++)v[i]=1<<i;
    while(scanf("%d%d",&n,&m)){
        if(!n && !m)break;
        memset(dp,10,sizeof(dp));
        for(int i=0;i<m;i++){
            b[i]=0;
            for(int j=0;j<n;j++){
                scanf("%1d",&a);
                if(a==1)b[i]|=v[j];
            }
        }
        printf("%d\n",dfs(0,0));
    }
    return 0;
}

Measured memory_bytes: 18424
#include <bits/stdc++.h>
using namespace std;
int a[100000];
int N;
vector<int> G[100000];

int dfs(int n) {
	vector<int> v;
	for (int val : G[n]) {
		v.push_back(dfs(val));
	}
	sort(v.begin(), v.end());
	int res = 1, sz = v.size();
	for (int i = 0; i < sz; i++) {
		res = max(res, v[i] + sz - i);
	}
	return res;
}

int main()
{
	cin >> N;
	for (int i = 1; i < N; i++) {
		cin >> a[i]; a[i]--;
		G[a[i]].push_back(i);
	}
	cout << dfs(0) - 1 << endl;
	return 0;
}


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

int N, A, B;
string S;
int tuuka;
int kaigai = 1;

signed main()
{
	cin >> N >> A >> B;
	cin >> S;

	rep(i,S.length()) {
		if (S[i] == 'a') {
			if (tuuka < A + B) {
				tuuka++;
				cout << "Yes" << endl;
			} else {
				cout << "No" << endl;
			}
		} else if (S[i] == 'b') {
			if (tuuka < A + B && kaigai <= B) {
				tuuka++;
				kaigai++;
				cout << "Yes" << endl;
			} else {
				cout << "No" << endl;
			}
		} else {
			cout << "No" << endl;
		}
	}
}


Measured memory_bytes: 896
# 初期入力
N = int(input())
A = list(map(int, input().split()))

#２の倍数か
gusu =[i for i in A if i % 2 ==0]
x = 0
for i in gusu:
    if i % 3 ==0 or i % 5 ==0:
            x += 1          # 偶数の内３または５で割り切れるものを数える  
if len(gusu) == x:
    print("APPROVED")
else:
    print("DENIED")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
    int c1,c5,c50,c10,c100,c500;
    cin>>c1>>c5>>c10>>c50>>c100>>c500;
    if(c1+5*c5+10*c10+50*c50+100*c100+500*c500>=1000){
       cout<<1<<endl;
    }
    else{
        cout<<0<<endl;
    }
    return 0;
}

Measured memory_bytes: 3088
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce


def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

sys.setrecursionlimit(10000)

mod = 1000000007

"""
# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]

# 標準入力取得
## 文字列
    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())
    = [list(list(sys.stdin.readline().rstrip())) for i in range(h)]

## 数値
    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

if __name__ == "__main__":
    a= int(sys.stdin.readline())
    s= sys.stdin.readline().rstrip()
    if a >=3200:
        print(s)
    else:
        print("red")

Measured memory_bytes: 5712
n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(n):
    a.append(a[i] + A[i])

for i in range(m):
    b.append(b[i] + B[i])

ans, j = 0, m
for i in range(n + 1):
    if a[i] > k:
        break
    while b[j] > k - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)

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

int main() {
  int n, a, b;
  cin >> n >> a >> b;
  ll value[n];
  rep (i,n) cin >> value[i];

  P dp[n][n+1];  // [from 1~i][select some] <max value, ways>
  rep (i,n) rep (j,n+1) dp[i][j] = P(0,1);
  dp[0][1] = P(value[0],1);

  for (int i=1; i<n; i++) {
    for (int j=1; j<i+2; j++) {
      if (dp[i-1][j-1].first + value[i] == dp[i-1][j].first) {
        dp[i][j].first = dp[i-1][j].first;
        dp[i][j].second = dp[i-1][j-1].second + dp[i-1][j].second;  // sum ways
      }
      else if (dp[i-1][j-1].first + value[i] > dp[i-1][j].first) {
        dp[i][j].first = dp[i-1][j-1].first + value[i];
        dp[i][j].second = dp[i-1][j-1].second;
      }
      else {
        dp[i][j].first = dp[i-1][j].first;
        dp[i][j].second = dp[i-1][j].second;
      }
    }
  }

  ll ans[3] = {0,0,a};  // <value, ways, selection>

  for (int i=a; i<=b; i++) {
    if (ans[0] * i < dp[n-1][i].first * ans[2]) {
      ans[0] = dp[n-1][i].first;
      ans[1] = dp[n-1][i].second;
      ans[2] = i;
    }
    else if (ans[0] * i == dp[n-1][i].first * ans[2]) {
      ans[1] += dp[n-1][i].second;
    }
  }

  long double x = ans[0] / (long double)ans[2];
  printf("%.6Lf\n", x);
  cout << ans[1] << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

	if (a > b) {
		if (a == 3) {
			cout << (b == 2 ? 1 : 2) << endl;
		}
		else {
			cout << 3 << endl;
		}
	}
	else {
		if (b == 3) {
			cout << (a == 2 ? 1 : 2) << endl;
		}
		else {
			cout << 3 << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 256
/*
------------____________----------------
--------------CRISTIANO-----------------
SUUUUUUUUUIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
GOOOOOOOOOOOOOOAAAAAAAALLLLLLLLLLLLLLLLL
 
Author- Shubham Jha
IIIT- ALLAHABAD
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD 1000000007
#define ffor(i,a,b) for(int i=a;i<b;i++)
#define bfor(i,a,b) for(int i=a-1;i>=b;i--)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define fast  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define endl "\n"
ll dp[100005],arr[100005]={0};
ll func(int n)
{
    if(dp[n]!=-1)
        return dp[n];
    if(n<=2)
        return dp[n] ;
    else
    {
       dp[n]=min((func(n-1)+abs(arr[n]-arr[n-1])),(func(n-2)+abs(arr[n]-arr[n-2])));
    }
    return dp[n];
}
int main()
{
    int n,i;
    cin>>n;
    ffor(i,1,n+1)
    {
      cin>>arr[i];
      dp[i]=-1;
    }
    dp[0]=0,dp[1]=0,dp[2]=abs(arr[1]-arr[2]);
    if(n==2)
      cout<<dp[2];
    else 
    cout<<func(n);

}

Measured memory_bytes: 3328
// template
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<long long, long long> LP;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define REP_AB(i, a, b) for (ll i = ll(a); i <= ll(b); ++i)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)), v.end());
#define SIZE(x) ((ll)(x).size())
#define REVERSE(v) reverse(ALL(v))
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;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
#define out cout
#define in cin
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
// template end

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;
    in >> n;
    vector<ll> s(n);
    REP(i, n) in >> s[i];
    ll ans = 0;
    REP(i, n) ans += s[i];
    if (ans % 10 == 0){
        ll s_min = INF;
        REP(i, n){
            if(s[i] % 10 != 0) chmin(s_min, s[i]);
        }
        if(s_min == INF){
            ans = 0;
        }else{
            ans -= s_min;
        }
    }
    out << ans << endl;
}


Measured memory_bytes: 256
N=int(input())
X=int(N/1.08)
import math
if math.floor(X*1.08)==N:
  print(X)
  exit()
elif math.floor(X*1.08)<N:
  while math.floor(X*1.08)<N:
    X+=1
else:
  while math.floor(X*1.08)>N:
    X-=1
if math.floor(X*1.08)==N:
  print(X)
else:
  print(':(')

Measured memory_bytes: 3064
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define FOR(i,a,n) for(i=(a);i<(n);i++)
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
void fill(int a[],int b,int c){
	int i;
	FOR(i,0,b) a[i]=c;
	return;
}
int main(void)
{
	int i;
	ll k,a,b;
	scanf("%lld",&k);
	a=k/50,b=k%50;
	puts("50");
	FOR(i,0,50){
		if(i<b) printf("%lld",a-b+100);
		else printf("%lld",a-b+49);
		printf("%c",i==49?'\n':' ');
	}
	return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;
import java.util.Arrays;
import java.util.Deque;
import java.util.ArrayDeque;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int num = Integer.parseInt(scanner.nextLine());
		for(int i = 0; i < num; i++){
			String str1 = scanner.nextLine();
			String str2 = scanner.nextLine();
			int m = str1.length();
			int n = str2.length();
			int[][] c = new int[m+1][n+1]; 
			
			for(int j = 0; j <= m; j++){
				c[j][0] = 0;
			}

			for(int j = 0; j <= n; j++){
				c[0][n] = 0;
			}

			for(int j = 1; j <= m; j++){
				for(int k = 1; k <= n; k++){
					if(str1.charAt(j-1) == str2.charAt(k-1)){
						c[j][k] = c[j-1][k-1] + 1;
					}else if(c[j-1][k] > c[j][k-1]){
						c[j][k] = c[j-1][k];
					}else{
						c[j][k] = c[j][k-1];
					}
				}
			}

			System.out.println(c[m][n]);
		}
	}
}

Measured memory_bytes: 64332
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n, s) for (int i = (s); i < (n); i++)
typedef long long int ll;
using namespace std;
using Graph = vector<vector<int>>;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> A(3);
    rep(i, 3) cin >> A[i];
    int total = A.at(0) + A.at(1) + A.at(2);
    if (total >= 22){
        cout << "bust" << endl;
    }
    else{
        cout << "win" << endl;
    }
 //   system("pause");
    return 0;
}

Measured memory_bytes: 256
'''
研究室PCでの解答
解説AC
'''
import math
#import numpy as np
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7

def main():
    r1,c1,r2,c2 = map(int,ipt().split())
    #nCrをmodで割った余りを求める。Nに最大値を入れて使用。
    N = r2+c2+2
    g1 = [1, 1] # 元テーブル
    g2 = [1, 1] #逆元テーブル
    inverse = [0, 1] #逆元テーブル計算用テーブル
    def cmb(n,r,mod=(10**9+7)):
        if r<0 or r>n :
            return 0
        r = min(r,n-r)
        return g1[n]*g2[r]*g2[n-r]%mod
    for i in range(2,N+1):
        g1.append((g1[-1]*i)%mod)
        inverse.append((-inverse[mod % i]*(mod//i))%mod)
        g2.append((g2[-1]*inverse[-1])%mod)

    print((cmb(r2+c2+2,r2+1)+cmb(r1+c1,r1)-cmb(r2+c1+1,r2+1)-cmb(r1+c2+1,r1))%mod)

    return None

if __name__ == '__main__':
    main()


Measured memory_bytes: 219040
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
	int N,X;
	cin >> N >> X;
	int D = 0, ans = 1;
	vector<int> L(N);
	for(int i = 0; i<N; i++){
		cin >> L.at(i);
		D += L.at(i);
		if(D <= X){
			ans++;
		}else{
			break;
		}
	}
	cout << ans << endl;
}


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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ll long long

int main() {
    fastio;
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;

    cout << x2 + y1 - y2 << " "
        << y2 + x2 - x1 << " "
        << x1 + y1 - y2 << " "
        << y1 + x2 - x1 << "\n";

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
    int n,a,sum=0;
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> a;
        if(a%2==1){
        sum++;
        }
    }

    if(sum%2==0){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <limits.h>
#include <map>
#include <numeric>

namespace test {
	std::string to_string (char val) {
		return std::string (1, val);
		// return std::string{val};
	}
	//if( str.find ("r") != string::npos)
}

using namespace std;
typedef long long int llint;

int main (void) {
	int a,b,c; cin >>a >>b>>c;
	if (a + b == c || a + c == b || b + c == a) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define FAST()                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);
#define fill(a, i) memset(a, i, sizeof(a))
#define all(vec) vec.begin(),vec.end()
#define revall(vec) vec.rbegin(),vec.rend()
#define vl vector<ll>
#define tlll tuple<ll, ll, ll>
#define pb push_back
#define fr(i, a, b) for (int i = a; i < b; ++i)  
ll mod=1e9+7;
const ll maxn=1e5+5;
vl adj[maxn]; 
ll dp[maxn][2];
ll n;
bool visited[maxn];
ll dfs(ll u,ll p,ll idx)
{ 
    if(visited[u])
    { 
        ll ans = idx==1?dp[u][0]:dp[u][1]+dp[u][0]; 
        return ans%mod;
    }
    visited[u]=1;
    fr(k,0,2)
    {
        ll temp=1;
        fr(i,0,adj[u].size())
        {
            if(adj[u][i]!=p) 
            temp=(temp*dfs(adj[u][i],u,k))%mod;
            
        } 
        dp[u][k]=temp;
    }
    ll ans = idx==1?dp[u][0]:dp[u][1]+dp[u][0] ; 
    return ans%mod;
}
void solve()
{
    cin>>n;
    fr(i,0,n-1)
    {
        ll u,v;
        cin>>u>>v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    ll ans=0;
    fr(k,0,2)
    {
        ll temp=1;
        temp=dfs(1,0,k); 
    } 
    cout<<(dp[1][0]+dp[1][1])%mod;
}
int main()
{
FAST();
    ll t=1;
    // cin>>t;
    while(t--)
    solve();
}

Measured memory_bytes: 17692
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>

using namespace std;

const int nmax = 1e9 + 7;
const long long INF = 1e18;
const double PI = 2 * asin(1);
typedef long long ll;


int main(){
  string S; cin >> S;
  if (S == "SUN"){
    cout << 7 << endl;
  }
  if (S == "MON"){
    cout << 6 << endl;
  }
    if (S == "TUE"){
    cout << 5 << endl;
  }
    if (S == "WED"){
    cout << 4 << endl;
  }
    if (S == "THU"){
    cout << 3 << endl;
  }
    if (S == "FRI"){
    cout << 2 << endl;
  }
  if (S == "SAT"){
    cout << 1 << endl;
  }
  return 0;
}


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

int main() {
    int n, m, i, sum=0;

    cin >> n >> m;
    int a[m];
    for(i=0; i<m; i++) {
        cin >> a[i];
        sum += a[i];
    }
    if(sum > n){
        cout << -1;
    }else{
        cout << n - sum;
    }
}

Measured memory_bytes: 3636
import java.util.Scanner;
public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int K=stdIn.nextInt();
		int X=stdIn.nextInt();
		int z=0,x=X-K+1;
		if(x<-1000000)
			x=-1000000;
		while(z<K*2-1&&z<1000001){
			System.out.println(x);
			x++;
			z++;
		}
	}
}

Measured memory_bytes: 21076