akhauriyash/Code-Regression huggingface dataset:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    A = sorted(nl())
    print(eval(str(A[2]) + str(A[1]) + '+' + str(A[0])))


if __name__ == '__main__':
    main()


Measured memory_bytes: 9180
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
for i in range(N):
    cankill = B[i]
    ans += min([A[i],B[i]])
    if B[i] - A[i] > 0:
        additional = min([B[i] - A[i],A[i+1]])
        ans += additional
        A[i+1] += - additional
print(ans)

Measured memory_bytes: 18624
#include <stdio.h>
#include <math.h>


using ll = long long;
using llu = long long unsigned;

int main(void)
{
    //scanf("%d", );
    //scanf("%llu", );
    //scanf("%ll", );
    //printf("%d");
    //printf("%lli");
    //printf("%llu");

    llu x,i;
    scanf("%llu", &x);
    llu balance=100;


    for (i=0; balance<x; i++) {
        balance += balance*0.01;
    }

    printf("%llu", i);

    return 0;
}


Measured memory_bytes: 1736
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long int n,m;
	cin >> n >> m;
	
    long long int res = 1e18;
	
	for(int turn = 0; turn <= 1; turn++){
		swap(n,m);
		res = min(res, (n%3) == 0 ? 0 : m);
			for(int j=1;j<=n-1;j++){
				long long int mx = j*m, mn = j*m;
				mx = max(mx, (n-j)*(m/2 + m%2));
				mn = min(mn, (n-j)*(m/2));
				res = min(res, mx-mn);
			}
	}
	
	cout << res;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
vector <int> v[200001];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int x,y;
        cin>>x>>y;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    int dist[n+1];
    for(int i=1;i<=n;i++)dist[i]=INT_MAX;
    dist[1]=0;
    set <pair<int,int>> s;
    s.insert({0,1});
    int ans[n+1];
    while(!s.empty()){
        auto it=s.begin();
        int x=it->second;
        for(int i=0;i<v[x].size();i++){
            int node=v[x][i];
            if(dist[x]+1<dist[node]){
                if(s.find({dist[node],node})!=s.end())s.erase({dist[node],node});
                dist[node]=dist[x]+1;
                s.insert({dist[node],node});
                ans[node]=x;
            }
        }
        s.erase(it);
    }
    for(int i=2;i<=n;i++){
        if(dist[i]==INT_MAX){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    for(int i=2;i<=n;i++)cout<<ans[i]<<endl;
    return 0;
}

Measured memory_bytes: 17212
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
	cin>>s;
	if(s[0]==s[1] || s[1] == s[2] || s[2]==s[3]){
      cout << "Bad" << endl;
    }else{
      cout << "Good" << endl;
    }
} 


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " = " << x << ", ";
#define ll long long
#define pb push_back
using namespace std;
#define FAST_IO                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
const int MOD = 2 * (1e9 + 7);
int dp[100005] = {};
int main()
{
    FAST_IO
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for (int &a : v)
        cin >> a;
    dp[0] = 0;
    for (int i = 1; i <= k; i++)
    {
        dp[i] = 0;
        for (int j = 0; j < n; j++)
        {
            if (i - v[j] >= 0 && dp[i - v[j]] == 0)
                dp[i] = 1;
        }
    }
    cout << (dp[k]==1 ? "First" : "Second") << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin>>s;
	Yn(s[0]=='7'||s[1]=='7'||s[2]=='7');
}


Measured memory_bytes: 3648
dish = []
for i in range(5):
  dish.append(int(input()))

dif = []
for i in range(5):
  if dish[i] % 10 != 0:
    dif.append(10 - (dish[i] % 10))
  else:
    dif.append(0)

max_dif = max(dif)
k = dif.index(max_dif)

sum_time = 0
for i in range(5):
  if i == k:
    sum_time += dish[i]
  else:
    if dif[i] != 0:
      sum_time += ((dish[i] // 10) + 1) * 10
    else:
      sum_time += dish[i]
    
print(sum_time)

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

#define For(i,a,b) for(int (i) = (a);(i) < (b);i++)
#define Rep(i,n) For((i),0,(n))
#define All(a) (a).begin(),(a).end()
#define sp " "
#define INF 1e18
#define INT_INF 1e9
#define MAX 1000

typedef long long ll;

#include <bits/stdc++.h>
using namespace std;


int main(){
    int N;
    cin >> N;
    N++;
    vector<ll> A(N);
    Rep(i,N-1){
        cin >> A[i];
    }
    A[N-1] = 0;
    sort(All(A));
    ll sum[N+1];
    bool jud[N];
    sum[0] = 0;
    Rep(i,N){
        jud[i] = false;
        sum[i+1] = sum[i] + A[i];
    }
    /*Rep(i,N+1){
        cout << sum[i] << sp;
    }*/
    jud[N-1] = true;
    int min = 0;
    for(int j = N-1;j >= 0;j--){
        bool jj = true;
        for(int i = j;i < N;i++){
            if(jud[i])break;
            else if(2*sum[i+1] >= A[i+1]);
            else{
                jj = false;
                break;
            }
        }
        jud[j] = jj;
        if(jj == false){
            min = j;
            break;
        }
    }
    //cout << min << endl;
    cout << N-min-1;
    //cin >> N;
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
#define ll long long
#define PI acos(-1)
#define INF 0x7f3f3f3f
#define L first
#define R second
#define pii  pair<int ,int>
#define pll  pair<long,long>
#define pb push_back
#define lowbit(x)  (x&-x)
#define fr(i,m,n) for( int i=m;i<n;++i)
#define fo(i,m,n) for(int i=m;i<=n;++i)
#define MM(a,b) memset(a,b,sizeof(a));
#define fin freopen("C:\\Users\\w\\Desktop\\ACM\\in.txt","r",stdin)
#define fot freopen("C:\\Users\\w\\Desktop\\ACM\\out.txt","w",stdout)
#define fcs fclose(stdin);fclose(stdout);


using namespace std;

inline void read(int&a){char ch;while(!(((ch=getchar())>='0')&&(ch<='9')));a=ch-'0';while(((ch=getchar())>='0')&&(ch<='9'))(a*=10)+=ch-'0';}


int main()
{
    ll i,n=1;
    cin>>i;
    while(n*(n+1)/2 <i)
    {
        n++;
    }
    cout<<n;
}













Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define reps(i,s,n) for(ll (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define reptr(i,n) for(ll (i)=(n);(i)>=0;--(i))
#define All(x) (x).begin(),(x).end()
using namespace std;
const ll KEY=1e18;

int main() {
  ll N,sum=0;
  cin >> N;
  vector<ll> a(N),b(N+1);
  rep(i,N){
    cin >> a[i];
  }
  b[0]=0;
  for(ll i=1;i<=N;i++){
    b[i]=b[i-1]+a[i-1];
  }
  sort(All(b));
  ll tmp=b[0],count=1;
  for(ll i=1;i<b.size();i++){
    if(tmp==b[i]){
      count++;
    }else{
      sum+=(count*(count-1)/2);
      tmp=b[i];
      count=1;
    }
  }
  sum+=(count*(count-1)/2);
  cout << sum << endl;
}

Measured memory_bytes: 3328
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define repp(i, m, n) for(int i = m, i##_len = (n); i < i##_len; ++i)
#define reprev(i, n) for(int i = (n-1LL); i >= 0; --i)
#define all(x) (x).begin(), (x).end()
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 <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

struct UnionFind {
    vector< int > data;
    UnionFind(int sz) {
        data.assign(sz, -1);
    }
    bool unite(int x, int y) {
        x = find(x), y = find(y);
        if(x == y) return (false);
        if(data[x] > data[y]) swap(x, y);
        data[x] += data[y];
        data[y] = x;
        return (true);
    }
    int find(int k) {
        if(data[k] < 0) return (k);
        return (data[k] = find(data[k]));
    }
    int size(int k) {
        return (-data[find(k)]);
    }
};

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, m; cin >> n >> m;
    UnionFind uf(2 * n);
    rep (i, m) {
        int a, b; cin >> a >> b; a--; b--;
        uf.unite(2 * a, 2 * b + 1);
        uf.unite(2 * b, 2 * a + 1);
    }
    if (uf.find(0) != uf.find(1)) {
        ll x[2] = {};
        rep (i, n) x[(uf.find(2 * i) != uf.find(0))]++;
        eprintf("%lld %lld\n", x[0], x[1]);
        cout << x[0] * x[1] - m << "\n";
    } else {
        cout << n * (n - 1) / 2 - m << "\n";
    }
    return 0;
}

Measured memory_bytes: 1024
# import sys
# import math #sqrt
# import decimal
import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # deque
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    x,y,a,b,c = map(int,input().split())
    p = list(map(int,input().split()))
    q = list(map(int,input().split()))
    r = list(map(int,input().split()))
    p.sort(reverse=True)
    q.sort(reverse=True)
    e = p[0:x] + q[0:y] + r
    e.sort(reverse=True)
    ans = 0
    for i in range(x+y):
        ans += e[i]
    print(ans)
    return

if __name__=='__main__':
    main()


Measured memory_bytes: 24220
#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 1;

int a[N], p[N], m[N], v = 1;
int main() {
    int i, j, n;
    //freopen("input.txt", "r", stdin);
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n;
    for (i = 1; i <= n; ++i)
        cin >> a[i];
    i = n;
    long long ans = 0;
    long long lastl = n + 1;
    while (i > 0) {
        if (i - a[i] < 1) {
            cout << -1;
            return 0;
         }
        if (i - a[i] > lastl) {
            cout << -1;
            return 0;
        }
        j = i;
        while (j > 0 && j - a[j] == i - a[i]) --j;
        ans += a[i];
        lastl = i - a[i];
        i = j;
    }
    cout << ans;
}

Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<cstring>
using namespace std;
long long  mod = 1000000007;
int main()
{
	int i = 1;
	char S[200010];
	char tmp[3] = { ' ','\0'};
	cin >> S;
	tmp[0] = S[0];
	int an = 1;
	while (S[i] != '\0') {
		if (strlen(tmp) == 2) {
			tmp[0] = S[i];
			tmp[1] = '\0';
			an++;
		}
		else if (S[i] == tmp[0]) {
			tmp[0] = S[i];
			i++;
			if (S[i] != '\0') {
				tmp[1] = S[i];
				tmp[2] = '\0';
				an++;
			}
			else {
				i--;
			}
		}
		else {
			tmp[0] = S[i];
			an++;
		}
		i++;
		//cout << tmp << "\n";
	}
	cout << an;
}

Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main()
{
  ll h, n;
  cin >> h >> n;
  vector<ll> as = {};

  ll total = 0;
  for (auto i = 0; i < n; i++)
  {
    ll a;
    cin >> a;
    total += a;
    as.push_back(a);
  }

  if (h <= total)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 1400
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <numeric>
#include <string>
#include <bitset>
#include <functional>

using ld = long double;
using vld = std::vector<ld>;
using vvld = std::vector<vld>;
using vvvld = std::vector<vvld>;
using ll = long long;
using vll = std::vector<ll>;
using vvll = std::vector<vll>;
using vvvll = std::vector<vvll>;
using pll = std::pair<ll, ll>;
using vpll = std::vector<pll>;
using str = std::string;
using vstr = std::vector<str>;

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

constexpr ld PI = 3.141592653589793L;
constexpr ld EPS = std::numeric_limits<ld>::epsilon();

ll gcd(ll n, ll m) { return m ? gcd(m, n % m) : n; }
ll lcm(ll n, ll m) { return n / gcd(n, m) * m; }
bool isprime(ll n) {
    if (n == 1) return false;
    for (ll i = 2; i * i <= n; i++)
        if (n % i == 0) return false;
    return true;
}
ll rpow(ll x, ll n) {
    if (n == 0) return 1;
    ll k = 1;
    for (; n > 1; n /= 2) {
        if (n & 1) k *= x;
        x *= x;
    }
    return k * x;
}
ll modpow(ll x, ll n, ll mod) {
    if (n == 0) return 1;
    ll k = 1;
    for (; n > 1; n /= 2) {
        if (n & 1) (k *= x) %= mod;
        (x *= x) %= mod;
    }
    return k * x % mod;
}
ll modcomb(ll n, ll r, ll mod) {
    if (r < 0 || n < r) return 0;
    chmin(n - r, r);
    ll mul = 1, div = 1;
    for (ll i = 0; i < r; i++) {
        (mul *= n - i) %= mod;
        (div *= i + 1) %= mod;
    }
    return mul * modpow(div, mod - 2, mod) % mod;
}

/*------------------------------------------------------------------------*/

void solve();

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    std::cout << std::setprecision(15);

    solve();
}
void solve() {
    ll n;
    std::cin >> n;

    vll a(n);
    for (ll i = 0; i < n; i++)
        std::cin >> a[i];

    ll ans = 0;
    for (ll i = 0; i < n; i++)
        ans += (~i & 1) && (a[i] & 1);

    std::cout << ans << '\n';
}


Measured memory_bytes: 3648
#include <iostream>
using namespace std;
int main(){
  int h,w,x,i,j,xcom,hout,wout,flag,xmin;
  while(1){
    flag=0;
    cin >> h >> w;
    if(h==0&&w==0) break;
    x=h*h+w*w;
    xmin=100000;
    for(i=1;i<151;i++){
      for(j=i+1;j<151;j++){
    xcom=i*i+j*j;
        if(x==xcom&&h<i){
          hout=i;
      wout=j;
      flag=1;
      break;
    }
    if(x<xcom&&xcom<xmin){
      hout=i;
      wout=j;
      xmin=xcom;
    }
      }
      if(flag==1) break;
    }
    cout << hout << ' ' << wout << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
// inputに入力データ全体が入る
function Main(input) {
 	input = input.split("\n");
    tmp = input[0].split(" ");
    const a = parseInt(tmp[0], 10);
    const b = parseInt(tmp[1], 10);
    const c = parseInt(tmp[2], 10);
//console.log(a,b,c);

 if (b > a*c){console.log(c);}else{console.log(Math.floor(b/a));}
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

int main() {

    char s[300000] = {} ,t[300000] = {};

    Scs(s);
    Scs(t);

    bool alf[127][127] = {{}};

    bool ans = 1;
    Rep( i,200000 ){
        for( int j = 'a'; j < 'z' + 1; j++){
            if( alf[s[i]][t[i]] ) continue;
            if( alf[s[i]][j] ){
                ans = false;
            }
            if( alf[j][t[i]] ){
                ans = false;
            }
        }
        if( !ans ) break;
        alf[s[i]][t[i]] = true;
    }

    YesNo(ans);

    return 0;
}



Measured memory_bytes: 896
#include <bits/stdc++.h>
#define REP(i, m, n) for(int (i) = (m); (i) < (n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
using namespace std;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9+7;
const ll LINF = 1LL<<60;

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    int res = 0;
    rep(i, n) {
        if (a[i] % 2 != 0) continue;
        while(a[i] % 2 == 0) {
            a[i] /= 2;
            res++;
        }
    }

    cout << res << endl;

    return 0;
}

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

using namespace std;

int main(){

  int N,W;
  cin >> N >> W;

  vector<int> v(N+1),w(N+1);
  for(int i = 1; i <= N; i++)
    cin >> v[i] >> w[i];

  auto dp = vector< vector<int> > (2, vector< int >(W+1,0) );
  for(int i = 1; i <= N; i++){
    int nowi = i % 2;
    int prei = (i - 1) % 2;
    for(int j = 1; j <= W; j++){
      dp[nowi][j] = dp[prei][j];
      if(j >= w[i]) dp[nowi][j] = max( dp[prei][j], dp[prei][j-w[i]] + v[i] ); 
    }
  }

  cout << dp[N%2][W] << endl;

}



Measured memory_bytes: 3256
#include <iostream>
#include<stdio.h>//冒泡排序
using namespace std;
int count;
template<typename T> //整数或浮点数皆可使用,若要使用类(class)或结构体(struct)时必须重载大于(>)运算符  //所以？？？？？
void bubble_sort(T arr[],int len,int *p)
{
    int i,j,count=0;
    for(i=0;i<len-1;i++)
    {
        for(j=0;j<len-1-i;j++)
            if(arr[j]>arr[j+1])
            {
                swap(arr[j], arr[j + 1]);
                count++;//看交换了几次
            }
            *p=count;
            //所以加了句 using...and  template是干嘛的，，
    }
}
int main()
{
    int array[300];
    int n,sum;//为了将交换次数传送出去
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&array[i]);
    }

     bubble_sort(array,n,&sum);

    /* for(int i=0;i<n;i++)
    {
       printf("%d ",array[i]);
    }
    printf("\n%d",sum); 这是我正常的输出         */
    for(int i=0;i<n;i++)
    {
        if(i!=n-1)
        {
            printf("%d ",array[i]);
        }
        else printf("%d\n",array[i]);
    }
printf("%d\n",sum);
}



Measured memory_bytes: 3232
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    S = SS()

    ans = [chr((ord(i) - ord('A') + N) % 26 + ord('A')) for i in S]
    print(''.join(ans))

if __name__ == '__main__':
    resolve()


Measured memory_bytes: 10136
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <list>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(long long (i)=0;(i)<(long long)(n);(i)++)
#define RREP(i,n) for(long long (i)=(long long)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;


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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1000000000;
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define rep(i,n) REP(i, 0, n)
typedef pair<int, int> pint;
int fld[20][20];
bool yoko[20][20], tate[20][20];//yoko(?????????tate)??????(j, i) ???????§??????§?????????
int main(){
    ios::sync_with_stdio(false);
    int test; cin >> test;
    rep(casenum, test){
        int gx, gy, p;
        cin >> gx >> gy >> p;
        memset(fld, 0, sizeof(fld));
        memset(yoko, 0, sizeof(yoko));
        memset(tate, 0, sizeof(tate));
        rep(i, p){
            int x1, y1, x2, y2;
            cin >> x1 >> y1 >> x2 >> y2;
            if(x1 == x2){
                tate[max(y1, y2)][x1] = true;
            }else{
                yoko[y1][max(x1, x2)] = true;
            }
        }
        rep(i, gy + 1) rep(j, gx + 1){
            if(i == 0 && j == 0){
                fld[i][j] = 1;
              continue;
            }
            int temp1 = j ? fld[i][j - 1] : 0, temp2 = i ? fld[i - 1][j] : 0;
            if(tate[i][j] && yoko[i][j]){
                fld[i][j] = 0;
            }else if(tate[i][j]){
                fld[i][j] = temp1;
            }else if(yoko[i][j]){
                fld[i][j] = temp2;
            }else{
                fld[i][j] = temp1 + temp2;
            }
        }
        if(!fld[gy][gx]) cout << "Miserable Hokusai!" << endl;
        else cout << fld[gy][gx] << endl;
    }
    return 0;
}

Measured memory_bytes: 1200
#include <stdio.h>
int main(void)
{
	int n[105];
	int a;
	int b;

	scanf("%d", &a);
	for (b=1;b<=a;b++)
	{
		scanf("%d", &n[b]);
	}
	for (b=a;b>0;b=b-1)
	{
		if (b==a)
		{
			printf("%d", n[b]);
		}
		else
			printf(" %d", n[b]);
	}
	printf("\n");
	return 0;
} 

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

vector<vector<int> > adj;
int solve(int i, int p) {
    int g = 0;
    for (int j : adj[i]) if (j != p) g ^= 1 + solve(j, i);
    return g;
}

int main() {
    int n; cin >> n;
    adj.resize(n);
    for (int i = 1; i < n; i++) {
        int u, v; cin >> u >> v;
        adj[u-1].push_back(v-1);
        adj[v-1].push_back(u-1);
    }
    cout << (solve(0, -1) == 0 ? "Bob" : "Alice") << endl;
}


Measured memory_bytes: 10368
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#define mod 1000000007
using namespace std;

int main()
{
    long long a,b,c;
    cin>>a>>b>>c;
    a=abs(a);
    long long k=a/c;
    if(k>=b)
    {
        printf("%lld\n",a-(b*c));
    }
    else
    {
        long long x = b-k;
        long long n = a%c;
        long long m = c-n;
        if(x%2==0)
        {
            printf("%lld\n",n);
        }
        else
            printf("%lld\n",m);

       // printf("%lld\n",min(n,m));
        //printf("%lld\n",min(n,long long(abs(n-c))));
    }
    return 0;
}


Measured memory_bytes: 3736
// B.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>

using namespace std;

int main(int argc, char *argv[]) {
	int n;
	cin >> n;
	string s;
	cin >> s;
	int ans = 0;
	for (int i = 0; i <= s.length() - 3; ++i) {
		ans += s.substr(i, 3) == "ABC";
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    for(int i=1;i<=3;i++){
        if(i!=a&i!=b){
            cout<<i<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
nt=input().split(" ")
N=int(nt[0])
T=int(nt[1])


a=input().split(" ")
int_a=[]
maxlist=[]
for i in range(N):
    int_a.append(int(a[i]))

reva=int_a
reva.reverse()
max=0
for i in range(N):
    if reva[i]>max:
        max=reva[i]
    maxlist.append(max)

maxlist.reverse()
int_a.reverse()


max=0
count=1
for i in range(N):
    if maxlist[i]-int_a[i]>max:
        count=1
        max=maxlist[i]-int_a[i]
    elif maxlist[i]-int_a[i]==max:
        count+=1

print(count)        


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

typedef long long ll;

int main() {
	int r, g, b;
	cin >> r>>g >>b;
	int x=10*g+b;
	if(x%4==0) {
		cout << "YES\n";
	}
	else	cout << "NO\n";
	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
  private static class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
      reader = new BufferedReader(new InputStreamReader(in));
      tokenizer = null;
    }

    public String next() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public String nextLine() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          return reader.readLine();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }

      return tokenizer.nextToken("\n");
    }

    public long nextLong() {
      return Long.parseLong(next());
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }

    public double nextDouble() {
      return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = nextInt();
      return a;
    }

    public long[] nextLongArray(int n) {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = nextLong();
      return a;
    }
  }

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    String s = sc.next();
    Set<String> chars = new HashSet<>();
    chars.addAll(Arrays.asList(s.split("")));
    if (chars.size() == 2) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}

Measured memory_bytes: 23124
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    int taste = 0;
    if(l > 0){
      for(int idx=0; idx<n-1; idx++){
        taste += l + idx + 1;
      }
    }else if(l == 0){
      for(int idx=0; idx<n; idx++){
        taste += l + idx;
      }      
    }else if(l < 0){
      if(n + l > 0){
        for(int idx=0; idx<n; idx++){
          taste += l + idx;
        }              
      }else{
        for(int idx=0; idx<n - 1; idx++){
          taste += l + idx;
        }                      
      }
    }

    System.out.println(taste);
    
  }
}


Measured memory_bytes: 23892
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>


using namespace std;

#define int long long
#define ll long long
//#define double long double
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

const int INF = 2e15;
const int MB = 20;
const int MOD = 1e9 + 7;
const int maxN = 2e5;

int fact[maxN], rev[maxN];

int mod_pow(int a, int b) {
    if (!b) return 1;
    if (b % 2) return a * mod_pow(a, b - 1) % MOD;
    int q = mod_pow(a, b / 2);
    return q * q % MOD;
}

int c(int n, int k) {
    return (fact[n] * rev[k] % MOD) * rev[n - k] % MOD;
}

void solve() {
    int n;
    cin >> n;
    vector<int> a(n + 1);
    for (int i = 0; i <= n; i++) {
        cin >> a[i];
    }

    fact[0] = 1;
    for (int i = 1; i < maxN; i++) {
        fact[i] = fact[i - 1] * i % MOD;
    }
    
    for (int i = 0; i < maxN; i++) {
        rev[i] = mod_pow(fact[i], MOD - 2);
    }

    vector<bool> good(n);
    int pos = -1;
    for (int i = 0; i <= n; i++) {
        if (good[a[i] - 1]) {
            pos = i;
            break;
        }
        good[a[i] - 1] = true;
    }

    int cnt = 0;
    for (int i = 0; i <= n; i++) {
        if (a[i] == a[pos]) break;
        cnt++;
    }
    for (int i = pos + 1; i <= n; i++) {
        cnt++;
    }

    for (int k = 1; k <= n + 1; k++) {
        int one = c(n + 1, k);
        int two = cnt >= k - 1 ? c(cnt, k - 1) : 0;
        cout << (one - two + MOD) % MOD << '\n';
    }
}

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

Measured memory_bytes: 5120
A, B = map(int, input().split())
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
def cnt_pfact(n):
    ans = 1
    _n = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if _n%i==0:
            cnt=0
            while _n%i==0:
                cnt+=1
                _n //= i
            ans += 1
    if _n!=1:
        ans += 1
    return ans
  
print(cnt_pfact(gcd(A, B)))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main(){
    string str;
    cin>>str;
    int a;
    a=0;
    for(int i=0;i<4;i++){
        if(str.at(i)=='+'){
            a++;
        }
        if(str.at(i)=='-'){
            a--;
        }
    }
    cout<<a<<endl;
}

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

int main() {
  ll h, w;
  cin >> h >> w;
  if (h == 1 || w == 1) {
    cout << 1 << endl;
    return 0;
  }
  ll size = h * w;
  if (size % 2 == 0)
    cout << size / 2 << endl;
  else
    cout << size / 2 + 1 << endl;
}


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

int main() 
{
    long long N, K;
    cin >> N >> K;
    vector<long long>H(N);
    for (int i = 0; i < N; i++) {
        cin >> H.at(i);
    }
    sort(H.begin(), H.end());
    
    long long sum = 0;
    for (int i = 0; i < N-K; i++) {
        sum += H.at(i);
    }
    cout << sum << endl;
}

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

int main()
{
	int n, x, y;
	cin >> n >> x >> y;
	vector<int> kyori (n);
	for (int i = 1; i < n; ++i)
	{
		for (int j = i+1; j <= n; ++j)
		{
			int l1, l2, l3, k;
			l1 = j - i;
			l2 = max(x, i) - min(x, i) + max(j, y) - min(j,y) + 1;
			l3 = max(y, i) - min(y, i) + max(j, x) - min(j,x) + 1;
			k = min(min(l1, l2), l3);
			kyori[k]++;
		}
	}
	for (int i = 1; i < n; ++i)
	{
		cout << kyori[i] << endl;
	}
}

Measured memory_bytes: 256
#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;

int main() {
    
    int N;
    long long H;
    cin >> N >> H;
    
    priority_queue<long long> pq;
    long long a_m = 0;
    for ( int i = 0; i < N; i++ ) {
        long long a,b;
        cin >> a >> b;
        a_m = max( a_m, a );
        pq.push(a);
        pq.push(b);
    }
    
    long long ans = 0;
    while ( H > 0 ) {
        long long a = pq.top();
        pq.pop();
        H -= a;
        ans++;
        if ( a == a_m ) { break; }
    }
    
    if ( H > 0 ) { ans += (H/a_m) + ( (H%a_m) ? 1 : 0 ); }
    
    cout << ans << endl;
    
    return 0;
}

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

using namespace std;
#define rep(i, n) for(int i=0; i<(int)(n); i++)

typedef long long ll;

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

  int a = 0;
  for(int i=1; i<=n; i++){
    if(i % 2 != 0) a++;
  }

  double ret = (double)a/n;

  cout << ret << endl;

  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int n,num;
  long long int i,j;
  int p[1000001];

  num = 0;
  p[1] = 0;
  for(i = 2;i<=1000000;i++){
   for(j = 2;j*j<=i;j++){
     if(!(i%j))break;
   }
   if(j*j>i)num++;
   p[i] = num;
  }
  while(scanf("%d",&n)!=EOF){
    printf("%d\n",p[n]);
  }
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define _GLIBCXX_DEBUG

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vvd = vector<vd>;
using vvvi = vector<vvi>;
using vvvll = vector<vvll>;
using vvvd = vector<vvd>;

const double pi=3.141592653589793;
const ll MOD=1e9+7;

int main() {
    int h,w;
    cin>>h>>w;
    int c[10][10];
    rep(i,10){
        rep(j,10){
            cin>>c[i][j];
        }
    }
    vi d(10,0);
    rep(i,h){
        rep(j,w){
            int a;
            cin>>a;
            if (a!=-1)d[a]+=1;
        }
    }
    rep(k,10){
        rep(i,10){
            rep(j,10){
                c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
            }
        }
    }
    ll ans=0;
    rep(i,10){
        ans+=c[i][1]*d[i];
    }
    cout<<ans<<endl;

    return 0;
}

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

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            Solve();
        }
        private const long MOD = 1000000007;
        private static Dictionary<string,int> dic = new Dictionary<string, int>();

        static void Solve()
        {
            int n = ReadAndParseInt();
            for(int i=0;i<n;++i)
            {
                var s = Console.ReadLine();
                SafeAdd(s);
            }

            int m = ReadAndParseInt();
            for(int i=0;i<m;++i)
            {
               var s = Console.ReadLine();
                SafeRemove(s);
            }
            int ans = 0;
            foreach(var p in dic)
            {
                if( p.Value >= 1)
                {
                    ans = Math.Max(ans, p.Value);
                }
            }
            Console.WriteLine(ans);

        }
        private static void SafeAdd(string s)
        {
            if(dic.ContainsKey(s))
            {
                dic[s]++;
            }
            else
            {
                dic.Add(s, 1);
            }
        }
        private static void SafeRemove(string s)
        {
            if (dic.ContainsKey(s))
            {
                dic[s]--;
            }
            else
            {
                dic.Add(s, -1);
            }
        }
#region よく使う便利関数
        private static bool isPrime(long x)
        {
            if (x == 2) { return true; }
            if (x < 2 || x % 2 == 0) { return false; }
            long i = 3;
            while (i * i <= x)
            {
                if (x % i == 0) { return false; }
                i = i + 2;
            }
            return true;
        }
        private static long lcm(long x, long y)
        {
            return x / gcd(x, y) * y;
        }
        private static long gcd(long x, long y)
        {
            return y > 0 ? gcd(y, x % y) : x;
        }
        private static long pow(long x, long n)
        {
            if (n == 0) { return 1; }
            long res = pow(x * x % MOD, n / 2);
            if (n % 2 == 1)
            {
                res = res * x % MOD;
            }
            return res;
        }
        private static int ReadAndParseInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static int[] ReadAndParseIntArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        }
        private static long ReadAndParseLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadAndParseLongArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        }
#endregion
    }
}

Measured memory_bytes: 13152
#include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int>P;//Pre val
#define fi first
#define se second
 
const int SIZE=16777216;
int dat[SIZE*2-1];
const int INF=LLONG_MAX/100;
void update(int k,int x){
    k+=SIZE-1;
    dat[k]=x;
    while(k){
        k=(k-1)/2;
        dat[k]=max(dat[k*2+1],dat[k*2+2]);
    }
}
 
int getMax(int a,int b,int k=0,int l=0,int r=SIZE){
    if(a<=l&&b>=r)return dat[k];
    if(r<=a||b<=l)return -INF;
 
    int m=(l+r)/2;
    int vl=getMax(a,b,k*2+1,l,m);
    int vr=getMax(a,b,k*2+2,m,r);
    return max(vl,vr);
}
 
int N,D;
int X[30],Y[30];
 
vector<P>A,B;
void Latte(int cur,int last,int val,int pre,bool after){
    if(cur==last){
        if(after)B.push_back(P(pre,val));
        else A.push_back(P(pre,val));
        return;
    }
 
    Latte(cur+1,last,val+X[cur],pre+Y[cur],after);
    Latte(cur+1,last,val-X[cur],pre-Y[cur],after);
    Latte(cur+1,last,val,pre,after);
}
 
 
signed main(){
    cin>>N>>D;
    for(int i=0;i<N;i++)cin>>Y[i]>>X[i];
 
    Latte(0,N/2,0,0,false);
    Latte(N/2,N,0,0,true);
 
    sort(A.rbegin(),A.rend());
    sort(B.begin(),B.end());
    fill_n(dat,SIZE*2-1,-INF);
    for(int i=0;i<B.size();i++){
        update(i,B[i].second);
    }
 
    int ans=-INF;
    int lb=0,ub=0;
    for(int i=0;i<A.size();i++){
        while(lb<B.size()&&-D-A[i].fi>B[lb].fi)lb++;
        while(ub<B.size()&&D-A[i].fi>=B[ub].fi)ub++;
        ans=max(ans,A[i].se+getMax(lb,ub));
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 713360
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>

using namespace std;

int main()
{
    const char *error = "error";

    int A, B;
    if (scanf("%d%d", &A, &B) < 2) return 0;

    if (10 <= A + B) printf("%s\n", error);
    else printf("%d\n", A + B);
}


Measured memory_bytes: 128
def prime_list(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

Q = int(input())
LR = [list(map(int,input().split())) for _ in range(Q)]
p = prime_list(100010)
s = []
s.append(0)
for i in range(100001):
    if (i%2 == 1) and i in p and (i+1)//2 in p:
        s.append(s[i]+1)
    else:
        s.append(s[i])
for lr in LR:
    print(s[lr[1]+1]-s[lr[0]])

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

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

void solve(long long N, long long M){
    if(N == M){
        cout<<YES<<endl;
    }else{
        cout<<NO<<endl;
    }
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    solve(N, M);
    return 0;
}


Measured memory_bytes: 256
def main():
    n = int(input())
    A = [int(x) for x in input().split()]
    a0 = A.pop(0)
    ans = A[1:n:2][::-1] + [a0] + A[0:n:2]
    if n % 2 == 0:
        print(' '.join([str(a) for a in ans[::-1]]))
    else:
        print(' '.join([str(a) for a in ans]))

if __name__ == '__main__':
    main()

Measured memory_bytes: 119104
#include<iostream>
#include<cmath>
using namespace std;
int main(){
	int *num,siz,time,max,nownum;
	while(cin>>time>>siz&&time!=0){
		num=new int[siz];
		for(int i=0;i<siz;++i){
			num[i]=0;
		}
		nownum=0;
		int dommy;
		max=-2000000000;
		for(int i=0;i<time;++i){
			cin>>dommy;
			nownum-=num[i%siz];
			nownum+=dommy;
			num[i%siz]=dommy;
			if(max<nownum&&i+1>=siz){
				max=nownum;
			}
		}
		cout<<max<<endl;
		delete num;
	}
	return 0;
}

Measured memory_bytes: 3000
#include <iostream>

using namespace std;

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

    int min_value = 10, min_index, sum = 0;
    for (int i = 0; i < 5; i++)
    {
        if (meal[i] % 10 != 0 && min_value > meal[i] % 10)
        {
            min_value = meal[i] % 10;
            min_index = i;
        }
    }

    for (int i = 0; i < 5; i++)
    {
        if (i != min_index && meal[i] % 10 != 0)
        {
            sum += (meal[i] / 10 + 1) * 10;
        }
        else
        {
            sum += meal[i];
        }
    }

    cout << sum << endl;
}

Measured memory_bytes: 256
// #pragma GCC target("avx")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
// #define BEGIN_STACK_EXTEND(size) void * stack_extend_memory_ = malloc(size);void * stack_extend_origin_memory_;char * stack_extend_dummy_memory_ = (char*)alloca((1+(int)(((long long)stack_extend_memory_)&127))*16);*stack_extend_dummy_memory_ = 0;asm volatile("mov %%rsp, %%rbx\nmov %%rax, %%rsp":"=b"(stack_extend_origin_memory_):"a"((char*)stack_extend_memory_+(size)-1024));
// #define END_STACK_EXTEND asm volatile("mov %%rax, %%rsp"::"a"(stack_extend_origin_memory_));free(stack_extend_memory_);

#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
#include<unordered_set>
#include<unordered_map>
#include<complex>
using namespace std;
const long long mod=998244353;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-11;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 11100000;
const int UF_SIZE = 3100000;
namespace{
	long long fact[C_SIZE];
	long long finv[C_SIZE];
	long long inv[C_SIZE];
	inline long long Comb(int a,int b){
	 	if(a<b||b<0)return 0;
	 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
	}
	void init_C(int n){
		fact[0]=finv[0]=inv[1]=1;
		for(int i=2;i<n;i++){
			inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
		}
		for(int i=1;i<n;i++){
			fact[i]=fact[i-1]*i%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	long long pw(long long a,long long b){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%mod;
			a=a*a%mod;
			b/=2;
		}
		return ret;
	}
	long long pw_mod(long long a,long long b,long long M){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%M;
			a=a*a%M;
			b/=2;
		}
		return ret;
	}
	int pw_mod_int(int a,int b,int M){
		if(a<0)return 0;
		if(b<0)return 0;
		int ret=1;
		while(b){
			if(b%2)ret=(long long)ret*a%M;
			a=(long long)a*a%M;
			b/=2;
		}
		return ret;
	}
	int ABS(int a){return max(a,-a);}
	long long ABS(long long a){return max(a,-a);}
	double ABS(double a){return max(a,-a);}
	int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
	int UF[UF_SIZE];
	void init_UF(int n){
		for(int i=0;i<n;i++)UF[i]=-1;
	}
	int FIND(int a){
		if(UF[a]<0)return a;
		return UF[a]=FIND(UF[a]);
	}
	void UNION(int a,int b){
		a=FIND(a);b=FIND(b);if(a==b)return;
		if(UF[a]>UF[b])swap(a,b);
		UF[a]+=UF[b];UF[b]=a;
	}
}
// ここから編集しろ
int t[103];
int main(){
	int a,b;scanf("%d%d",&a,&b);
	for(int i=0;i<b;i++){
		int p;scanf("%d",&p);
		t[p]=1;
	}
	int f=0;
	int d=mod;
	for(int i=0;i<=101;i++){
		if(t[i])continue;
		if(ABS(a-i)<d){
			d=ABS(a-i);
			f=i;
		}
	}
	printf("%d\n",f);
}

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

int main() {
  int n;cin>>n;
  vector<long long>a(n+1);
  rep(i,n+1) cin>>a[i];
  vector<long long>b(n);
  rep(i,n+1) cin>>b[i];
  
  long long count=0;
  for (int i=0;i<n;i++) {
    if (a[i]<=b[i]) {
      b[i]-=a[i];
      count+=a[i];
      if (a[i+1]>=b[i]) {
        a[i+1]-=b[i];
        count+=b[i];
      }
      else {
        count+=a[i+1];
        a[i+1]=0;
      }
    }
    else {
      count+=b[i];
    }
  }
  cout<<count<<endl;
}

Measured memory_bytes: 1792
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip> // fixed, setprecision 
#include <math.h> // double sqrt
#define rep(i,n) for(int i=1;i<(n);++i)
#define ll long long
using namespace std;

int main(){
    int v;
    int n;
    cin>>n;
    vector<int>a(100001);
    rep(x,105){
        rep(y,105){
            rep(z,105){
                v=x*x+y*y+z*z+x*y+z*x+y*z;
                if(v<=10001)a[v]+=1;
            }
        }
    }
rep(i,n+1)cout<<a[i]<<endl;
}

Measured memory_bytes: 3356
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n = 0;
  cin >> n;
  
  vector<int> x(n);
  for (int i = 0; i < n; i++) {
    cin >> x.at(i);
  }

  int mincost = 100000000000;
  for (int y = -100; y < 101; y++) {
    int sum = 0;
    for (int i = 0; i < n; i++) {
      sum += pow((x.at(i) - y), 2);
    }
    mincost = min(sum, mincost);
  }
  
  cout << mincost << endl;
}
 

Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define rep(i,n) for(long long int i = 0; i < n; i++)
#define _rep(i,m,n) for(long long int i = m; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
const int N = 1000000;
const ll mod = 1000000007;

int main(){
    string s; cin >> s;
    int count = s.size() - 2;
    print(s[0] + to_string(count) + s[s.size() - 1]);
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
  int N;
  cin >> N;
  int l, r;
  int ans = 0;
  for(int i = 0; i < N; ++i) {
    cin >> l >> r;
    ans += r - l + 1;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256