akhauriyash/Code-Regression huggingface dataset:
// dfmt off
T lread(T=long)(){return readln.chomp.to!T;}T[] lreads(T=long)(long n){return iota(n).map!((_)=>lread!T).array;}
T[] aryread(T=long)(){return readln.split.to!(T[]);}void arywrite(T)(T a){a.map!text.join(' ').writeln;}
void scan(L...)(ref L A){auto l=readln.split;foreach(i,T;L){A[i]=l[i].to!T;}}alias sread=()=>readln.chomp();
void dprint(L...)(lazy L A){debug{auto l=new string[](L.length);static foreach(i,a;A)l[i]=a.text;arywrite(l);}}
static immutable MOD=10^^9+7;alias PQueue(T,alias l="b<a")=BinaryHeap!(Array!T,l);import std, core.bitop;
// dfmt on

void main()
{
    long N = lread();
    long ans = long.max;
    foreach (x; 1 .. N)
    {
        if (N < x * x)
            break;
        if (N % x != 0)
            continue;
        ans = ans.min((x - 1) + ((N / x) - 1));
    }
    writeln(ans);
}


Measured memory_bytes: 3684
#include<stdio.h>

#include<math.h>
#include<string.h>
int main()
{
    long long int ch[100000];
    char arr[1000000];
    char kh,bh,ag[100];
    int cp[400000]= {0};
    int a,b,c,d,e=0,g,i=0,tep=0,temp=0,j=0,k=0,l=0,m=0,n=0;
    
    j=0;
    for(i=1; i<=5; i++)
    {
        scanf("%d",&a);
        if(a==0)
        j=i;
    }
    
        printf("%d\n",j);

    return 0;
}

Measured memory_bytes: 1656
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>

#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;
const ll mod = 1e9+7;
char s[1000];
int a[55][30];
int main() {
    //pld(C)
    int n,m;
    s(n)
    re(a,0);
    for(int i = 0; i < n; i ++){
        re(s,0);
        ss(s)
        for(int j = 0; j < strlen(s); j ++){
            a[i][s[j]-'a'] ++;
        }
    }


    for(int i = 0; i < 28; i ++){
        int x = 100000;
        for(int j = 0; j < n; j ++){
            x = min(x,a[j][i]);
        }
        if(x != 0){
            for(int j = 0; j < x; j ++){
                pc('a'+i)
            }
        }
    }
    return 0;
}


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

int main(){
    int n;
    cin >> n;
    vector<int> nums(n+10);
    for(int i=0;i<n;i++){
        cin >> nums.at(i);
    }
    int nump = 0;
    for(int i=0;i<n;i++){
        bool n_is_p = true;
        for(int j=2;j<(int)sqrt(nums.at(i))+50 && j<nums.at(i);j++){
            if(nums.at(i)%j == 0){
                n_is_p = false;
                break;
            }
        }
        if(n_is_p || nums.at(i)==2){
            nump++;
        }
    }
    cout << nump << endl;
    return 0;
}



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

int main()
{
	long long t[10];
	for(int i=0;i<3;i++)
	cin>>t[i];
	for(int i=0;i<3;i++)
	{
		if(t[i]%2==0)
		{
			cout<<0<<endl;
			return 0;
		} 
	}
	sort(t,t+3);
	long long ans=t[0]*t[1];
	cout<<ans<<endl;
	
	return 0;
}  

Measured memory_bytes: 256
import sys
printf = sys.stdout.write

ans = []
while True:
    word = list(raw_input())
    if word[0] == "-":
        break

    x = input()
    suff = []

    for i in range(x):
        suff.append(input())

    for i in range(len(suff)):
        for j in range(suff[i]):
            word.insert(int(len(word)), word[0])
            del word[0]
    ans.append(word)
    word = 0


for i in range(len(ans)):
    for j in range(len(ans[i])):
        printf(ans[i][j])
    print ""

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

int main(){
  int a, b;
  cin >> a >> b;
  if(a%3 == 0 || b%3 == 0 || (a+b)%3 == 0){
    cout << "Possible" << endl;
  }else{
    cout << "Impossible" << endl;
  }
}

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

const int INF = pow(2, 31) - 1;
#define ll long long
#define DEBUG(x) cout << "DEBUG>" << #x << ":" << x << endl;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> X(M);
  REP(i, M) {
    cin >> X[i];
  }
  sort(X.begin(), X.end());
  vector<int> L;
  REP(i, X.size() - 1) {
    L.push_back(X[i + 1] - X[i]);
  }
  sort(L.begin(), L.end());
  int ans = 0;
  REP(i, M - N) {
    ans += L[i];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1276
s=sorted(set(input()))
l=list(range(ord("a"),ord("z")+1))
if len(s) == len(l):
    print("None")
else:
    for i in range(len(s)):
        if ord(s[i]) == l[i]:
            pass
        else:
            print(chr(l[i]))
            exit()
    print(chr(ord(s[-1]) + 1))

Measured memory_bytes: 3188
#include<stdio.h>

int main(Void){
    long long int k,n,i,j,l,sum,max,pre;
    double exp;

    scanf("%lld%lld",&n,&k);

    long long int p[n];

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

    sum = 0;
  
  	for(l=0;l<k;l++){
    	sum = sum + p[l];
    }
    
  	pre = sum;
  	max = sum;

    for(j=0; j<n-k;j++){
      	pre = pre - p[j] + p[j+k];
      
        if(pre > max){
            max = pre;
        }      	
    }
  
    exp = (double)(max + k)/2;

    printf("%lf",exp);

}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
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; }

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };

// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */



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

    int N, K; cin >> N >> K;
    vector<int> a(1, 0);
    rep(i, N){
        int v; cin >> v;
        if(v < K) a.push_back(v);
    }
    N = a.size() - 1;
    sort(a.begin(), a.end());

    vector<vector<bool>> dpl(N+5, vector<bool>(K+5, false));
    vector<vector<bool>> dpr(N+5, vector<bool>(K+5, false));

    dpl[0][0] = true;
    repr(i, 1, N+1) rep(j, K+1) {
        // not use
        dpl[i][j] = (dpl[i][j] || dpl[i-1][j]);
        // use
        if(j-a[i]>=0) dpl[i][j] = (dpl[i][j] || dpl[i-1][j-a[i]]);
    }

    dpr[N+1][0] = true;
    reprrev(i, 1, N+1) rep(j, K+1) {
        // not use
        dpr[i][j] = (dpr[i][j] || dpr[i+1][j]);
        // use
        if(j-a[i]>=0) dpr[i][j] = (dpr[i][j] || dpr[i+1][j-a[i]]);
    }

    int ans = 0;
    repr(i, 1, N+1) {
        vector<int> L, R;
        rep(j, K){
            if(dpl[i-1][j]) L.push_back(j);
            if(dpr[i+1][j]) R.push_back(j);
        }
        bool noNeed = true;
        // l <= q < r を満たす q があるかだとどちらも lower_bound でできるので変形してから
        for(auto p : L) if(lower_bound(R.begin(), R.end(), K-p) - lower_bound(R.begin(), R.end(), K-a[i]-p) > 0) {
            noNeed = false;
            break;
        }
        if(noNeed) ++ans;
    }
    cout << ans << endl;

    
    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

int gcd(int n, int m) {
    if(n < m) swap(n, m);
    if(n % m == 0) return m;
    return gcd(m, n % m);
}

int lcm(int n, int m) {
    return n * m / gcd(n, m);
}

int main() {
    int A, B, C; cin >> A >> B >> C;
    vector<int> q;
    set<int> s;
    int hoge = A;
    while(hoge != lcm(A, B)) {
        if(!s.count(hoge % B)) q.push_back(hoge % B);
        s.insert(hoge % B);
        hoge += A;
    }
    sort(q.begin(), q.end());
    vector<vector<int>> dp(q.size() + 1, vector<int>(C + 1));
    for(int i = 0; i <= q.size(); i++) {
        dp[i][0] = 1;
        if(i == 0) continue;
        for(int j = q[i - 1]; j <= C; j += q[i - 1]) dp[i][j] = 1;
    }
    for(int i = 1; i <= q.size(); i++) {
        for(int j = 0; j <= C; j++) {
            dp[i][j] = max(dp[i][j], dp[i - 1][j]);
        }
    }
    if(dp[q.size()][C]) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include <fstream>
#include <algorithm>
#include <set>
#include <map>
//#define LOCAL
using namespace std;
typedef long long ll;
const int mx=2e5+10;
map<ll, int>vis;
int main() {
#ifdef LOCAL
ifstream fin("1.txt");
streambuf*p;
p=cin.rdbuf(fin.rdbuf());
#endif // LOCAL
set<ll>value;
ll q;
cin>>q;
for(ll i=1;i<=q;i++){
    ll a, b;
    cin>>a>>b;
    if(0==a){
        value.insert(b);
        vis[b]=1;
        printf("%d\n", value.size());
    }else{
        printf("%d\n",
               vis[b]);
    }
}


#ifdef LOCAL
fin.close();
#endif // LOCAL
}



Measured memory_bytes: 24996
#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; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

int main(){
    ll a, b;
    cin >> a;
    cin >> b;
    ll cnt = 0, c = b;
    while(c){
        cnt++;
        c /= 10;
    }
    REP(i, cnt) a *= 10;
    ll rec = a + b;
    REP(i, 1000){
        if(rec == i * i){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

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

#define pb 		push_back
#define mp 		make_pair
#define prior   priority_queue
#define MOD 	1000000007
#define INF64 	(long long)1e18
#define INF 	(int)1e9
#define PI 		3.1415926535897932384626433832795 
#define ll      long long
#define ld		long double
#define ret     return
#define NUM 	1000001
const int SIZE = 2e5+4;
void fastio(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}
void input(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
}

void swap(int& a, int& b){
	int t=a;
	a = b;
	b = t;
}

bool is_prime(int x){
	if(x<=1) return false;
	for(int i=2;i*i<=x;i++){
		if(x%i==0) return false;
	}
	return true;
}


void solveTest(){
	int n;
	cin>>n;
	while(!is_prime(n))n++;
	cout<<n<<endl;
	return ;
}

int main(){
	fastio();
	//input();

	int t=1;
	//cin>>t;
	while(t--){
		solveTest();

	}
	
	return 0;
}


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

#define ll              long long
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             (int)(1e18)
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define rep(i,j,n)      for(int i=j;i<n;i++)
#define all(p)          p.begin(),p.end()
#define ub(a,b)         upper_bound(all(a),b)
#define lb(a,b)         lower_bound(all(a),b)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

void run()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
int32_t main()
{
	run();
	int n;
	cin >> n;
	vector<double> dp(n + 1, 0);
	dp[0] = 1;
	for (int i = 0; i < n; i++)
	{
		double p;
		cin >> p;
		for (int j = i + 1; j >= 0; j--)
		{
			dp[j] = (j == 0 ? 0 : dp[j - 1] * p) + dp[j] * (1 - p);
		}
	}
	double ans = 0;
	for (int i = 0; i <= n; i++)
	{
		if (i > n - i)
		{
			ans += dp[i];
		}
	}
	cout << ps(ans, 9) << endl;
	return 0;
}

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

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = (long long)1e9 + 7; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}

#define MAX

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int T, D, ta, tb, da, db;
	long double minimum = INF;
	
	cin>>T>>D;
	cin>>ta>>tb;
	cin>>da>>db;
	
	for(int i = 0; i*da <= D; i++){
		for(int j = 0; i*da + j*db <= D; j++){
			if(i*da + j*db == 0) continue;
			long double tem;
			tem = (long double)(ta*da*i + tb*db*j)/(da*i + db*j);
			
			minimum = min(minimum, fabs(tem-T));
		}
	}
	
	cout<<minimum<<endl;
	
	return 0;
}


Measured memory_bytes: 3288
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcountll
#define INF 1e16
#define mod 1000000007
int main(){
    ll n,m;
    cin>>n>>m;
    if(n==m) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
return 0;}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Matrix;
static const int INF = 2000000000;


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

Measured memory_bytes: 256
using System;
class Program
{
    static void Main(string[] args)
    {
        string[] data = Console.ReadLine().Split(' ');
        int a = int.Parse(data[0]);
        int b = int.Parse(data[1]);
        if (a < b)
        {
            Console.WriteLine("a < b");
        }
        else if (a > b)
        {
            Console.WriteLine("a > b");
        }
        else
        {
            Console.WriteLine("a == b");
        }
    }
}

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

int main(){
  string s, ans;
  cin >> s;
  
  for(int i = 0; i < s.size(); i++){
    if(s.at(i) == '0'){
      ans = ans + '0';
    }
    
    else if(s.at(i) == '1'){
      ans = ans + '1';
    }
    
    else if(s.at(i) == 'B'){
      if(ans.empty() == false){
        ans.pop_back();
      }
    }
  }
  
  cout << ans << endl;
}


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

int MX = 1000000001;

int main(){
    int n,x,y;
    cin >> n >> x >> y;
    vector<int> count(n);
    for(int i=0;i<=n-2;i++){
        for(int j = i+1;j <= n-1;j++){
            count[min(min(abs(i-j),abs(x-1-i)+1+abs(y-1-j)),abs(y-1-i)+1+abs(x-1-j))]++;
        }
    }

    rep(i,n-1)cout << count[i+1] << endl;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
void init(){
  cin.tie(0);
  ios::sync_with_stdio(false);
}

double n,k;
double ans;



double power(double x,ll s){
  double ret=1;
  while(s>0){
    if(s&1) ret*=x;
    x*=x;
    s >>= 1;
  }
  
  return ret;
}

double f(int a){
  int res=0;
  while(a<k){
    a*=2;
    res++;
  }

 

  return (power(0.5,res)/n);
}


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

  FOR(i,1,n+1){
    ans+=f(i);
  }

  printf("%.10lf\n",ans);
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define MP(a,b) make_pair(a,b)
typedef long long LL;
typedef pair<int, int> PI;
typedef vector<int> VI;
const LL MOD = 1000000007LL;
vector<int> G[200000];
bool vis[200000];
queue<int> Q;
int main() {
	LL N, M;
	cin >> N >> M;
	rep(i, M) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	vis[0] = 1;
	Q.push(0);
	while (!Q.empty()) {
		int x = Q.front(); Q.pop();
		int v = x / 2;
		int b = x % 2;
		rep(i, G[v].size()) {
			int to = G[v][i] * 2 + (b ^ 1);
			if (!vis[to]) {
				vis[to] = 1;
				Q.push(to);
			}
		}
	}
	LL even = 0, odd = 0;
	rep(i, N) {
		if (vis[i*2] && !vis[i*2+1]) even++;
		else if (!vis[i*2] && vis[i*2+1]) odd++;
	}
	cout << N*(N - 1) / 2 - M - even*(even - 1) / 2 - odd*(odd - 1) / 2 << endl;
}

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

using namespace std;

int main() {

  int n;
  double bubble, pliefsto, gappy;
  string str;
  cin >> n;
  for(int i = 1;i <= n;i++){
    cin >> pliefsto >> str;
    if(str == "BTC"){
      bubble += pliefsto * 380000;
    }else{
      bubble += pliefsto;
    }
  }
  cout << fixed << setprecision(10) << bubble;
  return 0;
}


Measured memory_bytes: 3832
#include <iostream>
#include <algorithm>
using namespace std;
int arr[100000] = {};
int comp(int a,int b) {
    return a>b;
}
int main() {
    int n,k;
    cin >> n >> k;
    for(int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    sort(arr,arr+n,comp);
    long long sum = 0;
    for(int i = 0; i < k; i++) {
        sum += arr[i];
    }
    cout << sum << endl;
    return 0;
}

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

int parent[100005] , size[100005] , pa , pb;

void initialize(){
    for(int i = 1; i <= 100000; i++){
        parent[i] = i;
        size[i] = 1;
    }
}

int fparent(int x){
    if(parent[x]!=x){
        parent[x] = fparent(parent[x]);
    }
    return parent[x];
}

void uni(int a , int b){
    pa = fparent(a);
    pb = fparent(b);
    if(pa == pb){
        return;
    }
    else{
      if(size[pa] > size[pb]){
          size[pa] = size[pa]+size[pb];
          parent[pb]=parent[pa];
      }
      else{
          size[pb] = size[pa]+size[pb];
          parent[pa]=parent[pb];
      }
    }
}

int main(){
    initialize();
    int n , m, ans = 0 ,x  , y, z;
    cin >> n >> m;
    while(m--){
        cin >> x >> y >> z;
        uni(x,y);
    }
    for(int i = 1; i <= n; i++){
        if(parent[fparent(i)]==i){
            ans++;
        }
    }
    cout << ans << '\n';
}

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

int main() {
  string N;
  cin >> N;
  
  if (N.at(0) == '7' || N.at(1) == '7' || N.at(2) == '7') {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3596
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(0);cin.tie(0);
#define all(v)    ((v.begin()),(v.end()))
#define sz(v)     ((int)(v.size()))
#define forv(i, v) for(int i = 0; i < sz(v); ++i)
#define forn(i,n)   for(int i = 0; i < (int)(n); i++)
using namespace std;

typedef long long       ll;
typedef long double     ld;
typedef vector<int>     vi;
typedef vector<double>  vd;
typedef vector< vi >    vii;
typedef vector< vd >    vdd;
typedef vector<string>  vs;

int N;
int A[20];
int x[20][20];
int y[20][20];

int counter(int x)
{
    if(x == 0) return 0;
    return counter(x >> 1) + (x & 1);
}

void solve()
{
    cin>>N;
    for(int i = 1; i <= N; i++)
    {
        cin>>A[i];
        for(int j = 1; j <= A[i]; j++)
        {
            cin>>x[i][j] >>y[i][j];
        }
    }
    int ans= 0;
    for(int bits = 1; bits < (1<<N); bits++)
    {
        bool ok = true;
        for(int i = 1; i <= N; i++)
        {
            if(!(bits&(1<<(i - 1)))) continue;
            for(int j = 1; j <= A[i]; j++)
            {
                if(((bits >> (x[i][j]-1))&1)^y[i][j]) ok = false;
            }
        }
        if(ok) ans = max(ans, counter(bits));
    }
    cout<< ans<<endl;
    return;
}

int main()
{
    fast;
    solve();

    return 0;
}



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

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            Solve();

            Console.ReadKey();
        }

        static void Solve()
        {
            var str = IO.GetIntList();
            var ans = str[0] < str[1] ? 0 : 10;

            Console.WriteLine(ans);
        }
    }


    static class IO
    {
        static public string GetString() { return Console.ReadLine(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public List<string> GetStringList() { return Console.ReadLine().Split(' ').ToList(); }
        static public List<int> GetIntList() { return Console.ReadLine().Split(' ').Select(int.Parse).ToList(); }
        static public List<long> GetLongList() { return Console.ReadLine().Split(' ').Select(long.Parse).ToList(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteStrings<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
    }
}

Measured memory_bytes: 13396
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <iomanip>
#include <bitset>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>

using namespace std;

int main() {
  string a;
  cin >> a;
  for (int i = 0; i < a.size() - 1; i++) {
    if (a[i] == 'A' && a[i + 1] == 'C') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int main(void) {
  int a, b;
  scanf("%d%d", &a, &b);
  int ans = abs(b - a) + 2;
  ans = min(ans, abs(b + a) + 1);
  if (b >= a) ans = min(ans, b - a);
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 128
#include <cstdio>
#include <iostream>
#include <set>
#include <string>

std::set <std::string> set;
std::string s;

int main() {
	int n; std::cin >> n;
    int ans = 0;
    for(int i = 1;i <= n;i++) {
      std::cin >> s;
      if(set.count(s) == 0) ans++;
      set.insert(s);
    }
    std::printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 19308
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b;
  
  cin >> a >> b;
  
  if((a+b)%2){
    cout << (a+b)/2+1 << endl;
  }
  else{
    cout << (a+b)/2<< endl;    
  }
}

Measured memory_bytes: 256
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-12;

//int N, M, K, T, H, W, L, R;
long long int N, M, K, T, H, W, L, R;


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

	char c;
	map<char, int>mp;
	for (int i = 2; i < 10; i++) {
		mp[i + '0'] = i;
	}
	mp['T'] = 10;
	mp['J'] = 11;
	mp['Q'] = 12;
	mp['K'] = 13;
	mp['A'] = 14;
	while (cin >> c, c != '#') {
		vector<vector<string>>s(4, vector<string>(13));
		int cn = 0;
		for (auto &i : s)for (auto &j : i)cin >> j;
		int a = 0, b = 0;
		for (int i = 0; i < 13; i++) {
			int win = cn;
			for (int j = 0; j < 4; j++) {
				if (s[j][i][1] == c) {
					if (s[win][i][1] == c) {
						if (mp[s[j][i][0]] > mp[s[win][i][0]])win = j;
					}
					else win = j;
				}
				else if(s[j][i][1]==s[cn][i][1]){
					if (s[win][i][1] != c) {
						if (mp[s[j][i][0]] > mp[s[win][i][0]])win = j;
					}
				}
			}
			if (win & 1)b++;
			else a++;
			cn = win;
		}
		if (a > b)cout << "NS " << a - 6 << endl;
		else cout << "EW " << b - 6 << endl;
	}
}


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

public class Main {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/2;
    public static final int inf = Integer.MAX_VALUE/2;

    static void solve(InputReader in, PrintWriter out){
        int n = in.ni();
        TreeMap<Integer,Integer> map = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            int a = -in.ni();
            map.put(a,map.containsKey(a)?map.get(a)+1:1);
        }
        long e1 = 0, e2 = 0;
        for(Integer key: map.keySet()){
            if(map.get(key)>=4){
                if(e1==0){
                    e1 = -key;
                    e2 = -key;
                }else{
                    e2 = -key;
                }
                break;
            }else if(map.get(key)>=2){
                if(e1==0) e1 = -key;
                else if(e2==0){
                    e2 = -key;
                    break;
                }
            }
        }
        out.println(e1*e2);
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public double nd(){
            return Double.parseDouble(ns());
        }
        public char nc(){
            return ns().toCharArray()[0];
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}


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

enum POSITION{ONLINE_BACK = -2, CCW = -1, ON_SEGMENT = 0,
              CW = 1, ONLINE_FRONT = 2};

struct Point{
    long x;
    long y;
    Point(long x, long y) : x(x), y(y) {}
    Point(){}
    Point operator-(Point p){
        return Point(x - p.x, y - p.y);
    }
};
typedef Point Vector;
double cross(Vector v1, Vector v2){
    return v1.x * v2.y - v1.y * v2.x;
}
double dot(Vector v1, Vector v2){
    return v1.x * v2.x + v1.y * v2.y;
}

struct Segment{
    Point p1;
    Point p2;
    Segment(Point p1, Point p2) : p1(p1), p2(p2) {}
    Segment(){}
};
typedef vector<Point> Polygon;

POSITION get_position(Segment s, Point p){
    double c = cross(s.p2 - s.p1, p - s.p1);
    if (c > 0) return CCW;
    if (c < 0) return CW;
    double d = dot(s.p2 - s.p1, p - s.p1);
    if (d < 0) return ONLINE_BACK;
    if (d > dot(s.p2 - s.p1, s.p2 - s.p1)) return ONLINE_FRONT;
    return ON_SEGMENT;
}

bool intersect(Segment s1, Segment s2){
    if (get_position(s1, s2.p1) * get_position(s1, s2.p2) != -1) {
        return false;
    }
    if (get_position(s2, s1.p1) * get_position(s2, s1.p2) != -1) {
        return false;
    }
    return true;
}

int determine_containment(Point p, Polygon poly){
    Segment s_right(p, Point(p.x + 1e5, p.y));
    int count = 0;
    for (int i = 0, n = poly.size(); i < n; i++) {
        if (get_position(Segment(poly[i], poly[(i+1)%n]), p) == ON_SEGMENT) {
            return 1;
        }
        if (intersect(s_right, Segment(poly[i], poly[(i+1)%n]))) {
            count++;
            continue;
        }
        if (get_position(s_right, poly[i]) == ON_SEGMENT) {
            int i_pre = (i == 0 ? n - 1 : i - 1);
            POSITION pos_pre = get_position(s_right, poly[i_pre]);
            POSITION pos_aft = get_position(s_right, poly[(i+1)%n]);
            while (pos_aft != CCW && pos_aft != CW) {
                i++;
                pos_aft = get_position(s_right, poly[(i+1)%n]);
            }
            if (pos_pre * pos_aft == -1) count++;
        }
    }
    if (count % 2) return 2;
    return 0;
}
int main(){
    int q;
    cin >> q;
    Polygon poly(q);
    for (int i = 0; i < q; i++) {
        int x, y;
        cin >> x >> y;
        poly[i].x = x;
        poly[i].y = y;
    }
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        cout << determine_containment(Point(x, y), poly) << endl;
    }
    return 0;
}



Measured memory_bytes: 3124
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int A = scan.nextInt();
        int B = scan.nextInt();
        int C = scan.nextInt();
        int D = scan.nextInt();

        while (A > 0 && C > 0) {
            C -= B;
            if (C <= 0) {
                System.out.println("Yes");
                break;
            }
            A -= D;
            if (A <= 0) {
                System.out.println("No");
                break;
            }
        }
    }
}

Measured memory_bytes: 35712
import java.util.Scanner; // ?????¨?????????????????\

public class Main {
    public static void main(String[] args) {
        // ??????????????????????????????.
        // ????????????????????´??°??¨?????? 1 ?????\???????????????.
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        //
        int count = 0;
        for (int i = a; i <= b; i ++) {
            if (c % i == 0) { count ++; }
        }
        System.out.println(count);
    }
}

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

public class MainClarss
{
	public const long Giri = 1000000007;
	
	class Term
	{
		public int Start{get;set;}
		public int End{get;set;}
		public bool Right{get;set;}
	}
	
	public static void Main(string[] args)
	{
		int n = int.Parse(Console.ReadLine());
		string[] v  = Input();
		double[] vs = new double[n];
		for(int i = 0; i < n; i++)
		{
			int vv = int.Parse(v[i]);
			vs[i]=(double)vv;
		}
		Array.Sort(vs);
		Array.Reverse(vs);
		for(int i = n-2; i >= 0;i--)
		{
			vs[i] = (vs[i]+vs[i+1])/2d;
		}
		Console.WriteLine(vs[0]);
	}

	
	
	public static long GCD(long a, long b)
	{
		if(b == 1)
			return a;
		long p = b / a;
		return GCD(a, b - a*p);
	}
	
	public static string[] Input()
	{
		return Console.ReadLine().Split(' ');
	}

	
	public static int Clamp(int val, int max, int min = 0)
	{
		return Math.Min(max, Math.Max(min, val));
	}

}



Measured memory_bytes: 11348
#include <bits/stdc++.h>
using namespace std;
                     
#define int             long long
#define ld              long double
#define mp              make_pair
#define ff              first
#define ss              second
#define pb              push_back
#define fo(i,n)         for(i=0;i<n;i++)
#define fo1(i,n)        for(i=1;i<=n;i++)
#define FO(i,k,n)       for(i=k;k<=n?i<=n:i>=n;k<=n?i++:i--)
#define all(c)          c.begin(),c.end()
#define rall(c)         c.rbegin(),c.rend()
#define si              set<int>
#define vi              vector<int>
#define mii             map<int,int>
#define pii             pair<int,int>
#define usi             unordered_set<int>
#define umii            unordered_map<int,int>
#define pqmx            priority_queue<int>
#define pqmn            priority_queue<int,vi,greater<int> >
#define sp(x)           cout<<setprecision(x)<<fixed;
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define in(a,n)         vi a(n);fo(i,n)cin>>a[i];
#define in1(a,n)        vi a(n+1);fo1(i,n)cin>>a[i];
#define w(t)            int t;cin>>t;while(t--)
#define gcd             __gcd
#define lcm(x,y)        x*(y/gcd(x,y))
#define endl            '\n'
#define PI              3.14159265358979323846
#define inf             1e18
#define mod             1000000007
void __p(int x) {cout<<x;}
void __p(int32_t x){cout<<x;}
void __p(float x){cout<<x;}
void __p(double x){cout<<x;}
void __p(ld x) {cout<<x;}
void __p(char x){cout <<'\''<<x<<'\'';}
void __p(const char *x){cout <<'\"' <<x<<'\"';}
void __p(const string &x) {cout<<'\"'<<x<<'\"';}
void __p(bool x) {cout<<(x?"true":"false");}
template<typename T,typename V>     void __p(const pair<T,V> &x) {cout<<'{';__p(x.first);cout<<',';__p(x.second);cout<<'}';}
template<typename T>                void __p(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __p(i); cout << "}";}void _p() {cout << "]\n";}
template <typename T,typename... V> void _p(T t, V... v) {__p(t);if(sizeof...(v))cout<<", ";_p(v...);}
int po(int x,int p,int m = inf) {int ans=1;x%=m;while(p>0){if(p&1)ans=(ans*x)%m;p=p>>1;x=(x*x)%m;}return ans;}
int inv(int x,int m=mod){return po(x,m-2,m)%m;}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout<<"["<<#x<<"]=[";_p(x)
#else 
#define dbg(x...)
#endif
//=========================================================




const int N=1e6+6;
int n,m,k,x,y,z,a,b,c,d,i,j,l,r;








void sol()
{   
    cin>>n;
    c=1000*(n/500);
    n%=500;
    c+=5*(n/5);

    
    
    
    cout<<c<<endl;
}





int32_t main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //sp(10);
    // w(t)
    sol();
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<map>
using namespace std;
const int maxn=2e5+2;
int n,m;
map<int,int> d,t;
int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;i++){
		int x;
		scanf("%d",&x);
		d[x]++;
	}
	scanf("%d",&m);
	for (int i=1;i<=m;i++){
		int x;
		scanf("%d",&x);
		t[x]++;
		if (t[x]>d[x]){
			printf("NO");
			return 0;
		}
	}
	printf("YES");
	return 0;
}

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

const int Maxn = 205;
const int Inf = 1000000000;

int dist[Maxn][Maxn];
int n;
char B[Maxn][Maxn];
int col[Maxn];

bool Check(int v, int c)
{
    if (col[v]) return col[v] == c;
    col[v] = c;
    for (int i = 0; i < n; i++)
        if (B[v][i] == '1')
            if (!Check(i, -c)) return false;
    return true;
}

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%s", B[i]);
    if (Check(0, -1)) {
        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                if (i == j) dist[i][j] = 0;
                else dist[i][j] = B[i][j] == '0'? Inf: 1;
        for (int k = 0; k < n; k++)
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n; j++)
                    dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
        int res = 0;
        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                res = max(res, dist[i][j]);
        printf("%d\n", res + 1);
    } else printf("-1\n");
    return 0;
}


Measured memory_bytes: 512
using System;

class comp{
	public static void Main(){
		String[] str = Console.ReadLine().Split(' ');
		int a = int.Parse(str[0]);
		int b = int.Parse(str[1]);
		if(a > b)
			Console.WriteLine("a > b");
		else if(a == b)
			Console.WriteLine("a == b");
		else
			Console.WriteLine("a < b");
	}
}



Measured memory_bytes: 15932
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
/*ll digit(ll a)
{
    ll cnt=0;
    while(a>0)
    {
        if(a%10==4 || a%10==7)cnt++;
        a/=10;
    }
    return cnt;
}*/
int main()
{
    ll n,i,j,sum=0,a,b;
    map<ll,ll>mp;
    cin>>a;
    for(i=1;i<=a;i++)
    {
        cin>>n;
        mp[n]++;
        sum+=n;
    }
    cin>>a;
    for(i=1;i<=a;i++)
    {
        cin>>j>>b;
        ll t=mp[j];
        if(t>0){
        sum-=t*j;
        sum+=t*b;
        mp[j]=0;
        mp[b]+=t;}
        cout<<sum<<endl;
    }
    mp.clear();
    return 0;
}


Measured memory_bytes: 9136
using System;

 class Program
 {
     static void Main(string[] args)
     {
         double data0, data1, data2;
         double[] result = new double[3];
         String nyuryoku;
         nyuryoku = Console.ReadLine();
         //string[] data = nyuryoku.Split(' ');
         data0 = Double.Parse(nyuryoku);
         //data1 = Double.Parse(data[1]);
         //data2 = Double.Parse(data[2]);
         double result1,result2,result3;
         result1 = data0 * data0 * 3.14159265358979;
         result2 = 2 * data0 * 3.14159265358979;
         Console.WriteLine(String.Format("{0:F6} {1:F6}",result1,result2));
         

      }
 }


Measured memory_bytes: 17880
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
typedef pair<int,int> PP;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE cout << -1 << endl;return 0
#define MM <<" "<<
#define Endl endl

signed main(void){
    string S;
    char T[114514];
    int E[6]={1,10,9,12,3,4};
    cin >> S;
    int dp[2][20]={};
    int N=S.size();
    
    REP(i,N){
        T[i]=S[N-i-1];
    }
    
    if(T[0]!='?'){
        dp[0][T[0]-'0']=1;
    }else{
        REP(i,10){
            dp[0][i]=1;
        }
    }
    
    
    //REP(i,13){cout << dp[0][i] << " ";}cout << endl;
    
    
    
    for(int l=1;l<N;l++){
        REP(i,13){
            dp[1][i]=0;
        }
        
        if(T[l]!='?'){
            REP(i,13){
                dp[1][(i+(T[l]-'0')*(E[l%6]))%13]=(dp[1][(i+(T[l]-'0')*(E[l%6]))%13] +dp[0][i])%MOD;
            }
        }else{
            REP(j,10){
                REP(i,13){
                    dp[1][(i+(j)*(E[l%6]))%13]=(dp[1][(i+(j)*(E[l%6]))%13] +dp[0][i])%MOD;
                }
            }
        }
        
        REP(i,13){
            dp[0][i]=dp[1][i];
        }
        
        
        //REP(i,13){cout << dp[0][i] << " ";}cout << endl;
        
        
    }
    cout << dp[0][5] << endl;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using VI = vector<int>;
using VVI = vector<vector<int>>;

int main(){
  int n,l;
  cin >> n >> l;
  vector<string> s(n);
  rep(i,n) cin >> s[i];
  
  sort(s.begin(),s.end());
  
  rep(i,n) cout << s[i];
  
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
 
class Main{
  public static void main(String args[]){
	Scanner scanner = new Scanner(System.in);
	int N = scanner.nextInt();
    int M = scanner.nextInt();
    scanner.close();
  
  	if (N == M){
    	System.out.println("Yes");
    	}else{
    	System.out.println("No");
    	}
	}
}

Measured memory_bytes: 22612
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, a, c=1;
  cin >> N;
  for (int i=0; i<N; i++) {
     cin >> a;
     if((a % 2 == 0) && (a % 3 != 0) && (a % 5 !=0)){
       c = 0;
       break;
     } 
  }
  if(c==1){
    cout << "APPROVED" << endl;
  } else {
    cout << "DENIED" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,x;
  int cnt=0;
  cin >> N;
  for(int i=0; i<N; i++){
    cin >> x;
    if(x % 2 == 1 && (i+1) % 2 == 1){
      cnt++;
    }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define int long long
int MAX=1000000007;

signed gcd(int a, int b){
    int a0=a,b0=b;
    if(a0>b0)swap(a0,b0);
    while(a0!=0){
        b0=b0%a0;
        swap(a0,b0);
    }
    return b0;
}

signed main() {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int k=c*d/gcd(c,d);

    int ans= (b - b/c -b/d + b/k)-((a-1)- (a-1)/c - (a-1)/d +(a-1)/k);
    cout<<ans;

      return 0;

}


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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

int main()
{
    int x;
    cin >> x;
    if (x == 7 || x == 5 || x == 3)
        OP("YES");
    else
        OP("NO");

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){ 
    int N,M; cin >> N >> M;
    char A[N][N],B[M][M];
    for (int i=0;i<N;i++){
        for (int j=0;j<N;j++) cin >> A[i][j];
    }
    for (int i=0;i<M;i++){
        for (int j=0;j<M;j++) cin >> B[i][j];
    }

    string ans = "No";
    for (int l=0;l<N-M+1;l++){
        for (int k=0;k<N-M+1;k++){
            bool tmp = true;
            for (int i=0;i<M;i++){
                for (int j=0;j<M;j++){
                    if (A[i+k][j+l]!=B[i][j]){
                        tmp = false;
                        break;
                    }
                }
                if (!tmp) break;
            }
            if (tmp) {
                ans = "Yes";
                break;
            } 
        }
        if (ans=="Yes") break;
    }
    cout << ans << endl;
}

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

int main() {
    int N;
    cin >> N;
    vector<int>H(N);
    for (int i = 0; i < N; ++i) {
      cin >> H[i];
    }
    int flag = 1;
    H[0]--;
    for (int i = 1; i < N; ++i) {
        if(H[i-1] > H[i]){
            flag = 0;
            break;
        } else if(H[i-1] < H[i]){
            H[i]--;
        }
    }

    if(flag == 1){
        cout << "Yes";
    }else{
        cout << "No";
    }
    return 0;
}

Measured memory_bytes: 640
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

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


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

ll min(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll max(ll a,ll b){
    if(a>b)return a;
    else return b;
}

ll memo2[30]={};
ll memo(int i){
    if(memo2[i]!=0) return memo2[i];
    if(i==0){
        memo2[0]=1;
        return 1;
    }
    memo2[i]=2*memo(i-1);
    return memo2[i];
}

int main() {
    int n;cin>>n;
    ll i;
    int j;
    int x;x=1000000007;
    bool a[n][n];
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
            cin>>a[i][j];
        }
    }
    int dp[memo(n)];
    dp[0]=1;
    int c;
    ll ii;
    vector<vector<int>> d(memo2[n]);
    for(i=1;i<memo2[n];i++){
        dp[i]=0;
        ii=i;
        c=0;
        for(j=n-1;j>=0;j--){
            if(ii>=memo2[j]){
                ii=ii-memo2[j];
                c++;
                d[i].push_back(j);
            }
        }
        for(j=0;j<c;j++){
            if(a[c-1][d[i][j]]==1){
                dp[i]=(dp[i]+dp[i-memo2[d[i][j]]])%x;
            }
        }
    }
    cout<<dp[memo2[n]-1]<<endl;
    return 0;
}


Measured memory_bytes: 211072
#include <stdio.h>
int main(void)

{

    double a,b,c,d,e,f,x,y;
    while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){
       
        x=(e*c-b*f)/(e*a-b*d);
        y=(c-a*x)/b;
        x+=0.0004;
        y+=0.0004;
         
        printf("%.3lf %.3lf\n",x,y);

    }
    return 0;
     
}


Measured memory_bytes: 2056
using System;

namespace Rextester
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int s, h, m;
            s = int.Parse(Console.ReadLine());
            h = s / 3600;
            s = s % 3600;
            m = s / 60;
            s = s % 60;
            Console.WriteLine(h + ":" + m + ":" + s);
        }
    }
}


Measured memory_bytes: 15980
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
  ll K;
  cin >> K;
  if (K == 2 || K == 5) {
    cout << -1 << endl;
    return 0;
  }
  ll ten[3000000];
  ten[0] = 7;
  for (int i = 1; i < 3000000; i++) {
    ten[i] = (ten[i-1] * 10) % K;
  }
  ll now = 0;
  ll ans = 0;
  for (ans = 0; ans < 3000000; ) {
    now += ten[ans];
    now %= K;
    ans++;
    if (now == 0) {
      cout << ans << endl;
      return 0;
    }
  } 
  cout << -1 << endl;
  return 0;
}

Measured memory_bytes: 27060