akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())
#define fi first
#define se second

template <class T>
void cout_vec(const vector<T> &vec){
  for(auto itr:vec) cout<<itr<<' ';
  cout<<'\n';
}

typedef pair<ll,ll> P;
const ll mod=1e9+7;

template <class T>
T comb(T n,T k){
    T ans=1;
    FOR(i,n-k+1,n+1){
        ans*=i;
    }
    FOR(i,1,k+1){
        ans/=i;
    }
    return ans;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    map<string,ll> cnt;
    rep(i,n){
      string s;
      cin>>s;
      sort(begin(s),end(s));
      cnt[s]++;
    }
    ll ans=0;
    for(auto itr:cnt){
      ans+=comb(itr.second,(ll)2);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 11264
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
using namespace __gnu_pbds; 
using namespace std;
#define ull         unsigned long long int
#define ll          long long int
#define pb          push_back
#define pii         pair<int,int>
#define F           first
#define S           second
#define vi          vector<int>
#define vli          vector<ll>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define M_PI        3.14159265358979323846
#define mp          make_pair
#define sz(x)       (int)x.size()
#define matrix      vector<vector<ll>>
#define forn(i,a,b)  for(int i=a;i<b;i++)
#define eps 0.0000000001
#define all(a)      (a).begin(),(a).end()
#define ordered_set     tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update> 
 
const long long INF = (long long) 1e16+1;
const long long mod = (long long) 998244353;
const long long hell = (long long) 1000000007;

ll power(ll x,ll y){
  ll res=1;
  while(y>0){
    if(y%2) res=(x*res);
    x=(x*x);    
    y=y/2;
  }
  
  return res;
}
 
ll modinv(ll x){
  return power(x,hell-2);
}

ll gcd(ll a,ll b){
    while( b != 0)
	{
		ll  t = b;
		b= a %t;
		a = t;
	}
	return a;
}    

void fastIO(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

void solve(){
    int x;
    cin>>x;
    x-=400;
    x/=200;
    cout<<8-x;
}    

int main(){
   fastIO();
   int test;
   //cin>>test;
   test=1;    
      
   while(test--)
   solve();
}

Measured memory_bytes: 3636
from collections import defaultdict
dic=defaultdict(int)
n=int(input())
for i in range(n):
    s=input()
    dic[s]+=1
m=int(input())
for i in range(m):
    s=input()
    dic[s]-=1

ans=float('-inf')
for i in dic.values():
    ans=max(ans,i)
print(max(ans,0))

Measured memory_bytes: 3316
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;



const int M = 2e5+1;
const int MD=1e9+7;
int cnt[M],a[M];
ll C(int x){
	return 1LL*x*(x-1)/2;
}
int main() {
	fast_cin();
	ll res=0;
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		cnt[a[i]]++;
	}
	for(int i=0;i<M;i++){
		if(cnt[i]){
			res+=C(cnt[i]);
		}
	}
	for(int i=0;i<n;i++){
		cout<<res-C(cnt[a[i]])+C(cnt[a[i]]-1)<<"\n";
	}
	return 0;
}

Measured memory_bytes: 3712
/*
 * test01.cpp
 *
 *  Created on: 2013-8-2
 *      Author: lenovo
 */
#include <iostream>
using namespace std;
int main()
{
	for(int i=1;i<10;i++){
		for(int j=1;j<10;j++){
			cout<<i<<"x"<<j<<"="<<(i*j)<<endl;
		}
	}
}

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

int main() {
  int a,b;
  cin>>a>>b;
  if(a==1&&b==2 || a==2&&b==1){
    cout<<3<<endl;
  }
  if(a==1&&b==3 || a==3&&b==1){
    cout<<2<<endl;
  }
  if(a==2&&b==3 || a==3&&b==2){
    cout<<1<<endl;
  }
}


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

#define int long long
#define MAX_N (200005)
#define debug(x) cout << #x <<":"<< x << endl;
#define debugArray(x) for(auto p:(x)) cerr << p <<" "; cerr << endl;
#define debugIdx(i, x) cerr << #i <<" : "<< i <<" "<< #x <<" : "<< x << endl;
const int MOD = (int)1e9+7;

signed main() {
	int N;
    cin >> N;
    vector<int> H(N);
    for(int i=0; i<N; i++){
        cin >> H[i];
    }

    int ans=1;
    for(int i=1; i<N; i++){
        int mx=0;
        for(int j=i-1; j>=0; j--){
            mx = max(mx, H[j]);
        }
        if(H[i] >= mx) ans++;
    }

    cout << ans << endl;

}

Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<map>
#include<string>
#include<stdio.h>
#include<math.h>
#include <algorithm>

#define PI		3.14159265358979
#define IMAX	2147483647

using namespace std;

int main(void) {

	int a, b;
	cin >> a >> b;
	int ans = 10;
	if (a < b) ans = 0;

	cout << ans;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
 
int main() {
    int h, w, K;
    cin >> h >> w >> K;
    K--;  // Kを0-indexにする
 
    vector<vector<ll>> dp(h+1, vector<ll>(w));  // dp[i+1][j] : i行目を通過した直後にj列目にいる場合の数のmodでの剰余(i,jは0-index)
 
    dp[0][0] = 1LL;
    rep(i, h) {
        rep(j, w) {
            for(int b = 0; b < (1 << (w-1)); b++) {  // bのjビット目が1ならj列目とj+1列目の間に横棒を引き、0なら引かない
                
                // 横棒がつながっていないか調べる
				int flag = 1;
				rep(L, w-2) {
					if ( (b & (1 << L)) && (b & (1 << (L+1))) ) {  // bのLビット目もL+1ビット目も1のとき
						flag = 0;  // 横棒はつながっている
					}
				}
 
                //横棒がつながっていないとき
                if(flag) {
                    // bのj-1ビット目が1だったら、j列目からj-1列目に移動する(左方向に横棒を通過する場合)
                    if( j >= 1 && (b & (1 << (j-1))) ) {
                        dp[i+1][j-1] += dp[i][j];
                        dp[i+1][j-1] %= mod;
                    }
                    // bのjビット目が1だったら、j列目からj+1列目に移動する(右方向に横棒を通過する場合)
                    else if( j <= w-2 && (b & (1 << j)) ) {
                        dp[i+1][j+1] += dp[i][j];
                        dp[i+1][j+1] %= mod;
                    }
                    // 横棒を通過せず下に降りる場合
                    else {
                        dp[i+1][j] += dp[i][j];
                        dp[i+1][j] %= mod;
                    }
                }
 
            }
        }
    }
 
    cout << dp[h][K] << endl;
    return 0;
}

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

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

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

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

template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}
mt19937 _mt(chrono::steady_clock::now().time_since_epoch().count());
ll getrnd(ll l,ll r){return uniform_int_distribution<ll>(l,r-1)(_mt);}
#define _cTime (chrono::system_clock::now())
#define progress (chrono::duration_cast<chrono::milliseconds>(_cTime-_sTime).count())
#define reset _sTime=_cTime
auto reset;

constexpr ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n,x;
	cin>>n>>x;
	ll gcdnum=gcd(n,x);
	cout<< (n-gcdnum)*3<<endl;
	
}



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

int main(){
	int n;
	cin >> n;
	vector<int> v(n);
	for(int i = 0 ; i < n ; i++ ) cin >> v[i];
	sort(v.begin(), v.end());
	vector<int> a;
	for(int i=0 ; i < min(5, (int)v.size()) ; i++ ){
		a.push_back(v[i]);
	}
	vector<int> res;
	for(int i=0 ; i < a.size() ; i++ ){
		for(int j=0 ; j < a.size() ; j++ ){
			if( i == j ) continue;
			int k = a[j], digit = 1;
			while( k ) k /= 10, digit *= 10;
			res.push_back( a[i] * digit + a[j] );
		}
	}
	sort(res.begin(), res.end());
	cout << res[2] << endl;
}

Measured memory_bytes: 1248
//
//  second.cpp
//  CoderTest
//
//  Created by yuya on 2019/07/25.
//  Copyright © 2019 yuya. All rights reserved.
//

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int (i) = 0; (i) < (int)(n); i++)
#define rep1(i,n) for(int (i) = 1; (i) <= (int)(n); i++)
#define INF 1000000
#define MOD 998244353



int main()
{
    string S;
    cin >> S;
    
    char c = 'i';
    rep(i, S.size()){
        if (c == 'i' && S[i] == 'h') {
            c = 'h';
        } else if (c == 'h' && S[i] == 'i') {
            c = 'i';
        } else {
            c = 'x';
            break;
        }
    }
    
    if (c == 'i') {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    
    
    return 0;
}



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

public class Main{

    public static final int FIRST_NUMBER = 0;
    public static final int SECOND_NUMBER = 1;

    public static void main(String[] args) throws NumberFormatException, IOException {

	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	// ???????????°
	int vertical = Integer.parseInt(br.readLine());
	// ?¨?????????°
	int horizontal = Integer.parseInt(br.readLine());

	// ???????????????????´?????????°??????????????????
	List<int[]> changeRequests = new ArrayList<>();
	for (int i = 0; i < horizontal; i++) {
	    String[] changeRequestStr = br.readLine().split(",");
	    int[] changeRequest = new int[2];
	    changeRequest[FIRST_NUMBER] = Integer.parseInt(changeRequestStr[FIRST_NUMBER]);
	    changeRequest[SECOND_NUMBER] = Integer.parseInt(changeRequestStr[SECOND_NUMBER]);
	    changeRequests.add(changeRequest);
	}

	// ?????\???????????????????´???????????????????????????????
	int[] outputArray = getDrawedArray(changeRequests, vertical, horizontal);

	// ???????????????????????????????????¨????????????????????????????????????1??????????????????
	for (int i = 1; i < outputArray.length; i++) {
	    System.out.println(outputArray[i]);
	}

    }

    /**
     * ?????? ???????????????????????????????????\??????????????????
     * 
     * @param changeRequests
     * @param vertical
     * @param horizontal
     * @return ?????\?????????
     */
    private static int[] getDrawedArray(List<int[]> changeRequests, int vertical, int horizontal) {
	// ?????\?????????????????????????????????????????????
	// ?????????????????????????????¨?????\????????????????????´???????????????outputArray[0]????????¨?????????
	int[] outputArray = new int[vertical + 1];
	for (int i = 1; i < outputArray.length; i++) {
	    outputArray[i] = i;
	}

	// ?????????????????????????£????????????\????????????
	for (int[] changeRequest : changeRequests) {
	    int mediator = 0;
	    mediator = outputArray[changeRequest[FIRST_NUMBER]];
	    outputArray[changeRequest[FIRST_NUMBER]] = outputArray[changeRequest[SECOND_NUMBER]];
	    outputArray[changeRequest[SECOND_NUMBER]] = mediator;

	}

	return outputArray;

    }

}

Measured memory_bytes: 24388
#pragma comment(linker, "/stack:200000000")
       #pragma GCC optimize ("Ofast")
        #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
         
         
        #include <iostream>
        #include <iomanip>
        #include <sstream>
        #include <cstring>
        #include <vector>
        #include <deque>
        #include <queue>
        #include <set>
        #include <map>
        #include <valarray>
        #include <iterator>
        #include <functional>
        #include <limits>
        #include <algorithm>
        #include <numeric>
        #include <cmath>
        #include <cassert>
        #include <unordered_map>
        #include <stack>
        using namespace std;
        #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
         #define trace(x) cerr << #x << ": " << x << " " << endl;
     
        typedef int64_t ll;
     
        #define endl '\n'
        #define int ll
        ll mod=1e9+7;
        ll mod1=1e9+5;
        ll power(ll a,ll b)
        {
            if(b==0) return 1;
            else if(b%2==0)
                return power((((a%mod)*(a%mod))%mod),b/2)%mod;
            else return ((a%mod)*(power((((a%mod)*(a%mod))%mod),b/2)%mod))%mod;
        }
        
          
        
        
        int32_t main()
        {
            IOS
         
            int n,k;
            cin>>n;
            vector<pair<int,int>>v(n);
            for(int i=0;i<n;++i)
            {
                cin>>v[i].first;
                v[i].second=i;
            }
            sort(v.begin(),v.end());
            for(int i=0;i<n;++i)
                cout<<v[i].second+1<<" ";

        }

Measured memory_bytes: 2432
def main():

    n, k = map(int, input().split())

    C = [[0]*(2*k) for _ in range(2*k)]

    for i in range(n):
        x, y, c = map(str, input().split())
        x, y = int(x), int(y)
        if c == 'W':
            y += k
        C[y%(2*k)][x%(2*k)] += 1

    #print(C)
    s = [[0]*(2*k+1) for _ in range(2*k+1)]
    for i in range(2*k):
        for j in range(2*k):
            s[i+1][j+1] = s[i+1][j] + s[i][j+1] - s[i][j] + C[i][j]

    #print(s)

    def count(x1, x2, y1, y2):
        return s[y2][x2]-s[y1][x2]-s[y2][x1]+s[y1][x1]

    ans = 0
    for i in range(k):
        for j in range(k):
            temp = 0
            temp += count(0, j, 0, i)
            temp += count(j, j+k, i, i+k)
            temp += count(0, j, i+k, 2*k)
            temp += count(j+k, 2*k, 0, i)
            temp += count(j+k, 2*k, i+k, 2*k)
            ans = max(ans, max(temp, n-temp))
    print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 139228
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>
#include <exception>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << endl
const ll INF = 1e+9+7;
ll n,m,l;
string s,t;
ll d[200010],dp[500][500];

int main(){
  cin >> n;
  rep(i,0,n)cin >> d[i];
  ll ans[1000];
  ll a[1000],b[1000];
  cin >> m;
  rep(i,0,m)cin >> a[i] >> b[i];
  rep(i,0,m){
    l = 0;
    rep(j,0,n)ans[j] = d[j];
    ans[a[i]-1] = b[i];
    rep(i,0,n)l += ans[i];
    print(l);
  }
  return 0;
}

Measured memory_bytes: 256
//Auuthor:Avdhoot
//Editor:Geany
//Favourite:One Piece
#include <bits/stdc++.h>
#define ll long long
#define vl vector<ll int>
#define vs vector<string>
#define v vector<int>
#define mi map<int,int>
#define mc map<char,int>

//ios_base::sync_with_stdio(false);cin.tie(NULL);

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	int n,i;
	cin>>n;
	v A(n),B(n),C;
	for(i=0;i<n;i++){
		cin>>A[i]>>B[i];
		}
		for(i=0;i<n;i++){
			if(A[i]==B[i]){C.push_back(i);}
			}
			//for(auto x:C)cout<<x <<" ";
			int m=C.size(),c=0,c1=0;
			for(i=1;i<m;i++){
				if((C[i]-C[i-1])==1){c++;c1=max(c,c1);}
				else{c=0;c1=max(c,c1);}
				}
				if((c1+1)>=3){cout<<"Yes" <<"\n";}
				else{cout<<"No" <<"\n";}  
}


Measured memory_bytes: 3660
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
typedef long long ll;
#define M 200005
map<string,int> op;
string al[M];
int ans[M];
//int read(){
//	int l=0,f=1;char ch=getchar();
//	while(ch<'0'||ch>'9'){if(ch=='-')f=0;ch=getchar();}
//	while(ch>='0'&&ch<='9'){l=(l<<1)+(l<<3)+(ch^'0');ch=getchar();}
//	return f?l:-l;
//}
int main(){
	int m,ct=0,uk=0;
	scanf("%d",&m);
	for(int i=1;i<=m;++i){
		cin>>al[++ct];
		if(op[al[ct]])++ans[op[al[ct]]],--ct;
		else op[al[ct]]=ct;
	}
	m=0;
	for(int i=1;i<=ct;++i)uk=max(uk,ans[i]);
	for(int i=1;i<=ct;++i)if(ans[i]==uk)al[++m]=al[i];
	sort(al+1,al+1+m);
	for(int i=1;i<=m;++i)cout<<al[i]<<endl;
	return 0;
}

Measured memory_bytes: 26880
#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
//priority_queue<int, vector<int>, greater<int> > pq;
#define _CRT_SECURE_NO_DEPRECATE
const int N = 33003;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =  1e9+7;
using namespace std;
//ll n,s;

int main(){
ll a,b,c;
cin>>a>>b>>c;
if(!(a%2)||!(b%2)||!(c%2))
{
	cout<<0;
	return 0;
}
if(a<b)
swap(a,b);
if(a<c)
swap(a,c);
cout<<b*c;
}

Measured memory_bytes: 256
import Control.Applicative

import Control.Monad
    (replicateM, when)
    
type Problem = [Int]

type Result = Int

solve :: Problem -> Result

solve (x:xs)
    = sub x x xs
    
sub :: Int -> Int -> [Int] -> Int

sub m c []
    = max m c
        
sub m c (x:xs)
    | x > c + x && x > m
        = sub x x xs
        
    | x > c + x
        = sub m x xs
        
    | m > c + x
        = sub m (c + x) xs
        
    | otherwise
        = sub (c + x) (c + x) xs
        
main :: IO ()

main
    = do
        n <- readLn
        when (n /= 0) $ do
            print =<< solve <$> replicateM n readLn
            main

Measured memory_bytes: 4952
#include<stdio.h>
int main()
{
    int i,sum,A,B;
    int a[100002];
    int b[100002]={0};
    sum=0;
    for(i=10000;i<100002;i++)
    {
        if((i/10000)==(i%10)&&(i/1000-(i/10000)*10)==((i%100-i%10)/10))
        {
            sum++;
            b[i]=1;
        }
        a[i]=sum;
    }
    while(scanf("%d%d",&A,&B)!=EOF)
    {
        if(b[A]==1)
            printf("%d\n",a[B]-a[A]+1);
        else
            printf("%d\n",a[B]-a[A]);
    }
    return 0;
}


Measured memory_bytes: 896
using System;
using System.Linq;
using System.Collections.Generic;

namespace ABC
{
    class ProgramB
    {
        static void Main(string[] args)
        {
            var n = long.Parse(Console.ReadLine());
            long[] resultCount = new long[4];
            string[] resultList = new string[] { "AC", "WA", "TLE", "RE" };

            for (var i = 0; i < n; i++)
            {
                var s = Console.ReadLine();
                for (var j = 0; j < 4; j++)
                {
                    if (s == resultList[j])
                    {
                        resultCount[j]++;
                    }
                }

            }

            for (var i = 0; i < 4; i++)
            {
                Console.WriteLine(resultList[i] + " x " + resultCount[i]);
            }
        }
    }
}


Measured memory_bytes: 30668
using AtCoderBeginnerContest123.Questions;
using AtCoderBeginnerContest123.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace AtCoderBeginnerContest123.Questions
{
    public class QuestionA : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var antennas = new int[5];
            for (int i = 0; i < 5; i++)
            {
                antennas[i] = inputStream.ReadInt();
            }
            var range = inputStream.ReadInt();

            yield return antennas[4] - antennas[0] > range ? ":(" : "Yay!";
        }
    }
}

namespace AtCoderBeginnerContest123
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionA();    // 問題に合わせて書き換え
            var answers = question.Solve(Console.In);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
        }
    }
}

#region Base Classes

namespace AtCoderBeginnerContest123.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }

}

#endregion

#region Extensions

namespace AtCoderBeginnerContest123.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);
    }
}

#endregion

Measured memory_bytes: 11092
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int main(){
  int N;
  //vector<pair<int,int> >ans;
  while(cin>>N,N){
    int Map[N+300][N+300];
    vector<pair<int,int> >pii;
    for(int i=0;i<N+300;i++)
      for(int j=0;j<N+300;j++)
	Map[i][j]=-1;
    Map[(N+300)/2][(N+300)/2]=1;
    pii.pb(mp((N+300)/2,(N+300)/2));
    for(int i=0;i<N-1;i++){
      int n,d;
      cin>>n>>d;
      switch(d){
      case 0:
	Map[pii[n].F][pii[n].S-1]=1;
	pii.pb(mp(pii[n].F,pii[n].S-1));
	break;
      case 1:
	Map[pii[n].F+1][pii[n].S]=1;
	pii.pb(mp(pii[n].F+1,pii[n].S));
	break;
      case 2:
	Map[pii[n].F][pii[n].S+1]=1;
	pii.pb(mp(pii[n].F,pii[n].S+1));
	break;
      case 3:
	Map[pii[n].F-1][pii[n].S]=1;
	pii.pb(mp(pii[n].F-1,pii[n].S));
	break;
      }
    }
    int left=N+INF-10000;
    int right=-1;
    int up=N+INF-10000;
    int down=-1;
    for(int i=0;i<N+300;i++){
      for(int j=0;j<N+300;j++){
	if(Map[i][j]==1){
	  right=max(right,j);
	  left=min(left,j);
	}
	if(Map[j][i]==1){
	  up=min(up,j);
	  down=max(down,j);
	}
      }
    }
    //ans.pb(mp(right-left+1,down-up+1));
    //cout<<right<<" "<<left<<" "<<down<<" "<<up<<endl;
    cout<<right-left+1<<" "<<down-up+1<<endl;
  }
  //for(int i=0;i<ans.size();i++)
  //cout<<ans[i].F<<" "<<ans[i].S<<endl;
  return 0;
}

Measured memory_bytes: 3980
import Control.Applicative
import Control.Monad
import Data.List
import Data.Array
import Data.Char

main = do
  n <- (read::String -> Int) <$> getLine
  arr <- sort . flip zip [1..n] . map (read::String -> Int) . words <$> getLine
  forM arr (\(place, index) -> putStr $ show index ++ " ")
  putStrLn ""

Measured memory_bytes: 36348
toInt :: String -> Int
toInt = read :: String -> Int

calcTrapezoidArea :: Int -> Int -> Int -> Int
calcTrapezoidArea a b h = (a + b) * (h `div` 2)

main = do
  a <- getLine
  b <- getLine
  h <- getLine
  putStrLn $ show $ calcTrapezoidArea (toInt a) (toInt b) (toInt h)

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

int main(int argc, const char * argv[]) {
    
    int N;
    int p[21];
    int i;
    int count = 0;
    
    cin >> N;
    for(i=0; i<N; i++){
        cin >> p[i];
    }
    
    for(i=0; i<N-2; i++){
        if((p[i] <= p[i+1] && p[i+1] <= p[i+2]) || (p[i] >= p[i+1] && p[i+1] >= p[i+2])){
            count++;
        }
    }
    
    cout << count;
    
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

#define vi vector<int>
#define vl vector<long long>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPD(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FORD(i, a, b) for (int i = (int)(a); i >= (int)(b); i--)
#define INF 1e18
#define MOD 1e9+7

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

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

const int MAX_N = 200010;
int A[MAX_N];
int seen[MAX_N];

int main() {
    ll N, K;
    cin >> N >> K;
    REP(i, N) {
        cin >> A[i];
        --A[i];
    }
    REP(i, N) {
        seen[i] = -1;
    }
    int cnt = 1;
    int temp = A[0];
    seen[0] = 0;
    REP(i, N) {
        if (cnt == K) {
            cout << temp+1 << endl;
            break;
        }
        if (seen[temp] != -1) {
            int loop = cnt - seen[temp];
            int resid = (K-cnt)%loop;
            REP(j, resid) {
                temp = A[temp];
            }
            cout << temp+1 << endl;
            break;
        }
        seen[temp] = cnt;
        temp = A[temp];
        cnt += 1;
    }
    return 0;
}

Measured memory_bytes: 5184
function parseInt(x) parse(Int, x) end
parseMap(x::Array{SubString{String}, 1}) = map(parseInt, x)

function main()
	n, m = parseMap(split(readline()))
	x = [Int64[] for i in 1:n]
	for i in 1:m
		a, b = parseMap(split(readline()))
		push!(x[a], b)
		push!(x[b], a)
	end
	flg = 0
	for i in 2:n-1
		if 1 in x[i] && n in x[i]
			print("POSSIBLE")
			flg = 1
			break
		end
	end
	if flg == 0
		print("IMPOSSIBLE")
	end
end

main()

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

using namespace std;
typedef long long ll;

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

void solve() {
  int i = 0;
  ll H, count = 0;
  cin >> H;
  while(H != 0) {
    H /= 2;
    count += pow(2, i);
    i++;
  }
  cout << count << endl;
}

signed main() {
  solve();

  return 0;
}

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

int main(void){
    int a, b, c;
    cin >> a >> b >> c;
    if ((a == b && a != c) || (b == c && b != a) || (c == a && c != b)) { 
        cout << "Yes" << endl;        
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pii;
typedef vector< pii > vii;

#define ll          long long
#define ff          first
#define ss          second
#define pb          push_back
#define mkp         make_pair
#define sz          size()

#define forf(a,b,c)    for(int i=a;i<=b;i+=c)
#define forr(a,b,c)    for(int i=a;i>=b;i-=c)
#define all(a)      a.begin(),a.end()
#define mem(a,b)    memset(a,b,sizeof(a))
#define pi          2*acos(0.0)
#define End         return 0;

#define scan1(a)    scanf("%d",&a)
#define scan2(a,b)  scanf("%d %d",&a,&b)
#define scan3(a,b,c)  scanf("%d %d %d",&a,&b,&c)
#define scanl(a)    scanf("%lld",&a)
#define scanll(a,b) scanf("%lld %lld",&a,&b)
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)

#define print1(a)    printf("%d",a)
#define print2(a,b)  printf("%d %d",a,b)
#define print3(a,b,c)  printf("%d %d %d",a,b,c)
#define printl(a)    printf("%lld",a)
#define printll(a,b) printf("%lld %lld",a,b)
#define printlll(a,b,c) printf("%lld %lld %lld",a,b,c)

#define MAXN        100000007
#define INF 0x3f3f3f3f
//int dx[]={+1,-1,+0,+0};///Four Directions
//int dy[]={+0,+0,+1,-1};///Four directions
//int dx [] = {+1,-1,+0,+0,-1,-1,+1,+1};///Eight Directions
//int dy [] = {+0,+0,+1,-1,+1,-1,-1,+1};///Eight Directions

//int mark[10007];vi prime;void seive(){for(int i=2;i<10000;i++){if(mark[i]==0){prime.pb(i);for(int j=i+i;j<=10000;j+=i)mark[j]=1;}}}

//freopen("input.txt", "r", stdin);

int boss[200007];
int main()
{
   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

   int n; cin>>n;


   for(int i=1;i<n;i++){
    int c; cin>>c;
    boss[c]++;
   }

   for(int i=1;i<=n;i++) cout<<boss[i]<<endl;

   End;
}


Measured memory_bytes: 4432
#include<iostream>
#include<queue>
#include<map>
#include<string>
#include<string.h>
using namespace std;

int island[12][12];
bool visited[12][12];
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
  string s;
  while(cin>>s) {
    memset(island, 0, sizeof(island));

    for(int i=0; i<12; ++i)
      if(s[i] == '1') island[0][i] = 1;

    for(int i=0; i<11; ++i) {
      cin>>s;
      for(int j=0; j<12; ++j) {
	if(s[j] == '1') island[i+1][j] = 1;
      }
    }

    int ans = 0;
    for(int i=0; i<12; ++i) {
      for(int j=0; j<12; ++j) {
	if(island[i][j] == 1) {
	  ans++;
	  queue< pair<int,int> > Q;
	  Q.push(pair<int,int>(i,j));
	  while(!Q.empty()) {
	    pair<int,int> p = Q.front(); Q.pop();
	    int x = p.first,y = p.second;
	    island[x][y] = 2;
	    for(int k=0; k<4; ++k) {
	      if(x+dx[k] >= 0 && x+dx[k] < 12 && y+dy[k] >= 0
		 && y+dy[k] < 12 && island[x+dx[k]][y+dy[k]] == 1)
		Q.push(pair<int,int>(x+dx[k],y+dy[k]));
	    }
	  }
	}
      }
    }

    cout<<ans<<endl;
  }
}

Measured memory_bytes: 6688
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#ifdef rd
#define trace(...) cout<<"Line:"<<__LINE__<<" "; __f(#__VA_ARGS__, __VA_ARGS__)
template<typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
	cout<<name<<" : "<<arg1<<endl;
}
template<typename Arg1, typename ... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
	const char *comma=strchr(names+1,',');
	cout.write(names,comma-names)<<" : "<<arg1<<" | ";
	__f(comma+1,args...);
}
#else
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef float f80;
#define double long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
const ll infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;
//const int mod=998244353;
const int mod=1000000007;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;
auto clk=clock();
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
int powm(int a, int b, int mod) {
	int res=1;
	while(b) {
		if(b&1)
			res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}
int a[200005];
int b[200005];


void solve()
{
  int n;
  cin>>n;
  fr(i,1,n+1)
   cin>>a[i];
    fr(i,1,n)
   cin>>b[i];
      int cnt=0;
      fr(i,1,n)
      {
          if((a[i]+a[i+1])< b[i])
           {
               cnt+=(a[i]+a[i+1]);
           a[i]=a[i+1]=0;
           }
          else
          {
              cnt+=b[i];
              if(a[i]<=b[i])
               {

                    b[i]=b[i]-a[i],a[i]=0,a[i+1]-=b[i] ;
               }
              else
                a[i]-=b[i];
          }
      }
      cout<<cnt;


}



signed main() {
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	srand(chrono::high_resolution_clock::now().time_since_epoch().count());
	cout<<fixed<<setprecision(10);
	int t=1;
 	//cin>>t;
	fr(i,1,t) {
		solve();
	}
#ifdef rd
	cout<<endl<<endl<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
#endif
	return 0;
}
/// template by rahuldugar






Measured memory_bytes: 1792
#include <iostream>
#include <set>
#include <vector>

using namespace std;

const int MAX_N = 2e5 + 5;

int root [MAX_N];

int find (int u) {
  if (root[u] != u) {
    root[u] = find(root[u]);
  }
  return root[u];
}

void merge (int u, int v) {
  u = find(u);
  v = find(v);

  root[u] = v;
}

pair<int, int> mmex (const vector<int> &v) {
  set<int> unseen;
  for (int i = 0; i < (int) v.size() + 3; i++) {
    unseen.insert(i);
  }

  for (int u : v) {
    unseen.erase(u);
  }

  pair<int, int> ans;
  ans.first = *unseen.begin();
  unseen.erase(ans.first);
  ans.second = *unseen.begin();
  return ans;
}

int pre [MAX_N];
int nxt [MAX_N];
vector<int> adj [MAX_N];

pair<int, int> vals [MAX_N];
void dfs (int u) {
  for (int v : adj[u]) {
    dfs(v);
  }

  vector<int> chv;
  for (int v : adj[u]) {
    chv.push_back(vals[v].first);
  }

  vals[u] = mmex(chv);
}

int rval [MAX_N];

int main () {
  ios::sync_with_stdio(false);

  int n;
  cin >> n;

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

  int cycroot;
  for (int i = 1; i <= n; i++) {
    cin >> pre[i];

    if (find(i) == find(pre[i])) {
      cycroot = i;
    }

    merge(i, pre[i]);
  }

  int cur = cycroot;
  do {
    nxt[pre[cur]] = cur;
    cur = pre[cur];
  } while (cur != cycroot);

  for (int i = 1; i <= n; i++) {
    if (i != nxt[pre[i]]) {
      adj[pre[i]].push_back(i);
    }
  }

  for (int i = 1; i <= n; i++) {
    if (nxt[i] != 0) {
      dfs(i);
    }
  }

  // try both ways to assign to nxt[cycroot]
  rval[nxt[cycroot]] = vals[nxt[cycroot]].first;
  cur = cycroot;
  do {
    if (rval[nxt[cur]] == vals[cur].first) {
      rval[cur] = vals[cur].second;
    } else {
      rval[cur] = vals[cur].first;
    }
    cur = pre[cur];
  } while (cur != cycroot);

  if (rval[nxt[cycroot]] == vals[nxt[cycroot]].first) {
    cout << "POSSIBLE" << endl;
    return 0;
  }

  rval[nxt[cycroot]] = vals[nxt[cycroot]].second;
  cur = cycroot;
  do {
    if (rval[nxt[cur]] == vals[cur].first) {
      rval[cur] = vals[cur].second;
    } else {
      rval[cur] = vals[cur].first;
    }
    cur = pre[cur];
  } while (cur != cycroot);

  if (rval[nxt[cycroot]] == vals[nxt[cycroot]].second) {
    cout << "POSSIBLE" << endl;
    return 0;
  }

  cout << "IMPOSSIBLE" << endl;
}


Measured memory_bytes: 12544
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <list>
#include <cmath>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <vector>
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
// const ll MOD = 1000000009;

int main() {
    ll x, y, z, k;
    cin >> x >> y >> z >> k;
    vector<ll> A(x), B(y), C(z);
    for (auto & a : A) {
        cin >> a;
    }
    for (auto & b : B) {
        cin >> b;
    }
    for (auto & c : C) {
        cin >> c;
    }
    sort(A.begin(), A.end(), greater<ll>());
    sort(B.begin(), B.end(), greater<ll>());
    sort(C.begin(), C.end(), greater<ll>());
    auto c = [](const pair<ll, tuple<ll,ll,ll>> & left, const pair<ll, tuple<ll,ll,ll>> & right) { return left.first < right.first;};
    priority_queue<pair<ll, tuple<ll,ll,ll>>, vector<pair<ll, tuple<ll,ll,ll>>>, decltype(c) > q(c);
    set<tuple<ll,ll,ll>> Used;
    q.push(make_pair(A[0] + B[0] + C[0], make_tuple(0,0,0)));
    for (ll i = 0; i < k; ++i) {
        auto p = q.top();
        auto a = get<0>(p.second);
        auto b = get<1>(p.second);
        auto c = get<2>(p.second);
        //cerr << "a = " << a << ", b = " << b << ", c = " << c << endl;
        cout << p.first << endl;
        q.pop();
        if (a+1 < x && Used.find(make_tuple(a+1,b,c)) == Used.end()) {
            q.push(make_pair(A[a+1]+B[b]+C[c], make_tuple(a+1, b, c)));
            Used.insert(make_tuple(a+1, b, c));
        }
        if (b+1 < y && Used.find(make_tuple(a,b+1,c)) == Used.end()) {
            q.push(make_pair(A[a]+B[b+1]+C[c], make_tuple(a, b+1, c)));
            Used.insert(make_tuple(a, b+1, c));
        }
        if (c+1 < z && Used.find(make_tuple(a,b,c+1)) == Used.end()) {
            q.push(make_pair(A[a]+B[b]+C[c+1], make_tuple(a, b, c+1)));
            Used.insert(make_tuple(a, b, c+1));
        }
    }
    
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
#define xx first
#define yy second
#define ll long long
using namespace std;

const int N = 200000 + 5;
int a[N], n;
int stk[N], top;

int main () {
	scanf ("%d", &n);
	for (int i = 1; i <= n; ++i) {
		scanf ("%d", &a[i]);
	}
	stk[1] = 1;
	top = 1;
	for (int i = 2; i <= n; ++i) {
		if (a[i] <= a[stk[top]]) {
			stk[++top] = i;
		}
		else {
			int l = 1, r = top;
			while (l < r) {
				int mid = (l + r) / 2;
				if (a[stk[mid]] < a[i]) {
					r = mid;
				}
				else {
					l = mid + 1;
				}
			}
			stk[l] = i;
		}
	}
	printf ("%d\n", top);
	return 0;
}






















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

int main() {
  string s;
  int s1, s2, s3;
  
  int answer;
  
  cin >> s;
  
  s1 = (int) s[0] - 48;
  s2 = (int) s[1] - 48;
  s3 = (int) s[2] - 48;
  answer = s1 + s2 + s3;
  
  cout << answer << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl;
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
// }}} End Header


int main() {
	ll n, ans = 0;
	cin >> n;
	for(ll i=1; i<=n; i++){
		for(ll j=i; i*j<n; j++){
			if(n-i*j > 0){
				if(i!=j) ans+=2;
				else ans++;
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3616
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(1,n-1):
  pre=p[i-1]
  cur=p[i]
  nex=p[i+1]
  if (pre<cur and cur<nex) or(pre>cur and cur>nex):
    ans+=1
print(ans)

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

#pragma GCC optimize "O3"
#define rep(i,a,n) for(long long i=a; i<n; i++)
typedef long long ll;
typedef pair<int,int> P;
const ll MOD = (int)1e9+7;
const ll INF = MOD*MOD;
const double EPS = 1e-9;
const ll powll = 1LL<<1;

/*
while(!frag && cin >> a >>b, a|b)
*/

int main(void){
    int n; cin >> n;
    int ans = 0;

    rep(i,1,n+1){
        ans += (n-1)/i;
        
    }

    cout << ans << "\n";
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define initdp(a, b)  for (int i = 0; i <= a; i++)   for (int j = 0; j <= b; j++) dp[i][j] = -1;
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define ll long long
#define pll pair<ll, ll>
#define all(arr) arr.begin(), arr.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repd(i, n) for (int i = n - 1; i >= 0; i--)
#define fo(i, l, r) for (int i = l; i <= r; i++)
#define inf 1000000001
#define inf1 1000000000000000001
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 1000005
#define mid(l, r) l + (r - l) / 2
#define veci vector<int>
#define vecl vector<ll>
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define umapi unordered_map<ll, ll>
#define umapc unordered_map<char, int>
#define endl "\n"
#define pui pair<int, pair<int,int> >
using namespace std;

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

   string s;
   cin>>s;

   if(s.size() <= k) {
       cout<<s;
   } else {
       cout<<s.substr(0,k)<<"...";
   }

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



Measured memory_bytes: 3648
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<array>
#include<vector>
#include<functional>
#include<unordered_map>
#include<map>
#include<numeric>
#include<limits>
#include<utility>
#include<queue>
#include<random>
using namespace std;

int main(void) {
	string str;
	cin >> str;

	replace(str.begin(), str.end(), ',', ' ');



	cout << str << endl;

	return 0;
}

Measured memory_bytes: 256
#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<string.h>
#define ll long long int
#define MOD 1000000007LL
using namespace std; 
ll keta(ll n){
    int d=0;
    while(n>0){
        n/=10;
        d++;
    }
    return d;
}
int main() {
    ll n;
    cin>>n;
    int ans=keta(n);
    for(ll a=1;a<=sqrt(n);a++){
        if(n%a!=0){
            continue;
        }
        ll b=n/a;
        int c=keta(max(a,b));
        if(c<ans){
            ans=c;
        }
    }
    cout<<ans<<endl;
}

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

using namespace std;

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

	int n;
	cin >> n;
	vector<int> v(n);
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}
	
	int ans = 1;
	int ssf = v[0];
	for (int i = 1; i < n; i++) {
		if (v[i] < ssf) {
			ssf = v[i];
			ans++;
		}
	}

	cout << ans;

}

Measured memory_bytes: 1024
#include "bits/stdc++.h"

#define REP(i, n) for(decltype(n) i = 0; i < (n); i++)
#define REP2(i, x, n) for(decltype(x) i = (x); i < (n); i++)
#define REP3(i, x, n) for(decltype(x) i = (x); i <= (n); i++)
#define RREP(i, n) for (decltype(n) i = (n) - 1;i >= 0; i--)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

#define LL long long int
#define LD long double

#define INF 1000000000
#define PI 3.14159265358979

#define _CRT_SECURE_NO_WARNINGS

using namespace std;

// N, E, S, W
const int dx[4] = { -1, 0,  1,  0 };
const int dy[4] = { 0, 1,  0, -1 };

typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<LL> vll;
//==============================================

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

	double x; cin >> x;
	cout << (int)pow(x, 3) << "\n";
	return 0;
}

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

int main(){
    int ans=0;
    string S;
    for (int i=0; i<4; i++) cin >> S[i];
    for (int i=0; i<4; i++){
        if (S[i]=='+') ans++;
        else ans--;
    }
    cout << ans;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<functional>
#include<numeric>
#include<queue>
#include<stack>
#include<map>
#include<unordered_map>
#include<set>
#include<bitset>
#include<random>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0LL,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,n) RFOR(i,0LL,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define COUNT(a,y,x) upper_bound(all(a), y) - lower_bound(all(a), x)
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end())
#define pb push_back
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
const ll inf = 1LL << 61;
const ll mod = 1000000007LL;
//const ll mod = 998244353LL;

ll n = 0, m = 0, ans = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok;
ll dx[9] = { 0,1,0,-1,0,1,1,-1,-1 }, dy[9] = { 0,0,1,0,-1,1,-1,1,-1 };
#define endl '\n'
#pragma endregion
#define MAX 222222






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


  cin >> s;
  ok = true;
  rep(i, 3) if (s[i] == s[i + 1]) ok = false;
  if (ok) cout << "Good" << endl;
  else cout << "Bad" << endl;


  

  return 0;
}

Measured memory_bytes: 256