akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"

// Begin Header {{{
using namespace std;

#ifndef DEBUG
#define dump(...)
#endif

#define all(x) x.begin(), x.end()
#define rep(i, n) for (intmax_t i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, b, e) for (intmax_t i = (b), i##_limit = (e); i <= i##_limit; ++i)
#define repr(i, b, e) for (intmax_t i = (b), i##_limit = (e); i >= i##_limit; --i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)

constexpr size_t    operator""_zu(unsigned long long value) { return value; };
constexpr intmax_t  operator""_jd(unsigned long long value) { return value; };
constexpr uintmax_t operator""_ju(unsigned long long value) { return value; };

constexpr int INF = 0x3f3f3f3f;
constexpr intmax_t LINF = 0x3f3f3f3f3f3f3f3f_jd;

template <class T, class Compare = less<>>
using MaxHeap = priority_queue<T, vector<T>, Compare>;
template <class T, class Compare = greater<>>
using MinHeap = priority_queue<T, vector<T>, Compare>;

inline void input() {}
template <class Head, class... Tail>
inline void input(Head&& head, Tail&&... tail) {
    cin >> head;
    input(forward<Tail>(tail)...);
}

template <class T>
inline istream& operator>>(istream &is, vector<T> &vec) {
    for (auto &e: vec) {
        is >> e;
    }
    return is;
}

inline void output() { cout << "\n"; }
template <class Head, class... Tail>
inline void output(Head&& head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) {
        cout << " ";
    }
    output(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<<(ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = {" ", ""};
    for (const auto &e: vec) {
        os << e << delim[&e == &vec.back()];
    }
    return os;
}

template <class T>
inline vector<T> makeVector(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto makeVector(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeVector<T>(initValue, args...))>(sz, makeVector<T>(initValue, args...));
}

template <class Func>
class FixPoint : Func {
public:
    explicit constexpr FixPoint(Func&& f) noexcept : Func(forward<Func>(f)) {}

    template <class... Args>
    constexpr decltype(auto) operator()(Args&&... args) const {
        return Func::operator()(*this, std::forward<Args>(args)...);
    }
};

template <class Func>
static inline constexpr decltype(auto) makeFixPoint(Func&& f) noexcept {
    return FixPoint<Func>{forward<Func>(f)};
}

template <class T>
inline bool chmax(T &a, const T &b) noexcept {
    return b > a && (a = b, true);
}

template <class T>
inline bool chmin(T &a, const T &b) noexcept {
    return b < a && (a = b, true);
}

template <class T>
inline T diff(const T &a, const T &b) noexcept {
    return a < b ? b - a : a - b;
}
// End Header }}}

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

    var(string, S);

    bool A = false, B = false;
    for (const auto e: S) {
        A |= (e == 'A');
        B |= (e == 'B');
    }

    cout << ((A && B) ? "Yes" : "No") << "\n";

    return 0;
}


Measured memory_bytes: 256
import sys
import numpy as np 

I = np.array(sys.stdin.read().split(), dtype=np.int64)
w, h, n = I[:3]
x, y, a = I[3:].reshape(n, 3).T 

def main():
    l = 0
    r = w
    d = 0
    u = h
    if np.any(a == 1):
        l = np.amax(x[a == 1])
    if np.any(a == 2):
        r = np.amin(x[a == 2])
    if np.any(a == 3):
        d = np.amax(y[a == 3])
    if np.any(a == 4):
        u = np.amin(y[a == 4])
        
    if l > r or d > u:
        return 0
    return (r - l) * (u - d)

if __name__ == '__main__':
    ans = main()
    print(ans)

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

#define ALL(a) begin(a), end(a)
#define TPL template
#define TNM typename

using ll = long long;
using ull = unsigned long long;

TPL<TNM T> using vec = vector<T>;
TPL<TNM T> using vec2 = vec<vec<T>>;
TPL<TNM T> using vec3 = vec<vec2<T>>;
TPL<TNM T> using vec4 = vec<vec3<T>>;
TPL<TNM T> using vec5 = vec<vec4<T>>;

TPL<TNM T> inline istream& operator >> (istream& is, vector<T>& vec) { for (T& x : vec) is >> x; return is; }
TPL<TNM V, TNM H> void resize(vector<V>& _v, const H _h) { _v.resize(_h); }
TPL<TNM V, TNM H, TNM ... T> void resize(vector<V>& _v, const H& _h, const T& ... _t) { _v.resize(_h); for (auto& __v : _v) resize(__v, _t ...); }
TPL<TNM V, TNM T> TNM enable_if<!is_class<V>::value>::type fill(vector<V>& _v, const T &_t) { std::fill(ALL(_v), _t); }
TPL<TNM V, TNM T> TNM enable_if<is_class<V>::value>::type fill(vector<V>& _v, const T &_t) { for (auto &_e : _v) fill(_e, _t); }
TPL<TNM T> inline void UNIQUE(vector<T>& _v) { sort(ALL(_v)); _v.erase(unique(ALL(_v)), _v.end()); }
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(6); } } pre__;

int main(void) {
	int N;
	cin >> N;
	vector<tuple<string, int, int>> book(N);
	for (int i = 0; i < N; ++i) {
		string S;
		int P;
		cin >> S >> P;
		book[i] = make_tuple(S, -1 * P, i + 1);
	}
	sort(ALL(book));
	for (int i = 0; i < N; ++i) {
		cout << get<2>(book[i]) << endl;
	}

	return 0;
}

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

int main(){

  int N,M;
  cin >> N >> M;
  
  int MM = N/2;
  
  vector<vector<int>> ans(MM, vector<int>(2));
  
  if(N%2==1){
    for(int i=1; i<=MM; i++){
      ans[i-1][0]=i;
      ans[i-1][1]=N-i;
    }
  }
  
  if(N%2==0){
    int n = N/4;
    
    ans[0][0]=0;
    ans[0][1]=1;
    for(int i=2; i<=n; i++){
      ans[i-1][0]=i;
      ans[i-1][1]=N+1-i;
    }
    for(int i=1; i<=MM-n; i++){
      ans[n-1+i][0]= N/2 + i;
      ans[n-1+i][1]= N/2 - i;
    }
  }
  
  for(int i=0; i<MM; i++){
    ans[i][0]++;
    ans[i][1]++;
  }
  
  for(int i=0; i<M; i++){
    cout << ans[i][0] << ' ' << ans[i][1] << endl;
  }
}
        
        
      
        
        
      
    
 

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

using namespace std;

using ll = long long;

using Graph = vector< vector<int> >;

bool dfs(int cur, vector<int>& memo, Graph& g, vector<int>& order) {
    memo[cur] = 1;
    for (int nex : g[cur]) {
        if (memo[nex] == 2) continue;
        if (memo[nex] == 1) return false;
        if (!dfs(nex, memo, g, order)) return false;
    }
    memo[cur] = 2;
    order.push_back(cur);
    return true;
}

bool tsort(Graph& g, vector<int>& order) {
    vector<int> memo(g.size(), 0);
    for (int i = 0; i < g.size(); i++) {
        if (memo[i] != 0) continue;
        if (!dfs(i, memo, g, order)) return false;
    }
    reverse(order.begin(), order.end());
    return true;
}

const int INF = 1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector< vector<int> > a(n, vector<int>(n - 1));
    Graph g(n * n);
    vector<int> deg(n * n, 0);
    for (int i = 0; i < n; i++) {
        vector<int> tmp;
        for (int j = 0; j < n - 1; j++) {
            cin >> a[i][j];
            a[i][j]--;

            int v1 = i;
            int v2 = a[i][j];
            if (v1 > v2) swap(v1, v2);
            tmp.push_back(v1 * n + v2);
        }

        for (int j = 0; j < n - 2; j++) {
            g[tmp[j]].push_back(tmp[j + 1]);
            deg[tmp[j + 1]]++;
        }
    }

    vector<int> order;
    bool can = tsort(g, order);
    if (!can) {
        cout << -1 << endl;
        return 0;
    }

    vector<int> dists(n * n, 0);
    for (int cur : order) {
        for (int nex : g[cur]) {
            dists[nex] = max(dists[nex], dists[cur] + 1);
        }
    }

    int ans = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            ans = max(ans, dists[i * n + j]);
        }
    }
    ans++;
    cout << (ans >= INF ? -1 : ans) << endl;
    return 0;
}


Measured memory_bytes: 56700
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

x,n = mi()
p =li()

# small side
xs = x
while 1:
    if xs not in p:
        break
    xs -= 1

# large side
xl = x
while 1:
    if xl not in p:
        break
    xl += 1

if x-xs > xl - x:
    print(xl)
else:
    print(xs)
    



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

int main() {
  int num;
  cin >> num;
  int ans = num % 1000;
  if(ans == 0){
    cout << 0 << endl;
  }else{
    cout << 1000 - ans << endl;
  }
}

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

#define REP(i, n) for(int (i) = 0; (i) < (int)(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 INF 1e9

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

typedef long long ll;

using namespace std;

inline ll SetID(ll P, ll x)
{
    return P * 1000000 + x;
}

inline string SetAns(int id)
{
    int i;
    string str;

    for (i = 0; i < 13; i++)
    {
        if (id / pow(10, i) == 0)
            break;  
    }

    REP(j, 12 - i)
        str.push_back(0);
    
    str.push_back(id);

    return  str;
}

int main(int argc, char const *argv[])
{
    int A, B;
    cin >> A >> B;
    int ans;

    if (A > 12)
    {
        ans = B;
    }
    else if (A >= 6 && A <= 12)
    {
        ans = B /2;
    }
    else
    {
        ans = 0;
    }

    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 256
#![allow(non_snake_case)]
#![allow(unused_imports)]
use proconio::input;
use std::collections::HashMap;
// use std::collections::VecDeque;
// use std::cmp::max;
// use std::cmp::min;

fn main() {
    input! {
        S: String,
    }

    let mut chars: Vec<char> = S.chars().collect();
    chars.sort();

    let ans = if chars[0] == chars[1] && chars[2] == chars[3] && chars[0] != chars[2] {
        "Yes"
    } else {
        "No"
    };

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


Measured memory_bytes: 2132
#include <iostream>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  int A[N];
  for(int i = 0;i < N;i++)cin >> A[i];
  int n = 0,nn = 1;
  while(nn){
    for(int i = 0;i < N;i++){
      nn &= (A[i] + 1) % 2;
      A[i] /= 2;
    }
    if(nn)n++;
  }
  cout << n << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep0(i,n) for(i=0;i<n;i++)
#define rep1(i,n) for(i=1;i<=n;i++)
#define ll long long
#define test(a) cout << "*" << a << endl;
#define ss stringstream
int main (){
  int i,j;
  int N,M;
  int P[100001];
  int Y[100001];
  vector<ll>vec[100001];
  int X[100001][100001];
  
  cin >> N >> M;
  rep1(i,M){
    cin >> P[i] >> Y[i];
    vec[P[i]].push_back(Y[i]);
  }
  rep1(i,N){
    sort(vec[i].begin(),vec[i].end());
  }
  /*rep0(i,3){
    X[i] = vec[1][i];  
  }*/
  /*rep1(i,N){
    rep0(j,vec[i].size()){
      X[i][j] = vec[i][j];
      test(X[i][j]);
      cout << &(X[i]) << endl;
      test(i);
      test(j);
    }
  }*/
  //cout << &(X[1][0]) << endl;
  //cout << X[1][0] << endl;
  //cout << &(X[2][0]) << endl;
  //cout << &(X[1][1]) << endl;
  //cout << (X[1][1]) << endl;
  
  /*rep1(i,N){
    vector<ll>::iterator itrVec[i] = vec[i].begin();
  }*/
  
  //test(vec[1][1]);
  
  rep1(i,M){
    cout << setw(6) << setfill('0') << P[i] ;
    //cout << P[i];
    //cout << &(X[1]) << endl;
    //cout << &(X[2]) << endl;
    //cout << &(X[3]) << endl;
    //cout << &(Y[4]) << endl;
    //cout << &(Y[5]) << endl;
    j = vec[P[i]].size()/2 ;
    if(Y[i] < vec[P[i]][ vec[P[i]].size()/2 ]){    
      while(1){
        if(vec[P[i]][j] == Y[i]){
          cout << setw(6) << setfill('0') << j+1 << endl;
          break;
        }
        j--; 
      }
    }
    
    else{
      while(1){
        if(vec[P[i]][j] == Y[i]){
          cout << setw(6) << setfill('0') << j+1 << endl;
          break;
        }
        j++;
      }      
    }
    
                  
                  
    //rep0(j,vec[P[i]].size()){//TLE
      /*if(vec[P[i]][j] == Y[i]){
        cout << setw(6) << setfill('0') << j+1 << endl;
        break;
      }
    }*/
  }
  
  /*
  vector<ll>::iterator itrVec = vec[1].begin();
  cout << &(*itrVec)<<endl;
  cout << &(*(itrVec+1))<<endl;
  cout << &(*(itrVec+2)) - &(*itrVec)<<endl;
  */
  
}

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

using namespace std;
typedef long long LL;

#ifdef BTK
#define DEBUG if(1)
#else
#define CIN_ONLY if(1)
struct cww {cww() {CIN_ONLY{ios::sync_with_stdio(false); cin.tie(0);}}
}star;
#define DEBUG if(0)
#endif

#define ALL(v) (v).begin(),(v).end()
#define REC(ret, ...) std::function<ret (__VA_ARGS__)>
template <typename T>inline bool chmin(T &l, T r){bool a = l>r; if (a)l = r; return a;}
template <typename T>inline bool chmax(T &l, T r){bool a = l<r; if (a)l = r; return a;}
template <typename T>istream& operator>>(istream &is, vector<T> &v){for (auto &it : v)is >> it;return is;}

class range {private: struct I { int x; int operator*() { return x; }bool operator!=(I& lhs) { return x<lhs.x; }void operator++() { ++x; } }; I i, n;public:range(int n) :i({ 0 }), n({ n }) {}range(int i, int n) :i({ i }), n({ n }) {}I& begin() { return i; }I& end() { return n; }};

string s[2][2] = { {"R","U"}, {"D","L"} };
LL x[112345];
LL y[112345];
int main() {
	int N;
	cin >> N;
	vector<string> ret(N);
	vector<LL> d;
	for (int i : range(N)) {
		cin >> x[i] >> y[i];
	}
	for (int i : range(N-1)) {
		if (abs(x[i]+y[i]) % 2 != abs(x[i+1]+y[i+1]) % 2) {
			cout << -1 << endl;
			return 0;
		}
	}
	if (abs(x[0] + y[0]) % 2 == 0) {
		d.push_back(1);
	}
	for (int i : range(31))d.push_back(1ll << i);

	for (int i : range(N)) {
		LL nx = x[i] + y[i];
		LL ny = x[i] - y[i];
		if (abs(x[i] + y[i]) % 2 == 0) {
			nx++;
			ny++;
			ret[i] += "L";
		}
		nx = ((1ll << 31) - 1) - nx;
		ny = ((1ll << 31) - 1) - ny;
		nx /= 2;
		ny /= 2;
		for (int j : range(31)) {
			ret[i] += s[nx % 2][ny % 2];
			nx /= 2;
			ny /= 2;
		}
	}
	cout << d.size() << endl;
	string sp(d.size(), ' ');
	sp.back() = '\n';
	for (int i : range(d.size()))cout << d[i] << " " << sp[i];
	for (int i : range(N)) {
		cout << ret[i] << endl;
		DEBUG {
			for (int j : range(d.size())) {
				if (ret[i][j] == 'L')x[i] += d[j];
				if (ret[i][j] == 'R')x[i] -= d[j];
				if (ret[i][j] == 'D')y[i] += d[j];
				if (ret[i][j] == 'U')y[i] -= d[j];
			}
		if (x[i] != 0 || y[i] != 0) {
			cout << "NG" << endl;
		}

		}
	}
	return 0;
}


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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

using namespace std;

int main(){
  string s,t;
  cin >> s >> t;
  sort(all(s));
  sort(all(t),greater<char>());
  if(s < t){
    cout << "Yes" << endl;
  }else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
    
#define int long long
    
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define FORR(i,m,n) for(int i=m;i>=n;i--)
#define pb(x) push_back(x) 
#define SORT(x) sort((x).begin(),(x).end())
#define INF 99999999999
    
using namespace std;
    
int dy[4]={1, -1, 0, 0};
int dx[4]={0, 0, 1, -1};

int32_t main(){
    int h, w;
    cin >> h >> w;
    string str[h];
    REP(i, h) cin >> str[i];

    REP(i, h){
        REP(j, w){
            if(str[i][j]=='#'){
                bool f=0;
                REP(k, 4){
                    int uy = dy[k] + i;
                    int ux = dx[k] + j;
                    if(0<=uy && uy<h && 0<=ux && ux<w){
                        if(str[uy][ux]=='#') f=1;
                    }
                }

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

    cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<math.h>
// #include<bits/stdc++.h>
using namespace std;
#define ll long long
constexpr long long int INFLL = 1001001001001001LL;
constexpr int INFI = 1000000007;

int N,M;
int G[55][55];
vector<bool> seen(55,false);

void dfs(int v){
  seen[v] = true;
  for(int i=0; i<N; i++){
    if(G[v][i] == 1){
      if(seen[i]){
        continue;
      }
      dfs(i);
    }
  }
}


int main(){
  cin >> N >> M;
  for(int i=0; i<N; i++){
    for(int j=0; j<N; j++){
      G[i][j] = -1;
    }
  }
  vector<pair<int,int>> m;
  for(int i=0; i<M; i++){
    int a,b;
    cin >> a >> b;
    a--;
    b--;
    G[a][b] = 1;
    G[b][a] = 1;
    m.push_back(make_pair(a,b));
  }
  int count=0;
  for(auto mp: m){
    int a,b;
    a = mp.first;
    b = mp.second;
    G[a][b] = -1;
    G[b][a] = -1;
    for(int j=0; j<N; j++){
      seen[j] = false;
    }
    dfs(0);
    bool cant=false;
    for(int j=0; j<N; j++){
      if(!seen[j]){
        cant = true;
      }
    }
    if(cant){
      count++;
    }
    G[a][b] = 1;
    G[b][a] = 1;
  }
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
#include <queue>
#include <map>
#include <set>
using namespace std;
using ll = long long;
const int INF = 1 << 30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p)
{
    os << p.first << " " << p.second;
    return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    for (int i = 0; i < (int)v.size(); i++)
        os << v[i] << (i + 1 != v.size() ? " " : "");
    return os;
}

ll a, b, n;
ll func(ll x)
{
    return (a * x) / b - a * (x / b);
}

bool check(ll num)
{
    ll ng = -1, ok = n + 1;
    while (abs(ok - ng) > 1)
    {
        ll x = (ok + ng) / 2;
        if (func(x) >= num)
        {
            return true;
        }
        else
        {
            ng = x;
        }
    }
    return false;
}

void solve()
{
    cin >> a >> b >> n;
    ll x = min(n, b - 1);
    ll ans = func(x);
    cout << ans << endl;
}

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define int               long long
#define fr                first
#define sc                second
#define vc                vector
#define endl              '\n'
#define pii               pair<int,int>
#define msi               map<string,int>
#define mii               map<int,int>
#define psi               pair<string,int>
#define pis               pair<int,string>
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define LSB(i)            ((i)&-(i))

template<typename T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int N = 105;
const int W = 1e5 + 5;
int w[N], v[N];
int dp[N][W];
int n, wt;

int dynamic(int pos, int we)
{

    if (we > wt)
        return INT_MIN;
    if (pos >= n)
        return 0;
    if (dp[pos][we] != -1)
        return dp[pos][we];
    int ans;
    ans = max(dynamic(pos + 1, we + w[pos]) + v[pos], dynamic(pos + 1, we));
    dp[pos][we] = ans;
    return ans;
}

void solve()
{
    cin >> n >> wt;
    mem1(dp);
    for (int i = 0; i < n; i++)
        cin >> w[i] >> v[i];
    cout << dynamic(0, 0);
}
signed main() {
    ios_base::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t = 1;
    //cin>>t;
    while (t--) solve();
    return 0;
}

Measured memory_bytes: 82304
#include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
using namespace std;
using ll = long long;
//typedef pair<string,string> P;
//double dat[100][100];
//int dp[6][1010];//動的計画法
//int prime[10000001];
//char str[1010][1010];
//vector<pair<int,int> > pc[100001];
//int ABS(int a){return max(a,-a);}
//long long num[100000];
int main(){
	int m,n;
	ll ans;
	cin>>n>>m;
	ans=pow(2,m)*(1900*m+100*(n-m));
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.PrintWriter
import java.util.*
import java.math.*

val pw = PrintWriter(System.out)

fun main(args: Array<String>) {
    val n = readInt() 
    val k = readInt()
    
    var x = 1 
    for(i in 0 until n) {
        x = if(x * 2 < x + k) x * 2 else x + k
    }
    println(x)
    pw.flush()
}

fun inputList() = 
    readLine()!!.split(" ").map(String::toInt)

fun sum_digits(num_: Long): Long {
    var num = num_
    var rtn: Long = 0
    while(num != 0.toLong()) {
        val tmp = num % 10
        rtn += tmp
        num /= 10
    }
    return rtn
}

/****** Decrared Functions ******/

// IO
fun read() = readLine()!!
fun readInt() = read().toInt()
fun readLong() = read().toLong()
fun readDouble() = read().toDouble()
fun readListOfString() = read().split(" ")
fun readListOfInt() = readListOfString().map { it.toInt() }
fun readListOfLong() = readListOfString().map { it.toLong() }
fun readListOfDouble() = readListOfString().map { it.toDouble() }


fun println(value : Any) {
    pw.println(value)
}

fun gcd(a: Long, b: Long): Long = 
    if(b != 0L) a else gcd(b, a % b)

fun lcm(a: Long, b: Long) = 
    if(b==0L) a else gcd(b, a % b)


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


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


	long long n , sum = 0 ;
	cin >> n ;
	for (int i = 1; i <= n; i++) {
		if (i % 3 != 0 && i % 5 != 0)
			sum += i;
	}
	cout << sum << endl;
	
	return 0;
}


Measured memory_bytes: 3652
#include <stdio.h>

int main(void){
    int dish[5];
    int i,temp,last;
    int sum = 0;
    
    for(i = 0; i < 5; i++){
        scanf("%d", &dish[i]);
    }
    
    temp = 10;
    for(i = 0; i < 5; i++){
        //printf("temp:%d\n", temp);
        if(temp >= dish[i] % 10 && dish[i] % 10 != 0){
            last = i;
            temp = dish[i] % 10;
        }
    }

    for(i = 0; i < 5; i++){
        if(i != last){
            if(dish[i] % 10){
                sum += (dish[i]/10 + 1)*10;
            }else{
                sum += dish[i];
            }
        }else{
            sum += dish[i];
        }
    }
    
    printf("%d\n", sum);
    
    return 0;
}

Measured memory_bytes: 128
process.stdin.resume();
process.stdin.setEncoding("utf8");

const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});

const lines = [];

reader.on("line", (line) => {
  lines.push(line);
});

const nil = {};
nil.after = nil;
nil.before = nil;

reader.on("close", () => {
  const n = lines[0] - 0;
  for (let i = 1; i <= n; i++) {
    let [command, operand] = lines[i].split(" ");
    switch (command) {
      case "insert":
        const o = {
          value: operand,
          before: nil,
          after: nil.after,
        };
        nil.after.before = o;
        nil.after = o;
        break;
      case "delete":
        for (let c = nil.after; nil !== c; c = c.after) {
          if (c.value === operand) {
            c.before.after = c.after;
            c.after.before = c.before;
            break;
          }
        }
        break;
      case "deleteFirst":
        nil.after = nil.after.after;
        nil.after.before = nil;
        break;
      case "deleteLast":
        nil.before = nil.before.before;
        nil.before.after = nil;
        break;
    }
  }

  let first = true;
  for (let c = nil.after; nil !== c; c = c.after) {
    if (!first) process.stdout.write(" ");
    process.stdout.write(c.value);
    first = false;
  }
  console.log("");
});



Measured memory_bytes: 339888
#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() {
  string s;
  cin >> s;
  string ans = "Yes";
  rep(i, s.size()) {
    if (i % 2 == 0) {
      if (s[i] == 'L') {
        ans = "No";
        break;
      }
    } else {
      if (s[i] == 'R') {
        ans = "No";
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

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

#define int long long
#define itn int
#define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++)
#define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) For(i, 0, n - 1)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'
#define dump2(x, y) \
    cerr << #x << " = " << (x) << " " << #y << " = " << (y) << '\n'
#define SZ(x) ((int)(x).size())
#define bit(n) (1LL << (n))
constexpr int MOD = 1e9 + 7;

template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = LLONG_MAX / 2;
using P = pair<int, int>;
using vec = vector<int>;
template <typename T>
using mat = vector<vector<T>>;

// clang-format off
template <typename T1, typename T2>
ostream& operator<<(ostream& stream, const pair<T1, T2>& p) { return stream << p.first << "," << p.second; }
template <typename T>
void print(const vector<T> vec) { rep (i, vec.size() - 1) cout << vec[i] << ' '; cout << vec[vec.size() - 1] << '\n'; }
template <typename Arg>
void print(const Arg arg) { cout << arg << '\n'; }
template <typename Head, typename... Args>
void print(const Head head, const Args... args) { cout << head << " "; print(args...); }
template <typename T, typename U>
void init(vector<T>& v, vector<U>& w) { rep (i, v.size()) cin >> v[i] >> w[i]; }
template <typename T>
void init(vector<T>& v) { rep (i, v.size()) cin >> v[i]; }
template <typename T>
T sum_(vector<T> vec, T init = 0) { return std::accumulate(all(vec), T(init)); }
template<typename T>
bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template<typename T>
bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <typename T>
int index(const T& vec, const typename T::iterator it) { return distance(vec.begin(), it); }
template <typename T = int>
mat<T> mmat(int n, int m=0) { return mat<T>(n, vector<T>(m)); }
template <typename T = int>
vector<T> ivec(int n) { vector<T> v(n); init(v); return v; }
// clang-format on

void yn(bool tf) { print(tf ? "Yes" : "No"); }
void YN(bool tf) { print(tf ? "YES" : "NO"); }

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
// -------------------------------------------------------------------
// sort 1 2 3 4
// pqr 1 2 3 must impl >

signed main() {
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
    int n, a, b;
    cin >> n >> a >> b;
    if (a < b) swap(a, b);
    if ((a - b) % 2 == 0) {
        print((a - b) / 2);
        return 0;
    }
    if ((n - b) >= (a - 1)) {
        print(a + (b - a - 1) / 2);
    } else {
        print(n - b + 1 + (n - (a + n - b + 1)) / 2);
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int hako[111];
int main(){
int a,b,c;
cin>>a>>b>>c;
hako[a]=1;
hako[b]=1;
hako[c]=1;
a=0;
for(int i=0;i<111;i++){
a+=hako[i];
}
cout<<a<<endl;
return 0;
}

Measured memory_bytes: 256
S = input()
T = input()
flag = 0
anslist = []
for i in range(len(S)-len(T)+1):
    flag = 1
    for j in range(len(T)):
        if not (S[i+j] == T[j] or S[i+j] == "?"):
            flag = 0
            break
    if flag == 1:
        anslist.append(i)

anslist.sort(reverse=True)
flag = 0
count2 = 0
if len(anslist) == 0:
    print("UNRESTORABLE")
else:
    for i in range(len(S)):
        if i == anslist[0]:
            flag = 1
            count2 = 0
        if flag == 1:
            print(T[count2], end="")
            count2+=1
            if count2 == len(T):
                flag = 0
                continue
        if flag == 0:

            if S[i] == "?":
                print("a", end="")
            else:
                print(S[i], end="")

Measured memory_bytes: 38384
using System;
using System.Collections.Generic;
using System.Linq;

class D {
    static ulong Hash(int a1, int a2) {
        return (ulong)a1 * 0x9ddfea08eb382d69 + (ulong)a2;
    }

    class Graph {
        List<int>[] Out;
        public int[] C;

        public Graph(int n) {
            Out = new List<int>[n];
            for (int i = 0; i < n; ++i) Out[i] = new List<int>();
        }

        public void AddEdge(int s, int t) {
            Out[s].Add(t);
            Out[t].Add(s);
        }

        public void MakeConnection() {
            C = new int[Out.Length];
            var label = 1;
            for (int i = 0; i < Out.Length; ++i)
                if (C[i] == 0) Assign(i, label++);
            Out = null;
        }

        void Assign(int no, int label) {
            C[no] = label;
            foreach (var i in Out[no])
                if (C[i] == 0) Assign(i, label);
        }
    }

    public static void Main() {
        var line = Console.ReadLine().Split();
        var n = int.Parse(line[0]);
        var k = int.Parse(line[1]);
        var l = int.Parse(line[2]);
        var graph1 = new Graph(n);
        for (int i = 0; i < k; ++i) {
            line = Console.ReadLine().Split();
            var s = int.Parse(line[0]) - 1;
            var t = int.Parse(line[1]) - 1;
            graph1.AddEdge(s, t);
        }
        graph1.MakeConnection();
        var graph2 = new Graph(n);
        for (int i = 0; i < l; ++i) {
            line = Console.ReadLine().Split();
            var s = int.Parse(line[0]) - 1;
            var t = int.Parse(line[1]) - 1;
            graph2.AddEdge(s, t);
        }
        graph2.MakeConnection();
        var hash = new ulong[n];
        var d = new Dictionary<ulong, int>();
        for (int i = 0; i < n; ++i) {
            hash[i] = Hash(graph1.C[i], graph2.C[i]);
            var v = 0;
            d.TryGetValue(hash[i], out v);
            d[hash[i]] = v + 1;
        }
        Console.WriteLine(string.Join(" ", hash.Select(k1 => d[k1])));
    }
}


Measured memory_bytes: 54676
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	int a;
	cin>>a;
	for(int i=0;i<100000;i++){
		if(a<i*i){
			cout<<(i-1)*(i-1)<<endl;
			break;
		}
	}	
 
 
 
 
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int a,b,c,d;
	int i=1;
	cin>>a>>b>>c>>d;
	while(i==1){
		c=c-b;
		if(c<=0){
			cout<<"Yes"; return 0;
		}
		a=a-d;
		if(a<=0){
			cout<<"No";return 0;
		}
	}
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  
  int N;
  cin >> N ;
  
  vector<int> A(N);
    for(int i=0;i<N;i++){
      cin >> A.at(i);
    }
  
  int M=max(A.at(0),A.at(N-1)); //Mを小さくしていっていくつ割り切るか調べる
  
  while(true){
    
    int count=0;//MがAをいくつ割り切れないか数える
    
    for(int i=0;i<N;i++){
      
      if(A.at(i) % M > 0){
        count ++;
      }
      if(count >1){
        break;
      }
    }
    
    if(count <=1){
      break;
    }
    M -= 1;
  }
  
  cout << M << endl;
}


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

int main(){
  int n;
  cin>>n;
  vector<int> v(n,0);
  for(int i=0;i<n;i++){
    int x,y;
    cin>>x>>y;
    if(x==y){
      v[i]=1;
    }
  }
  for(int j=0;j<n-2;j++){
    if(v[j]&&v[j+1]&&v[j+2]){
      cout<<"Yes";
      return 0;
    }
  }
  cout<<"No";
  return 0;
}

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

using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> l(m), r(m);
	for (size_t i = 0; i < m; i++)
	{
		cin >> l[i] >> r[i];
	}
	int minr = *min_element(r.begin(), r.end());
	int maxl = *max_element(l.begin(), l.end());
	int ans = minr - maxl >= 0 ? minr-maxl+1 : 0;
	cout << ans << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <limits>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <functional>

using namespace std;

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif
using ll = long long;
using vll = std::vector<ll>;
using vvll = std::vector<vll>;
using vvvll = std::vector<vvll>;
#define reps(i, S, E) for (ll i = (S); i <= (E); i++)
#define rep(i, N) reps(i, 0, N-1)
#define deps(i, E, S) for (ll i = (E); i >= (S); i--)
#define dep(i, N) deps(i, N-1, 0)
const ll MOD = 1000000007;
const ll INF = 1LL << 60;


//AtCoder Beginner Contest 113 - D
ll LLpow(ll x, ll n) {
	ll ret = 1;
	while (n > 0) {
		if (n & 1) {
			ret *= x;
		}
		x *= x;
		n >>= 1;
	}
	return ret;
}

int main() {
	ll H;
	scanf("%lld", &H);
	ll W;
	scanf("%lld", &W);
	ll K;
	scanf("%lld", &K);

	if (W == 1) {
		printf("1\n");
		return 0;
	}

	vvll dp(H + 1, vll(W, 0));
	dp[0][0] = 1;

	rep(j, H) {
		vll lines(W - 1, 0);
		rep(i, LLpow(2, W - 1)) {
			//�������A�����邩�`�F�b�N
			bool ok = true;
			rep(k, W - 2) {
				if (lines[k] == 1 && lines[k + 1] == 1) {
					ok = false;
					break;
				}
			}

			if (ok == true) {
				//���̒i�̏ꍇ�̐������Z
				rep(k, W) {
					if (k == 0) {
						if (lines[k] == 0) {
							dp[j + 1][k] += dp[j][k];
						}
						else {
							dp[j + 1][k] += dp[j][k + 1];
						}
					}
					else if (k == W - 1) {
						if (lines[k - 1] == 0) {
							dp[j + 1][k] += dp[j][k];
						}
						else {
							dp[j + 1][k] += dp[j][k - 1];
						}
					}
					else {
						if (lines[k - 1] > 0) {
							dp[j + 1][k] += dp[j][k - 1];
						}
						else if (lines[k] > 0) {
							dp[j + 1][k] += dp[j][k + 1];
						}
						else {
							dp[j + 1][k] += dp[j][k];
						}
					}

					dp[j + 1][k] %= MOD;
				}
			}

			//���̏�Ԃ�
			lines[0]++;
			rep(k, W - 2) {
				if (lines[k] > 1) {
					lines[k + 1]++;
					lines[k] = 0;
				}
			}
		}
	}

	rep(j, H + 1) {
		rep(i, W) {
			eprintf("%lld ", dp[j][i]);
		}
		eprintf("\n");
	}

	ll result = dp[H][K - 1];

	printf("%lld\n", result);
}


Measured memory_bytes: 256
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//

fn run() {
    input! {
        n: usize,
        m: usize,
        d: [usize; n],
        e: [(usize1, usize1); m],
    }
    let mut a = vec![];
    for i in 0..n {
        a.push((d[i], i));
    }
    a.sort();
    let mut g = vec![vec![]; n];
    for i in 0..m {
        let (a, b) = e[i];
        g[a].push((b, i));
        g[b].push((a, i));
    }
    let inf = 1_000_000_001usize;
    let mut depth = vec![inf; n];
    let mut color = vec![2; n];
    let mut weight = vec![inf; m];
    for &(w, v) in a.iter() {
        if depth[v] < inf {
            continue;
        }
        let mut ok = false;
        for &(u, k) in g[v].iter() {
            if depth[u] < w {
                ok = true;
                color[v] = color[u];
                depth[v] = w;
                weight[k] = w - depth[u];
                break;
            }
        }
        if ok {
            continue;
        }
        for &(u, k) in g[v].iter() {
            if w == d[u] {
                if color[u] < 2 {
                    color[v] = color[u] ^ 1;
                } else {
                    color[v] = 0;
                    color[u] = 1;
                }
                depth[u] = w;
                depth[v] = w;
                weight[k] = w;
                ok = true;
                break;
            }
        }
        if !ok {
            println!("-1");
            return;
        }
    }
    let mut out = String::new();
    for i in 0..n {
        let c = if color[i] == 0 {'B'} else {'W'};
        out.push(c);
    }
    out.push('\n');
    for i in 0..m {
        let w = if weight[i] == inf {1_000_000_000} else {weight[i]};
        out.push_str(&format!("{}\n", w));
    }
    print!("{}", out);
}

fn main() {
    run();
}


Measured memory_bytes: 41044
#include <iostream>
using namespace std;
int main(void){
    int rooms[4][3][10];
    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < 10; k++) {
                rooms[i][j][k] = 0;
            }
        }
    }
    int n;
    int b, f, r, v;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> b >> f >> r >> v;
        rooms[b-1][f-1][r-1] += v;
    }
    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < 10; k++) {
                cout << " " << rooms[i][j][k];
            }
            cout << endl;
        }
        if (i != 3) {
            for (int j = 0; j < 20; j++) {
                cout << "#";
            }
            cout << endl;
        }
    }
}

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

int main(void){
    int n;
    std::cin >> n;
    long long int sum = 0;
    for(int i = 1; i <= n; i++){
        if(i % 3 != 0 && i % 5 != 0){
            sum += i;
        }
    }
    std::cout << sum << std::endl;
    return 0;
}

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

#define LSOne(S) (S&(-S))

char c[4005];
int a[4005];

int f[4005];
int ft[4005];

int N;

int nextWhite[2005][2005];
int nextBlack[2005][2005];
int indxWhite[2005];
int indxBlack[2005];

void init(){
    memset(ft, 0, sizeof(ft));
    for(int i = 1; i <= 2*N; i ++){
        ft[i] += f[i];
        if(i + LSOne(i) <= 2*N){
            ft[i+LSOne(i)] += ft[i];
        }
    }
}

int rsq(int b){
    int sum = 0;
    for(; b; b -= LSOne(b)){
        sum += ft[b];
    }
    return sum;
}

void adjust(int k, int v){
    for(; k <= 2*N; k += LSOne(k)){
        ft[k] += v;
    }
}

void init2(){
    for(int i = 1; i <= 2*N; i ++){
        if(c[i] == 'B'){
            indxBlack[a[i]] = i;
        }else if(c[i] == 'W'){
            indxWhite[a[i]] = i;
            //printf("indxWhite[%d]=%d\n", a[i], i);
        }
    }
    for(int numWhite = 0; numWhite <= N; numWhite ++){
        for(int i = 1; i <= 2*N; i ++){
            if((c[i] == 'B') || (a[i] > numWhite)){
                f[i] = 1;
                //printf("f[%d]=%d\n", i, 1);
            }else{
                f[i] = 0;
            }
        }
        init();
        for(int numBlack = 0; numBlack <= N; numBlack ++){
            nextWhite[numWhite][numBlack] = rsq(indxWhite[numWhite+1]);
            nextBlack[numWhite][numBlack] = rsq(indxBlack[numBlack+1]);
            //printf("nextWhite[%d][%d]=%d\n", numWhite, numBlack, nextWhite[numWhite][numBlack]);
            if(numBlack == N){break;}
            adjust(indxBlack[numBlack+1], -1);
        }
    }
}

int memo[2005][2005];

int dp(int i, int j){
    if(i == N && j == N){
        return 0;
    }else if(memo[i][j] != -1){
        return memo[i][j];
    }else{
        memo[i][j] = 1023456789;
        if(i < N){
            memo[i][j] = min(memo[i][j], nextWhite[i][j]-1+dp(i+1, j));
        }
        if(j < N){
            memo[i][j] = min(memo[i][j], nextBlack[i][j]-1+dp(i, j+1));
        }
        return memo[i][j];
    }
}

int main(){
    scanf("%d", &N);

    for(int i = 1; i <= 2*N; i ++){
        scanf(" %c %d", &c[i], &a[i]);
    }

    init2();
    memset(memo, -1, sizeof(memo));
    printf("%d", dp(0, 0));
    return 0;
}

Measured memory_bytes: 47616
#include<iostream>
#include<vector>
#include<cmath>

int main(){
	int n, d;
	std::cin >> n >> d;
	
	std::vector<std::vector<int>> x;
	
	for(int i = 0; i < n; ++i)
	{
		std::vector<int> temp;
		for(int j = 0; j < d; ++j)
		{
			int input;
			std::cin >> input;
			temp.push_back(input);
		}
		x.push_back(temp);
	}
	
	int count = 0;
	for (int i = 0; i < n - 1; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			int sum = 0;
			for (int k = 0; k < d; k++)
			{
				sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
			}
			if (int(std::sqrt(sum))*std::sqrt(sum) == sum)
			{
				++count;
			}
		}
	}
	std::cout << count << std::endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define N 1000005
#define ll long long int 	
#define MP make_pair
#define pb push_back
#define ppb pop_back
#define sp " "
#define endl "\n"
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll>
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define fast2 freopen ("kmp.in","r",stdin);freopen ("kmp.out","w",stdout);
#define mod 1000000009
#define fs(x,y) for(int i=1;i<=y;i++) cin>>x[i]
#define fo(i,x,y) for(int i=x;i<=y;i++)
using namespace std;

ll n,m,ar[N],sum;

int main()
{
	fast;
	ll a,b,c;
	cin>>n>>m>>c;
	ll x=min(c,n-m);
	c-=x;
	cout<<c;


}



/*     cd onedrive\desktop\kod
cls


*/ 

Measured memory_bytes: 764
#include <bits/stdc++.h>
#define ll long long
#define met(a) memset(a,0,sizeof(a))
#define inf 0x3f3f3f3f
using namespace std;
const int mod=1e9+7;
const int N=1e5+10;
int book[N],n;
void init()
{
    for(int i=1; i<=n; i++)
        book[i]=i;
}
int getfa(int x)
{
    if(book[x]!=x)
        book[x]=getfa(book[x]);
    return book[x];
}
void mergexy(int x,int y)
{
    book[y]=x;
}
struct node{
int x,y,cnt;}s[N];
struct nodee{
int u,v,w;}f[2*N];
bool cmp(node a,node b){
return a.x<b.x;}
bool cmpp(node a,node b){
return a.y<b.y;}
bool cmppp(nodee a,nodee b){
return a.w<b.w;}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int i,j,k,m;
    int cnt=0,sum=0,ans=0,num;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>s[i].x>>s[i].y;
        s[i].cnt=i;
    }
    sort(s+1,s+1+n,cmp);
    for(i=1;i<n;i++)
    {
        f[++cnt].u=s[i].cnt;
        f[cnt].v=s[i+1].cnt;
        f[cnt].w=min(s[i+1].x-s[i].x,abs(s[i+1].y-s[i].y));
    }
    sort(s+1,s+1+n,cmpp);
    for(i=1;i<n;i++)
    {
        f[++cnt].u=s[i].cnt;
        f[cnt].v=s[i+1].cnt;
        f[cnt].w=min(s[i+1].y-s[i].y,abs(s[i+1].x-s[i].x));
    }
    sort(f+1,f+1+cnt,cmppp);
    init();
    for(i=1;i<=cnt;++i)
    {
        k=getfa(f[i].u);
        m=getfa(f[i].v);
        if(k!=m)
        {
            mergexy(k,m);
            num++;
            sum+=f[i].w;
        }
        if(num==n)
            break;
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 4224
import java.math.BigDecimal;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long a = stdIn.nextLong();
		double b = stdIn.nextDouble();
		
		
	//	System.out.println((long)Math.floor(a*b));
		
		
		BigDecimal bd1 = BigDecimal.valueOf(a);
		BigDecimal bd2 = BigDecimal.valueOf(b);
		
		BigDecimal ans = bd1.multiply(bd2).setScale(0,BigDecimal.ROUND_DOWN);
		
		System.out.println(ans);
		
		
		
		
	}

}


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

#define ll long long
#define mod 1000000007
#define debug1(x) cerr<<#x<<" : "<<x<<"\n";
#define debug2(x,y) cerr<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\n";
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//    freopen("input.txt", "rt" , stdin);
//    freopen("output.out", "wt",stdout);


int main() {
    IOS;
    ll n;
    cin>>n;
    ll a[n];
    for(ll i=0;i<n;i++)cin>>a[i];
    ll ans=0,maxi=a[0];
    for(ll i=0;i<n;i++){
        if(a[i]<maxi)ans+=maxi-a[i];
        maxi=max(maxi,a[i]);
    }
    cout<<ans<<endl;
    return 0 ;
}


Measured memory_bytes: 5208
n=int(input())
p=list(map(int,input().split()))
p.append(0)
ansls=[0]
if p[0]==1:
  ansls[0]=1
for i in range(1,n):
  if p[i] ==i+1:
    if p[i-1] == i:
      ansls[-1]+=1
    else:
      ansls.append(1)
ans=0
for i in range(len(ansls)):
  ans+= (ansls[i]+1)//2
print(ans)

Measured memory_bytes: 14008
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	int a,b; cin>>a>>b;
	vi v={1,2,3};
	rep(i,0,3){
		if(v[i]!=a && v[i]!=b) cout<<v[i];
	}
	
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
typedef long long ll;
int N,L;
ll c[2][5001],mod=1e9+7;
ll x[5000],a[5000];
void add(ll &x,ll y){
	x+=y;
	x%=mod;
}
int main(){
	cin>>N>>L;
	rep(i,N) cin>>x[i];
	rep(i,N) cin>>a[i];
	rep(i,N){
		int id=N-1-i;
		ll sum=0;
		if(i==0) sum=1;
		rep(j,5001) c[1-i%2][j]=0;
		for(int j=L-1;j>=x[id];j--){
			if(a[id]!=0&&(j-x[id])%a[id]==0) add(c[1-i%2][j],sum);
			if(a[id]==0&&j==x[id]) add(c[1-i%2][j],sum);
			sum+=c[i%2][j];
		}
	}
	ll ans=0;
	rep(i,L) add(ans,c[N%2][i]);
	cout<<ans<<endl;
}

Measured memory_bytes: 1320
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        mut abc: [i8; 3]
    };
    abc.sort();
    println!("{}", [abc[0], abc[2]][(abc[0] == abc[1]) as usize]);
}


Measured memory_bytes: 2072
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
          
int main() {
    long long int x;
    cin >> x;
    long long int a = x % 11;
    if( a > 0 && a < 7 ){
        cout << (x / 11) * 2 + 1 << endl;
    }else if( a == 0 ){
        cout << x / 11 * 2 << endl;
    }else{
        cout << (x / 11) * 2 + 2 << endl;
    }
    return 0;
}


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

int main()
{
  int n;
  cin >> n;
  vector<pair<int, int>> a;
  for(int i = 0; i < n; ++i)
  {
    int num;
    cin >> num;
    a.push_back({num, i+1});
  }
  
  sort(a.begin(), a.end());

  for(int i = 0; i < n; ++i)
  {
    cout << a[i].second << " ";
  }
}

Measured memory_bytes: 4296