akhauriyash/Code-Regression huggingface dataset:
//作者：中国江苏省南京市李硕睿
#include <stdio.h>
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
int n,m;
string s[20];
int swaped[20];
int used[20];
int ans = 0;
bool check()
{
	memset(used,0,sizeof used);
	for(int i=0;i<m;i++){
		for(int j=0;j<m;j++){
			if(used[i]||used[j]||i==j) continue;
			int cur=1;
			for(int k=0;k<n;k++){
				if(s[swaped[k]][i]!=s[k][j]){
					cur=0;
					break;
				}
			}
			if(cur){
				used[i]=used[j]=1;
			}
		}
	}
	int cnt=0,to=0;
	for(int i=0;i<m;i++){
		if(!used[i]){
			cnt++;to=i;
		}
	}
	if(cnt>=2 || (m%2==0&&cnt)){
		return false;
	}
	if(!cnt) return true;
	for(int i=0;i<n;i++){
		if(s[swaped[i]][to]!=s[i][to]){
			return false;
		}
	}
	return true;
}
void dfs(int now,bool ji)
{
	if(now==(n+1)/2){
		if(check()){
			ans=1;
		}
		return;
	}
	for(int i=now;i<n;i++){
		for(int j=i+1;j<n;j++){
			if(swaped[i]==-1&&swaped[j]==-1){
				swaped[i]=j;
				swaped[j]=i;
				dfs(now+1,ji);
				swaped[i]=-1;
				swaped[j]=-1;
			}
		}
		if(ji&&swaped[i]==-1){
			swaped[i]=i;
			dfs(now+1,false);
			swaped[i]=-1;
		}
	}
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++){
		cin>>s[i];
		swaped[i]=-1;
	}
	if(n&1){
		dfs(0,true);
	}else{
		dfs(0,false);
	}
	if(ans) printf("YES\n");
	else printf("NO\n");
}

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

using namespace std;

#define int long long
#define all(v) begin(v), end(v)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = (int)(s); i < (int)(n); i++)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int x;
  cin >> x;
  if(x % 11) cout << (x / 11)*2 + (x % 11 < 7 ? 1 : 2) << endl;
  else cout << (x / 11)*2 << endl;

  return 0;
}


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

int main(void)
{
  string s;
  cin>>s;
  bool a=false;
  for(int i=0;i<3;i++){
      if(s[i]==s[i+1])
        a=true;
  }
  if(a)
    cout<<"Bad"<<endl;
  else
    cout<<"Good"<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner

object Main {
  def solve(sc: => Scanner): Unit = {
    val x, a, b = sc.nextInt
    println(if (Math.abs(x - a) < Math.abs(x - b)) "A" else "B")
  }

  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)
    solve(sc)
  }
}


Measured memory_bytes: 25504
#include <stdio.h>
#include <stdlib.h> 

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left != NIL){
    x = x->left;
  }
  return x;
}

Node treeMaximum(Node x){
  while(x->right != NIL){
    x = x->right;
  }
  return x;
}

Node treeSearch(Node u, int k){
  if(u == NIL || k == u->key) return u;
  if(k < u->key) return treeSearch(u->left, k);
  else return treeSearch(u->right, k);
}

Node treeSuccessor(Node x){
  Node y;
  if(x->right != NIL) return treeMinimum(x->right);//case 1
		       
  y = x->parent;
  while((y != NIL) && x == y->right ){
    x = y;
    y = y->parent;
    return y;//case 2
  }
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if( z->key < x->key)
      x = x->left;
    else
      x = x->right;
  }

  z->parent = y;

  if(y == NIL)    root = z ;
  else if(z->key < y->key) y->left = z;
  else  y->right = z;


}

void inorder(Node u){
  if(u != NIL){
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
  }
  
}
void preorder(Node u){
  if(u != NIL){
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
  }
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      
      inorder(root);
      // if(i != n-1)printf(" ");//空白処理
       printf("\n");
       
      preorder(root);
      // if(i != n-1) printf(" ");//空白処理
      printf("\n");
      
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}



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

using namespace std;

int main(void) {
	int a[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
	int K;
	cin >> K;
	cout << a[K - 1] << '\n';
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

int main(void){
    int n; cin >> n;
    ll x; cin >> x;
    vi a(n); for(auto & e : a) cin >> e;

    int mi = min_element(_all(a)) - begin(a);

    ll res = 0LL;
    rep(i, n) res += a[i];

    rep(mday, 1, n){
        ll cur = a[mi] + mday * x;
        set<int> s;
        s.insert(a[mi]);
        unordered_map<int, int> cnt;
        cnt[a[mi]]++;

        rep(i, 1, n){
            int ci = (mi + i) % n;
            cur += min(*s.begin(), a[ci]);

            s.insert(a[ci]);
            cnt[a[ci]]++;
            if(i >= mday){
                if(--cnt[a[(ci - mday + n) % n]] == 0){
                    s.erase(a[(ci - mday + n) % n]);
                }
            }
        }

        if(not chmin(res, cur)){
            break;
        }
    }

    cout << res << endl;

    return 0;
}


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

int main(){
	vector<char> v;
	string s;
	cin >> s;
	for(auto c: s){
		switch(c){
		case '0':
		case '1':
			v.push_back(c);
			break;
		case 'B':
			if(v.size()){
				v.pop_back();
			}
			break;
		}
	}
	for(auto c: v){
		cout << c;
	}
	return 0;
}




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

int main(){
	int N;
	int A[1100];
	int B[1100];
	int pro=1;
	double sum=0;
	double ans;
	
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> A[i];
	}
	
/*	for(int i=0; i<N; i++){
		pro=pro*A[i];
	}
	
*/	for(int i=0; i<N; i++){
//		B[i]=pro/A[i];
		sum=sum+1.0/A[i];
	}
	
//	ans = ((double) pro)/((double) sum);
	ans = 1/sum;
	
	cout<< fixed << setprecision(10) << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
#include<algorithm>
#include<vector>
#include<set>
#define mod  998244353
#define int long long int
int32_t main()
{
	int n;
	cin>>n;
	int j,arr[n+1];
	for(j=1;j<=n;j++)
	    cin>>arr[j];
	int answer=0;
	int position[n+1];
	for(j=1;j<=n;j++)
	{
		position[arr[j]]=j;
	}
	set<int> s;
	s.insert(0);
	s.insert(n+1);
	for(j=1;j<=n;j++)
	{
		int x=position[j];
		auto it=s.upper_bound(x);
		int right=*it;
		right--;
		it--;
		int left=*it;
		left++;
		answer+=j*(x-left+1)*(right-x+1);
		s.insert(x);
	}
	cout<<answer<<endl;
}


Measured memory_bytes: 12800
{-# LANGUAGE OverloadedLists     #-}
{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE ScopedTypeVariables #-}

import           Control.Monad
--import           Control.Monad.Loops
import           Data.IORef
import           Data.Maybe
import qualified Data.Text     as T
import qualified Data.Text.IO  as T
import           GHC.Base
import           System.IO

import qualified Data.Array    as A
import qualified Data.IntMap   as I
import           Data.List
import qualified Data.Map      as M
import qualified Data.Set      as S
import qualified Data.Vector   as V

-- for Text
(+.+) = T.append
(!.!) = T.index

-- for Vector
count :: (a -> Bool) -> V.Vector a -> Int
count p = V.length . V.filter p

-- for IO
readT :: Read a => T.Text -> a
readT = read . T.unpack

getLineSpc :: Read a => IO [a]
getLineSpc = do
  t <- T.getLine
  let xs = map readT $ T.split (== ' ') t
  return xs

getLineSpcVec :: Read a => IO (V.Vector a)
getLineSpcVec = do
  t <- T.getLine
  let xs = V.fromList $ map readT $ T.split (== ' ') t
  return xs

----------
-- main --
----------
main :: IO ()
main = kagamiMochi

kagamiMochi :: IO ()
kagamiMochi = do
  n  :: Int   <- readLn
  ds :: [Int] <- replicateM n readLn
  print $ S.size $ S.fromList ds

Measured memory_bytes: 1020
#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus >= 201703L
#        pragma GCC target("avx2")
#    else
#        pragma GCC target("avx")
#    endif

#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;
typedef long double Ld;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

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

    int k, n;
    cin >> n >> k;
    vector<int> l(n);
    for (int i = 0; i < n; i++) {
        cin >> l[i];
    }

    sort(l.begin(), l.end(), greater<>());
    int ans = accumulate(l.begin(), l.begin() + k, 0);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int W,H,x,y,r;
	
	scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
	if(r<=x && x<=W-r && r<=y && y<=H-r){
		printf("Yes\n");
	}else{
		printf("No\n");
	}
	
	return 0;
}

Measured memory_bytes: 584
num = gets.to_i
arr = gets.split.map(&:to_i).sort
ans = 10000000000000000000000000000000000000000000
now = 0
tmp = 0
arr[-1].times do |i|
	num.times do |j|
		tmp = (arr[j]-(i+1)) **2
		now += tmp
	end
	if now < ans
		ans = now
	end
  	now = 0
end

p ans

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

ll a[55], n, ans;

bool gg() {
    for (int i = 0; i < n; ++i) {
        if (a[i] >= n)
            return false;
    }
    return true;
}

void solve() {
    ll cur = 0;
    for (int i = 0; i < n; ++i) {
        cur += a[i] / n;
    }
    for (int i = 0; i < n; ++i) {
        ll cc = a[i] / n;
        a[i] -= cc * n;
        a[i] += cur - cc;
    }
    ans += cur;
}

int main() {
#ifdef LOCAL
    freopen("xxx.in", "r", stdin);
    freopen("xxx.out", "w", stdout);    
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    while (!gg()) {
        solve();
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
namespace Coder {
  class Scanner {
    private buffer: string = '';
    private stdinQueue: any = [];

    constructor() {
      process.stdin.resume();
      process.stdin.setEncoding('utf8');
      process.stdin.on(
        'data',
        (chunk): void => {
          this.buffer += chunk;
          while (this.stdinQueue.length > 0) {
            const i = this.buffer.indexOf('\n');
            if (i < 0) {
              break;
            }
            let line = this.buffer.substr(0, i);
            if (line.endsWith('\r')) {
              line = line.slice(0, -1);
            }
            this.buffer = this.buffer.substr(i + 1);
            this.stdinQueue.shift()(line);
          }
        },
      );
    }
    public getLine(): Promise<string> {
      return new Promise((resolve, reject) => {
        const i = this.buffer.indexOf('\n');
        if (i >= 0 && this.stdinQueue.length === 0) {
          let line = this.buffer.substr(0, i);
          if (line.endsWith('\r')) {
            line = line.slice(0, -1);
          }
          this.buffer = this.buffer.substr(i + 1);
          resolve(line);
        } else {
          this.stdinQueue.push(resolve);
        }
      });
    }

    public close(): void {
      process.stdin.pause();
    }
  }

  async function solve() {
    const sc = new Scanner();
    const S: string = await sc.getLine();
    const c0 = (S.match(/0/g) || []).length;
    const c1 = (S.match(/1/g) || []).length;

    console.log(Math.min(c0, c1) * 2);
    sc.close();
  }
  solve();
}


Measured memory_bytes: 9548
/* in the name of Anton */

/*
  Compete against Yourself.
  Author - Aryan Choudhary (@aryanc403)
*/

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define fo(i,n)   for(i=0;i<(n);++i)
#define repA(i,j,n)   for(i=(j);i<=(n);++i)
#define repD(i,j,n)   for(i=(j);i>=(n);--i)
#define all(x) begin(x), end(x)
#define sz(x) ((lli)(x).size())
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define endl "\n"

typedef long long int lli;
typedef long double mytype;
typedef pair<lli,lli> ii;
typedef vector<ii> vii;
typedef vector<lli> vi;


const auto start_time = std::chrono::high_resolution_clock::now();
void aryanc403()
{
#ifdef ARYANC403
auto end_time = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> diff = end_time-start_time;
    cerr<<"Time Taken : "<<diff.count()<<"\n";
#endif
}

#ifdef ARYANC403
#include "/home/aryan/codes/PastCodes/header.h"
#else
    #define dbg(args...)
#endif

const lli INF = 0xFFFFFFFFFFFFFFFL;

lli seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline lli rnd(lli l=0,lli r=INF)
{return uniform_int_distribution<lli>(l,r)(rng);}

class CMP
{public:
bool operator()(ii a , ii b) //For min priority_queue .
{    return ! ( a.X < b.X || ( a.X==b.X && a.Y <= b.Y ));   }};

void add( map<lli,lli> &m, lli x,lli cnt=1)
{
    auto jt=m.find(x);
    if(jt==m.end())         m.insert({x,cnt});
    else                    jt->Y+=cnt;
}

void del( map<lli,lli> &m, lli x,lli cnt=1)
{
    auto jt=m.find(x);
    if(jt->Y<=cnt)            m.erase(jt);
    else                      jt->Y-=cnt;
}

bool cmp(const ii &a,const ii &b)
{
    return a.X<b.X||(a.X==b.X&&a.Y<b.Y);
}

const lli mod = 1000000007L;
// const lli maxN = 1000000007L;

    lli T,n,i,j,k,in,cnt,l,r,u,v,x,y;
    lli m;
    string s;
    vi a;
    //priority_queue < ii , vector < ii > , CMP > pq;// min priority_queue .

int main(void) {
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    // freopen("txt.in", "r", stdin);
    // freopen("txt.out", "w", stdout);
// cout<<std::fixed<<std::setprecision(35);
// cin>>T;while(T--)
{
    lli ans=0;
    cin>>n>>m;
    ans-=n*60+m;
    cin>>n>>m;
    ans+=n*60+m;
    if(ans<0)
        ans+=24*60;
    cin>>k;
    ans-=k;
    cout<<ans<<endl;

}   aryanc403();
    return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const ll INF=1e18;
const int MOD=1e9+7;
const double pi=acos(-1);

int main(){
  ll a,b,h;
  cin >> a >> b >> h;
  cout << (a+b)*h/2 << endl;
}

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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

ll a[10001], b[10001];
vector<ll> c;

int main() {
    int N;
    cin >> N;
    ll sumA = 0, sumB = 0;
    rep(i, N) {
        cin >> a[i];
        sumA += a[i];
    }
    rep(i, N) {
        cin >> b[i];
        sumB += b[i];
    }
    if (sumA == sumB) {
        bool ok = true;
        rep(i, N) {
            if (a[i] != b[i]) { ok = false; break; }
        }
        if (ok) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    if (sumA > sumB) {
        bool ok = true;
        rep(i, N) {
            if (a[i] != b[i]) { ok = false; break; }
        }
        if (ok) {
            cout << "Yes" << endl;
        }
        else {
            cout << "No" << endl;
        }
    }
    else {
        rep(i, N) {
            ll tmp = (b[i] - a[i]);
            c.push_back(tmp);
        }
        sort(c.begin(), c.end());
        reverse(c.begin(), c.end());
        ll sum = 0;
        rep(i, N) {
            if (c[i] < 0LL) {
                sum += c[i];
                if (sum < 0LL) {
                    cout << "No" << endl;
                    return 0;
                }
            }
            else {
                sum += c[i]/2LL;
            }
        }
        cout << "Yes" << endl;
        return 0;
    }
}


Measured memory_bytes: 640
import java.util.*;
public class Main{
  public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
      int x = sc.nextInt();
      int max = 0;
      for(int i = 1;i <= 31;i++){
         for(int j = 2;j <= 9;j++){
             if(Math.pow(i,j) <= x) max = Math.max(max,(int)Math.pow(i,j));
         }
      }
      System.out.println(max);
     }
}


Measured memory_bytes: 22996
A,B,C,D,E,F =map(int,input().split())

amax = F//(100*A)
bmax = F//(100*B)

concmx =0
wholemx =0
sugarmx =0

for a in range(amax,-1,-1):
    for b in range(bmax,-1,-1):
        cmax = (F-100*A*a-100*B*b)//C
        dmax = (F-100*A*a-100*B*b)//D
        for c in range(cmax,-1,-1):
            for d in range(dmax,-1,-1):
                sugar =C*c+D*d
                whole = 100*A*a+100*B*b+sugar
                if whole ==0:
                    break
                elif sugar/whole <= E/(100+E) and whole <=F:
                    if sugar/whole >= concmx:
                        concmx =sugar/whole
                        sugarmx = sugar
                        wholemx =whole
                    
                   
print(str(wholemx)+" "+str(sugarmx))
                    

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int N, M;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> N >> M;
  int ans = 0;
  for (int i = 1; i * i <= M; i++) {
    if (M % i != 0) continue;
    int rem = M / i;
    if (M / i >= N) ans = max(ans, i);
    if (i >= N) ans = max(ans, M / i);
  }  
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
open System.Collections.Generic

type Scanner() = class
    let mutable hold = [||]
    let mutable index = 0
    member public this.Next() =
        if hold.Length > index
        then 
            index <- index + 1
            hold.[index - 1]
        else
            let mutable st = stdin.ReadLine()
            while st = "" do st <- stdin.ReadLine()
            hold <- st.Split(' ')
            if hold.Length = 0
            then
                this.Next()
            else
                index <- 1
                hold.[index - 1]
            
    member public this.NextI32() =
        this.Next() |> int

    member public this.ArrayI32(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextI32()|]

    member public this.NextI64() =
        this.Next() |> int64
    
    member public this.ArrayI64(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextI64()|]

    member public this.NextF32() =
        this.Next() |> float32
    
    member public this.ArrayF32(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextF32()|]

    member public this.NextF64() =
        this.Next() |> double
    
    member public this.ArrayF64(n: int) =
        [|for _ in 0 .. n - 1 -> this.NextF64()|]

    member public __.Tuple2Array n (f : int -> 'a list) =
        [|for _ in 0 .. n - 1 -> f 2 |> fun x -> x.[0], x.[1]|]
    
    member public __.Tuple3Array n (f : int -> 'a list) =
        [|for _ in 0 .. n - 1 -> f 3 |> fun x -> x.[0], x.[1], x.[2]|]

    member public __.CountDic n (f : unit -> 'a) =
        let seqs = seq {for _ in 0 .. n - 1 -> f()}
        let dic = new Dictionary<'a, int64>();
        for i in seqs do
            if dic.ContainsKey(i)
            then dic.[i] <- dic.[i] + 1L
            else dic.Add(i, 1L)
        dic

end

[<EntryPoint>]
let main _ =
#if DEBUG
    printfn "debuged"
#endif

    let scanner = Scanner()
    let n = scanner.NextI32()
    let arrA = scanner.ArrayI64(n)
    let arrB = Array.distinct arrA
    if (Array.length arrA) <> (Array.length arrB) then "NO" else "YES"
    |> printfn "%s"

    0


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

using namespace std;

const int N = 1e5;
int n, v[N + 2];
pair<int, int>a[N + 2], b[N + 2];

int main()
{
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> v[i];
  for (int i = 1; i <= N;i++)
    a[i].second = b[i].second = i;
  for (int i = 2; i <= n; i += 2)
    a[v[i]].first++;
  for (int i = 1; i <= n; i += 2)
    b[v[i]].first++;
  sort(a + 1, a + N + 1);
  reverse(a + 1, a + N + 1);
  sort(b + 1, b + N + 1);
  reverse(b + 1, b + N + 1);
  if (a[1].second != b[1].second)
    cout << n - a[1].first - b[1].first;
  else {
    cout << min(n - a[1].first - b[2].first, n - a[2].first - b[1].first);
  }
  return 0;
}


Measured memory_bytes: 5548
// AtcoderTemplate.cpp : アプリケーションのエントリ ポイントを定義します。
//

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

int main()
{
	string s, t;
	cin >> s >> t;
	vector<int> rs(26), rt(26);
	bool res = true;
	for (int i = 0; i < s.size(); i++) {
		int js = s[i] - 'a';
		int jt = t[i] - 'a';
		if (rs[js] > 0) {
			res &= (rs[js] == t[i]);
		}
		else {
			rs[js] = t[i];
		}
		if (rt[jt] > 0) {
			res &= (rt[jt] == s[i]);
		}
		else {
			rt[jt] = s[i];
		}

	}
	cout << (res ? "Yes" : "No") << endl;
    return 0;
}



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

int main()
{
    char str[1200];
    int i = 0;

    cin.getline(str, sizeof(str));

    while (str[i]) {
        if (isalpha(str[i])) {
            if (isupper(str[i]))
                str[i] = tolower(str[i]);
            else
                str[i] = toupper(str[i]);
        }
        i++;
    }
    cout << str << endl;
}


Measured memory_bytes: 3096
object Main {
  def main(args: Array[String]): Unit = {
    val nums   = scala.io.StdIn.readLine.split( " " ).map{ _.toInt }

    if      ( nums( 0 ) == nums( 1 ) ) println( nums( 2 ) )
    else if ( nums( 1 ) == nums( 2 ) ) println( nums( 0 ) )
    else                               println( nums( 1 ) )
  }
}

Measured memory_bytes: 54600
#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>

#define BIT(a) (1 << (a))

using namespace std;

set<pair<long long, long long> > black;
set<pair<long long, long long> > rac;

long long ans[10];

int main(void){
	long long h, w, n;
	cin >> h >> w >> n;
	for (int i = 0; i < n; i++){
		long long x, y;
		cin >> x >> y;
		black.insert(make_pair(x, y));
		for (int j = 0; j < 3; j++){
			for (int k = 0; k < 3; k++){
				rac.insert(make_pair((x-j), (y-k)));
			}
		}
	}

	ans[0] = (h-2)*(w-2);

	for (auto itr = rac.begin(); itr != rac.end(); ++itr){
		long long x, y;
		x = itr->first;
		y = itr->second;

		if (x <= 0 || x + 2 > h || y <= 0 || y + 2 > w) continue;

		int cnt = 0;

		for (int i = 0; i < 3; i++){
			for (int j = 0; j < 3; j++){
				cnt += black.count(make_pair((x+i), (y+j)));
			}
		}

		ans[cnt]++;
		ans[0]--;
	}

	for(int i = 0; i < 10; i++){
		cout << ans[i] << endl;
	}
	
	return 0;

}



Measured memory_bytes: 64768
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define ins insert
#define sb substr
#define con continue
#define ub upper_bound
#define lb lower_bound
#define sp fixed<<setprecision
#define bp __builtin_popcountll
#define pll pair<ll,ll>
#define pld pair<ld,ld>
using namespace std;

ll power(ll x, ll y);
ll mpower(ll x, ll y, ll p);
ll modInv(ll a, ll m);
ll gcdExtended(ll a, ll b, ll *x, ll *y);
bool isPrime(ll n);

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t,i,j,k,l,h,p,q,r,x,y,z,a,b,c,d,f,n,m,M=1000000007;
    char ch,ch2,ch3;
    string s,s1,s2,s3;
    vector<ll> v,w;
    unordered_map<ll,ll> N;
    set<ll> S;
    set<ll> :: iterator itr;
    cin>>n>>s;
    c=1;
    for(i=1;i<n;i++){
        if(s[i]!=s[i-1]){
            c++;
        }
    }
    cout<<c;
    return 0;
}

ll modInv(ll a, ll m){
    ll x, y;
    ll g = gcdExtended(a, m, &x, &y);
    ll res = (x%m + m) % m;
    return res;
}

ll gcdExtended(ll a, ll b, ll *x, ll *y){
    if (a == 0){
        *x = 0, *y = 1;
        return b;
    }
    ll x1, y1;
    ll gcd = gcdExtended(b%a, a, &x1, &y1);
    *x = y1 - (b/a) * x1;
    *y = x1;
    return gcd;
}

ll mpower(ll x, ll y, ll p){
    ll res = 1;
    x = x % p;
    while(y > 0){
        if(y & 1) res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

ll power(ll x, ll y){
    ll res = 1;
    while (y > 0){
        if (y & 1) res = res*x;
        y = y>>1;
        x = x*x;
    }
    return res;
}

bool isPrime(ll n){
    if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
    ll p=sqrt(n);
    for(int i=5;i<=p;i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
            return false;
    return true;
}


Measured memory_bytes: 512
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <string>

typedef long long int ll;
typedef unsigned long long int ull;

using namespace std;

int main()
{
  int a, b, ans;
  cin >> a >> b;

  if (a == b)
  {
    ans = 2 * a;
  }
  else
  {
    ans = 2 * max(a, b) - 1;
  }

  cout << ans << endl;

  return 0;
}

// ...###..

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

int main(){
  string s;
  cin >> s;

  int slen = s.length();
  int top,bottom;

  for(int i=0;i<slen;i++){
    if(s[i] == 'A'){
      top = i;
      break;
    }
  }
  for(int i = slen-1; i>=0; i--){
    if(s[i] == 'Z'){
      bottom = i;
      break;
    }
  }

  if(top < bottom){
    cout << bottom - top + 1 << endl;
  }

}

Measured memory_bytes: 640
a, b, c, x, y = map(int, input().split())
m = 0
z = min(x, y)
m += 2 * z * c if 2 * z * c <= (a * z + b * z)else (a * z + b * z) 
w = max(x, y) - min(x, y)
d = a if x > y else b
m += 2 * w * c if 2 * w * c <= d * w else d * w
print(m)

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>


using namespace std;

int main(){
    
    string S;
    
    cin >> S;
    
    int a = atoi(S.substr(0,1).c_str());
    bool bb = true;
    
    for (int i = 1; i < 4; i++) {
        int num = atoi(S.substr(i,1).c_str());
        if (a == num) {
            bb = false;
            break;
        }
        a = num;
    }
    
    
    if (bb) {
        cout << "Good" << endl;
    }else{
        cout << "Bad" << endl;
    }
    
    
    return 0;
    
}


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

int main() {
    int n, m, c;
    cin >> n >> m >> c;

    vector<int> b(m);
    for ( int i = 0; i < m; i++ ) {
        cin >> b[i];
    }

    int tmp_sum = 0;
    int tmp_a = 0;
    int cnt = 0;
    for ( int i = 0; i < n; i++ ) {
        tmp_sum = c;
        for ( int j = 0; j < m; j++ ) {
            cin >> tmp_a;
            tmp_sum += tmp_a * b[j];
        }
//        cout << tmp_sum << endl;
        if ( tmp_sum > 0 ) {
            cnt++;
        }
    }

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <chrono>
using namespace std;
#define MOD @
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

const int nKind = 26;
const int actualD = 365;

int D;
int C[nKind], S[actualD][nKind];

int emulate(const vector<int>& ans)
{
	int last[nKind];
	for (int i = 0; i < nKind; ++i) last[i] = -1;
	int score = 0;
	for (int i = 0; i < D; ++i) {
		score += S[i][ans[i]];
		last[ans[i]] = i;
		for (int j = 0; j < nKind; ++j) {
			score -= C[j] * (i - last[j]);
		}
	}
	return score;
}

vector<int> greedy()
{
	int last[nKind];
	for (int i = 0; i < nKind; ++i) last[i] = -1;

	vector<int> ans;
	for (int i = 0; i < D; ++i) {
		int profit[nKind];
		for (int j = 0; j < nKind; ++j) {
			profit[j] = C[j] * (i - last[j]) + S[i][j];
		}
		int best = 0;
		for (int j = 0; j < nKind; ++j) {
			if (profit[best] < profit[j]) best = j;
		}
		last[best] = i;
		ans.push_back(best);
	}
	return ans;
}

int main()
{
	scanf("%d", &D);
	for (int i = 0; i < nKind; ++i) scanf("%d", C + i);
	for (int i = 0; i < D; ++i) {
		for (int j = 0; j < nKind; ++j) scanf("%d", &(S[i][j]));
	}
	auto ans = greedy();
	for (int i = 0; i < D; ++i) printf("%d\n", ans[i] + 1);
	fprintf(stderr, "score: %d\n", emulate(ans));
	return 0;
}


Measured memory_bytes: 3276
#include <bits/stdc++.h>
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long a, b, n;
    cin >> a >> b >> n;
    if (n-a > 0) {
        n -= a; a = 0; b -= n;
        if (b < 0) b = 0;
    } else {
        a -= n;
    }
    cout << a << ' ' << b << '\n';
    return 0;
}


Measured memory_bytes: 256
// バチャで貼る悪魔的行為
#include <bits/stdc++.h>
using ll = long long;
constexpr ll pow(const ll a, const ll b, const ll mod) { return b == 0 ? 1LL : b % 2 == 1 ? pow(a, b - 1, mod) * a % mod : pow(a * a % mod, b / 2, mod); }
constexpr ll inverse(const ll a, const ll mod) { return pow(a, mod - 2, mod); }
constexpr ll MOD0 = 1000000007LL, MOD1 = 1000000009LL, MOD2 = 1000000021;
constexpr ll X = 121234243;
constexpr ll XINV0 = inverse(X, MOD0), XINV1 = inverse(X, MOD1), XINV2 = inverse(X, MOD2);
constexpr int L = 250000;
using P = std::tuple<ll, ll, ll>;
P power[L + 1] = {P{1, 1, 1}}, invpower[L + 1] = {P{1, 1, 1}};
auto plus = [](const P& p1, const P& p2) { return P{(std::get<0>(p1) + std::get<0>(p2)) % MOD0, (std::get<1>(p1) + std::get<1>(p2)) % MOD1, (std::get<2>(p1) + std::get<2>(p2)) % MOD2}; };
auto minus = [](const P& p1, const P& p2) { return P{(std::get<0>(p1) + MOD0 - std::get<0>(p2)) % MOD0, (std::get<1>(p1) + MOD1 - std::get<1>(p2)) % MOD1, (std::get<2>(p1) + MOD2 - std::get<2>(p2)) % MOD2}; };
auto rshift = [](const P& p) { return P{std::get<0>(p) * X % MOD0, std::get<1>(p) * X % MOD1, std::get<2>(p) * X % MOD2}; };
auto lshift = [](const P& p) { return P{std::get<0>(p) * XINV0 % MOD0, std::get<1>(p) * XINV1 % MOD1, std::get<2>(p) * XINV2 % MOD2}; };
auto mul = [](const P& p1, const P& p2) { return P{std::get<0>(p1) * std::get<0>(p2) % MOD0, std::get<1>(p1) * std::get<1>(p2) % MOD1, std::get<2>(p1) * std::get<2>(p2) % MOD2}; };
int main()
{
    for (int i = 1; i <= L; i++) { power[i] = rshift(power[i - 1]), invpower[i] = lshift(invpower[i - 1]); }
    auto invp = [](const int i) { return i >= 0 ? invpower[i] : power[-i]; };
    int N;
    std::string S;
    std::cin >> N >> S;
    std::vector<int> deg(N + 1, 0);
    std::vector<P> value(N + 1, P{0, 0, 0});
    for (int i = N - 1; i >= 0; i--) {
        if (S[i] == '-') {
            deg[i] = deg[i + 1], value[i] = minus(value[i + 1], P{1, 1, 1});
        } else if (S[i] == '+') {
            deg[i] = deg[i + 1], value[i] = plus(value[i + 1], P{1, 1, 1});
        } else if (S[i] == '>') {
            deg[i] = deg[i + 1] + 1, value[i] = rshift(value[i + 1]);
        } else {
            deg[i] = deg[i + 1] - 1, value[i] = lshift(value[i + 1]);
        }
    }
    const P answer = value[0];
    for (int i = 0; i <= N; i++) { value[i] = mul(minus(value[i], answer), invp(deg[i])); }
    std::map<P, ll> mp;
    ll ans = 0;
    for (int i = 0; i <= N; i++) {
        const P obj = plus(value[i], mul(invp(deg[i]), answer));
        if (mp.find(obj) != mp.end()) { ans += mp[obj]; }
        mp[value[i]]++;
    }
    std::cout << ans << std::endl;
    return 0;
}


Measured memory_bytes: 38532
//
// Created by Hideaki Imamura on 2020-03-22.
//
# include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair <ll, ll> l_l;
typedef pair<int, int> i_i;

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

# define EPS (1e-7)
# define INF (1e9)
# define PI (acos(-1))
//const ll mod = 1000000007;

int L;

int main() {
    cin >> L;
    double x = (double) L / 3;
    printf("%.10f\n", x * x * x);
    return 0;
}

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

#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif // LOCAL_
#define dump() fprintf(stderr, "#%s.%d\n", __func__, __LINE__);
#define dumpl(x1) fprintf(stderr, "#%s.%d (%s) = (%ld)\n", __func__, __LINE__, #x1, x1);
#define dumpll(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%ld, %ld)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define dumplll(x1, x2, x3) fprintf(stderr, "#%s.%d (%s, %s, %s) = (%ld, %ld, %ld)\n", __func__, __LINE__, #x1, #x2, #x3, x1, x2, x3);
#define dumpd(x1) fprintf(stderr, "#%s.%d (%s) = (%lf)\n", __func__, __LINE__, #x1, x1);
#define dumpdd(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%lf, %lf)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define loop for(;;)
typedef std::vector<long> LI;
typedef std::queue<long> QI;
#define rep(i,n) for(long i = 0; i < (long)n; ++i)
const double pi = M_PI;
// const long mod = 1000000007;
const long mod = 1777777777;

template<typename T> void scan1(T& x) { fprintf(stderr, "unknown type\n"); }
template<> void scan1(long& x) { if( scanf("%ld", &x) < 0 ) exit(0); }
template<> void scan1(std::string& x) { if( not ( std::cin >> x ) ) exit(0); }
template<> void scan1(LI& xs) { for(long &x : xs) scan1(x); }
void scan() {}
template<typename Head, typename... Tail>
void scan(Head& x, Tail&... xs) {
  scan1(x); scan(xs...);
}

struct Solver {
   Solver() { fprintf(stderr, "--------Solver begin--------\n"); }
   ~Solver() { fprintf(stderr, "--------Solver end--------\n"); }
   void solve() {
      long q, h, s, d; scan(q, h, s, d);
      long n; scan(n);
      long x = std::min(std::min(q*4, h*2), s);
      long y = d;
      long res = 0;
      if( 2 * x <= y ) {
         res = n * x;
      }
      else {
         res = (n / 2 * y) + (n % 2) * x;
      }
      printf("%ld\n", res);
   }
};

int main() {
   loop std::unique_ptr<Solver>(new Solver())->solve();
}



Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
	int n;
	scanf("%d", &n);
	int i;
	char s[102][44];
	int p[102];
	for (i = 0; i < n; i++)
		scanf("%s %d", s[i], &p[i]);
	int ans[102];
	for (i = 0; i < n; i++)
		ans[i] = i;
	int x;
	for (i = 0; i < n - 1; i++)
	{
		if (strcmp(s[ans[i]], s[ans[i + 1]]) > 0)
		{
			x = ans[i];
			ans[i] = ans[i + 1];
			ans[i + 1] = x;
			if (i > 0)
				i -= 2;
		}
		else if (strcmp(s[ans[i]], s[ans[i + 1]]) == 0)
		{
			if (p[ans[i]] < p[ans[i + 1]])
			{
				x = ans[i];
				ans[i] = ans[i + 1];
				ans[i + 1] = x;
				if (i > 0)
					i -= 2;
			}
		}
	}
	for (i = 0; i < n; i++)
		printf("%d\n", ans[i] + 1);
	return 0;
}

Measured memory_bytes: 128
using System;
using System.Linq;

public class AtCoder_153_A
{
    public static void Main()
    {
        //var exStdIn = new System.IO.StreamReader( "input.txt" );
        //System.Console.SetIn( exStdIn );

        int[] line = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        int h = line[0];
        int a = line[1];

        int count = h % a == 0 ? h / a : h / a + 1;
        Console.WriteLine(count);
    }
}


Measured memory_bytes: 13268
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<string.h>
#include<stdio.h>
#include<math.h>
#include<functional>
#include <memory.h>



using namespace std;
int row_max,start,goal,col_max;

int amida_test(int yoko[30][12]){
    int now=start;
    for(int i=0; i<col_max; i++){
        if(yoko[i][now]==1)now++;
        else if(yoko[i][now-1]==1)now--;
    }
    return now;
}

int amida_plus(int yoko[30][12]){
    if(amida_test(yoko)==goal){
        cout<<0<<endl;
        return 1;
    }
    for(int i=0;i<col_max; i++){
        for(int j=1; j<row_max; j++){
            if(yoko[i][j+1]==0&&yoko[i][j]==0&&yoko[i][j-1]==0){
                int temp_yoko[30][12]={0};
                memcpy(temp_yoko, yoko, sizeof(int)*30*12);
                temp_yoko[i][j]=1;
                int ret = amida_test(temp_yoko);
                if(ret == goal){
                    cout<<i+1<<" "<<j<<endl;
                    return 1;
                }
            }
        }
    }
    cout<<1<<endl;
    return 0;
}




int main(){
    
    while(cin>>row_max){
        if(row_max==0)break;
        cin>>start>>goal>>col_max;
        

        
        
        int yoko[30][12]={0};

        
        for(int i=0; i<col_max; i++){
            string temp;
            cin>>temp;
            for(int j=1; j<row_max; j++){
                yoko[i][j]=temp[j-1]-'0';
            }
        }
        /*
        cout<<endl;
        for(int i=0; i<30; i++){
            for(int j=0; j<12; j++){
                cout<<"|";
                if(yoko[i][j]==1){
                    cout<<"-";
                }else{
                    cout<<" ";
                }
            }
            cout<<endl;
        }
         */
        
        amida_plus(yoko);


    }
    
    
    
    /*
     5
     2
     3
     9
     1010
     1001
     0100
     1001
     0010
     1000
     0100
     0101
     1010
     
     */
}

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

int main() {
  string X;
  cin>>X;
  if(X=="ABC") cout<<"ARC"<<endl;
  else cout<<"ABC"<<endl;
}

Measured memory_bytes: 3592
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<regex>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	int n; cin >> n;
	int m[9][9];
	bool first = true;
	rep(h, 0, n) {
		bool b[9][9] = {};
		if (!first)cout << endl;
		first = false;
		rep(i, 0, 9)rep(j, 0, 9)cin >> m[i][j];

		rep(i, 0, 9) {
			int cnt[10] = {};
			rep(j, 0, 9)cnt[m[i][j]]++;
			rep(j, 0, 9) {
				if (cnt[m[i][j]] >= 2)b[i][j] = true;
			}
		}
		rep(j, 0, 9) {
			int cnt[10] = {};
			rep(i, 0, 9)cnt[m[i][j]]++;
			rep(i, 0, 9) {
				if (cnt[m[i][j]] >= 2)b[i][j] = true;
			}
		}
		for (int i = 0; i < 9; i += 3) {
			for (int j = 0; j < 9; j += 3) {
				int cnt[10] = {};
				rep(I, i, i + 3)rep(J, j, j + 3) {
					cnt[m[I][J]]++;
				}
				rep(I, i, i + 3)rep(J, j, j + 3) {
					if (cnt[m[I][J]] >= 2)b[I][J] = true;
				}
			}
		}
		rep(i, 0, 9) {
			rep(j, 0, 9) {
				if (b[i][j])cout << "*";
				else cout << " ";
				cout << m[i][j];
			}
			cout << endl;
		}
	}
	return 0;
}

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

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

const double EPS = 1e-14;
const double PI  = acos(-1.0);


int main(){
  int n, h, w;
  cin >> n >> h >> w;
  cout << (n - h + 1) * (n - w + 1) << endl;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

MOD = 10 ** 9 + 7

ans = 1
count = 0
lst = [0] * (N + 1)
for a in A:
    if a == 0:
        ans *= (3 - count)
        count += 1
        lst[a] += 1
    else:
        ans *= lst[a - 1]
        lst[a] += 1
        lst[a - 1] -= 1
    ans %= MOD

print (ans)




Measured memory_bytes: 13964
#include<iostream>
#include<cstring>
#include<string>
using namespace std;
int l[1001],r[1001];
long long ans;
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>l[i]>>r[i];
		ans+=r[i]-l[i]+1;
	}   
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public void main(Scanner sc) {
        int n = sc.nextInt();
        int p[] = new int[n];
        for (int i = 0; i < n; i++) {
            p[i] = sc.nextInt();
        }

        int cnt = 0;
        for (int i = 0; i < n - 1; i++) {
            if (p[i] == i + 1) {
                cnt++;
                p[i] = p[i + 1];
                p[i + 1] = i + 1;
            }
        }

        if (p[n - 1] == n) {
            cnt++;
        }

        System.out.println(cnt);
    }

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


Measured memory_bytes: 50956
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vpll = vector<pll>;
using vs = vector<string>;
template <typename T>
using ost = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;
#define forn(i,n) for(int i=0; i<int(n); ++i)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define ff first
#define ss second

int main() {
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vll xs(n);
    forn(i, n) cin>>xs[i];
    ll best=0;
    int l=0, r=k-1;
    ll pre=0, mid=0, post=0;
    for (int i=l; i<=r; i++) mid += xs[i];
    for (int i=r+1; i<n; i++) post += max(0ll, xs[i]);
    for (;; l++, r++) {
        best=max(best, pre+post+max(0ll, mid));
        if (r+1==n) break;
        pre += max(0ll, xs[l]);
        post -= max(0ll, xs[r+1]);
        mid -= xs[l];
        mid += xs[r+1];
    }
    cout << best << '\n';
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (((a)%mod) * ((b)%mod)) % mod
#define rollcall cout << "I'm Sucu." << endl;
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define dmt(x, y, z) make_tuple(x, y, z)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define fi first
#define se second
// debug
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << "(" << p.first << "," << p.second << ")";return os;
}
template <typename T, typename U, typename V>
ostream &operator<<(ostream &os, const tuple<T, U, V> &t){
  os << "(" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if(it != v.begin())os << " ";os << *it;
  }return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp){
  for(auto x: mp)os << "(" << x.first << "," << x.second << ")" << endl;
  return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void PRINTF(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void PRINTF(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}
string substr(const string &str, int S1, int S2 = -1){
  if(S2 == -1)return str.substr(S1);
  return str.substr(S1, S2-S1);
}
// typedef
typedef complex<double> Point;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef tuple<int, int, int> TT;
typedef pair<int, TT> PT;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;
// int sum = accumulate(a, a+n, 0LL);
// int mx = max_element(a, a+n);
// int mn = min_element(a, a+n);
// int cnt = count(a, a+n, k);




signed main(){
  int n, l;cin >> n >> l;
  int ans = 0, mn = inf;
  rep(i,n){
    ans += l + i;
    mn = min(mn, abs(l+i));
  }
  rep(i,n)if(abs(l+i) == mn){
    ans -= l+i;
    break;
  }
  cout << ans << endl;
  return 0;
}






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

int main()
{
    long long s;
    cin >> s;
    long long result = 1e15;
    while (s >= 100)
    {
        result = min(result, abs(s % 1000 - 753));
        s /= 10;
    }
    cout << result << endl;
}


Measured memory_bytes: 256
N = int(input())
A = [0 for i in range(N + 1)]
B = [0 for j in range(N + 1)]
C = [0 for k in range(N + 1)]
dp = [[0 for o in range(3)] for l in range(N + 1)]
for i in range(N):
    A[i + 1], B[i + 1], C[i + 1] = list(map(int, input().split()))
for i in range(1, N + 1):
    dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + A[i]
    dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + B[i]
    dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + C[i]
print(max(dp[N][0], dp[N][1], dp[N][2]))

Measured memory_bytes: 36212
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
// #define MOD 1000000007
#define rp(i,n) for(int i=0;i<(n);i++)
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))
#define ot(x) cout<<(x)
#define ote(x) cout<<(x)<<endl
#define all(x) (x).begin(),(x).end()

int main(){
	int N; cin>>N;
	vi L(N);
	int maxi = 0;
	int all = 0;
	rp(i,N){
		cin>>L[i];
		all += L[i];
		maxi = max(maxi, L[i]);
	}

	if(maxi<all-maxi) ote("Yes");
	else ote("No");

}


Measured memory_bytes: 256