akhauriyash/Code-Regression huggingface dataset:
/* ITP1_10_B: Triangle */

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main() {
    double a, b;
    int C;
    cin >> a >> b >> C;

    double th = C * M_PI / 180.0;
    double S = (a * b / 2) * sin(th);
    double L = a + b + sqrt( pow(a, 2) + pow(b, 2) - 2 * a * b * cos(th) );
    double h = b * sin(th);

    cout << fixed << setprecision(5)
         << S << endl
         << L << endl
         << h << endl;

    return 0;
}

Measured memory_bytes: 1296
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000

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

    int N;
    cin >> N;
    vector<ll> C(N - 1), S(N - 1), F(N - 1);
    rep(i, N - 1) { cin >> C[i] >> S[i] >> F[i]; }

    for (int i = 0; i < N - 1; i++) {
        ll ans = S[i] + C[i];
        for (int j = i + 1; j < N - 1; j++) {
            if (ans >= S[j]) {
                if ((ans - S[j]) % F[j] == 0)
                    ans += C[j];
                else {
                    ll n = (ans - S[j]) / F[j] + 1;
                    ans += (S[j] + F[j] * n - ans) + C[j];
                }
            } else {
                ans = S[j];
                ans += C[j];
            }
        }

        cout << ans << endl;
    }

    cout << 0 << endl;
}

Measured memory_bytes: 3564
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<char,int> P;
const LL LINF=1LL<<62;
const LL mod=1e9+7;

const int M_N=100000;


struct BIT{
    //1-indexed
    LL bit[M_N+1],n;
    //iまでの総和を返す
    LL sum(int i){
        LL s=0;
        while(i>0){
            s+=bit[i];
            i=i&(i-1);
        }
        return s;
    }
    //iにx加算する
    void add(int i,LL x){
        while(i<=n){
            bit[i]+=x;
            i+=i&-i;
        }
    }

};


int main(){
    int N;
    cin >> N;
    map<P,int> ma;
    for(int i=0;i<2*N;i++){
        int a;
        char c;
        cin >> c >> a;
        ma[mp(c,a)]=i+1;
    }
    LL dp[N+1][N+1];
    for(int i=0;i<=N;i++){
        for(int j=0;j<=N;j++){
            dp[i][j]=LINF;
        }
    }
    BIT bit;
    bit.n=2*N;
    dp[0][0]=0;
    for(int i=0;i<=N;i++){
        if(i) bit.add(ma[mp('W',i)],1);
        for(int j=0;j<=N;j++){
            if(j) bit.add(ma[mp('B',j)],1);
            if(j!=N) dp[i][j+1]=min(dp[i][j+1],dp[i][j]+i+j-bit.sum(ma[mp('B',j+1)]));
            if(i!=N) dp[i+1][j]=min(dp[i+1][j],dp[i][j]+i+j-bit.sum(ma[mp('W',i+1)]));
        }
        for(int j=0;j<N;j++){
            bit.add(ma[mp('B',j+1)],-1);
        }
    }
    cout << dp[N][N] << endl;
    return 0;
}

Measured memory_bytes: 31872
import itertools

N, K = map(int, input().split())
S = input()

gnum = 0
for key, elems in itertools.groupby(S):
    gnum += 1

k = K
while gnum > 1 and K > 0:
    if gnum != 2:
        gnum -= 2
    else:
        gnum -= 1
    K -= 1

if gnum == 1:
    print(N - 1)
else:
    print(N - gnum)


Measured memory_bytes: 3316
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		if(a==b) {
			if(a!=c) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
		}else if(a==c) {
			if(a!=b) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
		}else if(b==c) {
			if(a!=b) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
		}else {
			System.out.println("No");
		}


	}
}


Measured memory_bytes: 21972
loop {
	n = gets.to_i
	break if n == 0
	baloons = (1..n).map {
		gets.split.map &:to_i 		
	}

	if baloons[0].inject(:>)
		puts 'NG 1'
		next
	end

	baloons << [0, baloons[-1][1] + baloons[-1][0] * 5]
	x0, t0 = baloons.shift

	min_dist = [[x0, Float::INFINITY, Float::INFINITY], []]
	itr = 0
	baloons.each{|x, t|
		min_dist[1][0] = (0..2).map{|i|
			x0 * (i+2) + x <= t - t0 ? min_dist[0][i] + x0 + x : Float::INFINITY
		}.min

		min_dist[1][1] = (x - x0).abs * 2 <= t - t0 ? min_dist[0][0] + (x - x0).abs : Float::INFINITY
		min_dist[1][2] = (x - x0).abs * 3 <= t - t0 ? min_dist[0][1] + (x - x0).abs : Float::INFINITY
		
		break if min_dist[1] == [Float::INFINITY] * 3
		x0, t0 = x, t
		min_dist << min_dist.shift
		itr += 1
	}
	if itr < baloons.size
		puts "NG #{itr+2}"
	else
		puts "OK #{min_dist[0].min}"
	end
}

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

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

// 最小公倍数
unsigned lcm(unsigned a, unsigned b){
    return a / gcd(a, b) * b; 
}

int main(){
  int N;
  ll K;
  cin >> N >> K;
  vector<pair<ll,ll>>A(N);
  REP(i, N) cin >> A.at(i).first >> A.at(i).second;
  sort(all(A)); 

  int ans;
    REP(i, N){
      if(K <= A.at(i).second) {
        print(A.at(i).first);
        return 0;
      }
      K -= A.at(i).second;
    }



}

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

int main(){
	int n;
	cin >> n;
	
	int cnt=0;
	for(int i=1; i<10; i++){
      for(int j=1; j<10; j++){
		if(i*j == n) cnt++;
      }
	}

	if(cnt!=0) cout << "Yes" << endl;
	else cout << "No" << endl;
}

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


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

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <sstream>

using namespace std;
string intArrayToString(int* ary, int ary_size);
string select_sort(string str, int ary_size, int &counter);

int main()
{
	string str;
	getline(cin, str);
	int num;
	stringstream num_ss(str);
	num_ss >> num;

	getline(cin, str);
	int counter = 0;


	cout << select_sort(str, num, counter) << endl;
	cout << counter << endl;
	return 0;
}

string select_sort(string str, int ary_size, int &counter) {
	int* ary = new int[ary_size];
	stringstream ss(str);
	string buff;
	int cnt = 0;
	while (getline(ss, buff, ' ')) {
		stringstream tss(buff);
		tss >> ary[cnt];
		cnt++;
	}

	// main.
	for (int i = 0; i < ary_size; i++) {
		int min = i;
		for (int j = i + 1; j < ary_size; j++) {
			if (ary[min] > ary[j]) {
				min = j;
			}
		}
		
		if (min != i) {
			int tmp = ary[min];
			ary[min] = ary[i];
			ary[i] = tmp;
			counter++;
		}
	}

	return intArrayToString(ary, ary_size);
}

string intArrayToString(int* ary, int ary_size) {
	string str = "";
	for (int i = 0; i < ary_size; i++) {
		if (i == ary_size - 1) {
			str += to_string(ary[i]);
		}
		else {
			str += to_string(ary[i]) + " ";
		}
	}
	return str;
}

Measured memory_bytes: 3280
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <queue>
#include <set>
#include <map>
#include <stack>
 
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll N,M,K,X,H,W;
ll ans;
ll total;
ll S[25][25];
ll SS[25][25];
queue<pair<P,ll>> que;

int main(){
    cin >> H >> W;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            char a;
            cin >> a;
            if(a=='.'){
                S[i+1][j+1] = 1;
            }
        }
    }
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            for(int k = 0;k<H;k++){
                for(int l = 0;l<W;l++){
                    SS[k+1][l+1]=S[k+1][l+1];
                }
            }
            if(SS[i+1][j+1]==1){
                que.push(pair<P,ll>(P(i,j),0));
                while(!que.empty()){
                    pair<P,ll> c;
                    c = que.front();
                    que.pop();
                    int k = c.first.first;
                    int l = c.first.second;
                    int z = c.second;
                    SS[k+1][l+1] = 0;
                    if (ans < z){
                        ans = z;
                    }
                    if(SS[k][l+1]==1){
                        SS[k][l+1] = 0;
                        que.push(pair<P,ll>(P(k-1,l),z+1));
                    }
                    if(SS[k+1][l]==1){
                        SS[k+1][l] = 0;
                        que.push(pair<P,ll>(P(k,l-1),z+1));
                    }
                    if(SS[k+1][l+2]==1){
                        SS[k+1][l+2] = 0;
                        que.push(pair<P,ll>(P(k,l+1),z+1));
                    }
                    if(SS[k+2][l+1]==1){
                        SS[k+2][l+1] = 0;
                        que.push(pair<P,ll>(P(k+1,l),z+1));
                    }
                }
            }
        }
    }
    
    cout << ans << endl;
    
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<vector>
#include<array>
#include<string>
#include<stack>
#include<queue>
#include<algorithm>
#include<cassert>
#include<functional>
#include<random>
#include<complex>
#include<bitset>
#include<chrono>
#include<boost/multiprecision/cpp_int.hpp>
#define int int64_t
#define uint uint64_t
#define REP(i, a, b) for (int64_t i = (int64_t)(a); i < (int64_t)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define EACH(i, a) for (auto i: a)
#define ITR(x, a) for (auto x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
#define Min(x) *min_element(ALL(x))
#define Max(x) *max_element(ALL(x))
#define Unique(L) (L.erase(unique(ALL(L)), L.end()))
#define veccat(v1, v2) std::copy((v2).begin(),(v2).end(),std::back_inserter(v1)/*v1の後ろにv2を入れる*/)
#define intmax (std::numeric_limits<int64_t>::max() / 4)
using namespace std;
typedef boost::multiprecision::cpp_int bigint;
const double EPS = 1e-9;
const double PI = acos(-1.0);



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

	int N;
	cin >> N;

	vector<int>m;
	m.push_back(1);
	for (int i = 6; i <= N; i *= 6)m.push_back(i);
	for (int i = 9; i <= N; i *= 9)m.push_back(i);
	vector<int>dp(N + 1, N);
	dp[0] = 0;
	for (int i = 1; i <= N; ++i) {
		for (int x : m) if (x <= i) {
			dp[i] = min(dp[i], dp[i - x] + 1);
		}
	}
	cout << dp[N] << endl;


	return 0;
}



Measured memory_bytes: 1024
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
#define REP(i,n) for(ll i=0; i<(n); i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define ALL(n) begin(n),end(n)
#define IN(a, x, b) (a<=x && x<b)
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
template<class T> inline T CHMAX(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T CHMIN(T & a, const T b) { return a = (a > b) ? b : a; }

const long double EPS = 1e-10;
const long long INF = 1e18;
const long double PI = acos(-1.0L);
const long long MOD = 1000000007;

ll value[1000010];

int main(void){
    ll k;
    cin >> k;
    ll ans =0;
    if(k%2 ==0){
        ans =-1;
    }else{
        ll tmp=0;
        while(1){
            ans++;
            tmp *= 10;
            tmp += 7;
            if(tmp%k == 0){
                break;
            }else{
                tmp %= k;
                if(value[tmp]){
                    ans =-1;
                    break;
                }
                value[tmp] = 1;
            }
        }
    }
    cout << ans << endl;
    return 0;
}   

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define loop(i,b,n) for(int i=b;i<(n);++i)
#define each(e,v) for(auto &&e : v)

#define all(v) (v).begin(),(v).end()
#define sz(v) (int)v.size()

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const double EPS = 1e-9;
const ll MOD = 1e+9 + 7;

template<typename A,typename B> inline void chmin(A &a,B b){ if(a>b) a=b; }
template<typename A,typename B> inline void chmax(A &a,B b){ if(a<b) a=b; }
template <typename T> inline void print(const T& x) { cout << x << endl; }

bool ok(int a, int b, int c, int k){
    if(a<b && b<c) return true;
    if(k==0) return false;
    if(ok(2*a,b,c,k-1)) return true;
    if(ok(a,2*b,c,k-1)) return true;
    if(ok(a,b,2*c,k-1)) return true;
    return false;
}

int main() {
    int a,b,c,k;
    cin >> a >> b >> c >> k;
    if(ok(a,b,c,k)) print("Yes");
    else print("No");
    return 0;
}


Measured memory_bytes: 3584
import java.io.*;
 
public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      String input = br.readLine();
      int x = Integer.parseInt(input);
      System.out.println(x * x * x);
    } catch(IOException e) {
      System.out.println(e);
    }
  }
}

Measured memory_bytes: 24232
/* ITP1_9_A: Finding a Word */

#include <iostream>
#include <string>
#include <algorithm>
using std::string;

const string EOF_STR = "END_OF_TEXT";

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

    string target;
    std::cin >> target;

    int n_targets = 0;
    string word;
    while (std::cin) {
        std::cin >> word;
        std::transform(word.begin(), word.end(), word.begin(), tolower);
        if (word == EOF_STR)
            break;
        if (word == target)
            n_targets++;
    }
    std::cout << n_targets << std::endl;
    return 0;
}

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

#define roop(p,q) for(p=1;p<=q;q++)

int main(){

 long long int N,M;
  scanf("%lld %lld",&N,&M);

/*
  char A[];
  scanf("%s",A);
  */

 /* 
  long long int A[N+1];
  long long int i;
  for(i=1;i<=N;i++){
   scanf("%lld",&A[i]);
   }
  */
  
if(N>=10){
  printf("%lld",M);
}
else{
  printf("%lld",M+100*(10-N));
}








 return(0);
 }


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

int main()
{
    int N;
    cin >> N;

    long long X[N];
    long long Y[N];
    long long arm = 31;

    bool is_odd = false;
    bool is_even = false;
    for (int i = 0; i < N; i++)
    {
        cin >> X[i] >> Y[i];
        if ((abs(X[i]) + abs(Y[i])) % 2 == 0)
        {
            is_even = true;
        }
        else
        {
            is_odd = true;
        }
    }

    if (is_odd && is_even)
    {
        cout << -1 << endl;
        return 0;
    }

    if (is_even)
    {
        cout << arm + 1 << endl;
        cout << 1 << " ";
    }
    else
    {
        cout << arm << endl;
    }

    long long l = 1;
    for (int i = 0; i < arm; i++)
    {
        l *= 2;
    }
    for (int i = 0; i < arm; i++)
    {
        l /= 2;
        cout << l;
        if (i != arm - 1)
        {
            cout << " ";
        }
    }
    cout << endl;

    for (int i = 0; i < N; i++)
    {
        if (is_even)
        {
            cout << "R";
            X[i]--;
        }

        l = 1;
        for (int j = 0; j < arm; j++)
        {
            l *= 2;
        }
        for (int j = 0; j < arm; j++)
        {
            l /= 2;
            long long dx[4] = {1, 0, -1, 0};
            long long dy[4] = {0, 1, 0, -1};
            string word[4] = {"L", "D", "R", "U"};
            for (int k = 0; k < 4; k++)
            {
                if (abs(X[i] + dx[k] * l) + abs(Y[i] + dy[k] * l) < l)
                {
                    X[i] += dx[k] * l;
                    Y[i] += dy[k] * l;
                    cout << word[k];
                    break;
                }
            }
        }
        cout << endl;
    }
}

Measured memory_bytes: 384
#include <iostream>
#include <map>
#include <utility>
using namespace std;
map<pair<int,int>,long long> mp;
int main(){
	int i,n;
	cin >> n;
	for(i=1;i<=n;i++){
		int x = i%10;
		int y = i;
		while(y/10){
			y /= 10;
		}
		mp[{x,y}]++;
	}
	long long ans = 0;
	for(auto x:mp){
		pair<int,int> p = x.first;
		pair<int,int> q = {p.second,p.first};
		ans += mp[p]*mp[q];
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int MAX = 1e4 + 9;
int digit[11] = {2, 5, 5, 4, 5, 6, 3, 7, 6}, dp[MAX], n, m, a[11];

bool cmp(const int &a, const int &b) {
	return a > b;
}

void print_dp() {
	for (int i = 0; i <= n; i++) {
		cout << dp[i] << ' ';
	}
}

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

	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		cin >> a[i]; 
		a[i]--;
	}
	sort(a, a + m, cmp);
	dp[0] = 1;
	for (int i = 0; i <= n; i++) {
		for (int j = 0; j < m; j++) {
			if (i - digit[a[j]] < 0) continue;
			if (dp[i - digit[a[j]]] > 0) dp[i] = max(dp[i], dp[i - digit[a[j]]] + 1);
			//print_dp();
		}
	}
	int len = dp[n];
	while (n) {
		for (int i = 0; i < m; i++) {
			if (n - digit[a[i]] < 0) continue;
			if (dp[n - digit[a[i]]] == len - 1) {
				cout << (char)(a[i] + 1 + '0');
				n -= digit[a[i]];
				len--;
				break;
			}
		}
	}
	
	return 0;
}


Measured memory_bytes: 256
import sys
import random

def rd():
        return sys.stdin.readline().rstrip()

def rdi():
        return [ int(x) for x in rd().split() ]

N, K = rdi()
a = []
b = []

for i in range(N):
        ai, bi = rdi()
        a.append(ai)
        b.append(bi)

c = {}
for i in range(N):
        ai = a[i]
        bi = b[i]
        if ai not in c:
                c[ai] = bi
        else:
                c[ai] += bi
r = K
for x in sorted(c.keys()):
        y = c[x]
        r -= y
        if r <= 0:
                print x
                break

Measured memory_bytes: 16576
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
main()
{
      ll n,x,t,d;
      cin>>n>>x>>t;
      d=(n/x);
      d=d*t;
      if(n%x!=0)
      {
          d+=t;
      }
      cout<<d<<endl;
}


Measured memory_bytes: 3572
n,m=map(int,input().split())
#n<=10**5

tree=[0]*n

for _ in range(m):
    x,y=map(int,input().split())
    tree[x-1]+=1
    tree[y-1]+=1

for item in tree:
    if item%2==1:
        print("NO")
        exit()

print("YES")



Measured memory_bytes: 75380
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


r = int(sys.stdin.readline())
print(r**2 *3)


Measured memory_bytes: 23240
S = input()
a = list()
b = 0
u = 0
for i in range (len(S)):
    if S[u] == 'R':
        b = b + 1
    else:
        a.append(b)
        b = 0
    u = u + 1
a.append(b)
a.sort()
a.reverse()
print(a[0])

Measured memory_bytes: 8992
#include<iostream>
#include<cmath>

#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b))<EPS)

class Point{
    public:
    double x, y;

    Point(double x=0, double y=0):x(x), y(y){}

    Point operator + (Point p) {return Point(x+p.x, y+p.y); }
    Point operator - (Point p) {return Point(x-p.x, y-p.y); }
    Point operator * (double a) {return Point(a*x, a*y); }
    Point operator / (double a) {return Point(a*x, a*y); }

    double abs() {return sqrt(norm());}
    double norm() {return x*x+y*y; }

    bool operator < (const Point &p) const{
        return x != p.x ? x<p.x: y<p.y;
    }

    bool operator == (const Point &p) const{
        return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
    }
};

typedef Point Vector;

double dot(Vector a, Vector b){
    return a.x * b.x+a.y*b.y;
}

double cross(Vector a, Vector b){
    return a.x*b.y -a.y*b.x;
}

bool isOrthogonal(Vector a, Vector b){
    return equals(dot(a,b), 0.);
}

bool isOrthogonal(Point a1, Point a2, Point b1, Point b2){
    return isOrthogonal(a1-a2, b1-b2);
}

bool isParallel(Vector a, Vector b){
    return equals(cross(a,b), 0.0);
}

bool isParallel(Point a1, Point a2, Point b1, Point b2){
    return isParallel(a1-a2, b1-b2);
}

using namespace std;

int main(int argc, char const *argv[])
{
    int q;
    Point p0, p1, p2, p3;
    cin >> q;
    for(int i=0; i<q; i++){
        cin >> p0.x >> p0.y >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y;
        if(isParallel(p0, p1, p2, p3)){
            printf("2\n");
        }
        else if(isOrthogonal(p0, p1, p2, p3)){
            printf("1\n");
        }
        else printf("0\n");
    }

    return 0;
}



Measured memory_bytes: 3228
import java.util.Scanner;

class Main{

	static char[][] map;
	static int H;
	static int W;

	public static void main(String[] args) {



		Scanner sc = new Scanner(System.in);			//文字の入力
		//int N = sc.nextInt();
		String string = sc.next();
		int ans =0;
		for(int i= 0;i<4;i++){
			if(string.charAt(i) == '+'){
				ans++;
			}else{
				ans--;
			}
		}
		System.out.println(ans);
	}
}




class Pair implements Comparable{
	String from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}





Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
#define int           long long
#define pb            push_back
#define x             first
#define y             second
#define sz(v)         (int)v.size()
#define all(x)        (x).begin(),(x).end()
#define PI            3.14159265358979
#define N             200005

int solve(){
    int a,b,c,k; cin>>a>>b>>c>>k;
    if(k<=a+b){
        cout<<min(k,a);
    }
    else{
        cout<<a-(k-(a+b));
    }
    return 0;
}

signed main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t=1;
    // cin>>t;
    while(t--) solve();
    return 0;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    ll n,s=0;
    cin>>n;
    ll m=n;
    while(n)
    {
        s+=n%10;
        n/=10;
    }
    if(m%s==0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


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

#define fi first
#define se second
#define pb push_back
#define int long long
#define all(x) (x).begin(), (x).end()

using LL = long long;
using LD = long double;
using pii = pair<int, int>;
using vii = vector<pii>;

const int INF = 1e18;
const int MOD = 1e9 + 7;
const int N = 1e5 + 5;

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

    string a, b;
    cin >> a >> b;

    int n = a.size(), m = b.size();
    vector<vector<int>> dp(n + 1, vector<int>(m + 1));
    vector<vii> p(n + 1, vii(m + 1, {-1, -1}));
    vector<vector<char>> c(n + 1, vector<char>(m + 1));

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            if (a[i - 1] == b[j - 1]) {
                dp[i][j] = 1 + dp[i - 1][j - 1];
                p[i][j] = {i - 1, j - 1};
                c[i][j] = a[i - 1]; // or b[j - 1] 
            } else {
                if (dp[i - 1][j] > dp[i][j - 1]) {
                    dp[i][j] = dp[i - 1][j];
                    p[i][j] = {i - 1, j};
                } else {
                    dp[i][j] = dp[i][j - 1];
                    p[i][j] = {i, j - 1};
                }
            }
        }
    }
    
    int x, y;
    tie(x, y) = make_pair(n, m);
    string ans;
    while (p[x][y] != make_pair(-1LL, -1LL)) {
        if (c[x][y])
            ans += c[x][y];
        tie(x, y) = p[x][y];
    }

    reverse(all(ans));
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 220544
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
#define _GLIBCXX_DEBUG
     
int main() {
  ll ans=0;
  int n, m, x=0;
  cin >> n >> m;
  priority_queue<int> a;
  rep (i, n) {
    cin >> x;
    a.push(x);
  }
  
  rep (i, m) {
    x = a.top();
    x /= 2;
    a.pop();
    a.push(x);
  }
  
  rep (i, n) {
    ans += a.top();
    a.pop();
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 892
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define F first
#define S second

using namespace std;
using P = pair<int,int>;
using ivec = vector<int>;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

const int MOD=1000000007;
int INF=100100100100100;
int add(int a,int b){
  return (a+b)%MOD;
}
int prod(int a,int b){
  return (a*b)%MOD;
}

int beki(int a,int b)
{
	if(b==0)return 1;
	int x=beki(a,b/2);
	if(b%2==0)return (x*x)%MOD;
	else return (((a*x)%MOD)*x)%MOD;
}

int inv(int a)
{
	return beki(a,MOD-2);
}

int kaijou(int a)
{
	int ans=1;
	for(int i=1;i<=a;i++)
	{
		ans=(ans*i)%MOD;
	}			
	return ans;
}

/*int combi(int a,int b)
{
	int ret=1;
	for(int i=1;i<=b;i++)
	{
		ret=(((ret*(a+1-i))%MOD)*inv(i))%MOD;
	}
	return ret;
}*/
/*
const int MAX_a=200010;
int cb[MAX_a+1]
void combi(int a,int b)
{
    int ret=1;
    cb[0]=1;
    for(int i=1;i<=b;i++)
    {
	ret=(((ret*(a+1-i))%MOD)*inv(i))%MOD;
        cb[i]=ret;
    }
	
}*/

vector<P> prime_factorize(int N)
{
	vector<P> res;
	for(int a=2;a*a<=N;a++)
	{
		if(N%a!=0)continue;
		int ex=0;
		while(N%a==0)
		{
			ex++;N/=a;
		}
		res.push_back(P(a,ex));
	}
	if(N!=1)res.push_back(P(N,1));
	return res;
}

//ここから書く
signed main(){
  int n;cin>>n;
  ivec a(n);
  rep(i,n)cin>>a[i];
  string ans="second";
  rep(i,n){
    if(a[i]%2){
      ans="first";
      break;
    }
  }
  cout<<ans<<endl;
  return 0;
}

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

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

	if (n == 0) {
		cout << x << endl;
		return 0;
	}

	vector<int> v(n);
	for (auto& i : v) {
		cin >> i;
	}

	bool minus = true;
	int ret = x;
	int diff = -1;
	while (1) {
		bool fd = false;
		for (auto& i : v) {
			if (i == ret) {
				fd = true;
				break;
			}
		}

		if (!fd) {
			break;
		}

		if (minus) {
			ret = x + diff;
			diff *= -1;
		}
		else {
			ret = x + diff;
			diff++;
			diff *= -1;
		}
		minus = !minus;
	}

	cout << ret << endl;


	return 0;
}

Measured memory_bytes: 3624
N = int(input())
v = list(map(int, input().split()))
import heapq
def heapsort(iterable):
    h = []
    for value in iterable:
        heapq.heappush(h, value)
    return [heapq.heappop(h) for i in range(len(h))]
heap = heapsort(v)
result = heap[0]
for k in range(1, N):
  result = (result+heap[k])/2
print(result)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <climits>
#include <numeric>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <tuple>
 
using namespace std;
 
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define cina(s, n, a) for(int i = s; i < n; i++) cin >> a[i]
#define couta(n, a) for(int i = 0; i < n; i++) cout << a[i] << ' '
#define copy(s, n, a, b) for(int i = s; i < n; i++) b[i] = a[i]
#define yesno(ok) cout << (ok ? "YES" : "NO")
#define mod(a, b) (b + (a % b)) % b
#define MOD (ll)1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;


void solve(){
    ll n, w;
    cin >> n >> w;
    vector <vll> dp(n + 1, vll(w + 1, 0));
    vll a(n + 1), b(n + 1);
    for(ll i = 1; i <= n; i++) cin >> a[i] >> b[i];
    for(ll i = 1; i <= n; i++){
        for(int j = 1; j <= w; j++){
            dp[i][j] = dp[i - 1][j];
            if(a[i] <= j) dp[i][j] = max(dp[i][j], b[i] + dp[i - 1][j - a[i]]);
        }
    }
    cout << dp[n][w];
}
 
int main(){
    ios::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int q = 1;
    //cin >> q;
    for(int i = 1; i <= q; i++){
        solve();
    }
}


Measured memory_bytes: 80256
N, A, B, C, D = [int(i) for i in input().split()]
road = [i for i in list(input())]

for i in range(D-A):
  if (road[A+i-1] == '#') & (road[A+i] == '#'):
    judge = 0
    break
  else:
    judge = 1
if judge == 1:
  if C < D:
    judge = 1
  else:
    for i in range(D-B+1):
      if (road[B+i-2] == '.') & (road[B+i-1] == '.') & (road[B+i] == '.'):
        judge = 1
        break
      else:
        judge = 0

if judge == 0:
  print("No")
else:
  print("Yes")

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

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()

// output
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
  cout << a;
  ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
  cout << a << ' ';
}

int ans = 0;
bool check = 0;
string s;
int N = 3;
vector<int> v(N);
char a, b;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

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

  if (a < b)
    pr("<");
  else if (a > b)
    pr(">");
  else
    pr("=");

  return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
//#define uint __int128_t
 
#define pb push_back
#define fi first
#define se second
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define low(a,b) lower_bound(all(a),(b))-(a).begin()
#define upp(a,b) upper_bound(all(a),(b))-(a).begin()
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<vint> vvint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
typedef pair<pint,pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007;
const ll INF=1e18;

int N,M;
string s,t;
int gcd(int x,int y)
{
	if(x==0) return y;
	return gcd(y%x,x);
}
int lcm(int x, int y)
{
    return (x * y / gcd(x, y));
}

signed main() {
    IOS();
    //(1ll<<N)シフト演算のオーバーフローに気をつける
    cin>>N>>M;
    cin>>s>>t;
    int x=lcm(N,M);
    int y=gcd(N,M);
    rep(i,0,y){
        if(s[i*(N/y)]!=t[i*(M/y)]){
            cout<<-1<<endl;
            return 0;
        }
    }
    cout<<x<<endl;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    return 0;
}

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

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define deb(x)	cout << #x << " " << x << endl;

typedef long long int ll;

int main() {

	IOS

	ll n, x, m;
	cin >> n >> x >> m;

	unordered_map<ll, ll> seen;
	seen[x] = 1;

	vector<ll> pref(100001);
	pref[0] = 0;
	pref[1] = x;

	ll stc = 1, endc = n;
	ll pf = x, f;

	bool flag = false;

	ll res = x;

	for (ll i = 2; i <= n; i++) {
		f = (pf * pf) % m;

		if (seen.count(f)) {

			// deb(i);


			endc = i-1;
			stc = seen[f];
			flag = true;
			break;
		}


		pref[i] = f + pref[i-1];
		seen[f] = i;
		pf = f;
		res += f;

		// deb(i);
		// deb(f);

	}

	// ll res = 0;
	if (flag) {

		// deb(stc);
		// deb(endc);

		res = pref[stc-1];

		// deb(res);

		ll rem = n-stc+1;

		// deb(rem);

		ll sumc = pref[endc] - pref[stc-1];

		// deb(sumc);

		ll lenc = endc - stc + 1;

		// deb(lenc);

		
		ll times = rem / lenc;

		// deb(times);

		res += times * sumc;

		// deb(res);

		ll modc = rem % lenc;

		// deb(modc);

		res += pref[stc+modc-1] - pref[stc-1];
	}

	cout << res;

	return 0;
}

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

int main(){
  int n, l;
  cin >> n >> l;
  
  int target = 0;
  for (int i=0 ; i<n ; i++)
    target += l + i;
  
  int ans;
  vector<int> pie(n);
  for (int i=0 ; i<n ; i++){
    for (int j=0 ; j<n ; j++){
      if (i == j)
        continue;
      pie.at(i) += l + j;
    }
    if (i == 0)
      ans = pie.at(i);
    else{
      if (abs(pie.at(i)-target) < abs(ans-target))
        ans = pie.at(i);
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3576
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>

#define FOR_LT(i, beg, end) for (int i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (int i = beg; i <= end; i++)
#define FOR_DW(i, beg, end) for (int i = beg; end <= i; i--)

using namespace std;

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

	int n; cin >> n;
	vector<int> as(n);
	for (auto& a : as) {
		cin >> a;
	}

	int64_t ans = 0;

	int i = 0;
	while (i < n - 1) {
		int j = i + 1;
		int ac = as[i];
		int c = 1;

		while (j < n) {
 			if (ac & as[j]) {
				while ((ac & as[j]) && i < j) {
					ac -= as[i];
					i++;
					c--;
				}
				if (i == j) break;
			}

			ac  += as[j];
			ans += c;
			c++;
			j++;
		}

		if (j == n) break;
	}

	ans += n;

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

typedef long long ll;

int main() {
    ll N, C, K;
    cin >> N >> C >> K;
    vector<ll>T(N);
    ll ans, passenger;
    ll first = 0;
    ans = 1;
    passenger = 0;

    for (int i = 0; i < N; i++) {
        cin >> T.at(i);
    }

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

    for (int i = 0; i < N; i++) {
        if (first == 0) {
            first = T[i];
        }
        if (passenger < C && T[i] <= first+K) {
            passenger += 1;
        } else {
            passenger = 1;
            first = T[i];
            ans += 1;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{

     string a,b,c;
     cin>>a>>b>>c;
     if(b[0]==a[(int)a.size()-1]&&b[(int)b.size()-1]==c[0]){
          cout<<"YES"<<endl;
     }
     else cout<<"NO"<<endl;
     return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define ll long long
#define ull unsigned long long
#define ld long double
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rrep(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define pll pair<long long,long long>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define vvc vector<vector<char>>
#define vc vector<char>
#define vvb vector<vector<bool>>
#define vb vector<bool>
#define maxe(x) *max_element(all(x))
#define mine(x) *min_element(all(x))
#define Size(x) ((int)(x).size())
#define umap unordered_map
const long long INF = 1LL << 60;
const long double pi = 3.1415926535897932;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

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

//lis,modpow,uf,modncr,soinsubunkai,yakusurekkyo,gyakugen
//mint,dijkstra

    signed main(){
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
        ll n;
        cin>>n;
        vl X(n);
        vl Y(n);
        vl H(n);
        rep(i,n)cin>>X[i]>>Y[i]>>H[i];
        ll it=0;
        while(H[it]==0)it++;
        rep(i,101){
            rep(j,101){
                ll h=H[it]+abs(i-X[it])+abs(j-Y[it]);
                bool end=false;
                rep(k,n){
                    ll ifh=max(h-abs(X[k]-i)-abs(Y[k]-j),0LL);
                    if(ifh!=H[k]){
                        end=true;
                        break;
                    }
                }
                if(!end){
                    cout<<i<<' '<<j<<' '<<h<<endl;
                    return 0;
                }
            }
        }
    }

Measured memory_bytes: 256
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let mut sc = Scanner::new();
    let sc = sc.next_chars();

    let l = sc.len();
    println!("{}{}{}", sc[0], l - 2, sc[l - 1]);
}

pub struct Scanner {
    buf: std::collections::VecDeque<String>,
}

impl Scanner {
    pub fn new() -> Self {
        Self {
            buf: std::collections::VecDeque::new(),
        }
    }

    fn scan_line(&mut self) {
        let mut flag = 0;
        while self.buf.is_empty() {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).unwrap();
            let mut iter = s.split_whitespace().peekable();
            if iter.peek().is_none() {
                if flag >= 5 {
                    panic!("There is no input!");
                }
                flag += 1;
                continue;
            }

            for si in iter {
                self.buf.push_back(si.to_string());
            }
        }
    }

    pub fn next<T: std::str::FromStr>(&mut self) -> T {
        self.scan_line();
        self.buf
            .pop_front()
            .unwrap()
            .parse()
            .unwrap_or_else(|_| panic!("Couldn't parse!"))
    }

    pub fn next_usize(&mut self) -> usize {
        self.next()
    }

    pub fn next_isize(&mut self) -> isize {
        self.next()
    }

    pub fn next_chars(&mut self) -> Vec<char> {
        self.next::<String>().chars().collect()
    }

    pub fn next_string(&mut self) -> String {
        self.next()
    }

    pub fn next_char(&mut self) -> char {
        self.next()
    }

    pub fn next_float(&mut self) -> f64 {
        self.next()
    }
}


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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}

int nextInt() { int x; scanf("%d", &x); return x;}
ll nextLong() { ll x; scanf("%lld", &x); return x;}

int main2() {
  char ch; cin >> ch;
  cout << (char)(ch + 1) << endl;
  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){

    int A1,A2,A3;
    scanf("%d%d%d",&A1,&A2,&A3);

    if(A1 + A2 + A3 >= 22){
        printf("bust\n");
    }else{
        printf("win\n");
    }

    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int i;
	long int sum,x,n,k,count;
	sum=0;
	int ar[200001];
	
	cin>>n>>k;
	for(i=0; i<=n ; i++)
		ar[i]=0;
	for(i=0; i<n ; i++)
	{
		cin>>x;
		ar[x]++;		
	}
	sort( ar , ar + n +1);
		for(i=0; i<=n ; i++)
			if(ar[i]!=0)
			{
				count=i;
				break;
			}
	
	if(k < n-count+1 )
		for(i=count; i <= n-k; i++) {
			//cout<<ar[i];
			sum+=ar[i];
		}
	else
		sum=0;
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 1024
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}


fn main() {
    let n: u32 = read();
    let l: u32 = read();
    let mut v: Vec<String> = (0..n).map(|_| read()).collect();

    v.sort();

    let mut ans = String::new();
    for s in v {
        ans = format!("{}{}", ans, s);
    }

    println!("{}", ans);
}


Measured memory_bytes: 4352
#include<stdio.h>

int main(void){
	int a[100];
	int n;
	int i,flag;
	int tmp,cnt;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&(a[i]));
	}
	flag=1;
	cnt=0;
	while(flag){
		flag=0;
		for(i=n-1;i>=1;i--){
			if(a[i]<a[i-1]){
				tmp=a[i];
				a[i]=a[i-1];
				a[i-1]=tmp;
				cnt++;
				flag=1;
			}
		}
	}
	for(i=0;i<n;i++){
		printf("%d",a[i]);
		printf("%c",i==n-1?'\n':' ');
	}
	
	printf("%d\n",cnt);
	return 0;

}

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

#define F first
#define S second

using namespace std;

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

const int N = 6, M = 25;

LL n, k;

int main()
{
	cin >> n >> k;
	n %= k;
	cout << min(n, abs(n - k)) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,a[(int)1e5+5];
int add1[(int)1e5+5],min1[(int)1e5+5];
map<int,int> mm;
int main(){
	cin>>n;
	for(int i =0;i<n;i++){
		cin>>a[i];
		add1[i] = a[i]+1;
		min1[i] = a[i]-1;
		mm[a[i]]++;
		mm[add1[i]]++;
		mm[min1[i]]++;
	}
	int ans= 1;
	for(auto e:mm){
		ans = max(ans,e.second);
	}
	cout<<ans<<"\n";
	return 0;
}

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

signed main()
{
	string s;
	cin>>s;
	if(s=="keyence"){
		cout<<"YES"<<endl;
		return 0;
	}
	for(int i=0;i<s.size();i++){
		for(int j=i;j<s.size();j++){
			string x=s.substr(0,i)+s.substr(j+1);
			if(x=="keyence"){
				cout<<"YES"<<endl;
				return 0;
			}
		}
	}
	cout<<"NO"<<endl;
	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[] s = new int[n];
		int[] t = new int[n];
		for(int i = 0 ; i < n ; i++) {
			s[i] = sc.nextInt();
			t[i] = sc.nextInt();
		}
		long a = 1, b = 1;
		for(int i = 0 ; i < n ; i++) {
			long x = Math.max(a / s[i], b / t[i]);
			for(long j = x ;; j++) {
				if(a <= s[i] * j && b <= t[i] * j) {
					a = s[i] * j;
					b = t[i] * j;
					break;
				}
			}
		}
		System.out.println(a + b);
	}
}


Measured memory_bytes: 25936
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
const int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30);
const int INF = (1LL << 60);
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
template< typename T > istream &operator>>(istream &is, vector< T > &v) { for(T &in : v) is >> in; return is; }



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int n,p;string s;
    cin>>n>>p>>s;
    ll ans=0;
    if(p==2){ rep(i,n) if((s[i]-'0')%2 == 0) ans+=i+1; }
    else if(p==5){ rep(i,n) if(s[i]=='0'||s[i]=='5') ans+=i+1; }
    else{
        map<int,int> mp;
        int tmp=0;
        mp[tmp]++;
        int k=1;
        for(int i=n-1;i>=0;i--){
            tmp=(tmp+(s[i]-'0')*k)%p;
            ans+=mp[tmp];
            mp[tmp]++;
            k=k*10%p;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1044
s = input()
ans = [0]*(len(s)+1)
for i, c in enumerate(s):
    if c=='<':
        ans[i+1] = max(ans[i+1], ans[i]+1)
for i, c in enumerate(s[::-1]):
    if c=='>':
        ans[-2-i] = max(ans[-2-i], ans[-1-i]+1)
print(sum(ans))

Measured memory_bytes: 23720