akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int x = 0;
    int xmax = 0;
    int n;
    cin >> n;
    string s,s1;
    cin >> s;
    //cout << n << s << endl;

    for(int i=0 ; i<n ; i++){
        s1 = s.substr(i,1);
     	//cout << i << "文字め" << s1 << endl;
     	if (s1 == "I"){
         	//cout << "+1" << endl;
         	x++;
     	}else{
         	//cout << "-1" << endl;
         	x--;
     	}
     	
    //cout << x << endl;
    if(x > xmax){
        xmax = x;
    }
    }
    //cout << "xmax:" << xmax << endl;
    cout << xmax << endl;
    
}

Measured memory_bytes: 256
// にぶたんの臭いがしたけどぜんぜん違ったわ 1時間くらい無駄にした
package main

import (
	"fmt"
	"sort"
)

func main() {
	var N, C, K int
	fmt.Scan(&N, &C, &K)
	T := make([]int, N)
	for i := 0; i < N; i++ {
		var V int
		fmt.Scan(&V)
		T[i] = V
	}
	sort.Ints(T)
	bus := 1
	currentTime := T[0]
	limitTIme := currentTime + K
	passenger := 0
	arr := []int{}
	for _, t := range T {
		if passenger+1 > C || t > limitTIme {
			arr = []int{t}
			bus++
			passenger = 1
			currentTime = t
			limitTIme = currentTime + K
		} else {
			passenger++
			arr = append(arr, t)
		}
	}
	fmt.Println(bus)
}


Measured memory_bytes: 5504
import math
import sys
 
nums = list(map(int, input().split()))
a = nums[0]
b = nums[1]
 
for i in range(1200):
  if math.floor(i * 0.08) == a and math.floor(i*0.1) == b:
      print(i)
      sys.exit()
 
print(-1)

Measured memory_bytes: 3060
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
        int i;
        int h[] = new int[n];
        int count = 0;
        int ans = 0;
        for(i = 0; i < n; i++){
      	  h[i] = sc.nextInt();
          if(i >= 1 && h[i- 1] >= h[i]){
            count += 1;
          }else{
            count = 0;
          }
          
          if(ans < count){
            ans = count;
          }
        }
		
        
      	System.out.println(ans);
 
    }
}

Measured memory_bytes: 58452
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i,m,n) for(int i = m - 1; i >= n; i--)
#define ALL(v) v.begin(), v.end()
#define itn int
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
#define YES() cout << "YES" << endl
#define NO() cout << "NO" << endl
template<typename T, typename U>
inline bool CMAX(T &m, U x) { if (m < x) { m = x; return true; } return false; }
template<typename T, typename U>
inline bool CMIN(T &m, U x) { if (m > x) { m = x; return true; } return false; }

typedef long long lint;
typedef long double ldouble;
const int INF = 1e9;
const lint LINF = 1e18;
const int MOD = 1e9+7;
int main(){
    int n,k;
    cin >> n >> k;
    int cnt = 0;
    while(1){
        if(int(pow(k,cnt)) <= n && int(pow(k,cnt + 1)) > n)
            break;
        cnt++;
    }
    cout << cnt  +1 << endl;
    return 0;
}

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

#define REP(i,N) for(ll i=0;i<N;++i)

// p番目以降の要素を使って, tを作れる場合にtrueを返す
bool solve(const vector<ll> &A, ll p, ll t) {
	// t:target
	// p: the index of p-th element of A
	// branching with p used or not used
	if(t == 0) {
		return true;
	}
	if(p==A.size()) {
		return false;
	}
	bool ans;
 	ans	= solve(A,p+1, t-A[p]);// p-th element used
	if(ans) return ans;
	ans = solve(A,p+1, t);// p-th element not used
	if(ans) return ans;
}

int main() {
	ll n;
	cin >> n;
	vector<ll> A(n,0);
	REP(i,n) scanf("%lld", &A[i]);
	ll q;
	cin >> q;
	vector<ll> M(q,0);
	REP(i,q) scanf("%lld", &M[i]);
	// 全探索が必要
	// どうやって全探索するのか
	// 各要素を使うか使わないかの組合せを全て走査する
	// 2分岐tree構造 
	REP(i,q) {
		if(solve(A,0,M[i])) cout << "yes" << endl;
		else cout << "no" << endl;;
	}
	return 0;
}



Measured memory_bytes: 3236
import java.util.Scanner;

public class Main {

		public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);
		int N, K;
		N = sc.nextInt();
		K = sc.nextInt();
		sc.close();
		double ans = 0;
		for (int i = 1; i <= N; i++) {
			double tmp = 1.0/N;
			int  now = i;
			while (now < K) {
				now *= 2;
				tmp /= 2;
			}
			ans += tmp;

		}

		System.out.println(ans);


	}


}

Measured memory_bytes: 21588
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
const int MOD = 1E9+7;
const int N = 1000000+5;
const int dx[] = {0,0,-1,1,-1,-1,1,1};
const int dy[] = {-1,1,0,0,-1,1,-1,1};
using namespace std;

int a[N];
int bucket[N];
int main() {
    int n;
    scanf("%d",&n);
    for(int i=1; i<=n; i++) {
        scanf("%d",&a[i]);
        bucket[a[i]]++;
    }

    bool flag=true;
    if(n%2) {
        if(bucket[0]!=1)
            flag=false;

        for(int i=2; i<=n-1; i+=2)
            if(bucket[i]!=2)
                flag=false;
    }
    else {
        for(int i=1; i<=n-1; i+=2)
            if(bucket[i]!=2)
                flag=false;
    }

    LL res=1;
    for(int i=0;i<n/2;i++)
        res=(res%MOD)*2%MOD;

    if(n%2) {
        if(!flag)
            printf("0\n");
        else{
            printf("%lld\n",res);
        }
    }
    else {
        if(!flag)
            printf("0\n");
        else{
            printf("%lld\n",res);
        }
    }

    return 0;
}


Measured memory_bytes: 4736
N,K=map(int,input().split())
a=[]

for i in range(N):
    b=int(input())
    a.append(b)

a=sorted(a)

b=[]
for j in range(N-K+1):
    c=a[j+K-1]-a[j]
    b.append(c)    
        
print(min(b))    

Measured memory_bytes: 10892
import java.io.IOException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int data = scanner.nextInt();
			if (data == 0) {
				scanner.close();
				break;
			}

			char[][] symbols = new char[data][];
			symbols[0] = scanner.next().toCharArray();

			for (int i = 1; i < data; i++) {
				symbols[i] = scanner.next().toCharArray();
				for (int j = 0; j < symbols[i].length; j++) {
					if (symbols[i][j + 1] != '.') {
						// 右隣が文字の'.'は必ず'+'である
						symbols[i][j] = '+';
						for (int k = i - 1; k >= 0; k--) {
							// '+'の上にあるスペースは'|'で埋めていく
							if (symbols[k][j] == ' ') {
								symbols[k][j] = '|';
							} else {
								break;
							}
						}
						break;
					} else {
						// それ以外ならとりあえずスペースで埋めておく
						symbols[i][j] = ' ';
					}
				}
			}

			for (int i = 0; i < symbols.length; i++) {
				System.out.println(symbols[i]);
			}

		}

	}
}

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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
ll N,A[202020],B[202020];
vector<pll> bav;
ll i,j,k;
int main(){
    scanf("%lld", &N);
    fornum(i,0,N){
        scanf("%lld%lld", &A[i], &B[i]);
        bav.push_back({B[i], A[i]});
    }
    sort(bav.begin(), bav.end());
    k = 1e15;
    fornum(i,0,N){
        auto ba = bav[N - 1 - i];
        if(ba.first<k){
            k = ba.first;
        }
        k -= ba.second;
        if(k<0){
            printf("No");
            return 0;
        }
    }

    printf("Yes");
    return 0;
}

Measured memory_bytes: 8560
/* おまじない　*/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
typedef long long ll;
typedef long double ld;
using namespace std;
const ll MOD=pow(10,9)+7;
const ll INF=(1LL<<62);
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
void init(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
}


int main(){
    init();

    ll N;cin>>N;
    ll Lucas[N+1];
    Lucas[0]=2;
    Lucas[1]=1;
    for(int i=2;i<=N;i++){
        Lucas[i]=Lucas[i-1]+Lucas[i-2];
    }
    cout<<Lucas[N]<<endl;

}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <map>
#include <vector>
#include <cstring>
#include <climits>
#include <queue>
#include <cmath>
#include <iomanip>
#include <set>
#include <bitset>

using namespace std;

typedef long long LL;
typedef pair<int, int> pii;

const int MAXN = 200005;
int n, m, k;
LL a[MAXN], b[MAXN];
LL prefa[MAXN], prefb[MAXN];
int main() {
	ios::sync_with_stdio(false);
	cin >> n >> m >> k;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		prefa[i] = prefa[i - 1] + a[i];
	}
	for (int i = 1; i <= m; i++) {
		cin >> b[i];
		prefb[i] = prefb[i - 1] + b[i];
	}
	int L = n, R = 0;

	int ans = 0;
	while (L >= 0) {
		while (R + 1 <= m && prefb[R + 1] + prefa[L] <= k) {
			R++;
		}
		if (prefb[R] + prefa[L] <= (LL)k) {
			ans = max(ans, L + R);
		}
		L--;
	}
	cout << ans << '\n';
}

Measured memory_bytes: 9860
///   BISMILLAHIR RAHMANIR RAHEEM
///   ALLAH IS WATCHING ME
///   ALLAH save us from COVID-19.Amin.

///   █▀█─█──█──█▀█─█─█
///   █▄█─█──█──█▄█─█▄█
///   █─█─█▄─█▄─█─█─█─█

///   كُلُّ نَفْسٍ ذَآئِقَةُ الْمَوْت
///   Every soul shall taste death.



#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

///  order_of_key return number of elements less than x.
///  find_by_order return index.

using namespace std;
using namespace __gnu_pbds;


#define MOHAMMAD  ios::sync_with_stdio(0);cin.tie(0);
#define all(x)    (x).begin(), (x).end()
#define AE        cout << fixed << setprecision(10);

int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}; // 8-direction.......
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[]= {1,-1,0,0}; // 4-direction...........
int dy4[]= {0,0,1,-1};

typedef tree< int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;

//***********************************************  The END **********************************************************************************************************************************




int main()
{

  MOHAMMAD
  long long n , sum = 0 , x;
  cin >> n;

  map < long long , long long > oc;

  for ( int i = 0 ; i<n ; ++i ){
       cin >> x;
       sum+=x;
       oc[x]++;
  }

  long long q , b ,c;
  cin >> q;
  while ( q-- ){
        cin >> b >> c;

        long long timesb = oc[b];
        long long timesc = oc[c];

        sum-=(b*timesb);

        oc[c]+=timesb;

        sum+=(timesb*c);
        oc[b] = 0;

        cout << sum << "\n";
  }

}

/*





  Alhamdulillah
*/



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

using namespace std;

#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define INF 1000000000
#define INFL 10000000000000000LL
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

int main() {
  int h, w;
  cin >> h >> w;
  P p[h+w];
  REP(i, h+w){
    int c;
    cin >> c;
    if(i < h) p[i] = {c, 0};
    else p[i] = {c, 1};
  }
  sort(p, p+h+w);
  ll ans = 0;
  int t = h+w;
  REP(i, t){
    if(p[i].second == 0){
      ans += p[i].first*(w+1);
      h--;
    }
    else{
      ans += p[i].first*(h+1);
      w--;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3328
import sys
X, Y = map(int, input().split())

if X == 1:
  if Y == 2 or Y == 4:
    print('Yes')
  else:
    print('No')
  sys.exit()

a = 2*X -Y/2
b = Y/2 - X

if Y % 2 == 1:
  print('No')
 
elif Y / 4 > X:
  print('No')
  
elif a >= 0 and b >= 0:
  print('Yes')

else:
  print('No')

Measured memory_bytes: 9196
import numpy as np

N, M = map(int, input().split())
X = list(map(int, input().split()))

if N >= M:
  print(0)
else:
  X.sort()
  npX = np.array(X)
  D = npX[1:] - npX[:-1]
  D.sort()
  print(sum(D[0:M-N]))


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

int main()
{
    int H, W;
    cin >> H >> W;
    vector<string> a(H);
    for (int i = 0; i < H; i++)
    {
        cin >> a[i];
    }
    
    vector<bool> row(H, false);
    vector<bool> col(W, false);

    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
        {
            if (a[i][j] == '#')
            {
                row[i] = true;
                col[j] = true;
            }
            
        }
        
    }
    for (int i = 0; i < H; i++)
    {
        if (row[i])
        {
            for (int j = 0; j < W; j++)
            {
                if (col[j])
                {
                    cout << a[i][j];
                }
            }
            cout << endl;
        }
    }
}

Measured memory_bytes: 256
n, m = map(int, input().split())
count = 0
kind = [0 for i in range(m)]
for i in range(n):
    anketo = list(map(int, input().split()))
    for j in range(1, len(anketo)):
        kind[anketo[j]-1] += 1
for i in kind:
    if i == n:
        count += 1
print(count)


Measured memory_bytes: 3060
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int team[128]={0};
	int score[128]={0};
	int rank[128]={0};
	
	int e = 1;
	bool f = true;
	while(f){
		f = true;
		scanf("%d,%d",&team[e],&score[e]);
		(team[e] == 0 && score[e] == 0) ? f = false : e++;
	}
	
	for(int i = 1; i <= e; i++){
		for(int j = i + 1; j <= e; j++){
			if(score[i] < score[j]){
				swap(score[i],score[j]);
				swap(team[i],team[j]);
			}
		}
	}
	
	int x = 1;
	rank[1] = 1;
	for(int i = 2; i <= e; i++){
		if(score[i-1] > score[i])x++;
		rank[i] = x;
	}
	
	int n;
	while(~scanf("%d",&n)){
		for(int i = 1; i <= e; i++){
			if(team[i] == n){
				printf("%d\n",rank[i]);
				break;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 1028
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,j,n) for(int i = j; i < n; i++)
#define RFOR(i,j,n) for(int i = j-1; i >= n; i--)
#define PREC(n) fixed << setprecision(n)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define _LIBCPP_DEBUG 0
using namespace std;
int64_t MOD = 1000000007;

int digit(int n) {
  if(n < 10) return n;
  return digit(n/10) + n%10;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, a, b, cnt = 0;
  cin >> n >> a >> b;
  REP(i,n+1) {
    if(a <= digit(i) && digit(i) <= b) cnt += i;
  }
  cout << cnt << endl;
  return 0;
}
//templete by private_yusuke

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

#define int long long
#define double long double
#define ff first
#define ss second
#define endl '\n'
#define ii pair<int, int>
#define mp make_pair
#define mt make_tuple
#define DESYNC                      \
  ios_base::sync_with_stdio(false); \
  cin.tie(0);                       \
  cout.tie(0)
#define pb push_back
#define vi vector<int>
#define vii vector<ii>
#define all(x) x.begin(), x.end()
#define EPS 1e-9
#define INF 1e18
#define ROOT 1
#define M 1000000007
#define curtime chrono::steady_clock::now().time_since_epoch().count
#define rep(i, beg, n, s) for (int i = beg; i < n; i += s)
const double PI = acos(-1);

using namespace std;

inline int mod(int n, int m = M) {
  int ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}

int exp(int n, int k) {
  if (k == 0) return 1;
  if (k == 1) return n;
  int ax = exp(n, k / 2);
  ax = mod(ax * ax);
  if (k % 2) ax = mod(ax * n);
  return ax;
}

int gcd(int a, int b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
//#define MULTIPLE_TEST_CASE
void solution() {
  int a, b, c;
  cin >> a >> b >> c;
  if (b * c >= a)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

int32_t main() {
  DESYNC;
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int t = 1;
#ifdef MULTIPLE_TEST_CASE
  cin >> t;
#endif
  while (t--) solution();
}


Measured memory_bytes: 3644
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <limits>

int main( void ) {
    int n;
    std::cin >> n;

    std::vector< int > ss;

    for( size_t i = 0; i < n; ++i ) {
        int s;
        std::cin >> s;
        ss.push_back( s );
    }

    // 結局全てを足したとして、3つのケースしか生じない
    // X: 10の倍数の数しかなかった
    //   このときどんなことをしても10の倍数しかないため出力は0
    // Y-A: 全合計値が10の倍数であった
    //   このときは、一番小さい10の倍数ではない数を引けば10の倍数ではなくなるのでこれを出す
    // Y-B: 全合計値は10の倍数ではなかった
    //   このときはそのまま採用すればよい

    const int sum = std::accumulate( ss.begin(), ss.end(), 0 );

    // 10の倍数ではない中で、最小の点数を1つ見つける
    const int min = std::accumulate(
        ss.begin(), ss.end(),
        std::numeric_limits<int>::max(),
        [](int min, int current) {
            if( current % 10 == 0 ) return min;
            return std::min( min, current );
        }
    );

    if( min == std::numeric_limits<int>::max() ) {
        // 全ての点数が10の倍数だったので0しか出せない
        std::cout << 0 << std::endl;
    } else if( sum % 10 == 0 ) {
        // 全ての点数の合計が10の倍数だったので
        // どれか1つ10の倍数でない小さな数を引くことで
        // 次点として小さな数を探す
        std::cout << sum - min << std::endl;
    } else {
        // 合計値が10の倍数でなかったのでこれが最大値
        std::cout << sum << std::endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;int x[1<<23],p,q,n,i,j;
main(){
for(i=0;i<1000;i++){for(j=0;j<1000;j++){x[i*i+j*j]++;}}
cin>>n;
for(i=0;i<n;i++){
cin>>p>>q;int r=p*p+q*q,s=0;
for(j=1;j<=r;j++){
    if(r%j==0){s+=x[j]*x[r/j];}
}
if(s==8){cout<<'P'<<endl;}else{cout<<'C'<<endl;}
}
}

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

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main() {
  long long N;
  long long ans = 0;
  cin >> N;
  FOR(i,1,N) {
    ans += i;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <tuple>
#include <utility>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <iomanip>
#include <map>
#define rep(i, n) for (int i = 0; i < n; i++)
#define SORT(v) sort((v).begin(), (v).end())
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};

int main()
{
    string s;
    cin>>s;

    int n=s.size()-1;
    ll sum=0;
    for(int bit=0;bit<(1<<n);bit++){
        ll tmp=s[0]-'0';
        for(int i=0;i<n;i++){
            if(bit&(1<<i)){
                sum+=tmp;
                tmp=s[i+1]-'0';
            }
            else{
                tmp*=10;
                tmp+=s[i+1]-'0';
            }

        }
        sum+=tmp;
    }
    cout << sum <<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <deque>
#include <set>
#include <cmath>
#include <bits/stdc++.h>
#include <limits>
using namespace std;

int main(void){
    // Your code here!
    long long n;
    
    cin >> n;
    cout << 800 * n - (n / 15) * 200 << endl;
    
    return 0;
}

Measured memory_bytes: 256
n=int(input())
s=[]
for i in range(n):
    s.append(input())

s.sort()

t=[]
icnt=0
t.append([1,s[0]])
for i in range(1,len(s)):
    if s[i-1]==s[i]:
        t[icnt][0]=t[icnt][0]+1
    else:
        icnt=icnt+1
        t.append([1,s[i]])
        
#print(t)
t.sort(reverse=True)
#print(t)

u=[]
u.append(t[0][1])
for i in range(len(t)-1):
    if t[i][0]==t[i+1][0]:
        u.append(t[i+1][1])
    else:
        break

if len(u)==0:
    print(u[0])    
else:
    u.sort()
    for i in range(len(u)):
        print(u[i])
    

Measured memory_bytes: 41412
def fc(n):
    wk =0
    for i in range(2,int(n**0.5)):
        j=i
        while n%j == 0:
            wk+=1
            n//=j 
            j*=i
        while n%i==0:
            n//=i
            continue
    if n!=1:
        wk+=1
    return wk

n =int(input())
print(fc(n))

Measured memory_bytes: 9448
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define INF 1000000000000000000
#define fn(i,n) for(int i=0;i<n;i+=1)
int h[100100];
int dp[100100][4]={0};

signed main() {
   int n;cin>>n;
   for(int i=1;i<=n;i+=1)
   {
       int a,b,c;cin>>a>>b>>c;
       dp[i][1]=max(dp[i-1][2],dp[i-1][3])+a;
        dp[i][2]=max(dp[i-1][1],dp[i-1][3])+b;
         dp[i][3]=max(dp[i-1][1],dp[i-1][2])+c;
   }
   cout<<max(dp[n][1],max(dp[n][2],dp[n][3]))<<endl;
   
    return 0;
}



Measured memory_bytes: 3328
#include <iostream>
#include <string>
#include <stack>
#define S_LEN_MAX 20000
#define WATER true
using namespace std;

bool chkRightHeighest(string s, int start) {
    int diff = 0;
    for (int i=start; i<s.size(); i++) {
        if ( s[i] == '\\' ) {
            diff--;
        } else if ( s[i] == '/' ) {
            diff++;
        }
        if ( diff == 0 ) {
            return false;
        }
    }
    return true;
}

// half is 1
void solve (string s, int *a, int *L, int *n) {
    int idxl = 0;
    stack<bool> lake;
    for (int i=0; i<s.size(); i++) {
        if ( s[i] == '\\' ) {
            if ( !chkRightHeighest(s, i) ) {
                L[idxl] += 1 + 2 * lake.size();
                lake.push(WATER);
            }
        } else if ( s[i] == '_' ) {
            L[idxl] += 2 * lake.size();
        } else if ( s[i] == '/' ) {
            if ( !lake.empty() ) {
                L[idxl] += 2 * lake.size() - 1;
                lake.pop();
                if ( lake.empty() ) {
                    *a += L[idxl] / 2;
                    idxl++;
                }
            }
        }
    }
    *n = idxl;
}

int main () {
    // input
    string s;
    cin >> s;
    // solve
    int a = 0;
    int L[S_LEN_MAX/2] = {};
    int n = 0;
    solve(s, &a, L, &n);
    // output
    cout << a << endl;
    if (n == 0) {
        cout << n << endl;
    } else {
        cout << n << " ";
        for (int i=0; i<n; i++) {
            cout << L[i] / 2;
            if (i == n-1) {
                cout << endl;
            } else {
                cout << " ";
            }
        }
    }
}


Measured memory_bytes: 3308
import java.util.* ;
class Main {
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
    int i = 1 ;
    while(true){
      if((n*i)%2 == 0){
        System.out.println(n*i);
        break ;
      }
      i++;
    }
  }
}


Measured memory_bytes: 22612
fn main() {
    let input: Vec<i32> = read_vec();
    let n = input[0] as usize;
    let k = input[1];
    let q = input[2];
    let mut part = vec![k - q; n];

    for _ in 0..q {
        let a = {
            let tmp: usize = read();
            tmp - 1
        };

        part[a] += 1;
    }

    for p in part.into_iter() {
        println!("{}", if p > 0 { "Yes" } else { "No" });
    };
}

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

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

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

/* snippet: useful macros and functions */
#define ARC(i, a, b) for(Int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(Int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)
template<class T> T ant(const T &a, const T &b){ return a > b ? a : b; }
template<class T> T ont(const T &a, const T &b){ return a < b ? a : b; }
template<class T> T rng(const T &a, const T &b){ return a < b ? b - a : a - b; }
template<class T> void th(T &a, const T &b, T (*f)(const T &, const T &)){ a = f(a, b); }
#define anth(a, b) th(a, b, ant)
#define onth(a, b) th(a, b, ont)

/* snippet: modint library */
template<class T, int MOD>
class Modint{
	T val;
public:
	Modint(T val = 0) : val(val % MOD + (val > 0 ? 0 : MOD)) {}
	operator T(){ return val; }
	Modint &operator+=(const Modint &a){ val += a.val; if(val >= MOD) val -= MOD; return *this; }
	Modint &operator-=(const Modint &a){ val -= a.val; if(val < 0) val += MOD; return *this; }
	Modint &operator*=(const Modint &a){ val = val * a.val % MOD; return *this; }
	void inverse(){T x[2]={MOD,val},a[2]={0,1};int i;for(i=0;x[!i];i^=1){a[i]-=x[i]/x[!i]*a[!i];x[i]=x[i]%x[!i];}if(!i)a[i]+= MOD;val=a[i];}
	Modint &operator/=(Modint a){ a.inverse(); return *this *= a; }
	friend Modint modpow(Modint a, int n){ Modint ret(1); while(n){ if(n & 1) ret *= a; a *= a; n >>= 1; } return ret; }
	friend Modint operator+(Modint a, const Modint &b){ return a += b; }
	friend Modint operator-(Modint a, const Modint &b){ return a -= b; }
	friend Modint operator*(Modint a, const Modint &b){ return a *= b; }
	friend Modint operator/(Modint a, const Modint &b){ return a /= b; }
	friend std::ostream &operator<<(std::ostream &os, const Modint &a){ return os << a.val; }
};

/* snippet: using declarations */
using Int = long long;
using std::cout;
using std::cin;
using std::endl;
using Mint = Modint<long long, 1000000007>;

int main(){
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	for(;;){
		c -= b;
		if(c <= 0){
			cout << "Yes" << endl;
			return 0;
		}
		a -= d;
		if(a <= 0){
			cout << "No" << endl;
			return 0;

		}
	}
}


Measured memory_bytes: 3632
n = int(input())
w = [input() for i in range(n)]
tmp = w[0]
count = 1

def is_unique(arr):
    return len(arr) == len(set(arr))

if is_unique(w):
    for i in w[1:]:
        if tmp[-1] == i[0]:
            count += 1
        else:
            break
        tmp = i

if len(w) == count:
    print("Yes")
else:
    print("No")

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

int compare_int(const void *a, const void *b)
{
    return *(long int*)a - *(long int*)b;
}

int main(){
  long int X;
  int N;
  scanf("%d%ld", &N,&X);
  long int a[N];
  int i;
  for(i=0;i<N;i++){
    scanf("%ld",&a[i]);
  }

  qsort(a, N, sizeof(long int), compare_int);

  int ans=0;
  int temp=X;
  while(temp>0&&ans<N){
    temp=temp-a[ans];
    ans++;
  }

  if(temp==0){
    ans=ans+1;
  }
  printf("%d", ans-1);
  return 0;
}
    
    
    


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

void fnInput(vector<double>& rvnValue)
{
  int nValueSiz;
  cin >> nValueSiz;
  rvnValue.resize(nValueSiz);

  for(double& rnValue : rvnValue)
    cin >> rnValue;
}
  
double fnMaxValueGet(const vector<double>& cnrvnValue)
{
  vector<double> vnAscValue(cnrvnValue);

  while (vnAscValue.size() > 1)
  {
    sort(begin(vnAscValue), end(vnAscValue));
    auto it = begin(vnAscValue);
    double nAveValue = (double)( *it + *(it + 1) ) / 2;
    vnAscValue.erase(it, it + 2);
    vnAscValue.push_back(nAveValue);
  }
  return vnAscValue[0];
}
  
int main()
{
  vector<double> vnValue;

  fnInput(vnValue);
  cout << fnMaxValueGet(vnValue) << endl;

  return 0;
}

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

int main() {
  int n; cin >> n;
  vector<ll> T(n), A(n);
  for (int i = 0; i < n; ++i) cin >> T[i] >> A[i];
  ll t = 1, a = 1;
  for (int i = 0; i < n; ++i) {
    ll j = (t+T[i]-1)/T[i];
    j = max(j, (a+A[i]-1)/A[i]);
    t = T[i]*j, a = A[i]*j;
  }
  cout << t+a << endl;
  return 0;
}


Measured memory_bytes: 256
# ワーシャルフロイド　全点最短経路、負の距離あっても可　o(n**3)
def warshall_floyd(d):
    #d[i][j]: iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j]= min(d[i][j],d[i][k] + d[k][j])
    return d

##############################
h,w = map(int,input().split()) #n:頂点数　m:辺の数
n=10
d = [list(map(int, input().split())) for i in range(n)]
a= [list(map(int, input().split())) for i in range(h)]

x=warshall_floyd(d)

ans=0
for i in range(h):
    for j in range(w):
        if a[i][j]==-1:
            continue
        else:
            ans+=x[a[i][j]][1]
print(ans)

Measured memory_bytes: 40284
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
const int mod =1e+9+7;

int main(){
    ll n; cin>>n;
    vector<ll>a(n);
    ll cnt=0;
    ll sum=0;
    rep(i,n){
        cin>>a[i];
        if(a[i]<=0){
            cnt++;
            a[i]*=-1;
        }
        sum+=a[i];
    }
    sort(a.begin(),a.end());
    if(cnt%2==0){
        cout<<sum<<endl;
    }
    else{
        cout<<sum-2*a[0]<<endl;
    }
}








































Measured memory_bytes: 4100
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever while (true)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
template<typename A> using V = std::vector<A>;
template<typename A> using F = std::function<A>;
template<typename A, typename B> using P = std::pair<A, B>;
using pii = P<int, int>;
using vi = V<int>;
using vd = V<double>;
using vs = V<std::string>;
using vpii = V<pii>;
using vvi = V<vi>;
using vvpii = V<vpii>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &v) { for (T &x : v) is >> x; return is; }
using namespace std;
// clang-format on

template<typename InputIterator> constexpr std::string join(InputIterator first, InputIterator last, const std::string &sep) {
  if (first == last) return "";
  std::stringstream ss;
  ss << *(first++);
  for_each(first, last, [&](auto &x) { ss << sep << x; });
  return ss.str();
}

main {
  vi a(3);
  cin >> a;
  sort(all(a));
  cout << join(all(a), " ") << endl;
}

Measured memory_bytes: 3204
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define endl "\n"
#define pb push_back
#define f(i,n) for(i=0;i<n;i++)
#define F(i,a,b) for(i=a;a<=b;i++)
#define arr(a,n) for( i=0;i<n;i++)cin>>a[i];
#define fi first
#define se second
#define mp make_pair
#define mod 1000000007
#define YES cout<<"YES"<<endl;
#define Yes cout<<"Yes"<<endl;
#define NO cout<<"NO"<<endl;
#define No cout<<"No"<<endl;
#define yes cout<<"yes"<<endl;
#define no cout<<"no"<<endl;
#define vi vector<ll>
#define ed end()
#define bg begin()
#define sz size()
#define ln length()
#define s() sort(a,a+n);
#define sr() sort(a,a+n,greater<ll>());
#define v()  sort(v.begin(),v.end());
#define vr() sort(v.begin(),v.end(),greater<ll>());
#define mod 1000000007
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
int main() {
   /* #ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("output.txt", "w", stdout);
    #endif*/
        

fast();
//ll t;cin>>t;while(t--)
{
  ll n,k;
  double ans=0.0;
  cin>>n>>k;



  for(int i=1;i<=n;i++)
  {
    ll temp=i,p=0;
    while(temp<k)
    {
      p++;
      temp*=2;
    }
    
    double pr=pow(2.0,p);
    //cerr<<pr<<endl;

    ans+=double(1.0/double(pr));
    //ans=ans/double(n);
    //cout<<p<<" "<<ans<<endl;
  }
  //cerr<<"ans = "<<ans<<endl;
  ans=ans/double(n);
  //cout<<"Ans = "<<endl;
 cout<<fixed<<setprecision(12)<<ans<<endl;
  /*while(c<k)
  {
    c*=2;
    p++;
  }
  ll temp=pow(1ll*2,p);
  vi v;
  for(int i=1;i<=n;i++)
  {
    if(temp>0)
     {
         v.pb(temp);
         temp/=2;
     }
    else
    {
      break;
    }
  }
  for(auto t:v)cerr<<t<<" ";
    cerr<<endl;
  cerr<<p<<endl;
  for(int i=0;i<v.size();i++)
  {
    ans+=(double(1.0/double(v[i])));
  }
  cout<<ans<<endl;
  ans=ans/double(n);
  cout<<fixed<<setprecision(12)<<ans<<endl;
  */
    
}
return 0;
}

Measured memory_bytes: 256
#include <stack>
#include <queue>
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
 
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n0,n) for(int i=n0;i<n;i++)
#define Com(i,j,n) for(int i=0;i<n-1;i++)for(int j=i+1;j<n;j++)
#define INF (1<<29)
#define test cout << "test" << endl;

long int tests (long int a, long int b){
	return (a==0)? 1:b;
}

int main(){
	long int NNN;
	cin >> NNN;
	string temp;
	long int memo[5]={0};
	rep(i,NNN){
		cin >> temp;
		if(temp[0]=='M'){
			memo[0]++;
		}
		else if(temp[0]=='A'){
			memo[1]++;
		}
		else if(temp[0]=='R'){
			memo[2]++;
		}
		else if(temp[0]=='C'){
			memo[3]++;
		}
		else if(temp[0]=='H'){
			memo[4]++;
		}
	}
	long int ans=0;
	long int bit=0;
	long int bits[5]={0};
	long int tbit=0;
	bool check=true;

	while(bit < 32){
		tbit = bit;
		check = true;

		rep(i,5){
			bits[i]=tbit%2;
			tbit = (tbit-tbit%2)/2;
		}

		if(bits[0]+bits[1]+bits[2]+bits[3]+bits[4]!=3){
			bit ++ ;
			continue;
		}

		else {//bitsが3つ立ってる時
			rep(i,5){
				if(bits[i]==1 && memo[i]==0){//どれかのmemoが0だとだめ
					check = false;
				}
			}
			if(check){//testsは、bitsが0なら1を、bitsが1ならmemoを返す関数
				ans = ans + tests(bits[0],memo[0])*tests(bits[1],memo[1])*tests(bits[2],memo[2])*tests(bits[3],memo[3])*tests(bits[4],memo[4]);
			}
		}

		bit ++;
	}

	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

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


signed main(void) {
    int n = 3;
    vi v(4);

    rep(i,3){
        int a,b;
        cin >> a >> b;
        a--,b--;
        v[a]++;
        v[b]++;
    }
    bool ans = true;
    rep(i,4)if(v[i] == 0 || v[i] == 3)ans = false;
    if(ans)cout << "YES" << endl;
    else cout << "NO" << endl;
}


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

#define int long long
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; }

#define MOD 1000000007

int n;
int memo[1000010][2][2];

int dp(int i, int a, int b){
	if(i == n) return a == 1 && b == 1 ? 1 : 0;
	if(memo[i][a][b] != -1) return memo[i][a][b];
	int ans = dp(i+1, a, b) * 8 % MOD;
	ans += dp(i+1, 1, b);
	ans %= MOD;
	ans += dp(i+1, a, 1);
	ans %= MOD;
	return memo[i][a][b] = ans;
}

signed main(){
	cin >> n;
	memset(memo, -1, sizeof(memo));
	cout << dp(0, 0, 0) << endl;
	return 0;
}



Measured memory_bytes: 112660
n=int(input())
listA=[29,59,89,149,179]
i=7
while len(listA)<n:
  for j in range(7,(30*i-1)//2+1):
    if (30*i-1)%j==0:
      break
    elif j==(30*i-1)//2:
      listA.append(30*i-1)
  i+=1
print(' '.join(map(str,listA)))

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

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

/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

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

int main(){
    int n;
    string s;
    cin >> n;
    cin >> s;
    if(n % 2 == 1){
        cout << "No" << endl;
        return 0;
   }
    for(int i = 0; i < n/2; i++){
        if(s[i] != s[i+n/2]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}

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

int num[3][3];
bool bingo[3][3];

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

  for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) cin >> num[i][j];

  int n;
  cin >> n;

  for (int i = 0; i < n; ++i) {
    int b;
    cin >> b;

    for (int j = 0; j < 3; ++j) {
      for (int k = 0; k < 3; ++k) {
        if (num[j][k] == b) bingo[j][k] = true;
      }
    }
  }

  bool ok = false;

  for (int i = 0; i < 3; ++i) {
    bool c = true;
    for (int j = 0; j < 3; ++j) if (!bingo[i][j]) c = false;
    if (c) ok = true;
  }

  for (int j = 0; j < 3; ++j) {
    bool c = true;
    for (int i = 0; i < 3; ++i) if (!bingo[i][j]) c = false;
    if (c) ok = true;
  }

  if (bingo[0][0] && bingo[1][1] && bingo[2][2]) ok = true;
  if (bingo[2][0] && bingo[1][1] && bingo[0][2]) ok = true;

  cout << (ok ? "Yes" : "No") << '\n';

  return (0);
}

Measured memory_bytes: 3636
import sys
#import time
#import copy
from collections import deque, Counter, defaultdict
#from fractions import gcd
#import bisect
import heapq
import time

start = time.time()
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))

h,w = rl()
c=[rl() for _ in range(10)]
#g=[[inf]*h for _ in range(h)]



for k in range(10):
    for i in range(10):
        for j in range(10):
            c[i][j]=min(c[i][j], c[i][k]+c[k][j])

ans=0
for _ in range(h):
    a=rl()
    for num in a:
        if num==-1:
            continue
        ans+=c[num][1]
print(ans)

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

int main()
{
  ll n, k, s, i, ans, sz;

  cin>>n>>k>>s;
  for(i=1; i<=k; i++)
  {
    cout<<s<<" ";
  }
  for(i=k+1; i<=n; i++)
  {
    if(s==1e9)cout<<1<<" ";
      else
    cout<<s+1<<" ";
  }
  cout<<endl;
}

Measured memory_bytes: 1280
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	var n, k int
	fmt.Scan(&n, &k)

	ds := make([]string, k)
	for i := 0; i < k; i++ {
		fmt.Scan(&ds[i])
	}

	for i := n; i < n*10; i++ {
		flg := true
		str := strconv.Itoa(i)

		for _, v := range ds {
			if strings.Contains(str, v) {
				flg = false
				break
			}
		}

		if flg {
			fmt.Println(i)
			break
		}
	}
}


Measured memory_bytes: 1024
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <queue>

using namespace std;

typedef long long ll;

const int MAX = 100000;

int main(){
  int ans=0;
  int n; cin >> n;
  int cnt[MAX+1];
  for(int i=1;i<=MAX;i++) cnt[i]=0;
  for(int i=0;i<n;++i){
    int x; cin >> x;
    if(x > 100000) ans++;
    else cnt[x]++;
  }
  for(int i=1;i<=MAX;i++){
    if(cnt[i]!=0 && cnt[i]!=i){
      if(cnt[i]>i) ans = ans + (cnt[i] - i);
      else ans = ans + cnt[i];
    }
  }
  cout << ans << endl;
}

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

int main(){
	int n, h[20], look, result = 1;
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> h[i];
		if(i >= 1){
			look = 0;
			for(int j = 0; j < i; j++) if(h[i] < h[j]) look = 1;
			if(look == 0) result++;
		}
	}
	cout << result << endl;
	return 0;
}

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


int main()
{
	int W,H,x,y,r;
	cin >> W >> H>>x>>y>>r;
	if (((x - r >= 0) && (x + r <= W)) && ((y - r >= 0) && (y + r <= H))) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 3068
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<long double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }
#define INF 1LL<<60

int main() {
    ll mod = 1e9 + 7;
    ll N, K;
    cin >> N >> K;
    vector<ll> a(N);
    for(ll i=0; i<N; i++) cin >> a[i];

    // dp[i][k]: i番目までの子供がk個の飴を分ける方法
    vector<vector<ll>> dp(N, vector<ll>(K+1));

    for(ll i=0; i<N; i++) dp[i][0] = ll(1);
    for(ll i=0; i<N; i++)
        for(ll k=1; k<=K; k++)
            if(i==0){
                if(a[i] >= k)
                    dp[i][k] = ll(1);
            }
            else {
                if(k-1-a[i] >= 0)
                    dp[i][k] = (dp[i][k-1] - dp[i-1][k-1-a[i]] + dp[i-1][k] + mod) % mod;
                else
                    dp[i][k] = (dp[i][k-1] + dp[i-1][k]) % mod;
            }
    cout << dp[N-1][K] % mod << endl;
    return 0;
}

Measured memory_bytes: 79488
#include<iostream>
#include<string>
#include<set> 
#include<algorithm>
using namespace std;
int jd(int a)
{
if(a>=0)
a=a;
if(a<0) 
a=-a;
return a; 
}
int main()
{
int a,b,c,d;
cin>>a>>b>>c>>d;
if((jd(a-b)<=d and jd(b-c)<=d) or jd(c-a)<=d)
cout<<"Yes";
else
cout<<"No";
system ("pause");
return 0;
}


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

using ll =long long;

//最大公約数
ll gcd(ll a, ll b){
   if (a%b == 0){
       return(b);
   }else{
       return(gcd(b, a%b));
   }
}
//最小公倍数
ll lcm(ll a, ll b){
   return a * b / gcd(a, b);
}

//文字列→数列
//string S;int A=atoi(S.c_str());
//数列→文字列
//int A;string S=to_string(A);
//数字判定　isdigit
//
//

int main(){
cout<<fixed<<setprecision(10);

  
int N,M,X,Y;cin>>N>>M>>X>>Y;
  vector<int> x(N);
  vector<int> y(M);
  for(int i=0;i<N;i++){
    cin>>x[i];
  }
  for(int i=0;i<M;i++){
    cin>>y[i];
  }
  sort(x.begin(),x.end());
    sort(y.begin(),y.end());
  int A=max(X,x[N-1]);
  int B=min(Y,y[0]);
  if(B-A>=1){
    cout<<"No War"<<endl;}
  else{cout<<"War"<<endl;}

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll N; cin>>N;
    for(int h=1; h<=3500; h++){
        for(int n=1; n<=3500; n++){
            if((4*h*n-N*n-N*h)!=0&&(N*h*n)%(4*h*n-N*n-N*h)==0){
                ll w = (N*h*n)/(4*h*n-N*n-N*h);
                if(w<0) continue;
                cout<<h<<" "<<n<<" "<<w;
                return 0;
            }
        }
    }

    return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        PrintWriter pw = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int i =0;
        for(i = 0; i < n; i-=-1) {
            int a = sc.nextInt();
            if (a%2 == 0) {
                if (a%3 == 0 || a%5 == 0)
                {}else
                    break;
            }
        }
        if (i == n) {
            pw.println("APPROVED");
        } else
            pw.println("DENIED");

        pw.close();
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String file) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(file));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {
            return br.readLine();
        }

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

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
}




Measured memory_bytes: 24276
n, k = map(int, input().split())
a = list(map(int, input().split()))
t, s = 0, 0

for i in range(n-1):
  for j in range(i+1, n):
    if a[i] > a[j]:
      t += 1
      
a.sort()
l = [ i for i in range(n) ]
for i in range(1, n):
  if a[i] == a[i-1]:
    l[i] = l[i-1]
s = sum(l)
    
print((k*t%1000000007 + s*k*(k-1)//2%1000000007)%1000000007)

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,s,n) for(int i=s;i<n;i++)
#define per(i,s,n) for(int i=n-1;i>=s;i--)
#define fi first
#define se second
#define all(c) c.begin(),c.end()
typedef long long int ll;
typedef pair<int, int> P;
typedef long double ld;
void Ans(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}

const ll INF=1001001001;
const ll mod=1000000007;

struct UnionFind{
  vector<int> par;
  
  UnionFind(int n) : par(n){
    rep(i,n){
      par[i] = i;
    }
  }
  int root(int x){
    if(par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  
  void unite(int x, int y){
    if(root(x) == root(y)) return;
    par[root(x)] = root(y);
  }
  
  bool same(int x, int y){
    return root(x) == root(y);
  }
  
};

int main(){
  int n,m;
  cin>>n>>m;
  
  UnionFind u(n);
  
  vector<int> p(n);
  rep(i,n){
    cin>>p[i];
    p[i]--;
  }
  
  int a,b;
  rep(i,m){
    cin>>a>>b;
    a--;
    b--;
    u.unite(a,b);
  }
  
  int ans=0;
  
  rep(i,n){
    if(u.same(i,p[i])) ans++;
  }
  
  cout<<ans<<endl;
}
  
  
    

Measured memory_bytes: 1024
#include <iostream>
 
int main(){
	int N;
  	std::cin >> N;
  	int* a = new int[N];
  
  	int sum = 0;
  	int max = 0;
  	for(int i = 0; i < N; i++){
    	std::cin >> a[i];
      	sum += a[i];
      	if(a[i] > max) max = a[i];
    }
  
  	if(max >= sum - max){
    	std::cout << "No";
    }
  	else{
    	std::cout << "Yes";
    }
 
  	delete[] a;
    return 0;
}

Measured memory_bytes: 256