akhauriyash/Code-Regression huggingface dataset:
//header{{{
#include<bits/stdc++.h>
  
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define setout(n,x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10)
#define int long long
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1e9+7; 
 
int gcd(int a,int b){ return b ? gcd(b,a % b) : a;}
int lcm(int a,int b){ return a / gcd(a,b) * b;}
//}}}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	string s;
	cin >> n >> s;
	int cnt = 1;
	rep(i,n-1){
		if(s[i] != s[i+1]) ++cnt;
	}
	cout << cnt << '\n';
   return 0;
}


Measured memory_bytes: 512
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


A, B, C = zz()
for i in range(1, B + 1):
    if ((A * i) % B == C):
        print('YES')
        exit()
print('NO')


Measured memory_bytes: 41952
#include<bits/stdc++.h>
 #include <ext/pb_ds/tree_policy.hpp>
 #include <ext/pb_ds/assoc_container.hpp>
 #include<chrono>
 using namespace std;
 using namespace std::chrono;      
 using namespace __gnu_pbds; 
 #define fastio     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
 #define fi         first
 #define se         second
 #define int         long long 
 #define pb         push_back
 #define emp        emplace_back
 #define vv(x)      vector<x>
 #define mp(x,y)    map<x,y>
 #define dq(x)      deque<x>
 #define pql(x)     priority_queue<x>
 #define pqs(x)     priority_queue<x,vv(x),greater<x> >
 #define M          1000000007
 #define forf(i,a,b) for(int i=a;i<b;i++)
 #define it(x)      x::iterator
 #define ll         long long 
 #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
 #define time__(d)  for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
 #define vii        vector<int>
 #define big        3e18
 #define sm         -2e9
 #define mkr        make_pair
 #define vpi        vector<pair<int,int> >
 #define pii        pair<int,int>
 #define rng        500005
 #define sz(x)      (int)x.size()
 #define rv(x)      reverse(x.begin(),x.end())
 #define out(x)     cout<<x.fi<<" "<<x.se<<endl;

//#define ordered_set tree<pii, null_type,less<pii>, rb_tree_tag,tree_order_statistics_node_update> 
  
void pr_init()
{
   
    #ifndef ONLINE_JUDGE
    freopen("gin.txt", "r", stdin);
    freopen("gout.txt", "w", stdout);
   
    #endif
}



int raise(int a,int b)
{
  int an = 1;

  while(b>0)
  {
    if(b%2!=0) an = ((an%M) * (a%M))%M;

    b/=2;
    a = ((a%M)*(a%M))%M;
  }
  return an;
}
int inv(int a)
{
  return raise(a,M-2);
}

void solve()
{
  
 int x,y;
 cin >> x >> y;
 
 if(2*x-y< 0 || 2*y-x < 0 || (2*x-y)%3!=0 || (2*y-x)%3!=0)
 {
  cout<<"0\n";
  return ;
 }
 int a1 = (2*x-y)/3 , a2 = (2*y-x)/3; 
 int cn = a1+a2;
 
 int an = 1;

 for(int i=1;i<=cn;i++)
 {
  an = ((i%M)*(an%M))%M;
 }

 for(int i=2;i<=a1;i++)
 {
  an = ((inv(i)%M)*(an%M))%M;
 }

 for(int i=2;i<=a2;i++)
 {
  an = ((inv(i)%M)*(an%M))%M;
 }

 cout<<an%M;

}


int32_t main()
{
  pr_init();
  fastio;
  
  auto start = high_resolution_clock::now(); 
 
  solve();
  auto stop = high_resolution_clock::now();
  auto duration = duration_cast<microseconds>(stop - start); 
   // cout << "Time taken by function: "
   //       << duration.count() << " microseconds" << endl; 

 }
      
      

Measured memory_bytes: 3608
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,j,n) for(int i = j; i < n; i++)
#define RFOR(i,j,n) for(int i = j-1; i >= n; i--)
#define PREC(n) fixed << setprecision(n)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define _LIBCPP_DEBUG 0
using namespace std;
int64_t MOD = 1000000007;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m, maxi = -1000000000;
  map<string,int> pl, mi;
  set<string> se;
  cin >> n;
  REP(i,n) {
    string s;
    cin >> s;
    pl[s]++;
    se.insert(s);
  }
  cin >> m;
  REP(j,m) {
    string s;
    cin >> s;
    mi[s]++;
    se.insert(s);
  }
  for(string t : se) {
    int a = 0, b = 0;
    if(pl.count(t)) a = pl[t];
    if(mi.count(t)) b = mi[t];
    int res = a - b;
    maxi = max(maxi, res);
  }
  if(maxi < 0) maxi = 0;
  cout << maxi << endl;
  return 0;
}
//templete by private_yusuke

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

typedef long long Fack;

int n;
inline static char get(vector<bool> & abraham, int i) {
	int re = 0;
	for (int iter=0; iter<8; iter++) re += abraham[(i << 3) | iter] << iter;
	return (char) re;
}

#define P 'D'
#define B 'M'
#define zonde 'C'

/* __orz__ */ int32_t /* __orz__ */ main() {
	cin >> n;
	string s;
	cin >> s;
	static int cD[(int)1e6+5],cM[(int)1e6+5];
	cD[0]=0;for(int i=0;i<n;i++)cD[i+1]=cD[i]+(s[i]==P);
	cM[0]=0;for(int i=0;i<n;i++)cM[i+1]=cM[i]+(s[i]==B);
	int nq; cin >> nq; for(int q=0;q<nq;q++){
		int k; cin >> k;
		Fack cur = 0;
		Fack S=0;
		for (int i=0; i<n; i++) {
			if (i >= k && s[i-k]==P) {
				cur -= cM[i]-cM[i-k+1];
			}
			if (s[i] == B) {
				// pos(D) >= i-k+1.
				cur += cD[i]-cD[max(0, i-k+1)];
			}
			if (s[i] == zonde) S += cur;
		}
		cout << S << endl;
	}
}


Measured memory_bytes: 9220
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

typedef long long int ll;
typedef pair<int, int> Pii;

const ll mod = 1000000007;

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

  int n;
  cin >> n;

  vector<vector<ll> > dp(n+2, vector<ll>(4));
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    dp[i+1][0] = (dp[i][0] * 8) % mod;
    dp[i+1][1] = (dp[i][0] * 1 + dp[i][1] * 9) % mod;
    dp[i+1][2] = (dp[i][0] * 1 + dp[i][2] * 9) % mod;
    dp[i+1][3] = (dp[i][1] * 1 + dp[i][2] * 1 + dp[i][3] * 10) % mod;
  }

  cout << dp[n][3] << endl;

  return 0;
}


Measured memory_bytes: 73244
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int Maxn=5005;
int a[Maxn],pos[Maxn];
ll f[Maxn][Maxn];
int main(){
    int n,A,B;cin>>n>>A>>B;
    for(int i=1;i<=n;i++)cin>>a[i],pos[a[i]]=i;
    memset(f,0x3f,sizeof(f));
    memset(f[0],0,sizeof(f[0]));
    for(int i=1;i<=n;i++){
        for(int j=0;j<=n;j++){
            int l=pos[i],delta=0;
            if(l<j)delta=A;
            else if(l>j)delta=B;
            f[i][j]=min(f[i][j],f[i-1][j]+delta);
        }
        for(int j=1;j<=n;j++)f[i][j]=min(f[i][j],f[i][j-1]);
    }
    cout<<f[n][n]<<"\n";
    return 0;
}

Measured memory_bytes: 195968
//#include <bits/stdc++.h>
#include<iostream>
#include<vector>
#include<map>
#include<math.h>

#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define irrep(i,n) for(int i = (int)(n-1); i > -1; i--)
#define irrep2(i,n,a) for(int i = (int)(n); i >= (int)(a); i--)

#define fi first
#define se second

using namespace std;

using ll = long long;
using v_int = vector<int>;
using v2_int = vector<v_int>;
using v_ll = vector<ll>;
using v2_ll = vector<v_ll>;
using v_string = vector<string>;
using v_bool = vector<bool>;
using v2_bool = vector<v_bool>;
using pii = pair<int, int>;
using mii = map<int, int>;

const double PI = 3.1415926535897932;
const int INF = (int)2e9;
const ll LINF = (ll)2e18;
const ll MOD = 1000000007;
const int dc[8] = {1, -1, 0,  0, 1, -1,  1, -1};
const int dr[8] = {0,  0, 1, -1, 1,  1, -1, -1};

template<typename T, typename U> inline
ostream& operator<<(ostream &o, pair<T,U> &p) {
    return o << "{" << p.first << "," << p.second << "}";
}
template<typename T> inline
istream& operator>>(istream &is, vector<T> &vec) {
    for(auto &v : vec) { is >> v; }
    return is;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<T> &vec) {
    for(auto &v : vec) { os << v << ",";}
    return os;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<vector<T> > &mat) {
    for(auto &row : mat) { os << row << endl; }
    return os;
}
template<typename T> inline
void chmin(T &a, T b) { a = min(a, b); }
template<typename T> inline
void chmax(T &a, T b) { a = max(a, b); }

int main(void)
{
    int h, w;
    cin >> h >> w;

    v_string s(h);
    cin >> s;

    v2_int t(h, v_int(w));

    irep(i, h) {
        int cnt = 0;
        v_int done(w);
        irep(j, w) {
            if(done[j]) { continue; }
            if(s[i][j] == '.') {
                cnt++;
                int col = j + 1;
                while(col < w && s[i][col] == '.') {
                    col++;
                    cnt++;
                }
                irep2(k, j, col-1) {
                    t[i][k] += cnt;    
                    done[k] = 1;
                }
            } else {
                cnt = 0;
            }
        }
    }

    irep(j, w) {
        int cnt = 0;
        v_int done(h);
        irep(i, h) {
            if(done[i]) { continue; }
            if(s[i][j] == '.') {
                int row = i + 1;
                cnt++;
                while(row < h && s[row][j] == '.') {
                    row++;
                    cnt++;
                }
                irep2(k, i, row-1) {
                    t[k][j] += cnt;    
                    done[k] = 1;
                }
            } else {
                cnt = 0;
            }
        }
    }
    int ans = 0;
    irep(i, h) {
        irep(j, w) {
            chmax(ans, t[i][j]-1);
        }
    }       
    cout << ans << endl;
    return 0;
} /*atcoder*/


Measured memory_bytes: 26500
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PI 4*atan(1.0)
typedef long long ll;
typedef long double ld;
using namespace std;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
const int SIZE=100050;
//int arr[SIZE]={};
//ここまでテンプレ
int main(){
	int X,A,B;
	cin>>X>>A>>B;
	if(B<=A)
		cout<<"delicious"<<endl;
	else if(B-A<=X)
		cout<<"safe"<<endl;
	else
		cout<<"dangerous"<<endl;
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    s, w = LI()
    print("unsafe" if s <= w else "safe")
    return


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


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

using namespace std;

int main(int qtd, char* nome[])
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;
    int gem[n], coast[n], x=0;

    for (int i=0; i < n; i++){
        cin >> gem[i];
    }
    for (int i=0; i < n; i++){
        cin >> coast[i];
    }
    int m = 0;
    for (int i = 0; i < n; ++i){
        m += max(gem[i] - coast[i], 0);
    }
    cout << m;

    return 0;
}

Measured memory_bytes: 256
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdint>
#include <cstring>

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

using i32 = int32_t;
using u32 = uint32_t;
using f32 = float;
using f64 = double;
using i64 = int64_t; 
using u64 = uint64_t; 

#define SELECTER(_1, _2, _3, _4, _5, _6, _7, _8, SELECT, ...) SELECT

#define _FC1(func, type, _1)      func(type, _1);
#define _FC2(func, type, _1, ...) func(type, _1); _FC1(func, type, __VA_ARGS__);
#define _FC3(func, type, _1, ...) func(type, _1); _FC2(func, type, __VA_ARGS__);
#define _FC4(func, type, _1, ...) func(type, _1); _FC3(func, type, __VA_ARGS__);
#define _FC5(func, type, _1, ...) func(type, _1); _FC4(func, type, __VA_ARGS__);
#define _FC6(func, type, _1, ...) func(type, _1); _FC5(func, type, __VA_ARGS__);
#define _FC7(func, type, _1, ...) func(type, _1); _FC6(func, type, __VA_ARGS__);
#define _FC8(func, type, _1, ...) func(type, _1); _FC7(func, type, __VA_ARGS__);

#define _FCN(func, type, ...) SELECTER(__VA_ARGS__, _FC8, _FC7, _FC6, _FC5, _FC4, _FC3, _FC2, _FC1)(func, type, __VA_ARGS__);

constexpr const char *type2fmt(const char *fmt) {
  if(strcmp(fmt, "i32")) return "%d";
  if(strcmp(fmt, "u32")) return "%u";
  if(strcmp(fmt, "f32")) return "%f";
  if(strcmp(fmt, "f64")) return "%lf";
  if(strcmp(fmt, "i64")) return "%lld";
  if(strcmp(fmt, "u64")) return "%llu";
  if(strcmp(fmt, "char*")) return "%s";
  return "";
}

#define _R(type, _1) type _1; { type _t; scanf(type2fmt(#type), &_t); _1 = _t; }
#define _P(type, _1) { const type _t = (_1); printf(type2fmt(#type), _t); putchar('\n'); }

#define RI(...)   _FCN(_R, i32, __VA_ARGS__);
#define RUI(...)  _FCN(_R, u32, __VA_ARGS__);
#define RF(...)   _FCN(_R, f32, __VA_ARGS__);
#define RD(...)   _FCN(_R, f64, __VA_ARGS__);
#define RLL(...)  _FCN(_R, i64, __VA_ARGS__);
#define RULL(...) _FCN(_R, u64, __VA_ARGS__);

#define PI(...)   _FCN(_P, i32, __VA_ARGS__);
#define PUI(...)  _FCN(_P, u32, __VA_ARGS__);
#define PF(...)   _FCN(_P, f32, __VA_ARGS__);
#define PD(...)   _FCN(_P, f64, __VA_ARGS__);
#define PLL(...)  _FCN(_P, i64, __VA_ARGS__);
#define PULL(...) _FCN(_P, u64, __VA_ARGS__);
#define PS(...)   _FCN(_P, char*, __VA_ARGS__);

#define REP(n) for (int _i = 0; _i < n; _i++)

const u64 mod = 1000000007;

int main() {
  string s;
  cin >> s;
  auto l = s.begin(), r = s.end();
  while (*l != 'A') l++;
  while (*r != 'Z') r--;
  PI(r - l + 1);
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define res register int
#define ll long long
//#define cccgift
//#define getchar()(p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
//char buf[1<<21],*p1=buf,*p2=buf;
template<typename T>
inline void read(T &x)
{
    static char ch;bool f=1;
    for(x=0,ch=getchar();!isdigit(ch);ch=getchar()) if(ch=='-') f=0;
    for(;isdigit(ch);x=(x<<1)+(x<<3)+(ch^48),ch=getchar());x=f?x:-x;
}
template<typename T>
void print(T x)
{
    if (x<0) x=-x,putchar('-');
    if (x>9) print(x/10);
    putchar(x%10+48);
}
template<typename T>
inline void print(T x,char ap) {print(x);if (ap) putchar(ap);}
template<typename T>
inline void chkmax(T &x,const T &y) {x=x<y?y:x;}
template<typename T>
inline void chkmin(T &x,const T &y) {x=x<y?x:y;}
map<int,int> mp;
int n,k;
ll a[200001],tot;
int main()
{
	ios::sync_with_stdio(false);
	cin>>n>>k;
	for(res i=1;i<=n;++i) cin>>a[i],a[i]+=a[i-1];mp[0]=1;
	for(res i=1;i<=n;++i) {
		if(i>=k) --mp[(a[i-k]%k-i%k+k)%k];
		tot+=mp[(a[i]%k-i%k+k)%k],++mp[(a[i]%k-i%k+k)%k];
	}
	cout<<tot<<'\n';
	cout<<flush;
	return 0;
}
/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do something instead of nothing and stay organized
*/ 

Measured memory_bytes: 11136
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tii tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define edge(v,a,b) v[a].pb(b);v[b].pb(a);
#define MAX_V 400010
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
template<typename A, size_t NNN, typename T>
void Fill(A (&array)[NNN], const T &val){
    fill( (T*)array, (T*)(array+NNN), val );
}
#define INF 1e9+7
#define LLINF 1e18+7
ll MOD=1e9+7;
#define N 500
ll n,m,k;
ll a[N];
ll b[N];
ll dp[N][N];
ll s[N];
ll dfs(int x,int y){
    if(x==y)return 0ll;
    if(dp[x][y]!=-1)return dp[x][y];
    ll ans=LLINF;
    rep2(i,x,y-1){
        ans=min(ans,dfs(x,i)+dfs(i+1,y));
    }
    return dp[x][y]=ans+s[y]-s[x-1];
}
int main(){
    n=in();
    rep2(i,1,n){
        a[i]=in();
        s[i]=s[i-1]+a[i];
    }
    rep(i,401)rep(j,401)dp[i][j]=-1;
    cout<<dfs(1,n);
    return 0;
}

Measured memory_bytes: 1792
table_1 = input().split()
table_2 = input().split()
table_3 = input().split()
bingo_card = table_1 + table_2 + table_3

N = int(input())

for _ in range(N):
    b = str(int(input()))
    if b in bingo_card:
        bingo_card[bingo_card.index(b)] = True
        
if bingo_card[0] == bingo_card[1] == bingo_card[2]:
    print('Yes')
elif bingo_card[3] == bingo_card[4] == bingo_card[5]:
    print('Yes')
elif bingo_card[6] == bingo_card[7] == bingo_card[8]:
    print('Yes')
elif bingo_card[0] == bingo_card[3] == bingo_card[6]:
    print('Yes')
elif bingo_card[1] == bingo_card[4] == bingo_card[7]:
    print('Yes')
elif bingo_card[2] == bingo_card[5] == bingo_card[8]:
    print('Yes')
elif bingo_card[0] == bingo_card[4] == bingo_card[8]:
    print('Yes')
elif bingo_card[2] == bingo_card[4] == bingo_card[6]:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 38384
#include <stdio.h>

int main()
{
	int i, j, N, M, k[11], s[11][11], p[11];
	scanf("%d %d", &N, &M);
	for (i = 1; i <= M; i++) {
		scanf("%d", &(k[i]));
		for (j = 1; j <= k[i]; j++) scanf("%d", &(s[i][j]));
	}
	for (i = 1; i <= M; i++) scanf("%d", &(p[i]));
	
	int count = 0, flag[11] = {}, tmp;
	while (1) {
		for (i = 1; i <= M; i++) {
			tmp = 0;
			for (j = 1; j <= k[i]; j++) if (flag[s[i][j]] == 1) tmp ^= 1;
			if (tmp != p[i]) break;
		}
		
		if (i > M) count++;
		for (i = 1; i <= N; i++) if (flag[i] == 0) break;
		if (i > N) break;
		flag[i] = 1;
		for (i--; i >= 1; i--) flag[i] = 0;
	}
	
	printf("%d\n", count);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 128
/*
LANG:C++
PROB:

*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <iostream>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)


using namespace __gnu_pbds;
using namespace std;


typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
typedef unsigned long long ui64;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
const int mod=1000000007;
  i64 poww(i64 a, i64 b)
  {
    a%=mod;
    i64 res=1;
    while(b)
      {
if(b&1)res=res*a%mod;

      a=a*a%mod;
      b/=2;

      }
      return res;
  }
  i64 inv(i64 a)
  {
    return poww(a,mod-2);
  }


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

    // ifstream fin(".in");
    // ofstream fout(".in");
    int n,m;
cin>>n>>m;
if(n==m)cout<<"Yes";
else
cout<<"No";



    return 0;
  }

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

int main(void) {
	string S, T;
	cin >> S >> T;

	bool Tfound = false;
	int tlen = T.length();
	int slen = S.length();
	for (int ts = slen-tlen; ts >= 0; ts--) {
		for (int i = 0; i < tlen; i++) {
			if ((S[i+ts]=='?') || (S[i+ts]==T[i])) {
				if (i==tlen-1) {
					Tfound = true;
					break;
				}
			} else {
				break;
			}
		}
		if (Tfound) {
			for (int i = 0; i < tlen; i++) {
				S[i+ts] = T[i];
			}
			break;
		}
	}
	if (Tfound) {
		for (int i = 0; i < slen; i++) {
			if (S[i]=='?') S[i] = 'a';
		}
		cout << S << endl;
	} else {
		cout << "UNRESTORABLE" << endl;
	}
  return 0;
}


Measured memory_bytes: 256
n = int(input())
ls = list(map(int, input().split()))

s = ls[0]
a = sum(ls) - ls[0]

ans = abs(s - a)

for i in range(1, n - 1):
	s += ls[i]
	a -= ls[i]
	sa = abs(s - a)
	if sa < ans:
		ans = sa

print(ans)

Measured memory_bytes: 24832
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    public static bool f = false, t = true;
    static void Main(string[] args)
    {
        int[] a = Read.ints();
        int sum = 0;
        for(int i = 1; i <=100; i++)
        {
            if (a[0] < i && i <= a[1] && a[2] < i && i <= a[3]) { sum++; }
        }
        Console.WriteLine(sum);Console.ReadLine();

    }

    public static long gcd(long a, long b)
    {
        while (true)
        {
            if (a == 0) { return b; }
            if (b == 0) { return a; }
            if (a > b) { a -= b; }
            else { b -= a; }
        }
    }
    public static long lcm(long a, long b)
    {
        return a * b / gcd(a, b);
    }
    public static bool IsPrime(long n)
    {
        if (n < 2) return false;
        if (n == 2) return true;

        for (long i = 2; i < Math.Sqrt(n); i++)
        {
            if (n % i == 0) return false;
        }
        return true;
    }

}
public static class Read
{
    public static void outl(string n = "") { Console.WriteLine(n); return; }
    public static long Long()
    {
        return long.Parse(Console.ReadLine());
    }
    public static long[] longs()
    {
        return Console.ReadLine().Split().Select(long.Parse).ToArray();
    }
    public static int Int()
    {
        return int.Parse(Console.ReadLine());
    }
    public static int[] ints()
    {
        return Console.ReadLine().Split().Select(int.Parse).ToArray();
    }
    public static string Str() { return Console.ReadLine(); }
    public static string[] Strs() { return Console.ReadLine().Split(); }
}

Measured memory_bytes: 13268
N = int(input())
playlist = list()
for i in range(N):
    s, t = input().split()
    playlist.append([s, int(t)])
X = input()

#print(playlist, X)
total = 0
found = False
for s, t in playlist:
    if found:
        total += t
    if s == X:
        found = True
print(total)


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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int a, b, c;
  cin >> a >> b >> c;

  cout << (a + b >= c ? "Yes" : "No") << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		setIO();

		int N = ni();
		int[] A = nia(N);
		Arrays.sort(A);
		
		int ans = 0;
		for (int i = 0; i < N; i++) {
			for (int j = i+1; j < N; j++) {
				for (int k = j+1; k < N; k++) {
					if (A[i] != A[j] && A[j] != A[k] && A[i] + A[j] > A[k]) {
						ans++;
					}
				}
			}
		}
		
		out.println(ans);
		
		f.close();
		out.close();
	}
	
	static boolean[] generate(int x, int n) {
		boolean[] s = new boolean[n];
		for (int i = 0; i < n; i++) {
			s[i] = (x & (1 << i)) >> i == 1;
		}
		return s;
	}
	
	static boolean valid(int K, char[][] A, boolean[] h, boolean[] v) {
		for (int i = 0; i < h.length; i++) {
			for (int j = 0; j < v.length; j++) {
				if (h[i] && v[i] && A[i][j] == '#') K--;
			}
		}
		
		return K == 0;
	}

	static BufferedReader f;
	static PrintWriter out;
	static StringTokenizer st;

	static int ni(StringTokenizer st) {
		return Integer.parseInt(st.nextToken());
	}

	static int ni() throws IOException {
		return Integer.parseInt(f.readLine());
	}

	static StringTokenizer nl() throws IOException {
		return new StringTokenizer(f.readLine());
	}

	static int[] nia(int N) throws IOException {
		StringTokenizer st = nl();
		int[] A = new int[N];
		for (int i = 0; i < N; i++)
			A[i] = ni(st);
		return A;
	}

	static void setIn(String s) throws IOException {
		f = new BufferedReader(new FileReader(s));
	}

	static void setOut(String s) throws IOException {
		out = new PrintWriter(new FileWriter(s));
	}

	static void setIn() {
		f = new BufferedReader(new InputStreamReader(System.in));
	}

	static void setOut() {
		out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
	}

	static void setIO(String s) throws IOException {
		setIn(s + ".in");
		setOut(s + ".out");
	}

	static void setIO() {
		setIn();
		setOut();
	}
}


Measured memory_bytes: 33316
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from collections import defaultdict
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def main():
    n = int(input())

    votes = defaultdict(int)

    m = 0
    top = []
    for _ in range(n):
        s = input()
        votes[s] += 1

        if votes[s] > m:
            m = votes[s]
            top = []

        if votes[s] == m:
            top.append(s)

    print(*sorted(top), sep='\n')


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


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

int main()
{

    int x,a,b;
    scanf("%d %d %d",&x,&a,&b);

    a=abs(a-x);

    b=abs(b-x);

    if(a<=b)
    printf("A");

    else printf("B");

    return 0;
}






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

using namespace std;

int main()
{
	long long n;
	cin >> n;
	string s;
	cin >> s;
	string buf;
	buf.push_back(s[0]);
	for (long long i = 1; i < s.size(); i++)
	{
		if (s[i] != s[i - 1])
			buf.push_back(s[i]);
	}

	cout << buf.size() << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
#define ALL(a)  (a).begin(),(a).end()
const ll INF = 1e18+18;
const ll MAX = 200000;
const ll MOD = 1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
static const double pi = 3.141592653589793;



int main(){
    vector<vector<ll>> C(3, vector<ll>(3));
    rep(i,3){
        rep(j, 3){
            cin>>C[i][j];
        }
    }
    bool OK=true;
    if((C[0][0]-C[0][1])-(C[1][0]-C[1][1]))OK=false;
    if((C[1][0]-C[1][1])-(C[2][0]-C[2][1]))OK=false;
    if((C[0][1]-C[0][2])-(C[1][1]-C[1][2]))OK=false;
    if((C[1][1]-C[1][2])-(C[2][1]-C[2][2]))OK=false;
    if((C[0][0]-C[1][0])-(C[0][1]-C[1][1]))OK=false;
    if((C[0][1]-C[1][1])-(C[0][2]-C[1][2]))OK=false;
    if((C[1][0]-C[2][0])-(C[1][1]-C[2][1]))OK=false;
    if((C[1][1]-C[2][1])-(C[1][2]-C[2][2]))OK=false;
    Yes(OK);

}

Measured memory_bytes: 256
N=int(input())
S=input()

class RollingHash():
    BASE1 = 1007
    BASE2 = 2009
    MOD1 = 1000000007
    MOD2 = 1000000009
 
    def __init__(self, s, opt=2):
        self.n = len(s)
        self.opt = opt
        self.hash1 = [0] * (self.n + 1)
        self.power1 = [1] * (self.n + 1)
        if opt == 2:
            self.hash2 = [0] * (self.n + 1)
            self.power2 = [1] * (self.n + 1)
        for i, e in enumerate(s):
            self.hash1[i + 1] = (self.hash1[i] * self.__class__.BASE1 + ord(e)) % self.__class__.MOD1
            self.power1[i + 1] = (self.power1[i] * self.__class__.BASE1) % self.__class__.MOD1
            if opt == 2:
                self.hash2[i + 1] = (self.hash2[i] * self.__class__.BASE2 + ord(e)) % self.__class__.MOD2
                self.power2[i + 1] = (self.power2[i] * self.__class__.BASE2) % self.__class__.MOD2
 
    def get(self, l: int, r: int):
        res1 = self.hash1[r] - self.hash1[l] * self.power1[r - l] % self.__class__.MOD1
        if(res1 < 0):
            res1 += self.__class__.MOD1
        if self.opt == 2:
            res2 = self.hash2[r] - self.hash2[l] * self.power2[r - l] % self.__class__.MOD2
            if(res2 < 0):
                res2 += self.__class__.MOD2
        return (res1, res2) if self.opt == 2 else res1


    
rh = RollingHash(S, opt=1)

def check(n: int):
    d = dict()
    for i in range(N - n + 1):
        p = rh.get(i, i + n)
        if p in d.keys():
            if(i - d[p] >= n):
                return True
        else:
            d[p] = i
    return False
    
ok, ng = 0, N // 2 + 1
while ng - ok > 1:
    mid = (ok + ng) // 2
    if check(mid):
        ok = mid
    else:
        ng = mid
print(ok)


Measured memory_bytes: 4140
import java.util.*;
import java.io.*;

public class Main {
	private static void solve(){
		//Implement solution here.
		boolean[] ba = new boolean[]{true,true,true};
		ba[ni() - 1] = false;
		ba[ni() - 1] = false;
		for(int i = 0; i < 3; i++) {
			if(ba[i])System.out.println(i+1);
		}
		
	}
	
	//Switch input source (stdin/file)
	private static Scanner scanner = new Scanner(System.in);
	public static void main(String[] args){
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				scanner = new Scanner(new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath)))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(scanner.nextLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

Measured memory_bytes: 21588
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeSet;


public class Main {
	
	public static void main(String[] args) throws IOException {	
		try(final Scanner sc = new Scanner(System.in)){
			final long H = sc.nextLong();
			
			long answer = 0;
			long prob = 1;
			for(long r = H; r >= 1; r /= 2) {
				answer += prob;				
				prob *= 2;
			}
			
			System.out.println(answer);
		
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}

Measured memory_bytes: 22608
#!/usr/bin python3
# -*- coding: utf-8 -*-

n, m, v, p = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)

def f(x):
    if x < p:
        return True
    if a[p-1] > a[x] + m:
        return False
    else:
        cnt = m * ((n-x)+(p-1))
        for i in range(p-1, x):
            cnt += min(m, max(0,a[x]+m-a[i]))
        return cnt >= m*v

ok = 0
ng = n
while ng - ok > 1:
    nw = (ok+ng) // 2
    if f(nw):
        ok = nw
    else:
        ng = nw
print(ng)


Measured memory_bytes: 20504
#include <stdio.h>
#include <string.h>

int main() {

    int n, x, l;

    scanf("%d %d", &n, &x);

    int arr[n + 1];
    arr[0] = 0;


    for (int i = 1; i <= n; i++) {
        scanf("%d", &l);
        arr[i] = arr[i - 1] + l;
    }

    int cnt = 0;
    for (int i = 0; i <= n; i++) {
        //printf("%d", arr[i]);
        if (arr[i] <= x) {
            cnt++;
        }
    }
    printf("%d", cnt);

    return 0;
}


Measured memory_bytes: 1700
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		for (long a = 0; a <= 1000; a++) {
			long a5 = a * a * a * a * a;
			for (long b = 0; b <= 1000; b++) {
				long b5 = b * b * b * b * b;
				if (a5 - b5 == x) {
					System.out.println(a + " "+ b);
					return;
				}
				if (-a5 - b5 == x) {
					System.out.println(-a + " "+ b);
					return;
				}
				if (-a5 + b5 == x) {
					System.out.println(-a + " "+ -b);
					return;
				}
				if (a5 + b5 == x) {
					System.out.println(a + " "+ -b);
					return;
				}
			}
		}
	}
}


Measured memory_bytes: 38840
#include <algorithm>
#include <iostream>
using namespace std;
using ll = long long;

int main() {
    ll edge[3];
    bool even = false;
    for (int i = 0; i < 3; ++i) {
        cin >> edge[i];
        if (edge[i] % 2 == 0) even = true;
    }
    sort(edge, edge + 3);
    cout << (even ? 0 : edge[0] * edge[1]) << endl;
    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
#define INF 2000000000
typedef long long int ll;
typedef pair<ll,ll> ii;
typedef pair<ii,ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
#define getbit(n,i) (((n)&(1<<(i)))!=0)
#define setbit0(n,i) ((n)&(~(1<<(i))))
#define setbit1(n,i) ((n)|(1<<(i)))
#define togglebit(n,i) ((n)^(1<<(i)))
#define lastone(n) ((n)&(-(n)))
#define read freopen("debug\\in.txt","r",stdin)
#define write freopen("debug\\out.txt","w",stdout)
#define fi first
#define se second
#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("%d%d",&a,&b)
#define PI (acos(-1))
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL)
#define mod (1000000007)
#define asz 500005
#define pb push_back
#define ppf pop_front
#define ppb pop_back
#define pf push_front
   
int main()
{
    fastread;
    ll a,b,c;
    cin>>a>>b>>c;
    ll sum=a+b+c;
    if(a==b&&a!=c)
    cout<<"Yes";
    else if(b==c&&a!=b)
    cout<<"Yes";
    else if(c==a&&a!=b)
    cout<<"Yes";
    else
    cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF         1e9
#define INFLL       1e18
#define EPS         1e-9
#define REP(i,n)    for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(ll i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP(n)     cout<<fixed<<setprecision(n)
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

signed main()
{
	double t1, t2;
	while (cin >> t1 >> t2) {
		cout << (
			t1 < 35.50 && t2 < 71.00 ? "AAA" :
			t1 < 37.50 && t2 < 77.00 ? "AA" :
			t1 < 40.00 && t2 < 83.00 ? "A" :
			t1 < 43.00 && t2 < 89.00 ? "B" :
			t1 < 50.00 && t2 < 105.00 ? "C" :
			t1 < 55.00 && t2 < 116.00 ? "D" :
			t1 < 70.00 && t2 < 148.00 ? "E" : "NA"
			) << endl;
	}
}



Measured memory_bytes: 3212
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

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

int main() {

    int N, Z, W;
    cin >> N >> Z >> W;
    vector<ll> a(N);
    REP(i, N) cin >> a[i];
    if (N == 1){
        cout << abs(W - a[0]) << endl;
        return 0;
    }

    cout << max(abs(a[N-2] - a[N-1]), abs(a[N-1] - W)) << endl;

    return 0;
}

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

int main(){
  int N,K;cin>>N>>K;
  int dp[110000];
  for(int i=0;i<110000;i++)  dp[i]=1000000000;
  int h[N];
  for(int i=0;i<N;i++) cin>>h[i];
  
  dp[0]=0;
  dp[1]=abs(h[1]-h[0]);
  //cout<<dp[0]<<endl<<dp[1]<<endl;
  
  for(int i=2;i<N;i++){
    int m=1000000000;
    for(int k=1;k<=K;k++){
      //cout<<m;
      if(k<=i)
        m=min(m,dp[i-k]+abs(h[i]-h[i-k]));
    }
    dp[i]=m;
  }
  
  cout<<dp[N-1]<<endl;
}

Measured memory_bytes: 1024
import sys
import collections
input = sys.stdin.readline
n,k = map(int,input().split())

A = list(map(int,input().split()))
sum = 0
c = collections.Counter(A)
c = c.most_common()
if len(c) > k:
  a = len(c)-k
  c = c[-a:]
  for i in range(a):
    sum += c[i][1]
  print(sum)
else:
  print(0)

Measured memory_bytes: 39532
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define min_3(a,b,c) min(a,min(b,c))
#define max_3(a,b,c) max(a,max(b,c))
#define mp1(a,b,c) P1(a,P(b,c))
#define pque(a) priority_queue<a>
#define rpque(a) priority_queue<a,vector<a>,greater<a>>

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};
const int kaijou[10]={1,1,2,6,24,120,720,5040,40320,362880};

int main(){
	static ll n,t;
	static ll x[52][2],y[52][2],z[52][2];
	
	scanf("%lld%lld",&n,&t);
	rep(i,n){
		scanf("%lld",&x[i][0]);
		scanf("%lld",&y[i][0]);
		scanf("%lld",&z[i][0]);
		scanf("%lld",&x[i][1]);
		scanf("%lld",&y[i][1]);
		scanf("%lld",&z[i][1]);
	}
	
	static vector<ll> Zx,Zy,Zz;
	rep(i,n){
		Zx.pb( x[i][0] );
		Zx.pb( x[i][1] );
		Zy.pb( y[i][0] );
		Zy.pb( y[i][1] );
		Zz.pb( z[i][0] );
		Zz.pb( z[i][1] );
	}
	sor(Zx); uniq(Zx);
	sor(Zy); uniq(Zy);
	sor(Zz); uniq(Zz);
	
	static ll imos[102][102][102] = {};
	
	rep(i,n){
		ll x1 = lb(Zx,x[i][0]) - Zx.begin();
		ll x2 = lb(Zx,x[i][1]) - Zx.begin();
		ll y1 = lb(Zy,y[i][0]) - Zy.begin();
		ll y2 = lb(Zy,y[i][1]) - Zy.begin();
		ll z1 = lb(Zz,z[i][0]) - Zz.begin();
		ll z2 = lb(Zz,z[i][1]) - Zz.begin();
		imos[x1][y1][z1] ++;
		imos[x1][y1][z2] --;
		imos[x1][y2][z1] --;
		imos[x2][y1][z1] --;
		imos[x1][y2][z2] ++;
		imos[x2][y1][z2] ++;
		imos[x2][y2][z1] ++;
		imos[x2][y2][z2] --;
	}
	
	rep1(i,101)rep(j,102)rep(k,102)imos[i][j][k] += imos[i-1][j][k];
	rep(i,102)rep1(j,101)rep(k,102)imos[i][j][k] += imos[i][j-1][k];
	rep(i,102)rep(j,102)rep1(k,101)imos[i][j][k] += imos[i][j][k-1];
	
	static ll ret = 0;
	
	rep(i,Zx.size()){
		rep(j,Zy.size()){
			rep(k,Zz.size()){
				if(imos[i][j][k] >= t){
					ret += (Zx[i+1]-Zx[i]) * (Zy[j+1]-Zy[j]) * (Zz[k+1]-Zz[k]);
				}
			}
		}
	}
	
	printf("%lld\n",ret);
}

Measured memory_bytes: 9508
#include<bits/stdc++.h>
//#pragma GCC optimize("O3")
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(x) x.begin(), x.end()
#define pb push_back
#define eb emplace_back

using namespace std;
using ll=long long;
// using ll=int;

const ll mod = (ll)(1e9+7);

typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;

int main(){

    /*
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("myoutput.txt", "w", stdout);
    #endif
    */

    fast;
    ll t = 1;
    // cin >> t;
    while(t--){
        ll a[3]; cin >> a[0] >> a[1] >> a[2];
        sort(a, a+3);
        if((a[0] == a[1] && a[1] != a[2]) || (a[2] == a[1] && a[1] != a[0])) cout << "Yes" << endl;
        else cout << "No" << endl;
        
    }
    // cerr << (double)clock()/CLOCKS_PER_SEC << endl;
    return 0;
}

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

using namespace std;

int main() {
  int n; cin >> n;
  vector <int> cnt(n, 0);
  for(int i = 1; i < n; i++) {
    for(int j = i; j < n; j += i) {
      cnt[j]++;
    }
  }
  int ans = 0;
  for(int i = 1; i < n; i++) {
    ans += cnt[i];
  }
  cout << ans << '\n';
}

Measured memory_bytes: 7124