akhauriyash/Code-Regression huggingface dataset:
//include
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const long long INF = 1000000007;
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
// chmax chmin
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; }

int main(void){
    int N; cin >> N;
    int a[N]; REP(i,N) cin >> a[i];

    int n2=0,n4=0;
    REP(i,N){
        if(a[i]%2==0) n2++;
        if(a[i]%4==0) n4++;
    }
    n2 -= n4;
    cout << (n2/2+n4 >= N/2 ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 640
//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \\#################\\
//   \\#################\\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define debug(x) 0//(cerr<<#x<<" = "<<(x)<<'\n')
#define all(v) begin(v),end(v)
#define siz(v) (ll(v.size()))
#define get_pos(v,x) (lower_bound(all(v),x)-begin(v))
#define pb emplace_back
#define ff first
#define ss second
#define mid (l+(r-l>>1))
#define rep(i,n) for(int i = 0; i < (n); i++)
#define REP(i,n) for(int i = 1; i <= (n); i++)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef uint64_t ull;
typedef long double ld;
typedef pair<ll,ll> pll;
template <typename T> using rkt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-8;
constexpr ll N = 502525, INF = 1e18, MOD = 998244353, K = 2;
constexpr inline ll cdiv(ll x, ll m) { return (x+m-1)/m; } // ceiling divide, x/m for flooring divide
template <typename T> void M(T &x, ll m = MOD){x%=m; if(x<0) x+=m;}

ll n,v[N];
vector<ll> ans;
signed main(){
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i++) cin >> v[i];
    for(int i = n; i >= 1; i--) {
        for(int j = i*2; j <= n; j += i) v[i] ^= v[j];
    }
    for(int i = 1; i <= n; i++) if(v[i]) ans.pb(i);
    cout << ans.size() << '\n';
    for(auto i:ans) cout << i << ' ';
    cout << '\n';
}


Measured memory_bytes: 3700
import itertools
n = int(input())
a = list(map(int, input().split()))
a = [0] + a
lacc = list(itertools.accumulate(a))
a.reverse()
racc = list(itertools.accumulate(a))
racc = [0] + racc[:-1] 
racc.reverse()
ans = racc[0]
for i in range(n+1):
    ans = min(ans, abs(racc[i] - lacc[i]))
print(ans)

Measured memory_bytes: 118348
use proconio::input;

const M: usize = 300000;

fn main() {
    input! {
        n: usize,
        k: usize,
    }

    let mut st = SegTree::new(M, std::cmp::max);
    for _ in 0..n {
        input! {a: usize}
        let l = if a > k {a - k} else {0};
        let r = (a + k).min(M);
        let m = st.get(l, r + 1, None) + 1;
        st.set(a, m);
    }

    println!("{}", st.get(0, M + 1, None));
}


struct SegTree {
    tree: Vec<u64>,
    leaf_size: usize,
    op: fn(u64, u64) -> u64,
}

impl SegTree {
    fn new(n: usize, op: fn(u64, u64) -> u64) -> Self {
        let mut ls = 1;
        while ls < n {
            ls <<= 1;
        }
        Self {
            tree: vec![0; 2 * ls - 1],
            leaf_size: ls,
            op,
        }
    }

    fn set(&mut self, mut i: usize, v: u64) {
        i += self.leaf_size - 1;
        self.tree[i] = v;
        while i > 0 {
            i = (i - 1) / 2;
            self.tree[i] = (self.op)(self.tree[2 * i + 1], self.tree[2 * i + 2]);
        }
    }

    fn get(&self, s: usize, e: usize, rng: Option<(usize, usize, usize)>) -> u64 {
        let (i, l, r) = if let Some(rng) = rng { rng } else { (0, 0, self.leaf_size) };
        if l >= e || r <= s {
            0
        } else if l >= s && r <= e {
            self.tree[i]
        } else {
            let m = (l + r) / 2;
            let vl = self.get(s, e, Some((2 * i + 1, l, m)));
            let vr = self.get(s, e, Some((2 * i + 2, m, r)));
            (self.op)(vl, vr)
        }
    }
}


Measured memory_bytes: 8840
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout << fixed << setprecision(20);
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
int N;

int main() {
  INCANT;
  cin >> N;
  cout << N/3 << "\n";
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main() {
	int n, t[9999], m, p[9999], x[9999], total;
	cin >> n;
	for (int y = 0; y < n; ++y) cin >> t[y];
	cin >> m;
	for (int y = 0; y < m; ++y) cin >> p[y] >> x[y];
	for (int y = 0; y < m; ++y) {
		total = 0;
		for (int z = 0; z < n; ++z) {
			if (p[y] == z + 1)total = total + x[y];
			else total = total + t[z];
		}
		cout << total << endl;
	}
}

Measured memory_bytes: 256
//				.-/+oossssoo+/-.    										
//        `:+ssssssssssssssssss+:`          
//      -+ssssssssssssssssssyyssss+-        
//    .ossssssssssssssssssdMMMNysssso.      
//   /ssssssssssshdmmNNmmyNMMMMhssssss/     
//  +ssssssssshmydMMMMMMMNddddyssssssss+    
// /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/   	
//.ssssssssdMMMNhsssssssssshNMMMdssssssss.  
//+sssshhhyNMMNyssssssssssssyNMMMysssssss+  						
//ossyNMMMNyMMhsssssssssssssshmmmhssssssso  
//ossyNMMMNyMMhsssssssssssssshmmmhssssssso
//+sssshhhyNMMNyssssssssssssyNMMMysssssss+
//.ssssssssdMMMNhsssssssssshNMMMdssssssss.
// /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
//  +sssssssssdmydMMMMMMMMddddyssssssss+
//   /ssssssssssshdmNNNNmyNMMMMhssssss/
//    .ossssssssssssssssssdMMMNysssso.
//      -+sssssssssssssssssyyyssss+-
//        `:+ssssssssssssssssss+:`
//            .-/+oossssoo+/-.
//
//
//
//..............                                     
//            ..,;:ccc,.                             
//          ......''';lxO.                                                      
//           .';;;:::;,,.x,                          
//      ..'''.            0Xxoc:,.  ...              
//  ....                ,ONkc;,;cokOdc',.            
// .                   OMo           ':ddo.          
//                    dMc               :OO;         
//                    0M.                 .:o.       
//                    ;Wd
//                     ;XO,
//                       ,d0Odlc;,..
//                           ..',;:cdOOd::,.
//                                    .:d;.':;.
//                                       'd,  .'
//                                         ;l   ..
//                                          .o
//                                            c
//                                            .'
//                                             .

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

#define ll long long
#define vi vector<int>
#define pi pair<int, int>

//using namespace __gnu_pbds;
using namespace std;

//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

//int ans1[3][3], ans2[3][3], a, b, c , d;

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

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

	ll a, b;
	cin >> a >> b;
	ll ans = (a * b) / gcd(a, b);
	cout << ans;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int i,j,n;
  int flag = 0;
  char s[200];
  char t1[100], t2[100];
  
  scanf("%d %s", &n, &s);
  
  if(n % 2 == 0){
     for(i = 0; i < n / 2; i++){
          t1[i] = s[i];
     }
    
     j = 0;
    for(; i < n; i++){
          t2[j] = s[i];
          j++;
     }

    for(i = 0; i < n / 2; i++){
		if(t1[i] != t2[i]){
       		flag = 1;
        }
    }
    
    if(flag == 0){
      	printf("Yes\n");
    }else{
      printf("No\n");
    }
  }else{
    printf("No\n");
  }
  
  return 0;
}

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

int main(){
    int a,b;
    while(true){
        scanf("%d %d",&a,&b);
        if(a==0&&b==0)break;
        for(int i=0;i<a;i++){
            for(int j=0;j<b;j++){
                if((i+j)%2==0){
                    printf("#");
                }
                else{
                    printf(".");
                }
            }
            printf("\n");
        }
        printf("\n");
    }
}


Measured memory_bytes: 3160
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int MOD = 1e9+7;

typedef pair<ll, ll> pairs;
typedef vector<pairs> p;

struct edge{
    ll to, cost;
};


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

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

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

// 素数
vector<bool> IsPrime;
void sieve(size_t max){
    if(max+1 > IsPrime.size()){
        IsPrime.resize(max+1,true);
    } 
    IsPrime[0] = false;
    IsPrime[1] = false;

    for(size_t i=2; i*i<=max; ++i){
        if(IsPrime[i]){
            for(size_t j=2; i*j<=max; ++j){
                IsPrime[i*j] = false;
            }
        }
    }
}

// べき乗の余り
ll modpow(ll a, ll n){
    ll res = 1;
    while(n){
        if(n & 1){
            res = res * a % MOD;
        }
        a = a * a % MOD;
        n = n >> 1;
    }
    return res;
}

// コンビネーション
ll MAXN = 2e5+10;
vector<ll> inv(MAXN);
ll nCk(ll n, ll k) {
	ll res = 1;
	for(ll i = 1; i <= k; i++) {
		res = res*(n-i+1) % MOD;
	}
 
	for(ll i = 1; i <= k; i++) {
		res = res*inv[i] % MOD;
	}
	return res;
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

int main(){
    ll x;
    cin>>x;
    if(x >= 30){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}

Measured memory_bytes: 4660
<?php
list($n, $m, $d) = ints();
echo $d === 0 ? ($m - 1) / $n : ($m - 1) * 2 * ($n - $d) / ($n ** 2);
function ints()
{
    return array_map('intval', explode(' ', trim(fgets(STDIN))));
}


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

vector<string> S(3);
int turn_n;
char next_turn;

int solve(char turn){
	turn_n=turn-'a';
	if(S[turn_n].size()==0){
		cout<<char(turn+'A'-'a')<<endl;
		return 0;
	}
	next_turn = S[turn_n][0];
	S[turn_n].erase(S[turn_n].begin());
	solve(next_turn);
}
int main() {
	cin>>S[0]>>S[1]>>S[2];
	solve(S[0][0]);
}

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

#define x first
#define h second

using namespace std;

const int N = (int)2e5 + 5;

long long n,d,a,ans,curDam,b[N];

pair<long long,long long> m[N];

int main(){
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> n >> d >> a;
    for(int i = 1; i <= n; i++){
    	cin >> m[i].x >> m[i].h;
    }
    sort(m + 1,m + 1 + n);
    for(int i = 1; i <= n; i++){
    	curDam -= b[i];
    	m[i].h -= curDam;
    	if(m[i].h < 0) m[i].h = 0;
    	int need = (m[i].h + a - 1) / a;
    	ans += need;
    	long long R = m[i].x + 2 * d,l = i,r = n,curR = i;
    	while(l <= r){
    		long long mid = r + l >> 1;
    		if(m[mid].x <= R){
    			curR = mid;
    			l = mid + 1;
    		}	
    		else r = mid - 1;
    	}	
    	curDam += need * a;
    	b[curR + 1] += need * a;
	}
    cout << ans;
 	return 0;  
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define Int int64_t

using namespace std;

bool check(const char& a, const char& b) { return (a == '?' || b == '?' || a == b); }

void tapu(vector<bool>& v, const string& a, const string& b) {
	for (int i = 0; i < a.size(); ++i) {
		for (int j = 0; j < b.size(); ++j) {
			if (i + j >= a.size()) { break; }
			if (!check(a[i + j], b[j])) {
				v[i] = false;
				break;
			}
		}
	}
}

int main() {
	const int sz = 4010;
	string s[3];
	for (int i = 0; i < 3; ++i) { cin >> s[i]; }

	int ans = 1e8;
	vector<int> P = { 0, 1, 2 };
	do {
		string a = s[P[0]], b = s[P[1]], c = s[P[2]];
		vector<bool> ab(sz, true), bc(sz, true), ac(sz, true);
		tapu(ab, a, b);
		tapu(bc, b, c);
		tapu(ac, a, c);

		for (int i = 0; i < sz; ++i) {
			for (int j = i; j < sz; ++j) {
				if (ab[i] && bc[j - i] && ac[j]) {
					int n = max({ a.size(), b.size() + i, c.size() + j });
					ans = min(ans, n);
				}
			}
		}
	} while ( next_permutation(P.begin(), P.end()) );

	cout << ans << endl;

	return 0; 
}


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

using namespace std;
int main(){
int a,b,c,x,y;
cin>>a>>b>>c>>x>>y;
int pa,pb,pt,p,pab,pall;
pa=x*a;
pb=y*b;
pt=pa+pb;
if(x>y)
{
    pab=y*c*2;
    pa=(x-y)*a;
    p=pa+pab;
    pall=2*x*c;
}
else
    {
    pab=x*c*2;
    pb=(y-x)*b;
    p=pab+pb;
    pall=2*y*c;
}
if(p>pt && pall>pt)
  cout<<pt<<endl;
else if(p<pt && p<pall)
cout<<p<<endl;
else
cout<<pall<<endl;

return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	private static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int tmp = a;
		for (int i = 0;i < 1000000;i++) {
			if (tmp%b==c) {
				System.out.println("YES");
				return;
			}
			tmp += a;
		}
		System.out.println("NO");
	}
}


Measured memory_bytes: 21972
#include <iostream>

using namespace std;

int main() {
    int i, m, f, r;
    cin >> m >> f >> r;
    for(i=1; m!=-1||f!=-1||r!=-1; i++)
    {
        if (m==-1|f==-1)
        cout << "F" << endl;
        else if (m+f>=80)
        cout << "A" << endl;
        else if (m+f<80 && m+f>=65)
        cout << "B" << endl;
        else if (m+f<65 && m+f>=50)
        cout << "C" << endl;
        else if (m+f<50 && m+f>=30 && r>=50)
        cout << "C" << endl;
        else if (m+f<50 && m+f>=30)
        cout << "D" << endl;
        else if (m+f<30)
        cout << "F" << endl;
        cin >> m >> f >> r;
    }
    
}


Measured memory_bytes: 3116
#include<iostream>

using namespace std;

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

	int k,n;
	cin >> k >> n;
	int a[n];
	for(int i=0; i<n; i++)
		cin >> a[i];
	int mn = a[n-1] - a[0];
	for(int i=0; i<n-1; i++){
		if(k - a[i+1] + a[i] < mn)
		 	mn = k - a[i+1] + a[i];
	}
	cout << mn;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define SZ(v) (int((v).size()))
#define ALL(vec) (vec).begin(),(vec).end()
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
using namespace std;
 
template<typename T, typename V = __gnu_pbds::null_type>
using ordered_set = __gnu_pbds::tree<T, V, less<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>; // find_by_order(), order_of_key()

using ll = long long int;
using i64 = long long int;
template <typename T> inline bool uax(T &x, T y) {return (y > x) ? x = y, true : false;}
template <typename T> inline bool uin(T &x, T y) {return (y < x) ? x = y, true : false;}

void err(__attribute__((unused)) istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " =: " << a << endl;
  err(++it, args...);
}
template <typename T1, typename T2>
inline ostream& operator << (ostream& os, const pair<T1, T2>& buf) {
  return os << "(" << buf.first << ": " << buf.second << ")";
}
template<typename T>
inline ostream &operator << (ostream & os,const vector<T>& v) {
  bool first = true;
  os << "[";
  for(unsigned int i = 0; i < v.size(); i++) {
    if(!first) os << ", ";
    os << v[i];
    first = false;
  }
  return os << "]";
}
template<typename T>
inline ostream &operator << (ostream & os,const set<T>& v) {
  bool first = true;
  os << "{";
  for (auto ii = v.begin(); ii != v.end(); ++ii) {
    if(!first) os << ", ";
    os << *ii;
    first = false;
  }
  return os << "}";
}
inline ostream &operator << (ostream & os,const multiset<int>& v) {
  bool first = true;
  os << "{";
  for (auto x: v) {
    if(!first) os << ", ";
    os << x;
    first = false;
  }
  return os << "}";
}
template<typename T1, typename T2>
inline ostream &operator << (ostream & os,const map<T1, T2>& v) {
  bool first = true;
  os << "{";
  for (typename map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii) {
    if(!first) os << ", ";
    os << *ii ;
    first = false;
  }
  return os << "}";
}
template<typename T>
ostream &operator << (ostream & os,const vector<vector<T>>& v) {
  for (auto &u: v) os << '\n' << u;
  return os;
}
template<typename T>
void finish(T ans) {cout << ans << '\n'; exit(0);}
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const double EPS = 1e-6;
#define PI 3.14159265358979323846
/***********************************************************************/

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

  int n, m, c;
  cin >> n >> m >> c;
  int ans = 0;
  vector<int> b(m);
  for (int &e: b) cin >> e;
  for (int i = 0; i < n; ++i) {
    int sum = c;
    for (int j = 0; j < m; ++j) {
      int x;
      cin >> x;
      sum += b[j] * x;
    }
    ans += (sum > 0);
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-


def main():
    import sys
    input = sys.stdin.readline

    from heapq import heappush, heappop

    x, y, a, b, c = map(int, input().split())
    p = sorted(list(map(int, input().split())), reverse=True)[:x]
    q = sorted(list(map(int, input().split())), reverse=True)[:y]
    r = sorted(list(map(int, input().split())), reverse=True)

    h = list()

    for pi in p:
        heappush(h, pi)

    for qi in q:
        heappush(h, qi)

    for ri in r:
        heappush(h, ri)

    for i in range(c):
        heappop(h)

    print(sum(h))


if __name__ == '__main__':
    main()


Measured memory_bytes: 106860
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;

int main(){
    string s;cin>>s;
    if(s[0]=='B'&&s[1]=='B'&&s[2]=='B') cout<<"No"<<endl;
    else if(s[0]=='A'&&s[1]=='A'&&s[2]=='A') cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};

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; }

struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};




signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;

    ll n,k,s;
    cin>>n>>k>>s;
    ll a[100010]={};
    rep(i,k){
        a[i]=s;
    }
    rep2(i,k,n){
        if(s!=1000000000){
            a[i]=1000000000;
        }
        else{
            a[i]=999999999;
        }
    }
    rep(i,n){
        cout<<a[i]<<" ";
    }
    cout<<endl;

    return 0;
}


Measured memory_bytes: 2176
#include"bits/stdc++.h"
using namespace std;
#define LL long long

LL N,M,K,r,t,a[100000],aa[100000];
double W, H, x, y;
double ans;
string s,f;
int main() {
	cin >> W >> H >> x >> y;
	ans = W*H / 2;
	if (x == W / 2&& y == H / 2) {
		cout << fixed << setprecision(10) <<ans<<" "<<1 << endl;
	}
	else {
		cout << fixed << setprecision(10) << ans <<" "<< 0 << endl;
	}
	return 0;

}


Measured memory_bytes: 256
#pragma warning (disable:4996)
#include <stdio.h>

int input(int *m, int *f, int *r){
	scanf("%d %d %d", m, f, r);
	if (*m == -1 && *f == -1 && *r == -1)return 0;
	else return 1;
}

char checkGrade(int *m, int *f, int *r){
	int sum = *m + *f;
	if (*m == -1 || *f == -1)return 'F';
	else if (sum >= 80)return 'A';
	else if (65 <= sum&& sum < 80)return 'B';
	else if (50 <= sum&& sum < 65)return 'C';
	else if (30 <= sum&& sum < 50){
		if (*r >= 50)return'C';
		return 'D';
	}
	else return 'F';
}

void output(int *m, int *f, int *r){
	printf("%c\n", checkGrade(m, f, r));
}

int main(void){
	int m, f, r;
	while (1){
		if (input(&m, &f, &r)){
			output(&m, &f, &r);
		}
		else break;
	}
	return 0;
}

Measured memory_bytes: 600
#include<iostream>
#include<cstdlib>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<cmath>
#include<iomanip>
#define rep(i,n) for(int i(0);i<n;i++)
const int INF = 1001001001;

using namespace std;
int main(){
	string s;
	cin >> s;
	if(s=="SUN") puts("7");
	else if(s=="MON")puts("6");
	else if(s=="TUE")puts("5");
	else if(s=="WED")puts("4");
	else if(s=="THU")puts("3");
	else if(s=="FRI")puts("2");
	else if(s=="SAT")puts("1");

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int a=0,b=0,c,d,e,f;

  scanf("%d %d %d %d",&c,&d,&e,&f);
  a=c+d+e+f;
  scanf("%d %d %d %d",&c,&d,&e,&f);
  b=c+d+e+f;
  if(a<b)printf("%d\n",b);
  else printf("%d\n",a);
  return 0;
}

Measured memory_bytes: 592
#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

int field[70][40];

int mintime[70][40][2];

struct aa {
	int time;
	int y;
	int x;
	bool isl;

};
class Compare {
public:
	//keiroが昇順に並ぶ
	bool operator()(const aa&l, const aa&r) {
		return l.time> r.time;
	}
};

int main() {
	while (1) {
		for (int i = 0; i < 70; ++i) {
			for (int j = 0; j < 40; ++j) {
				for (int k = 0; k < 2; ++k) {
					mintime[i][j][k] = 99999999;
				}
			}
		}
		memset(field, 0, sizeof(field));
		int w, h; cin >> w >> h;
		if (!w)break;
		
		vector<pair<int, int>>sts;
		for (int i = 0; i < h; ++i) {
			for (int j = 0;j < w; ++j) {
				char c; cin >> c;
				if (c == 'X') {

				}
				else if (c == 'T') {
					field[i + 5][j + 5] = 100;
				}
				else if (c == 'S') {
					sts.push_back(make_pair(i + 5, j + 5));
				}
				else {
					field[i + 5][j + 5] = c-'0';
				}
			}
		}
		priority_queue<aa, vector<aa>, Compare>que;
		for (int i = 0; i < sts.size(); ++i) {
			for (int j = 0; j < 2; ++j) {
				que.push(aa{ 0, sts[i].first, sts[i].second, bool(j) });
				mintime[sts[i].first][sts[i].second][j] = 0;
			}
		}
		int ans = 99999999;
		while (que.size()) {
			aa atop(que.top());
			que.pop();
			const bool mover = atop.isl;
			for (int dy = -2; dy <= 2; ++dy) {
				for (int dx = 1; dx < 4 - abs(dy); ++dx) {
					if (!mover)dx = -dx;
					const int nx = atop.x + dx;
					const int ny = atop.y + dy;
					if (field[ny][nx]) {
						int nt = atop.time;
						if (field[ny][nx] == 100) {
							ans = min(nt, ans);
							break;
						}
						else {
							nt += field[ny][nx];
						}
						if (mintime[ny][nx][!mover]>nt) {
							mintime[ny][nx][!mover] = nt;
							que.push(aa{ nt, ny, nx, !mover });

						}
					}
					if (!mover)dx = -dx;
				}
			}
		}
		if (ans == 99999999) {
			cout << -1 << endl;
		}
		else {
			cout << ans << endl;
		}

	}
	return 0;
}

Measured memory_bytes: 3208
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,max,cnt=0;
	cin >> n >> max;
	vector<int>arr(n);

	for(int i=0; i<n; i++)
	{
		cin >> arr[i];
		if(arr[i]>=max)
			cnt++;
	}
	cout << cnt;
 	return 0; 	
}

Measured memory_bytes: 640
//666yuchen
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
using namespace std;
string a;
int c;
int main()
{
  cin>>a;
  for(int i=0;i<a.size();i++)
  {
  	if(a[i]=='C')c++;
  	if(a[i]=='F'&&c!=0){cout<<"Yes";return 0;}
  }
  cout<<"No";
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,j,a[102],k=0,l=0,cnt=0,x,n;
    map<int,int>m;
    string s,s1;
    cin>>s;
    if(s[0]=='S'){cout<<"Cloudy\n";}
    else if(s[0]=='C'){cout<<"Rainy\n";}
    else if(s[0]=='R'){cout<<"Sunny\n";}




}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

ll gcd(ll p, ll q){
	if (q == 0){
		return p;
	}
	 return gcd(q, p%q);
}

ll a[10], m[10], co[10], L;

int main(){
	while (cin >> a[0] >> m[0] >> a[1] >> m[1] >> a[2] >> m[2] && a[0] + a[1] + a[2] + m[0] + m[1] + m[2]){
		REP(i, 3){
			co[i] = 1;
			int k = a[i];
			while (1){
				if (k == 1)break;
				co[i]++;
				k = k*a[i] % m[i];
			}
		}
		L = co[2] * co[1] / gcd(co[2],co[1]);
		L = L*co[0] / gcd(L, co[0]);
		cout << L << endl;
	}
}

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

int main(){
  int H,W,M; cin >> H >> W >> M;
  set<pair<int,int>> bomb;
  vector<int> sumh(H,0), sumw(W,0);
  for(int i=0; i<M; i++){
    int x,y; cin >> x >> y;
    x--; y--;
    bomb.emplace(x,y);
    sumh[x]++;
    sumw[y]++;
  }
  
  set<int> kouhoh,kouhow;
  int mh=0;
  for(int i=0; i<H; i++){
    if(mh<sumh[i]) mh=sumh[i];
  }
  for(int i=0; i<H; i++){
    if(mh==sumh[i]) kouhoh.insert(i);
  }
  int mw=0;
  for(int i=0; i<W; i++){
    if(mw<sumw[i]) mw=sumw[i];
  }
  for(int i=0; i<W; i++){
    if(mw==sumw[i]) kouhow.insert(i);
  }
  
  for(auto kh:kouhoh){
    for(auto kw:kouhow){
      if(bomb.find(pair<int,int>(kh,kw))==bomb.end()){
        cout << mh+mw << endl;
        return 0;
      }
    }
  }
  cout << mh+mw-1 << endl;
}

Measured memory_bytes: 47824
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define EPS (1e-15)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define bet(x, a, b) (a) <= (x) && (x) < (b)
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	int M, D;
	int ans = 0;

	cin >> M >> D;

	repc(m, 1, M) repc(d, 1, D) {
		int d1 = d % 10;
		int d10 = d / 10;
		if (d1 >= 2 && d10 >= 2 && d1 * d10 == m) ans++;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

int NOT(int x){
  if(x==0) return 2;
  else if(x==1) return 1;
  else return 0;
}

int AND(int x,int y){
  if(x==2&&y==2) return 2;
  else if(x==0||y==0) return 0;
  else return 1;
}

int OR(int x,int y){
  if(x==2||y==2) return 2;
  else if(x==0&&y==0) return 0;
  else return 1;
}

struct State{
  int value;
  int backpos;
  State(int a,int b) {
    value   = a;
    backpos = b;
  }
  State(){
    value=0;
    backpos=0;
  }
};

State formula(const std::string& s,const int frontpos){
  char c=s[frontpos];
  if(c=='0'){
    return State(0,frontpos);
  }else if(c=='1'){
    return State(1,frontpos);
  }else if(c=='2'){
    return State(2,frontpos);
  }else if(c=='-'){
    State result=formula(s,frontpos+1);
    result.value=NOT(result.value);
    return result;
  }else if(c=='('){
    int right_front=frontpos+1;
    int bracket=0;
    for(;right_front<s.size();right_front++){
      if(s[right_front]=='('){
        bracket++;
      }else if(s[right_front]==')'){
        bracket--;
      }
      if(bracket==0&&s[right_front]=='*'){
        right_front++;
        State left=formula(s,frontpos+1);
        State right=formula(s,right_front);
        State result(AND(left.value,right.value),right.backpos+1);
        return result;
      }else if(bracket==0&&s[right_front]=='+'){
        right_front++;
        State left=formula(s,frontpos+1);
        State right=formula(s,right_front);
        State result(OR(left.value,right.value),right.backpos+1);
        return result;
      }
    }
  }
}

int Solve(const std::string& s){
  int result=0;
  for(int p=0;p<=2;p++){
    for(int q=0;q<=2;q++){
      for(int r=0;r<=2;r++){
        std::string replaced=s;
        for(int i=0;i<replaced.size();i++){
          if(replaced[i]=='P'){
            replaced[i]=p+'0';
          }else if(replaced[i]=='Q'){
            replaced[i]=q+'0';
          }else if(replaced[i]=='R'){
            replaced[i]=r+'0';
          }
        }
        // cerr<<replaced<<endl;
        // cerr<<Perse(replaced,0)<<endl;

        if(formula(replaced,0).value==2){
          result++;
        }
      }
    }
  }

  return result;
}

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

  while(1){
    std::string s;
    cin>>s;
    if(s==".") break;
    cout<<Solve(s)<<endl;
  }
  return 0;
}



Measured memory_bytes: 3204
(function(input) {
    var a = parse(input);
    a = a.map(function(e) { return e.map(Number); });
    for (var i = 0; i < a.length; i++) {
        var s = a[i];
        var m = s[0];
        var f = s[1];
        var r = s[2];
        if (m === -1 && f === -1 & r === -1) {
            return;
        }
        console.log(rank(m, f, r));
    }
})(require('fs').readFileSync('/dev/stdin', 'utf8'));

function parse(str, sep, ter) {
    sep = sep || ' ';
    ter = ter || '\n';
    str = str.replace(/\n$/, '');
    var a = str.split(ter);
    for (var i = 0; i < a.length; i++) {
        a[i] = a[i].split(sep);
    }
    return a;
}

function rank(m, f, r) {
    var s = m + f;
    if (m < 0 || f < 0) {
        s = 0;
    }
    if (s< 30) {
        return 'F';
    }
    if (s < 50) {
        if (r < 50) {
            return 'D';
        }
        return 'C';
    }
    if (s < 65) {
        return 'C';
    }
    if (s < 80) {
        return 'B';
    }
    return 'A';
}

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

int dp[20][50001]={0};

int main(){
  int n,m;
  int c[20];
  cin >> n >> m;
  for(int i=0;i<m;i++){
    cin >> c[i];
  }
  for(int i=0;i<m;i++){
    for(int j=1;j<=n;j++){
      if(i==0){
        dp[i][j]=dp[i][j-1]+c[i];
      }else if(j<c[i]){
        dp[i][j]=dp[i-1][j];
      }else{
        dp[i][j]=min(dp[i-1][j],dp[i][j-c[i]]+1);
      }
    }
  }
  int min=100000;
  for(int i=0;i<m;i++){
    if(min>dp[i][n]){
      min=dp[i][n];
    }
  }
  /*cout << endl;
  for(int i=0;i<m;i++){
    for(int j=0;j<=n;j++){
      cout << dp[i][j] << " ";
    }
    cout << endl ;
  }*/
  cout << min << endl;
  return 0;
}
  

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

int main(){
    int x,a,b;
    cin >> x >> a >> b;
    if(abs(x-a)<abs(x-b)){
        cout << 'A' << endl;
    }else{
        cout << 'B' << endl;
    }
    return 0;
}

Measured memory_bytes: 256
x,k,d=map(int,input().split())
if x==0:
    if d%2==0:
        print(0)
    else:
        print(d)
else:
    cou=0
    ok=True
    if x>0:
        xx=x
        while x>0:
            if xx-k*d>0:
                ans=x-k*d
                ok=False
                break
            cou+=1
            x-=d
            
        xx=x+d
        if ok:
            if cou%2==0 and k%2==0:
                ans=x
            elif cou%2==0 and k%2==1:
                ans=xx
            elif cou%2==1 and k%2==0:
                ans=xx
            else:
                ans=x
    
    if x<0:
        xx=x
        while x<0:
            if xx+k*d<0:
                ans=xx+k*d
                ok=False
                break
            cou+=1
            x+=d
            
        xx=x-d
        if ok:
            if cou%2==0 and k%2==0:
                ans=x
            elif cou%2==0 and k%2==1:
                ans=xx
            elif cou%2==1 and k%2==0:
                ans=xx
            else:
                ans=x
    print(abs(ans))

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

int n;
long long c;
int v[100005];
long long x[100005];
long long dp[100005];
long long dp1[100005];
long long dp2[100005];
int main()
{
    cin >> n >> c;
    for(int i = 1; i <= n ; ++i) cin >> x[i] >> v[i];
    //ma duc clockwise
    long long Sol = 0;
    dp[1] = v[1] - x[1];
    Sol = max(Sol, dp[1]);
    dp1[1] = dp[1];
    for(int i = 2; i <= n ; ++i){
        dp[i] = dp[i - 1] + v[i] - (x[i] - x[i - 1]);
        Sol = max(Sol, dp[i]);
        dp1[i] = max(dp[i], dp1[i - 1]);
    }
    dp2[n] = x[n] + v[n] - c;
    Sol = max(Sol, dp2[n]);
    for(int i = n - 1; i >= 1 ; --i){
        dp2[i] = dp2[i + 1] + v[i] - (x[i + 1] - x[i]);
        Sol = max(Sol, dp2[i]);
    }
    for(int i = n; i > 1 ; --i)
        Sol = max(Sol, dp2[i] + dp1[i - 1] - (c - x[i]));
    for(int i = n - 1; i >= 1 ; --i)
        dp2[i] = max(dp2[i], dp2[i + 1]);
    for(int i = 1; i < n ; ++i){
        Sol = max(Sol, dp[i] + dp2[i + 1] - x[i]);

    }

    cout << Sol;

    return 0;
}


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

int main(){
	int e,y;
	cin>>e>>y;

	if(e==0){
		if(1868<=y&&y<=1911){
			cout<<'M'<<y-1867<<endl;
		}else if(1912<=y&&y<1926){
			cout<<'T'<<y-1911<<endl;
		}else if(1926<=y&&y<1989){
			cout<<'S'<<y-1925<<endl;
		}else if(1989<=y&&y<2017){
			cout<<'H'<<y-1988<<endl;
		}
	}
	if(e==1){
		cout<<y+1867<<endl;
	}
	if(e==2){
		cout<<y+1911<<endl;
	}
	if(e==3){
		cout<<y+1925<<endl;
	}
	if(e==4){
		cout<<y+1988<<endl;
	}
return 0;
}

Measured memory_bytes: 3084
import sys, itertools
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 1000000007
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)

def kruskal(es, V):
    es.sort(key=lambda x:x[2])
    uf = UnionFind(V)
    res = 0
    for e in es:
        if not uf.same(e[0], e[1]):
            uf.union(e[0], e[1])
            res += e[2]
    return res

def resolve():
    while True:
        n = I()
        if n==0:
            break
        else:
            xyzr = [LF() for _ in range(n)]

            edge = []
            for i, j in itertools.combinations(range(n), 2):
                corridor_length = max(sum([(k-m)**2 for k, m in zip(xyzr[i][:3], xyzr[j][:3])])**0.5-(xyzr[i][3]+xyzr[j][3]), 0)
                edge.append([i, j, corridor_length])
            # print(n, edge)
            mst_cost = kruskal(edge, n)
            print(f'{mst_cost:.03f}')

if __name__ == '__main__':
    resolve()


Measured memory_bytes: 6648
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
const int mod = 1e9+7, A = 1e6+1;

int main()
{
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	int n;
	cin >> n;
	string s;
	int mx = 0;
	map<string, int> mop;
	for (int i = 0; i < n; i++)
	{
		cin >> s, mop[s]++;
		mx = max(mx, mop[s]);
	}
	for (auto i : mop)
		if (i.S == mx)
			cout << i.F << '\n';

	return 0;
}


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

namespace B___Coins
{
    class Program
    {
        static void Main(string[] args)
        {
            int A = int.Parse(Console.ReadLine());
            int B = int.Parse(Console.ReadLine());
            int C = int.Parse(Console.ReadLine());
            int X = int.Parse(Console.ReadLine());
            int count = 0;

            for (int i = 0; i <= A; ++i)
            {
                for (int j = 0; j <= B; ++j)
                {
                    for (int k = 0; k <= C; ++k)
                    {
                        if ((i * 500) + (j * 100) + (k * 50) == X)
                        {
                            count += 1;
                        }
                    }
                }
            }

            Console.Write(count);

            Console.Read();
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)//半開区間[a, b)
#define rep(i,n) for(int i=0;i<n;i++)//半開区間[0, n)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--)//半開区間[a, b)を上から
#define reprev(i,n) reprrev(i,0,n)//半開区間[0, n]を上から
typedef long long ll;//intは[-2147483648, 2147483647]の範囲 
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;
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
                     
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
 int N; cin >> N;
 string S; cin >> S;
 if(N%2!=0) cout << "No" << endl;

 else if(S.substr(0, N/2)==S.substr(N/2, N/2)) cout << "Yes" << endl;

 else cout << "No" << endl;
}

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

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


Measured memory_bytes: 256
n,w = map(int,input().split()) #n:頂点数　w:辺の数
from collections import defaultdict
D=defaultdict(list)
def warshall_floyd(d):
    #d[i][j]: iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                if d[i][j]>d[i][k]+d[k][j]:
                    d[i][j] = d[i][k] + d[k][j]
                    D[(i,j)]=D[(i,k)]+D[(k,j)][1:]
    return d
done=[[-1]*n for _ in range(n)]
d = [[float("inf")]*n for i in range(n)] 
#d[u][v] : 辺uvのコスト(存在しないときはinf)
for i in range(w):
    x,y,z = map(int,input().split())
    d[x-1][y-1] = z
    d[y-1][x-1] = z
    D[(x-1,y-1)]=[x-1,y-1]
    D[(y-1,x-1)]=[y-1,x-1]
    done[x-1][y-1]=0
    done[y-1][x-1]=0
for i in range(n):
    d[i][i] = 0 #自身のところに行くコストは０
warshall_floyd(d)
for l in D.values():
    for i in range(1,len(l)):
        a=l[i-1]
        b=l[i]
        done[a][b]=1
        done[b][a]=1
import numpy as np
done=np.array(done)
ans=(done==0).sum()
#print(D)
#print(done)
print(ans//2)

Measured memory_bytes: 16992
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		long y = 100;
		for (int i = 1; i <= 1000000; i++) {
			y = y + y /100;
			if (y >= x) {
				System.out.println(i);
				return;
			}
		}
	}
}


Measured memory_bytes: 35596
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
const int INF = 1001001001;

template<class Type>
Type modpow(Type a, Type n, Type mod)
{
	Type res = 1;
	while (0 < n) {
		if (n & 1) {
			res = res * a % mod;
		}
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

template<class Type>
Type gcd(Type x, Type y)
{
	Type r;
	if (x < y) swap(x, y);

	while (0 < y) {
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

template<class Type>
Type lcm(Type x, Type y)
{
	return x * y / gcd(x, y);
}

template<class Type>
bool is_prime(Type x)
{
	if (x == 2) return true;
	if (x < 2 || x % 2 == 0) return false;

	for (Type i = 3; i <= sqrt(x); i += 2) {
		if (x % i == 0) return false;
	}
	return true;
}

template<class Type>
vector<bool> eratos(Type n)
{
	vector<bool> isPrime(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	for (Type i = 2; i <= n; i++) {
		if (isPrime[i]) {
			Type j = i + i;
			while (j <= n) {
				isPrime[j] = false;
				j = j + i;
			}
		}
	}
	return isPrime;
}

bool binary_search_judge(vector<int> a, int index, int key)
{
	if (key <= a[index]) return true;
	else return false;
}

int binary_search(vector<int> a, int key)
{
	int ng = -1;
	int ok = a.size();
	while (1 < abs(ng - ok)) {
		int mid = (ng + ok) / 2;
		if (binary_search_judge(a, mid, key)) ok = mid;
		else ng = mid;
	}
	return a[ok] == key;
}

int main()
{
	string s;
	cin >> s;
	for (int i = 0; i < s.size(); i++) {
		cout << "x";
	}
	cout << endl;
}

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

#define rep(i,a,b) for(i=(a);i<=(b);++i)
#define rev(i,a,b) for(i=(a);i>=(b);--i)
#define max2(a,b)  ((a)>(b)?(a):(b))
#define min2(a,b)  ((a)<(b)?(a):(b))

typedef long long int ll;
const ll mod = 1000000007;  //998244353;
ll i, j, k;

//***************** Code Starts Here *******************//

int main()
{
	ll n, k; cin >> n >> k;
	ll a[n + 1] = {0}; rep(i, 1, n) cin >> a[i];

	ll dp[n + 1][k + 1], pre[n + 1][k + 1];
	memset(dp, 0, sizeof(dp));
	memset(pre, 0, sizeof(pre));

	rep(i, 0, a[n]) dp[n][i] = 1;
	pre[n][0] = dp[n][0];
	rep(i, 1, k) pre[n][i] = pre[n][i - 1] + dp[n][i];

	rev(i, n - 1, 1)
	rep(j, 0, k)
	{
		int l = j - min2(j, a[i]), r = j;
		if (l == 0)
		{
			dp[i][j] += pre[i + 1][r];
			dp[i][j] %= mod;
		}
		else
		{
			dp[i][j] += (pre[i + 1][r] - pre[i + 1][l - 1] + mod) % mod;
			dp[i][j] %= mod;
		}

		if (j == 0)
			pre[i][j] = dp[i][j];
		else
		{
			pre[i][j] = pre[i][j - 1] + dp[i][j];
			pre[i][j] %= mod;
		}
	}

	cout << dp[1][k] << endl;
}

Measured memory_bytes: 158080
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <string>
#include <map>
using namespace std;
int ci[510], si[510], fi[510];
int n;
long long ans = 0;

long long solve(int now,long long ti)
{
	//printf("%d %d\n", now, ti);
	if (now == n) return ti;
	if (ti < si[now]) return solve(now + 1, si[now] + ci[now]);
	if (ti%fi[now] == 0) return solve(now + 1, ti + ci[now]);
	else return solve(now + 1, ti + fi[now] - ti%fi[now] + ci[now]);
}

int main()
{
	int i, j;
	scanf("%d", &n);
	for (i = 1; i < n; i++)
	{
		scanf("%d%d%d", &ci[i], &si[i], &fi[i]);
	}
	for (i = 1; i < n; i++)
	{
		printf("%lld\n", solve(i, 0));
	}
	printf("0\n");
	return 0;
}

Measured memory_bytes: 256
s=[0 for _ in range(26)]
t=[0 for _ in range(26)]
S=input()
T=input()

for i in range(len(S)):
    s[ord(S[i])-ord('a')]+=1
    t[ord(T[i])-ord('a')]+=1

s.sort()
t.sort()
if s==t:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3632
#include <stdio.h>

int fib(int );
int f[44];
int main(){
  int n;
  scanf("%d",&n);
  printf("%d\n",fib(n));
  return 0;
}

int fib(int n){
  if(n==0||n==1)
    return f[n]=1;
  else {
    if(f[n]!=NULL)
      return f[n];
  }
  return f[n] = fib(n-2)+fib(n-1);
}



Measured memory_bytes: 2104
use std::io;

fn main(){
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("error");
	let n: i32 = match buf.trim().parse() {
		Ok(num) => num,
		Err(_) => panic!("error"),
	};
	println!("{}", n/2 + n%2);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main(){
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	int n,c;
	cin >> n >> c;
	int h[n],dp[n],s[n],top=0,l=0;
	for(int i=0;i<n;i++)
		cin >> h[i];
	dp[0]=h[0]*h[0],s[top]=0;
	for(int i=1;i<n;i++){
		dp[i]=dp[s[l]]-2*h[i]*h[s[l]];
		while(l<top){
			int x=dp[s[l+1]]-2*h[i]*h[s[l+1]];
			if(x<dp[i])dp[i]=x,l++;
			else break;
		}
		dp[i]+=2*h[i]*h[i]+c;
		while(top){
			int p=(dp[s[top]]-dp[s[top-1]])*(h[i]-h[s[top]]);
			int q=(dp[i]-dp[s[top]])*(h[s[top]]-h[s[top-1]]);
			if(p>=q)top--;
			else break;
		}
		s[++top]=i;
		if(l>top)l=top;
	}
	cout << dp[n-1]-h[n-1]*h[n-1] << endl;
}


Measured memory_bytes: 4992