akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <utility>
#include <string.h>
#include <map>
#include <stack>
#include <iomanip>
#include <chrono>
#include <random>
#include <math.h>
#include <time.h>
#include <assert.h>
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define pb push_back 
#define mp make_pair
#define ff first
#define ss second
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define all(x) x.begin(),x.end() 
#define PII pair <ll,ll>
#define N 100005
#define MOD 1000000007
#define INF 1000000000000000000
using namespace std;

vector <int> v[N];
bool vis[N];
int ans = 0, dp[N];
int dfs(int s)
{
	int cur = 0;
	vis[s] = true;
	for (auto g : v[s])
	{
		if(!vis[g])
		{
			dp[g] = dfs(g);
			cur = max(dp[g] + 1, cur);
		}
		else
		{
			cur = max(cur, dp[g] + 1);
		}
	}
	return dp[s] = cur;
}
int main() 
{	
	int n, m, x, y;
	cin >> n >> m;
	for (int i = 0; i < m; ++i)
	{
		cin >> x >> y;
		v[x].push_back(y);
	}
	memset(vis, false, sizeof(vis));
	for (int i = 1; i <= n; ++i)
	{
		if(!vis[i])
			dfs(i);	
	}
	for (int i = 1; i <= n; ++i)
	{
		ans = max(ans, dp[i]);
	}
	cout << ans;
}

Measured memory_bytes: 8192
open Batteries
module EnumL = Enum.Labels
module ListL = List.Labels
module ArrayL = Array.Labels

let dbg0 x = Printf.eprintf "[debug]%s\n" @@ dump x
let dbg1 x = dbg0 x; x

let id = identity

let (++) n m = List.range n `To m
let (++^) n m = if n < m then List.range n `To (pred m) else []

let scan fmt = Scanf.sscanf (read_line ()) fmt

let scan_lines n fmt f =
  if n = 0 then []
  else List.map (fun _ -> scan fmt f) (1 ++ n)

let scan_list sep cnv =
  let line = read_line () in
  (match sep with
   | None -> List.map String.of_char @@ String.to_list line
   | Some sep -> String.split_on_char sep line)
  |> List.map cnv

let scan_array ?sep cnv = Array.of_list @@ scan_list sep cnv

let scan_matrix n m e ?sep conv =
  let arr = Array.make_matrix n m e in
  ListL.iter (0 ++^ n)
    ~f:(fun i -> arr.(i) <- Array.of_list @@ scan_list sep conv);
  arr

let rec powerset e =
  match Enum.get e with
  | None -> Enum.singleton @@ Enum.empty ()
  | Some v ->
    let f = powerset e in
    let g = Enum.clone f in
    EnumL.map f ~f:(fun x -> let y = Enum.clone x in push y v; y)
    |>  Enum.append g

let permutations l =
  let rec aux l =
    let rec interleave x = function
      | [] -> [[x]]
      | (hd::tl) as lst ->
        (x::lst) ::
        (ListL.map ~f:(List.cons hd)  @@ interleave x tl)
    in
    match l with
    | [] -> [[]]
    | hd::tl -> List.concat @@ List.map (interleave hd) @@ aux tl in
  let l = List.sort (List.compare Int.compare) @@ aux @@ List.of_enum l in
  List.enum % ListL.map ~f:List.enum @@ l

let intersection l =
  EnumL.filter ~f:(fun x -> EnumL.exists ~f:((=) x) @@ Enum.clone l)

let lower_bound n f =
  let rec aux l u =
    if u - l > 1 then
      let m = (l + u) / 2 in
      if f m then aux l m
      else aux m u
    else u in aux (-1) n

let between n x m = n <= x && x < m

let (n, m) = scan "%d %d" Tuple.Tuple2.make
let heights = scan_array ~sep:' ' Int.of_string
let routes = scan_lines m "%d %d" Tuple.Tuple2.make

let () =
  let max_heights = Array.make n (-1) in
  ListL.iter routes
    ~f:(fun (a, b) ->
        let a, b = pred a, pred b in
        max_heights.(a) <- max max_heights.(a) heights.(b);
        max_heights.(b) <- max max_heights.(b) heights.(a));
  ArrayL.mapi heights ~f:(fun i h ->
      if h > max_heights.(i) then 1 else 0)
  |> Array.sum
  |> Printf.printf "%d\n"


Measured memory_bytes: 20612
w, h, n = [int(s) for s in input().split()]
temp_list = [[True] * w for _ in range(h)]
for _ in range(n):
    xs, xe, ys, ye = 0, w, 0, h
    x, y, a = [int(s) for s in input().split()]
    if a == 1:
        xe = x
    elif a == 2:
        xs = x
    elif a == 3:
        ye = y
    elif a == 4:
        ys = y
    for i in range(ys, ye):
        for j in range(xs, xe):
            temp_list[i][j] = False
ans = 0
for i in range(h):
    for j in range(w):
        if temp_list[i][j]:
            ans += 1
print(ans)

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

using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, c;
    cin >> n >> c;
    ++n;
    int count = 0;
    for (int i = 0; i < c; ++i) {
        int k;
        cin >> k;
        count += k;
    }
    cout << (count + n - 1) / n << '\n';
}


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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;


long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0,1,1,-1,-1};
int dx[]={0,1,0,-1,1,-1,1,-1};
string alph("abcdefghijklmnopqrstuvwxyz");
char s[100][100];
bool fl=true;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

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

      
      cin>>h>>w;
      rep(i,h)rep(j,w)cin>>s[i][j];
      rep(i,h){
        rep(j,w){
          if(s[i][j]=='#')cout<<"#";
          else{
            rep(k,8){
              int nx=dx[k]+j,ny=dy[k]+i;
              if(nx>=0&&nx<w&&ny>=0&&ny<h){
                if(s[ny][nx]=='#')cnt++;
              }
            }

          cout<<cnt;
          cnt=0;

          }
        }
        cout<<"\n";
      }
     

       
return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <stack>
#include <queue>
#include <cstring>
#include <map>
using namespace std;

int main()
{
    int a,  b;
    cin >> a >> b;
    if(b >= a)
        printf("%d\n", a);
    else
        printf("%d\n", a - 1);
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	static int lcs(String left,String right){

		int left_len = left.length();
		int right_len = right.length();

		int dp[][] = new int[left_len+1][right_len+1];

		for(int i = 0; i <= left_len; i++){
			for(int k = 0; k <= right_len; k++){
				dp[i][k] = 0;
			}
		}

		for(int i = 0; i < left_len; i++){
			for(int k = 0; k < right_len; k++){
				if(left.charAt(i) == right.charAt(k)){
					dp[i+1][k+1] = dp[i][k]+1;
				}else{
					if(dp[i][k+1] >= dp[i+1][k]){
						dp[i+1][k+1] = dp[i][k+1];
					}else{
						dp[i+1][k+1] = dp[i+1][k];
					}
				}
			}
		}

		return dp[left_len][right_len];
	}

	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.nextLine());

		String left,right;

		for(int i = 0; i < N; i++){
			left = sc.nextLine();
			right = sc.nextLine();

			System.out.printf("%d\n", lcs(left,right));
		}
	}
}

Measured memory_bytes: 64788
s=str(input())
if s=="SRS":
  print(1)
  exit()
if "R" not in list(set(list(s))):
  print(0)
  exit()
else:
  if s[1]=="S":
    print(1)
    exit()
  else:
    if s[0]=="S" or s[2]=="S":
      print("2")
      exit()

print("3")

Measured memory_bytes: 9056
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define RREPS(i,n) for(ll (i)=(n);(i)>0;(i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());

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

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

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int N;
    cin >> N;
    vector<int> A(N);
    vector<vector<pair<int,int>>> X(N,vector<pair<int,int>>(0));
    REP(i,N){
        cin >> A[i];
        X[i].assign(A[i],mp(0,0));
        REP(l,A[i]){
            cin >> X[i][l].F >> X[i][l].S;
            X[i][l].F--;
        }
    }
    int count = 0;
    REP(i,exp2(N)){
        bool ok = 1;
        REP(l,N){
            if((i & (1 << l)) != 0){
                REP(k,A[l]){
                    if(X[l][k].S == 0){
                        if((i & (1 << X[l][k].F)) != 0){
                            ok = 0;
                            break;
                        }
                    }else{
                        if((i & (1 << X[l][k].F)) == 0){
                            ok = 0;
                            break;
                        }
                    }
                }
            }
            if(!ok)break;
        }
        if(ok)chmax(count,__builtin_popcountll(i));
    }
    cout << count << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

template <int mod> struct ModInt {
    int x;

    ModInt() : x(0) {}

    ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

    ModInt &operator+=(const ModInt &p) {
        if((x += p.x) >= mod)
            x -= mod;
        return *this;
    }

    ModInt &operator-=(const ModInt &p) {
        if((x += mod - p.x) >= mod)
            x -= mod;
        return *this;
    }

    ModInt &operator*=(const ModInt &p) {
        x = (int)(1LL * x * p.x % mod);
        return *this;
    }

    ModInt &operator/=(const ModInt &p) {
        *this *= p.inverse();
        return *this;
    }

    ModInt operator-() const { return ModInt(-x); }

    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

    bool operator==(const ModInt &p) const { return x == p.x; }

    bool operator!=(const ModInt &p) const { return x != p.x; }

    ModInt inverse() const {
        int a = x, b = mod, u = 1, v = 0, t;
        while(b > 0) {
            t = a / b;
            swap(a -= t * b, b);
            swap(u -= t * v, v);
        }
        return ModInt(u);
    }

    ModInt pow(int64_t n) const {
        ModInt ret(1), mul(x);
        while(n > 0) {
            if(n & 1)
                ret *= mul;
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }

    friend ostream &operator<<(ostream &os, const ModInt &p) {
        return os << p.x;
    }

    friend istream &operator>>(istream &is, ModInt &a) {
        int64_t t;
        is >> t;
        a = ModInt<mod>(t);
        return (is);
    }

    static int get_mod() { return mod; }
};

using mint = ModInt<MOD>;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, a, b;
    cin >> n >> a >> b;
    mint ans = mint(2).pow(n);
    mint aa = 1, bb = 1;
    for(ll i = 0; i < a; i++) {
        aa *= mint(n - i);
    }
    for(ll i = a; i >= 1; i--) {
        aa /= mint(i);
    }
    for(ll i = 0; i < b; i++) {
        bb *= mint(n - i);
    }
    for(ll i = b; i >= 1; i--) {
        bb /= mint(i);
    }
    ans = ans - aa - bb - 1;
    cout << ans << endl;
}

Measured memory_bytes: 256
# include "bits/stdc++.h"
 
using namespace std;
 
#define endl "\n"
typedef long long int ll;
#define f first
#define s second
 
inline void fastio(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
inline void setPrecision(int n){cout.precision(n);}
 
//DEBUG
#define dbg(x) cerr<<(#x)<<": "<<x<<endl
#define dbgV(x) cerr<<(#x)<<": "; for(auto it: x) cerr<<it<<" "; cerr<<endl;
#define dbgS(x) cerr<<(#x)<<": "; for(auto it: x) cerr<<it<<" "; cerr<<endl;
#define dbgM(x) cerr<<(#x)<<": "; for(auto it: x) cerr<<"["<<it.f<<", "<<it.s<<"] "; cerr<<endl;
#define dbg2D(x) cerr<<(#x)<<": \n"; for(auto y: x) { for(auto it: y) cerr<<it<<" "; cerr<<endl; } cerr<<endl;
#define dbgA(x, n) cerr<<(#x)<<": "; for(int i=0;i<n;++i) cerr<<x[i]<<" "; cerr<<endl;
#define dbgVP(x) cerr<<(#x)<<": "; for(auto it: x) cerr<<"["<<it.f<<", "<<it.s<<"] "; cerr<<endl;
 
ll INF = 1e10;
int MOD = 1e9+7;

int main(){
    fastio();

    int n, m;
    cin >> n >> m;

    cout << ((m == n) ? "Yes" :  "No");

    return 0;
}

/*

*/

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

long long int N,A,B;
long long int X[100010];
long long int ans = 0;

int main()
{
    scanf("%lld%lld%lld",&N,&A,&B);
    for(int i = 0; i < N; i++)
    {
        scanf("%lld",&X[i]);
    }
    for(int i = 0; i < N - 1; i++)
    {
        if((X[i + 1] - X[i]) * A > B)
        {
            ans += B;
        }
        else
        {
            ans += A * (X[i + 1] - X[i]);
        }
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 1024
// C - Sentou
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define rep(i, m, n) for (lli i = m; i < (n); i++)
#define repe(i, m, n) for (lli i = m; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((lli)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define _GLIBCXX_DEBUG
const lli INF = 2147483647;
const lli MINF = -2147483648;
const lli LINF = 9223372036854775807;
const lli MOD = 1000000007; //10^9+7
const double PI = acos(-1);
#define SORT(n) sort(n.begin(), n.end())
#define SORTR(n) sort(n.begin(), n.end(), greater<int>())
#define REV(n) reverse(n.begin(), n.end())
#define pb push_back
#define eb emplace_back
#define mp make_pair
#pragma GCC optimize("Ofast")
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vlli = vector<lli>;
using vvli = vector<vlli>;
using vs = vector<string>;
using vvs = vector<vs>;
using vb = vector<bool>;
using vvb = vector<vb>;
using ll = long long;
// vector入力
template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
  for (T &x : vec)
    is >> x;
  return is;
}
// vector出力
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec)
{
  // os << '{';
  for (int i = 0; i < vec.size(); i++)
  {
    os << vec[i] << (i + 1 == vec.size() ? "" : "");
  }
  // os << '}';
  return os;
}
// aよりもbが大きいならばaをbで更新する(更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T &b)
{
  if (a < b)
  {
    a = b; // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する(更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T &b)
{
  if (a > b)
  {
    a = b; // aをbで更新
    return true;
  }
  return false;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  lli a, b, c, t, h, n, w, ans = 0, count = 0;
  string s;
  vector<pair<string, pair<lli, lli>>> pr;
  cin >> n >> t;
  vlli d(n), e(n, 0);
  rep(i, 0, n)
  {
    cin >> d[i];
  }
  rep(i, 1, n)
  {
    if (d[i] < d[i - 1] + t)
    {
      count = d[i] - d[i - 1];
      ans += min(t, count);
    }
    else
    {

      ans += t;
    }
  }
  ans += t;
  cout << ans << endl;
}

Measured memory_bytes: 6280
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <string.h>
#include <fstream>

using namespace std;


#define LL long long
#define N 901000
#define M 3000011
#define MP make_pair
#define Pi acos(-1.0)
#pragma comment(linker,"/STACK:1024000000,1024000000")
#define ls (root << 1)
#define rs (ls | 1)
#define md ((ll+rr)/2)
#define lson ll, md, ls
#define rson md+1, rr, rs
#define mod 1000000007
#define inf 0x3f3f3f3f
#define sqr(x) ((x)*(x))
#define eps 1e-6
#define MP make_pair
#define uLL unsigned long long
LL powmod(LL a,LL b) {LL res=1;a%=mod;for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
#define F(x) ((x)/3+((x)%3 == 1 ? 0 : tb))
#define G(x) ((x)<tb ? (x)*3+1 : ((x) - tb)*3+2)
#define lowbit(x) ((x)&(-x))
#define fi first
#define se second
#define pii pair<int,int>

int gcd(int a,int b){
    while(b){
        int t = a % b;
        a = b;
        b = t;
    }
    return a;
}
LL a[N],mi1[2010][2010];
int main(){
    int n,x;
    scanf("%d%d",&n,&x);
    memset(mi1, 0x3f, sizeof mi1);
    for(int i = 0; i < n; i++) scanf("%lld",&a[i]);
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(j == 0) mi1[i][j] = a[i];
            else{
                mi1[i][j] = min(mi1[i][j-1],a[(i-j+n)%n]);
            }
        }
    }

    LL ans = 1e18;
    for(int i = 0; i < n; i++){
        LL tmp = 0;
        for(int j = 0; j < n; j++)
            tmp += mi1[j][i];
        ans = min(ans,tmp+1LL*i*x);
    }
    cout<<ans<<'\n';
}


Measured memory_bytes: 31872
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)          (x).begin(), (x).end()
#define rep(i, n)       for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, s, t)   for (i64 i = (s), i##_limit = (t); i <= i##_limit; ++i)
#define repr(i, s, t)   for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(Type, ...)  Type __VA_ARGS__; input(__VA_ARGS__)
#ifndef DBG
#define trace(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U> inline bool chmax(T &a, const U &b) { return b > a && (a = b, true); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return b < a && (a = b, true); }
inline i64  sigma(i64 n)            { return (n * (n + 1) >> 1); }
inline i64  updiv(i64 a, i64 b)     { return (a + b - 1) / b; }
inline i64  sqr(i64 n)              { return n * n; }
inline string to_string(char c)     { return string(1, c); }
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> make_v(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}
template <class T, class... Args>
inline auto make_v(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initValue, args...))>(sz, make_v<T>(initValue, args...));
}

inline void input() {}
template <class Head, class... Tail>
inline void input(Head &head, Tail&... tail) { cin >> head; input(tail...); }

inline void print() { cout << "\n"; }
template <class Head, class... Tail>
inline void print(Head &&head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<< (ostream &out, const vector<T> &vec) {
    static constexpr const char *delim[] = { " ", "" };
    for (const auto &e : vec) out << e << delim[&e == &vec.back()];
    return out;
}

template <typename Func>
struct FixPoint : Func {
    inline constexpr FixPoint(Func &&f) noexcept : Func(forward<Func>(f)) {}

    template <typename... Args>
    inline decltype(auto) operator()(Args &&... args) const {
        return Func::operator()(*this, forward<Args>(args)...);
    }
};

template< typename Func >
inline decltype(auto) makeFixPoint(Func &&f) {
    return FixPoint< Func >{forward< Func >(f)};
}
// }}} End Header

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

    var(int, n);
    print(n * n);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll AMAX = 100000;
ll cnt[AMAX + 1];

int main(void) {
    int N;
    ll K;
    cin >> N >> K;
    for (int i = 0; i < N; ++i) {
        int A, B;
        cin >> A >> B;
        cnt[A] += B; }
    for (int ans = 1; ans <= AMAX; ++ans){
        if (K <= cnt[ans]) {
            cout << ans << endl;
            break;
        }
        K -= cnt[ans];
    }

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
vector<int> ch[100005];
int K, ans;
int go(int x) {
	int mx = 0;
	for (int y : ch[x]) {
		int h = go(y) + 1;
		if (h == K && x != 1) ++ans;
		else mx = max(mx, h);
	}
	return mx;
}
int main() {
	int N;
	scanf("%d%d", &N, &K);
	for (int i = 1; i <= N; ++i) {
		int p;
		scanf("%d", &p);
		if (i == 1 && p != 1) ++ans;
		if (i != 1) ch[p].push_back(i);
	}
	go(1);
	printf("%d\n", ans);
}


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

using namespace std;
typedef long long LL;
const int MaxN = 1e5;




string s;

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


Measured memory_bytes: 256
h,w=map(int,input().split())
l=[]
l.append(['#' for i in range(w+2)])
for i in range(h):
  l.append(list('#'+input()+'#'))
l.append(['#' for i in range(w+2)])
ctw=0
for i in range(1,h+1):
  for j in range(1,w+1):
    if l[i][j]=='.':ctw+=1
L=[[1,1]]
ct=0
x=0
for i in range(h*w):
  L2=[]
  for j in range(len(L)):
    L3=[[L[j][0]-1,L[j][1]],[L[j][0]+1,L[j][1]],[L[j][0],L[j][1]-1],[L[j][0],L[j][1]+1]]
    for k in range(4):
      if l[L3[k][0]][L3[k][1]]=='.':
        L2.append(L3[k])
        l[L3[k][0]][L3[k][1]]='#'
  ct+=1
  L=L2
  if [h,w] in L:
    x=ct
    break
if x==0:print(-1)
else:print(ctw-ct-1)

Measured memory_bytes: 41712
import heapq

n,m = map(int,input().split())
a = list(map(int,input().split()))
all =  sum(a)


a1 = list(map(lambda x: x*(-1), a))  # 各要素を-1倍
heapq.heapify(a1)

flg=0
for i in range(m):
    tmp = -1*(heapq.heappop(a1))
    if(tmp*m*4 >= all):
        continue
    else:
        flg=1
        break
if(flg==0):
    print("Yes")
else:
    print("No")

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

int main() {
  int A,B;
  cin >> A >> B;
  if (B >= 0) {
    cout << max(A+B,A*B) << endl;
  }
  else {
    cout << max(A-B,A*B) << endl;
  }
}

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

public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int n = Integer.parseInt(chr[0]);
			 System.out.println(n%2 == 0 ? n/2 : (n+1)/2);
		}
	}
}

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

int min(int a,int b,int c){
    int asdf=a;
    if(asdf>b){asdf=b;}
    if(asdf>c){asdf=c;}
    return asdf;
}



int main(void){
int n,a,b,p[105];
int one=0,two=0,three=0;
scanf("%d",&n);
scanf("%d %d",&a,&b);

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

for(int i=0;i<n;i++){
if(p[i]<=a){one++;}
else if(a+1<=p[i]&&p[i]<=b){two++;}
else {three++;}
}

printf("%d",min(one,two,three));
}


Measured memory_bytes: 128
import math
N,K=map(int,input().split())
count=[]
no_count=[]


for i in range(1,N+1):
    if K>i and math.floor(math.log2(K/i))!=math.ceil(math.log2(K/i)):
        count.append((1/N)*((1/2)**(1+int(math.log2(K/i)))))
    elif K>i and math.floor(math.log2(K/i))==math.ceil(math.log2(K/i)):
        count.append((1 / N) * ((1 / 2) ** (int(math.log2(K / i)))))
    else:
        no_count.append(1/N)
print(sum(count)+sum(no_count))


Measured memory_bytes: 6232
function main()
	N = parse(Int, readline())
	arr = [parse.(Int,split(readline())) for _=1:N]
	pushfirst!(arr, [0,0,0])
	
	can = true
	for i= 1:N
		dt = arr[i+1][1] - arr[i][1]
		dist = abs(arr[i+1][2] - arr[i][2]) + abs(arr[i+1][3] - arr[i][3])
		if dt < dist; can = false;end
		if dt%2 != dist%2;can = false; end
	end

	print(can ? "Yes" : "No")
	
end

main()

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

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
 for (int i=0; i<N; i++){
   cin >>vec.at(i);
}
  sort(vec.begin(),vec.end());
  int a=N;
    for(int i=0; i<N-1; i++){
     
       if(vec.at(i) == vec.at(i+1)){
        a--;
      }
    }
  cout << a << endl;
}
    


Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

#define INF 1000000000000

signed main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];

    int x2 = 0;
    for(int i = 0; i < n; i++) {
        if(i % 2) x2 -= a[i];
        else x2 += a[i];
    }

    vector<int> ans(n);
    ans[0] = x2 / 2;
    for(int i = 0; i < n - 1; i++) {
        ans[i + 1] = a[i] - ans[i];
    }
    for(int i = 0; i < n; i++) ans[i] *= 2;
    for(int i = 0; i < n; i++) printf("%d%c", ans[i], i == n-1 ? '\n' : ' ');
    return 0;
}


Measured memory_bytes: 2048
import sys
def input():
	return sys.stdin.readline().strip()

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

i = 2
yakusu = [[0, 0]]
num = 0
while i < M**0.5 + 1:
	if M % i == 0:
		num += 1
		M = M // i
		if yakusu[-1][0] == i:
			yakusu[-1][1] += 1
		else:
			yakusu.append([i, 1])
	else:
		num = 0
		i += 1
if M == yakusu[-1][0] and M != 1:
	yakusu[-1][1] += 1
elif M != 1:
	yakusu.append([M, 1])

mod = 1000000007
pow = [1]

def comb(a, b):
	ans = 1
	for i in range(a, b, -1):
		ans *= i
	for i in range(1, a - b + 1):
		ans = ans // i
	ans = ans % mod
	return  ans

total = 1
for i in range(1, len(yakusu)):
	total *= comb(N + yakusu[i][1] - 1, N - 1)
	total = total % mod


print(total)

Measured memory_bytes: 38768
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut 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:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: i32,
        a: [i32; n],
    };
    let mut b = a.clone();
    b.sort_by(|a, b| b.cmp(a));
    println!(
        "{}",
        b.iter()
            .enumerate()
            .map(|(i, &v)| if i % 2 == 0 { v } else { -1 * v })
            .sum::<i32>()
    );
}


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

int n;
vector<int> to[200005];
vector<int> dist;

void dfs(int v, int d = 0, int p = -1){
    dist[v] = d;
    for(int u : to[v]){
        if(u == p) continue;
        dfs(u, d+1, v);
    }
}

vector<int> calcDist(int s){
    dist = vector<int>(n);
    dfs(s);
    return dist;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    for(int i = 0; i < n-1; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    vector<int> distF = calcDist(0);
    vector<int> distS = calcDist(n-1);
    int Fen = 0, Snu = 0;
    for(int i = 0; i < n; i++){
        if(distF[i] <= distS[i]) Fen++;
        else Snu++;
    }
    cout << (Fen > Snu ? "Fennec" : "Snuke") << endl;
    return 0;
}


Measured memory_bytes: 13952
import java.util.Scanner;

public class Main{

    public static void main(String args[]){
		solve();
    }
	
	private static void solve(){
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int A = sc.nextInt();
		if(H%A == 0){
			System.out.println(H/A);
		}else{
			System.out.println(H/A + 1);
		}
	}
}

Measured memory_bytes: 21844
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main()
{
    long long a, x = 0, i;
    cin >> a;
    for(i = 1; i <= a;i++){
        if((i%3==0)||(i%5==0))
            continue;
        else 
            x+=i;}
    cout << x << endl;

}

Measured memory_bytes: 3632
import cmath
import numpy as np
import sys

INF=1**18
MOD=10**9+7
MAX=10**5

def moP(x,n):
    res=1
    while n>0:
        if n & 1:
            res=res*x%MOD
        x=x*x%MOD
        n>>=1
    return res

def moF(n):
    res=1
    for i in range(1,n+1):
        res=res*i%MOD
    return res


def C(n,k):
    if n==0 or n==k:
        return 1
    return moF(n)*moP(moF(k), MOD-2)%MOD*moP(moF(n-k), MOD-2)%MOD

def main():
    x,y=map(int, input().split())

    if (x+y)%3:
        print(0)
        exit()

    N=(x+y)//3
    if x<N or y<N:
        print(0)
        exit()

    K=min(x,y)-N
    print(C(N,K))

if __name__=='__main__':
    main()







Measured memory_bytes: 14080
# from : https://twitter.com/tempura_cpp/status/1094238517784326144

S = input()
N = len(S)
MOD = 998244353

red = []
blue = []

for i in range(N):
    if S[i] == "0": # two red balls 
        red.append(i)
        red.append(i)
    if S[i] == "1": # red, blue
        red.append(i)
        blue.append(i)
    if S[i] == "2": # two blue 
        blue.append(i)
        blue.append(i)

DP = [ [0]*4020 for _ in range(4020)] # DP[rsize][bsize] : # of patterns for 
                                           # the case red size is i, blue size is j. 
                                                        
DP[0][0] = 1                          # S = "" pattern.

rsize = len(red)
bsize = len(blue)
# print("red: {}, blue: {}".format(red, blue))

# S = 12001021211100201020
# red:  [0, 2, 2, 3, 3, 4, 5, 5, 7, 9, 10, 11, 12, 12, 13, 13, 15, 15, 16, 17, 17, 19, 19], 
# blue: [0, 1, 1, 4, 6, 6, 7, 8, 8, 9, 10, 11, 14, 14, 16, 18, 18]

# sample
# b r r r r r b
# b r r r r r b
# blue : [0,0, 6,6]
# red  : [1,1,2,2,3,3,4,4,5,5]
# it is hard to use blue[2] = 6, you have to use red 1-5
# this constraint is represented with m = i+j


for i in range(rsize+1):
    for j in range(bsize+1):

        DP[i][j] %= MOD

        m = i+j

        if j < bsize and blue[j] <= m:
            DP[i][j+1] += DP[i][j]

        if i < rsize and red[i] <= m:
            DP[i+1][j] += DP[i][j]


print(DP[rsize][bsize] % MOD)




Measured memory_bytes: 169564
#define _USE_MATH_DEFINES

#include <vector>
#include <list>
#include <map>
#include <string>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <utility>
#include <ctgmath>
#include <queue>
#include <set>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
const ll mod = 1000000007;
const ll inf = 10e17;
const ld eps = 10e-9;



ll solve(void);
ll gcd(ll x, ll y);

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

ll power(ll n, ll r)
{
	if ( r == 0 ) { return 1; }
	if ( r == 1 ) { return n; }
	if ( n == 0 ) { return 0; }
	if ( n == 1 ) { return 1; }

	if (r % 2 == 0)
	{
		ll y = pow(n, r/2);
		return y * y;
	}
	else
	{
		ll y = pow(n, (r-1)/2);
		return n * y * y;
	}


}

ll gcd(ll x, ll y)
{
	if (y == 1) { return 1;}
	if (x % y == 0) { return y; }
	return gcd(y, x % y);
}


ll solve(void)
{
	ll n;
	ll k;
	cin >> n >> k;

	for (ll i = 0; i < 60; i++)
	{
		if (power(k, i) <= n && n < power(k, i + 1))
		{
			cout << i + 1 << endl;
			break;
		}
	}

	return 0;
}



Measured memory_bytes: 256
/*
  The Island Was Silent before.
  .....
  And One day again it became Silent.
*/
#include<bits/stdc++.h>
using namespace std;
 
#define endl '\n'
#define ll  long long
#define modd(a,b) ((a+2*b)%b)
#define debug(a) cout << #a << ": " << (a) << "\n"
#define ioso ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define rtt cerr << "Time: " << clock()*1.0 / CLOCKS_PER_SEC << endl;
#define ffe freopen("input.txt","r",stdin), freopen("output.txt","w",stdout);
 
int main() {
  ioso
  #ifndef ONLINE_JUDGE
  ffe
  #endif
  ll n; cin >> n;
  if(n>=30) {
    cout << "Yes\n";
  }
  else {
    cout << "No\n";
  }
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
main()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	while(a>0 && c>0)
	{
		c=c-b;
		if(c<=0)
		{
			break;
		}
		a=a-d;
		if(a<=0)
		{
			break;
		}
	}
	if(a<=0)
	cout<<"No"<<endl;
	else
	{
		cout<<"Yes"<<endl;
	}
	
	
}


Measured memory_bytes: 3568
H, W = gets.chomp.split.map(&:to_i)
S = H.times.map{gets.chomp}

(0...H).map{|i|
    puts (0...W).map{|j|
        if S[i][j] == "." then
            hs, he = [i-1, 0].max, [i+1, H-1].min
            ws, we = [j-1, 0].max, [j+1, W-1].min
            (hs..he).inject(0){|sum, v| sum += S[v][ws..we].count("#"); sum}.to_s
        else
            S[i][j]
        end
    }.join
}

Measured memory_bytes: 1788
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
import collections
import itertools
import bisect
mod = 10 ** 9 + 7
N, K, Q = list(map(int, input().split()))
A = [0]*Q
for q in range(Q):
    A[q] = int(input())
# 自分以外の人がK回答えたら敗退
seikai_num = [0]*(N+1)

for a in A:
    seikai_num[a] += 1
# print(seikai_num)

for seikai in seikai_num[1:]:
    if (Q - seikai >= K):
        print('No')
    else:
        print('Yes')


Measured memory_bytes: 18428
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1000005;

ll tab[N];

 int main()
 {
	ll n,a,b,i;
	ll k;
	scanf("%lld%lld",&n,&k);

	for(i=1;i<=N-5;i++) tab[i]=0;

	for(i=1;i<=n;i++)
	{
		scanf("%lld%lld",&a,&b);
		tab[a]+=b;
	}

	ll wn;
	wn=0;

	for(i=1;i<=N-5;i++)
	{
		wn+=tab[i];
		if(wn>=k)
		{
			printf("%lld\n",i);
			return 0;
		}
	}

	return 0;	
 }


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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

template<class T>
bool ChangeMax(T&a,const T&b){
  if(a >= b) return false;
  a = b;    return true;
}

template<class T>
bool ChangeMin(T&a,const T&b){
  if(a <= b) return false;
  a = b;    return true;  
}

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  int k,a,b; cin >> k >> a >> b;
  for(int i = a; i <= b; ++i){
    if(i % k == 0) {
      cout << "OK" << endl;
      return 0;
    }  
  }
  cout << "NG" << endl;
  return 0;
}


Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// BIT
template< typename T >
struct BIT {
  int N; int max_2beki;

  vector< T > data;
  // 初期化 1-indexedでデータを管理する 0で初期化
  BIT(int size){
      N = ++size;
      data.assign(N, 0);
      max_2beki = 1;
      while(max_2beki * 2 <= N) max_2beki *= 2;
  }

  // [0,k](閉区間)の総和 閉区間に注意！
  T sum(int k) {
    if(k < 0) return 0; // k<0のとき0を返す
    T ret = 0;
    for(++k; k > 0; k -= k & -k) ret += data[k];
    return (ret);
  }

  // [l,r](閉区間)の総和
  inline T sum(int l,int r){
    return sum(r) - sum(l-1);
  }

  // 一点取得 更新はできないことに注意
  inline T operator[](int k){
    return sum(k) - sum(k-1);
  }

  // data[k] += x;
  void add(int k, T x) {
    for(++k; k < N; k += k & -k) data[k] += x;
  }

  // imos法 [l,r]にxを加算
  void imos(int l,int r,T x){
    add(l , x); add(r + 1 , -x);
  }

  // lower_bound sum(i)がval以上となる最小のi
  int lower_bound(T w){
    if(w <= 0) return 0;
    int x = 0;
    for(int k = max_2beki; k > 0; k /= 2){
      if(x+k <= N - 1 && data[x + k] < w){
        w -= data[x + k];
        x += k;
      }
    }
    return x;
  }

  // upper_bound sum(i)がvalより大きくなる最小のi
  int upper_bound(T w){
    if(w < 0) return 0;
    int x = 0;
    for(int k = max_2beki; k > 0; k /= 2){
      if(x+k <= N - 1 && data[x + k] <= w){
        w -= data[x + k];
        x += k;
      }
    }
    return x;
  }

};

int main(){
    ll n,d,a;cin >> n >> d >> a;
    vector<pair<int,int>> c(n);
    for(int i=0;i<n;i++){
        int x,h;cin >> x >> h;
        c[i]={x,h};
    }
    sort(c.begin(),c.end());
    vector<ll> x(n),h(n);
    for(int i=0;i<n;i++){
        x[i]=c[i].first;
        h[i]=c[i].second;
    }
    ll ans=0;
    BIT<ll> bit(n+10);
    for(int i=0;i<n;i++){
        ll cnt=max(0LL,(h[i]+bit.sum(i)+a-1)/a);
        ans+=cnt;
        int t=upper_bound(x.begin(),x.end(),x[i]+2*d)-x.begin();
        bit.imos(i,t-1,-a*cnt);
    }
    cout << ans << endl;
}

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

int main()
{
	string weather;
	cin >> weather;
	if (weather == "Sunny")cout << "Cloudy" << endl;
	if (weather == "Cloudy")cout << "Rainy" << endl;
	if (weather == "Rainy")cout << "Sunny" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string.h>
#include<complex>
using namespace std;
typedef long long int llint;
int main(){
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if (abs(a - b) <= d && abs(b - c) <= d){
		cout << "Yes" << endl;
	}
	else if (abs(a - c) <= d){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}

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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
#define DEBUG freopen("in.txt", "r", stdin);

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

const int N = 1e5 + 5;
int n, m, k, ans;

int main() {
    cin >> n >> m;
    cout << n * m - n - m + 1 << endl;
    return 0;
}


Measured memory_bytes: 3536
#include<iostream>
using namespace std;
#include<set>
int main()
{
	string tmp,str;
	set<string> s;
	int n;
	bool ans=true;
	
	cin >> n;
	cin >> tmp;
	s.insert(tmp);
	for(int i=0;i<n-1;i++)
	{
		cin >> str;
		s.insert(str);
		if(tmp[tmp.size()-1]!=str[0])ans=false;
		tmp=str;
	}
	
	if(s.size()!=n)ans=false;
	
	if(ans)cout << "Yes";
	else cout << "No";
	cout << endl;
	return 0;
}

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

int main() {
    int n;
    string s, t, ans;
    cin >> n >> s >> t;
    for (int i = 0; i < n; i++) {
        ans = ans + s.at(i) + t.at(i);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3576
//
// Created by Myabu on 2020/01/26.
//

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <math.h>
#include <stack>
#include <queue>
#include <cstdio>
#include <numeric>
#include <iomanip>

using namespace std;


int main(void){
    int X, t;
    cin>>X>>t;
    
    cout<<max(0, X-t)<<endl;
    
    
    return 0;
}

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

int m,n,x,ans;
int P[100+10],edge1[10000+10],edge2[10000+10];


int root(int a){
	if (P[a] == a) return a;
	return (P[a] = root(P[a]));
}

bool same(int a, int b){
	return root(a)==root(b);
}
	
void unite(int a, int b){
	P[root(a)] = root(b);
}

int main() {
	pair<int,int> edges[10000+10];
	cin >> n;
	
	for (int i=1; i<=n; i++){
		P[i] = i;
	}
	
	m = 0;
	for (int i=1; i<=n; i++){
		for (int j=1; j<=n; j++){
			cin >> x;
			if (x>-1){
				edge1[m] = i;
				edge2[m] = j;
				edges[m] = make_pair(x, m);
				m+=1;
			}
		}
	}
	
	sort(edges, edges+m);
	n=1;
	for (int i=0; i<m; i++){
		if (n>=m) break;
		if (!same(edge1[edges[i].second], edge2[edges[i].second])){
			unite(edge1[edges[i].second], edge2[edges[i].second]);
			ans += edges[i].first;
			n+=1;
		}
	}
	
	cout << ans << endl;
	
}

Measured memory_bytes: 3204
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;

double minkowskiDist(int n,int p,double *x,double *y){
	double sum = 0;
	for(int i = 0; i < n; i++){
		sum += pow( fabs(x[i] - y[i]) , p);
	}
	return pow( sum, 1.0/p);
}

double chebychevDist(int n,double *x,double *y){
	double max = fabs(x[0] - y[0]);
	for(int i = 1; i < n; i++){	//top of the hill????????£????????§???????±???????
		if( max < fabs(x[i] - y[i])) max = fabs(x[i] - y[i]);
	}
	return max;
}

int main()
{
	int n;
	cin>>n;
	double *x = new double[n];
	double *y = new double[n];
	for(int i = 0; i < n; i ++) cin>>x[i];
	for(int i = 0; i < n; i ++) cin>>y[i];
	printf("%.6lf\n", minkowskiDist(n,1,x,y));
	printf("%.6lf\n", minkowskiDist(n,2,x,y));
	printf("%.6lf\n", minkowskiDist(n,3,x,y));
	printf("%.6lf\n", chebychevDist(n,x,y));
	delete x;
	delete y;
	return 0;
}

Measured memory_bytes: 3400
use std::process;
macro_rules! get {
      ($t:ty) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.trim().parse::<$t>().unwrap()
          }
      };
      ($($t:ty),*) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              let mut iter = line.split_whitespace();
              (
                  $(iter.next().unwrap().parse::<$t>().unwrap(),)*
              )
          }
      };
      ($t:ty; $n:expr) => {
          (0..$n).map(|_|
              get!($t)
          ).collect::<Vec<_>>()
      };
      ($($t:ty),*; $n:expr) => {
          (0..$n).map(|_|
              get!($($t),*)
          ).collect::<Vec<_>>()
      };
      ($t:ty ;;) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.split_whitespace()
                  .map(|t| t.parse::<$t>().unwrap())
                  .collect::<Vec<_>>()
          }
      };
      ($t:ty ;; $n:expr) => {
          (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
      };
}
fn main() {
    let n = get!(u64);
    let mut c = 0;

    for i in 1..n+1 {
        if i%2 == 1 {
            c += 1;
        }
    }

    println!("{}" , c as f64 /n as f64);

}


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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 1e5+34;
int bio[N];
vector<int> g[N];

void bfs(int p) {
  queue<int> q;
  q.push(p);
  bio[p] = 69;
  while (!q.empty()) {
    int p = q.front(); q.pop();
    for (int v: g[p]) {
      if (bio[v]) continue;
      q.push(v);
      bio[v] = p;
    }
  }
}

void solve() {
  int n, m; scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int u, v; scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  bfs(1);
  for (int i = 1; i <= n; ++i) {
    if (!bio[i]) {
      puts("No");
      return;
    }
  }
  puts("Yes");
  for (int i = 2; i <= n; ++i) {
    printf("%d\n", bio[i]);
  }
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


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

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

    SORT(A); reverse(A.begin(), A.end());
    int tate=0, yoko=0;
    bool flag=false;
    REP(i,N-1){
        if(A[i] == A[i+1]){
            if(flag){
                yoko = A[i];
                break;
            }
            else{
                tate = A[i];
                flag = true;
            }
            i++;
        }
    }
    cout << (ll)tate*yoko << endl;
    return 0;
}

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

using namespace std;

const int maxn=1e5+100;

typedef long long ll;

int main()
{
    //freopen("in.txt","r",stdin);
    ll x,y;
    scanf("%lld %lld",&x,&y);
    if(x-y>=2||y-x>=2) printf("Alice");
    else  printf("Brown");
}


Measured memory_bytes: 256
#!/usr/bin/env python3

N = int(input())
A = list(map(int, input().split()))

S = sum(A)

Ret = []
s = 0
for i in range(1, N, 2):
    s += A[i]

Ret.append(S-2*s)

for i in range(N-1):
    Ret.append(2*A[i]-Ret[-1])

print(*Ret)


Measured memory_bytes: 20548
#include<stdio.h>
int main(void){
	int a,b,c,d,e;
	d=0;
	scanf("%d %d %d",&a,&b,&c);
	for(e=a;e<=b;e++){
		if(c%e==0){
			d++;
		}
	}
	printf("%d\n",d);
	return 0;
}

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

int main(){
string s;  
int t = 0;
cin >> s;

if(s[0] == '1'){
  t++;
	}
if(s[1] == '1'){
	t++;
	}
if(s[2] == '1'){
	t++;
	}
cout << t << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int X = sc.nextInt();

        System.out.println(solve(X));

        sc.close();
    }

    static int solve(int X) {
        int sum = 0;
        for (int i = 1;; ++i) {
            sum += i;
            if (sum >= X) {
                return i;
            }
        }
    }
}

Measured memory_bytes: 23124