akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define RREP(i, n) for (int i = n - 1; 0 <= i; i--)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define RFOR(i, start, end) for (int i = start - 1; 0 <= i; i--)
#define ALL(a) a.begin(), a.end()
using ll = long long;
using namespace std;
constexpr int INF32       = 1'050'000'000;
constexpr long long INF64 = 4'000'000'000'000'000'000;
constexpr int MOD7        = 1'000'000'007;
constexpr int MOD9        = 1'000'000'009;
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;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
void scan() {}
template <class H, class... T> void scan(H &&head, T &&... args) {
    std::cin >> head;
    scan(std::forward<T>(args)...);
}
template <class T> void scan(std::vector<T> &v) {
    for (auto &&i : v) {
        scan(i);
    }
}

template <class T> T up(T a, T div) { return (a + div - 1) / div; }

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

    ll N;
    scan(N);
    vector<ll> v(5);
    scan(v);
    SORT(v);

    ll ans = 4;
    ans += up(N, v[0]);
    print(ans);

    return 0;
}

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

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

using namespace std;

class Dice {
private:
    vector<int> num, i_num;

public:
    enum FACE {TOP, FRONT, RIGHT, LEFT, BACK, BOTTOM}; 
    enum MOVE {TOP_TO_FRONT, TOP_TO_RIGHT, TOP_TO_LEFT, TOP_TO_BACK, FRONT_TO_LEFT, FRONT_TO_RIGHT};

    const int tb[6][4] = {
        {FRONT, TOP, BACK, BOTTOM},
        {RIGHT, TOP, LEFT, BOTTOM},
        {LEFT, TOP, RIGHT, BOTTOM},
        {BACK, TOP, FRONT, BOTTOM},
        {LEFT, FRONT, RIGHT, BACK},
        {RIGHT, FRONT, LEFT, BACK}
    };

    Dice() 
    { 
        num.assign(6, -1);
        i_num.resize(6);
        i_num = {1, 3, 5, 2, 4, 6};
    }

    Dice(int t, int f) 
    {
        num.resize(6), i_num.resize(6);
        i_num = {1, 3, 5, 2, 4, 6};
        roll(t, f);
    }

    void set_identity(vector<int> i) { num = i_num = i; }

    int top() {return num[TOP];}
    int bottom() {return num[BOTTOM];}
    int right() {return num[RIGHT];}
    int left() {return num[LEFT];}
    int front() {return num[FRONT];}
    int back() {return num[BACK];}
    int get(FACE f) { return num[f]; }

    void rotate(int move)
    {
        int tmp = num[tb[move][0]];
        rep(i, 3) num[tb[move][i]] = num[tb[move][i+1]];
        num[tb[move][3]] = tmp;
    }
    
    void roll(int t, int f)
    {
        num = i_num;

        for (int j=0; j<6; j++) {
            for (int i=0; i<4; i++) {
                if (num[0] == t && num[1] == f) return;
                rotate(FRONT_TO_RIGHT);
            }
            if (j%2) rotate(TOP_TO_FRONT);
            else rotate(TOP_TO_RIGHT);
        }
    }

    void print()
    {
        cerr << "[" << num[0] << ", " << num[FRONT] << ", " 
            << num[RIGHT] << "]" << endl;
    };
};

int main()
{
    Dice d;

    vector<int> num(6);
    rep(i, 6) cin >> num[i];
    d.set_identity(num);

    int N;
    cin >> N;

    rep(i, N) {
        int t, f;
        cin >> t >> f;
        d.roll(t, f);
        cout << d.get(d.RIGHT) << endl;
    }
}

Measured memory_bytes: 3156
#include <stdio.h>

int main(void)
{
    int m;
    int f;
    int r;
    while(m != -1 || f != -1 || r != -1){
        scanf("%d",&m);
        scanf("%d",&f);
        scanf("%d",&r);
            if(m == -1 && f == -1 && r == -1){
                break;
            }
            if(m == -1 || f == -1){
                printf("F\n");
            }else if(m + f >= 80){
                printf("A\n");
            }else if(m + f >= 65 && m + f < 80){
                printf("B\n");
            }else if(m + f >= 50 && m + f < 65 ){
                printf("C\n");
            }else if(m + f >= 30 && m + f < 50 && r >=50){
                printf("C\n");
            }else if(m + f >= 30 && m + f < 50 && r < 50){
                printf("D\n");
            }else if(m + f < 30){
                printf("F\n");
            }
    }                
    return 0;
}

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

int main() {
    int N; cin >> N;
    vector<char> a(N);

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

    int tmp = 0;
    int left = 0;
    for (int i = 0; i < N; i++) {
        if (a[i] == ')') {
            (tmp == 0) ? left++ : tmp--;
        }
        else {
            tmp++;
        }
    }

    tmp = 0;
    int right = 0;
    for (int i = N - 1; i >= 0; i--) {
        if (a[i] == '(') {
            (tmp == 0) ? right++ : tmp--;
        }
        else {
            tmp++;
        }
    }

    for (int i = 0; i < left; i++) {
        cout << '(';
    }
    for (int i = 0; i < N; i++) {
        cout << a[i];
    }
    for (int i = 0; i < right; i++) {
        cout << ')';
    }
    cout << endl;
}


Measured memory_bytes: 256
use proconio::input;
use std::collections::HashMap;

struct Info {
	count: u64,
  	val: u64,
}

fn main() {
    input! {
        n: usize,
      	arr: [u64;n],
      	q: usize
    }
  	
  	let mut sum = 0;
  	let mut map: HashMap<u64, Info> = HashMap::new();
  	for i in 0..n {
    	let mut info = map.entry(arr[i]).or_insert(Info {
        	count: 0,
          	val: arr[i]
        });
      	sum += arr[i];
        info.count += 1;
    }
  	
  	for _ in 0..q {
      input! {
          from: u64,
          to: u64
      }
      if let Some(mut from_info) = map.remove(&from) {
        sum -= (from - to) * from_info.count;
        
        from_info.val = to;
        if let Some(mut to_info) = map.get_mut(&to) {
            to_info.count += from_info.count;
        } else {
            map.insert(to, from_info);
        }
      }
      println!("{}", sum);
    }
}

Measured memory_bytes: 9524
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl
#define debug cout << "hi" << endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<long long ,long long>pll;

ll gcd(ll a, ll b) {return (!b ? a : gcd(b, a % b));}
ll lcm(ll a, ll b) {return ((a*b)/gcd(a,b));}
bool cmp(int a,int b){return a>b;}

const ll mod = 1e9 + 7;
const int INF32 = 1<<30;
const ll INF64 = 1LL<<60;
const ld pi = 3.141592653589793;

 long long modpow(long long n, long long k,long long mod)
{
if (k == 0) return 1;
long long r = modpow(n * n % mod, k >> 1, mod);
if (k & 1) r = r * n % mod;
return r;
}
const int N = 1e6 + 10;
//const int mod = 1e9 + 7;

ll fac[N];

ll binpow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1) res = res * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return res;
}

void init() {
    fac[0] = 1;
    for (int i = 1; i < N; i++)
        fac[i] = fac[i - 1] * i % mod;
}

ll inv(ll a) {
	return binpow(a, mod - 2);
}

ll A(ll n, ll m) {
	return fac[n] * inv(fac[n - m]) % mod;
}

ll C(ll n, ll m) {
    return fac[n] * inv(fac[m]) % mod * inv(fac[n - m]) % mod;
}

void solve(){
     init();
     ll n;cin >> n;
     if(n<3){
        cout << 0;
        return;
     }
     ll ans = 1;
     ll k = n-6+1;
     for(ll i = 2;i<n;i++){
        if(k<(i-1)) break;
        ans += C(k,i-1);
        ans %= mod;
        k -= 2;
     }
     cout << (ans+mod)%mod;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    solve();
    return 0;
}


Measured memory_bytes: 11448
def depth(id):
    depth = 0
    target_id = id
    while nodes[target_id][0] !=-1:
        depth += 1
        target_id = nodes[target_id][0]
    return depth

def height(id):
    return 1 + max({0}.union([height(value) for value in nodes[id][1:] if value != -1]))

nodes = dict()
n = int(input())
for _ in range(n):
    id,l,r = list(map(int, input().split()))
    if id not in nodes:
        nodes[id] = (-1, -1, -1)
    node = nodes[id]
    node = (node[0], l, r)
    nodes[id] = node
    for child_id in [child_id for child_id in node[1:] if child_id != -1]:
        if child_id not in nodes:
            nodes[child_id] = (-1, -1, -1)
        child_node = nodes[child_id]
        child_node = (id, child_node[1], child_node[2])
        nodes[child_id] = child_node

for id, node in sorted(nodes.items()):
    node_type = "root" if node[0] == -1 else "internal node" if node[1] != -1 or node[2] != -1 else "leaf"
    sibling = -1 if node[0] == -1 else [value for value in nodes[node[0]][1:] if value != id][0]
    degree = len([1 for value in node[1:] if value != -1])
    print(f"node {id}: parent = {node[0]}, sibling = {sibling}, degree = {degree}, depth = {depth(id)}, height = {height(id)-1}, {node_type}")


Measured memory_bytes: 5636
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define BUGAVOID(x) x
#define rep(...) BUGAVOID(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define sz(c) (int)(c.size())
#define all(c) c.begin(),c.end()
#define ms(a,v) memset(a,v,sizeof(a))
#define mp make_pair
#define write(x) cout<<(x)<<endl
using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll;
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; }
inline ll pow2(const int n) { return 1ll << n; }
const int INF = 1 << 28; const ll LINF = 1ll << 60;
const int MAX = 1e5 + 5; const int MOD = 1e9 + 7; const double EPS = 1e-6;
const int dy[4] = { 0,1,0,-1 }; const int dx[4] = { 1,0,-1,0 };
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;
// 1. 問題よくよめえええええええええええええええええええええええええ
// 2. intオーバーフロー << * + あたり
// 3. 落ち着け

int main() {
    int N, M, X, Y; cin >> N >> M >> X >> Y;
    vi x(N), y(M);
    rep(i, N) cin >> x[i];
    rep(i, M) cin >> y[i];

    int xmax = X;
    rep(i, N) chmax(xmax, x[i]);
    int ymin = Y;
    rep(i, M) chmin(ymin, y[i]);

    if (xmax < ymin) write("No War");
    else write("War");
}

Measured memory_bytes: 256
n, m = list(map(int, input().split()))
lmax = 0
rmin = n
for i in range(m):
  l, r = list(map(int, input().split()))
  lmax = max(lmax, l)
  rmin = min(rmin, r)

if rmin<lmax:
  ans = 0
else:
  ans = rmin-lmax + 1
print(ans)
            

Measured memory_bytes: 3060
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/irange.hpp>
#include "bits/stdc++.h"

namespace adaptor = boost::adaptors;

bool search(int64_t A[], int64_t n, int64_t key) {
    int64_t i = 0;
    A[n] = key;
    while (A[i] != key) {
        i++;
    }
    return i != n;
}

void solve() {
    int64_t n, A[10001], q, key, sum = 0;
    std::cin >> n;
    for (int64_t i = 0; i < n; i++) {
        std::cin >> A[i];
    }
    std::cin >> q;
    for (int64_t i = 0; i < q; i++) {
        std::cin >> key;
        if (search(A, n, key)) sum++;
    }

    std::cout << sum << std::endl;
    return;
}

int main() {
    std::cin.tie(0);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    solve();
}



Measured memory_bytes: 3276
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;


int main(){
    string s;
    cin >> s;
    cout << s.substr(0,3) << endl;
    return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <bitset>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <regex>
#include <iomanip>
#include <climits>
#include <utility>
#include <queue>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1e9 + 7;
const dd PI = 3.1415926435;
 
ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return b;
    }
    return gcd(b, a % b);
}
 
ll fact(ll n)
{
    if (n == 0)
    {
        return 1;
    }
    if (n == 1)
    {
        return 1;
    }
    return n * fact(n - 1) % MOD;
}
 
ll pow_fast(ll n, ll k)
{
    if (k == 0)
    {
        return 1;
    }
    if (k == 1)
    {
        return n;
    }
 
    if (k % 2 == 0)
    {
        ll tmp = pow_fast(n, k / 2LL);
        return tmp * tmp % MOD;
    }
    else
    {
        ll tmp = pow_fast(n, k / 2LL);
        tmp *= tmp;
        tmp %= MOD;
        return tmp * n % MOD;
    }
}
 
map<ll, ll> sosuu(ll n)
{
    map<ll, ll> res;
    for (ll i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            res[i] += 1;
            n /= i;
        }
    }
    if (n != 1)
    {
        res[n] += 1;
    }
    return res;
}
 
int main()
{
    string W;
    cin >> W;
    map<char, ll> mp;
    for (ll i = 0; i < W.size(); i++)
    {
        mp[W[i]] += 1;
    }
    
    bool ok = true;
    for (auto &&e : mp)
    {
        if (e.second % 2 == 1) {
            ok = false;
        }
    }
    cout << (ok ? "Yes" : "No") << endl;
}

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

vector< vector<int> >ans(10+1,vector<int>(330+1,0));

void rec(int n,int use,int sum,int depth){
  ans[n][sum]++;
  for(int i=0;i<10;i++){
    if( (use>>i)&1 )continue;
    rec(n+1,use^(1<<i),sum+depth*i,depth+1);
  }
  return;
}

int main()
{
  int n,s;
  rec(0,0,0,1);
  while(cin>>n>>s)cout<<ans[n][s]<<endl;
}

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

using namespace std;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;

ll MAX = 1000000000000;

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

    int N;
    cin >> N;

    vll H(N);
    for(int i=0;i<N;i++) cin >> H[i];

    vll dp(N, MAX);
    dp[0] = 0;
    for(int i=1;i<N;i++) {
        dp[i] = min(dp[i], dp[i-1] + abs(H[i] - H[i-1]));
        if (i > 1) dp[i] = min(dp[i], dp[i-2] + abs(H[i] - H[i-2]));
    }

    cout << dp[N-1] << endl;

    return 0;
}

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

using namespace std;

#define int long long
#define double long double

main() {
#ifdef HOME
    freopen("input.txt", "r", stdin);
#endif // HOME
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int a;
    double b;
    cin >> a >> b;
    double ans = a * b;
    cout << (int)ans << '\n';
    return 0;
}



Measured memory_bytes: 3748
<?php
fscanf(STDIN, "%d %d", $a, $b);
$min = $b * 10;
$max = $min + 9;
for ($i=$min;$i<=$max;$i++) {
  if (intdiv($i * 8, 100) == $a) {
    echo $i;
    return;
  }
}
echo -1;

Measured memory_bytes: 4856
from collections import defaultdict as dd
mod = 10**9+7
n,x = map(int, input().split())
s = sorted(list(map(int, input().split())),reverse=True)
d = dd(int)
d[x] = 1
for i in range(n):
    new = dd(int)
    for x in d:
        new[x] += d[x]*(n-i-1)
        new[x] %= mod
        new[x%s[i]] += d[x]
        new[x%s[i]] %= mod
    d = new
ans = 0
for x in d:
    ans += x*d[x]
    ans %= mod
print(ans)

Measured memory_bytes: 5424
// include headers{{{
#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>
/*}}}*/
# define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {
    int n; cin >> n;
    double u;
    string v;
    double ans = 0;

    rep (i, n) {
        cin >> u >> v;
        if (v == "JPY") {
            ans += u;
        }
        else {
            ans += 380000 * u;
        }
    }

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



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

const int mod=1e9+7;

int pw(int a,int t){
	int x=1;
	while(t>0){
		if(t&1)x=x*a%mod;
		a=a*a%mod,t>>=1;
	}
	return x;
}
int C(int n,int r){
	if(r>n or r<0)return 0;
	int res=1;
	for(int i=0;i<r;i++){
		res=res*(n-i)%mod;
		res=res*pw(r-i,mod-2)%mod;
	}
	return res;
}
int32_t main(){
    ios::sync_with_stdio(0),cin.tie(0);
    int T;
    cin >> T;
    while(T--){
    	int n,ans=0;
    	cin >> n;
    	n-=5;
    	for(int i=0;i<12;i++){
    		if((n-i)%2)continue;
    		ans=(ans+C((n-i)/2+15,15)*C(11,i))%mod;
    	}
    	cout << ans << '\n';
    }
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
long long a,b,k,an1,an2;
int main(){
	cin>>a>>b>>k;
	if(a==0 && b==0){
		cout<<"0 0"; return 0;
	}
	if(a<=k){
		an1=0; 
		if(b-(k-a)<0) an2=0;
		else an2=b-(k-a);
	}
	else if(a>k){
		an1=a-k; an2=b;
	}
	cout<<an1<<" "<<an2<<endl;
    return 0;
}

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

int main(){
   int N;
   cin >> N;
   vector<int> P(N);
   for (int i=0; i<N; i++){
      cin >> P.at(i);
   }
   int min = P.at(0);
   int cnt = 0;
   for (int i=0; i<N; i++){
      if (min >= P.at(i)){
         cnt++;
         min = P.at(i);
      }
   }
   cout << cnt << endl;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int st, n, m;
bool mark[N];
vector<int> gr[N], d[3];
void dfs(int v, int dr) {
	d[dr].push_back(v);
	mark[v] = 1;
	for (auto u : gr[v]) {
		if (!mark[u]) {
			dfs(u, dr);
			break;
		}
	}
}
int main() {
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int x, y;
		cin >> x >> y;
		x--, y--;
		gr[x].push_back(y);
		gr[y].push_back(x);
	}
	dfs(0, 0);
	dfs(0, 1);
	cout << (int) d[0].size() + (int) d[1].size() - 1 << endl;
	for (int i = (int) d[0].size() - 1; i >= 0; i--) {
		cout << d[0][i] + 1 << " ";
	}
	for (int i = 1; i < d[1].size(); i++)
		cout << d[1][i] + 1 << " ";
	return 0;
}


Measured memory_bytes: 9720
#include <stdio.h>
int main(void)
{
	int a,b,c,d,p,x=0,y=0;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&p);
	x=p*a;
	y=b;
	if(c<p){
		y=(p-c)*d+y;
	}
	if(y>x){
		printf("%d\n",x);
	}
	else{
		printf("%d\n",y);
	}
	return 0;
}



Measured memory_bytes: 2048
my_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
N = input()
N = int(N)
print(my_list[N-1])

Measured memory_bytes: 3060
W,H,N = map(int, input().split())
xya = [list(map(int, input().split())) for i in range(N)]

ld = [0,0]
ru = [W,H]

flag = True
for x,y,a in xya:
    if a == 1:
        if ld[0] < x: ld[0] = x
    if a == 2:
        if ru[0] > x: ru[0] = x
    if a == 3:
        if ld[1] < y: ld[1] = y
    if a == 4:
        if ru[1] > y: ru[1] = y
    tate = ru[1] - ld[1]
    yoko = ru[0] - ld[0]
    if tate <= 0 or yoko <= 0:
        flag = False
        break

if flag:
    print(tate*yoko)
else:
    print(0)

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

#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define E 2.71828182845905
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define debug(x) cout<<#x<<" is "<<x<<endl;
#define PI 3.14159265
#define mem(x) memset(x,0,sizeof(x));
using namespace std;

void sol() {
	int n,k;
	cin>>n>>k;
	int arr[n];
	rep(i,0,n)
	cin>>arr[i];
	bool dp[k+1];
	mem(dp);
	rep(i,0,n)
	dp[arr[i]]=1;
	rep(i,1,k+1){
		if(dp[i])
			continue;
		rep(j,0,n){
			if(i-arr[j]>=0 && dp[i-arr[j]]==0){
				dp[i]=1;
				break;
			}
		}
	}
	if(dp[k])
		cout<<"First";
	else
		cout<<"Second";
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t=1;
 	//cin>>t;
 	while(t--){	
	sol();
 	}
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;


int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#ifndef ONLINE_JUDGE
  freopen("in", "r", stdin);
  freopen("out", "w", stdout);
#endif

  int n;
  cin >> n;
  cout << (1000 - n % 1000) % 1000;
  return 0;
}


Measured memory_bytes: 3604
N = int(input())
a = [[0 for i in range(3)] for j in range(N)]
dp = [[0 for i in range(3)] for j in range(N)]
for i in range(N):
    a[i][0], a[i][1], a[i][2] = map(int, input().split())

for j in range(3):  # initialize dp[0]
    dp[0][j] = a[0][j]

for i in range(1, N):
    dp[i][0] = a[i][0] + max(dp[i-1][1], dp[i-1][2])
    dp[i][1] = a[i][1] + max(dp[i-1][0], dp[i-1][2])
    dp[i][2] = a[i][2] + max(dp[i-1][0], dp[i-1][1])
print(max(dp[N-1][0], dp[N-1][1], dp[N-1][2]))

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

template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
    os << "{";
    for (int i = 0; i < (int)vec.size(); ++i) {
        os << vec[i] << (i + 1 == (int)vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
    os << "{";
    for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
        os << "(" << itr->first << ", " << itr->second << ")";
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
    os << "{";
    for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
        os << *itr;
        ++itr;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
void dump_func() {
    cerr << "\n";
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&&... tail) {
    cerr << head;
    if (sizeof...(Tail) == 0) {
        cerr << " ";
    } else {
        cerr << ", ";
    }
    dump_func(std::move(tail)...);
}
#define dump(...) cerr << "[" << to_string(__LINE__) << "]"        \
                       << "    " << string(#__VA_ARGS__) << " = ", \
                  dump_func(__VA_ARGS__)

using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<double>;
using VVI = vector<VI>;
using VVL = vector<VL>;
using PI = pair<int, int>;
using PL = pair<ll, ll>;
using VPI = vector<PI>;
using VPL = vector<PL>;
using VS = vector<string>;

#define ln '\n'
#define REP(t, n) for (int t = 0; t < (n); ++t)
#define FOR(t, a, b) for (int t = (a); t <= (b); ++t)
#define FORR(t, a, b) for (int t = (a); t >= (b); --t)
#define ALL(c) (c).begin(), (c).end()
#define CAUTO const auto&

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    VI time(3);
    REP(i, 3)
        cin >> time[i];
    sort(ALL(time));
    cout << time[0] + time[1] << ln;

    return 0;
}


Measured memory_bytes: 256
N, X, M = map(int, input().split())

mods = [0 for i in range(M)]
vals = []
for i in range(1, M+2):
  if i == 1:
    p = X
  else:
    p = p**2 % M
  
  if mods[p] > 0:
    break
  else:
    mods[p] = i
    vals.append(p)
    if i == N:
      print(sum(vals))
      exit()

len_loop = i - mods[p]
sum_answer = sum(vals)
N_res = N - len(vals)
sum_answer += sum(vals[mods[p]-1:]) * (N_res // len_loop)
N_res = N_res % len_loop
sum_answer += sum(vals[mods[p]-1:mods[p]-1+N_res])

print(sum_answer)
  


    

Measured memory_bytes: 73432
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP2(i, x, n) for(int i = x; i < (int)(n); i++)
#define ALL(n) begin(n), end(n)
//struct cww{cww(){ios::sync_with_stdio(false);cin.tie(nullptr);}}star;
const long long INF = numeric_limits<long long>::max();
typedef long long ll;

int h;
int w;
bool** s;
bool** l;
int** rev;

void search(int x, int y, int flip, bool last) {
  // printf("%d, %d, %d, %s\n", x, y, flip, last ? "true" : "false");
  if (x == (w - 1) && y == (h - 1)) {
    if (flip < rev[y][x]) {
      rev[y][x] = flip;
    }
    return;
  }
  bool c_last = false;
  int c_flip = flip;

  if (x + 1 < w) {
    if (s[y][x + 1]) {
      c_last = false;
    } else {
      c_last = true;
      if (last == false) {
        c_flip = flip + 1;
      }
    }
    if (c_flip < rev[y][x + 1]) {
      rev[y][x + 1] = c_flip;
      search(x + 1, y, c_flip, c_last);
    }
    if (c_flip == rev[y][x + 1] && c_flip == true && l[y][x + 1] == false) {
      l[y][x + 1] = true;
      search(x + 1, y, c_flip, c_last);
    }
  }
  c_flip = flip;
  if (y + 1 < h) {
    if (s[y + 1][x]) {
      c_last = false;
    } else {
      c_last = true;
      if (last == false) {
        c_flip = flip + 1;
      }
    }
    if (c_flip < rev[y + 1][x]) {
      rev[y + 1][x] = c_flip;
      search(x, y + 1, c_flip, c_last);
    }
    if (c_flip == rev[y + 1][x] && c_flip == true && l[y + 1][x] == false) {
      l[y + 1][x] = true;
      search(x, y + 1, c_flip, c_last);
    }
  }
  return;
}

int main() {
  scanf("%d", &h);
  scanf("%d", &w);
  s = new bool*[h];
  REP(i, h) {
    s[i] = new bool[w];
  }

  char* str = new char[w];
  REP(i, h) {
    scanf("%s", str);
    REP(j, w) {
      s[i][j] = str[j] == '.' ? true : false;
    }
  }

  rev = new int*[h];
    REP(i, h) {
    rev[i] = new int[w];
    REP(j, w) {
      rev[i][j] = 999999;
    }
  }

  l = new bool*[h];
    REP(i, h) {
    l[i] = new bool[w];
    REP(j, w) {
      l[i][j] = false;
    }
  }

  if (s[0][0] == true) {
    search(0, 0, 0, false);
  } else {
    rev[0][0] = 1;
    search(0, 0, 1, true);
  }

  printf("%d\n", rev[h - 1][w - 1]);
  return 0;
}


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

const int N = 200101;
int n, cnt = 1, ch[N][2], len[N];
LL L;
bool num[111];
char s[200001];

int lowbit(LL x)
{
    int r = 0;
    for(;!(x & 1); r++, x >>= 1);
    return r;
}

void ins(int u, int id, int d, int leng) {
	if (ch[u][s[len[id] + d - 1] - '0'] == 0) {
		ch[u][s[len[id] + d - 1] - '0'] = ++ cnt;
	}
	if (d != leng) ins(ch[u][s[len[id] + d - 1] - '0'], id, d + 1, leng);
}

void dfs(int u, int d) {
	for (int k = 0; k <= 1; ++ k) {
		if (ch[u][k] == 0) {
			if (L - d > 0) num[lowbit(L - d)] ^= 1;
		} else dfs(ch[u][k], d + 1);
	}
}

int main() {
	std::cin >> n >> L;
	int tot = 0;
	for (int i = 1; i <= n; ++i) {
		len[i] = tot + 1;
		std::cin >> (s + len[i]);
		tot += strlen(s + len[i]);
		ins(1, i, 1, strlen(s + len[i]));
	}
	dfs(1, 0);
	for (int i = 0; i <= 60; ++i) {
		if (num[i]) {
			std::cout << "Alice\n";
			return 0;
		}
	}
	std::cout << "Bob\n";
	return 0;
}

Measured memory_bytes: 9176
#include "bits/stdc++.h"
using namespace std;
#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 ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size)
#define MOD 1000000007
const long long mod = 1e9+7;
typedef vector<long long> Vl;
typedef vector<double> VI;  // VI a(n);
typedef vector<string> VS;  
typedef vector<VS> VSS;  
typedef vector<VI> VVI;   // VVI a(n,vector<int>(m)) n * m 
typedef vector<Vl> VVl;
typedef pair<int, int> PII;
typedef long long ll;  //ll とdoubleは違う
// cout << << endl;
// cin >> ;
int main(){
    double a,b,c=0,d=0,n,m1,n2,m2,min=100000,k=0,ans=0;
    string s,s2;
    cin >> s >> s2;
    c = stoi(s+s2);
    if (ceil(sqrt(c)) == floor(sqrt(c))){
        cout << "Yes" <<endl; 
    }
    else cout << "No" <<endl; 
    return 0;
}


Measured memory_bytes: 256
//In the name of God
#include <bits/stdc++.h>
using namespace std;

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

const ll maxn = 5e3 + 100;
const ll mod = 1e9 + 7;
const ll inf = 1e18;

#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io freopen("input.txt", "r+", stdin);freopen("output.txt", "w+", stdout);
#define pb push_back
#define Mp make_pair
#define F first
#define S second

ll n, f[maxn], dp[2][maxn][maxn], sz[maxn];
vector<ll> g[maxn];
bool vis[maxn];

void dfs(ll v){
    vis[v] = 1;
    ll p = 0;
    dp[p][v][1] = 1;
    sz[v] = 1;
    for(ll u : g[v]){
        if(vis[u]) continue;
        dfs(u);
        for(ll i = sz[v]; i > 0; i--){
            for(ll j = 1; j <= sz[u]; j++){
                dp[1 - p][v][i] = (dp[1 - p][v][i] + dp[p][v][i] * (dp[0][u][j] * f[j] % mod)) % mod;
                dp[1 - p][v][i + j] = (dp[1 - p][v][i + j] + dp[0][u][j] * dp[p][v][i]) % mod;
            }
        }
        sz[v] += sz[u];
        p = 1 - p;
        for(ll j = 0; j <= sz[v]; j++){
            dp[1 - p][v][j] = 0;
        }
    }
    for(ll i = 1; i <= sz[v]; i++){
        dp[1 - p][v][i] = dp[p][v][i];
    }
    return;
}

int main(){
    fast_io;

    f[0] = -1;
    for(ll i = 2; i < maxn; i++){
        f[i] = f[i - 2] * (i - 1) % mod;
    }

    cin >> n;
    for(ll i = 1; i < n; i++){
        ll v, u;
        cin >> v >> u;
        g[v].pb(u);
        g[u].pb(v);
    }
    dfs(1);
    ll ans = 0;
    for(ll i = 1; i <= n; i++){
        ans = (ans + dp[0][1][i] * f[i]) % mod;
    }
    cout << (mod - ans + mod) % mod;

    return 0;
}


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

vector<string>v;
map<string, int>mp;
int main()
{
    int i, j=0, n=0;
    cin>>n; string s;
    for(i=0; i<n; i++){
        cin>>s; v.push_back(s); mp[s]++;
        j=max(j,mp[s]);
    }
    sort(v.begin(),v.end());
    for(i=0; i<v.size(); i++){
        if(mp[v[i]]==j)cout<<v[i]<<endl;
        mp[v[i]]=0;
    }
    return 0;
}


Measured memory_bytes: 26736
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
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; }

ll INF = 1001001001;
ll LINF = 1001001001001001001ll;

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

    string s;
    cin>>s;
    ll n = sz(s);

    ll ac = 0;
    ll ans = 0;
    rep(i, n) {
        if (s[i] == 'A') {
            ac++;
            continue;
        }
        if (s[i] == 'B' && s[i + 1] == 'C') {
            i++;
            ans += ac;
            continue;
        }
        ac = 0;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 720
#include <iostream>
#include <vector>
#include <queue>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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

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

  vector<string> field(H);
  for(int i = 0; i < H; i++){
    cin >> field[i];
  }

  vector<vector<int>> dist(H, vector<int>(W,-1));
  queue<pair<int, int>> que;

  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(field[i][j] == '#'){
        que.push(make_pair(i, j));
        dist[i][j] = 0;
      }
    }
  }

  int distMax = 0;
  while(!que.empty()){
    pair<int, int> cp = que.front();
    int cx = cp.second;
    int cy = cp.first;
    que.pop();
    for(int i = 0; i < 4; i++){
      int nx = cx + dx[i];
      int ny = cy + dy[i];
      if(nx < 0 || nx >= W || ny < 0 || ny >= H)continue;
      if(dist[ny][nx] != -1) continue;
      dist[ny][nx] = dist[cy][cx] + 1;
      if(distMax < dist[ny][nx]) distMax = dist[ny][nx];
      que.push(make_pair(ny, nx));
    }
  }

  cout << distMax << endl;

  return 0;
}


Measured memory_bytes: 13568
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int h[n];
    int dp[n];
    for(int i = 0 ; i<n ; i++){
        cin>>h[i];
        dp[i] = INT_MAX;
    }
//    int dp[n];
    dp[0] =0;
    dp[1] = abs(h[1]-h[0]);
    for(int i = 2 ; i<n ; i++){
        dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
    }
    cout<<dp[n-1]<<endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define IOS ios_base::sync_with_stdio(0);cin.tie(0)
#define infinite 9123456789
#define PRECISION cout.precision(3); cout.setf(ios::fixed);

int n, f[100000], f1[100000], f2[100000];

void solve(){
	cin >> n;
	int a, b, c;
	for(int i=1; i<=141; i++){
		for(int j=1; j<=141; j++){
			for(int k=1; k<=141; k++){
				if(i*i+j*j+k*k+i*j+j*k+k*i<=n){
					int vez=i*i+j*j+k*k+i*j+j*k+k*i;
					f[vez]++;
				}
			}
		}
	}
	for(int i=1; i<=141; i++){
		for(int j=1; j<=141; j++){
			int k=i;
			if(i*i+j*j+k*k+i*j+j*k+k*i<=n){
				int vez=i*i+j*j+k*k+i*j+j*k+k*i; f1[vez]++;
			}
		}
	}
	for(int i=1; i<=141; i++){
		if(3*i*i<=2*n){
			int vez=6*i*i;
			f2[vez]++;
		}
	}
	for(int i=1; i<=n; i++){
		cout << f[i] << "\n";
	}
}
signed main(){
	solve();
}

Measured memory_bytes: 3968
n = input()
a = list(map(int, input().split()))
count = [0] * 9
for i in a:
    if i < 3200:
        count[i//400] = 1
    else:
        count[8] += 1
ansMax = sum(count)
ansMin = sum(count[:8])
if ansMin==0 and count[8] > 0:
    ansMin = 1
print(ansMin, ansMax)
        


Measured memory_bytes: 3060
#128
n, m = list(map(int, input().split(' ')))
k = []
for i in range(m):
    k.append([int(x) for x in input().split(' ')])
p = [int(x) for x in input().split(' ')]
count = 0
for i in range(2**n):
    #sw_p is str
    sw_p = format(i,'0{}b'.format(n))
    hantei = True
    for j in range(m):
        sum_s = [int(sw_p[x-1]) for x in k[j][1:]]
        if sum(sum_s)%2 == p[j]:
            continue
        else:
            hantei = False
            break
    if hantei == True:
        count += 1
print(count)

Measured memory_bytes: 3188
#include <algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<string>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;
int main(){
  long n,y;
  cin >> n >> y;
  long ii=0,jj;
  long n10000,n5000,n1000,n1000Mod;
  bool flg = false;
  n10000 = y/10000;
  //cout << "n10000:"  << n10000 << endl;;

  for(ii=n10000;ii>=0;ii--){
	n5000 = (y-ii*10000)/5000;
	for(jj=n5000;jj>=0;jj--){
	  n1000 = (y-ii*10000-jj*5000)/1000;
	  n1000Mod = (y-ii*10000-jj*5000) % 1000;
	  //cout << "ii:" << ii << "jj:" << jj << "n1000:" << n1000 << "mod:" << n1000Mod << endl;

	  if(n1000Mod != 0){
		continue;
	  }
	  
	  if(ii+jj+n1000 == n){
		flg = true;
		goto ok;
	  }
	}
  }
  
 ok:
  if(flg == true){
	cout << ii << " " << jj << " " << n1000 << endl;
  }
  else{
	cout <<"-1 -1 -1" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#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 x, k, d;
	cin >> x >> k >> d;

	x = abs(x);

	ll t = x / d;

	if (t <= k) {
		ll z = x - t*d;
		ll y = abs(z - d);

		if ((k-t) % 2 == 1)
			cout << y;
		else
			cout << z;

	} else {
		cout << x - k*d;
	}

	ll z = x % d;

	return 0;
}


Measured memory_bytes: 3652
#include <cstdio>
#include <string>
#include <algorithm>

using namespace std;

char t[100'009];
string z[2];

int main() {
  int qq;
  scanf("%s%d", t, &qq);
  string s = string(t);
  z[0] = "";
  z[1] = "";
  int w = 0;
  while (qq--) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      w ^= 1;
    } else {
      int x;
      scanf("%d%s", &x, t);
      --x;
      z[x ^ w] += t[0];
    }
  }
  string ans = "";
  reverse(z[w].begin(), z[w].end());
  ans += z[w];
  if (w == 1) {
    reverse(s.begin(), s.end());
  }
  ans += s;
  ans += z[w ^ 1];
  puts(ans.c_str());
}


Measured memory_bytes: 1348
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int R = stdIn.nextInt();
        stdIn.close();

        int X = 0;
        if (N >= 10) {
            X = R;
        } else {
            X = R + 100 * (10 - N);
        }
       
        System.out.println(X);
    }
}

Measured memory_bytes: 21844
#include <iostream>

void leapYear(int, int);

int main()
{
  int check1 = 0;
    while (true) {
        int a, b;
        std::cin >> a >> b;
        if (a == 0 && b == 0) {
            break;
        }
        if (check1 == 1) {
            std::cout << std::endl;
        }
        check1 = 1;
        leapYear(a, b);
    }
    return 0;
}

void leapYear(int a, int b)
{
    int check2 = 0;
    for (int year = a; year <= b; ++year) {
      if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
            std::cout << year <<std::endl;
            check2 = 1;
      }
    }
    if (check2 == 0) {
        std::cout << "NA" <<std::endl;
    }
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793




int main(){
   int a,b,c;
   cin >> a >> b>> c;
   int x=(c-a)*(b-c);
   if(x>0)cout << "Yes" << endl;
   else cout << "No" << endl;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define FIXED_FLOAT(x)  std::fixed <<std::setprecision(7)<<(x)
#define all(v) (v).begin(), (v).end()
using namespace  std;
#define loop(i,a,b) for (int i=a; i<b; ++i)
using ll = long long;
const int mod = 1e5;
typedef pair<int , int> pairs;
typedef complex<ll> G;

const int N = 1e3 + 10;

int power(int a,int b, int q){
    if(!b)
        return 1;
    int c=power(a,b/2, q);
    c=(1LL*c*c)%q;
    if(b%2)
        c=(1LL*c*a)%q;
    return c;
}

vector<int>dis(N);
vector<bool>vis(N);
vector<int>c[N];
int far;
int ans;
int now;
void aff(int s, int e, int d) {
    if(vis[s])return;
    vis[s] = true;
    dis[s] = d;
    ans = max(ans, dis[s]);
    for(auto u : c[s]) {
        if(u == e)continue;
        aff(u, s, d + 1);
    }
}
void dfs(int s, int e, int d) {

    if(vis[s])return;

    dis[s] = d;
    if(now < d) {
        far = s;
        now = d;
    }
    vis[s] = true;
    for(auto u : c[s]) {
        if(u == e)continue;
        dfs(u, s, d + 1);
    }
}
void done() {
    int n;
    cin >> n;
    for(int i = 1;i < n;++i) {
        int a,b;
        cin >> a >> b;
        c[a].push_back(b);
        c[b].push_back(a);
    }
    if(n == 1) {
        cout << 0 << '\n';
        return;
    }
    far = 0;
    now = 0;
    ans = 0;
    dfs(1, 0, 0);

    fill(vis.begin(), vis.end(), 0);
    fill(dis.begin(), dis.end(), 0);
    aff(far, 0, 0);
    cout << ans * 3 << '\n';

}
/*string solve_palindrome(const string& s)
{
    string a = s;
    reverse(a.begin(), a.end());
    //a = s + "#" + a;
    int c = 0;
    for (int i = 1; i < (int)a.size(); i++)
    {
        while (c != 0 && a[c] != a[i])
            c = pref[c - 1];
        if (a[c] == a[i])
            c++;
        pref[i] = c;
    }
    return s.substr(0, c);
}
*/

/*3
3 7 7 9 11
4 6 6 7*/
void solve()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    if(n <= 2)   {
        cout << 0 << '\n';
        return;
    }
    int ans = 0;
    for(int i = 0;i < n-2;++i) {
        if(s[i] == '0' && s[i + 1] == '1' && s[i + 2] == '0') {
            ++ans;
            s[i + 2] = '1';
        }
    }
    cout << ans << '\n';
}
int cal(int  n) {
    string s = to_string(n);
    int ans = 0;
    for(int i = 0;i < s.size();++i) {
        ans += s[i] - '0';
    }
    return ans;
}
int sum(long long n) {
	int res = 0;
	while (n > 0) {
		res += n % 10;
		n /= 10;
	}
	return res;
}

void another() {
    int n;
    cin >> n;
    cout << (n ^ 1) << '\n';


}


void test_case() {
    int t;
    cin >> t;
    while(t--)solve();
}
int main() {

    ios::sync_with_stdio(NULL); cin.tie(0); cout.tie(0);

    another();
}


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

int main(){
  int s;
  cin >> s;
  int x = s;
  set <int> st ;
  while(st.count(x) == 0){
    st.insert(x);
    if(x % 2 == 0){
      x /= 2;
    }
    else{
      x = x * 3 + 1;
    }
  }
  cout << (st.size() + 1) << endl;
}


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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

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

void func(long long N, long long K, std::string S){



    vector<lli> d;
    if(S[0]=='0')d.push_back(0);
    lli now=0;
    lli nex=1;
    while(now<N && nex<N){
        if(S[now]!=S[nex]){
            
            d.push_back(nex-now);
            now=nex;
        }
        nex++;
    }
    d.push_back(nex-now);
    if(S[N-1]=='0')d.push_back(0);

    lli ans = 0;
    lli sum = 0;
    REP(i,0,min((int)(2*K+1),(int)d.size())){
        sum+=d[i];
    }
    chmax(ans,sum);
    for(lli i=2*K+1;i<d.size();i+=2){
        LOG2(ans,sum);
        sum-=d[i-2*K-1];
        sum-=d[i-2*K];
        sum+=d[i];
        sum+=d[i+1];
        chmax(ans,sum);
    }

    cout<<ans<<endl;

}

int main(){
    // cout << fixed << setprecision(5);

    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::string S;
    std::cin >> S;
    func(N, K, S);
    return 0;
}


Measured memory_bytes: 1656
import java.util.HashSet;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		HashSet<Integer>array=new HashSet<>();
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		
		for(int i=0;i<N;i++) {
			array.add(sc.nextInt());
		}
		
		if(N!=array.size()) {
			System.out.println("NO");
		}else {
			System.out.println("YES");
		}

	}

}


Measured memory_bytes: 101920
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};
use std::collections::HashMap;

fn main() {
    input!{
        s: chars
    }
    let mut map: HashMap<char, usize> = HashMap::new();
    for c in s {
        let x = map.entry(c).or_insert(0);
        *x += 1;
    }
    if map.len() != 2 {
        println!("No");
        return;
    }
    for (_, &v) in map.iter() {
        if v != 2 {
            println!("No");
            return;
        }
    }
    println!("Yes");
}


Measured memory_bytes: 4352