akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O3")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << "\n";
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (int i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int n, a, b;
    cin >> n >> a >> b;

    print(min(n * a, b));

}

Measured memory_bytes: 3644
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Threading;

class Program
{
    static void Main(string[] args)
    {
        int[] arr = Console.ReadLine().Split(' ').Select(v => int.Parse(v)).ToArray();
        int n = arr[0];
        int k = arr[1];
        arr = Console.ReadLine().Split(' ').Select(v => int.Parse(v)).OrderBy(v => v).ToArray();
        int sum = 0;
        for(int i = 0; i < k; i++)
        {
            sum += arr[i];
        }
        Console.WriteLine(sum);

    }

    

}

Measured memory_bytes: 28568
#include<stdio.h>
int main(){
	int nm,nd,i;
	int M[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
	while(1){
		scanf("%d %d",&nm,&nd);
		if(nm==0)break;
		int d=2;
		int m;
		if(0<nm&&nm<13){
			if(0<nd&&nd<M[nm]+1){
				for(i=nm-1;i>0;i--){
					d+=M[i];
				}
				d+=nd;
				if(d%7==0)printf("Monday\n");
				if(d%7==1)printf("Tuesday\n");
				if(d%7==2)printf("Wednesday\n");
				if(d%7==3)printf("Thursday\n");
				if(d%7==4)printf("Friday\n");
				if(d%7==5)printf("Saturday\n");
				if(d%7==6)printf("Sunday\n");
			}
		}
	}
	return 0;
}

Measured memory_bytes: 584
using System;
using System.Collections.Generic;

namespace ConsoleApp15
{
    class Class198
    {
        static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            SortedSet<int> set = new SortedSet<int>();
            for (int i = 0; i < N; i++)
                set.Add(int.Parse(Console.ReadLine()));
            Console.WriteLine(set.Count );
        }
    }
}


Measured memory_bytes: 13268
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
using namespace std;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define rrep(i,a,n) for(ll i=n;i>=a;i--)
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF = 1e+17;
const ll MODcdf = 998244353;
int main(){
    int a,b,ans;cin>>a>>b;
    if(b%a==0)ans=a+b;
    else ans=b-a;
    cout<<ans<<endl;
    return 0;

}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
    int n, modos = 0, j;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++){
        j = n - i;
        if (i < j){
            modos += 1;
        }
        else{
            break;
        }
    }
    printf("%d\n", modos);
    return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

/**
 * Created by enpingkuang on 2020/9/9 11:58 下午
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        if(n == m){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 35696
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
int n, d, x[15][15], ans;

int main(){
	scanf("%d%d", &n, &d);
	rep(i,n){
		rep(j,d) scanf("%d", x[i]+j);
		rep(j,i){
			int dis = 0, u = 1;
			rep(k,d) dis += (x[i][k] - x[j][k])*(x[i][k] - x[j][k]);
			for(; u*u < dis; u++);
			if(u*u == dis) ans++;
		}
	}
	printf("%d\n", ans);
}

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

using namespace std;

using ll = long long;

const ll mod = 1e9 + 7;

ll sum(ll a, ll b) { return (a + b) % mod; }
void add(ll& a, ll b) { a = sum(a, b); }
ll sub(ll a, ll b) { return (a - b + mod) % mod; }
ll mul(ll a, ll b) { return a * b % mod; }

void NO() {
    cout << 0 << endl;
    exit(0);
}

int main() {
    ios_base::sync_with_stdio(false);
    ll n;
    string s;
    cin >> n >> s;
    ll cur = 0;
    ll ans(1);
    for (char c : s)
        if (c == 'W') {
            if (cur % 2)
                ++cur;
            else if (cur == 0)
                NO();
            else {
                ans = mul(ans, cur);
                --cur;
            }
        } else {
            if (cur % 2) {
                ans = mul(ans, cur);
                --cur;
            } else {
                ++cur;
            }
        }
    if (cur) NO();
    for (int i(1); i <= n; ++i)
        ans = mul(ans, i);
    cout << ans << endl;
}


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

#define _ cin.tie(0);ios::sync_with_stdio(false);
using namespace std;
using LL = long long;
const int N = 100000 + 5;

LL tree[N << 1];
LL read(int k)
{
    LL sum=0;
    while(k)
    {
        sum+=tree[k];
        k-=k&-k;
    }
    return sum;
}

void add(int k,LL num)
{
    while(k<=N)
    {
        tree[k]+=num;
        k+=k&-k;
    }
}
vector<LL> a, b, c;
int main(){ _
    LL  n, m;
    memset(tree, 0, sizeof(tree));
    scanf("%lld", &n);
    for(int i = 0; i < n; i++) { scanf("%lld", &m); a.push_back(m); }
    for(int i = 0; i < n; i++) { scanf("%lld", &m); b.push_back(m); }
    for(int i = 0; i < n; i++) { scanf("%lld", &m); c.push_back(m); }
    sort(a.begin(), a.end()); sort(b.begin(), b.end()); sort(c.begin(), c.end());

   // array<LL, N> nCount;
    for(int i = 0; i < n; i++){
        auto tmp = lower_bound(a.begin(), a.end(), b[i]);
        LL num = distance(a.begin(), tmp);
        add(i + 1, num);
    }
    LL sum = 0;
    for(auto &i : c){
        auto tmp = lower_bound(b.begin(), b.end(), i);
        LL cur = distance(b.begin(), tmp);
        sum += read(cur);
    }
    printf("%lld\n", sum);
}


Measured memory_bytes: 4980
#include<bits/stdc++.h>
using namespace std;
int main(){
  string ans="YES";
  string s,t;
  cin>>s;
  cin>>t;
  for(int i=0;i<3;i++){
    if(s.at(i)!=t.at(2-i)){ans="NO";}
  }
  cout<<ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,m;
    cin >> n >> m;
    int k[m];
    int p[m];
    vector<vector<int>> s(m,vector<int>(n,0));
    for(int i = 0;i < m;i++){
        cin >> k[i];
        for(int j = 0;j < k[i];j++){
            int S;
            cin >> S;
            S--;
            s[i][S] = 1;
        }
    }
    int ans = 0;
    bool judge = true;
    for(int i = 0;i < m;i++)cin >> p[i];
    for(int bit = 0;bit < (1 << n);bit++){
        judge = true;
        for(int i = 0;i < m;i++){
            int on = 0;
            for(int j = 0;j < n;j++){
                if((bit & (1 << j))&&(s[i][j] == 1))on++;
            }
            if(on % 2 == p[i]);
            else{
                judge = false;
                break;
            }
        }
        if(judge == true)ans++;
    }
    cout << ans << endl;
}

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

using namespace std;

int u[100001];
int ans[401];
int a[301][301];


int main () {
	int n, m;
	cin >> n >> m;
	for (int i = 1;i <= n;i ++) {
		for (int j = 1;j <= m;j ++) {
			cin >> a[i][j];
		}
	}
	int kol = 0, almas = 1e9;           
	while (kol < m) {
		for (int i = 1;i <= n;i ++) {
			for (int j = 1;j <= m;j ++) {
				if (!u[a[i][j]]) {
					ans[a[i][j]] ++;
					break;
				}
			}
		}
		int id = 0;
		for (int i = 1;i <= m;i ++) {
			if (ans[i] > ans[id]) {
				id = i;
			}
		}
		u[id] = 1;      
		kol ++;
		almas = min (almas, ans[id]);
		memset (ans, 0, sizeof ans);
	}
	cout << almas;
	return 0;
}

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

int main()
{
    string s;
    cin >> s;
    string ans = {};
    for (int i = 0; i < s.size(); i++)
    {
        if (i % 2 == 0)
        {
            ans += s[i];
        }
    }
    cout << ans << endl;
}

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

#define sws ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define INFINITO 1000000000
#define ll long long
#define vi vector<int>
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define ff first
#define ss second
#define vvi vector<vi>
#define all(x) x.begin(), x.end()
#define fo(i, n) for( int i = 0; i < n; i++ )


int main() {

    int n;
    cin >> n;
    vi h(n);

    fo(i, n) cin >> h[i];

    bool pos = true;

    for ( int i = n - 1; i > 0 and pos; i-- ) {
        if ( h[i] >= h[i - 1] ) continue;
        if ( h[i] == h[i - 1] - 1 ) h[i - 1]--;
        else pos = false;
    }

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

    return 0;
}

Measured memory_bytes: 640
import java.util.*;

public class Main{
	public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
 	  String s1=sc.next(),s2=sc.next();
      int y=0;
      for(int i=0; i<3; i++){
      	if(s1.charAt(i)==s2.charAt(2-i)){
        	y++;
        }
      }
      if(y==3){
      	System.out.println("YES");
      }else{
      	System.out.println("NO");
      }
    }
}

Measured memory_bytes: 23892
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
using namespace std;
namespace mp = boost::multiprecision;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define rep0(i,n) for (int i=0; i<=(int)(n); ++i)
#define rep1(i,n) for (int i=1; i<=(int)(n); ++i)
#define rrep(i,n) for (int i=(int)(n)-1; i>=0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;
using llGraph = vector<vl>;
using vb = vector<bool>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int MOD = 1e9+7;
const int MOD2 = 998244353;
const double EPS = 1e-9;

template<typename T>
struct is_vector : false_type{};

template<typename T>
struct is_vector<vector<T>> : true_type{};

template<typename T>
ostream &operator << (ostream &ostr, const vector<T> &vec) {
  if (vec.empty()) {
    return ostr;
  }
  ostr << vec.front();
  for (auto itr = ++vec.begin(); itr != vec.end(); ++itr) {
    if (is_vector<T>()) ostr << "\n" << *itr;
    else ostr << ' ' << *itr;
  }
  return ostr;
}

template<typename T>
bool CompareBySecond(pair<T, T> a, pair<T, T> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}

template<typename T>
bool CompareBySlope(pair<T, T> a, pair<T, T> b) {
// counterclockwise from 12 o'clock direction
  if (a.first * b.first < 0) {
    return a.first < b.first;
  }
  if (a.first == 0) {
    if (a.second >= 0) {
      return true;
    }
    return a.first < b.first;
  }
  if (b.first == 0) {
    if (b.second >= 0) {
      return false;
    }
    return a.first < b.first;
  }
  return a.second * b.first < a.first * b.second;
}

template<typename T>
T GCD(T a, T b) {
  T c = a % b;
  while (c != 0) { a = b; b = c; c = a % b; }
  return b;
}


/* -------- <templates end> -------- */


void calc(const Graph &G, vector<double> &dp, int cnt) {
  rrep(i,cnt) {
    double sum = 0;
    for (auto &v : G[i]) {
      sum += dp[v] + 1;
    }
    dp[i] = sum / G[i].size();
  }
}

void solve() {
  int n, m; cin >> n >> m;
  Graph G(n);
  rep(i,m) {
    int s, t; cin >> s >> t; --s; --t;
    G[s].push_back(t);
  }

  vector<double> dp(n);
  dp.back() = 0;
  calc(G, dp, n-1);

  double ans = dp.front();
  rep(i,n-1) {
    auto ndp = dp;
    double tmp = 0;
    for (auto &v : G[i]) {
      tmp = max(tmp, dp[v] + 1);
    }
    ndp[i] = (dp[i] * G[i].size() - tmp) / (G[i].size() - 1);
    calc(G, ndp, i);
    ans = min(ans, ndp.front());
  }

  cout << ans << endl;
}


/* -------- <programs end> -------- */


int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  solve();
  return 0;
}


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


//c++ templte for help............................................................................................................................................
typedef long long ll;

//template<typename... T>
//void print1(T... t){
	//((cout<<t<<" "),...);
//}

//template<typename... T>
//void print2(T... t){
		//vector<vector<ll>> ans={t...};
		//for(ll i=0;i<(ll)ans.size();i++){
			//if(i!=0) cout<<"\t\t";
			//else cout<<"\t";
			//for(ll j=0;j<(ll)ans[i].size();j++){
				//cout<<ans[i][j]<<" ";
			//}
			//if(i!=(ll)ans.size()-1)
			//cout<<endl;
		//}
//}	
//#define deb(...) cout<<" [ "#__VA_ARGS__<<" : "; print1(__VA_ARGS__); cout<<"]"<<endl; 
//#define vdeb(...) cout<<" [ "#__VA_ARGS__<<" : "; print2(__VA_ARGS__); cout<<"]"<<endl;





	
 
//for loop
//#define fo(i,n) for(int i=0;i<(ll)n;i++)
//#define Fo(i,k,n) for(int i=k;i<n;i++)
 
 
//to print vector element 
//template<typename T>
//void printV(T vec){
	//fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
	//cout<<endl;
	//}
	
 
#define M int(1e9+7)
const int INF=1e9+5;
 
//iterate map
//template<typename T>
//void itR(T map){
	 //for(auto itr=map.begin();itr!=map.end();itr++){
				//deb(itr->first,itr->second);
			//}
	//cout<<endl;
//}


 
 
 
//c++ template for help...........................................................................................................................................


ll solve(){
	ll n;
	cin>>n;
	
	return (1000-(n%1000))%1000;
}

int main() {
	//stringstream ss;
	//ss<<"akhil";
	//cout<<ss.str()<<endl;
	cout<<setprecision(10);
	ios::sync_with_stdio(0);
	cin.tie(0);
	

	//ll testCase;
	//cin>>testCase;
	//for(ll tt=0;tt<testCase;tt++){
		//solve();
		ll ans=solve();
		cout<<ans<<endl;
	//}
	return 0;
}


Measured memory_bytes: 3644
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
using namespace std;
using ll = long long;
constexpr ll INF = 3000000000000000000;

int main() {
    string S;
    cin >> S;
    
    if (S[0] == S[SZ(S) - 1]) {
        if (SZ(S) & 1) cout << "Second\n";
        else cout << "First\n";
    } else {
        if (SZ(S) & 1) cout << "First\n";
        else cout << "Second\n";
    }
    return 0;
}


Measured memory_bytes: 3748
#pragma region _head

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<numeric>
#include<utility>

#pragma region _define

#define int LL
#define f(i,a,b) for(LL i=a;i<b;i++)
#define rep(i,n) for(LL i=0;i<n;i++)
#define f_vI(v,n) f(i,0,n)cin>>v[i]
#define f_v2I(v1,v2,n) f(i,0,n)cin>>v1[i]>>v2[i]
#define f_v3I(v1,v2,v3,n) f(i,0,n)cin>>v1[i]>>v2[i]>>v3[i]
#define f_vO(v,n,option) f(i,0,n)cout<<v[i]<<option;
#define all(a) a.begin(),a.end()
#define size(s) ((int)s.size())
#define check() cout<<"! ! !"
#define endl "\n"
#define _y() cout<<"Yes"<<endl
#define _Y() cout<<"YES"<<endl
#define _n() cout<<"No"<<endl
#define _N() cout<<"NO"<<endl
#define INT_INF 1<<29
#define LL_INF 1LL<<60
#define MOD 10000007

#pragma endregion

#pragma region _using

using namespace std;

using LL = long long;
using st = string;
using vi = vector<LL>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vc = vector<char>;
using vs = vector<st>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using qi = queue<int>;
using qc = queue<char>;
using qs = queue<st>;
using si = stack<LL>;
using sc = stack<char>;
using ss = stack<st>;
using pi = pair<LL, LL>;
using mll = map<LL, LL>;
using vpi = vector<pi>;

#pragma endregion


//素数判定
bool is_prime(int n) {
	for (int i = 2; i*i <= n; i++) {
		if (n%i == 0) {
			return false;
		}
	}
	return true;
}

void y_n(bool p) {
	if (p)_y();
	else _n();
}

void Y_N(bool p) {
	if (p) _Y();
	else _N();
}

LL gcd(LL a, LL b) {
	LL r;
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}
LL lcm(LL a, LL b) {
	return (a / gcd(a, b)*b);
}

//階乗計算
LL factorial(LL n) {
	LL a = 1, ret = 1;
	while (a < n) {
		a++;
		ret *= a;
		//ret %= 1000000007;
	}
	return ret;
}

#pragma endregion

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

	
	int a, b, t;
	cin >> a >> b >> t;
	int ans = 0;
	for (int i = a; i <= t; i += a) {
		ans+=b;
	}

	cout << ans;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int A,B,X;
  cin>>A>>B>>X;
  if(A>X)
  {
    cout<<"NO"<<endl;
  }else{
    if(X<=A+B)
    {
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>

auto & in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int64_t K,X,Y;

int main()
{
	using std::abs;
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> K>>X>>Y;
	int64_t dist = abs(X) + abs(Y);
	if (K % 2 == 0 && dist % 2 == 1) {
		out << "-1\n";
		return 0;
	}
	std::vector<std::pair<int64_t, int64_t>> res;
	int64_t nowx = 0, nowy = 0;
	int64_t after = (K - dist%K)%K;
	if (after % 2 == 1) {
		after += K;
	}
	after /= 2;
	while (after < K - dist) {
		if (K % 2 == 0) {
			after += K / 2;
			if (after >= K - dist) {
				break;
			}
			after -= K / 2;
		}
		dist += K;
		if (nowx <= X) {
			nowx -= K;
		}
		else {
			nowx += K;
		}
		res.emplace_back(nowx, nowy);
	}
	if (after > 0) {
		int64_t movep = K - after;
		bool ymove = false;
		int64_t befnowx = nowx, befnowy = nowy;
		if (movep > 0) {
			auto dif = std::min(movep,abs(X - befnowx));
			movep -= dif;
			nowx += ((X > befnowx) ? (dif) : (-dif));
		}
		if (movep > 0) {
			ymove = true;
			auto dif = std::min(movep, abs(Y - befnowy));
			movep -= dif;
			nowy += ((Y > befnowy) ? (dif) : (-dif));
		}
		assert(movep == 0);
		if (ymove) {
			nowx += ((X > befnowx) ? (after) : (-after));
		}
		else {
			nowy += ((befnowy <= Y) ? (-after) : (after));
		}
		res.emplace_back(nowx, nowy);
	}

	auto TMPTMPTMMP = (abs(nowy - Y) + abs(nowx - X));
	assert(TMPTMPTMMP %K == 0);
	while (nowy != Y || nowx!=X) {
		int64_t move = K;
		if (nowx < X) {
			nowx += move;
			if (X < nowx) {
				if (Y > nowy) {
					nowy += nowx - X;
				}
				else {
					nowy -= nowx - X;
				}
				nowx = X;
			}
		}
		else if (X < nowx) {
			nowx -= move;
			if (X > nowx) {
				if (Y > nowy) {
					nowy += X - nowx;
				}
				else {
					nowy -= X - nowx;
				}
				nowx = X;
			}
		}
		else if (Y > nowy) {
			nowy += move;
		}
		else if (Y < nowy) {
			nowy -= move;
		}
		res.emplace_back(nowx, nowy);
	}

	out << res.size() << "\n";
	for (auto& i : res)
	{
		out << i.first << " " << i.second << "\n";
	}

	return 0;
}
#endif


Measured memory_bytes: 5484
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <algorithm>
#include <climits>
#include <iomanip>
#define endl "\n"
#define debug(x) cout << #x << " : " << x << endl;
#define debug2(x, y) cout << #x << " : " << x  << ", " << #y << " : " << y << endl;
#define FASTIO ios_base::sync_with_stdio(false),cin.tie(0);
typedef long long ll;
using namespace std;

int main()
{
	FASTIO
	
	int x;
	cin >> x;

	int val = x ^ 1;
	cout << val << endl;
}

Measured memory_bytes: 3644
#include<stdio.h>

/* 大文字を小文字に変換 */
char tolowr(char c) {
  if ((c >= 'A') && (c <= 'Z')) {
    return (c + 0x20);
  } else {
    return c;
  }
}

int main(){
  char c;
  int i,ans[26] = {0};
  
  while(1){
    if(scanf("%c", &c) == EOF) break;
    c = tolowr(c);

    if(c >= 'a' && c <= 'z')
      ++ans[c - 'a'];
  }

  for(i=0;i<26;++i){
    printf("%c : %d\n",i+'a',ans[i]);
  }
  
  return 0;
}



Measured memory_bytes: 2740
from itertools import product
while True:
    N = input()
    if N == 0:
        break
    g = [[2<<30 if i!=j else 0 for j in xrange(11)] for i in xrange(11)]
    used = [False]*11
    for _ in xrange(N):
        a,b,c = map(int,raw_input().split())
        g[a][b] = g[b][a] = c
        used[a] = used[b] = True
    for k,i,j in product(xrange(11),repeat=3):
        g[i][j] = min(g[i][j],g[i][k]+g[k][j])
    a = [sum(filter(lambda x:x<(2<<30),g[i])) if used[i] else 2<<30 for i in xrange(11)]
    print "{} {}".format(*min(zip(range(11),a),key=lambda(i,s):s))

Measured memory_bytes: 4416
#include<stdio.h>
 
//??????????????????????????????????????????
int top,S[1000];
 
void push(int x){
  S[++top] = x;
}
 
int pop(){
  top--;
  return S[top+1];
}
 
int main(){
  int a,b;
  top = 0;
  char s[100];
 
  while( scanf("%s",s) != EOF ){
    if(s[0]=='+'){
      a=pop();
      b=pop();
      push(a+b);
    } else if(s[0]=='-'){
      a=pop();
      b=pop();
      push(b-a);
    } else if(s[0]=='*'){
      a=pop();
      b=pop();
      push(a*b);
    } else {
      push(atoi(s));
    }
  }
 
  printf("%d\n",pop());
   
  return 0;
}

Measured memory_bytes: 548
#include<iostream>
#include<algorithm>

using namespace std;

const int MAX = 10001;
typedef pair<int,int> P;

int N, ans;
P num[MAX];
short data[MAX],cop[MAX];

void Copy(int pos, int col){
  
  for(int i = 0; i < N; i++)
    cop[i] = data[i];

  cop[pos] = col;

}

void del(int pos, int number,int rev){

  for(int i = pos+1; i <= rev; i++)
    cop[i-number] = cop[i];

  fill(&cop[rev-number],&cop[rev],0);
}

void play(){
 
  int rev = -1;
  fill(num,num+MAX,P(1,0));
  int s = 0;
  for(int i = 0; cop[i] != 0; i++,s++){
    if(i && cop[i] == cop[i-1]) num[rev].first++;
    else {
      rev++;
      num[rev].second = cop[i];
    }
  }
  
  
  int now = s, r,l;
  
  for(int i = rev; i >=0; i--){
    
    if(num[i].first >= 4){
      now -= num[i].first;
      r = i+1;
      l = i-1;
      while(r <= rev && l >= 0){
	if(num[r].second == num[l].second &&
	   num[r].first+num[l].first >= 4 && num[r].second){

	  now -= num[r].first+num[l].first;
	  r++;
	  l--;
	}else break;
      }
      break;
    }
    }
  ans = min(ans,now);
  /*
    bool flg = true;

    for(int i = rev-1; i >= 0; i--)
      if(num[i] >= 4){
	del(i,num[i],rev);
	flg = false;
	break;
      }

    if(flg){
      ans = min(ans,rev);
      break;
    }
    */
  
}

void solve(){
  
  for(int i = 0; i < N; i++)
    for(int j = 1; j <= 3; j++)
      if(data[i] != j){
	Copy(i,j);
	play();
      }
}

void init(){

  fill(data,data+MAX,0);
  fill(cop,cop+MAX,0);
  ans = MAX;

}

int main(){
  while(cin >> N && N){
    init();
    for(int i = 0; i < N; i++)
      cin >> data[i];
  
    solve();
    cout << ans << endl;
  }
  return 0;
}

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

vector <int> v;

void PrimeFac(int n){
    while(n%2==0){
        v.push_back(2);
        n/=2;
    }

    int ans=sqrt(n);
    for(int i=3; i<=ans; i+=2){
        while(n%i==0){
            v.push_back(i);
            n/=i;
        }
    }

    if(n>2) v.push_back(n);
}

int main(){
    int n;
    scanf("%d",&n);
    PrimeFac(n);

    int len=v.size();
    printf("%d: %d",n,v[0]);
    for(int i=1; i<len; i++){
        printf(" %d",v[i]);
    }
    printf("\n");

    return 0;
}



Measured memory_bytes: 3272
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc=new Scanner(System.in);
		String S=sc.next();
		String T=sc.next();
		char toridasi=T.charAt(T.length()-1);
		String tasi=S+toridasi;
		
		
		if(T.equals(tasi)) {
			System.out.println("Yes");
		}else {
				System.out.println("No");
			}
		}

	
  }




Measured memory_bytes: 38936
S = input()

N = len(S)
ans = [0 for i in range(len(S))]
R_cnt = L_cnt = 0

for i in range(N):
    if S[i] == 'R':
        if S[i+1] == 'L':
            ans[i] += R_cnt//2 + 1
            ans[i+1] += (R_cnt+1)//2
            R_cnt = 0
        else:
            R_cnt += 1

for i in range(1,N+1):
    if S[N-i] == 'L':
        if S[N-(i+1)] == 'R':
            ans[N-i] += L_cnt//2 + 1
            ans[N-(i+1)] += (L_cnt+1)//2
            L_cnt = 0
        else:
            L_cnt += 1

L = [str(int(i)) for i in ans]
print(' '.join(L))

Measured memory_bytes: 10876
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 文字列の入力
		String s = sc.next();
		String t = sc.next();
		// スペース区切りの整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();

		String u = sc.next();

		if ( u.equals(s) ) {
			a--;
		} else {
			b--;
		}
		System.out.println(a + " " + b);
	}
}

Measured memory_bytes: 23892
#include <bits/stdc++.h>
using namespace std;
using ld = long double;

struct edge {
	int from, to;
	ld cost;
	edge() {}
	edge(int from, int to, ld cost) : from(from), to(to), cost(cost) {}
};

bool operator<(const edge& l, const edge& r){
	return l.cost < r.cost;
}

class UnionFind {
	vector<int> data;
	vector<int> rank;
	int root(int a) {
		return data[a] < 0 ? a : data[a] = root(data[a]);
	}
public:
	UnionFind(int n) : data(n, -1), rank(n, 1) {}
	bool Find(int a, int b) {
		return root(a) == root(b);
	}
	void Union(int a, int b) {
		a = root(a);
		b = root(b);
		if (a == b) return;
		if (rank[a] < rank[b]) {
			data[a] += data[b];
			data[b] = a;
		}
		else {
			data[b] += data[a];
			data[a] = b;
			if (rank[a] == rank[b]) rank[b]++;
		}
	}
	int Size(int a) {
		return -data[root(a)];
	}
	int Rank(int a) {
		return rank[root(a)];
	}
};

int main()
{
	cin.sync_with_stdio(false);
	cout << fixed << setprecision(3);
	int n;
	while (cin >> n, n) {
		vector<ld> x(n), y(n), z(n), r(n);
		for (int i = 0; i < n; i++) {
			cin >> x[i] >> y[i] >> z[i] >> r[i];
		}
		vector<edge> es;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				ld dx = x[j] - x[i], dy = y[j] - y[i], dz = z[j] - z[i];
				es.emplace_back(i, j, max((ld)0, sqrtl(dx * dx + dy * dy + dz * dz) - r[i] - r[j]));
			}
		}
		sort(es.begin(), es.end());
		ld res = 0;
		UnionFind uf(n);
		for (auto e : es) {
			if (uf.Find(e.from, e.to)) {
				continue;
			}
			res += e.cost;
			uf.Union(e.from, e.to);
		}
		cout << res << endl;
	}
	return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<int> num(n);
  for(int i = 0; i < n; i++){
    cin >> num[i];
  }
  set<int> st;
  for(int i = 0; i < n; i++){
    st.insert(num[i]);
  }
  
  if(st.size()==num.size()) cout << "YES" << endl;
  if(st.size()!=num.size()) cout << "NO" << endl;
}


Measured memory_bytes: 10368
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,ans;cin>>N;
  vector<int> a(N);
  cin>>a.at(0);
  for(int i=1;i<N;i++)a.at(i)=a.at(0)+i;
  if(a.at(0)>=0)ans=accumulate(a.begin(),a.end(),0)-a.at(0);
  else if(a.at(N-1)<=0)ans=accumulate(a.begin(),a.end(),0)-a.at(N-1);
  else ans=accumulate(a.begin(),a.end(),0);
  
  cout<<ans<<endl;
}

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

int main() {
        int n;
        scanf("%d", &n);
        //vector<unsigned long long> ans;
        //unsigned long long x = 2;
        //while (true) {
        //        x --;
        //        x = 3 * x + 2;
        //        cerr << x << endl;
        //        ans.push_back(x);
        //        if (ans.size() > 40) break;
        //}
        //printf("%lld\n", ans[n - 1]);
        printf("%lld\n", (1LL << (n + 2)) - 2);
        return 0;
}



Measured memory_bytes: 128
n = int(input())

x = [int(input()) for i in range(n)]
minx = x[0]
maxx = -10000000000

for i in range(1,n):
    r = x[i] - x[i-1]
    maxx = max(maxx,x[i] - minx)
    minx = min(minx,x[i])

print(maxx)


Measured memory_bytes: 13676
class Job
  attr_reader :name
  attr_accessor :remaining_time, :finished_at

  def initialize(name, remaining_time)
    @name = name
    @remaining_time = remaining_time
    @finished_at = nil
  end
end

n, q = gets.split.map(&:to_i)

unfinished_jobs = $stdin.readlines.map do |line|
  name, remaining_time = line.split

  Job.new(name, remaining_time.to_i)
end

finished_jobs = []

current_time = 0

until unfinished_jobs.empty?
  job = unfinished_jobs.shift

  elapsed_time = [job.remaining_time, q].min
  job.remaining_time -= elapsed_time
  current_time += elapsed_time

  if job.remaining_time > 0
    unfinished_jobs << job
  else
    job.finished_at = current_time
    finished_jobs << job
  end
end

puts finished_jobs.map {|job| "#{job.name} #{job.finished_at}" }

Measured memory_bytes: 21200
#include <bits/stdc++.h>
#define N 100005
#define LL long long 
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define sp " "
#define endl "\n"
using namespace std;
LL int n,a,sum,b,c;
int main()
{
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(false);
	cin>>c>>a>>b;
	if(a%2!=b%2)
		cout<<"Borys";
	else
		cout<<"Alice";
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
int main()
{
    string str;
    cin >> str;
    size_t n = str.size();
    for (int i = 1; i < n - 1; ++i)
    {
        string sub = str.substr(0, n - i);
        size_t m = sub.size();
        if (m % 2 == 1) continue;
        string subleft = sub.substr(0, m / 2);
        string subright = sub.substr(m / 2, m / 2);
        if (subleft == subright)
        {
            cout << m << endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int nanashi(double xa,double ya,double ra,double xb,double yb,double rb)
{
	double d = (xb-xa)*(xb-xa) + (yb-ya)*(yb-ya);	/*ツ陳心ツ甘板づ個仰猟猟」ツ禿アツ湘ヲ*/
	double sr= (ra+rb)*(ra+rb);					/*ツ板シツ径ツづ個和ツ禿アツ湘ヲ*/
	double dr= (rb-ra)*(rb-ra);					/*ツ板シツ径ツづ個債キツ禿アツ湘ヲ*/
	
	if(sr<d){
		return 0;
	}else if(dr<=d){
		return 1;
	}else if(d<dr){
		return ( (ra>rb) ? 2 : -2 );
	}else{
		return 1;
	}
}

int main()
{
	double xa,ya,ra,xb,yb,rb;
	int n,i;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
		printf("%d\n",nanashi(xa,ya,ra,xb,yb,rb) );
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <utility>
#include <map>
#include <set>
#include <algorithm>
#include<cmath>
#include <cstring>

#define rep(i, a, b) for (int i=a; i <b; i++)
#define F first
#define S second

using namespace std;

typedef long long ll;
typedef vector< int > vi;

const int  MAX_N = 2 *100000 + 10;

int par[MAX_N]; // 各ノードの親
int trank[MAX_N]; // 各ノードのランク，つまり木の高さ．
int para[MAX_N]; // 各ノードの親
int tranka[MAX_N]; // 各ノードのランク，つまり木の高さ．

void init(int* par, int*trank, int n) {
    for (int i=0; i<n; i++) {
        par[i] = i;
        trank[i] = 0;
    }
}

//木の根を求める
int find (int* par, int x) {
    if (par[x] == x) {
        return x;
    } else {
        return par[x] = find(par, par[x]);
    }
}

// xとyの属する集合を併合
void unite(int* par, int* trank, int x, int y) {
    x = find(par, x);
    y = find(par, y);
    if (x == y) return;

    if (trank[x] < trank[y]) {
        par[x] = y;
    } else {
        par[y] = x;
        if(trank[x] == trank[y]) {
            trank[x]++;
        }
    }
}

// xとyが同じ集合に属するか否か
bool same(int* par, int x, int y) {
    return find(par, x) == find(par, y);
}


int main() {
    string s, t;
    cin >> s; cin >> t;
    int n = s.length();   
    int alpa[26], alpb[26];
    for(int i=0; i<26; i++) {
        alpa[i] = -1;
        alpb[i] = -1;
    }

    init(par, trank, n); init(para, tranka, n);
    for (int i=0; i<n; i++) {
        if(alpa[t[i]-'a'] == -1) {
            alpa[t[i]-'a'] = i; 
        } else {
            unite(par, trank, i, alpa[t[i]-'a']);
        }
        if(alpb[s[i]-'a'] == -1) {
            alpb[s[i]-'a'] = i; 
        } else {
            unite(para, tranka, i, alpb[s[i]-'a']);
        }
    } 
    /*
    for(int i=0; i<26; i++) {
        printf("%d, ", alpa[i]);
    }
    printf("\n");
    */
    vector<queue<int>> q(26), qb(26);
    for(int i=0; i<n; i++) {
        q[s[i]-'a'].push(i);
        qb[t[i]-'a'].push(i);
    }
    

    /* for(int i=0; i<26; i++) {
        printf("%c: ", 'a'+i);
        while(!q[i].empty()) {
            printf("%d ", q[i].front());
            q[i].pop();
        }
        printf(", ");
    } */

    bool ans = true;
    for(int i=0; i<26; i++) {
        int f = q[i].front();
        while(!q[i].empty()) {
            if (!same(par, f, q[i].front())) {
                ans = false;
            }
            q[i].pop();
        }
    }

    for(int i=0; i<26; i++) {
        int f = qb[i].front();
        while(!qb[i].empty()) {
            if (!same(para, f, qb[i].front())) {
                ans = false;
            }
            qb[i].pop();
        }
    }

    if(ans) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 5512
#include <iostream>

int main() {

	int i;
	int h, m, s;

	std::cin >> i;

	h = i / 3600;
	m = (i / 60) - (h * 60);
	s = i - (h * 3600) - (m * 60);
	std::cout << h << ":" << m << ":" << s << std::endl;
	return 0;

}


Measured memory_bytes: 3100
/*================================================================
*
*   创 建 者： badcw
*   创建日期： 2020/6/21 20:07
*
================================================================*/
#include <bits/stdc++.h>

#define ll long long
using namespace std;

const int maxn = 1e5+50;
const int mod = 1e9+7;
ll qp(ll a, ll n, ll mod = ::mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main(int argc, char* argv[]) {
    int n;
    scanf("%d", &n);
    vector<int> a(n);
    int tot = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", &a[i]);
        tot ^= a[i];
    }
    for (int i = 0; i < n; ++i) {
        printf("%d%c", tot ^ a[i], i == n - 1 ? '\n' : ' ');
    }
//    for (int i = 0; i < n; ++i) {
//        int tmp = 0;
//        for (int j = 0; j < n; ++j) {
//            if (i == j) continue;
//            tmp ^= (tot ^ a[j]);
//        }
//        printf("* %d %d\n", a[i], tmp);
//    }
    return 0;
}

Measured memory_bytes: 4064
N = int(input())
A = list(map(int,input().split()))
ans = 0
odd = 1
for i in range(N):
  tmp = 0
  if A[i] % 2 == 0:
    tmp = 2
  else:
    tmp = 1
  odd *= tmp
print(pow(3, N) - odd)

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

ll a_sum[222222];
ll b_hist[222222];

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

    ll n, m;cin >> n >> m;
    vector<ll> a(n);
    REP(i, n){
        cin >> a[i];
    }
    REP(i, m){
        int now;cin >> now;
        b_hist[now]++;
    }

    sort(ALL(a));
    REP(i, n){
        a_sum[i] = a[i];
        if(i)a_sum[i] += a_sum[i-1];
    }

    ll ans = 0;
    REP(i, 222222){
        if(b_hist[i] == 0){
            continue;
        }

        ll now = 0;
        ll kake = 1;
        ll l = 0;
        //cout << "i " << i << endl;
        while(1) {
            auto it = lower_bound(ALL(a), i * kake);
            int r = it - a.begin() - 1;
            ll tmp = a_sum[r];
            if(l)tmp -= a_sum[l-1];
            //cout << kake << " " << l << " " << r << " " << tmp << " " << i*(kake-1)*(r-l+1) << endl;
            if(r >= l){
                now += tmp - i * (kake-1) * (r - l + 1);
            }
            l = r + 1;
            kake++;
            if(it == a.end()){
                break;
            }
        }

        //cout << now << endl;

        ans += now * b_hist[i];
    }

    cout << ans << endl;

	return 0;
}



Measured memory_bytes: 7568
N, K = map(int, input().split())
V = list(map(int, input().split()))
ans = 0
for i in range(N + 1):#左から何個とるか
    if i > K:
        break
    for j in range(N + 1):#右から何個とるか
        if i + j > N or i + j > K:
            break
        for l in range(N + 1):#何個捨てるか
            if i + j + l > K:
                break
            a = V[:i] + V[N-j:]
            a.sort()
            s = sum(a[l:])
            ans = max(ans, s)
print(ans)

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

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

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

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

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

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	cin>>n;
	ll tmp=n;
	ll fv=0;
	if(n%2==1){
		cout<<0<<endl;
		return 0;
	}
	while(tmp>5){
		tmp/=5;
		fv+=tmp/2;
	}
	cout<<fv<<endl;

}


Measured memory_bytes: 256
n = int(input())
s = input()

if n % 2 != 0:
    print("No")
else:
    s_1 = s[:int(n/2)]
    s_2 = s[int(n/2):]
    if (s_1 == s_2):
        print("Yes")
    else:
        print("No")

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
string S;

int nex[101010][11];
int cur[101010];
int num[101010];
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>S;
	N=S.size();
	
	FOR(i,N) {
		x=i;
		FOR(j,10) {
			if(S[x]=='L') x--;
			else x++;
		}
		nex[i][0]=x;
		cur[i]=i;
	}
	
	FOR(i,10) {
		FOR(j,N) {
			x=j;
			FOR(y,10) x=nex[x][i];
			nex[j][i+1]=x;
			if(100&(1<<i)) cur[j]=nex[cur[j]][i];
		}
	}
	
	FOR(i,N) num[cur[i]]++;
	FOR(i,N) cout<<num[i]<<" ";
	cout<<endl;
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 5712
# AOJ 0626 Collecting Stamps 2
# Python3 2018.7.2 bal4u

import sys
from sys import stdin
input = stdin.readline

n = int(input())
si, sj = [0]*(n+1), [0]*(n+1)
s = input().strip()
for i in range(n):
	sj[i+1] = sj[i] + (s[i] == 'J')
	si[i+1] = si[i] + (s[i] == 'I')

ans = a = b = c = 0
for i in range(1, n): a = max(a, sj[i] * (si[n]-si[i]))
for i in range(n):
	if s[i] == 'O':
		b += si[n]-si[i+1]
		c += sj[i]
		ans += (si[n]-si[i+1]) * sj[i]
print(ans + max(a, b, c))


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

typedef long long ll;

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

    queue<ll> Q;
    for (int i = 1; i <= 9; i++) {
        Q.push(i);
    }

    while (--K) {
        ll n = Q.front(); Q.pop();

        int ld = n % 10;
        if (ld != 0) {
            Q.push(n*10 + ld - 1);
        }
        Q.push(n*10 + ld);
        if (ld != 9) {
            Q.push(n*10 + ld + 1);
        }
    }

    cout << Q.front() << "\n";
}


Measured memory_bytes: 1792
data =[int(s) for s in input().split()]

if data[0] <= data[1]:
  if data[1] >= data[2] and data[0] <= data[2]:
    print("Yes")
  else:
    print("No")
else:
  if data[1] <= data[2] and data[0] >= data[2]:
    print("Yes")
  else:
    print("No")
    

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

#define pb push_back
#define pf push_front
#define ar array
typedef long long ll;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i=0; i<n; ++i)
		cin >> a[i];
	ll ans=0;
	for(int i=1; i<n; ++i) {
		if(a[i-1]>a[i]) {
			ans += a[i-1]-a[i];
			a[i]=a[i-1];
		}
	}

	cout << ans;
}


Measured memory_bytes: 3980
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

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

  int K,Q;
  cin>>K>>Q;
  vector<ll> D(K);
  rep(i,K) cin>>D[i];

  for(int q=0;q<Q;q++){
      ll N,X,M;
      cin>>N>>X>>M;
      N--;
      X%=M;

      vector<ll> A=D;
      rep(i,K) A[i]%=M;
      ll sum=0;
      rep(i,K) sum+=A[i];

      ll last=X+sum*(N/K);
      rep(i,N%K) last+=A[i];

      ll ng=(last/M)-(X/M);
      ll keep=0;
      rep(i,K) if(A[i]==0) keep++;
      keep*=(N/K);
      rep(i,N%K) if(A[i]==0) keep++;

      ll ans=N;
      ans-=keep;
      ans-=ng;
      cout<<ans<<endl;
  }

  return 0;
}


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

int main() {
	int n;
	cin >> n;
	string s;
	map<string, int> mp;
	for (int i = 0; i < n; i++) {
		cin >> s;
		mp[s]++;
	}
	string str[4] = {"AC", "WA", "TLE", "RE"};
	for (int i = 0; i < 4; i++) {
		cout << str[i] << " x " << mp[str[i]] << endl;
	}
}

Measured memory_bytes: 3628
//start of jonathanirvings' template v3.0.3 (BETA)

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

typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<LL> vl;
typedef vector<vl> vvl;

double EPS = 1e-9;
int INF = 1000000005;
long long INFF = 1000000000000000005LL;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};

#ifdef TESTING
  #define DEBUG fprintf(stderr,"====TESTING====\n")
  #define VALUE(x) cerr << "The value of " << #x << " is " << x << endl
  #define debug(...) fprintf(stderr, __VA_ARGS__)
#else
  #define DEBUG 
  #define VALUE(x)
  #define debug(...)
#endif

#define FOR(a,b,c) for (int (a)=(b);(a)<(c);++(a))
#define FORN(a,b,c) for (int (a)=(b);(a)<=(c);++(a))
#define FORD(a,b,c) for (int (a)=(b);(a)>=(c);--(a))
#define FORSQ(a,b,c) for (int (a)=(b);(a)*(a)<=(c);++(a))
#define FORC(a,b,c) for (char (a)=(b);(a)<=(c);++(a))
#define FOREACH(a,b) for (auto &(a) : (b))
#define REP(i,n) FOR(i,0,n)
#define REPN(i,n) FORN(i,1,n)
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define SQR(x) ((LL)(x) * (x))
#define RESET(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ALL(v) v.begin(),v.end()
#define ALLA(arr,sz) arr,arr+sz
#define SIZE(v) (int)v.size()
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr,sz) sort(ALLA(arr,sz))
#define REVERSEA(arr,sz) reverse(ALLA(arr,sz))
#define PERMUTE next_permutation
#define TC(t) while(t--)

inline string IntToString(LL a){
  char x[100];
  sprintf(x,"%lld",a); string s = x;
  return s;
}

inline LL StringToInt(string a){
  char x[100]; LL res;
  strcpy(x,a.c_str()); sscanf(x,"%lld",&res);
  return res;
}

inline string GetString(void){
  char x[1000005];
  scanf("%s",x); string s = x;
  return s;
}

inline string uppercase(string s){
  int n = SIZE(s); 
  REP(i,n) if (s[i] >= 'a' && s[i] <= 'z') s[i] = s[i] - 'a' + 'A';
  return s;
}

inline string lowercase(string s){
  int n = SIZE(s); 
  REP(i,n) if (s[i] >= 'A' && s[i] <= 'Z') s[i] = s[i] - 'A' + 'a';
  return s;
}

inline void OPEN (string s) {
  #ifndef TESTING
  freopen ((s + ".in").c_str (), "r", stdin);
  freopen ((s + ".out").c_str (), "w", stdout);
  #endif
}

//end of jonathanirvings' template v3.0.3 (BETA)

string s;

int main()
{
  s = GetString();
  if (SIZE(s) >= 4 && s.substr(0,4) == "YAKI") puts("Yes");
  else puts("No");
  return 0;
}










Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	//変数を定義。
	int c[3][3];
	int flag = 0;

	//3×3のグリッドを入力。
	for (int i = 0; i < 3; i++) {
		scanf("%d %d %d\n", &c[i][0], &c[i][1], &c[i][2]);
	}

	/*表の上の数値から下の数値を引いた値がそれぞれ等しいと条件が満たされる。
	  例えば、c[0][0] - c[1][0] と c[0][1] - c[1][1]の差が等しい。*/
	for (int j = 0; j < 2; j++) {
		for (int k = 0; k < 2; k++) {
			if (c[j][k] - c[j + 1][k] != c[j][k + 1] - c[j + 1][k + 1]) {
				printf("No\n");
                return 0;
			}
		}
	}

		printf("Yes\n");
}


Measured memory_bytes: 128
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <sstream>
#include <queue>
#include <exception>
#include <cmath>
#include <numeric>
#include <map>
#include <algorithm>
#include <bitset>
#include <set>
#include <functional>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using namespace std;
typedef long long int lint;

int middle_square(int s) {
	return ((s * s) / 100) % 10000;
}

void AOJ0137(int x)
{
	int s;
	cin >> s;
	cout << "Case " << x << ":" << endl;
	REP(i, 10) {
		cout << (s = middle_square(s)) << endl;
	}
	return;
}

int main()
{
	int d;
	cin >> d;
	REP(i, d) AOJ0137(i + 1);

	return 0;
}

Measured memory_bytes: 2996