akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define LI list<int>
#define vct vector
#define D(a) (double)(a)
#define vi vct<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vvi vct<vi>
#define vll vct<ll>
#define vvll vct<vll>
#define vpii vct<pii>
#define vpll vct<pll>
#define vb vct<bool>
#define vs vector<string>
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define ff first
#define ss second
#define bg begin()
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define ft cout<<"for test"<<endl;
#define read(v,a,n) for(int i=a; i<n; i++)cin>>v[i];
#define print(v) for(auto it:v)cout<<it<<' '; cout<<endl;
#define PI acos(-1.0)
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define t_c int test,cs=1;cin>>test;while(test--)
#define rt return true
#define rf return false
///................function.....................///
#define siz(s) (int)(s.size())
#define mod 1000000007
#define dbg(a) cout << #a << " = " << a << " ";
int main()
{
    ///freopen("input15.txt","r",stdin);
    ///freopen("output15.txt","w",stdout);
    int n,k,i,j;
    cin>>n>>k;
    vb dp(k+1);
    vi v(n);
    read(v,0,n);
    for(i=1; i<=k; i++)
    {
        for(j=0; j<n; j++)
            if((i-v[j]>=0)&&(!dp[i-v[j]]))
                dp[i]=1;
    }
    if(dp[k])
        cout<<"First"<<endl;
    else cout<<"Second"<<endl;

}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <iomanip>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define repf(i, a, b) for (int i = (int)a; i < (int)b; i++)
#define repr(i, a, b) for (int i = (int)a; i > (int)b; i--)
#define all(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int infi = 1147483600;
const ll infl = 4e18 + 5;
const char ENDL = '\n';
//cout << fixed << setprecision(17) << res << endl;
const ll MOD = 998244353;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    rep(i,s.size()){
        if ((i%2 == 0) && (s[i]=='L')){
            cout << "No" << ENDL;
            return 0;
        }
        else if ((i&1) && (s[i]=='R')){
            cout << "No" << ENDL;
            return 0;
        }
    }
    cout << "Yes" << ENDL;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std;
#define int long long int
#define float double
#define pb push_back
#define FF first
#define SS second
#define N 200018
#define MOD 1000000007
#define fn(i,n) for(int i=0;i<n;i++)
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define pii pair<int,int>
#define mp make_pair
#define INF 1000000000000000000
#define speed ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)


signed main() 
{
    speed;
    //freopen("input.tXt","r",stdin);
    //freopen("output.tXt","w",stdout);

    int a,b,n;
    cin>>a>>b>>n;
    int c=min(n,b-1);
    cout<<(floor(a*c/b)-a*floor(c/b));
}   

Measured memory_bytes: 3764
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで
// g++ hoge.cpp -std=c++17 -I . でコンパイルできる
// -fsanitize=undefinedでオーバーフロー検出
#include <bits/stdc++.h>
#include <atcoder/all>

#define mod 1000000007
#define INF LLONG_MAX
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
using namespace atcoder;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;
//https://pyteyon.hatenablog.com/entry/2019/03/11/200000#Union-Find-%E6%9C%A8%E3%81%AE%E5%AE%9F%E8%A3%85
// union by size + path having
#include <bits/stdc++.h>
#define ll long long 
using namespace std;

//    UnionFind t(n+1);で初期化する!!!!!!!(n番目の値が入ってきたときにせぐふぉする)
class UnionFind {
public:
    vector <ll> par; // 各元の親を表す配列
    vector <ll> siz; // 素集合のサイズを表す配列(1 で初期化)

    // Constructor
    UnionFind(ll sz_): par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
        for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }

    // Member Function
    // Find
    ll root(ll x) { // 根の検索
        while (par[x] != x) {
            x = par[x] = par[par[x]]; // x の親の親を x の親とする
        }
        return x;
    }

    // Union(Unite, Merge)
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) { // 連結判定
        return root(x) == root(y);
    }

    ll size(ll x) { // 素集合のサイズ
        return siz[root(x)];
    }
};



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

    int a,b,c,d,m,n,maxi=0,f=0,mini=INF,sum=0;
    int k;
    int g,e;
    ll q;
    cin>>n>>q;
    UnionFind uf(n);
    ll x;
    rep(i,q){
        cin>>x;
        if(x){
            cin>>a>>b;
            if(uf.issame(a,b)) cout<<1<<endl;
            else cout<<0<<endl;
        }else{
            cin>>a>>b;
            uf.merge(a,b);
        }
    }

    return 0;
}


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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

int main(){

    string s;
    cin >> s;
    for(char c = 'a'; c <= 'z'; c++){
        if(s.find(c) == string::npos){
            cout << c << endl;
            return 0;
        }
    }
    cout << "None" << endl;

    return 0;
}

Measured memory_bytes: 3732
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,ans=0,maxx=1,minn=1e9,l[1000010],r[1000010];
struct Num{
	int x,y;
}a[1000010];
inline bool cmp(Num a,Num b){
	return a.x<b.x||(a.x==b.x&&a.y>b.y);
}
int main(){
	scanf("%d",&n);
	for(register int i=1;i<=n;i++){
		scanf("%d%d",&l[i],&r[i]);
		minn=min(minn,r[i]);
		maxx=max(maxx,l[i]);
	}
	for(register int i=1;i<=n;i++){
		ans=max(ans,max(minn-maxx+1,0)+r[i]-l[i]+1);
		a[i].x=r[i]-maxx+1;
		a[i].y=minn-l[i]+1;
	}
	sort(a+1,a+n+1,cmp);
	int res=a[1].y;
	for(register int i=2;i<=n;i++){
		ans=max(ans,a[i].x+res);
		res=min(res,a[i].y);
	}
	printf("%d",ans);
	return 0;
}

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

int main() {
    int N;
    cin >> N;
    vector<long long int> vec(5);
    for(int i=0; i<N; i++){
        string S;
        cin >> S;
        if(S.at(0)=='M') vec[0]++;
        if(S.at(0)=='A') vec[1]++;
        if(S.at(0)=='R') vec[2]++;
        if(S.at(0)=='C') vec[3]++;
        if(S.at(0)=='H') vec[4]++;
    }
    sort(vec.begin(), vec.end());
    reverse(vec.begin(), vec.end());

    if(vec[0]==0 || vec[1]==0 || vec[2]==0){
        cout << 0 << endl;
    }
    else if (vec[3]==0){
        cout << vec[0]*vec[1]*vec[2] << endl;
    }
    else if(vec[4]==0){
        cout << vec[0]*vec[1]*vec[2] + vec[0]*vec[1]*vec[3] + vec[0]*vec[3]*vec[2] + vec[3]*vec[1]*vec[2]<< endl;
    }
    else{
        long long int S=0;
        S += vec[2]*vec[3]*vec[4];
        S += vec[1]*vec[3]*vec[4];
        S += vec[1]*vec[2]*vec[4];
        S += vec[1]*vec[2]*vec[3];
        S += vec[0]*vec[3]*vec[4];
        S += vec[0]*vec[2]*vec[4];
        S += vec[0]*vec[2]*vec[3];
        S += vec[0]*vec[1]*vec[4];
        S += vec[0]*vec[1]*vec[3];
        S += vec[0]*vec[1]*vec[2];
        cout << S << endl;
    }
}

Measured memory_bytes: 256
#define ONLINE_JUDGE
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif	
	int n, k;
	cin >> n >> k;
	int a[n];
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}

	bool dp[k + 1];
	for(int i = 0; i <= k; ++i) {
		dp[i] = false;
	}
	for(int i = 1; i <= k; ++i) {
		for(int j = 0; j < n; ++j) {
			if(a[j] <= i){
				dp[i] = dp[i] || !dp[i - a[j]];
			} else break;
		}
	}
	cout << ((dp[k]) ? "First" : "Second") << endl;
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif	
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
char a[109][109];
int b[109][109];
int n,m;
int main()
{
    cin>>n>>m;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        cin>>a[i][j];
    for(int i=1;i<=n;i++)
    for(int j=1;j<=m;j++)
    {
        int sum=0;
        if(a[i][j]=='#')continue;
        if(a[i+1][j]=='#')sum++;
        if(a[i-1][j]=='#')sum++;
        if(a[i][j+1]=='#')sum++;
        if(a[i][j-1]=='#')sum++;
        if(a[i+1][j+1]=='#')sum++;
        if(a[i+1][j-1]=='#')sum++;
        if(a[i-1][j+1]=='#')sum++;
        if(a[i-1][j-1]=='#')sum++;
        b[i][j]=sum;
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            if(a[i][j]=='#')cout<<a[i][j];
        else cout<<b[i][j];
        }
        cout<<endl;
    }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();

        if(S.charAt(S.length() - 1) != 's') {
            System.out.print(S + "s");
        } else {
            System.out.print(S + "es");
        }
    }
}



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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    string s, t;
    cin >> s >> t;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end(), greater<>());
    cout << (t > s ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i = (a);i <= (b);i++)
#define pii pair<int,int>
#define pll pair<long long, long long>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
const int maxn = 3e5 + 5;
const int maxm = 1e6 + 5;
const double eps = 1e-8;
const double pi = acos(-1.0);
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);}
ll poww(ll x,ll y,ll p){ll ans = 1;while(y){if(y & 1) ans = ans * x % p;x = x * x % p;y >>= 1;}return ans % p;}
bool isp(ll x){if(x <= 1) return 0; for(ll i = 2;i * i <= x;i++){if(x % i == 0) return 0;}return 1;}
ll n,k,h[maxn];
int main(){
 	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> k;
	for(int i = 0;i < n;i++) cin >> h[i];
	sort(h,h+n,greater<ll>());
	if(k >= n) cout << 0 << endl;
	else{
		ll ans = 0;
		for(int i = k;i < n;i++) ans += h[i];
		cout << ans << endl; 
	}
 	return 0;
}
//do smt instead of nothing! never give up!
//take care of long long!
//take care of upper or lower case e.g "yes" or "YES"?
//boundary condition! e.g. n = 0?
//brute force is always the first choice!
// print the ans to look for patterns in the data!

Measured memory_bytes: 1792
N = int(input())
def func(X,n):
    if len(X) == N:
        return [X]
    ans = []
    for i in range(n):
        ans += func(X+chr(ord('a')+i),n)
    ans += func(X+chr(ord('a')+n) , n+1)

    return ans

for ans in func('a',1):
    print(ans)

Measured memory_bytes: 12676
from itertools import product

N, M = map(int, input().split())
S = []
for i in range(M):
    s = list(map(int, input().split()))
    k = s.pop(0)
    assert len(s) == k
    S.append(s)
P = list(map(int, input().split()))
assert len(P) == M

def on(s, p, onoff):
    return sum(onoff[i - 1] for i in s) % 2 == p

n = 0
for onoff in product(range(2), repeat=N):
    if all(on(s, p, onoff) for s, p in zip(S, P)):
        n += 1

print(n)


Measured memory_bytes: 3064
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
 
using namespace std;
typedef long long ll;
const ll INF = 1e18;

# define rep(i, n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(ll i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(ll i=((int)(n)); i>0; --i)
# define all(x) (x).begin(), (x).end()
# define pb push_back
 
ll N;

ll findSumOfDigits(ll n);
ll findSumOfDigits(ll n) {
  int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> N;
    
    ll sumOfDigits = findSumOfDigits(N);
    if (N%sumOfDigits == 0) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
int main()
{
  int a, b;
  scanf("%d %d", &a, &b);
  long min, max;
  if (a >= b)
  {
    min = b;
    max = a;
  }
  else
  {
    min = a;
    max = b;
  }
  long ans;
  int i;
  for (i = 1; (min * i) % max != 0; i++)
    ans = min * i;
  ans = min * i;
  printf("%ld", ans);
}


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

// main.cpp

int main() {
  std::int_fast64_t h, w;
  std::cin >> h >> w;
  std::array<std::array<std::int_fast64_t, 10>, 10> c;
  for (std::int_fast64_t i = 0; i < 10; ++i) {
    for (std::int_fast64_t j = 0; j < 10; ++j) {
      std::int_fast64_t c_ij;
      std::cin >> c_ij;
      c[i][j] = c_ij;
    }
  }

  for (std::int_fast64_t k = 0; k < 10; ++k) {
    for (std::int_fast64_t i = 0; i < 10; ++i) {
      for (std::int_fast64_t j = 0; j < 10; ++j) {
        c[i][j] = std::min(c[i][j], c[i][k] + c[k][j]);
      }
    }
  }

  std::int_fast64_t answer = 0;
  for (std::int_fast64_t i = 0; i < h; ++i) {
    for (std::int_fast64_t j = 0; j < w; ++j) {
      std::int_fast64_t a_ij;
      std::cin >> a_ij;
      if (a_ij > -1) {
        answer += c[a_ij][1];
      }
    }
  }

  std::cout << answer << std::endl;
  return 0;
}

Measured memory_bytes: 256
a, b, c = map(int, input().split())
k = int(input())
tf2 = True
while True:
  if b > a:
    break
  else:
    b *= 2
    k -= 1
    if k < 0:
      print("No")
      tf2 = False
      break
while tf2:
  if c > b:
    print("Yes")
    break
  else:
    c *= 2
    k -= 1
    if k < 0:
      print("No")
      break

Measured memory_bytes: 9180
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<ll> vl;
typedef vector<vector<int> > vvi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 7;
int main(){
    int a, b;
    cin >> a >> b;
    vb used(4, false);
    used[a] = true;
    used[b] = true;
    for(int i = 1; i <= 3; i++){
        if(used[i] == false){
            cout << i;
            return 0;
        }
    }   
}

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

#ifdef DEBUG
#define PRINT(x)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#x<<" = "<<(x)<<endl;
#define PRINTA(a,first,last)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<(first)<<", "<<(last)<<")"<<endl;\
    for (int i=(first);i<(last);++i){cout<<#a<<"["<<i<<"] = "<<(a)[i]<<endl;}
#else
#define PRINT(x)
#define PRINTA(a,first,last)
#endif

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

template <class T, class U> void amax(T& x, U y) {if (x < y) x = y;}
template <class T, class U> void amin(T& x, U y) {if (x > y) x = y;}

int main(void)
{
    int N;
    cin >> N;
    int posX = 0;
    int posY = 0;
    int bt = 0;
    while (N--) {
        int t, x, y;
        cin >> t >> x >> y;
        PRINT(t);
        PRINT(x);
        PRINT(y);
        int d = abs(x - posX) + abs(y - posY);
        PRINT(d);
        if (d <= (t - bt) && (t - bt - d) % 2 == 0) {
            // ok
        } else {
            cout << "No" << endl;
            return 0;
        }
        posX = x;
        posY = y;
        bt = t;
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
import math
N,D=map(int,input().split())
X=[]
for i in range(N):
    x=list(map(int,input().split()))
    X.append(x)
res=0
for i in range(N-1):
    for j in range(i+1,N):
        dist=0
        for d in range(D):
            dist+=(X[i][d]-X[j][d])**2
        dist=math.sqrt(dist)
        if dist==int(dist):
            res+=1
print(res)

Measured memory_bytes: 3064
#include<stdio.h>

int main()
{
   long long n,i,c=0;
   scanf("%lld",&n);
   for(i=1;i<=n;i++)
   {
       if(i%3==0 || i%5==0)
       {
           continue;
       }
       c+=i;
   }

    printf("%lld",c);

}


Measured memory_bytes: 1732
/* ex3_2 melo */
#include <stdio.h>
int main(void){
    int Number,onesplace;//整数の箱を二つ用意する
    scanf("%d",&Number);//本数を代入する
    onesplace = Number%10;//一の位の数を出す
    switch(onesplace){//連続したif文なのでswitch関数を使う
        case 2:case 4:case 5:case 7:case 9://onesplaceが2または4または5または7または9であった場合
        printf("hon\n");//honとよむ
        break;//swich{}から抜ける
        case 0:case 1:case 6:case 8://onesplaceが0,1,6,8のいずれかであった場合
        printf("pon\n");//ponとよむ
        break;//swich{}から抜ける
        case 3://onesplaceが3であった場合
        printf("bon\n");//bonとよむ
        break;//swich{}から抜ける
        default:fprintf(stderr, "unexpected Number value:%d¥n", Number);return 1;//他の場合errorを出す

    }
    return 0;
    

}

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



int main() {
  int N; cin >> N;
  int D,X; cin >> D >> X;
  int e = 0;
  for(int i=0;i<N;i++){
    int a; cin >> a;
    e += (D-1)/a + 1;
  }
  cout << X+e << endl;
}

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

#define int long long
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define fr(i,j,k) for(i = j; i < (k); i++)
#define all(x) x.begin(), x.end()
#define el '\n'
#define remax(a,b) a = max(a, b)
#define remin(a,b) a = min(a, b)
#define sz(x) int32_t(x.size())

typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpi;
// --------------------------------------------------------------------

const pii dxy[] = { {-1, 0}, {1, 0}, {0, 1}, {0, -1} };
const int mod = 1e9 + 7;
const int INF = mod;
const ld EPS = 1e-9;
const int MAXLOG = 80;
const int NN = 2e5 + 2;

int dp[NN][MAXLOG];

string to_string(string s) {
      return '"' + s + '"';
}
string to_string(const char* s) {
      return to_string((string) s);
}
string to_string(bool b) {
      return (b ? "true" : "false");
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
      return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
      bool first = true;  string res = "{";
      for (const auto &x : v) {
            if (!first) { res += ", "; }
            first = false; res += to_string(x);
      }
      res += "}";	  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
      cerr << " " << to_string(H);
      debug_out(T...);
}

// #define TRACE

#ifdef TRACE
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif
//============================================================================

void solve() {
	int i = 0, j = 0, k = 0, n = 0, m = 0, T;
	cin >> n >> T;
	vpi x(n);
	fr(i, 0, n) {
		cin >> x[i].fi>>x[i].se;
	}
	sort(all(x), [&](pii a, pii b) {
		int u = a.fi * (b.se + 1);
		int v = b.fi * (a.se + 1);
		if(u != v) {
		        return u > v;
		}
            return a.se < b.se;
	});
      debug("done");
	vi v;
	fr(i, 0, n) {
		for(j = 1; j < MAXLOG; j++) {
			// i = 0
			if(i == 0) {
				dp[i][j] = j == 1 ?  x[0].fi + x[0].se + 1 : INF;
				continue;
			}
			if(x[i].fi == 0) {
				v.pb(1 + x[i].se);
				break;
			}
			dp[i][j] = dp[i - 1][j - 1] + 1 + (dp[i - 1][j - 1] + 1) * x[i].fi + x[i].se;
			remin(dp[i][j], dp[i - 1][j]);
			remin(dp[i][j], INF);
		}
	}
      debug("done");
	int ans = 0, s = 0;
	k = sz(v);
	for(i = 0; i < k; i++) {
		s += v[i];
		v[i] = s;
	}
      debug(v);
	for(j = 0; j < MAXLOG; j++) {
		if(dp[n - k - 1][j] <= T) {
			int t = dp[n - k - 1][j], a = j;
			if(k > 0 and v[0] <= T-t) {
				a    += (upper_bound(all(v), T - t) - v.begin());
			}
			remax(ans, a);
		}
	}

	cout << ans << el;
}

int32_t main() {
	ios::sync_with_stdio(false); cin.tie(0);
	int T = 1;
	// cin >> T;
	for(int tc = 1; tc <= T; tc++) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 128384
#include <bits/stdc++.h>
#define maxn 500086

using namespace std;

struct Node{
	int sum, id;
}t[maxn << 2];

#define ls(x) (x << 1)
#define rs(x) (x << 1 | 1)

inline void up(int x){
	t[x].sum = max(t[ls(x)].sum, t[rs(x)].sum);
	t[x].id = t[x].sum == t[ls(x)].sum ? t[ls(x)].id : t[rs(x)].id;
}

void del(int x, int l, int r, int pos){
	if(l == r){
		t[x].sum = -1e9;
		return;
	}
	int mid = l + r >> 1;
	if(mid >= pos) del(ls(x), l, mid, pos);
	else del(rs(x), mid + 1, r, pos);
	up(x);
}

Node query(int x, int l, int r, int ll, int rr){
	if(ll <= l && r <= rr) return t[x];
	int mid = l + r >> 1;
	if(mid < ll) return query(rs(x), mid + 1, r, ll, rr);
	if(mid >= rr) return query(ls(x), l, mid, ll, rr);
	Node a = query(ls(x), l, mid, ll, rr), b = query(rs(x), mid + 1, r, ll, rr);
	return (Node){max(a.sum, b.sum), a.sum > b.sum ? a.id : b.id};
}

int a[maxn];

void build(int x, int l, int r){
	if(l == r){
		t[x].sum = a[l], t[x].id = l;
		return;
	} 
	int mid = l + r >> 1;
	build(ls(x), l, mid), build(rs(x), mid + 1, r);
	up(x);
}

int n, k;
int ans[maxn];
bool inq[maxn];
priority_queue<int> q;

int main(){
	scanf("%d%d", &n, &k), k--;
	for(int i = 1;i <= n;i++) scanf("%d", &a[i]);
	build(1, 1, n);
	for(int i = 1;i <= n;i++) if(query(1, 1, n, max(1, i - k), min(n, i + k)).id == i) q.push(i), inq[i] = true;
	for(int i = n;i;i--){
		int x = q.top();q.pop();
		ans[x] = i;
		del(1, 1, n, x);
		if(!k) continue;
		Node node = query(1, 1, n, max(1, x - k), max(1, x - 1));
		if(node.sum > 0){
			int id = node.id;
			if(!inq[id] && query(1, 1, n, max(1, id - k), min(n, id + k)).id == id) q.push(id), inq[id] = true;
		}
		node = query(1, 1, n, min(n, x + 1), min(n, x + k));
		if(node.sum > 0){
			int id = node.id;
			if(!inq[id] && query(1, 1, n, max(1, id - k), min(n, id + k)).id == id) q.push(id), inq[id] = true;
		}
	}
	for(int i = 1;i <= n;i++) printf("%d\n", ans[i]);
}

Measured memory_bytes: 18516
#include <iostream>
#include <string>
#include <iomanip>
#include <stdlib.h>
using namespace std;
int main(){
    int h,w;
	while(true){
	cin>>h>>w;
	if(h==0&&w==0)
		break;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(i==0||j==0||i==h-1||j==w-1)
				cout<<"#";
			else
				cout<<".";
		}
		cout<<endl;
	}
	cout<<endl;
	}
	return 0;
}

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

graph = [[False for j in range(N)] for i in range(N)]

am = [0] * M
bm = [0] * M


def judge(visited):
    for v in visited:
        if not v:
            return True
    else:
        # 完走 橋ではない
        return False


def dfs(visited, n):
    visited[n] = True

    for k, v in enumerate(graph[n]):
        if not v:
            continue

        if visited[k]:
            continue

        visited = dfs(visited, k)

    return visited


def main():
    for i in range(M):
        # 0-indexed
        ai, bi = map(int, input().split())
        ai -= 1
        bi -= 1

        am[i] = ai
        bm[i] = bi

        graph[ai][bi] = True
        graph[bi][ai] = True

    ans = 0

    for ai, bi in zip(am, bm):
        graph[ai][bi] = False
        graph[bi][ai] = False

        # 訪問済 All False
        visited = dfs([False] * N, 0)

        if judge(visited):
            ans += 1

        # 元に戻す
        graph[ai][bi] = True
        graph[bi][ai] = True

    print(ans)
    return


main()


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

#define vt          vector
#define sz(x)       int((x).size())
#define all(x)      (x).begin(), (x).end()
#define rall(x)     (x).rbegin(), (x).rend()
#define fi          first
#define se          second

using ll = long long;
using pii = pair<int, int>;

void solve() {
    int k, x;
    cin >> k >> x;
    cout << (500 * k >= x ? "Yes" : "No");
}

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

    int tcs = 1;
    for (int tc = 1; tc <= tcs; tc++) {
        // cout << "Case " << tc << ": ";
        solve();
    }
}


Measured memory_bytes: 3620
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		
		System.out.println((a*b) + " " + (2*(a+b)) );
	}
}

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

typedef long long       ll;

int n, freq[4009][3];
string s;

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

    cin >> n >> s;
    s.insert(0, 1, '*');
    for (int i=n; i>=1; --i) {
        if (s[i]=='R')          ++freq[i][0];
        else if (s[i]=='G')     ++freq[i][1];
        else                    ++freq[i][2];

        for (int j=0; j<3; ++j) {
            freq[i][j]+=freq[i+1][j];
        }
    }

    ll ans=0;
    for (int i=1; i<=n; ++i) {
        for (int j=i+1; j+1<=n; ++j) {
            if (s[j]==s[i]) {
                continue;
            }

            char need='R';
            int id=0;
            if (s[i]=='R' || s[j]=='R') {
                need='G';
                id=1;
                if (s[i]=='G' || s[j]=='G') {
                    need='B';
                    id=2;
                }
            }

            int cnt=freq[j+1][id];
            int dist=j-i;
            if (dist+j<=n && s[dist+j]==need) {
                --cnt;
            }

            ans+=cnt;
        }
    }

    cout << ans;

    return 0;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
# define mod 1000000007
# define INF (1 << 29)
# define MAX_N 1000010
/* ACはうれCすぎてうれD */


int main(void){ 
    int x, y, z, k;
    cin >> x >> y >> z >> k;
    vector<ll> A;
    vector<ll> B;
    vector<ll> C;
    for(int i=0; i<x; i++){
        ll tmp_a;
        cin >> tmp_a;
        A.push_back(tmp_a);
    }
    for(int i=0; i<y; i++){
        ll tmp_b;
        cin >> tmp_b;
        B.push_back(tmp_b);
    }
    for(int i=0; i<z; i++){
        ll tmp_c;
        cin >> tmp_c;
        C.push_back(tmp_c);
    }

    // sort
    sort(C.begin(), C.end(), greater<ll>());

    vector<ll> AB;
    for(int i=0; i<x; i++){
        for(int j=0; j<y; j++){
            ll tmp_ab = A[i] + B[j];
            AB.push_back(tmp_ab);
        }
    }
    sort(AB.begin(), AB.end(), greater<ll>());

    // k^2個(このくらいのサイズで考えればok)
    // i j の上限を k しか考えてなかったね
    // minの比較かた合わせる

    int a = AB.size();
    int c = C.size();
    vector<ll> top;
    for(int i=0; i < min(k, a); i++){
        for(int j=0; j < min(k, c); j++){
            ll tmp_sum = AB[i] + C[j];
            top.push_back(tmp_sum);
        }
    }

    // sort K^2 logK
    sort(top.begin(), top.end(), greater<ll>()); // ~~sortしてなぜ over flow...~~


    for(int i=0; i<k; i++){
        cout << top[i] << "\n";
    }

    return 0;
}

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

using namespace std;

int main(){
    int n,x;
    cin >> n >> x;
    vector<int> a;
    for(int i = 0;i < n;i++){
        int t;
        cin >> t;
        a.push_back(t);
    }
    sort(a.begin(),a.end());
    int ans = 0;
    for(int i = 0;i < n;i++){
        if(x >= a[i]){
            if(i == n-1 && (a[i] != x))break;
            x-=a[i];
            ans++;
        }else{
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

typedef long long ll;

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

int main(){

	ll A,B;
	cin >> A >> B ;

	ll gcd = GCD(A,B);
	//cout << gcd << endl;
	ll count =1;

	for (ll i =2; i*i <= gcd; i++){
		if (gcd % i != 0) continue;

		while(gcd % i == 0){
			gcd/= i; 
		}
		count++;
	}
	if (gcd != 1)
	{
		count++;
	}

	cout << count << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
#define fi first
#define se second
#define pb push_back
#define mp make_pair
 
#define all(x) (x).begin() , (x).end()
#define rall(x) (x).rbegin() , (x).rend()
 
#define pii pair<LL,LL>
#define mem(v, x) memset(v, x, sizeof v)
 
#define si(x) scanf("%d", &x)
#define sii(x, y) scanf("%d %d", &x, &y)
#define siii(x, y, z) scanf("%d %d %d", &x, &y, &z)
 
#define sf(x) scanf("%lf", &x)
#define endl '\n'

#define FOR(i , N) for(int i = 0  ; i < N ; i++)
#define FOR1(i , N) for(int i = 1  ; i <= N ; i++)

template <typename T> T six(T &n){n = 0;bool neg = false;char c = getchar();while( c < '0' || c > '9'){if(c == '-') neg = true;c = getchar();}while(c >= '0' && c <= '9'){n = n*10 + c-48;c = getchar();}if(neg) n = ~(n-1);return n;}

using namespace std;
 
typedef long long LL;
 
int SET(int N,int pos){return N=N | (1<<pos);}
int RESET(int N,int pos){return N= N & ~(1<<pos);}
bool CHECK(int N,int pos){return (bool)(N & (1<<pos));}


LL N, k;
LL arr[100001];
LL dp[100001];

LL go(LL to, LL k , LL val) {
   LL mn = LLONG_MAX;
   for(LL cnt = 1 ; cnt <= k && to >= 0; cnt++, to--) {
      mn = min(mn , dp[to] + abs(val - arr[to]));
   }
   return mn;
}

int main()
{

#ifndef ONLINE_JUDGE // dont use this in toph/codemarshal
    //freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
#endif
    six(N), six(k);
    FOR(i , N) {
      six(arr[i]);
    } 

    FOR(i , N) {
      if(i == 0) dp[i] = 0;
      else dp[i] = go(i - 1, k, arr[i]);
    }
    printf("%lld\n", dp[N - 1]);
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
typedef long long ll;
using namespace std;

int main(){
  int N,K;
  cin >> N >> K;
  vector<ll> x(N);
  for(int i = 0; i < N; i++) cin >> x[i];
  ll res = 1LL << 60;
  for(int i = 0; i < N-K+1; i++){
    ll left = x[i];
    ll right = x[i+K-1];
    res = min(res, min(abs(left), abs(right)) + right - left);
  }
  cout << res << endl;
    
}


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

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, s, e) for(ll i=s; i>=e; i--)
#define reps(i, s, e) for(ll i=s; i<=e; i++)
#define inf 1e18
#define all(v) v.begin(),v.end()
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
void ans(bool b){ cout << (b ? "Yes" : "No") << endl; }
void ans2(bool b){ cout << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill((T*)array, (T*)(array+N), val);
}
template<typename T> void vdeb(T v){
    cout << "#vector set debug" << endl;
    for(auto vv : v) cout << vv << " ";
    cout << endl;
}
template<typename T1, typename T2> void adeb(T1 arr[], T2 n){
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}
template<typename T1> void mdeb(T1 mp){
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};


class ARoundOne {
public:
	void solve(std::istream& in, std::ostream& out) {
        int a, b;
        in >> a >> b;

        map<int, int> mp;
        mp[a]++;
        mp[b]++;

        if(mp[1] == 0) out << 1 << endl;
        if(mp[2] == 0) out << 2 << endl;
        if(mp[3] == 0) out << 3 << endl;
	}
};


int main() {
	ARoundOne solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 

//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val
 
using namespace std;
using namespace __gnu_pbds;
 	// find_by_order()  // order_of_key
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inff (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
#define flush fflush(stdout) 
#define primeDEN 727999983
#define SPEED ios_base::sync_with_stdio(false) ;cin.tie(NULL) ;cout.tie(NULL) ;
#define fp(i,a,n) for(ll i=n-1; i>a ;i--)
#define deb(x) cout << #x << " ---> " << x << endl;
#define X first
#define Y second
#define pia 3.1415926536
#define mod 1000000007
#define N 100005
#define ml map<ll,ll>
#define mll map<pll,ll>
#define letsh(a,b) (a<<b)
#define rigsh(a,b) (a>>b)
 #define vvl vector<vl>
mt19937 rng32(chrono::steady_clock::now().time_since_epoch().count()) ;
		ll lcm(ll a, ll b){
               return a / __gcd(a, b) * b;
       }
	   bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
} 	   

       ll power(ll a,ll n)
	   {
        ll ans=1;
        while(n)
		{
        if(n&1) ans=(ans*a)%mod;
        a=(a*a)%mod ;
        n=n>>1;
   		 }
   		 return ans;
      }
      ll power2(ll a,ll n)
      {
      	ll ans =1 ;
      	while(n)
      	{
      		if(n&1) ans =(ans*a) ;
      		a = (a*a) ;
      		n =n>>1 ;
		  }
		  return ans ;
	  } 
	  void p1(ll x,ll y)
	  {
	  cout<<x<<" "<<y<<endl ; 	
	  }
	  void p2(ll x,ll y)
	  {
	  	cout<<x<<" "<<y<<" " ;
	  }
  vvl dir({{1, 0}, {-1, 0}, {0, 1}, {0, -1}});
  
  void solve()
  {
  	ll n,x,t ;cin>>n>>x>>t ;
  	ll cur =0 ;
  	if(n%x !=0) cur++ ;
  	cout<<(n/x)*t +cur*t<<endl ;
  	
  }
  int main() 
  	{
  		SPEED
  		ll t =1 ;
  		while(t--) solve() ;  
   	}
   	

Measured memory_bytes: 3660
//B TAKOYAKI FESTIVAL 2019
#include "bits/stdc++.h"
using namespace std;

int main()
{
  int n,x,y,z,ans;
  cin>>n;
  x=0;
  z=0;
  vector<int> vec(n);
  for(int i=0;i<n;i++)
  {
    cin>>vec.at(i);
    x=x+vec.at(i);
  }
  y=x*x;
  for(int i=0;i<n;i++)
  {
    z=z+vec.at(i)*vec.at(i);
  }
  ans=(y-z)/2;
  cout<<ans<<endl;
}


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

using namespace std;
const double PI = (acos(-1));
const long long MOD = pow(10, 9) + 7;
long long kaizyou(int N);
long long POW(int J);

bool judge(int dt, int dx, int dy);

int main()
{
    int A,P;
    cin >> A >> P;

    P+= 3*A;
    int num =P/2;
    
    cout << num;
}


Measured memory_bytes: 3596
n,k = map(int,input().split())
ans = {}
for i in range(k):
    di=int(input())	
    li = list(map(int,input().split()))
    for l in li:
        ans[str(l)] = "0"
count = 0
for i in range(1,n+1):
    if str(i) not in ans.keys():
        count += 1
print(count)

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

namespace ConsoleApplication2
{
    class Program
    {
        static int[] TakeTwoNumbers(Stack<string> st)
        {
            return new int[] { int.Parse(st.Pop()), int.Parse(st.Pop()) };
        }

        static void Calculate(Stack<string> st, string op)
        {
            var operands = TakeTwoNumbers(st);
            var lhs = operands[1];
            var rhs = operands[0];
            switch (op)
            {
                case "+":
                    st.Push((lhs + rhs).ToString());
                    break;
                case "-":
                    st.Push((lhs - rhs).ToString());
                    break;
                case "*":
                    st.Push((lhs * rhs).ToString());
                    break;
            }
        }

        static void Main(string[] args)
        {
            var inputLine = Console.ReadLine().Split();
            var intStack = new Stack<string>();
            foreach (var s in inputLine)
            {
                switch (s)
                {
                    case "+":
                    case "-":
                    case "*":
                        Calculate(intStack, s);
                        break;
                    default:
                        intStack.Push(s);
                        break;
                }
            }
            Console.WriteLine(intStack.Pop());
        }
    }
}

Measured memory_bytes: 16244
import java.util.Scanner;

public class Main {
	static int r = 0;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int D = sc.nextInt();
		int[][] X = new int[N][D];
		for(int i = 0; i < N; i++) {
			for(int j = 0; j < D; j++) {
				X[i][j] = sc.nextInt();
			}	
		}
		sc.close();
		for(int i = 0; i < N; i++) {
			for(int j = i + 1; j < N; j++) {
				solve(D, X, i, j);
			}
		}
		System.out.println(r);
	}
	
	static void solve(int D, int[][] X, int idx1, int idx2) {
		int sum = 0;
		for(int i = 0; i < D; i++) {
			int yx = Math.abs(X[idx1][i] - X[idx2][i]);
			sum += yx * yx;
		}
		double sqrt1 = Math.sqrt(sum);
		int sqrt2 = (int)sqrt1;
		if(sqrt1 == (double)sqrt2) r++;
		// System.out.println("# " + (sqrt1 == (double)sqrt2) + " = " + sum + " : " + sqrt1 + " " + sqrt2);
	}
}	


Measured memory_bytes: 23252
A, B = map(int, input().split())

def f(X):
  a = 1
  temp = 2
  ret = []
  while a > 0:
    a, b = divmod(X+1, temp)
    if temp == 2:
      ret.append(a%2)
    else:
      ret.append(max(b-(temp//2), 0)%2)
    temp *= 2
  return "".join(map(str, reversed(ret)))

print(int(f(max(0, A-1)), 2)^int(f(B), 2))

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

#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	TEST(freopen("input.txt","r",stdin));
	TEST(freopen("output.txt","w",stdout));
	TEST(freopen("debug.txt","w",stderr));
	int X;
	cin>>X;
	for(int i=1;i<=360;i++) if((X*i)%360==0) {
		cout<<i<<'\n';
		break;
	}
	return 0;
}

Measured memory_bytes: 3600
// -*- coding:utf-8-unix -*-

use proconio::input;

fn main() {
    input! {
        k: u32,
        n: u32,
        a: [u32; n],
    }

    let mut vd: Vec<u32> = Vec::with_capacity(n as usize);
    for i in 0.. n - 1 {
        vd.push(a[(i + 1) as usize] - a[i as usize]);
    }
    vd.push(k + a[0] - a[(n - 1) as usize]);
    vd.sort();
    let ans = k - vd.last().unwrap();
    println!("{}", ans);
}


Measured memory_bytes: 5404
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<complex>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#include <numeric>
using namespace std;
using Complex = complex<double>;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1145141919810364364LL;
double PI = acos(-1.0);
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)

void err() {
	puts("No");
	exit(0);
}

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

	int N;
	cin >> N;
	vector<pair<int, int>>v1, v2;
	int h = 0;
	for (int i = 0; i < N; i++) {
		string s;
		cin >> s;
		int sum = 0;
		int mi = 0;
		for (int j = 0; j < s.size(); j++) {
			sum += (s[j] == '(')?1:-1;
			mi = min(sum,mi);
		}
		h += sum;
		if (sum > 0) { v1.pb({mi,sum}); continue; }

		sum = 0, mi = 0;
		reverse(all(s));
		for (int j = 0; j < s.size(); j++) {
			sum += (s[j] == ')') ? 1 : -1;
			mi = min(sum, mi);
		}
		v2.pb({mi,sum});
	}

	if (h != 0)err();

	sort(all(v1));
	reverse(all(v1));
	sort(all(v2));
	reverse(all(v2));

	int z = 0;
	for (int i = 0; i < v1.size(); i++) {
		if (v1[i].first + z < 0)err();
		z += v1[i].second;
	}

	z = 0;
	for (int i = 0; i < v2.size(); i++) {
		if (v2[i].first + z < 0)err();
		z += v2[i].second;
	}
	puts("Yes");
	
	return 0;
}

Measured memory_bytes: 11468
n = int(input())

if n < 10:  # < 10^1
    # 1-n
    print(n)

elif n < 100:  # < 10^2
    # 1-9
    print(9)

elif n < 1000:  # < 10^3
    # 1-9, 100-n
    print(n-99+9)

elif n < 10000:  # < 10^4
    # 1-9, 100-999
    print(9+900)

elif n < 100000:  # < 10^5
    # 1-9 + 100-999 + 10000-n
    print(n-9999+900+9)

else:  # == 10^5
    # 1-9 + 100-999 + 10000-90000
    print(9+900+90000)


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
 long long gcd(long long a, long long b) {
	if (a > b) return gcd(b, a);
	return a == 0 ? b : gcd(b % a, a);
    }
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
   

	int N;
	cin >> N;
	long long a, b;
	cin >> a;
	for (int i = 0; i < N - 1; i++) {
		cin >> b;
        long long c= gcd(a,b);
		a = (a/c)*b;
	}
	cout << a << endl;
	return 0;
}

Measured memory_bytes: 256
n,m=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
mod=10**9+7

ans1=0
for k in range(1,n+1):
    ans1+=(2*k-1-n)*X[k-1]
    ans1%=mod
ans2=0
for k in range(1,m+1):
    ans2+=(2*k-1-m)*Y[k-1]
    ans2%=mod
print(ans1*ans2%mod)

Measured memory_bytes: 24356
#include <algorithm>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <vector>
using namespace std;

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

const int INF = 0x3f3f3f3f, MOD = 1000000007;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
/*-----------------------------------------*/
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  string s; cin >> s;
  int n = s.length();
  sort(ALL(s));
  s.erase(unique(ALL(s)), s.end());
  cout << (s.length() < n ? "no\n" : "yes\n");
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>



int main()
{
    std::string S;
std::cin >> S;
    bool flag=0;
    if(S.length()%2==0){
    for(long i=0; i<S.length(); i+=2){
        if(S[i]!='h' || S[i+1]!='i'){
            flag=1;
            break;
        }
    }
    }else{
        flag=1;
    }
    if(flag){
        std::cout << "No" << std::endl;
    }else{
        std::cout << "Yes" << std::endl;
    }
    return 0;
}

Measured memory_bytes: 256