akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> oset;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
using ll = long long;

void test_case(){
	ll n; cin >> n;
	string s ="";
	while(true){
		n--;
		const char ch = 'a'+n%26;
		s+=ch;
		n/=26;
		if(n==0)
			break;
		}
		reverse(s.begin(),s.end());
		cout<<s;
}
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int T=1;
	//~ cin >> T;
	while(T--){
		test_case();
	}
	return 0;
}


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

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define MOD 1000000007

#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;

typedef long long ll;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    ll i,j,n,m;
    string s;
    cin>>s;
    n=s.length();
    ll cnt[13]={0};
    ll temp[13]={0};
    cnt[0]=1;
    ll pro=1;
    for(i=n-1;i>=0;i--)
    {
        for(j=0;j<13;j++)
        temp[j]=cnt[j];
        memset(cnt,0,sizeof(cnt));
        if(s[i]=='?')
        {
            for(ll k=0;k<10;k++)
            {
                ll add=pro*(k);
                add%=13;
                for(j=0;j<13;j++)
                cnt[(j+add)%13]+=temp[j];
                for(j=0;j<13;j++)
                cnt[j]%=MOD;
            }
        }
        else
        {
            ll add=pro*(s[i]-'0');
            add%=13;
            for(j=0;j<13;j++)
            cnt[(j+add)%13]+=temp[j];
            for(j=0;j<13;j++)
            cnt[j]%=MOD;
        }
        pro=pro*10;
        pro%=13;
    }
    cout<<cnt[5];
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
 
using namespace std;
#define ll long long int
//map<pair<ll, ll>, ll> pos;
vector<ll>Iraq;
vector<ll>Seria;
vector<ll>Afgan;
vector<ll>temp;
ll arrra[100008];
map<ll,ll>vis;
map<ll,ll>tmp_vis;
map<ll,ll>exact_pos;
ll F[200009];
ll tF[200009];
vector<ll>sub_s[29];
vector<ll>siz;
ll check=1;


int main() {
    
    ll t, i, h, c, big, end, mid,n,m=0,x,y=1,j,k,p,q,r,s=0,sum,tot=100;
    cin>>n;
    m=sqrt(n);
    for(i=1;i<=m;i++)
    {
      for(j=1;j<=m;j++)
      {
        for(k=1;k<=m;k++)
        {
           h=i*i+j*j+k*k+i*j+j*k+k*i;
          // if(h==)
          vis[h]++;	
        }	
      }	
    }
  for(i=1;i<=n;i++)
    cout<<vis[i]<<'\n';  
    
    
     
 
}

Measured memory_bytes: 5952
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
while(true){
   var n=Arr.shift()-0;
   if(n==0)break;
   var team=[];
   for(var i=0;i<n;i++){
      var arr=(Arr.shift()).split(" ");
      var name=arr.shift();
      var scoreA=0;
      var scoreB=0;
      for(var j=0;j<n-1;j++){
         if(arr[j]-0===0)scoreA++;
         if(arr[j]-0===1)scoreB++;
      }
      team.push([name,scoreA*100+(10-scoreB)+((10-j)*0.01)]);
   }
   team.sort(function(a,b){return b[1]-a[1];});
   team.forEach(function(v){console.log(v[0]);});
}

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

using namespace std;

#define int long long
#define endl '\n'
#define MOD 1000000007
#define maxn 100010

vector<pair<int, int>> g[maxn];

int in[maxn], out[maxn];

void dfs1(int u, int p = -1) {
    for (auto x : g[u]) {
        if (x.first == p)continue;
        dfs1(x.first, u);
        in[u] = max(in[u], x.second + in[x.first]);
    }
}

void dfs2(int u, int p = -1) {
    int mx1(-1), mx2(-1);
    for (auto x :g[u]) {
        if (x.first == p)continue;
        if (in[x.first] + x.second >= mx1)mx2 = mx1, mx1 = in[x.first] + x.second;
        else if (in[x.first] + x.second > mx2)mx2 = in[x.first] + x.second;
    }
    for (auto x :g[u]) {
        if (x.first == p)continue;
        int use = mx1;
        if (in[x.first] + x.second == mx1)
            use = mx2;
        out[x.first] = max(x.second + use, x.second + out[u]);
        dfs2(x.first, u);
    }
}

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

    for (int i = 0; i < n - 1; ++i) {
        int a, b, w;
        cin >> a >> b >> w;

        g[a].push_back({b, w});
        g[b].push_back({a, w});
    }
    dfs1(0);
    dfs2(0);
    for (int i = 0; i < n; i++)
        cout << max(in[i], out[i]) << endl;
}

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

    int t = 1;
//    cin >> t;

    while (t--)
        solve();
    return 0;
}


Measured memory_bytes: 6820
#include <iostream>
#include <cstdio>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <string>
#include <ctype.h>

using namespace std;

class Point
{
public:
	double x, y;
};

void solve()
{
	Point P1, P2;
	cin >> P1.x >> P1.y >> P2.x >> P2.y;
	printf("%.6f\n", sqrt((P2.x - P1.x) * (P2.x - P1.x) + (P2.y - P1.y) * (P2.y - P1.y)));
}

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

Measured memory_bytes: 1236
my ($n, $m) = split(/\s+/, <>);

my (@op);
for (1..$n) { $op[$_] = []; }

for (1..$m) {
    my ($a, $b) = split(/\s+/, <>);
    push @{$op[$a]}, $b;
    push @{$op[$b]}, $a;
}

my @ans;
my $rest = $n-1;
my @current = (1);
$ans[1]=1;

while ($rest>0) {
    my @next = ();
    for my $c (@current) {
	for (@{$op[$c]}) {
	    unless ($ans[$_]) {
		push @next, $_;
		$ans[$_]=$c;
		$rest--;
	    }
	}
    }
    @current = @next;
}

print "Yes\n";
for (2..$n) {
    print $ans[$_], "\n";
}


Measured memory_bytes: 73444
# C - Pyramid

N = int(input())
XYH = [tuple(int(i) for i in input().split()) for _ in range(N)]

XYH.sort(key = lambda x: x[2], reverse=True)

for cx in range(101):
    for cy in range(101):
        (x, y, h) = XYH[0]
        tmp_H = h + abs(x - cx) + abs(y - cy)
        for (x, y, h) in XYH:
            if h != max(tmp_H - abs(x - cx) - abs(y - cy), 0):
                break
        else:
            ans = (cx, cy, tmp_H)
            break

print(' '.join(map(str, ans)))
        

Measured memory_bytes: 3064
#include <stdio.h>
#define MAX_N 51
#define MAX_M 51
#define MAX_COUNT 101

int count[MAX_COUNT];

void init(void) {
  int i;
  for (i = 0; i < MAX_COUNT; i++)
    count[i] = 0;
}

int main(void) {
  int n, q, m, t, i, j, max, maxp;
  while (1) {
    init();
    scanf("%d %d", &n, &q);
    if (n == 0 && q == 0) return 0;

    for (i = 0; i < n; i++) {
      scanf("%d", &m);
      for (j = 0; j < m; j++) {
	scanf("%d", &t);
	count[t]++;
      }
    }

    max = 0;
    maxp = 0;
    for (i = 1; i < MAX_COUNT; i++) {
      if (count[i] >= q && count[i] > max) {
	max = count[i];
	maxp = i;
      }
    }
    printf("%d\n", maxp);
  }
}

Measured memory_bytes: 600
#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,sum=0;
    char s[10];
    scanf("%s",s);
    int len=strlen(s);
    for(i=0 ; i<len ; i++)
    {
        if(s[i]=='+')
        {
            sum++;
        }
        else
        {
            sum--;
        }
    }
    printf("%d\n",sum);
    return 0 ;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
#define PI acos(-1)
#define ld long double
//mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
const int mod = 1e9+7, N = 2e5+5;

int a[N], n, m, k, p[N];

void solve(int test_case){
	int i, j, x, d;
	cin >> n >> k;
	int ans = -mod;
	for(i=1;i<=n;i++){
		cin >> p[i];
	}for(i=1;i<=n;i++){
		cin >> a[i];
		ans = max(a[i], ans);
	}
	for(int s=1;s<=n;s++){
		vector<int> used(n+1, false);
		i = s;
		int sum = 0;
		int c = 0;
		int mx = -mod;
		vector<int> mm(n+1);
		while(!used[i]&&c<k){
			used[i] = true;
			sum += a[p[i]];
			mx = max(sum, mx);
			i = p[i];
			c++;
			mm[c] = mx;
		}ans = max(mx, ans);
		if(k > c){
			ans = max(ans, mm[k-((k-1)/c)*c]+(((k-1)/c)*(sum)));
		//	cout << mx << ' ' << c << '\n';
		}
	}cout << ans << '\n';
}

signed main(){
	FASTIO;
#define MULTITEST 0
#if MULTITEST
	int ___T;
	cin >> ___T;
	for(int T_CASE = 1; T_CASE <= ___T; T_CASE++)
		solve(T_CASE);
#else
	solve(1);
#endif
	return 0;
}



Measured memory_bytes: 3688
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int r, c;
  cin >> r >> c;
  int arr[r + 1][c + 1];

  rep(i, 0, r) rep(j, 0, c) cin >> arr[i][j];

  rep(i, 0, c) {
    int sum_val = 0;
    rep(j, 0, r) { sum_val += arr[j][i]; }
    arr[r][i] = sum_val;
  }
  rep(i, 0, r + 1) {
    int sum_val = 0;
    rep(j, 0, c) { sum_val += arr[i][j]; }
    arr[i][c] = sum_val;
  }

  rep(i, 0, r + 1) {
    rep(j, 0, c + 1) {
      if (j > 0)
        cout << " ";
      cout << arr[i][j];
    }
    cout << endl;
  }
}



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

const int mod = 1000000007;

int main()
{
	int n;
	ll ans;
	string s1,s2;
	cin>>n;
	cin>>s1>>s2;
	int len = s1.size();
	for(int i=0;i<len;i++){
		if(s1[i]==s2[i]){
			if(i==0)	ans=3;
			else if(s1[i-1]==s2[i-1])  ans = (ans*2)%mod;
		}
		else{
			if(i==0)	ans = 6;
			else {
				if(s1[i-1]==s2[i-1])	ans = (ans*2)%mod;
				else  ans = (ans *3)%mod;
			}
			i++;
		}
	}
	cout<<ans<<'\n';
	return 0;
 } 


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

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

  string s;
  cin >> s;
  cout << s.at(0) << s.at(1) << s.at(2) << endl;

  return 0;
}

Measured memory_bytes: 3616
require 'prime'

def solve(p)
  (2...p-1).each_with_object([1, 10 % p]){ |i, arr| arr << (arr[1] * arr[-1]) % p }.reduce(:+) % p
end
n = gets.to_i
p solve(Prime.each.lazy.drop_while{ |p| p <= 2 * n }.take(1).to_a[0])

Measured memory_bytes: 9020
#include<bits/stdc++.h>
using namespace std;
int main(){
  
  int n,m,a,b,ans=1;
  vector<int> vec;
  
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a;
    vec.push_back(a);
  }
 
  cin >> m;
  for(int i=0;i<m;i++){
    cin >> b;
    ans *= binary_search(vec.begin(),vec.end(),b);
  }
  cout << ans << endl;
  return(0);
}



Measured memory_bytes: 3908
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
ll mx(ll a,ll b){if(a>=b) return a;return b;}
ll mn(ll a,ll b){if(a<b) return a;return b;}
#define pb push_back
#define mp make_pair
#define endl "\n"
#define INF (int) (3e18)
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    string s,t;
    cin>>s>>t;
    ll m=s.size(),n=t.size();
    ll dp[m+1][n+1];
    for(ll i=0;i<=m;i++)
        for(ll j=0;j<=n;j++){
            if(i==0 or j==0)
                dp[i][j]=0;
            else if(s[i-1]==t[j-1])
                dp[i][j]=dp[i-1][j-1]+1;
            else
                dp[i][j]=mx(dp[i-1][j],dp[i][j-1]);
        }
    ll len=dp[m][n];
    ll len2=len;
    char lcs[len];
    ll i=m,j=n;
    while(i!=0 and j!=0){
        if(s[i-1]==t[j-1]){
            lcs[len-1]=s[i-1];
            i--;j--;len--;
        }
        else if(dp[i][j-1]>=dp[i-1][j])
            j--;
        else
            i--;
    }
    for(ll i=0;i<len2;i++)
        cout<<lcs[i];
    cout<<endl;
    return 0;
}





Measured memory_bytes: 70656
#include <iostream>
#include <string>

using namespace std;

string s,t,u;

int a,b;

int main()
{
    cin>>s>>t>>a>>b;
    cin.get();cin>>u;
    if(u==s)
        a--;
    else
        b--;
    cout<<a<<" "<<b<<'\n';
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <locale>
#include <iostream>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()

using namespace std;

using ll = long long;
using ld = long double;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> int len(const T &x) { return x.size(); }

template<typename T>
vector<T> table(int n, T v) { return vector<T>(n, v); }

template <class... Args>
auto table(int n, Args... args) {
  auto val = table(args...);
  return vector<decltype(val)>(n, move(val));
}

struct yes_no : numpunct<char> {
  string_type do_truename()  const { return "Yes"; }
  string_type do_falsename() const { return "No"; }
};

string S;
int dp[310][310][310];
bool memo[310][310][310];

int dfs(int l, int r, int k) {
  if (k < 0) return -1e9;
  if (l > r) return 0;
  if (l == r) return 1;
  int &m = dp[l][r][k];
  if (memo[l][r][k]) return m;
  int res = dfs(l, r - 1, k);
  chmax(res, dfs(l + 1, r, k));
  if (S[l] == S[r]) chmax(res, dfs(l + 1, r - 1, k) + 2);
  else chmax(res, dfs(l + 1, r - 1, k - 1) + 2);
  memo[l][r][k] = true;
  return m = res;
}

int main() {
  locale loc(locale(), new yes_no);
  cout << boolalpha << setprecision(12) << fixed;
  cout.imbue(loc);
	ll K;
	cin >> S;
	cin >> K;
  const int n = S.size();
  cout << dfs(0, n - 1, K) << endl;
	return 0;
}


Measured memory_bytes: 143616
package main

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

func main() {
	n := readInt()
	ans := 0
	m := math.MaxInt64
	for i := 0; i < n; i++ {
		p := readInt()
		if p <= m {
			ans++
		}
		m = min(m, p)
	}

	fmt.Println(ans)
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

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

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


Measured memory_bytes: 2048
#include <iostream>
#include <map>
#include <queue>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;
#pragma warning (disable: 4996)

int N, A[1 << 18];
vector<int> E[1 << 18];

int main() {
	cin >> N;
	for (int i = 1; i <= N; i++) cin >> A[i];
	for (int i = 1; i <= N; i++) {
		for (int j = i; j <= N; j += i) E[j].push_back(i);
	}

	vector<int> vec;
	for (int i = N; i >= 1; i--) {
		if (A[i] == 0) continue;
		for (int j : E[i]) A[j] ^= 1;
		vec.push_back(i);
	}
	cout << vec.size() << endl;
	for (int i = 0; i < vec.size(); i++) {
		if (i) cout << " "; cout << vec[i];
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 25080
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
#include<fstream>
#include<set>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define out(str) cout << str << endl
#define ALL(a) (a).begin(),(a).end()
#define INF (1<<29)

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

int N,K,cnt,h;

int main(){
    cin>>N>>K;
    rep(i,N){
        cin>>h;
        if(h>=K)cnt++;
    }
    out(cnt);
    
    
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
typedef long long ll;
int main()
{
  int m;
  cin >> m;
  vector<ll> d(m),c(m);
  rep(i,m){
    cin >> d[i] >> c[i];
  }
  
  ll sum=0;
  ll res=-1;
  rep(i,m){
    res+=c[i];
    sum+=d[i]*c[i];
  }
  cout << res+(sum-1)/9 << "\n";
  
  return 0;
}


Measured memory_bytes: 3328
A, B, C, K = map(int, input().split())
result = 0
k = K
ca = 0

k -= A
if k < 0:
    k = 0
    result += 1 * K
else:
    result += 1 * ( A )

    k -= B
    if k > 0:

        result -= 1 * ( k )

print(result)

Measured memory_bytes: 9188
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
int main() {
    int a,b;
    cin >> a >> b;
    for(int i=1;i<=10000;++i){
      int x = i * 8/100;
      int y = i * 10/100;
        if(a == x && b == y){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        string s = sc.Next();

        string answer = s.Substring(0, 3);

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


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

using namespace std;

const int N = 2e5 + 7;
int n;


int main() {
    std :: ios :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    char x;
    cin >> x;
    if(x >= 'A' and x <= 'Z') cout << 'A' << endl;
    else cout << 'a' << endl;
    return 0;
}



Measured memory_bytes: 3688
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define forna(i,a,n) for(int i =a; i < n; i++)
#define fornd(i,a) for (int i = (a)-1; i >= 0; i--)
#define pb push
#define fi first
#define se second
#define __ ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long int unsigned lliu;
typedef long long int lli;
typedef pair<lli,lli> pi;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;

int main(){
    string s;
    int a=0;
    cin>>s;
    forn(i, s.size()){
        if(s[i]=='A')
            a++;
    }
    if(a==0 || a==3){
        cout<<"No\n";
    } else
        cout<<"Yes\n";
}

Measured memory_bytes: 256
n = int(input())
points = set()
A = []
B = []
for _ in range(n):
    a, b = map(int, input().split())
    if n % 2 == 0:
        a *= 2
        b *= 2
    A.append(a)
    B.append(b)


A.sort()
B.sort()

if n % 2 == 0:
    src = (A[n // 2 - 1] + A[n // 2]) // 2
    dst = (B[n // 2 - 1] + B[n // 2]) // 2
else:
    src = A[n // 2]
    dst = B[n // 2]

print(dst - src + 1)


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

int main(){
    int N;
    cin >> N;
    vector<int> P(N, 0);
    rep(i, N) cin >> P[i];

    int cnt = 0;
    int minv = N + 10;

    for (int i = 0; i < N; i++){
        if (P[i] < minv){
            minv = P[i];
            cnt++;
        }
    }

    cout << cnt << endl;
    
    // if (a >= b){
    //     rep(i, a) cout << b;
    //     cout << endl;
    // }else{
    //     rep(i, b) cout << a;
    //     cout << endl;
    // }

    return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#define REP(i, n) for(long long i = 0; i < n; ++i)
#define ALL(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

int main() {
	while(1) {
	int n, m;
	cin>>n>>m;
		if(n==0&&m==0) break;
	vector<P> d(n);
	REP(i, n) cin>>d[i].first>>d[i].second;
	sort(ALL(d));
	ll res = 0;
	REP(i, n - 1) if(d[i + 1].first > d[i].first) res += d[i].second;
		res += d[n - 1].second;
	cout<<res<<endl;
	}
}

Measured memory_bytes: 3088
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void chmin(int &a, int b) { if (a > b) a = b; }

int N, A, B, C;
vector<int> L;

// 再帰
int rec(int i, int a, int b, int c) {
    if (i == N) {
        if (!a || !b || !c) return 1000000; // A, B, C いずれも竹は 1 本は必ず使ってないとダメ
        return abs(a - A) + abs(b - B) + abs(c - C); // 合体してできた a, b, c を A, B, C にするコスト
    }

    // 今ある竹を採用しない場合
    int res = rec(i+1, a, b, c);
    
    // A, B, C を使う場合。
    // (a ? 10 : 0) とかは、最初の 1 本目は合体コストなし、2 本目からはコスト 10 かかることを意味する
    chmin(res, rec(i+1, a + L[i], b, c) + (a ? 10 : 0));
    chmin(res, rec(i+1, a, b + L[i], c) + (b ? 10 : 0));
    chmin(res, rec(i+1, a, b, c + L[i]) + (c ? 10 : 0));
    
    return res;
}

int main() {
    // 入力
    cin >> N >> A >> B >> C;
    L.resize(N);
    for (int i = 0; i< N; ++i) cin >> L[i];
    
    // 再帰する
    cout << rec(0, 0, 0, 0) << endl;
}

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

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 100000000

vector<vector<ll> > dp(1005, vector<ll> (1005,-1));
char s[1005][1005];
ll n,m;
ll f(ll i , ll j){

    if(i>=n || j>=m || s[i][j]=='#') return 0;
    if(i==n-1 && j==m-1) return 1;
    if(dp[i][j]!=-1) return dp[i][j];

    dp[i][j] = f(i+1,j)+f(i,j+1);
    dp[i][j] = dp[i][j] % 1000000007;

    return dp[i][j];
}



int main(){

    cin>>n>>m;
    ll i;
    for(i=0;i<n;i++) cin>>s[i];
    f(0,0);


    cout<<dp[0][0]<<endl;
    return 0;
}


Measured memory_bytes: 9344
#include <iostream>
#include <iomanip>
#include <random>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <sstream>
#include <bitset>
#include <cassert>
#include <fstream>
#include <queue>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
	#define DBG(X) cout << #X << "=" << (X) << '\n';
	#define SAY(X) cout << (X) << '\n';
#else
	#define DBG(X)
	#define SAY(X)
#endif
 
using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld  = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF  = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for(auto el: v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for(auto& elem: ret) cin >> elem; return ret; }

void solve() {
	int n = fetch<int>();
	int cnt = 0, mn = n + 1;
	for(int i = 0; i < n; ++i) {
		int v = fetch<int>();
		if(v < mn) {
			++cnt;
			mn = v;
		}
	}

	cout << cnt << '\n';
}

int main() {
	fast_io();
	solve();

	return 0;
}


Measured memory_bytes: 256
arr = list(map(str, input().split()))

stack = []

for i in range(len(arr)):
	current = arr[i]
	if current.isnumeric():
		stack.append(int(current))
	else:
		n1 = stack.pop()
		n2 = stack.pop()
		if current == '+':
			n1 = n1 + n2
		elif current == '-':
			n1 = n2 - n1
		else:
			n1 = n1 * n2
		stack.append(n1)

print(stack.pop())

		


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

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
ll max(ll a, ll b, ll c){
    return max(a, max(b, c));
}
int mat[maxn][5];
ll dp[maxn][5];
int main()
{
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < 3; ++j) {
            cin >> mat[i][j];
            dp[i][j] = -(1e18L + 10);
        }
    }
    dp[0][0] = mat[0][0];
    dp[0][1] = mat[0][1];
    dp[0][2] = mat[0][2];
    for(int at = 0; at < n; ++at) {
        for(int prev_activity = 0; prev_activity < 3; ++prev_activity) {
            for(int next_activity = 0; next_activity < 3; ++next_activity) {
                if(prev_activity == next_activity) continue;
                dp[at + 1][next_activity] = max(dp[at + 1][next_activity], dp[at][prev_activity] + mat[at + 1][next_activity]);
            }
        }
    }
    cout << max(dp[n][0], dp[n][1], dp[n][2]) << endl;
    return 0;
}

Measured memory_bytes: 6144
import sys
f = sys.stdin

k1 = {
" ":"101",
"'":"000000",
",":"000011",
"-":"10010001",
".":"010001",
"?":"000001",
"A":"100101",
"B":"10011010",
"C":"0101",
"D":"0001",
"E":"110",
"F":"01001",
"G":"10011011",
"H":"010000",
"I":"0111",
"J":"10011000",
"K":"0110",
"L":"00100",
"M":"10011001",
"N":"10011110",
"O":"00101",
"P":"111",
"Q":"10011111",
"R":"1000",
"S":"00110",
"T":"00111",
"U":"10011100",
"V":"10011101",
"W":"000010",
"X":"10010010",
"Y":"10010011",
"Z":"10010000"}
import string
k2 = string.ascii_uppercase + " .,-'?"

for line in f:
    c1 = c2 = ''
    for c in line.rstrip('\n'):
        c1 += k1[c]

    #5の倍数に0フィル
    c1 += '0' * (- len(c1) % 5)

    for i in range(0, len(c1),5):
        c2 += k2[ int(c1[i:i + 5],2)]
    print(c2)

Measured memory_bytes: 6748
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
using namespace std;
using ll = long long;

unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

int main() {
    int a,b;
    cin >> a >> b;
    if (a >= b)cout << 10 << endl;
    else cout << 0 << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys


def solve(a: int, b: int):
    n = b - a - 1
    return n * (n + 1) // 2 - a

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    print(solve(a, b))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()


Measured memory_bytes: 9120
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define LLINF 9223372036854775807
#define MOD ll(1e9+7)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr<<#x<<": "<<x<<endl


int main(){
    ll n,k; cin >> n >> k;

    cout << ((k==1) ? 0 : n-k) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

int main(void){
    double buf[8];
    double ip;
    double eps;
    eps = 0.00001*0.00001;
    do{
        scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n",
                buf,buf+1,buf+2,buf+3,
                buf+4,buf+5,buf+6,buf+7);
        ip = (buf[2]-buf[0])*(buf[6]-buf[4]) + 
             (buf[3]-buf[1])*(buf[7]-buf[5]);
        ip = (ip>0.0)?ip:(-ip);
        if(ip<eps) printf("YES\n");
        else printf("NO\n");
    }while(!feof(stdin));
    return 0;
}

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

int Q;
int l[NUM];
int r[NUM];
bool eratos[NUM+3];
int acc[NUM+3];

void set_eratos() {
  eratos[1] = false;
  for (int i = 2; i <= NUM; i++) {
    eratos[i] = true;
  }
  for (int i = 2; i <= NUM; i++) {
    if (eratos[i]) {
      for (int j = i + i; j <= NUM; j += i) {
        eratos[j] = false;
      }
    }
  }
}

bool is_2017_like(int n) {
  return eratos[n] && eratos[(n + 1) / 2];
}

void set_acc() {
  acc[0] = 0;
  for (int i = 1; i <= NUM; i++) {
    if (is_2017_like(i)) {
      acc[i] = acc[i - 1] + 1;
    } else {
      acc[i] = acc[i - 1];
    }
  }
}

void solve() {
  for (int i = 0; i < Q; i++) {
    cout << acc[r[i]] - acc[l[i] - 1] << endl;
  }
}

int main() {
  cin >> Q;
  for (int i = 0; i < Q; i++) {
    cin >> l[i] >> r[i];
  }

  set_eratos();
  set_acc();
  solve();
  return 0;
}


Measured memory_bytes: 1920
N, D = map(int, input().split())

coord = []
for i in range(N):
    coord.append(list(map(int, input().split())))

ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        tmp = 0
        for x, y in zip(coord[i], coord[j]):
            tmp += (x - y) ** 2
        if (tmp ** 0.5).is_integer():
            ans += 1
print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int getgcd(int a,int b){
  int x,y; x = max(a,b); y = min(a,b);
  int c=1,r=1;
  while(y != 0 && c != 0){
    c = x / y;
    r = x % y;
    x = y; y = r;
  }
  return x;
}

int main()
{
  int K; cin >> K;
  ll sum = 0;
  FOR(a,1,K+1){
    FOR(b,1,K+1){
      FOR(c,1,K+1){
        sum += getgcd(getgcd(a,b),c);
      }
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 3604
#!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
INF = 10**19
def input():
    return sys.stdin.readline()[:-1]
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b

def main():
    W, H, x, y = map(int, input().split())

    if x == W / 2 and y == H / 2:
        print(W * H / 2, 1)
    else:
        print(W * H / 2, 0)


if __name__ == '__main__':
    main()


Measured memory_bytes: 70896
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 1 << 21;
const ll INF = 1LL << 60;
const ll mod = 1e9+7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

// abc138d
int main(){
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int cnt = 0;
    rep(i, n-1){
        if (s[i]==s[i+1]) cnt++;
    }
    int ans = min(cnt+2*k, n-1);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque> 
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype> 
using namespace std;

int main(){
    int H, W;
    cin >> H >> W;
    vector<vector<char> > C(H,vector<char>(W));
    for (int i=0; i<H; i++) {
        for (int j=0; j<W; j++) {
            cin >> C.at(i).at(j);
            cout << C.at(i).at(j);
        } 
        cout << endl;
        for (int j=0; j<W; j++) {
            cout << C.at(i).at(j);
        }
        cout << endl;
    }
}

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

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

  int ans = 1;
  for (int i = 0; i < N-1; i++) {
    if (S[i] != S[i+1]) ans += 1;
  }
  cout << ans << endl;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <deque>
#include <bitset>
using namespace std;

#define rep(i, n) for (int i=0; i<int(n); i++)
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))


int main() {
	int n, k;
	cin >> n >> k;
	int A[n];
	rep(i, n) cin >> A[i];
	cout << ceil(float(n-1)/float(k-1)) << endl;
}

Measured memory_bytes: 4160
#include <iostream>
#include<bits/stdc++.h>
#define ll long long
#define   ull unsigned long long 
const int MAX=2e5+9;
const long long mod=1e9+7;
using namespace std;
vector<int>adj[MAX];
int dp[MAX][4];
ll pre[MAX][101];
int main(){
	int n ,m;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int u, v;
		cin>>u>>v;
		u--;
		v--;
		adj[u].push_back(v);
	}
	int s,t;
	cin>>s>>t;
	s--;
	t--;
	queue<pair<int , int> > q;
	q.push(make_pair(s, 0));
	while(!q.empty()){
		pair<int , int> p = q.front();
		q.pop();
		int now=p.first;
		int cnt=p.second;
		for(int i=0;i<adj[now].size();i++){
			int to=adj[now][i];
			if(dp[to][(cnt+1)%3])continue;
			dp[to][(cnt+1)%3]=dp[now][cnt]+1;
			q.push(make_pair(to , (cnt+1)%3));
		}
	}
	if(dp[t][0])cout<<dp[t][0]/3;
	else
		cout<<-1;


}

Measured memory_bytes: 11264
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))

N,X,T=map(int, input().split())


print(math.ceil(N/X)*T)

Measured memory_bytes: 72856
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
#define pll pair<ll,ll>
using ll=long long;
using ld=long double;
const ll INF = 1LL<<60;
const ll mod=1e9+7;
using namespace std;
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }


int main(){
    ll n;
    cin>>n;
    cout<<(ceil(n/1000.0)*1000)-n;
}




Measured memory_bytes: 3772
N,W = map(int,input().split())
weight = [0]
value = [0]
for i in range(N):
    w,v = map(int,input().split())
    weight.append(w)
    value.append(v)
    
maxValue = sum(value)
INF = 10**10
dp = [[INF for i in range(maxValue+1)] for j in range(N+1)]
for i in range(N+1):
    dp[i][0] = 0
for i in range(1,N+1):
    for v in range(1,maxValue+1):
        if value[i] <= v:
            dp[i][v] = min(dp[i-1][v],weight[i] + dp[i-1][v-value[i]])
        else:
            dp[i][v] = dp[i-1][v]
ans = 0
for x in range(maxValue+1):
    if dp[N][x] <= W:
        ans = x
print(ans)

Measured memory_bytes: 171116
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

using namespace std;

//----------------------- Print Function ----------------------//

inline void print() {
    cout << '\n';
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest) {
    cout << first << ' ';
    print(rest...);
}

template <typename T>
void print(const T &a) {
    for (auto e : a) cout << e << ' ';
    cout << '\n';
}

//------------------------- Libraries -------------------------//

//--------------------------- Solve ---------------------------//

void solve() {
    int x; cin >>x;
    if (x == 1) cout << 0 << '\n';
    else cout << 1 << '\n';
}

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

    solve();

    return 0;
}

Measured memory_bytes: 3608
let puts st = print_string st; print_string "\n"
let puti num = print_int num; print_string "\n"
let getSL () = Str.split (Str.regexp " ") (read_line ())
let getAS () = Array.of_list @@ getSL ()
let getLI () = List.map int_of_string (getSL ())
let getAI () = Array.of_list (getLI ())
let geti () = int_of_string (read_line ())
let rep n f =
    let rec repimpl i n = if i < n then (f i; repimpl (i+1) n) else () in repimpl 0 n
let rep_from from until f =
    let rec repimpl i n = if i < n then (f i; repimpl (i+1) n) else () in repimpl from until


let () =
    let n :: k :: _ = getLI() in
    let inl = getAI() in
    let dp = Array.make (k+1) false in
    rep (k+1) (fun i ->
        Array.iter (fun v ->
            if v+i <= k then
                dp.(v+i) <- dp.(v+i) || not dp.(i);
        ) inl
    );
    puts @@ if dp.(k) then "First" else "Second"


Measured memory_bytes: 5376
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
class Solve{
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        string[] str = Console.ReadLine().Split(' ');
        long A = int.Parse(str[0]);
        long B = int.Parse(str[1]);
        long C = int.Parse(str[2]);
        int count = 0;
        while(true){
            if(A%2 == 1 || B%2 == 1 || C%2 == 1){
                break;
            }
            long A0 = (B+C)/2;
            long B0 = (A+C)/2;
            long C0 = (A+B)/2;
            if(A == A0 && B == B0 && C == C0){
                count = -1;
                break;
            }
            count++;
            A = A0;
            B = B0;
            C = C0;
        }
        sb.Append(count+"\n");
    }
}

Measured memory_bytes: 11092
#include<string>
#include<list>
#include<iostream>
using namespace std;
int main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
 
  string str;
  list<int> data;
  list<int>::iterator it,l;
  int n,x;
  cin >> n;
  while(n--){
    cin >> str;
    if(str == "insert"){
      cin >> x;
      data.push_front(x);
    }else if(str == "delete"){
      cin >> x;
      for(it=data.begin(),l=data.end();it!=l;++it){
    if(*it == x){
      data.erase(it);
      break;
    }
      }
    }else if(str == "deleteFirst") data.pop_front();
    else data.pop_back();
  }
  for(it=data.begin(),l=--data.end();it!=l;++it) cout << *it << " ";
  cout << *it << endl;
}

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

int n;
vector<int> pre, in, ans;

int main() {
  string word;
  stack<int> S;
  while (cin >> word) {
    if (word == "+") {
      int num1 = S.top();
      S.pop();
      int num2 = S.top();
      S.pop();
      S.push(num2 + num1);
    } else if (word == "-") {
      int num1 = S.top();
      S.pop();
      int num2 = S.top();
      S.pop();
      S.push(num2 - num1);
    } else if (word == "*") {
      int num1 = S.top();
      S.pop();
      int num2 = S.top();
      S.pop();
      S.push(num2 * num1);
    } else
      S.push(stoi(word));
  }
  cout<<S.top()<<endl;
}



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

int a,b,c;
bool ans;

int main(){
    scanf("%d%d%d",&a,&b,&c);
    if(b == a && c != a) ans = 1;
    if(c == a && b != a) ans = 1;
    if(b == c && a != c) ans = 1;
    if(ans) printf("Yes\n");
    else printf("No\n");
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, M; cin >> N >> M;
	vector<int> in(N);
	rep(i, 0, M) {
		int a, b; cin >> a >> b;
		a--, b--;
		in[a]++, in[b]++;
	}
	rep(i, 0, N) {
		if (in[i] % 2 != 0) {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}

Measured memory_bytes: 640
#! env python
# -*- coding: utf-8 -*-

import os
import sys


# ac_py.main
# Date: 2020/06/16
# Filename: main 
# Author: acto_mini

def main():
    K, S = map(int, input().split())

    ans = 0
    for i in range(K + 1):
        for j in range(K + 1):
            if 0 <= (S - i - j) <= K:
                ans += 1
    print(ans)
    return


if __name__ == '__main__':
    main()


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

int main(){
    int n,m;
    while(scanf("%d %d",&n,&m), n != 0 || m != 0){
        int t[101]={0}, h[101]={0}, st=0, sh=0;
        for(int i=0;i<n;++i){
            scanf("%d",&t[i]);
            st += t[i];
        }
        for(int i=0;i<m;++i){
            scanf("%d",&h[i]);
            sh += h[i];
        }
        int dif = st - sh;
        if(dif % 2 != 0){
            printf("-1\n");
            continue;
        }
        bool flag=false;
        int mini = INT_MAX, a,b;
        for(int i=0;i<n;++i){
            for(int j=0;j<m;++j){
                int d = t[i] - h[j];
                if(d == dif/2){
                    if(t[i] + h[j] < mini){
                        a = t[i];
                        b = h[j];
                        mini = a + b;
                    }
                    flag = true;
                }
            }
            if(flag)break;
        }
        if(flag == false)printf("-1\n");
        else printf("%d %d\n",a,b);
    }

    return 0;
}


Measured memory_bytes: 3048
#include<iostream>
#include<math.h>
using namespace std;
long long dp[30];

void tribonacci(int n){
    if (n==1) {
        dp[n-1] = 1;
    } else if (n==2) {
        dp[n-1] = 2;
    } else if (n==3) {
        dp[n-1] = 4;
    } else {
        dp[n-1] = dp[n-2] + dp[n-3] + dp[n-4];
    }
}

int main() {
    int n;
    double days;
    long long year;
    for(int i=1;i<=30;i++){
        tribonacci(i);
    }
    while(1){
        cin >> n;
        if (n==0) break;
        days = dp[n-1]/10;
        year = floor(days/365)+1;
        cout << year << endl;
    }
    return 0;
}

Measured memory_bytes: 2976
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <iomanip>
using namespace std;
typedef long long ll;

int main() {
    int a, b;
    cin >> a >> b;
    if (1 <= a && a <= 9 && 1 <= b && b <= 9) {
        cout << a * b << endl;
    }
    else cout << -1 << endl;

}

Measured memory_bytes: 256
n = int(input())
l = list(map(int,input().split()))
M = 1000000007
sm = 0
for i in l:
	sm = (sm + i)
sms = pow(sm,2)
ss = 0
for i in range(n):	
	ss = (ss + (l[i] * l[i]))
print(((sms - ss)//2)%M)

Measured memory_bytes: 94128
n, k = map(int, input().split())
p = list(map(int, input().split()))
lst = [0]*(n+1)
lst[1] = (p[0]+1)/2

for i in range(2, n+1):
    lst[i] = lst[i-1] + (p[i-1]+1)/2

max = 0

for i in range(n-k+1):
    if max < lst[i+k]-lst[i]:
        max = lst[i+k]-lst[i]

print(max)


Measured memory_bytes: 25060
import java.util.Scanner;

public class Main
{
	public static void main(String arg[])
	{
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext())
		{
			int n = sc.nextInt();
			if(n==0)
				return;

			int a[]= new int[10];
			for(int i=0; i<10; i++)
				a[i]=0;

			while(n-->0)
			{
				int in = sc.nextInt();
				a[in]++;
			}

			for(int i=0; i<10; i++)
			{
				if(a[i] ==0)
					System.out.print("-");
				else
					for(int j=0; j<a[i]; j++)
						System.out.print("*");

				System.out.println();
			}

		}
	}
}

Measured memory_bytes: 12000