akhauriyash/Code-Regression huggingface dataset:
#[allow(unused_imports)]
use std::cmp;
use std::io::Write;

// Input macro from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
    let mut iter = $s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
  ($($r:tt)*) => {
    let s = {
      use std::io::Read;
      let mut s = String::new();
      std::io::stdin().read_to_string(&mut s).unwrap();
      s
    };
    let mut iter = s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
}

macro_rules! input_inner {
  ($iter:expr) => {};
  ($iter:expr, ) => {};

  ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
    let $var = read_value!($iter, $t);
    input_inner!{$iter $($r)*}
  };
}

macro_rules! read_value {
  ($iter:expr, ( $($t:tt),* )) => {
    ( $(read_value!($iter, $t)),* )
  };

  ($iter:expr, [ $t:tt ; $len:expr ]) => {
    (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  };

  ($iter:expr, chars) => {
    read_value!($iter, String).chars().collect::<Vec<char>>()
  };

  ($iter:expr, usize1) => {
    read_value!($iter, usize) - 1
  };

  ($iter:expr, [ $t:tt ]) => {{
    let len = read_value!($iter, usize);
    (0..len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  }};

  ($iter:expr, $t:ty) => {
    $iter.next().unwrap().parse::<$t>().expect("Parse error")
  };
}

fn main() {
  let out = std::io::stdout();
  let mut out = std::io::BufWriter::new(out.lock());
  macro_rules! puts {
    ($($format:tt)*) => (write!(out,$($format)*).unwrap());
  }
  input! {
    a: i32,
    _b: i32,
    c: i32,
    _d: i32,
  }
  if a == c {
    puts!("0\n");
  } else {
    puts!("1\n");
  }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
using ll = long long;
const ll MOD = 1e9 + 7;
const long long INF = 1LL << 60;

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> p(n);
    rep(i, n) cin >> p.at(i);

    vector<double> one_prob(n);
    rep(i, n)
    {
        one_prob.at(i) = 1.0 * (1 + p.at(i)) * p.at(i) / 2.0 / p.at(i);
        // cout << one_prob.at(i) << " ";
    }
    // cout << endl;

    vector<double> accum_prob(n + 1);
    double one_accum_prob = 0.0;
    accum_prob.at(0) = 0.0;
    // cout << accum_prob.at(0) << " ";
    for (int i = 1; i <= n; i++)
    {
        one_accum_prob += one_prob.at(i - 1);
        accum_prob.at(i) = one_accum_prob;
        // cout << accum_prob.at(i) << " ";
    }
    // cout << endl;

    // cout << "hoge" << endl;

    double answer = 0.0;
    for (int l = 0; l < n - k + 1; l++)
    {
        int r = l + k - 1;
        // cout << l << " " << r+1 << endl;
        // cout << accum_prob.at(l) << " " << accum_prob.at(r+1) << endl;
        answer = max(answer, accum_prob.at(r + 1) - accum_prob.at(l));
    }
    // cout << "hogehoge" << endl;
    cout << fixed << setprecision(12) << answer << endl;
}

Measured memory_bytes: 4096
import std.stdio, std.array, std.conv, std.string, std.algorithm, std.range;

void main() {
  foreach (string line; lines(stdin)) {
    auto d = line.chomp.to!int;

    int ans = 0;
    for (int i = d; i < 600; i += d) {
      ans += i * i * d;
    }

    ans.writeln;
  }
}

Measured memory_bytes: 1044
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Console;
using static System.Math;

namespace Atcoder
{
    class Program
    {
        static StreamWriter sw = new StreamWriter(OpenStandardOutput()) { AutoFlush = false };
        static void Main(string[] args)
        {
            try
            {
                SetOut(sw);
                Solve.Answer();
                Out.Flush();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
            }
        }
    }

    public class Solve
    {
        public static void Answer()
        {
            var nt = IO.RSInt;
            var t = IO.RSInt;
            var ans = 0;
            for (int i = 0; i < nt[0]; i++)
            {
                ans += nt[1];
                if (i == 0) continue;
                if (t[i] - t[i - 1] < nt[1])
                    ans -= nt[1] - (t[i] - t[i - 1]);
            }
            WriteLine(ans);
        }
    }

    public class IO
    {
        #region Input
        public static int RInt => int.Parse(ReadLine());
        public static long RLong => long.Parse(ReadLine());
        public static double RDouble => double.Parse(ReadLine());

        public static string[] RSString => ReadLine().Split();
        public static int[] RSInt => ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        public static long[] RSLong => ReadLine().Split().Select(s => long.Parse(s)).ToArray();
        public static double[] RSDouble => ReadLine().Split().Select(s => double.Parse(s)).ToArray();
        #endregion

        #region Output
        public static void OutJoinSpace<T>(IEnumerable<T> list) => WriteLine(string.Join(" ", list));
        public static void WriteLineYes_or_No(bool flag) => WriteLine(flag ? "Yes" : "No");
        public static void WriteLineYES_or_NO(bool flag) => WriteLine(flag ? "YES" : "NO");
        #endregion
    }

    public class Mod
    {
        #region
        private readonly static long M = 1000000007;

        public static long Add(long a, long b) => (a * b) % M;
        public static long Sub(long a, long b) => (a - b) % M >= 0 ? (a - b) % M : (a - b) % M + M;
        public static long Multi(long a, long b) => (a * b) % M;
        #endregion
    }
}

Measured memory_bytes: 28768
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1e9 + 7

template < typename T >
void printVector (const vector < T > & vec) {
	for (const T x : vec) {
		cout << x << " ";
	}
	cout << endl;
}

template < typename T >
void printMatrix (const vector < vector < T > > & mat) {
	for (const vector < T > vec : mat) {
		printVector (vec);
	}
	cout << endl;
}

const ll INF = 1e18L + 5;

template < typename T >
void min_self (T& a, T b) {
	a = min (a, b);
}

template < typename T >
void max_self (T& a, T b) {
	a = max (a, b);
}

void add_self (int & a, int b) {
	a += b;
	if (a >= MOD) {
		a -= MOD;
	}
}

int main() {
	int n;
	double p;
	scanf ("%d", &n);
	vector < double > dp (n + 1, 0.0);
	dp[0] = 1.0;
	for (int coin = 1; coin <= n; coin++) {
		scanf ("%lf", &p);
		for (int i = coin; i >= 0; i--) {
			dp[i] = (i == 0 ? 0 : dp[i - 1] * p) + dp[i] * (1.0 - p);
		}
	}
	double answer = 0.0;
	for (int i = n / 2 + 1; i <= n; i++) {
		answer += dp[i];
	}
	printf ("%.10lf\n", answer);
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b; if (a >= mod) a -= mod; }


void solve();

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  int T;
  T = 1;
  while (T--) solve();
}

void solve() {
  int n;
  ll k;
  cin >> n >> k;
  vector<int> a(n);
  cin >> a;
  rep(i, n) a[i]--;
  vector<vector<int> > G(n);
  rep(i, n) {
    G[i].eb(a[i]);
  }

  if (k <= 10000000) { // ループ前に終わる
    int now = 0;
    rep(i, k) now = a[now];
    cout << now + 1 << endl;
    return;
  }

  vector<int> seen(n);
  int pos = -1; // cycle 中に含まれる頂点 pos
  stack<int> hist; // 訪問履歴
  auto dfs = [&](auto&& dfs, int v, int p) -> void {
    seen[v] = 1;
    hist.push(v);
    for (auto nv : G[v]) {
      // if (nv == p) continue; directed ならいらない, undirected なら 2 頂点ループは見つけられない
      if (seen[nv] == 2) continue;
      if (seen[nv] == 1) { // cycle を検出
        pos = nv;
        return;
      }
      dfs(dfs, nv, v);
      if (pos != -1) return;
    }
    hist.pop();
    seen[v] = 2;
  };
  dfs(dfs, 0, -1);
  if (pos != -1) { // cycle
    // 経路復元, cycle に限らず
    vector<int> cycle;
    while (!hist.empty()) {
      int t = hist.top();
      cycle.eb(t);
      hist.pop();
      if (t == pos) break;
    }
    reverse(all(cycle));
    // cout << cycle << endl;

    int now = 0, cnt = 0;
    rep(i, n) {
      if (now == cycle[0]) {
        cnt = i;
        break;
      }
      now = a[now];
    }
    // cout << "cnt " << cnt << endl;

    (k = k - cnt + sz(cycle)) %= sz(cycle);
    cout << cycle[k] + 1 << endl;
  }
}


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

using namespace std;

typedef long long ll;

const ll MOD=1e9+7;

int main() {
    ll N, K; cin>>N>>K;

    vector<int> A(N);
    for (int i=0;i<N;i++) cin>>A[i];

    ll cnt0=0;
    ll cnt1=0;
    for (int i=0;i<N;i++) {
        for (int j=0;j<N;j++) {
            if (A[i] > A[j]) {
                cnt1++;
                if (i < j) {
                    cnt0++;
                }
            }
        }
    }

    ll sum=0;
    ll k=K*(K-1)/2 % MOD;
    sum += cnt0 * K % MOD;
    sum += cnt1 * k % MOD;
    sum %= MOD;

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define TO(x,t,f) ((x)?(t):(f))
#define YesNo(a) cout<<TO((a),"Yes","No")<<endl;
#define YESNO(a) cout<<TO((a),"YES","NO")<<endl;

int main(){
	ll N,K,Q;
	cin >> N >> K >> Q;
	ll A[N+1];
	FOR(i,0,N+1)A[i]=-Q+K;
	FOR(i,0,Q){
		ll a;
		cin >> a;
		A[a]++;
	}
	FOR(i,1,N+1){
		YesNo(A[i]>0);
	}
}



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

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

int main() {
  string s, t;
  cin >> s >> t;
  int a, b;
  cin >> a >> b;
  string u;
  cin >> u;
  if(u == s) cout << a-1 << " " << b;
  else cout << a << " " << b-1;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int w = sc.nextInt();
		String out = "";
		for (int i=0;i<s.length();i+=w) {
			out = out + s.charAt(i);
		}
		System.out.println(out);
	}
}


Measured memory_bytes: 24780
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>


int main()
{
	int i,j,k;
	int n,m;

	while(1)
	{
		int a[22][22]={0};
		int d[401][2]={0}; //四方探索候補x,y
		int e=0; //現時点での四方探索候補数
		int f=0; //現時点での四方探索済み数
		char c[21];
		for(i=0;i<22;i++){for(j=0;j<22;j++){a[i][j]=-2;}}

		scanf("%d %d",&n,&m);
		if((n==0)&&(m==0)){break;}
		else
		{
			for(i=0;i<m;i++)
			{
				scanf("%s",c);
				for(j=0;j<n;j++)
				{
					if(c[j]=='.'){a[j+1][i+1]=1;} //1は未探索
					else if(c[j]=='#'){a[j+1][i+1]=-2;} //-2は探索済み＆行けない
					else if(c[j]=='@'){a[j+1][i+1]=-1;d[e][0]=(j+1);d[e][1]=(i+1);e++;} //-1は探索済み＆行ける
				}
			}

			while(e!=f)
			{
				int e1=0;
				int f1=0;
				for(i=f;i<e;i++)
				{
					for(j=0;j<4;j++)
					{
						if(j==0)
						{if(a[d[f+f1][0]+1][d[f+f1][1]]==1){
								a[d[f+f1][0]+1][d[f+f1][1]]=-1;
								d[e+e1][0]=(d[f+f1][0]+1);
								d[e+e1][1]=(d[f+f1][1]);
								e1++;}}
						if(j==1)
						{if(a[d[f+f1][0]-1][d[f+f1][1]]==1){
								a[d[f+f1][0]-1][d[f+f1][1]]=-1;
								d[e+e1][0]=(d[f+f1][0]-1);
								d[e+e1][1]=(d[f+f1][1]);
								e1++;}}
						if(j==2)
						{if(a[d[f+f1][0]][d[f+f1][1]+1]==1){
								a[d[f+f1][0]][d[f+f1][1]+1]=-1;
								d[e+e1][0]=(d[f+f1][0]);
								d[e+e1][1]=(d[f+f1][1]+1);
								e1++;}}
						if(j==3)
						{if(a[d[f+f1][0]][d[f+f1][1]-1]==1){
								a[d[f+f1][0]][d[f+f1][1]-1]=-1;
								d[e+e1][0]=(d[f+f1][0]);
								d[e+e1][1]=(d[f+f1][1]-1);
								e1++;}}
					}
					f1++;
				}
				e+=e1;
				f+=f1;
			}
		}
		printf("%d\n",e);
		}
	return 0;
}

Measured memory_bytes: 604
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
t = [0] * (N + 1)
for _ in range(M):
  u, v = map(int, input().split())
  t[u] += 1
  t[v] += 1
for i in range(1, N + 1):
  if t[i] % 2:
    print("NO")
    exit(0)
print("YES")

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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    ll h,w;cin>>h>>w;
    vvc c(h+2,vc(w+2,'#'));
    rep1(i,h+1)rep1(j,w+1)cin >> c[i][j];
    rep(i,h+2){
        rep(j,w+2){
            cout << c[i][j];
        }
        cout << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;

int N;
int dp[410][410];
int A[410];
int sum[410] = { 0 };
bool F[410][410] = { false };

int f(int l, int r) {
	if (F[l][r])return dp[l][r];
	F[l][r] = 1;
	if (l == r)return 0;
	int fans = LLINF;
	FOR(m, l, r)fans = min(fans, f(l, m) + f(m + 1, r));
	//cout << r << " " << l << " " << sum[r] - sum[l - 1] << endl;
	return dp[l][r] = fans + (sum[r] - sum[l - 1]);
}


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

	cin >> N;
	REP(i, N) {
		cin >> A[i];
		sum[i + 1] = sum[i] + A[i];
	}
	
	cout << f(1, N) << endl;
	/*eREP(i, N) {
		eREP(j, N)cout << dp[i][j] << " ";
		cout << endl;
	}*/
	return 0;
}



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

using namespace std;

#define int long long
#define MOD 1000000007

#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 rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()

#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T>
void print(T x)
{
    std::cout << x << '\n';
}

//typedef long long ll;

signed main()
{
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i, n)
    {
        cin >> a[i];
    }

    int c = min(k, 100ll);

    rep(i, c)
    {
        vector<int> b(n, 0);
        rep(j, n)
        {
            int l = max(0ll, j - a[j]);
            int r = min(n - 1, j + a[j]);
            b[l]++;
            if (r + 1 < n)
                b[r + 1]--;
        }
        rep(j, n - 1)
        {
            b[j + 1] += b[j];
        }
        rep(j, n)
        {
            a[j] = b[j];
        }
    }

    rep(i, n)
    {
        cout << a[i] << " ";
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 6432
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	int k, x;
	cin >> k >> x;
	for (int i = x - (k - 1); i < x + k ; i++) {
		cout << i;
		if (i == x + (k - 1)) {
			cout << endl;
		}
		else cout << ' ';
	}
	return 0;
}

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

int main() {
    int n;
    string s;
    cin>>n>>s;
    ll ans = 0;
    ll cor = 0;
    ll cog = 0;
    ll cob = 0;
    rep(i,n){
        if(s[i]=='R'){
            cor++;
        }else if(s[i]=='G'){
            cog++;
        }else{
            cob++;
        }
    }
    ans = cor * cog * cob;
    ll except = 0;
    for(int i = 0;i<n-2;i++){
        for(int j = i+1;j<n-1;j++){
            int k=j+(j-i);
            if(k>=n){
                break;
            }
            if(s[i]!=s[j]&&s[i]!=s[k]&&s[j]!=s[k]){
                except++;
            }
        }
    }
    ans = ans - except;
    cout<<ans<<endl;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
void solve()
{
    int n;
    cin>>n;
    cout<<(n+1)/2<<endl;
}
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    // int _t;cin>>_t;while(_t--)
    solve();
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		solver.readS(in.readLine());
		// for (; solver.hasNext();) {
		// solver.readBody(in.readLine());
		// }
		// solver.solve();
	}
}

class Solver {
	int N;
	int cnt;

	public void init() {
		N = 0;
		cnt = 0;
	}

	public void readHead(String str) {
		String[] strArr = str.split("\\s+");
		N = Integer.parseInt(strArr[0]);
		// System.out.println(N);
	}

	public void readS(String str) {
		int ans = 0;
		char prev = ' ';
		for (int i = 0; i < N; i++) {
			if (str.charAt(i) == prev)
				continue;
			ans++;
			prev = str.charAt(i);
		}
		System.out.println(ans);
	}

	public boolean hasNext() {
		return cnt < N;
	}

	public void readBody(String str) {
		// System.out.println(str);
		cnt++;
	}

	public void solve() {

	}
}


Measured memory_bytes: 23124
n = int(input())
v = list(map(int,input().split()))

v1 = []
v2 = []

j=0
for i in range(int(n/2)):
    v1.append(v[j])
    j+=2
    
j=0
for i in range(int(n/2)):
    v2.append(v[j+1])
    j+=2

import collections

v1n = collections.Counter(v1)
v2n = collections.Counter(v2)

if v1n.most_common()[0][0] != v2n.most_common()[0][0]:
    print(n - v1n.most_common()[0][1] - v2n.most_common()[0][1])
else:
    if len(v1n) == 1 and len(v2n) == 1:
        print(int(n/2))
    else:
        xxx=(len(v1)-v1n.most_common()[0][1])+(len(v2)-v2n.most_common()[1][1])
        yyy=(len(v1)-v1n.most_common()[1][1])+(len(v2)-v2n.most_common()[0][1])
        print(min(xxx,yyy))

Measured memory_bytes: 19040
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }


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

    int N, A, B; cin >> N >> A >> B;
    vel v(N); rep(i,N) cin >> v[i];
    sort(rall(v));
    ll comb[51][51];
    for(int i = 0; i <= 50; i++){
        comb[i][0] = 1;
        comb[i][i] = 1;
    }
    for(int i = 1; i <= 50; i++){
        for(int j = 1; j <= i - 1; j++){
            comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
        }
    }

    ll sum = 0LL;
    rep(i,A) sum += v[i];
    ld av = (ld) sum / A;
    cout << fixed << setprecision(20) << av << endl;
    ll key = v[A-1]; int cnt = 0; int choice = 0;
    rep(i,N) if(v[i] == key) cnt++;
    rep(i,A) if(v[i] == key) choice++;
    ll ans = 0LL;
    if(v[0] != v[A-1]) cout << comb[cnt][choice] << endl;
    else {
        for(int i = A; i <= B;i++) {
            ans += comb[cnt][i];
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int N, K;
vector<int> h;

int dp[101010];

int Solve(int pos)
{
    if (dp[pos] >= 0) return dp[pos];

    if (pos == N - 1) return 0;
    if (pos >= N) return inf;

    int res = inf;
    rep(i, 1, K + 1)
    {
        if (pos + i <= N - 1)
        {
            chmin(res, abs(h[pos] - h[pos + i]) + Solve(pos + i));
        }
    }
    return dp[pos] = res;
}

void _main()
{
    memset(dp, -1, sizeof(dp));
    cin >> N >> K;
    h.resize(N);
    rep(i, 0, N) cin >> h[i];
    cout << Solve(0) << endl;
}


Measured memory_bytes: 8832
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPS(i, n) for (int i = 1; i <= n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define IHF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
    int H, W;
    cin >> H >> W;
    vector<vector<char>> table(H + 2, vector<char>(W + 2, '#'));
    REPS(i, H)
    {
        REPS(j, W)
        {
            cin >> table.at(i).at(j);
        }
    }
    vector<vector<int>> cost(H + 2, vector<int>(W + 2, 0));

    REP(i, H + 2)
    {
        int tmp;
        bool flg = false;
        REP(j, W + 2)
        {
            if (flg && table.at(i).at(j) == '#')
            {
                FOR(k, tmp, j)
                {
                    cost.at(i).at(k) = j - tmp;
                }
                flg = false;
            }
            else if (!flg && table.at(i).at(j) != '#')
            {
                tmp = j;
                flg = true;
            }
        }
    }
    REP(j, W + 2)
    {
        int tmp;
        bool flg = false;
        REP(i, H + 2)
        {
            if (flg && table.at(i).at(j) == '#')
            {
                FOR(k, tmp, i)
                {
                    cost.at(k).at(j) += i - tmp;
                }

                flg = false;
            }
            else if (!flg && table.at(i).at(j) != '#')
            {
                tmp = i;
                flg = true;
            }
        }
    }
    int maxval = -1;
    REP(i, H + 2)
    {
        REP(j, W + 2)
        {
            if (maxval < cost.at(i).at(j))
            {
                maxval = cost.at(i).at(j);
            }
            // cout << cost.at(i).at(j);
        }
        // cout << "\n";
    }
    cout << maxval - 1 << "\n";
}

Measured memory_bytes: 19968
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

const long MOD = 10^^9 + 7;

void main() {
    auto N = readln.chomp.to!int;
    auto A = 2.iota.map!(_ => readln.split.map!(to!long).array).array;

    foreach (j; 0..N-1) {
        A[0][j+1] += A[0][j];
    }

    for (int j = N-1; j > 0; --j) {
        A[1][j-1] += A[1][j];
    }

    long ans = 0;
    foreach (i; 0..N) {
        ans = max(ans, A[0][i] + A[1][i]);
    }

    ans.writeln;
}


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

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repe(i,a,b) for(ll i=a;i>=b;i--)

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define ll long long
#define ld long double

#define V vector<ll>
#define pp pair<ll,ll>
#define pb push_back
#define mp make_pair
#define Pr pair<ll,ll>
#define all(A) A.begin(),A.end()
#define allr(A) A.rbegin().A.rend()

#define ff first
#define ss second
#define len length()
ll max3(ll a,ll b,ll c)
{
    if(a>=b&&a>=c)
        return a;
    else if(b>=a&&b>=c)
        return b;
    else
        return c;
}
int min3(int a,int b,int c)
{
    if(a<=b&&a<=c)
        return a;
    else if(b<=a&&b<=c)
        return b;
    else
        return c;
}
int binarySearch(ll arr[], int l, int r, int x)
{
    if (r >= l) {
        int mid = l + (r - l) / 2;

        if (arr[mid] == x)
            return mid;

        if (arr[mid] > x)
            return binarySearch(arr, l, mid - 1, x);


        return binarySearch(arr, mid + 1, r, x);
    }

    return -1;
}
int main()
{
	fast;

      int n;
      cin>>n;
      double a[n],sum=0.0;
      rep(i,0,n)
      {
          cin>>a[i];
          sum=sum+1.00/a[i];
      }
      double ans=1.0/sum;
      cout<<fixed<<setprecision(5)<<ans<<endl;

    return 0;
}


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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var a = array[0];
            var b = array[1];

            var aString = new string(Enumerable.Repeat(a.ToString()[0], b).ToArray());
            var bString = new string(Enumerable.Repeat(b.ToString()[0], a).ToArray());

            if (aString.CompareTo(bString) < 0)
            {
                Console.WriteLine(aString);
            }
            else
            {
                Console.WriteLine(bString);
            }
        }
    }
}


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

int main()
{
	bool flag = true;
	string s;
	cin >> s;
	for (int i = s.size() - 1; i >= 0; i--) {
		if (i >= 6 && s.substr(i - 6, 7) == "dreamer") {
			i -= 6;
		}
		else if (i >= 4 && s.substr(i - 4, 5) == "dream") {
			i -= 4;
		}
		else if (i >= 5 && s.substr(i - 5, 6) == "eraser") {
			i -= 5;
		}
		else if (i >= 4 && s.substr(i - 4, 5) == "erase") {
			i -= 4;
		}
		else {
			cout << "NO" << endl;
			flag = false;
			break;
		}
	}
	if (flag) {
		cout << "YES" << endl;
	}
	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main(){
    int h1,m1,h2,m2,k;
    cin>>h1>>m1>>h2>>m2>>k;
    int t1=h1*60+m1,t2=h2*60+m2;
    t2-=k;
    cout<<max(0,t2-t1);
}

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

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const LL mod = 1000000007;

int main()
{
    int N;
    LL K;
    cin >> N >> K;
    vector<PII> ab(N);
    REP(i, N) cin >> ab[i].first >> ab[i].second;

    sort(ab.begin(), ab.end());

    int ans = 0;
    LL si = 0;
    REP(i, N) {
        if (si+ab[i].second >= K) {
            ans = ab[i].first;
            break;
        } 
        si += ab[i].second;
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<set>
#include<map>

using namespace std;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define PRINT(str) printf(#str "\n")
#define yOUT PRINT(Yes)
#define nOUT PRINT(No)
#define YOUT PRINT(YES)
#define NOUT PRINT(NO)
 
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

int main(){
  string s;
  cin >> s;
  bool a[4] = {};
  for(int i = 0; i < s.size();i++){
    if(s[i] == 'E') a[0] = 1;
    if(s[i] == 'W') a[1] = 1;
    if(s[i] == 'N') a[2] = 1;
    if(s[i] == 'S') a[3] = 1;
  }
  
  if(a[0] == a[1] && a[2] == a[3]) cout << "Yes" << endl;
  else cout << "No" << endl;	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define DEBUG if(0)
#define lli long long int
#define ldouble long double
using namespace std;

int digits(int num)
{
  int d = num == 0;
  while (num)
    num /= 10, d ++;
  return d;
}

int main()
{
  int n, m;
  while (scanf("%d %d", &n, &m) != EOF)
  {
    vector<int> ans(n, -1);
    bool can = true;
    while (m --)
    {
      int s, c; scanf("%d %d", &s, &c);
      if (ans[s - 1] != -1 && ans[s - 1] != c)
        can = false;
      ans[s - 1] = c;
    }

    if (ans[0] == -1)
      ans[0] = n == 1 ? 0 : 1;
    for (int i = 1; i < n; i ++)
      if (ans[i] == -1)
        ans[i] = 0;
    reverse(ans.begin(), ans.end());

    int num = 0;
    for (int i = 0, p = 1; i < n; i ++, p *= 10)
      num += p * ans[i];
    if (can)
      can = digits(num) == n;
    printf("%d\n", can ? num : -1);
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	static Scanner scan = new Scanner(System.in);

	public static void main(String[] args) {
		
		int n = scan.nextInt();
		int a = n;
		int sn = 0;
		while(a != 0) {
			sn += a % 10;
			a /= 10;
		}
		if(n % sn == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

}


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

using namespace std;

int main(){
  int n,uv[2],m;
  cin>>n>>uv[0]>>uv[1]>>m;
  if(n==1){
    uv[0]*=4;
    uv[1]*=4;
  }
  static int x[2][1000001],y[2][1000001];
  fill(x[0],x[2],-1);
  fill(y[0],y[2],-1);
  for(int i=0;i<2;i++){
    for(int j=0;j<n;j++){
      for(int k=0;k<n;k++){
	int d;
	cin>>d;
	x[i][d]=k;
	y[i][d]=j;
      }
    }
  }
  int ny[2][500]={},nx[2][500]={},ns[2]={},nbs[2]={};
  for(int i=0;i<m;i++){
    int c;
    cin>>c;
    for(int p=0;p<2;p++){
      if(x[p][c]>=0){
	nx[p][x[p][c]]++;
	uv[p]-=nx[p][x[p][c]]==n;
	ny[p][y[p][c]]++;
	uv[p]-=ny[p][y[p][c]]==n;
	if(x[p][c]==y[p][c]){
	  nbs[p]++;
	  uv[p]-=nbs[p]==n;
	}
	if(x[p][c]+y[p][c]==n-1){
	  ns[p]++;
	  uv[p]-=ns[p]==n;
	}
      }
    }
    if(uv[0]<=0&&uv[1]<=0){
      break;
    }else if(uv[0]<=0||uv[1]<=0){
      cout<<((uv[1]<=0)?"NEKO":"USAGI")<<endl;
      return 0;
    }
  }
  cout<<"DRAW"<<endl;
  return 0;
}

Measured memory_bytes: 16788
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        long k = sc.nextLong();
        sc.close();
        long ans = 0;
        if (a >= k) {
            ans = k;
        } else if (a + b >= k) {
            ans = a;
        } else if (k > a + b) {
            ans = a - (k - a - b);
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 35532
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a) for(int i=0;i<(a);i++)
const ll MOD=1000000007;
//const ll MOD=998244353;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int N,M; cin>>N>>M;
  if(N>M) cout<<"No\n";
  else cout<<"Yes\n";
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const ll LINF = 1001001001001001;
const int MOD = 1000000007;

template <typename T>
void print(const T &v);

int main()
{
    int n, m, q;
    cin >> n >> m >> q;
    vector<vector<int>> G(n + 1, vector<int>(n + 1, 0));
    for (int i = 0; i < m; i++)
    {
        int l, r;
        cin >> l >> r;
        G[r][l]++;
    }
    for (int i = 0; i < n + 1; i++)
    {
        for (int j = 0; j < n; j++)
        {
            G[i][j + 1] += G[i][j];
        }
    }
    for (int j = 0; j < n + 1; j++)
    {
        for (int i = 0; i < n; i++)
        {
            G[i + 1][j] += G[i][j];
        }
    }
    // for (auto g : G)
    // {
    //     print(g);
    // }
    for (int i = 0; i < q; i++)
    {
        int a, b;
        cin >> a >> b;
        cout << G[b][b] - G[b][a - 1] << endl;
    }
    return 0;
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}

Measured memory_bytes: 4564
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 1e5 + 5;

int32_t main()
{
	IOS;
	string a, b;
	cin >> a >> b;
	int ans = 0;
	for(int i = 0; i < a.size(); i++)
		ans += (a[i] != b[i]);
	cout << ans;
	return 0;
}

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

int main(){
   int n;
   cin>>n;
   double ans=0;
   for(int i=0;i<n;i++){
       double x;
       string s;
       cin>>x>>s;
       if(s=="BTC"){
           ans+=380000.0*x;
       }
       else ans+=x;
   }
   printf("%lf\n",ans);
   
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long
#define INF 2147483647

int main()
{
    int w[8],c[8]={1,2,1,2,1,4,1,4},dict[8]={0,2,6,4,1,3,7,5};
    while(1)
    {
	int r[8]={0},m=INF;
	rep(i,8)if (!(cin >> w[i]))return 0;
	rep(i,8)
	{
	    rep(j,8)
	    {
		r[i]+=max(0,w[j]-c[j]);
	    }
	    m=min(m,r[i]);
	    rep(j,7)swap(c[j],c[j+1]);
	}
	rep(i,8)
	{
	    if (r[dict[i]] == m)
	    {
		rep(j,8)
		{
		    cout << c[(dict[i]+j)%8];
		    if (j!=7)cout << " ";
		}
		cout << endl;
		break;
	    }
	}
    }
    return 0;
}

Measured memory_bytes: 868
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
#include <cmath>
using namespace std;

void solve(){
  int n; cin >> n;
  map<int, int> mp;
  for(int i = 0; i < n; i++){
    int x; cin >> x;
    mp[x]++;
  }
  int ans = 0;
  for(auto itr = mp.begin(); itr != mp.end(); itr++){
    if(itr->second % 2 != 0) ans++;
  }
  cout << ans << endl;
  return;
}

int main(){
  solve();
  return 0;
}


Measured memory_bytes: 4864
#include <iostream>

int main() {

	int A, B, C, D;

	std::cin >> A >> B >> C >> D;

	if (A + B > C + D) {
		std::cout << "Left" << std::endl;
	}
	else if (A + B == C + D) {
		std::cout << "Balanced" << std::endl;
	}
	else if (A + B < C + D) {
		std::cout << "Right" << std::endl;
	}
}

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

#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

using namespace std;

typedef long long LL;

LL INF = 1 << 30;  // (2^10)^3 > 10^9

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
    os << "[ ";
    REP(i, vec.size()) {
        os << vec[i] << " ";
    }
    os << "]";

    return os;
}

void print(int* A, int n) {
    REP(i, n) {
        if (i > 0) cout << " ";
        cout << A[i];
    }
    cout << endl;
}

int merge(int*A, int left, int mid, int right) {
    int cmp = 0;

    int n1 = mid - left, n2 = right - mid;
    int L[n1 + 1], R[n2 + 1];

    REP(i, n1) L[i] = A[left + i];
    REP(i, n2) R[i] = A[mid + i];

    L[n1] = INF; R[n2] = INF; // sentinel

    int i = 0, j = 0;

    FOR(k, left, right) {
        if(L[i] < R[j]) {
            A[k] = L[i];
            ++i;
        } else {
            A[k] = R[j];
            ++j;
        }

        ++cmp;
    }

    return cmp;
}

int mergeSort(int* A, int left, int right) {
    int cmp = 0;

    if ((left + 1) < right) {
        int mid = (right + left) / 2;
        cmp += mergeSort(A, left, mid);
        cmp += mergeSort(A, mid, right);
        cmp += merge(A, left, mid, right);
    }

    return cmp;
}

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

    int n;
    cin >> n;

    int S[n];
    REP(i, n) cin >> S[i];

    int cmp = 0;
    cmp = mergeSort(S, 0, n);

    print(S, n);

    cout << cmp << endl;
}



Measured memory_bytes: 7016
import java.util.Scanner;
public class Main {
	 public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
	        int a,b;

	            a = sc.nextInt();
	            b = sc.nextInt();

	            System.out.printf("%d %d %f",a/b,a%b,(double)a/b);
	            sc.close();
	    }
	}


Measured memory_bytes: 26424
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if(s=="Sunny") {
    cout << "Cloudy" << endl;}
  else if(s=="Cloudy") {
    cout << "Rainy" << endl;}
  else if(s=="Rainy") {
    cout << "Sunny" << endl;}
  return 0;
  }

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define dbg(x) cerr << #x << ": " << x << endl
int main() {
  int n;
  cin >> n;
  cout << (n + 1) / 2 << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define NI NTL
#define H 250

int parent(int);
int Left(int);
int Right(int);

int main(){
  int n,i,p,left,right;
  int P[H];
  scanf("%d", &n);
  for(i = 1;i<=n;i++){
    scanf("%d" , &P[i]);
  }
  for(i = 1;i<=n;i++){
    printf("node %d: key = %d, ",i,P[i]);
    p = parent(i);
  if(p!=0){
    printf("parent key = %d, ", P[p]);
  }
  left = Left(i);
  if(left <= n){
    printf("left key = %d, ", P[left]);
}
  right = Right(i);
    if(right <= n){
      printf("right key = %d, ",P[right]);
    }
    printf("\n");
  }
  
  return 0;
  
}
int parent(int i){
  return i/2;
}
int Left(int i){
  return 2*i;
}
int Right(int i){
  return 2*i+1;
}

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

using namespace std;

#define CIN ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define TEST_CASE(t) for(int zz=1 ; zz<=t ; zz++)
#define PRINT_CASE printf("Case %d: ",zz)
#define Debug(x)            cout<<#x " = "<<(x)<<endl

const int maxn = (int)1e7+5;
typedef long long ll;


bool isPrime[maxn];
ll cnt[maxn];


void sieve(int n){

   for(int i=1 ; i<=n ; i++){
      for(int j=i ; j<=n ;j+=i){
         cnt[j]++;
      }
   }
}

void solve(){
   int n;
   cin >> n;

   sieve(n);
   ll ans = 0LL;
   for(int i=1 ; i<=n ; i++){

      ans += (i*cnt[i]);
   }
   cout << ans << endl;

}


int main()
{
    CIN
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    //cout << "Fi Amanillah" << endl;

    int t=1;
    while(t--){
      solve();
    }


    return 0;
}




Measured memory_bytes: 81704
#include <stdio.h>
#include <algorithm>

using namespace std;

using ll = long long;

ll a[3];

int main()
{
	scanf("%lld %lld %lld", a, a + 1, a + 2);
	sort(a, a + 3);
	if (a[0] % 2 && a[1] % 2 && a[2] % 2)
	{
		printf("%lld\n", a[0] * a[1]);
	}
	else
	{
		printf("0\n");
	}
	return 0;
}



Measured memory_bytes: 128
// AOJ 1258: Book Replacement
// 2017.10.22 bal4u@uu

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct { int stu, seq, id; } T;
T req[5002]; int len;
int desk[12][5001]; int hi[12];
int book[101][2];

int cmp(T *a, T *b)
{
	if (a->seq - b->seq) return (a->seq - b->seq);
	return a->stu - b->stu;
}

int main()
{
	int m, c, n, i, j, id, ans;
	int from, pos, tmp, id2, t;

	while (scanf("%d%d%d", &m, &c, &n) && m > 0) {
		memset(hi, 0, sizeof(hi)), memset(book, 0, sizeof(book));
		tmp = m + 1;
		for (len = i = 0; i < n; i++) {
			scanf("%d", &t); 
			for (j = 0; j < t; j++) {
				scanf("%d", &id);
				req[len].stu = i, req[len].seq = j, req[len++].id = id;
				if (book[id][0] == 0) {
					book[id][0] = tmp, book[id][1] = hi[tmp], desk[tmp][hi[tmp]++] = id;
				}
			}
		}
		qsort(req, len, sizeof(T), cmp);

		for (ans = 0, i = 0; i < len; i++) {
			id = req[i].id;
			from = book[id][0], pos = book[id][1];

			for (j = pos+1; j < hi[from]; j++) {
				t = desk[from][j], book[t][1]--;
				desk[from][j-1] = desk[from][j];
			}
			hi[from]--, ans += from;

			if (hi[1] == c) {
				for (tmp = 2; tmp <= m && hi[tmp] == c; tmp++);
				desk[tmp][hi[tmp]++] = id, ans += tmp;

				id2 = desk[1][0];
				for (j = 1; j < hi[1]; j++) {
					t = desk[1][j], book[t][1]--;
					desk[1][j-1] = desk[1][j];
				}
				hi[1]--, ans++;

				for (j = 2; j <= m && hi[j] == c; j++);
				pos = hi[j]; if (j == tmp) pos--;
				desk[j][pos] = id2; hi[j]++;
				book[id2][0] = j, book[id2][1] = pos;
				ans += j + tmp; hi[tmp]--;
			}
			
			book[id][0] = 1, book[id][1] = hi[1];
			desk[1][hi[1]++] = id, ans++;
		}
		printf("%d\n", ans);
	}
	return 0;
}

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

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

int MOD=1e9+7;
ll INF=1e18;

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

int main(){
    ll n; cin>>n;
    if(1<=n && n<=9){
        cout << n << endl;
        return 0;
    }
    
    int digit=0;
    bool f=true;
    while(n>0){
        digit++;
        if(n%10 != 9) f=false;
        n/=10;

        if(1<=n && n<=9 && f){
            cout << n+9*digit << endl;
            return 0;
        }

        if(n==1) cout << 9*digit << endl;
        else if(2<=n && n<=9) cout << (n-1)+9*digit << endl;
    }
}

Measured memory_bytes: 256
import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * https://abc062.contest.atcoder.jp/tasks/arc074_b
 */
public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int[] a = new int[3*N];
		for(int i=0; i<N*3; i++){
			a[i] = Integer.parseInt(sc.next());
		}
		sc.close();
	
		long[] dpLeft = new long[N+1];
		long[] dpRight = new long[N+1];
		
		PriorityQueue<Integer> que = new PriorityQueue<>();
		long sum = 0;
		for(int i=0; i<N; i++){
			que.add(a[i]);
			sum += a[i];
		}	
		dpLeft[0] = sum;
		for(int i=1; i<=N; i++){
			que.add(a[i+N-1]);
			sum = sum + a[i+N-1] - que.remove();
			dpLeft[i] = sum;
		}
		
		//System.out.println(Arrays.toString(dpLeft));
		
		que = new PriorityQueue<>((o1,o2)->o2-o1);
		sum = 0;
		for(int i=3*N-1; i>=N*2; i--){
			que.add(a[i]);
			sum += a[i];
		}
		dpRight[0] = sum;
		for(int i=1; i<=N; i++){
			que.add(a[2*N-i]);
			sum = sum + a[2*N-i] - que.remove();
			dpRight[i] = sum;
		}
		//System.out.println(Arrays.toString(dpRight));
		
		long ans = Long.MIN_VALUE;
		for(int i=0; i<=N; i++){
			ans = Math.max(ans, dpLeft[i]-dpRight[N-i]);
		}
		
		System.out.println(ans);
		
	}
	

}

Measured memory_bytes: 63896
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

//double cross(double x1,double y1,double x2,double y2)
//{
//	return x1*y2-x2*y1;
//}
#define cross(x1,y1,x2,y2) (x1)*(y2)-(x2)*(y1)

int ccw(double x1,double y1,double x2,double y2,double x3,double y3)
{
	return cross(x2-x1,y2-y1,x3-x1,y3-y1)>0;
}

int main()
{
	//float x,y,a,b,n,m,p,q;
	//int i;
	//for(;~scanf("%f%f%f%f%f%f%f%f",&x,&y,&a,&b,&n,&m,&p,&q);puts(i>2^!i?"YES":"NO"))
	//	i=((p-x)*(b-y)>(q-y)*(a-x))+((p-a)*(m-b)>(q-b)*(n-a))+((p-n)*(y-m)>(q-m)*(x-n));
	
	for(double x,y,a,b,n,m,p,q;scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x,&y,&a,&b,&n,&m,&p,&q)==8;){
		int counter=0;
		//counter+=(p-x)*(b-y)-(q-y)*(a-x)>0;
		//counter+=(p-a)*(m-b)-(q-b)*(n-a)>0;
		//counter+=(p-n)*(y-m)-(q-m)*(x-n)>0;
		counter+=cross(a-x,b-y,p-x,q-y)>=0;
		counter+=cross(n-a,m-b,p-a,q-b)>=0;
		counter+=cross(x-n,y-m,p-n,q-m)>=0;
		
		cout<<(counter%3==0?"YES":"NO")<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <stdio.h>

int Con(int n, int k, int s){
	if(s < 0) return 0;
	if(k > n) return 0;
	if(k == 0) return s == 0 ? 1 : 0;
	return Con(n - 1, k - 1, s - n) + Con(n - 1, k, s);
}

int main (){
	int n, k, s;

	while (1) {
		scanf("%d %d %d", &n, &k, &s);
		if(n == 0 && k == 0 && s == 0)
			return 0;
		printf("%d\n", Con(n, k, s));
	}
}



Measured memory_bytes: 2024