akhauriyash/Code-Regression huggingface dataset:
import sys
import itertools

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    n = int(input())
    f = [list(map(int, input().split())) for _ in range(n)]
    p = [list(map(int, input().split())) for _ in range(n)]
    ans = -(10 ** 12)
    for i in range(1, 11):
        num = list(itertools.combinations(range(10), i))
        for j in range(len(num)):
            cnt = [0] * n
            cnt2 = 0
            for k in range(i):
                for l in range(n):
                    if f[l][num[j][k]] == 1:
                        cnt[l] += 1
            for k in range(n):
                cnt2 += p[k][cnt[k]]
            ans = max(cnt2, ans)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9336
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;

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

    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;

    int overlap = 0;
    int ptr = 0;
    rep(i, n){
        if(s[i] == t[ptr]){
            ++overlap;
            ++ptr;
        }
        else{
            overlap = 0;
            ptr = 0;
            if(s[i]==t[ptr]){
                ++overlap;
                ++ptr;
            }
        }
    }
    cout << 2*n - overlap << endl;

    return 0;
}

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

int main()
{
	int n;

	cin >> n;

	while (n > 0) {
		int a[4];
		a[0] = n / 1000;
		a[1] = (n % 1000) / 100;
		a[2] = (n % 100) / 10;
		a[3] = n % 10;

		if (a[0] == a[1] && a[0] == a[2] && a[0] == a[3])
			cout << "NA" << endl;
		else {
			int t = 0;

			while (n != 6174) {
				a[0] = n / 1000;
				a[1] = (n % 1000) / 100;
				a[2] = (n % 100) / 10;
				a[3] = n % 10;
				sort(a, a + 4);
				n = (a[3] - a[0]) * 999 + (a[2] - a[1]) * 90;
				t++;
			}

			cout << t << endl;
		}

		cin >> n;
	}

	return 0;
}


Measured memory_bytes: 3148
#include<bits/stdc++.h>
#include<string>
using namespace std;
string a, b;
int main(){
  cin >> a >> b;
  int c = stoi(a + b);
  for(int i = 1; i <= 1000; ++i){
    if(i*i == c) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
const ll mod = 1e9 + 7;

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

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int i, j;
    ll h,w,m;
    cin >> h >> w >> m;
    set<P> s;
    VI a(303030,0),b(303030,0);
    ll ma = 0;
    ll mb = 0;
    for(i=0;i<m;i++){
        int x,y;
        cin >> x >> y;
        a[x]++;
        b[y]++;
        chmax(ma,a[x]);
        chmax(mb,b[y]);
        s.insert(P(x,y));
    }
    VI va,vb;
    for(i=0;i<303030;i++){
        if(a[i]==ma) va.pb(i);
    }
    for(i=0;i<303030;i++){
        if(b[i]==mb) vb.pb(i);
    }
    for(int ca: va){
        for(int cb:vb){
            if(s.find(P(ca,cb)) == s.end()) {
                cout<<ma + mb << endl;
                return 0;
            }
        }
    }
    cout<<ma +mb-1 << endl;

}

Measured memory_bytes: 35048
$debug = false
flag = ARGV.shift
if flag == "-d"
  $debug = true
end

def dputs str
  p str if $debug
end

def max(n, m)
  if n > m
    return n
  else
    return m
  end
end

def min(n, m)
  if n < m
    return n
  else
    return m
  end
end

def gets_all_int
  return gets.chomp.split.map{|v| v.to_i}
end

## start

N = gets_all_int[0]
Hs = gets_all_int

dputs N
dputs Hs

cnt = 0
max = 0
1.upto(N-1) do |n|
  dputs "#{Hs[n] <= Hs[n-1]} max =#{max}"
  if Hs[n] <= Hs[n-1]
    cnt += 1
    dputs "move #{cnt}"
    if max < cnt
      max = cnt
    end
  else
    dputs "cant move #{cnt}"
    if max < cnt
      max = cnt
    end
    cnt = 0
  end
end

puts max

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

int main(){
    int N;
    cin >> N;
    int T;
    int A;
    cin >> T >> A;
    int h;
    int min = 1<<30;
    int index = 0;
    for (int i=1; i <= N; i++){
        cin >> h;
        int d = (1000*T - (h*6)) - A*1000;
        if (d<0) d = -d;
        if (min>d) min=d, index=i;
    }
    cout << index << endl;
    
}

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

const int maxn = 200000+5;
int data[maxn]={0};
typedef long long ll;

int main()
{
    ll sum=0;
    int N;
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>data[i];
        sum+=data[i];
    }
    ll num=data[0];
    ll cnt=0;
    ll ans=0;
    ll tmp=num;
    ll cnt1=sum-tmp;
    ans=abs(tmp-cnt1);
    for(int i=1;i<N-1;i++){
        tmp=num;
        cnt1=sum-tmp;
        num+=data[i];
        cnt=sum-num;
        if(ans>abs(num-cnt)){
            ans=abs(num-cnt);
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define DEBUG(x) cout << #x << " = " << x << endl
#define pb push_back
using namespace std;
typedef long long ll;


const int MAXN = 1005;
string s[MAXN];
int cnt_row[MAXN];
int cnt_col[MAXN];
int main()
{
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> s[i];
    }




    bool flag = false;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (s[i][j] == '#') flag = true;
            if(s[i][j] == '#') cnt_row[i]++;
            if(s[j][i] == '#') cnt_col[i]++;
        }
    }

    if (!flag)
    {
        cout << -1; return 0;
    }

    int ans = 2*n;

    for (int i = 0; i < n; i++)
        if (cnt_col[i] == n) ans--;

    int mx = 0;
    for (int i = 0; i < n; i++)
    {
        int res = cnt_row[i];
        if (cnt_col[i] == 0) res--;
        mx = max(mx, res);
    }

    ans -= mx;

    cout << ans;


    return 0;
}




Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main(){
  int64_t n,m,count=0,cnt=0;
  cin >> n >> m;
  int64_t a[m],sum[n],c[n];
  vector<string> b(m);
  for(int64_t i=0;i<n;i++){
    sum[i]=0;
    c[i]=0;
  }
  for(int64_t i=0;i<m;i++){
    cin >> a[i] >> b[i];
  }
  for(int64_t i=0;i<m;i++){
    if(b[i]=="WA")c[a[i]-1]++;
    if(sum[a[i]-1]==0 && b[i]=="AC"){
      sum[a[i]-1]=1;
      count++;
      cnt+=c[a[i]-1];
    }
  }
  cout << count << " " << cnt << endl;
}
    
      

Measured memory_bytes: 8708
#include<bits/stdc++.h>
#define rep(i,a,b) for (int i=(a); i<=(b); i++)
#define per(i,a,b) for (int i=(a); i>=(b); i--)
using namespace std;
typedef long long LL;

inline int read() {
    int x=0,f=1; char ch=getchar();
    while (!(ch>='0'&&ch<='9')) {if (ch=='-')f=-1;ch=getchar();}
    while (ch>='0'&&ch<='9') {x=x*10+(ch-'0'); ch=getchar();}
    return x*f;
}

const int N = 200005;

int n,pre[N];
int num[26][N];
int T;
char s[N];
LL l,r;

LL Calc(int c,LL lim) {
	if (lim<=n) return num[c][lim];
	LL l1=T,l2=n; LL sum1=num[c][T],sum2=num[c][n];
	while (lim>l1+l2) {
		l1+=l2,sum1+=sum2;
		swap(l1,l2); swap(sum1,sum2);
	}
	return sum2+Calc(c,lim-l2);
}

int main() {

	#ifndef ONLINE_JUDGE
	//	freopen("data.in","r",stdin);
	//	freopen("data.out","w",stdout);
	#endif

	scanf("%s",s+1); scanf("%lld%lld",&l,&r);
	n=strlen(s+1)/2;
	
	pre[1]=0; int k=0;
	rep(i,2,n) {
		while (k&&s[k+1]!=s[i]) k=pre[k];
		if (s[k+1]==s[i]) k++;
		pre[i]=k;
	} T=n-pre[n];
	
	rep(i,1,n) {
		rep(j,0,25) num[j][i]=num[j][i-1];
		num[s[i]-'a'][i]++;
	}
	
	rep(i,0,25) {
		printf("%lld",Calc(i,r)-Calc(i,l-1));
		if (i!=25) putchar(' '); else puts("");
	}

	return 0;
}


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

struct Card { char suit; int value;};

void selectionsort(struct Card A[], int N) {

  for (int i = 0; i< N; i++) {

    int minj = i;

    for (int j = i; j < N; j++) {

      if (A[j].value < A[minj].value) minj = j;
    }

    swap(A[i], A[minj]);
  }
  
}

void bubblesort(struct Card A[], int N) {
  int flag = 1;

  while (flag) {
    flag = 0;
    for (int i = N-1; i > 0; i--) {
      if (A[i].value < A[i-1].value) {
	swap(A[i], A[i-1]);
	flag = 1;
      }
    }
  }
}


void print(struct Card A[], int N) {
  for (int i = 0; i < N; i++) {

    if (i != N-1) cout << A[i].suit << A[i].value << " ";
    else cout << A[i].suit << A[i].value << endl;
  }
}

bool isstable(struct Card A[], struct Card B[], int N) {

  for(int i = 0; i < N; i++) {
    if (A[i].suit != B[i].suit) return false;
  }
  return true;
}


int main() {

  Card C1[100], C2[100];
  int N;

  cin >> N;

  for (int i=0; i < N; i++) {
    cin >> C1[i].suit >> C1[i].value;
  }

  for (int i = 0; i < N; i++) C2[i] = C1[i];

  bubblesort(C1, N);
  selectionsort(C2, N);

  print(C1, N);
  cout << "Stable" << endl;

  print(C2, N);
  if (isstable(C2, C1, N)) cout << "Stable" << endl;
  else cout << "Not stable" << endl;

  return 0;
}

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

int main(){

    double n,m,a,b;
    int k=0;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>a>>b;
        double c=sqrt(a*a+b*b);
        if(c<=m)
            k++;
    }
    cout<<k<<endl;
    return 0;
}


Measured memory_bytes: 3728
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout<<(ans)<<endl
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
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;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);};};
const ll MOD = 1000000007;
const int INF = INT_MAX;
const ll LLINF = 1LL<<62;

vvi v(1000010);
map<pair<int,int>,int> ans;

struct Corr{
    int pos;
    int bef;
};
queue<Corr> q;
void bfs(){
    while(!q.empty()){
        Corr now=q.front();q.pop();
        int color=0;
        for(int i=0;i<v[now.pos].size();i++){
            int nextpos=v[now.pos][i];
            if(ans.find(mp(min(now.pos,nextpos),max(now.pos,nextpos)))!=ans.end())continue;
            if(color==now.bef)color++;
            ans[mp(min(now.pos,nextpos),max(now.pos,nextpos))]=color;
            Corr c={nextpos,color};
            q.push(c);
            color++;
        }
    }
}

int main(void) {

    int n;
    cin>>n;
    int a,b;
    vpii edge(n);
    rep(i,n-1){
        cin>>a>>b;
        a--;b--;
        if(a>b)swap(a,b);
        edge[i]=mp(a,b);
    }
    map<int,int> m;
    rep(i,n-1){
        m[edge[i].first]++;
        m[edge[i].second]++;
        v[edge[i].first].push_back(edge[i].second);
        v[edge[i].second].push_back(edge[i].first);
    }
    int start=0;
    int maxnum=0;
    for(auto it=m.begin();it!=m.end();it++){
        if(it->second>maxnum){
            maxnum=it->second;
            start=it->first;
        }
    }
    Corr c={start,-1};
    q.push(c);
    bfs();

    vi ansvec(n-1);


    for(int i=0;i<n-1;i++){
        int mi=min(edge[i].first,edge[i].second);
        int ma=max(edge[i].first,edge[i].second);
        ansvec[i]=ans[mp(mi,ma)]+1;
    }
    set<int> s;
    rep(i,n-1)s.insert(ansvec[i]);
    cout<<s.size()<<endl;
    for(int i=0;i<n-1;i++){
        cout<<ansvec[i]<<endl;
    }
}


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

int compare(int X, int A){
    int result;
    
    if (X < A) {
        result = 0;
    } else {
        result = 10;
    };
      
    
    return result;
}

int main(void){
    // Your code here!
    int X, A;
    cin >> X >> A;
    
    cout << compare(X, A) << endl;
}

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

int main() {
    int n,k;
    string s;
    cin >> n >> k >> s;

    if (s[k-1] == 'A') {
        s[k-1] = 'a';
    } else if (s[k-1] == 'B') {
        s[k-1] = 'b';
    } else if (s[k-1] == 'C') {
        s[k-1] = 'c';
    }

    cout << s << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n, s) for (int i = (s); i < (n); i++)
#define MOD 1000000007
typedef long long ll;
using namespace std;
using Graph = vector<vector<int>>;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<int> h(n);
    rep(i, n) cin >> h[i];
    sort(h.begin(), h.end());
    int min_diff = 10e9;
    rep(i, n - (k-1))
    {
        min_diff = min(h[i + (k-1)] - h[i], min_diff);
    }
    cout << min_diff << endl;
 //   system("pause");
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <algorithm>
#include <cmath>
#include <climits>
#include <fstream>
#include <cstdlib>
#include <cstdio>
#define REP(i, n) for(int i=0; i<(n); i++)
#define FOR(i, a, n) for(int i=(a); i<(n); i++)
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;

ll mod = 1000000007;
map<int, ll> rec;

ll conb(int a){
    if(rec.find(a) != rec.end()){
        return rec[a];
    }else{
        if(a <= 0){
            return 0;
        }else if(a == 1){
            return 1;
        }else{
            ll tmp = (conb(a-1) + conb(a-2))%mod;
            rec.insert(make_pair(a, tmp));
            return tmp;
        }
    }
}

int main(){
    ll N, M;cin>>N>>M;
    vl a(M+2);
    a[0] = -1;
    a[M+1] = N+1;
    FOR(i, 1, M+1){
        cin >> a[i];
    }

    ll ans = 1;
    FOR(i, 1, M+2){
        ans = (ans*conb(a[i] - a[i-1] - 1))%mod;
    }

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

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

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
template < typename _T > inline void _DBG(const char *s, _T x) { cerr << s << " = " << x << "\n"; }
template < typename _T, typename... args > void _DBG(const char *s, _T x, args... a) { while(*s != ',') cerr << *s++; cerr << " = " << x << ','; _DBG(s + 1, a...); }

#ifdef LOCAL
#define DBG(...) _DBG(#__VA_ARGS__, __VA_ARGS__)
#else
#define DBG(...) (__VA_ARGS__)
#define cerr if(0) cout
#endif

// ********************** CODE ********************** //

const int N = 1e3 + 7;

LL n, C[N], F[N], S[N];

int main()
{
	_upgrade
	cin >> n;
	n--;
	for(int i = 0; i < n; i++)
		cin >> C[i] >> S[i] >> F[i];
	for(int i = 0; i < n; i++)
	{
		LL t = 0;
		for(int j = i; j < n; j++)
		{
			if(S[j] >= t)
			{
				t = S[j];
			}
			else
			{
				t = (LL)ceil(LD(t) / LD(F[j])) * F[j];
			}
			t += C[j];
		}
		cout << t << "\n";
	}
	cout << 0 << "\n";
	return 0;
}


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

int main(void){
    char s[101];
    cin >> s;
    int n = strlen(s);
    int ans=0;
    for(int i=0;i<n/2;i++){
        if(s[i] != s[n-1-i]) ans++;
    }
    cout << ans << endl;
    return 0;
}

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

typedef long long int ll;

const int MAX = 2e5 + 10;

int main()
{
	int n; cin>>n;
	map<ll,int> f;
	for(int i=0;i<n;i++){
		ll x; cin>>x;
		f[x]++;
	}
	int ans=0;
	for(auto i : f){
		if(i.second%2 == 1) ans++;
	}
	cout<<ans;
}

// abcab

Measured memory_bytes: 6528
#include<bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using ll=long long;
using ld=long double;
#define inf INT_MAX  
const ll infll=1ll*inf*inf;
#define mode 998244353
#define mod 1000000007
const long double PI=3.141592653589793238462643383279502884197169399375105820974944;
#define pb push_back
#define mp make_pair
#define ub upper_bound 
#define lb lower_bound 
#define far(i,a,b) for (ll i = a; i <= b; i++)
#define rev(i,a,b) for (ll i = a; i >= b; i--)
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define sz(a) int((a).size())
#define ftr(c,i) for(auto i = begin(c); i != end(c); i++)
#define rtr(c,i) for(auto i = rbegin(c); i != rend(c); i++)
#define pre(c,x) ((c).find(x) != (c).end())
#define cpre(c,x) (find(all(c),x) != (c).end())
#define mii map<int,int>
#define mll map<ll,ll>
#define vs vector<string>
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define vii vector<pii >
#define vll vector<pll >
#define vvl vector<vector<ll> >
#define vvi vector< vector<int > >
#define W(t) while(t --)
#define print(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout <<(ll)(it-arr.begin()) << ')' <<  *it << ' '; cout << endl;
#define printii(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout << it->ff<<' '<<it->ss << endl; cout << endl;
#define MID(i,j) ((i)+(j))/2
#define nl '\n' 
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
ll max(ll a,ll b) {return (a>b? a:b);}
ll min(ll a,ll b) {return (a>b? b:a);}
ll gcd(ll a,ll b) {return (b==0)? a:gcd(b,a%b); }
ll gcd(ll a,ll b,ll & x,ll & y) {
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }
    ll x1, y1;
    ll d = gcd(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}
ll modinv(ll a,ll b){
	ll x,y;
	gcd(a, b, x, y);
	return (x%b + b)%b;
}
ll ceiling(ll a,ll b){ 
        if(a%b==0) return a/b;
        else return a/b+1;
}
ll bpow(ll a,ll b,ll m){
	a%=m;
	ll res=1;
	while(b>0){
		if(b&1) res=(res*a)%m;
		b>>=1;
		a=a*a%m;
	}
	return res;
}
vvl mat_mul(vvl mat1,vvl mat2,ll mod1){
        vvl res(sz(mat1),vl(sz(mat2[0]),0));
        far(i,0,sz(mat1)-1){
                far(j,0,sz(mat2[0])-1){
                        far(k,0,sz(mat1[0])-1){
                                res[i][j]=(res[i][j]+(mat1[i][k]*mat2[k][j])%mod1)%mod1;          
                        }   
        }   
        }   
        return res;
}
vvl mat_exp(vvl mat,ll p,ll mod1){ 
        vvl res(sz(mat),vl(sz(mat[0]),0));
        far(i,0,sz(mat)-1) res[i][i]=1;
        while(p>0){
                if(p&1) res=mat_mul(res,mat,mod1);   
                mat=mat_mul(mat,mat,mod1);
                p>>=1;
        }   
        return res;
}
const int N=1e6+5;
ll n,m,q,t,k,x,y,z,ans;
int main()
{
	cin >> x >> y;
	if(x<y) cout << 0 << nl;
	else cout << 10 << nl;
}


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

int k[20],s[20][20],p[20];

int main(void)
{
    int n, m;
    int l,cnt=0,nol;
    int nos,q;
    cin >> n >> m;
    int i, j;
    for(i = 1; i <= m; i++) {
        cin >> k[i];
        for(j = 1; j <= k[i]; j++) {
            cin >> s[i][j];
        }
    }
    for(i = 1; i <= m; i++) {
        cin >> p[i];
    }
    l=pow(2.0, (float)n);
    for( i = 0; i <l; i++) {
        nol=0;
        for(j = 1; j <= m; j++) {
            nos=0;
            for(int q = 1; q <= k[j]; q++) {
//                cout << (1<<(s[j][q]-1)) << " "; 
                nos += ((i&(1<<(s[j][q]-1)))!=0)?1:0;
            }
 //           cout << " :" << nos << endl;
            if(nos % 2 == p[j]) {
                nol ++;
            }
        }
  //      cout << "nol: " << nol << endl;
        if(nol==m) cnt++;
    }
    cout << cnt << endl;
}


Measured memory_bytes: 384
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleAppTest
{
    class Multiplication2
    {
        static void Main(string[] args)
        {
            var i = 0;

            var num = Console.ReadLine();
            if (num == null)
            {
                Console.WriteLine(0);
                return;
            }

            int eleNum = int.Parse(num);
            var ele = new long[eleNum];
            long sum = 1;
            long max = (long)Math.Pow(10, 18);

            //2つ以上のスペース区切り入力の取得
            string[] str = Console.ReadLine().Split(' ');

            //数値で受け取りたい場合は変換する            
            for (i = 0; i < eleNum; i++)
            {
                ele[i] = long.Parse(str[i]);
                if(ele[i] == 0)
                {
                    Console.WriteLine(0);
                    return;
                }
            }

            for (i = 0; i < eleNum; i++)
            {
                if(max / sum < ele[i])
                {
                    sum = -1;
                    break;
                }

                sum *= ele[i];
                if (sum > max) 
                {
                    sum = -1;
                    break;
                }
            }

            Console.WriteLine($"{sum}");
        }
    }
}


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

int main() {
    int n,m;
    
    cin >> n;
    vector<string> s(n);
    for(int i = 0;i < n; i ++){
        cin >> s.at(i);
    }

    cin >> m;
    vector<string> t(m);
    for(int i = 0;i < m; i ++){
        cin >> t.at(i);
    }

    int max = 0;

    for(int i = 0; i < n; i ++){
        int sum = 0;
        for(int j = 0; j < n; j ++){
            if(s.at(i) == s.at(j)){
                sum ++;
            }
        }
        for(int k = 0; k < m; k++){
            if(s.at(i) == t.at(k)){
                sum --;
            }
        }

        if(max<sum){
            max = sum;
        }
    }
    if(max>0){
        cout << max << endl;
    }else{
        cout << 0 << endl;
    }

}
    

Measured memory_bytes: 256
#include <iostream>
using namespace std;
static const int N = 100;

int main() {
    int m[N][N];
    int n, u, k, v;
    cin >> n;

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            m[i][j] = 0;
        }
    }

    for (int i = 0; i < n; i++) {
        cin >> u >> k;
        u--;
        for (int j = 0; j < k; j++) {
            cin >> v;
            v--;
            m[u][v] = 1;
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (j) cout << " ";
            cout << m[i][j];
        }
        cout << endl;
    }
}



Measured memory_bytes: 3120
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstdlib>
#include<bitset>
#include<utility>

typedef long long ll;
#define INF 1000000000
#define MOD 1000000007

using namespace std;


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

int main() {
	string s;
	cin >> s;
	if (s <= "2019/04/30") {
		cout << "Heisei" << endl;
	} else {
		cout << "TBD" << endl;
	}
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <array>
#include <vector>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <queue>
#include <complex>
#define full(c) c.begin(), c.end()
#define vector2d(name,type,h,w,init) vector<vector<type>> name(h,vector<type>(w,init)) 
const int PRIME = 1000000007;
const int INF = 2147483647;
const double PI = acos(-1);
const double EPS = 0.000000001;
typedef unsigned long long int ull;
typedef long long int ll;
using namespace std;

int main(){
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int k;
	cin >> k;
	cout << (k / 2)*(k / 2 + k % 2) << endl;
	return 0;
}


Measured memory_bytes: 256
private fun readIntList() = readLine()!!.split(" ").map { it.toInt() }

fun main(args: Array<String>) {
    val (N, K) = readIntList()
    val A = readIntList()

    var count = K
    var times = 1
    while (count < N) {
        count += (K - 1)
        times++
    }

    println(times)
}

Measured memory_bytes: 49576
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define bit(n,k) (((ll)n>>(ll)k)&1) /*nのk bit目*/
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
vl dx={-1,-1,-1,0,0,1,1,1};
vl dy={1,-1,0,1,-1,1,0,-1};

int main(){
    ll n;cin>>n;
    ll k;cin>>k;
    set<ll>S;
    rep(i,k){
        ll d;cin>>d;
        rep(j,d){
            ll a;cin>>a;
            S.insert(a);
        }
    }
    cout<<n-S.size()<<endl;
}

Measured memory_bytes: 3628
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
    tmp0 = input[0].split(" ");
   // tmp1 = input[1].split(" ");
	//文字列から10進数に変換するときはparseIntを使います
    var x1 = parseInt(tmp0[0], 10);
    var y1 = parseInt(tmp0[1], 10);
    var x2 = parseInt(tmp0[2], 10);
    var y2 = parseInt(tmp0[3], 10);
    var x3=x2-(y2-y1);
    var y3=y2+(x2-x1);
    var x4=x1-(y2-y1);
    var y4=y1+(x2-x1);
    console.log(x3,y3,x4,y4);

   
                    }

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
length,min_num,max_num = (int(n) for n in input().split(" "))
if min_num > max_num or (length == 1 and min_num != max_num):
    print(0)
elif min_num == max_num or length == 2:
    print(1)
else:
    max_max = max_num * (length - 1) + min_num
    min_min = min_num * (length - 1) + max_num
    print(max_max - min_min + 1)

Measured memory_bytes: 38384
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (int i = m; i < (n); ++i)
using namespace std;
using ll = long long;

int main(){
    int n;
    cin >> n;
    if (65 <= n && n <= 90){
        cout << 1 << endl;
    }
    else if (97 <= n && n <= 122){
        cout << 2 << endl;
    }
    else{
        cout << 0 << endl;
    }
}


Measured memory_bytes: 3084
# B
def main(L_list, N):
    if sum(L_list) > max(L_list)*2:
        return "Yes"
    else:
        return "No"
    
if __name__ == "__main__":
    N = int(input())
    L_list = list(map(int, input().split()))
    res = main(L_list, N)
    print(res)

Measured memory_bytes: 2940
a,b=map(int,input().split())
g1=[1,3,5,7,8,10,12]
g2=[4,6,9,11]
g3=[2]
if (a in g1 and b in g1) or (a in g2 and b in g2) or (a in g3 and b in g3):
   print('Yes')
else:
   print('No')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
    REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

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

const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};

const int dx8[8] = {1,1,0,-1,-1,-1,0,1};
const int dy8[8] = {0,1,1,1,0,-1,-1,-1};

vector< vector<int> > Graph;
vector< int > value;




int main(int argc, const char * argv[]) {
    
    // remove the bottom 3 lines when you submit this code.
    std::ifstream in("sample.txt");
    std::cin.rdbuf(in.rdbuf());

    cin.tie(0);
    ios::sync_with_stdio(false);

    int a,b,c; cin >> a >> b >> c;
    if((10*b + c) % 4==0) cout << "YES" << endl;
    else cout << "NO" << endl;
    
}



Measured memory_bytes: 384
n = int(input())
if n % 10 == 2 or n % 10 == 4 or n % 10 == 5 or n % 10 == 7 or n % 10 == 9:
    print('hon')
elif n % 10 == 0 or n % 10 == 1 or n % 10 == 6 or n % 10 == 8:
    print('pon')
else:
    print('bon')

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

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)


int main()
{
  ll n, t, c=0;
  cin >> n;
  map<ll, ll> a;
  forll(i, 0, n){
	cin >> t;
	a[t]++;
  }
  for(auto i=a.begin(); i!=a.end(); ++i){
	if(i->second % 2 == 1)
	  c++;
  }
  cout << c << endl;
}



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

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    ll ans = 0;
    rep(i, n){
        ans += a[i] / 2;
        if (i != n - 1 && a[i] % 2 && a[i + 1]){
            a[i + 1]--;
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3756
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author munkhbat
 * Coin change AOJ
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_A
 * Find the minimum number of coins to make change for n cents 
 * using coins of denominations d1, d2,.., dm. The coins can be used any number of times.
 */
public class Main {
	private static int n, m;
	private static int[] dp;
	private static int[] denominations;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		n = sc.nextInt();
		m = sc.nextInt();
		
		dp = new int[n + 1];
		denominations = new int[m];
		
		for (int i = 0; i < m; i++) {
			denominations[i] = sc.nextInt();
		}
		
		sc.close();
		
		Arrays.fill(dp, 1 << 25);
		dp[0] = 0;
		// i : cents to change
		for (int i = 1; i < n + 1; i++) {
			for (int j = 0; j < m; j++) {
				if (denominations[j] <= i && dp[i - denominations[j]] + 1 < dp[i]) {
					dp[i] = dp[i - denominations[j]] + 1;
				}
			}
		}
		
		System.out.println(dp[n]);
	}
}

Measured memory_bytes: 19756
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
using namespace std;

long long f[1001];

int main()
{
	f[0]=2;
	for(int i=1;i<1001;i++)
	{
		f[i]=2*f[i-1]+2;
	}
	int x;
	cin>>x;
	cout<<f[x]<<endl;
	return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	N := oneInt()
	mapper := make(map[int]bool)

	for index := 0; index < N; index++ {
		in := oneInt()
		if mapper[in] {
			fmt.Print("NO")
			return
		} else {
			mapper[in] = true
		}
	}
	fmt.Print("YES")
}

func searchAbove(slice []int, target int, index int) int {
	for i := index + 1; i < len(slice); i++ {
		v := slice[i]
		if v >= target {
			return i
		}
	}
	return -1
}

var sc = bufio.NewScanner(os.Stdin)

func oneInt() int {
	var a int
	fmt.Scan(&a)
	return a
}
func oneStr() string {
	var a string
	fmt.Scan(&a)
	return a
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func scanNums() (nums []int) {
	s := nextLine()
	numStr := strings.Split(s, " ")

	for _, n := range numStr {
		i, _ := strconv.Atoi(n)
		nums = append(nums, i)
	}
	return nums
}

func scanStrings() (strs []string) {
	s := nextLine()
	list := strings.Split(s, " ")
	strs = append(strs, list...)
	return strs
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func sortAsc(a []int) []int {
	sort.Ints(a)
	return a
}

func sortDesc(a []int) []int {
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
	return a
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {
	if a == 0 && b == 0 {
		return 0
	}
	return a * b / gcd(a, b)
}


Measured memory_bytes: 8448
import sys
sys.setrecursionlimit(10**7)
N, M = [int(i) for i in input().split()]
edges = {j : [] for j in range(N + 1)}
for j in range(M):
    x, y = [int(i) for i in input().split()]
    x -= 1
    y -= 1
    edges[x].append(y)
for i in range(N):
    edges[N].append(i)

memo_ls = [None for i in range(N + 1)]


def dfs(last):
    if memo_ls[last] is not None:
        return memo_ls[last]
    if len(edges[last]) == 0:
        return 0
    cnt = max([dfs(_next) + 1 for _next in edges[last]])
    memo_ls[last] = cnt
    return cnt


print(dfs(N) - 1)

Measured memory_bytes: 144912
#include<bits/stdc++.h>
using namespace std;
#define deb(x) cerr << #x << " = " << x << "\n";
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}


int main(){
	FIO
		
	// fuck my life is fucked by this task
	int fuck;cin >> fuck;
	cout << fixed << setprecision(12) << (long double)((fuck * fuck * fuck) / 27.0);
	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))
#define repr(i, a, n) for(int (i) = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define RNG(x, a, n) &((x)[a]), &((x)[n])
#define ADD(a, b) ((((a+MOD)%MOD)+((b+MOD)%MOD))%MOD)
#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define PI 3.1415926535897
#define EPS (1e-10)
#define INF INT_MAX
#define INFLL LLONG_MAX
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using MII = std::map<int, int>;
using TIII = std::tuple<int, int, int>;
using MCI = std::map<char, int>;
using VPII = std::vector<PII>;
using namespace std;


signed main(){
	int A, B, C;
	cin >> A >> B >> C;

	if(A == B) cout << C << endl;
	else if(B == C) cout << A << endl;
	else cout << B << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    bool judw=false,jude=false,judn=false,juds=false;
    string s;
    cin>>s;
    for(int i=0;i<=s.size()-1;i++)
    {
    	if(s[i]=='W')
    		judw=true;
    	else if(s[i]=='E')
    		jude=true;
		else if(s[i]=='N')
    		judn=true;
		else if(s[i]=='S')
    		juds=true;	
	}
	if(judn==juds&&judw==jude)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime> 
#include <memory.h>
#include <assert.h>

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18 + 1;

ll func(ll A) {
    ll ret = ((A+1)/2)%2 ? 1 : 0;
    for(ll i = 2; i <= A; i*=2) {
        if((A/i)%2 == 0) continue;
        if((A%i)%2 == 1) continue;
        ret += i; 
    }    
    return ret;
}

int main(){
    ll A, B;
    cin >> A >> B;

    if(A != 0) cout << (func(A-1) ^ func(B)) << endl;
    else cout << func(B) << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<list>
#include<cstdio>

using namespace std;

const int mod = 100009;

typedef list<pair<int, int> > map;

map hashmap[mod];

int main(){
  int n;
  while(scanf("%d", &n), n){
    int ans = -1;

    if(n == 1){
      int a; scanf("%d", &a);
      printf("%d\n", a);
      continue;
    }

    for(int i = 0; i < mod; i++){
      hashmap[i].clear();
    }

    for(int i = 0; i < n; i++){
      int a; scanf("%d", &a);

      map &ls = hashmap[a % mod];

      bool ok = false;

      for(map::iterator it = ls.begin(); it != ls.end(); ++it){
	if(it->first == a){
	  ok = true;
	  ++(it->second);

	  if(it->second > n / 2){
	    ans = it->first;
	  }
	  break;
	}
      }

      if(!ok) ls.push_back(make_pair(a, 1));
    }

    if(ans == -1)
      puts("NO COLOR");
    else
      printf("%d\n", ans);
  }
  return 0;
}

Measured memory_bytes: 2476
//! Framework <https://github.com/vain0x/procon>

#![allow(non_snake_case)]
#![allow(unused_imports)]

use std::collections::*;

pub struct Scan(Box<dyn Iterator<Item = &'static str>>); // '

impl Scan {
    fn new() -> Self {
        let mut buf = String::new();
        let read_line = move || {
            std::io::stdin().read_line(&mut buf).unwrap();
            Box::leak(buf.split_off(0).into_boxed_str()).split_whitespace()
        };
        Scan(Box::new(std::iter::repeat_with(read_line).flatten()))
    }

    pub fn word<T: std::str::FromStr>(&mut self) -> T {
        self.0.next().unwrap().parse().ok().unwrap()
    }

    pub fn list<T: std::str::FromStr>(&mut self, len: usize) -> Vec<T> {
        std::iter::repeat_with(|| self.word()).take(len).collect()
    }
}

fn main() {
    let mut scan = Scan::new();

    let N = scan.word::<usize>();
    let A = scan.list::<usize>(N);

    let mut freq = HashMap::new();
    for &a in &A {
        *freq.entry(a).or_insert(0) += 1;
    }

    let mut b = freq.keys().collect::<Vec<_>>();
    b.sort();

    let m = b.last().copied().unwrap() + 1;
    let mut done = vec![false; m + 1];
    for (&a, &k) in &freq {
        if k >= 2 {
            done[a] = true;
        }
    }

    for &x in &b {
        let mut k = 2;
        while k * x <= m {
            done[k * x] = true;
            k += 1;
        }
    }

    let n = A.iter().filter(|&&a| !done[a]).count();
    println!("{}", n);
}


Measured memory_bytes: 13780
#include<stdio.h>
int main(void)
{
    int x,y,z;
    char c;
    while(1)
    {
        scanf("%d%d%d",&x,&y,&z);
        if(x==-1&&y==-1&&z==-1)
        {
            break;
        }
        if(x==-1||y==-1)
        {
            c = 'F';
        }
        else if(x+y>=80)
        {
            c = 'A';
        }
        else if(x+y>=65&&x+y<80)
        {
            c = 'B';
        }
        else if(x+y>=50&&x+y<65)
        {
            c = 'C';
        }
        else if(x+y>=30&&x+y<50)
        {
            c = 'D';
            if(z>=50)
            {
                c = 'C';
            }
        }
        else
        {
            c = 'F';
        }
        printf("%c\n",c);
    }
    return 0;
}

Measured memory_bytes: 600
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define fs first
#define fst first
#define sc second
#define snd second
#define sz(X) (int)(X).size()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define fornr(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define forab(i, a, b) for(int i = int(a); i < int(b); i++)
#define all(X) X.begin(), X.end()

typedef long long ll;
typedef vector<pair<ll, ll>> vpll;
typedef pair<int, int> pii;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef double dbl;
typedef long double ld;
typedef vector<int> vi;


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    char c;
    cin >> c;
    cout << (char) (c + 1) << "\n";
    return 0;
}

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

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

    if(n >= 10){
        n = n % 10;
    }
    else if(n >= 1) n = n;

    if((n==2) || (n==4) || (n==5) || (n==7) || (n==9)) cout << "hon" << endl;
    else if((n==0) || (n==1) || (n==6) || (n==8)) cout << "pon" << endl;
    else if(n==3) cout << "bon" << endl;

    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define sb __builtin_popcount
#define MOD (ll)998244353
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll x, y, a, b, c;
    cin >> x >> y >> a >> b >> c;
    ll r[a];
    ll g[b];
    ll co[c];
    for (ll i = 0; i < a; i++)
    {
        cin >> r[i];
    }
    for (ll i = 0; i < b; i++)
    {
        cin >> g[i];
    }
    for (ll i = 0; i < c; i++)
    {
        cin >> co[i];
    }
    sort(r, r + a, greater<ll>());
    sort(g, g + b, greater<ll>());
    sort(co, co + c, greater<ll>());
    priority_queue<ll, vector<ll>, greater<ll>> pq;
    ll sum = 0;
    for (ll i = 0; i < x; i++)
    {
        sum += r[i];
        pq.push(r[i]);
    }
    for (ll i = 0; i < y; i++)
    {
        sum += g[i];
        pq.push(g[i]);
    }
    for (ll i = 0; i < c && pq.size(); i++)
    {
        ll top = pq.top();
        if (co[i] - top > 0)
        {
            pq.pop();
            sum += (co[i] - top);
        }
        else
        {
            break;
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 4852
/*I MAY NOT GET THE SUCCESS IMMEDIATELY BUT I WILL GET IT FOR SURE*/
#include<bits/stdc++.h>
#define opt std::ios_base::sync_with_stdio(false)
#define I int
#define li		int32_t
#define lli		long long
#define ulli unsigned long long
 
#define pn			 printf("\n")
#define nl			 cout<<'\n'
#define sf(N)        scanf("%lld",&N)
#define pf(N)        printf("%lld",N)
#define sf1(N1,N2)    scanf("%lld %lld",&N1,&N2)
#define pf1(N1,N2)    printf("%lld %lld",N1,N2)
#define sf2(N1,N2,N3) scanf("%lld %lld %lld",&N1,&N2,&N3)
#define pf2(N1,N2,N3) printf("%lld %lld %lld",N1,N2,N3)
 
#define sl          cout<<' '
#define ps          printf(" ")
 
#define rep(i,a,b)	for(i=a;i<b;i++)
#define repr(i,a,b)	for(i=a;i>b;i--)
#define elif		else if
#define mset(a,b)	memset(a,b,sizeof(a))
 
#define pb		push_back
#define pob		pop_back
#define itr		iterator
#define sz()	size()
#define szof    sizeof
#define lb		lower_bound
#define ub		upper_bound
#define mp		make_pair
#define vlli    vector<lli>
#define plli	pair<lli,lli>
#define vplli	vector<plli >
#define F   	first
#define S		second
#define Dup     erase(unique(V.begin(),V.end()),V.end())
 
#define bs      binary_search
#define ub      upper_bound
#define lb      lower_bound
 
#define MX1     100000
#define MX2     1000000
#define MX3     10000
#define Inf     1000000000000000
#define mod		1000000007
using namespace std;

lli dp[1<<15];

lli Power(lli a,lli b)
{
    lli result=1;
 
    while(b)
    {
        if(b%2)
        {
            result=(result*a)%mod;
        }
 
        b=b>>1;
        a=(a*a)%mod;
    }
 
 return result;
}
 
int main()
{
    opt;
    
    /*#ifndef ONLINE_JUDGE
    freopen("double_squares.txt","r",stdin);
    freopen("double_squares_out.txt","w",stdout);
    #endif // ONLINE_JUDGE*/
    
    string s;
    cin>>s;
    string s1;
    s1=s;
    
    reverse(s1.begin(),s1.end());
    if(s==s1)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }
    
    
    
    
    
 
 return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define REP(i, n) FOR(i, 0, n)
using namespace std;
int main() {
    int N, M;
    cin >> N >> M;
    int a[M], b[M];
    vector<int> stog;
    int check[N] = {};
    REP(i, M) {
        cin >> a[i] >> b[i];
        if(a[i] == 1) {
            check[b[i]-1] = 1;
        } 
        if(b[i] == N) {
            stog.push_back(a[i]);
        }
    }
    REP(i, stog.size()) {
        if(check[stog[i] - 1]) {
            puts("POSSIBLE");
            return 0;
        }
    }
    puts("IMPOSSIBLE");
}

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

int main() {
	int A, B, C, sum = 0;
	cin >> A >> B >> C;
	for (int i = 1; i <= 10000000; i++) {
		if (i % 7 == 0) sum += B;
		sum += A;
		if (sum >= C) { cout << i << endl; break; }
	}
	return 0;
}


Measured memory_bytes: 3112