akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<string>
#include<stdio.h>
#include<stdlib.h>
#include<float.h>
#include<tuple>
#include<string.h>
#include<iomanip>
#include<stack>
#include<queue>

using namespace std;
#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
#define ALLOF(c) (c).begin(), (c).end()
#define Pa pair<ll,ll>
const ll mod=1000000007;
const ll INF=10e12;
const ll inf=-1;
ll ABS(ll a){return max(a,-a);}

bool isok(ll X){
    vector<ll> KETA(9);
    rep(i,9){
        KETA.at(i)=X%10;
        X/=10;
    }
    bool san=false,go=false,nana=false;
    rep(i,9){
        if(KETA.at(i)==3) san=true;
        if(KETA.at(i)==5) go=true;
        if(KETA.at(i)==7) nana=true;
    }
    if(san && go && nana) return true;
    else return false;
}

int main(void){
    ll N;
    cin>>N;
    vector<ll> A(0);
    queue<ll> que;
    que.push(3);
    que.push(5);
    que.push(7);
    
    while(!que.empty()){
        A.push_back(que.front());
        if(que.front()<100000000){
            que.push(que.front()*10+3);
            que.push(que.front()*10+5);
            que.push(que.front()*10+7);
        }
        que.pop();
    }
    ll ans=0;
    rep(i,A.size()){
        if(A.at(i)>N) break;
        if(isok(A.at(i))) ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 768
unittest
{
	assert( [ "3 20" ].parse.expand.solve == 3 );
	assert( [ "25 100" ].parse.expand.solve == 3 );
	assert( [ "314159265 358979323846264338" ].parse.expand.solve == 31 );
}



import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto xy = input.front.split.to!( long[] );
	return tuple( xy[ 0 ], xy[ 1 ] );
}

auto solve( long x, long y )
{
	auto l = 0L;
	auto n = x;
	
	while( n <= y )
	{
		l++;
		n *= 2;
	}
	
	return l;
}


Measured memory_bytes: 256
N = int(input())
D,X = map(int, input().split())
A = []
for i in range(N):
    A.append(int(input()))
    
chocos= [0]*N
for i in range(N):
    day = 1
    while day<=D:
        chocos[i] += 1
        day += A[i]
        
print(sum(chocos)+X)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>

using namespace std;

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

    vector<long long int> vec(100000,0);
    int a,b;
    for (int i = 0; i < N; ++i) {
        cin >> a >> b;
        vec[a] += b;
    }
    long long int count = 0;
    long long int nowK = 0;
    while(1){
        count += vec[nowK];

        if(K <= count){
            cout << nowK << endl;
            return 0;
        }
        nowK++;
    }

}

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

int main()
{
int n;cin>>n;
int a[n];
for(int i=0;i<n;i++)
	cin>>a[i];
sort(a,a+n);
 double dp[n];
 dp[0]=(double)a[0];
for(int i=1;i<n;i++)
	dp[i]=(a[i]+dp[i-1])/2.0;
printf("%.14f",dp[n-1]);
return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    long long a,b,k;
    long long i=0;
    scanf("%lld %lld %lld",&a,&b,&k);
 
    if(a>=k)
    {
        printf("%lld %lld",a-k,b);
    }
    else if(a<=k && (a+b)>=k)
    {
        printf("0 %lld",b-(k-a));
    }
    else {printf("0 0");}
}

Measured memory_bytes: 2136
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int lim = 1e5+7;
vector<int> adj[lim];
vector<int> dis(lim,0);
vector<int> top;
vector<bool> vis(lim,false);

void dfs(int v){
    vis[v]=true;
    for(int u:adj[v]){
        if(!vis[u]){
            dfs(u);
        }
    }
    top.push_back(v);
}

int main(){
    int n,m;
    cin>>n>>m;
    while(m--){
        int x,y;
        cin>>x>>y;
        adj[x].push_back(y);
    }
    int ans = 0;
    for(int i=1;i<=n;i++){
        if(!vis[i]) dfs(i);
    }
    reverse(top.begin(),top.end());
    for(int v:top){
        for(int u:adj[v]){
            dis[u]=max(dis[u],dis[v]+1);
            ans=max(ans,dis[u]);
        }
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 8828
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <climits>
#include <cmath>
#include <algorithm>
#include <cassert>

#define TEST_ASSERT(msg, cond) do { if (cond) { cout << msg << " => pass" << endl;} else { cout << msg << " => failed" << endl;} } while(0)

using namespace std;

int main() {

  int N;

  cin >> N;

  vector<int> an(N);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    an[i] = a;
  }

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

  int alice = 0;
  int bob = 0;
  bool isAliceTurn = true;
  for (int i = N - 1; i >= 0; i--) {
    if (isAliceTurn) {
      alice += an[i];
      isAliceTurn = false;
    }
    else {
      bob += an[i];
      isAliceTurn = true;
    }
  }

  cout << alice - bob << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <vector>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <stack>
#include <utility>
#include <queue>
using namespace std;
typedef long long int lld;
typedef pair<int, int> pii;



int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector <pii> E;
  for (int i = 1; i <= n; i++) {
    int match = n-i + (n&1 ? 0 : 1);
    for (int j = i+1; j <= n; ++j) {
      if (j == match) continue;
      E.push_back({i, j});
    }
  }
  cout << E.size() << "\n";
  for (auto e : E) {
    cout << e.first << " " << e.second << "\n";
  }
  return 0;
}

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

using namespace std;

int in(){ int a; cin >> a; return a; }
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

int main(){
  ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(0); cerr.tie(0);
  int a = in();
  cout << a + a*a + a*a*a << endl;
  return 0;
}



Measured memory_bytes: 3648
void main() {
	auto ip = readAs!(long[]), N = ip[0], K = ip[1];
	auto A = readAs!(ulong[]);
	ulong res;
	ulong[] c = new ulong[](64);
	foreach(v; A) foreach(i; 0..64) if(v & (1UL << i)) c[i]++;
	
	foreach(i; -1..64) {
		if(i != -1 && !(K & (1UL << i))) continue;
		auto X = K; X &= ~(1UL << i);
		ulong tmp;
		foreach(j; 0..64) {
			auto mask = (1UL << j);
			if(j < i) {
				tmp += max(c[j], N - c[j]) * mask;
			} else if(j == i) tmp += c[j] * mask;
			else {
				if(K & mask) tmp += (N - c[j]) * mask;
				else tmp += c[j] * mask;
			}
		}
		debug tmp.writeln;
		res = max(res, tmp);
	}
	res.writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


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

using namespace std ;

#define sz(v) (int)v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )
#define PI acos( -1.0 )
#define forn( t , v , be , n ) for( t v = be ; v < n ; v++ )
#define fore( x , j ) for( auto x : j )
#define se second
#define fr first
//#define c_b fflush(stdin);

const ll Long_max = numeric_limits < ll > :: max() ;
const int Int_max = numeric_limits < int > :: max() ;

void File_input( string pathIn ) {
    freopen( pathIn.c_str(), "r", stdin ) ;
}

void File_output( string pathOut ) {
    freopen( pathOut.c_str(), "w", stdout ) ;
}

int msg() {
    srand( time( 0 ) ) ;
    vector < string > st = {
        "Wish everyone high ratings!",
        "Good luck!",
        "Have fun!",
        "Please, read all the problems!",
        "Go Go fight!"
    } ;
    cerr << st[ rand() % sz( st ) ] ;
    return 0 ;
}

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

int main() {

   string a , b , tmp = "" ;
   cin >> a >> b ;
   int j = 0 ;
   forn( int , i , 0 , sz( a ) ){
       if( a[ j ] == b[ i ] ){
         tmp += b[ i ] ;
         j++;
       }
   }

   if( j != sz( a ) ){
      tmp = a.substr( j ) + tmp ;
   }


   if( tmp == b ){
     cout << "Yes\n" ;
   } else cout << "No\n" ;


    return 0 ;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<ll>;
using VV = vector<VI>;
using VS = vector<string>;

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,b) FOR(i, 0, b)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<'\n'
#define p2(s, t) cout << (s) << " " << (t) << '\n'
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << '\n'

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

    // input
    ll N; cin >> N;
    
    string s; cin >> s;
    ll cnt = 0;
    rep(i, N-1){
      if(s[i]!=s[i+1]) cnt++;
    }
    p(cnt+1);

    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
void display(int a[], int n) {
    for(int i = 0; i < n; i++) {
        if(i > 0) printf(" "); 
        printf("%d", a[i]);
    }
    printf("\n");
}
void insertion_sort(int a[], int n) {
    int j;
    int v;
    for(int i = 1; i < n; i++) {
        v = a[i];
        j = i - 1;
        while(j >= 0 && a[j] > v) {
            a[j+1] = a[j];
            j--;
        }
        a[j+1] = v;
        display(a, n);
    }
}
int main(){
    int n;
    scanf("%d", &n);
    int a[100];
    for(int i = 0; i < n; i++) scanf("%d", &a[i]);
    display(a, n);
    insertion_sort(a, n);
    return 0;
}


Measured memory_bytes: 3212
#include<bits/stdc++.h>
using namespace std;
string s;
char ch[10000];
int n;
int main()
{
	cin>>s;
	for(int i=0;i<s.size();i++){
		if(s[i]=='0') ch[++n]='0';
		else if(s[i]=='1') ch[++n]='1';
		else{
			if(n){
				n--;
			}
		}
	}
	for(int i=1;i<=n;i++) cout<<ch[i];
	return 0;
}


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

#define INF 1e18
#define REP(i, n) for (int i=0; i<n; i++)
#define print(x) cout << x << endl
#define debug(x) cout << #x << " = "<< x << endl

const double PI=3.141592653589793238462643383279502884197169399375105820974944;

typedef long long ll;

using namespace std;

void solve() {
    int N, X;
    cin >> N >> X;
    vector<int> m(N);
    REP(i, N) cin >> m[i];
    
    sort(m.begin(), m.end());

    int total = 0;
    REP(i, N) total += m[i];

    int ans = N;
    ans += (X - total) / m[0];
    print(ans);
}

signed main() {
    solve();
}


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

int main() {
  int n, k, m = 10e9;
  cin >> n >> k;
  vector<int> v(n);
  rep(i, n) cin >> v[i];
  sort(v.begin(), v.end());
  rep(i, n-k+1) m = min(m, v[k+i-1] - v[i]);
  cout << m << endl;
  return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>

#define rep(i,n) for (long long int i = 0; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define INF 100000000000
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using P = pair<int, int>;

// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

int main()
{
    ll n, k , q, tmp;
    cin >> n >> k >> q;
    vector<int> a(n);
    rep(i,n) a[i] = k;
    rep(i,q) {
        cin >> tmp;
        tmp--;
        a[tmp]++;
    }

    rep(i,n) a[i] -= q;
    rep(i,n) {
        if(a[i] > 0)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
ll bpow(ll b, ll p, ll m = 1000000007LL) {
  ll rt = 1;
  for (; p; p >>= 1, b = b * b % m)
    if (p & 1)
      rt = rt * b % m;
  return rt;
}
int main() {
  IOS;
  int x;
  cin >> x;
  if (x >= 30)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP0(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define RREP0(i, n) for (int i = (n)-1; i >= 0; --i)
#define REP1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)

typedef long long LL;
typedef pair<int, int> pii;

const int INTINF = int(1e9) + 1;
const LL LLINF = LL(1e18) + 1;
long double eps = 1.0E-14;
#define pow10(n) int(1e##n + n)

struct seg
{
    LL s;
    LL t;
};

void solve()
{
    int N;
    cin >> N;
    vector<seg> segs(N);
    REP0 (i, N)
    {
        LL X, L;
        cin >> X >> L;
        segs[i].s = X - L;
        segs[i].t = X + L;
    }
    sort(segs.begin(), segs.end(), [](seg a, seg b) { return a.t < b.t; });
    int ans = 1;
    LL prev_t = segs[0].t;
    REP1 (i, N-1)
    {
        if (prev_t <= segs[i].s)
        {
            ans++;
            prev_t = segs[i].t;
        }
    }

    cout << ans << endl;
}

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(10);
    solve();
    return 0;
}


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

int w,h,n,sx,sy,cnt;
int mas[20][20];
int dx[2]={1,0};
int dy[2]={0,1};

void Set(void);
void fbs(int x,int y);

main(){
  while(1){
    cin >> w >> h;
    if(w==0 && h==0){
      break;
    }
    Set();
    cin >> n;
    for(int i=0;i<n;i++){
      int x,y;
      cin >> x >> y;
      mas[y][x]=1;
    }
    fbs(1,1);
    cout << cnt << endl;
  }
}

void Set(void){
  for(int i=1;i<=h;i++){
    for(int j=1;j<=w;j++){
      mas[i][j]=0;
    }
  }
  cnt=0;
}

void fbs(int x,int y){
  if(x==w && y==h){
    cnt++;
  }
  else{
    for(int i=0;i<2;i++){
      int nx=x+dx[i];
      int ny=y+dy[i];
      if(nx<=w && ny<=h && mas[ny][nx]==0){
	fbs(nx,ny);
      }
    }
  }
}

Measured memory_bytes: 1160
#include <iostream>
#include <utility>
#include <vector>
#include <queue>
#include <stack>
#include <array>
#include <algorithm>
#include <numeric>
#include <limits>
#include <string>
#include <regex>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main()
{
    int N;
    cin >> N;
    int L[N];
    for (int i = 0; i < N; i++) cin >> L[i];
    sort(L, L + N);
    int ans = 0;
    for (int i = 0; i < N; i++) {
        int k = i + 2;
        for (int j = i + 1; j < N; j++) {
            for (k = max(k, j + 1); k < N; k++) {
                if (L[k] >= L[i] + L[j]) {
                    ans += k - j - 1;
                    break;
                }
                else if (k == N - 1 && L[k] < L[i] + L[j]) {
                    ans += N - j - 1;
                    break;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}


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


int main(){
  string cards;
  int times, h;

  while(true){
    cin >> cards;
    if(cards == "-") break;

    cin >> times;
    for(int i = 0; i < times; i++){
      cin >> h;
      cards = cards.substr(h) + cards.substr(0, h);
    }

    cout << cards << endl;
  }

  return 0;
}

Measured memory_bytes: 1216
#include <bits/stdc++.h>
#include <queue>
#define REP(i, n) for (ll i = 1; i <= n; i++)
#define rep(i, n) for (ll i = 0; i < n; i++)
#define ll long long
#define ld long double
using namespace std;

int main()
{
    int H1,M1,H2,M2,K;
    cin >> H1 >> M1 >> H2 >> M2 >> K;
    int ans = 0;
    ans = (H2 - H1) * 60 + (M2 - M1) - K;
    cout << ans << endl;

}

Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
#include <set>
#include <string>


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

using namespace std;

int main(void){
	int m;
	cin >> m;
	rep(i,m){
		string a;
		cin >> a;
		int n=a.size();
		set<string> com;
		rep(j,n-1){
			string pro=a.substr(0,j+1);
			string pos=a.substr(j+1,n-(j+1));
			string rpro=pro;
			string rpos=pos;
			reverse(rpro.begin(),rpro.end());
			reverse(rpos.begin(),rpos.end());
			com.insert(pro+pos);
			com.insert(rpro+pos);
			com.insert(pro+rpos);
			com.insert(rpro+rpos);

			com.insert(pos+pro);
			com.insert(rpos+pro);
			com.insert(pos+rpro);
			com.insert(rpos+rpro);

		}
		cout << com.size() << endl;
	}
	return 0;
}

Measured memory_bytes: 1292
package main

import "fmt"

func main() {
	var N, M int
	fmt.Scan(&N, &M)

	for d := M / N; d > 0; d-- {
		if M%d == 0 {
			if M/d >= N {
				fmt.Println(d)
				return
			}
		}
	}
}


Measured memory_bytes: 1772
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;

const int kMaxn = 5e3 + 5;
const int INF = 1e9 + 9;
int T, N, M, K;

int main() {
  //
  // freopen("indata.txt", "r", stdin);
  int D, T, S;
  cin >> D >> T >> S;
  if (1LL * T * S >= D)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


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

int main(){
	int N, X, i, sum;
  	cin >> N >> X;
  
  	for(i = 0; i < N + 1 && sum <= X; i++){
      	int k;
       	cin >> k;
      	sum += k;
    }
  
  	cout << i << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>;
const ll INF = 5e15;
vector<ll> dp(1e5 + 10);
int main(){
    ll N;
    cin >> N;
    vector<ll> H(N);
    for(ll &h : H) cin >> h;
    dp[0] = 0;
    dp[1] = abs(H[0] - H[1]);
    for(ll i = 2; i < N; i++){
        dp[i] = min(dp[i - 2] + abs(H[i] - H[i - 2]),
                    dp[i - 1] + abs(H[i] - H[i - 1]));
    }
    cout << dp[N - 1] << endl;
    return 0;
}


Measured memory_bytes: 1792
s=input()
l=[0,0,0,0]
for i in range(len(s)):
    if s[i]=="K" : l[0]+=1
    if s[i]=="U" : l[1]+=1
    if s[i]=="P" : l[2]+=1
    if s[i]=="C" : l[3]+=1
print(min(l))


Measured memory_bytes: 5564
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define FOR(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v),end(v)
#define debug(x) std::cerr<<#x<<": "<<x<<"\n"
#define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
#define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"

using ll=long long;
using vi=std::vector<int>;
using vvi=std::vector<vi>;
using vll=std::vector<ll>;
using vvll=std::vector<vll>;
template<typename T> using vvec=std::vector<std::vector<T>>;
template<typename T>
auto make_v(size_t sz){return std::vector<T>(sz);}
template<typename T,typename... Ts>
auto make_v(size_t sz,Ts...ts){return std::vector<decltype(make_v<T>(ts...))>(sz,make_v<T>(ts...));}
template<typename T>
void fill_v(T&var,const T&x){var=x;}
template<typename V,typename T>
void fill_v(V&v,const T&x){for(auto&& w:v){fill_v(w,x);}}

template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<std::vector<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<std::deque<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s, const std::set<T>&v){
  s<<"\n";for(auto&& elm:v){s<<elm<<"\t";}s<<"\n";return s;}

inline void scan(int&a){scanf("%d",&a);}
inline void scan(ll&a){scanf("%lld",&a);}
inline void scan(char&a){scanf(" %c",&a);}
inline void scan(double&a){scanf("%lf",&a);}
template<typename T>
inline void scan(std::vector<T>&v){for(auto&& sv:v){scan(sv);}}
template<typename First,typename...Args>
inline void scan(First&f,Args&...args){scan(f);scan(args...);}
inline void scan(std::string&s){char BUF[3000000];scanf(" %s",BUF);s=std::string(BUF);}
inline void print(int a){printf("%d\n",a);}
inline void print(ll a){printf("%lld\n",a);}
inline void print(double a){printf("%.12f\n",a);}
inline void print(std::string s){std::cout<<s<<"\n";}

using namespace std;

int main() {
  string s;
  scan(s);
  if (s[2] == s[3] and s[4] == s[5]) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}


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

int num[23333];

int main()
{
    int n, ans = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
        scanf("%d", &num[i]);
    int maxx = 0;
    for (int i = 1; i <= n; i++)
    {
        if (num[i] >= maxx)
            ans++, maxx = num[i];
    }
    cout << ans;
    return 0;
}

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

int main()
{
    int a, b;
    string s;

    cin >> a >> b >> s;

    if (s[a] != '-')
    {
        cout << "No" << endl;
        return 0;
    }
    else
    {
        for (int i = 0; i < a+b; i++)
        {
            if (i == a) continue;
            if (s[i] < '0' || s[i] > '9')
            {
                cout << "No" << endl;
                return 0;
            }
        }
    }

    cout << "Yes" << endl;
}

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

using namespace std;

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

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

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

	ll n;cin >> n;
	vector<double> v(n);REP(i, n)cin >> v[i];
	sort(ALL(v));
	REP(i, n - 1){
		v[i+1] = (v[i] + v[i+1]) / 2;
	}
	cout << fixed << setprecision(10000) << v.back() << endl;
	return 0;
}


Measured memory_bytes: 384
def bins(a, n, st, en)
  mid = (st+en)/2
  if a[[0,mid-1].max] == n
    return [0,mid-1].max
  elsif a[mid]==n || st==en || (a[[0,mid-1].max] < n && n < a[mid])
    return mid
  else
    if n < a[[0,mid-1].max]
      return bins(a, n, st, mid-1)
    else
      return bins(a, n, mid+1, en)
    end
  end
end

while (ln = gets.to_i) != 0
  n = gets.to_i
  m = gets.to_i
  d = (n-1).times.map{gets.to_i}
  k = m.times.map{gets.to_i}
  
  d.push(0)
  d.sort!
  ans = 0
  for i in 0..(m-1)
    if k[i] == 0
      ans += 0
    elsif d[n-1] <= k[i]
      ans += [ln-k[i], k[i]-d[n-1]].min
    else
      id = bins(d, k[i], 0, n-1)
      ans += [d[id]-k[i], k[i]-d[id-1]].min
    end
  end
  puts ans
end


Measured memory_bytes: 8916
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;

#define rep(i, n) for(int i = 0 ; i < (int)n ; i++)

typedef pair<string, int> P;

const int dx[] = {1, -1, 4, -4};
map<string, int> ans;


void bfs(){
  queue<P> que;
  set<string> found;
  que.push(P("01234567", 0));  
  while(!que.empty()){   
    P tmp = que.front();
    que.pop();
    
    if(found.find(tmp.first) != found.end()) continue;
    ans[tmp.first] = tmp.second;
    found.insert(tmp.first);
    
    int zero;
    for(int i = 0 ; i < 8 ; i++){
      if(tmp.first[i] == '0') zero = i;
    }
    
    for(int i = 0 ; i < 4 ; i++){
      int nx = zero + dx[i];
      if(nx < 0 || nx > 7 || (zero == 3 && dx[i] == 1) || (zero == 4 && dx[i] == -1)) continue;
      swap(tmp.first[zero], tmp.first[nx]);
      que.push(P(tmp.first, tmp.second+1));
      swap(tmp.first[zero], tmp.first[nx]);      
    }
  }
}

int main(){
  bfs();
  string s;
  while(getline(cin, s)){
    rep(i, s.size()){
      if(s[i] == ' ') s.erase(s.begin()+i);
    }
    cout << ans[s] << endl;
  }
  return 0;
}

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

int main() {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int K;//鐘
  
  if(A + B > 2 * C){//すくないのの枚数分*2はCにする
    if(X > Y){//Aの値段が2Cより高いならCで組み替えてしまえ
      if(A > 2 * C){
        K = 2 * C * X;
      }
      else{
        K = 2 * Y * C + A * (X - Y);
      }
    }
    else{//Y <= X,
      if(B > 2 * C){
        K = 2 * C * Y;
      }
      else{
        K = 2 * X * C + B * (Y - X);
      }
    }
  }
  else{//Cなんか必要ねえ
    K = A * X + B * Y;
  }
  
  cout << K << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
  
int main(){
   long long int i, n, max, min, sum;
   scanf("%d",&n);
   int a[10000];
   for(i=0;i < n;i++){
       scanf("%d",&a[i]);
   }
   max=a[0];
   min=a[0];
   sum=0;
   for(i=0;i < n;i++){
      if(max < a[i]){
         max=a[i];
      }
      if(min > a[i]){
         min=a[i];
      }
      sum=sum+a[i];
   }
   printf("%d %d %lld\n",min, max ,sum);
   return 0;
}

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


int main() {
  
  int A,B;
  cin >> A >> B;
  
  int num =0;

  rep(i, 10){
    rep(j,10){
      rep(k,10){
        if(A<=10001*i+1010*j+100*k && 10001*i+1010*j+100*k <=B )
          num++;
      }
    }
  }
    cout << num << endl;
}

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

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

int main(){
	int field[10][10] = {},mas[10][10] = {};
	string s;
	for(int i = 0;i < 8;i++){
		cin >> s;
		for(int j = 0;j < 8;j++){
			if(s[j] == 'o') field[i + 1][j + 1] = 1;
			else if(s[j] == 'x') field[i + 1][j + 1] = 2;
		}
	}
	int flag = 0;//o start
	bool pass = false;
	while(1){
		int can = 0;
		int mnum = 0,mx,my;
		for(int i = 0;i <= 9;i++){
			for(int j = 0;j <= 9;j++) mas[i][j] = 0;
		}
		for(int i = 1;i <= 8;i++){
			for(int j = 1;j <= 8;j++){
				if(!field[i][j]){
					int ma = 0;
					for(int k = 0;k < 8;k++){
						int x = i + dx[k],y = j + dy[k],cnt = 0;
						while(field[x][y] == (flag + 1) % 2 + 1) {
							cnt++;
							x += dx[k];
							y += dy[k];
						}
						if(field[x][y]) {
							ma += cnt;
							mas[i][j] += (1 << k);
						}
					}
					if((flag == 0 && mnum < ma) || (flag == 1 && mnum <= ma)){
						mnum = ma;
						mx = i;
						my = j;
					}
					if(ma) can++;
				}
			}
		}
		if(can == 0){
			if(!pass) pass = true;
			else break;
		}else{
			field[mx][my] = flag + 1;
			for(int i = 0;i < 8;i++){
				if((mas[mx][my] >> i) & 1){
					int x = mx + dx[i],y = my + dy[i];
					while(field[x][y] == (flag + 1) % 2 + 1){
						field[x][y] = flag + 1;
						x += dx[i];
						y += dy[i];
					}
				}
			}
			pass = false;
		}
		flag = !flag;
	}
	for(int i = 1;i <= 8;i++){
		for(int j = 1;j <= 8;j++){
			if(field[i][j] == 0) cout << '.';
			else if(field[i][j] == 1) cout << 'o';
			else cout << 'x';
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 3220
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

#include <set>
#include <map>
#include <iomanip>

using namespace std;

#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define rrep(i, n) for(long long i = (long long)(n - 1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()

using ll = long long;

int main()
{
	int n, r;
	cin >> n >> r;

	if (n < 10)
	{
		cout << r + 100 * (10 - n) << endl;
	}
	else
	{
		cout << r << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
ll MOD = 1000000007;
ll bpow(ll b, ll p, ll m = 1000000007LL) {
  ll rt = 1;
  for (; p; p >>= 1, b = b * b % m)
    if (p & 1)
      rt = rt * b % m;
  return rt;
}
ll a[200005];
int main() {
  IOS;
  int k, n;
  cin >> n >> k;
  for (int i = 0; i < n; i++)
    cin >> a[i];
  sort(a, a + n);
  ll product = 1;
  if (a[n - 1] == 0 && (k & 1)) {
    cout << 0 << endl;
    return 0;
  } else if (a[n - 1] <= 0 && (k & 1)) {
    for (int i = n - 1; i >= n - k; i--)
      product = (product * a[i] + MOD) % MOD;
    cout << product << endl;
    return 0;
  }
  int i = 0, j = n - 1;
  if (k & 1) {
    product = (product * a[j] % MOD + MOD) % MOD;
    j--, k--;
  }
  k /= 2;
  for (int it = 0; it < k; it++) {
    ll lproduct = a[i] * a[i + 1];
    ll rproduct = a[j] * a[j - 1];
    // cout << lproduct << ' ' << rproduct << endl;
    if (lproduct > rproduct) {
      product = ((product * (lproduct % MOD + MOD) % MOD) % MOD + MOD) % MOD;
      i += 2;
    } else {
      product = ((product * (rproduct % MOD + MOD) % MOD) % MOD + MOD) % MOD;
      j -= 2;
    }
  }
  cout << (product + MOD) % MOD << endl;
}

Measured memory_bytes: 5076
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <chrono>

using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define pii pair<ll,pi >
#define ppi pair<pi,ll>
#define ppp pair<pi,pi >
#define ex(str,a,b) str.substr((int)(a),min((int)str.size()-a,(int)(b-a+1))) 
#define all(X) X.begin(),X.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   __builtin_popcount(n) : no. of set bits in n.
*/

const int M = (1<<20)+5;
const int md = 1e9+7;

priority_queue<ll,vector<ll >,greater<ll > > pq;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

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

	ll x,k,d,m,i;
	cin >> x >> k >> d;
	if(x<0)
		x *= -1;
	m = x/d;
	if(k<=m)
		cout << x-k*d << "\n";
	else
	{
		if((k-m)%2 == 0)
			cout << x-m*d << "\n";
		else
			cout << abs(x-(m+1)*d) << "\n";
	}
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
double a[200001],b[1001];
int main(){
	ios
	double n,k,mx=0,ans=0;
	int x=1;
	cin>>n>>k;
	for(int i=1;i<=1000;i++){
		b[i]=b[i-1]+i;
	}
	for(int i=1;i<=n;i++){
		int c;
		cin>>c;
		a[i]=b[c]/c;
		if(i<=k){
			mx+=a[i];
		}
	}
	ans=mx;
	for(int i=k+1;i<=n;i++){
		mx=(mx-a[x])+a[i];
		if(ans<mx){
			ans=mx;
		}
		x++;
	}
	cout<<fixed<<setprecision(9)<<ans;
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
int qmax(int a, int b){
	return (a > b) ? a : b;
}

int n;
int val[100100];
int cnt[20];
int res;
int target_mask;
bool good[33333];
int dp[33333];

int main(){
	scanf("%d", &n);
	rep(i, n-1){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		a--, b--;
		val[a] ^= c;
		val[b] ^= c;
	}
	rep(i, n) if(val[i]) cnt[val[i]]++;
	res = 0;
	int bp = 0;
	rep(i, 16){
		res += (cnt[i] / 2);
		if(i){
			bp += (cnt[i] & 1);
			target_mask |= ((cnt[i] & 1) << (i-1));
		}
	}
	rep(mask, 1<<15){
		int XORsum = 0;
		rep(i, 15){
			int now = i+1;
			if(mask & (1 << i)) XORsum ^= now;
		}
		if(XORsum == 0) good[mask] = 1;
	}
	memset(dp, 0, sizeof(dp));
	rep(mask, 1<<15){
		int mask2 = mask;
		while(mask2 > 0){
			if(good[mask2]) dp[mask] = qmax(dp[mask], dp[mask ^ mask2] + 1);
			mask2 = (mask2 - 1) & mask;
		}
	}
	cout << res + bp - dp[target_mask] << endl;
	return 0;
}

Measured memory_bytes: 896
#include<iostream>
using namespace std;
int a[4];
char ope[4];
int ctoi(char c){
  if(c=='0') return 0;
  if(c=='1') return 1;
  if(c=='2') return 2;
  if(c=='3') return 3;
  if(c=='4') return 4;
  if(c=='5') return 5;
  if(c=='6') return 6;
  if(c=='7') return 7;
  if(c=='8') return 8;
  if(c=='9') return 9;
  return 10;
}
bool DFS(int i,int sum){
  if(i==3) return sum==7;
  if(DFS(i+1,sum+a[i+1])){
    ope[i+1]='+';
    return true;
  }
  if(DFS(i+1,sum-a[i+1])){
    ope[i+1]='-'; 
    return true;
  }
  return false;
  
}
int main(){
  for(int i=0;i<4;i++){
    char c;
    cin >> c;
    a[i]=ctoi(c);
  }
  if(DFS(0,a[0])){
    cout << a[0];
    for(int i=1;i<4;i++){
      cout << ope[i] << a[i]; 
    }
    cout << '=' << 7 <<"\n";
  }
  else cout << -1 << "\n";
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<stdio.h>
#include<cctype>
#include<algorithm>
#include<climits>
#include<cmath>
#include<map>
#include<vector>
#define INF INT_MAX
using namespace std;

int r;
string s;
double ans;


int main() {
	cin >> r;
	
	ans = (r + r) * 3.141592;

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3804
#include<iostream>

using namespace std;

int main(){

	int n;
	int dp[32];
	int ans;

	while(1){

		cin >> n;

		if(n==0){break;}

		for(int i=1; i<=n; i++){
			if(i==1 ||  i==2 ){dp[i] = i;}
			else if(i==3){dp[i] = 4;}
			else{
				dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
			}
		}

		ans = dp[n] / 3650;
		if(dp[n]%3650 != 0){
			ans++;
		}

		cout << ans << endl;

	}

	return 0;
}

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

int main(){
  string S;
  cin >> S;
  set<char> characters;
  for(int i=0; i<S.size(); i++){
    characters.insert(S.at(i));
  }
  char ans,check='a';
  bool flag = true;
  for(auto itr=characters.begin(); 
      itr!=characters.end(); itr++){
    if(*itr!=check){
      ans=check;
      break;
    }
    if(check=='z'){
      flag = false;
      break;
    }
    check++;
  }
  if(flag){
    cout << ans;
  }else{
    cout << "None";
  }
  return 0;
}

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

int main()
{
	int n, m;
	cin >> n >> m;
	int sum = 0;
	for(int i = 0; i < m; i++)
	{
		int temp;
		cin >> temp;
		sum += temp;
	}
	if(sum > n)
		cout << -1 << endl;
	else
		cout << n - sum << endl;
}


Measured memory_bytes: 3632
import java.util.*;
import java.lang.*;

public class Main {

    public static void main (String[] args) {
        Scanner in = new Scanner(System.in);
        char[] s = in.next().toCharArray();
        if (s[0] == s[1] && s[1] == s[2]) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
}

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

void _126() {
    string s;
    cin >> s;
    int first = atoi(s.substr(0, 2).c_str());
    int second = atoi(s.substr(2, 2).c_str());

    if (first > 0 && first <= 12 && second > 0 && second <= 12)
        cout << "AMBIGUOUS" << endl;
    else if (first > 0 && first <= 12)
        cout << "MMYY" << endl;
    else if (second > 0 && second <= 12)
        cout << "YYMM" << endl;
    else
        cout << "NA" << endl;
}

void _127() {
    int r, d, x;
    cin >> r >> d >> x;
    for (int i = 0; i < 10; ++i) {
        x = r * x - d;
        cout << x << endl;
    }
}

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

    string  cities[100];
    int score;
    string name;
    vector<pair<pair<string, int>, int> > stores;

    for (int i = 0; i < n; ++i) {
        cin >> name >> score;
        stores.push_back(make_pair(make_pair(name, -score), i + 1));
    }

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

    for (auto itr = stores.begin(); itr != stores.end(); ++itr) {
        cout << itr->second << endl;
    }

    // for (int i = 0; i < n; ++i) {
    //     cout << cities[i] << " " << scores[i] << endl;
    // }

}

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



Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <utility>
#include <deque>
#include <stack>
#include <bitset>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<ll> vl;
typedef queue<int> qi;
typedef queue<ll> ql;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
#define rep(i,n) for (int i=0;i<n;++i)
#define REP(i,n) for (int i=1;i<=n;++i)
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back
#define pf push_front
#define F first
#define S second
#define read(x) scanf("%d",&x)
int n;
int main(){
	ios::sync_with_stdio(false);
	cin>>n;
	cout<<(n-2)*180;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{long int n,m,s=0,k=0,x[1000],l=1,d=2;
cin>>n>>m;
for(long int j=1;j<=m;j++)
{x[k]=l;
k=k+1;
l=l+2;}
for(long int i=1;i<=n;i++){
      x[k]=d;
      k=k+1;
      d=d+2;
    }

for(long int i=0;i<k;i++){
    for(long int j=i+1;j<k;j++)
        if(x[i]==x[j])
        continue;
        else
            if((x[i]+x[j])%2==0)
               s=s+1;
}
cout<<s;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip> //setprecision()
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <set>
using ll = long long;
using namespace std;

double Mcos(double k){return cos(k*atan(1.0)*4/180);}

string monmo(int a,int b,int c){
    if(b>a && c>b){
        return "Yes";
    }else{
        return "No";
    }
}

int main() {
    int n,k;
    ll zenki=0,now=0;
    cin>>n>>k;
    vector<int> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    int j;
    for(j=0;j<k;j++){
        zenki+=v[j];
    }
    for(int i=j;i<n-k+j;i++){
        now=zenki+v[i]-v[i-k];
        if(zenki<now)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
        zenki=now;
    }
}


Measured memory_bytes: 4112
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1'000'000'007;
const ld PI = acos(-1);  
const ld EPS = 0.0000000001;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define REP(i, n) for(ll i=0; i<(ll)(n); i++)
#define REPD(i, n) for(ll i=n-1; 0<=i; i--)
#define FOR(i, a, b) for(ll i=a; i<(ll)(b); i++)
#define FORD(i, a, b) for(ll i=a-1; (ll)(b)<=i; i--)
#define ALL(x) x.begin(), x.end()
#define rALL(x) x.rbegin(), x.rend()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

vector<vector<char>> g;
int main(){
    ll n;   cin >> n;
    vector<ll> a(n);
    ll res=0;
    REP(i, n)   cin >> a[i], a[i]--;
    REP(i, n-1){
        if(i==a[i]){ 
            swap(a[i], a[i+1]);
            res += 1;
        }
    }
    if(a.back()==n-1) res += 1;
    cout << res << endl;
    
}


Measured memory_bytes: 4060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int n;cin>>n;
    vector<ll>a(n);
    ll ans=1;
    for(int i=0;i<n;++i){
        cin>>a[i];
        if(a[i]==0){
            cout<<0<<endl;
            return 0;
        }
    }
    for(int i=0;i<n;++i){
        if(a[i]<=1000000000000000000/ans){
            ans*=a[i];
        }else{
            cout<<-1<<endl;
            return 0;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 4048
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
 
int main() {
	string S; long long K;
	cin >> S >> K;
	for (int i = 0; i < K; i++) {
		if (S[i] >= '2') { cout << S[i] << endl; return 0; }
	}
	cout << '1' << endl;
	return 0;
}


Measured memory_bytes: 256
import math

n = int(input())
m = []
ds = []

for i in range(n):
    m.append(list(map(int, input().split())))

for i in range(n):
    for j in range(i + 1, n):
        ds.append(math.sqrt((m[i][0] - m[j][0]) ** 2 + (m[i][1] - m[j][1]) ** 2))

ps = math.factorial(n)

x = (n-1) * math.factorial(n) / len(ds)

print(sum(ds) * (n-1) / len(ds))


Measured memory_bytes: 3064
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
using namespace std;
typedef long long ll;

ll cs[200000+10];
vector<int> g[200000+10];
ll ans[200000+10];

int main(void) {
  int nNode, nQuery;
  scanf("%d%d", &nNode, &nQuery);
  REP(i, nNode-1) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a;
    --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  REP(iQuery, nQuery) {
    int p, q;
    scanf("%d%d", &p, &q);
    --p;
    cs[p] += q;
  }

  queue<pair<int,int> > q;
  q.push(make_pair(0, -1));
  ans[0] = cs[0];
  while(!q.empty()) {
    auto cur = q.front(); q.pop();
    int u = cur.first;
    for(int v : g[u]) {
      if(v != cur.second) {
        ans[v] = cs[v] + ans[u];
        q.push(make_pair(v, u));
      }
    }
  }
  REP(i, nNode) {
    printf("%lld%c", ans[i], i == nNode-1 ? '\n' : ' ');
  }
  
  return 0;
}


Measured memory_bytes: 17652
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

ll n,m;
int main(){
	scanf("%lld%lld",&n,&m);
    printf("%.9f",1.0*n/m);
}



Measured memory_bytes: 128
/*
They turn the lights down low,
In shadows hiding from the world,
Only coming out when it gets cold

The seas part when they hit the floor,
The voices carry on and out the door
And everything you touch turns into gold

Like the angel you are you laugh creating
A lightness in my chest,
Your eyes they penetrate me,
(your answer's always 'maybe')
That's when I got up and left

A beating heart and a microphone,
A ticking clock in an empty home
Still tells of these times so long ago,

Even though I've come so far,
I know I've got so far to go
And any day now I'll explode

Like the angel you are you laugh creating
A lightness in my chest,
Your eyes they penetrate me,
(your answer's always 'maybe')
That's when I got up and left

And each and everyday will lead into tomorrow
Tomorrow brings one less day without you
But don't wait up just leave the light on
'Cause all the roads that I might take
Will all one day lead back to you

And like the angel you are you laugh creating
A lightness in my chest,
Your eyes they penetrate me,
(never cease to amaze me)
That's when I got up and left
*/

#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd
#define prev asdgSHJsfgsdfhdsh
#define hash asdgasdgasdgdfrywewery

#define eps 1e-12
#define M_PI 3.141592653589793
#define bsize 300

#define ldouble long double
using namespace std;

#define bs 1000000007

const int N = 600031;

long long n,k,A[N],cur_s;

long long done[200][200],memo[200][200];

long long eval(int ps,int val){
	if (done[ps][val])
		return memo[ps][val];
	long long ret=0;
	for (int i=0;i<n;i++){
		int h;
		if (A[i]&(1ll<<(59-ps)))
			h=1;
		else
			h=0;
		ret+=(h!=val);
	}

	done[ps][val]=1;
	memo[ps][val]=ret*(1ll<<(59-ps));
	return memo[ps][val];
}

long long ans;

int k_at(int ps){
	long long here=(k>>(59-ps));
	return here&1;
}

int main(){
//    freopen("apache.in","r",stdin);
//    freopen("apache.out","w",stdout);
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    //ios_base::sync_with_stdio(0);
    //cin.tie(0);

	cin>>n>>k;

	for (int i=0;i<n;i++){
		cin>>A[i];
	}

	for (int com_p=0;com_p<=60;com_p++){
		long long cur_s=0;
		int shit=0;
		for (int i=0;i<60;i++){
			long long v1=eval(i,0);
			long long v2=eval(i,1);
			if (i<com_p){
				if (k_at(i)==0)
					cur_s+=v1;
				else
					cur_s+=v2;
			}
			else if (i==com_p){
				if (k_at(i)==0){shit=1;break;}
				else
					cur_s+=v1;
			}
			else
				cur_s+=max(v1,v2);
		}
		if (shit)
			continue;
		ans=max(ans,cur_s);
	}

	cout<<ans<<endl;

//    cin.get(); cin.get();
    return 0;
}


Measured memory_bytes: 1280