akhauriyash/Code-Regression huggingface dataset:
import math

EPS = 1e-10

COUNTER_CLOCKWISE = 1
CLOCKWISE = -1
ONLINE_BACK = 2
ONLINE_FRONT = -2
ON_SEGMENT = 0

class Segment():
    def __init__(self, p1, p2):
        self.p1 = p1
        self.p2 = p2

class Point():
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __add__(self, point):
        # + 演算子での挙動を指定
        return Point(self.x+point.x, self.y+point.y)

    def __sub__(self, point):
        # - 演算子での挙動を指定
        return Point(self.x-point.x, self.y-point.y)

    def __mul__(self, a):
        # * 演算子での挙動を指定
        return Point(a*self.x, a*self.y)

    def __truediv__(self, a):
        # / 演算子での挙動を指定
        return Point(self.x/a, self.y/a)

    def __abs__(self):
        # abs関数での挙動を指定
        return math.sqrt(self.norm())

    def norm(self):
        return self.x**2+self.y**2

    def __eq__(self, point):
        # == 演算子での挙動を指定
        return abs(self.x-point.x) < EPS and abs(self.y-point.y) <EPS

def dot(a, b):
    return a.x*b.x+a.y*b.y

def cross(a, b):
    return a.x*b.y - a.y*b.x

def isOrthogonal(a, b):
    return dot(a, b) == 0

def isParallel(a, b):
    return cross(a, b) == 0

def project(s, p):
    #s: Segment(), p: Point()
    base = s.p2 - s.p1
    r = dot(p-s.p1, base)/base.norm()
    return s.p1+base*r

def reflect(s, p):
    return p+(project(s, p)-p)*2

def get_distance(a, b):
    return abs(a-b)

def get_distance_lp(l, p):
    return abs(cross(l.p2-l.p1, p-l.p1)/abs(l.p2-l.p1))

def get_distance_sp(s, p):
    if dot(s.p2-s.p1, p-s.p1) < 0:
        return abs(p-s.p1)
    if dot(s.p1-s.p2, p-s.p2) < 0:
        return abs(p-s.p2)
    return get_distance_lp(s, p)

def intersect(s1, s2):
    return True
    
def get_distance(s1, s2):
    if intersect(s1, s2):
        return 0
    return min([get_distance_sp(s1, s2.p1), get_distance_sp(s1, s2.p2),
                get_distance_sp(s2, s1.p1), get_distance_sp(s2, s1.p2)])

def ccw(p0, p1, p2):
    a = p1 - p0
    b = p2 - p0
    if cross(a, b) > EPS:
        return COUNTER_CLOCKWISE
    if cross(a, b) < -EPS:
        return CLOCKWISE
    if dot(a, b) < -EPS:
        return ONLINE_BACK
    if a.norm() < b.norm():
        return ONLINE_FRONT
    return ON_SEGMENT


if __name__ == '__main__':
    from sys import stdin
    input = stdin.readline

    x0, y0, x1, y1 = map(int, input().split())
    p0 = Point(x0, y0)
    p1 = Point(x1, y1)

    q = int(input())
    for _ in range(q):
        x2, y2 = map(int, input().split())
        p2 = Point(x2, y2)
        # このccw関数の書き方は、この問題では冗長な書き方となるが、
        # 今後のために上記のような形にしている。
        ans = ccw(p0, p1, p2)
        if ans == -2:
            print('ONLINE_FRONT')
        if ans == -1:
            print('CLOCKWISE')
        if ans == 0:
            print('ON_SEGMENT')
        if ans == 1:
            print('COUNTER_CLOCKWISE')
        if ans == 2:
            print('ONLINE_BACK')



Measured memory_bytes: 5884
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int N=100010;
ll s[N],t[N];
int main()
{
  ll a,b,q,x;
  cin>>a>>b>>q;
  for(int i=1;i<=a;i++) cin>>s[i];
  for(int i=1;i<=b;i++) cin>>t[i];
  for(int i=1;i<=q;i++)
  {
    cin>>x;
    ll tem=1e18,shr=1e18,ans=1e18;
    if(x>s[1] && x>t[1])
    {
      int p=lower_bound(s+1,s+a+1,x)-s-1;
      int q=lower_bound(t+1,t+b+1,x)-t-1;
      ans=min(ans,max(x-s[p],x-t[q]));
      // cout<<ans<<" "<<i<<endl;
      // cout<<max(x-s[p],x-t[q])<<endl;
      // cout<<s[p]<<" "<<t[q]<<endl;
    }
    if(x<s[a] && x<t[b])
    {
      int p=lower_bound(s+1,s+a+1,x)-s;
      int q=lower_bound(t+1,t+b+1,x)-t;
      ans=min(ans,max(s[p]-x,t[q]-x));
    }
    if(s[1]<x)
    {
      int p=lower_bound(s+1,s+a+1,x)-s-1;
      shr=min(shr,x-s[p]);
    }
    if(x<s[a])
    {
      int p=lower_bound(s+1,s+a+1,x)-s;
      shr=min(shr,s[p]-x);
    }
    if(t[1]<x)
    {
      int p=lower_bound(t+1,t+b+1,x)-t-1;
      tem=min(tem,x-t[p]);
    }
    if(x<t[b])
    {
      int p=lower_bound(t+1,t+b+1,x)-t;
      tem=min(tem,t[p]-x);
    }
    ans=min(ans,2*shr+tem);
    ans=min(ans,2*tem+shr);
    cout<<ans<<endl;
  }
  return 0;
}


Measured memory_bytes: 2816
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int,int> P;

int main(){
    ll x;
    cin >> x;
    ll c = 0;
    ll tot = 100;
    while(tot<x){
        c++;
        tot += tot/100;
    }
    cout << c << endl;
}

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

#define ll long long 
 
using namespace std ;
 
ll z , ans , o ;

ll mod = 1e9 + 7 ;
ll N = 1e5 + 7 ;


int main( ){

	int n , m ;

	cin >> n >> m ;

	int a[n] , b[n] , c[n] ;

	for( int i = 0 ; i < n ; i ++ ){

		cin >> a[i] ;

		b[i] = 0 ;

		c[i] = 0 ;

	}

	for( int i = 0 ; i < m ; i ++ ){

		int s , t ;

		cin >> s >> t ;

		if( a[s-1] > a[t-1] ){

			c[s-1] ++ ;

			b[s-1] ++ ;

			c[t-1] ++ ;

		}

		if( a[s-1] < a[t-1] ){

			c[s-1] ++ ;

			c[t-1] ++ ;

			b[t-1] ++ ;

		}

		if( a[s-1] == a[t-1] ){

			c[s-1] ++ ;

			c[t-1] ++ ;

		}

	}

	for( int i = 0 ; i < n ; i ++ ){

		if( b[i] == c[i] ){

			ans ++ ;

		}

	}

	cout << ans << endl ;

}






Measured memory_bytes: 4796
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
    string S;
    cin >> S;
    if(S[S.size() - 1] == 's'){
        cout << S << "es" << endl;
    }else{
        cout << S << "s" << endl;
    }
    return 0;
}

Measured memory_bytes: 3520
#include<iostream>
using namespace std;
int main()
{
  int n,t,i,res=0;
  cin >> n;
  for(i=1;i<=n;i++){
    cin >> t;
    if(i%2==1&&t%2==1)
      res++;
  }
  cout << res << endl;
  return 0;
}

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

using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001;

int N;
vi child[MX];

int solve(int x) {
    vi v;
    for (int i: child[x]) v.pb(solve(i));
    sort(v.rbegin(),v.rend());
    int ans = 0;
    F0R(i,sz(v)) ans = max(ans,i+1+v[i]);
    return ans;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> N;
    FOR(i,2,N+1) {
        int x; cin >> x;
        child[x].pb(i);
    }
    cout << solve(1);
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS

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

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

int main(){long N, M;
cin >> N >> M;
COMinit();
if(abs(N - M) >= 2){
    cout << 0 << endl;
    return 0;
}
else if(abs(N - M) == 1){
    cout << fac[N] * fac[M] % MOD << endl;
    return 0;
}
else{
    cout << fac[N] * fac[M] * 2 % MOD << endl;
}

// cout << fac[N] << endl;
// cout << (4 - n / 2) * 2 - 1 << endl;

// cout << cnt << endl;
return 0;
}



Measured memory_bytes: 12160
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main(){
	int N,max=0,count=0;
	cin>>N;
	vector<int>H(N);
	for(int i=0;i<N;i++){
		cin>>H[i];
	}
	for(int i=0;i<N;i++){
		if(H[i]>=max){
			count++;
			max=H[i];
		}
	}
	cout<<count<<endl;
	return 0;
}


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

class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		int[][] next = new int[26][A.length()];
		for (int i = 0; i < next.length; ++i) {
			for (int j = 0; j < next[i].length; ++j) {
				next[i][j] = -1;
			}
		}
		int[] f = new int[A.length()];
		boolean[][] ok = new boolean[26][A.length()];
		Arrays.fill(f, Integer.MAX_VALUE >> 3);
		for (int i = A.length() - 1; i >= 0; --i) {
			for (int j = 0; j < 26; ++j) {
				if (i + 1 < A.length())
					next[j][i] = next[j][i + 1];
			}
			int c = (int) (A.charAt(i) - 'a');
			next[c][i] = i;
			for (int j = 0; j < 26; ++j) {
				if (next[j][i] == -1) {
					f[i] = 1;
				} else {
					f[i] = Math.min(f[i], (next[j][i] + 1 < A.length() ? f[next[j][i] + 1] : 1) + 1);
				}
			}
		}

		for (int i = A.length() - 1; i >= 0; --i) {
			int c = (int) (A.charAt(i) - 'a');
			next[c][i] = i;
			for (int j = 0; j < 26; ++j) {
				if (next[j][i] == -1) {
					if (f[i] == 1) {
						ok[j][i] = true;
					}
				} else {
					if (f[i] == (next[j][i] + 1 < A.length() ? f[next[j][i] + 1] : 1) + 1) {
						ok[j][i] = true;
					}
				}
			}
		}

		int cur = 0;
		int res = f[0];
		while (res > 0) {
			for (int i = 0; i < 26; ++i) {
				if (ok[i][cur]) {
					System.out.print((char) ('a' + i));
					cur = next[i][cur] + 1;
					--res;
					break;
				}
			}
		}
		System.out.println();
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}

Measured memory_bytes: 57540
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author NikuKyabe
 */

#include <iostream>
#include <fstream>

#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define RFOR(i,a,b) for(int i = (int)(b-1);i>=(int)(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " <<
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

class AWeatherPrediction {
public:
	void solve(std::istream& in, std::ostream& out) {
    const vector<string> ss = {
            "Sunny",
            "Cloudy",
            "Rainy"
    };
    string s;
    in >> s;
    REP(i,ss.size()){
      if(s == ss[i]){
        out << ss[(i + 1) % 3] << endl;
      }
    }
	}
};


signed main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout.precision(20);
	AWeatherPrediction solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

using namespace std;
typedef long long ll;

#define INF (long long)(1e9+7)
#define REP(i,n) for(ll i = 0; i < n; i++)
#define REP1(i,n) for(ll i = 1; i <= n; i++)

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



int main(void)
{
  ll n;
  cin >> n;
  ll ans = 0;
  REP1(i, n-1) ans+=i;
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<pair<ll, ll>> pll;
 
#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define popcount(x) __builtin_popcountll(x)
 
const long double PI = acos(-1);
 
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}
bool isInteger(double x){return floor(x) == x;}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  ll a, b, c;
  cin >> a >> b >> c;
  cout << (c-(a-b)<0?0:c-(a-b)) << endl;
  return 0;
}

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

int main(){
	string S;
	cin >> S;
	int N;
	int ans = 999;
	for (int i = 0; i <= (S.size() - 3); i++) {
		N = (S.at(i) - '0') * 100 + (S.at(i + 1) - '0') * 10 + (S.at(i + 2) - '0');
		ans = min(ans, (max(N, 753) - min(N, 753)));
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string a,b;
    cin>>a;
    cin>>b;
    int cnt=0;
    for(int i=0;i<3;i++){
        if(a[i]==b[i]){
            cnt++;
        }
    }
    cout<<cnt<<endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

ll d[100100];

ll flag;
ll n,m;
vector<vector<ll> > vv;

void dfs(ll a, ll p, ll h){
  d[a] = h%2;
  if(vv[a].sz==1&&p!=-1){
    return;
  }
  rep(i,0,vv[a].sz){
    if(vv[a][i]==p)continue;
    if(d[vv[a][i]]==-1){
      dfs(vv[a][i],a,h+1);
    }
    if(d[vv[a][i]]!=(h+1)%2){
      flag = 0;
      return;
    }
  }
  return;
}


int main() {
  clr(d,-1);
  flag = 1;
  cin>>n>>m;
  vector<vector<ll> > vv_(n,vector<ll>());
  vv = vv_;
  vector<pair<ll,ll> > v;
  rep(i,0,m){
    ll a,b;
    cin>>a>>b;
    a--;b--;
    vv[a].pb(b);
    vv[b].pb(a);
    v.pb(mp(a,b));
  }
  dfs(0,-1,0);
  if(flag == 1){
    ll c1 = 0;
    ll c2 = 0;
    rep(i,0,n){
      if(d[i]==0)c1++;
      else c2++;
    }
    ll all = c1*c2;
    rep(i,0,v.sz){
      ll a1 = v[i].fi;
      ll b1 = v[i].se;
      if(d[a1]!=d[b1])all--;
    }
    cout << all << endl;
  }
  else{
    ll all = n*(n-1)/2;
    cout << all-m << endl;
  }
  return 0;
}

Measured memory_bytes: 11760
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define reverse(x) reverse(x.begin(), x.end())
#define pb push_back
#define pii pair<int, int>
#define pll pair<long long,long long>
#define f first
#define s second
typedef long long ll;
const int mod = 1e9+7;
using namespace std;
ll dp[300005], n, m;

int main(){
	ll i, j;
	cin >> n >> m;
	if(n>m)swap(n,m);
	j = n+m;
	if(n == m){
		dp[1] = m;
		m--;
		for(i=2;i<=j;i++){
			if(i%2==0){
				dp[i] = n*dp[i-1]; n--;
			}else {
				dp[i] = m*dp[i-1]; m--;
			}dp[i]%=mod;
		}
		dp[j]*=2;
	}else if(m-1==n){
		dp[1] = m;
		m--;
		for(i=2;i<=j;i++){
			if(i%2==0){
				dp[i] = n*dp[i-1]; n--;
			}else {
				dp[i] = m*dp[i-1]; m--;
			}dp[i]%=mod;
		}
	}
	cout << dp[j]%mod;
}


Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <algorithm>
#include <set>
#include <unordered_map>

using namespace std;
int a, b;

int main() {
  cin >> a >> b;
  if (a*b%2 == 0) {
    cout << "Even" << endl;
  } else {
    cout << "Odd" << endl;
  }
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define ld long double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

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

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int k,x; cin>>k>>x;
    if (500*k>=x){
        cout<<"Yes\n";
    }else{
        cout<<"No\n";
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

		int ans = (int) Math.ceil((double) n / (2 * d + 1));

		System.out.println(ans);
		sc.close();
	}
}

Measured memory_bytes: 21844
#include <iostream>
#include <algorithm>
#include <string>
#define TIME 86400
using namespace std;

int flag[TIME + 1];

int main() {
  while (true) {
    int n;
    cin >> n;
    if (n == 0) return 0;
    string p[n], q[n];
    int a[n][8], b[n][8], s[n], t[n];
    for (int i = 0; i < n; i++)
      cin >> p[i] >> q[i];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < 8; j++) {
	if (j == 2 || j == 5) continue;
	a[i][j] = p[i][j] - '0';
	b[i][j] = q[i][j] - '0';
      }
    }
    
    for (int i = 0; i < n; i++) {
      s[i] = a[i][0] * 36000 + a[i][1] * 3600 + a[i][3] * 600 + a[i][4] * 60
	+ a[i][6] * 10 + a[i][7];
      t[i] = b[i][0] * 36000 + b[i][1] * 3600 + b[i][3] * 600 + b[i][4] * 60
	+ b[i][6] * 10 + b[i][7];
    }
    
    for (int i = 0; i < TIME + 1; i++)
      flag[i] = 0;
    
    for (int i = 0; i < n; i++)
      for (int j = s[i]; j < t[i]; j++)
	flag[j]++;
    
    int max = 0;
    for (int i = 1; i < TIME + 1; i++)
      if (flag[i] > max) max = flag[i];

    cout << max << endl;
  }
}

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

#include <fstream>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(20) << fixed;
  /*
     ifstream in("input.txt");
     cin.rdbuf(in.rdbuf());
  //*/
  string S;
  cin >> S;
  int ans = 700;
  for(int i = 0; i < 3; i++){
    if(S[i] == 'o'){
      ans+=100;
    }
  }
  cout << ans <<endl;
}


Measured memory_bytes: 3496
# ABC166d


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと

    def dump(*args):
        sys.stderr.write(str(args))

    x = int(input())
    for i in range(-200, 200):
        for j in range(-200, 200):
            if (i ** 5 - j ** 5 == x):
                print(i, j)
                exit(0)


if __name__ == '__main__':
    main()


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


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PalindromeCounter pc = new PalindromeCounter();
		
		while(true){
			String str = br.readLine();
			
			if(str == null){
				break;
			}
			
			pc.setString(str);
		}
		
		System.out.println(pc.getCount());

	}

}

class PalindromeCounter{
	int count = 0;
	
	public void setString(String str){
		StringBuffer sb = new StringBuffer(str);
		sb.reverse();
		if(str.equals(sb.toString())){
			count++;
		}
	}
	
	public int getCount(){
		return count;
	}
}

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

int main() {
  long long N;
  cin>>N;
  map<string,int>mp;
  int max=0;
  for(long long i=0;i<N;i++){
    string S;
    cin>>S;
    mp[S]++;
    if(max<mp[S]){
      max=mp[S];
    }
  }
  vector<string>ans;
  for(auto X:mp){
    if(X.second==max){
      ans.push_back(X.first);
    }
  }
  sort(ans.begin(),ans.end());
  for(int i=0;i<ans.size();i++){
    cout<<ans.at(i)<< endl;
  }
}

Measured memory_bytes: 27176
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

// increment
#define rep_n(_1, _2, _3, NAME, ...) NAME
#define rep_2(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define rep_3(i, initial, n) for (int(i) = (int)(initial); (i) < (int)(n); ++(i))
#define rep(...) rep_n(__VA_ARGS__, rep_3, rep_2, rep_1)(__VA_ARGS__)
// decrement
#define rep_r_n(_1, _2, _3, NAME, ...) NAME
#define rep_r_2(i, n) for (int(i) = (int)(n); (i) > 0; (i)--)
#define rep_r_3(i, initial, n) for (int(i) = (int)(initial); (i) > (int)(n); (i)--)
#define rep_r(...) rep_r_n(__VA_ARGS__, rep_r_3, rep_r_2)(__VA_ARGS__)
// define type definition
using namespace std;
typedef long long ll;
using mpint = boost::multiprecision::cpp_int; // 多倍長整数（任意精度）
typedef pair<int, int> P;

// define construct variable
const double EPS = numeric_limits<double>::epsilon();
// 10^9 + 7
const ll MOD = ll(1e9)+7;
const ll INF = ll(1e10);
const string ALPHABET = "abcdefghijklmnopqrstuvwxyz";

// define methods
// 最大公約数
ll gcd(const ll a, const ll b) { return b ? gcd(b, a % b) : a; }
// 最小公倍数
ll lcm(const ll a, const ll b) { return a / gcd(a, b) * b; }
// char -> int
int ctoi(char c) { return (int)(c - '0'); }
// 素因数分解
vector< pair<ll, ll> > prime_factorize(ll n) {
  vector< pair<ll, ll> > p;
  for (ll i = 2; i * i <= n; i++) {
    if ((n % i) != 0) continue;
    p.push_back(make_pair(i, 0));
    while ((n % i) == 0) {
      n /= i;
      p[i].second += 1;
    }
    p.push_back(make_pair(n, 0));
  }

  if (n != 1) p.push_back(make_pair(n, 1));
  return p;
}
// 組み合わせの整合性を保つ（後ほど解析する）
ll modinv(ll a) {
	ll b = MOD, u = 1, v = 0;
	while (b) {
		ll t = a / b;
		a -= t * b;
		swap(a, b);
		u -= t * v;
		swap(u, v);
	}
	u %= MOD;
	if (u < 0) { u += MOD; }
	return u;
}
// 順列
ll permutation(const ll n, const ll m) {
	ll result = 1;
	for (ll i = n; i > n - m; i--) { result = (result * i) % MOD; }
	return result;
}

// 繰り返し n 乗法
ll repeat_square(const ll n, const ll x) {
	if (x == 0) return 1;
	ll res = repeat_square(n, x/2);
	res = res * res % MOD;
	if ((x % 2) == 1) res = res * n % MOD;
  return res;
}
// 組み合わせ
ll combination(const ll n, const ll a) {
	ll x = 1, y = 1;
  for(ll i = 0; i < a; i++){
    x = x * (n-i) % MOD;
    y = y * (i+1) % MOD;
  }
  return x * repeat_square(y, MOD-2) % MOD;
}

int main() {
	int H, W;
	cin >> H >> W;

	vector<string> s(H);
	int dx[] = {-1, 0, 1, 0};
	int dy[] = {0, 1, 0, -1};

	rep(i, H) {
		cin >> s[i];
	}

	rep(i, H) rep(j, W) {
		char c = s[i][j];
		if (c == '.') continue;

		bool is_exist = false;
		rep(dir, 4) {
			int x = i+dx[dir], y = j+dy[dir];

			if (x < 0 || y < 0 || H <= x || W <= y) continue;

			if (s[x][y] == '#') is_exist = true;
		}

		if (!is_exist)  {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
  return 0;
}


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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
#define ld long double
#define ll long long

const int MOD =  1000000007;
const int IINF = INT_MAX;
const ll INF = 1LL << 60;


int main() {
    int n, t; cin >> n >> t;
    V<P<int, int> > v(n);
    for(int i = 0; i < n; i++){
        int c, d; cin >> c >> d;
        v[i] = make_pair(c, d);
    }

    int ans = IINF;
    for(int i = 0; i < n; i++){
        if(v[i].second <= t){
            ans = min(ans, v[i].first);
        }
    }
    if(ans != IINF) cout << ans << endl;
    else cout << "TLE" << endl;

    return 0;
}


Measured memory_bytes: 3576
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdio>
#include <iomanip>
#include <utility>
#include <unordered_map>

using namespace std;
typedef long long int ll;

#define SP(x) setprecision((int)x)
#define SW(x) setw(x) // 桁数指定
#define SF(c) setfill(c) // 埋め文字指定('0')
#define ALL(v) v.begin(), v.end()

int main(int argc, char const *argv[])
{
    ll n;
    cin >> n;
    vector<ll> h(n);
    ll m = 0;
    for (ll i = 0; i < n; i++)
    {
        cin >> h[i];
        if (m < h[i])
        {
            m = h[i];
        }
        if (i != 0 && m - h[i] > 1)
        {
            cout << "No" << endl;
            exit(0);
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 1024
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <map>
#define mp make_pair
#define pb push_back
#define p push
#define FOR(a,c) for(int a = 0;a<c;a++)
#define ll long long
#define abs(x) (x<0 ? (-x) : x)
#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("%d %d",&a,&b)
#define getIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define getL(a) scanf("%lld",&a)
#define getLL(a,b) scanf("%lld %lld",&a,&b)
#define getLLL(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define BEND(c) (c).begin(),(c).end()
#define fi first
#define se second
#define PI 3.1415926535897932384626
#define getS(a) scanf("%s",a)
#define pfi(a) printf("%d",a);
#define pfii(a,b) printf("%d%d",a,b);
#define pfl(a) printf("%lld",a);
#define pfll(a,b) printf("%lld%lld",a,b);
using namespace std;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vl;
typedef vector<pair<int,int>> vpi;
typedef vector<pair<long long,long long>> vpl;
typedef pair<int,int> pii;
typedef pair <ll,ll> pll;


int main(){
	double a, b, x; 
  	cin >> a >> b >> x;
	double res;
	if (2*x <= a*a*b){
		res = 2*x/(a*b*b);
		
	}
	else{
		res = a*a*a / (2*(a*a*b - x));
	}
	printf("%.12lf", 90 - atan(res) * 180 / PI);
	
	return 0;
}

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

ll INF = 1e+18;

int 
main()
{
  string S; cin >> S;
  int K; cin >> K;
  int num = S.size() * (S.size() + 1) / 2;
  set<string> substring;
  rep(i, 0, S.size()){
    rep(k, 1, 5.6){
      substring.insert(S.substr(i, k));
    }
  }

  vector<string> arr;
  for(auto s: substring){
    arr.push_back(s);
  }

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

  cout << arr[K -1] << endl;

}


Measured memory_bytes: 5028
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5+10;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
int a[maxn],book[maxn];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,ans=0;
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        ans+=x;
    }
    for(int i=2;i<=n;i++) cin>>book[i];
    for(int i=2;i<=n;i++)
    {
        if(a[i]==a[i-1]+1) ans+=book[a[i]];
    }
    cout<<ans<<'\n';
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define int long long
typedef long long ll;  
typedef vector<ll> vi; 
typedef pair<int, int> ii; 
typedef vector<ii> vii; 
typedef vector<vi> vvi;
#define F first
#define S second
#define pb emplace_back
#define M 1000000007
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fr(i,a,b) for(int i = a; i<= b; i++)
#define ws " "
#define all(c) c.begin(), c.end()
#define ln "\n" 
 
void printarray(int ar[], int n) {
    for (int i = 0; i < n; i++) {
        cout << ar[i] << ws;
    }
    cout << ln;
}


main() {
    IOS;
    string s, t;
    cin >> s >> t;
    int n = s.length(), m = t.length();
    // n - string s
    // m - string t

    int dp[n + 1][m + 1];

    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= m; j++) {
            if (i == 0 or j == 0) {
                dp[i][j] = 0;
                continue;
            }
            if (s[i - 1] == t[j - 1]) {
                dp[i][j] = 1 + dp[i - 1][j - 1];
            } else {
                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
            }
        }
    }

    int i = n, j = m;
    int val = dp[n][m];
    string str = "";

    while (i >= 1 and j >= 1) {
        if (s[i - 1] == t[j - 1]) {
            str.push_back(s[i-1]);
            i--, j--;
        } else {
            if (dp[i - 1][j] > dp[i][j - 1]) {
                i = i - 1;
            } else {
                j = j - 1;
            }
        }
    }
    reverse(all(str));
    cout << str;
}
 
/*  Check for base cases such as n == 1
    and cases like it where code can fail */

Measured memory_bytes: 70656
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(long long i=0; i<(n); i++)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main(){
    ll n,m; cin>>n>>m;
    vector<ll> h(n);
    rep(i,n) cin>>h[i];
    ll res=0;
    vector<vector<ll>> route(n);
    rep(i,m){
        ll a,b; cin>>a>>b;
        route[a-1].push_back(h[b-1]);
        route[b-1].push_back(h[a-1]);
    }
    rep(i,n){
        sort(route[i].begin(), route[i].end(), greater<ll>());
    }
    rep(i,n){
        if(route[i].empty()){
            res++;
            continue;
        }
        if(h[i] > route[i][0]) res++;
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 9860
#define _GLIBCXX_DEBUG
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <map>
#include <list>
using namespace std;
typedef long long ll;
#define ALL(v) (v).begin(), (v).end()
#define mp make_pair
const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1e9+7;

int main() {
	int r;
	cin >> r;
	cout << 3 * r * r << endl;
    return 0;
}


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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(1e5 + 5);

int n, m;
vector<vector<pair<int, ll>>> graph(MAX_N);

ll pos[MAX_N];
bool visited[MAX_N];

bool check(int node, ll suppose) {
  // printf("%d, %lld\n", node, suppose);
  if (visited[node]) {
    return pos[node] == suppose;
  }

  pos[node] = suppose;
  visited[node] = true;

  for (auto &e : graph[node]) {
    if (!check(e.first, pos[node] + e.second)) {
      return false;
    }
  }

  return true;
}

int main(void) {
  // Here your code !
  scanf("%d %d", &n, &m);

  for (int i = 0; i < m; ++i) {
    int l, r;
    ll d;
    scanf("%d %d %lld", &l, &r, &d);
    graph[l].push_back(make_pair(r, d));
    graph[r].push_back(make_pair(l, -d));
  }

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

  for (int i = 1; i <= n; ++i) {
    // printf("--------------------%d\n", i);

    if (visited[i] || graph[i].empty()) continue;
    if (!check(i, 0LL)) {
      printf("No\n");
      return 0;
    }
  }

  printf("Yes\n");

  return 0;
}


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

int main(){

    int a,b,total=0;
    char sinal;

    scanf("%d %c %d",&a,&sinal,&b);

    if(sinal=='+')
        total=a+b;

    if(sinal=='-')
        total=a-b;

    printf("%d\n",total);

    return 0;
}


Measured memory_bytes: 128
#include <iostream>

#include <stdio.h>

using namespace std;

int main(){

  char S[8];
  int i,ans = 700;
  
  scanf("%s",S);

  for(i = 0; i < 3;i++){
    if(S[i] == 'o'){
      ans += 100;
    }
  }

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


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

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = (int)1e9 + 7;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }


int main(){
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n, a;
	cin >>n >>a;
	VI x(n);
	rep(i, n) cin >>x[i];
	vector<vector<ll>> dp(n+2, vector<ll>(a*n+10, 0));
	dp[0][0] =1;
	
	rep(i, n){
		auto np = dp;
		rep(j, n) rep(k, a*n){
			if(k+x[i] <= a*n) np[j+1][k+x[i]] += dp[j][k];
		}
		swap(dp, np);
	}
	ll ans =0;
	rep2(i, 1, n+1) rep2(j, 1, a*n+1) if(j==i*a) ans += dp[i][j];
	cout << ans <<"\n";
	//for(auto xl: dp){for(auto x :xl) printf("%dll ",x); puts("");}

	return 0;
}

Measured memory_bytes: 2364
#define _USE_MATH_DEFINES
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
#include <typeinfo>

#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REP1(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREP1(i, x) for (int i = ((int)(x)); i > 0; i--)
/*
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

#define all(x) (x).begin(),(x).end()
*/

using namespace std;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int i,n;
    cin >> i >> n;
    cout << i + 1 - n;
}

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

typedef long long ll;

int main(){
    ll a, b, n;
    cin >> a >> b >> n;
    ll ret = 0;
    for(ll x = min(b-1, n); x <= n; x += b){
        ret = max(ret, a*x/b-x/b*a);
        break;
    }
    ll tmp = n/b*b;
    tmp += b-1;
    while(tmp > n)  tmp -= b;
    ret = max(ret, a*tmp/b-tmp/b*a);
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

int main() {
    IOS; string s; cin >> s;
    bool da=0;
    for(int i=0; i<(int)s.length(); ++i) {
        if(s[i]=='7') {da=1; break;}
    }
    if(da) cout << "Yes";
    else cout << "No";
    return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <iomanip>
#include <stack>
#include <array>
#include <deque>
#include <forward_list>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iterator>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <time.h>
#include <complex>
#include <cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n;i>0;i--)
#define arep(a,i,n) for(int i=(a);i<(n);i++)
#define SORT(v) sort((v).begin(),(v).end())
#define TEMP(type,x,y) do {temp temp=x,x=y,y=temp}while(0)
#define INF (1LL << 50);

int main() {

	int N;
	cin >> N;

	string s;
	cin >> s;

	vector<int>a(N + 1, 0);
	vector<int>b(N + 1, 0);

	
	
	for (int i = 0; i < N; i++) {
		if (s[i] == '#') a[i + 1] = a[i] + 1;
		else a[i + 1] = a[i];
	}
	
	
	for (int i = N - 1; i >= 0; i--) {
		if (s[i] == '.') b[i] = b[i + 1] + 1;
		else b[i] = b[i + 1];
	}
	
	
	int ans = 100000;
	for (int i = 0; i <= N; i++) {
		ans = min(ans, a[i] + b[i]);
	}
	

	cout << ans << endl;

	return 0;

}

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

int d[51]={0}, t[51]={0};

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

    sort(d, d+n);

    for(int i=0;i<n;++i){
        t[i] = abs(24*(i%2) - d[i]);
    }

    int mini = d[0];
    for(int i=1;i<n;++i){
        for(int j=0;j<i;++j)
            mini = min(mini, min(abs(t[i]-t[j]), 24-abs(t[i]-t[j])));
    }

    cout << mini << endl;

    return 0;
}


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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<VC> VVC;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1e9;
const LL MOD = 1e9+7;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

//memo
// setprecision()

LL Gcd(LL a, LL b) {
  return __gcd(a,b);
}

LL Lcm(LL a, LL b) {
  LL abd = Gcd(a,b);
  LL x = a / abd, y = b / abd;
  
  return x*y*abd;
}


LL RepSqu(LL N, LL P, LL M) {
  if(P == 0) {
    return 1;
  }
  if(P%2 == 0) {
    LL t = RepSqu(N, P/2, M);
    return t*t % M;
  }
  return (N * RepSqu(N, P-1, M)) % M;
}


int main() {
  
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  VI v = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };
  
  int K;
  cin >> K;
  
  cout << v.at(K-1) << endl;
  
  return 0;
}

Measured memory_bytes: 256
N = int(input())
h = [0]
h[1:] = list(map(int, input().split()))
inf = 1 << 60
dp = [inf] * (N + 1)
dp[0] = 0
dp[1] = 0
dp[2] = abs(h[1] - h[2])
for i in range(3, N + 1):
    dp[i] = min(dp[i], dp[i - 1] + abs(h[i - 1] - h[i]))
    dp[i] = min(dp[i], dp[i - 2] + abs(h[i - 2] - h[i]))

print(dp[N])


Measured memory_bytes: 13900
#include <bits/stdc++.h>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i,a,b) for (ll i=(a);i<(ll)b; i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define INF 1LL << 60
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll,ll> p;
const int MOD = 1000000007;

// vector<p> cut(M);
// cut[i].second
// cut[i].first;
// REP(i,M){
//     int a,b;cin>>a>>b;
//     cut[i] = make_pair(b,a);//last first の順番
// }
// for(int i=0; i<N;i++){
// }
// sort(cut.begin(),cut.end()); //sort
// char '' str ""
int main(void)
{
    int N,M;cin>>N>>M;
    int ans = (3*N + M) / 2;

    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	num, _ := strconv.Atoi(sc.Text())

	fmt.Println(fibonacci(num))
}

func fibonacci(num int) int {
	fibs := make([]int, num+1)

	for i := range fibs {
		if i <= 1 {
			fibs[i] = 1
		} else {
			fibs[i] = fibs[i-1] + fibs[i-2]
		}
	}

	return fibs[num]
}



Measured memory_bytes: 1112
def reader(x)
  x.split(" ").map(&:to_i)
end

def solve(xs, n, k)
  edges = {}
  return 0 if xs.size == 1
  val = xs[-1] - xs[0]
  return val if k == 1
  values = xs[0..-2].zip(xs[1..-1])
    .map.with_index { |x, i|
    x[1] - x[0]
  }.sort.reverse[0..k-2]
  val - values.reduce(&:+)
end
data = $stdin.read.split("\n")
data[1..-1].each_slice(2) do |num, items|
  n, k = reader(num)
  xs = reader(items)
  puts solve(xs, n, k)
end

Measured memory_bytes: 23088
#![allow(unused_imports)]
#![allow(clippy::many_single_char_names)]

// language: Rust(1.42.0)
// check available crates on AtCoder at "https://atcoder.jp/contests/language-test-202001"
// My Library Repo' is at "https://github.com/Loptall/prcn_lib"

/*
    そう甘くはないんだな〜w
*/

// from std...
use std::cmp::{
    max, min,
    Ordering::{Equal, Greater, Less},
    Reverse,
};
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::convert::TryInto;
use std::mem::swap;
use std::ops::*;
use std::process::exit;
use std::{f32, f64, i128, i16, i32, i64, i8, isize, u128, u16, u32, u64, u8, usize};

// Dep' crates are...
use itertools::*;
use itertools_num::*;
use lazy_static::lazy_static;
use maplit::{btreemap, btreeset, hashmap, hashset};
use num_bigint::{BigInt, BigUint};
use num_complex::Complex;
use num_integer::{binomial, gcd, lcm, Integer};
use num_rational::Rational;
use num_traits::{clamp, one, pow, zero, One, Pow, Zero};
use permutohedron::Heap;
use petgraph::unionfind::UnionFind;
use proconio::{fastout, input, is_stdin_empty, marker::*};
use rand::random;

pub const MOD: usize = 1000000007;
pub const MAX: usize = 1usize << 63usize;
pub const MIN: i64 = i64::MIN;
pub const PI: f64 = f64::consts::PI;
pub const A: u8 = 'A' as u8;

// code...
// #[fastout]
fn main() {
    input! {
        d: usize,
        c: [i64; 26],
        s: [[i64; 26]; d],
        t: [Usize1; d]
    }

    let mut last = vec![0usize; 26];
    let mut ans = 0i64;

    for day in 0..d {
        ans += s[day][t[day]];
        last.iter_mut().for_each(|x| *x += 1);
        last[t[day]] = 0;
        ans -= last
            .iter()
            .enumerate()
            .map(|(i, l)| c[i] * *l as i64)
            .sum::<i64>();
        println!("{}", ans);
    }
}


Measured memory_bytes: 2216
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os, const map<T,U>& mp){ os << "{"; for(auto& p : mp){ os << p << ","; } os << "}"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int,int>;
using vi = std::vector<int>;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

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

    ll ans = 0;
    set<ll> st({-1, n});
    for(ll i=0;i<n;i++){
        int p = ids[i];
        auto itr = st.upper_bound(p);
        ll l,r;
        r = *itr - p;
        itr--;
        l = p - *itr;
        ans += l * r * (i+1);
        st.insert(p);
    }
    cout << ans << endl;
}


Measured memory_bytes: 12032
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        char[] c = sc.next().toCharArray();
        int[] a = new int[n + 1];
        int[] b = new int[n + 1];
        for (int i = 0 ; i < n ; i++) {
            a[i + 1] = a[i];
            b[i + 1] = b[i];
            if (c[i] == 'W') {
                a[i + 1]++;
            } else {
                b[i + 1]++;
            }
        }
        int min = n + 3;
        for (int i = 0 ; i < n + 1 ; i++) {
            int lw = a[i] - a[0];
            int rr = b[n] - b[i];
            min = Math.min(min, Math.max(lw, rr));
        }
        System.out.println(min);
    }

}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main() {
  ll N; cin >> N;
  bool flag = false;
  for(ll h = 1; h <= 10000; ++h) {
    for(ll n = 1; n <= 10000; ++n) {
      ll a = N * h * n;
      ll b = 4 * n * h - N * n - N * h;
      ll c = a / b;
      if(a > 0 && b > 0) {
        if(a % b == 0) {
          cout << h << " " << n << " " << c << endl;
          flag = true;
          break;
        }
      }
    }
    if(flag) break;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.lang.Math;

public class Main {
		public static void main (String args[]) throws Exception{
		Scanner scan = new Scanner(System.in);
		double  a = scan.nextDouble();
		double  b = scan.nextDouble();
		double  h = scan.nextDouble();
		double  m = scan.nextDouble();
		double ans = 0;
		h = h * 30 + m * 0.5;
		m = m * 6;
		double angle = Math.abs(h - m);
		ans = a*a + b*b -2*a*b*Math.cos(angle/180*Math.PI);
		System.out.println(Math.sqrt(ans));
	}
}

Measured memory_bytes: 28840
#include<iostream>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>

#define range(i, n) for (i = 0; i < n; i++) 
#define rrange(i, n) for(i = n-1; i>=0; i--)

typedef long long int ll;


using namespace std;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
inline ll max(ll a, ll b) { if (a < b) return b; else return a; }


int main() {
	int i, k, l;

	int A, K, B;

	cin >> A >> B >> K;



	int count = 0;
	int ret = 0;

	for(i=A; i>=0; i--){
		if (A%i == 0 && B%i == 0) {
			count++;
			if (count == K) {
				ret = i;
				break;
			}
		}

	}

	cout << dec << ret;

	return 0;
}


Measured memory_bytes: 256