akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define pb              push_back
#define ppb             pop_back
#define endl            '\n'
#define mii             map<ll,ll>
#define pii             pair<ll,ll>
#define vi              vector<ll>
#define vs              vector<string>
#define all(a)          (a).begin(),(a).end()
#define F               first
#define S               second
#define sz(x)           ((ll)x.size())
#define hell            (1000000007)
#define inf             ((ll)5e18 + 5)
#define PI              ((double)3.14159265358979323844)
#define DECIMAL(n)      cout << fixed << setprecision(n);
#define rep(i,a,b)      for (ll i=a;i<b;i++)
#define repr(i,a,b)     for (ll i=a-1;i>=b;i--)
#define bitcount(a)     (ll)__builtin_popcount(a)
#define lbnd            lower_bound
#define ubnd            upper_bound
#define mp              make_pair
#define ios             ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ordered_set     tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define trace(...)      __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}

using namespace std;
using namespace __gnu_pbds;

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

//primes for hashing 937,991,1013,1409,1741

void solve() {
    ll d, t, s;
    cin>>d>>t>>s;
    if (d>s*t) {
        cout<<"No"<<endl;
        return;
    }
    cout<<"Yes"<<endl;
}

signed main() {
    ios
    ll test=1;
    //cin>>test;
    while (test--) solve();
    return 0;
}

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

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, min = INT_MAX, sum = 0, num;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> num;
		if(num <= min){
			sum++;
			min = num;
		}
	}
	cout << sum;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define MOD 1000000007
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define ALL(v) v.begin(), v.end()
typedef long long ll;

int main(){
    ll n,ans=0;cin >> n;
    for(int i=1;i<=n;i++){
        if(i%3!=0 and i%5!=0)ans+=i;
    }
    cout << ans << endl;
}

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

int main() {
  int n;
  cin >> n;
  long long d = 100000;
  for (int i = 0; i < n; ++i) {
    d *= 1.05;
    if (d % 1000) { d += 1000 - d % 1000; }
  }
  cout << d << endl;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); i++)
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())
#define sort_g(v) sort(all(v), greater<int>())
#define dump(x) cerr << #x << ' ' << '=' << ' ' << x << endl

int main() {
    ll N;
    cin >> N;

    ll cnt = 0;
    if(N % 2 == 0) {
        while(N) {
            N /= 5;
            cnt += N / 2;
        }
    }

    cout << cnt << endl;
}

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

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);i--)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
//constexpr long long MOD = (ll) 1e9 + 7;
constexpr long long MOD = 998244353LL;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve(){
    ll n;
    cin>>n;

    vec<string> s(n);
    REP(i,n) cin>>s[i];

    vvec<P> t(4);

    REP(i,n){
        ll m=s[i].size();

        ll con0=0;
        ll pre=0;
        REP(j,m){
            if(s[i][j]==')'){
                if(pre>0) pre--;
                else con0++;
            }else{
                pre++;
            }
        }

        ll con1=0;
        pre=0;
        REP2(j,m){
            if(s[i][j]=='('){
                if(pre>0) pre--;
                else con1++;
            }else{
                pre++;
            }
        }

        if(con0==0) t[0].push_back({con0,-con1});
        else if(con1==0) t[3].push_back({con1,-con0});
        else if(con0<con1) t[1].push_back({con0,-con1});
        else t[2].push_back({con1,-con0});
    }
    REP(i,4) sort(all(t[i]));
    
    ll now0=0;
    REP(i,2){
        ll m=t[i].size();
        REP(j,m){
            auto [l,r] = t[i][j];
            if(now0 < l){
                cout<<"No"<<en;
                return;
            }
            now0-=l;
            now0-=r;
        }
    }

    ll now1=0;
    rep2(i,2,4){
        ll m=t[i].size();
        REP(j,m){
            auto [l,r] = t[i][j];
            if(now1 < l){
                cout<<"No"<<en;
                return;
            }
            now1-=l;
            now1-=r;
        }
    }


    if(now0==now1) cout<<"Yes"<<en;
    else cout<<"No"<<en;
}

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

    solve();
    //ll t;cin>>t;REP(i,t) solve();

    return 0;
}

Measured memory_bytes: 50248
import math
A,B=map(int,input().split())
al=A*12.5
ar=(A+0.99)*12.5
bl=B*10
br=(B+0.9)*10
if bl>ar or br<al:
  print(-1)
elif al<bl:
  print(math.ceil(bl))
elif bl<=al:
  print(math.ceil(al))

Measured memory_bytes: 3064
fib_dic = {0:1, 1:1}
def fib(n):
    ans = fib_dic.get(n)
    if ans == None:
        fib_dic[n] = fib(n-1) + fib(n-2)
    return fib_dic[n]

n = int(input())
print(fib(n))


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

int main() {
  int a, b;
  cin >> a >> b;
  cout << max({a+b, a-b, a*b}) << endl;
  return 0;
}


Measured memory_bytes: 3564
#include <iostream>
#include <cmath>
#include <string>
#include <string.h>
#include <cstdlib>
#include <iomanip>
#include <stdio.h>

using namespace std;

int main(){

        int n,*p;

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

        p=(int *)malloc(sizeof(int)*n+1);

        for(int i=0;i<n;i++){
                scanf("%d ",p);
                p++;
        }
        for(int i=0;i<n;i++){
                p--;
                printf("%d",*p);
                if(i<n-1)
                        putchar(' ');
        }
        putchar('\n');

        free(p);

        return 0;
}


Measured memory_bytes: 3192
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N=sc.nextInt();
        int a[]=new int[N];
        for(int i=0;i<N;i++){
            a[i]=sc.nextInt();
        }
        int count=0;
        int b=0;
        boolean ans=false;
        while(count++<=N){
             b=a[b]-1;
             if(b==1){
                 ans=true;
                 break;
             }
        }
        if(ans==false){
            System.out.println("-1");
        }else{
            System.out.println(count);
        }
    }
}


Measured memory_bytes: 50716
#include <cstdio>

int main(){
	int n, m;
	bool a[21][21];
	while(scanf("%d", &n),n){
		int px = 10, py = 10;
		for(int i = 0; i < 21; i++){
			for(int j = 0; j < 21; j++){
				a[i][j] = false;
			}
		}
		for(int i = 0; i < n; i++){
			int x, y;
			scanf("%d%d", &x, &y);
			a[x][y] = true;
		}
		scanf("%d", &m);
		for(int i = 0; i < m; i++){
			char d; int x;
			scanf(" %c%d", &d, &x);
			if(d == 'E'){
				for(int j = 0; j <= x; j++) a[px+j][py] = false;
				px += x;
			} else if(d == 'N'){
				for(int j = 0; j <= x; j++) a[px][py+j] = false;
				py += x;
			} else if(d == 'W'){
				for(int j = 0; j <= x; j++) a[px-j][py] = false;
				px -= x;
			} else{
				for(int j = 0; j <= x; j++) a[px][py-j] = false;
				py -= x;
			}
		}
		bool ok = true;
		for(int i = 0; i < 21; i++){
			for(int j = 0; j < 21; j++){
				if(a[i][j]) ok = false;
			}
		}
		if(ok) printf("Yes\n");
		else printf("No\n");
	}
}

Measured memory_bytes: 1012
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    int ss=s.lastIndexOf("s");
    if(ss==s.length()-1)System.out.println(s+"es");
    else System.out.println(s+"s");
  }
}

Measured memory_bytes: 38424
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i > 0; i++)

using ll=long long;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int ans =0;
  if(n<105) ans=0;
  else if(n<135) ans=1;
  else if(n<165) ans=2;
  else if(n<189) ans=3;
  else if(n<195) ans=4;
  else ans=5;
  cout << ans << endl;
}


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

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<vector<int>> A(2, vector<int>(N));
  for (size_t i = 0; i < 2; i++) {
    for (size_t j = 0; j < N; j++) {
      cin >> A[i][j];
    }
  }
  int max = 0;
  for (size_t i = 0; i < N; i++) {
    int sum = 0;
    for (size_t j = 0; j < N; j++) {
      if (i == j) {
        sum += A[0][j];
      }
      sum += A[i <= j ? 1 : 0][j];
    }
    if (sum > max) {
      max = sum;
    }
  }

  cout << max << endl;
  return 0;
}


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

int a[33] = {0, 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

int main() {
	int n;
	scanf("%d", &n);
	printf("%d\n", a[n]);
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define all(x) (x).begin(),(x).end()
#define S(x) (int)(x).size()
#define L(x) (int)(x).length()
#define debug(x) cerr << #x << " " << x << endl;
#define debug_p(x) cerr << #x << " [" << x.fi << " " << x.se << "]"<<endl;
#define debug_v(x) {cerr << #x << " "; for (auto ioi : x) cerr << ioi << " "; cerr << endl;}
#define debug_vp(x) {cerr << #x << " "; for (auto ioi : x) cerr << '[' << ioi.fi << " " << ioi.se << ']'; cerr << endl;}
#define debug_v_v(x) {cerr << #x << "/*\n"; for (auto ioi : x) { for (auto ioi2 : ioi) cerr << ioi2 << " "; cerr << '\n';} cerr << "*/" << #x << endl;}
#define gen_clock(x) ll x = clock(); cerr << "Clock " << #x << " created" << endl;
#define check_clock(x) cerr << "Time spent in " << #x << ": " << (double)(clock() - x)/CLOCKS_PER_SEC << endl; x = clock();
#define reset_clock(x) x = clock()

const int mod = 1e9+7;
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;

int a[200009],vis[200009];

void solve()
{
	ll n,k;
	cin>>n>>k;
	int i;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	vis[1]=1;
	vi cycle;
	int st=1;
	cycle.pb(1);
	i=a[1];
	while(1)
	{
		vis[i]=1;
		cycle.pb(i);
		i=a[i];
		if(vis[i])
		{
			st=i;
			break;
		}
	}
	for(i=0;i<S(cycle);i++)
	if(cycle[i]==st) break;
	int norm=i;
	if(k<=i)
	cout<<cycle[k];
	else
	{
		k-=norm;
	k=k%(S(cycle)-norm);
	cout<<cycle[k+norm];
}
}

int main()
{
	IOS
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
}


Measured memory_bytes: 5736
#include <bits/stdc++.h>
#define rep2(i,x,y) for (int i = x; i < (y); ++i)
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
int INF = 100100101;
int main()
{
  ios::sync_with_stdio(false);  cin.tie(0); cout.tie(0);
  int h=1, w=1;
  while(h != 0 || w != 0){
    cin >> h >> w;
    rep(i, h){
      if(i == 0){
        rep(j, w){
          cout << "#";
        }
        // cout << endl;
      }
      else if(i == h-1){
        rep(j, w){
          cout << "#";
        }
        // cout << endl;
      }
      else{
        cout << "#";
        rep(j, w - 2){
          cout << ".";
        }
        cout << "#";
        // cout << endl;
      }
      cout << endl;
    }
    if(h == 0 && w == 0) break;
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 3160
use std::io::stdin;
use std::time::SystemTime;

fn main() {
    let ny: Vec<u64> = read().split(" ").map(|n| n.parse().unwrap()).collect();
    let a = ny[0];
    let b = ny[1];
    let c = ny[2];
    if (a < b && a < c && c < b) || (a > b && a > c && c > b) {
        println!("Yes")
    } else {
        println!("No")
    }
}

fn read() -> String {
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}


Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
#include <climits>
#include <vector>
using namespace std;

#define ll long long int

const int MOD = 1000000007;

int max(int a, int b) {

	if (a > b)return a;
	else return b;

}
int main() {

	int N, T[105], M, P[105], X[105], all_time = 0;

	cin >> N;
	for (int i = 1; i <= N; i++) {

		cin >> T[i];
		all_time += T[i];

	}
	cin >> M;
	for (int i = 1; i <= M; i++) {

		cin >> P[i] >> X[i];

	}

	for (int i = 1; i <= M; i++) {

		cout << all_time - T[P[i]] + X[i] << endl;

	}

	return 0;
}

Measured memory_bytes: 256
// Hail god Yato
 
#include <bits/stdc++.h> 
using namespace std;
 
#define hs ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = 1e18;
const ll MAX = 200008;
//
//

      ll mpow(ll x,ll y){
        ll res = 1LL;
        x%=MOD;
        while(y){
            if(y&1){
                res = res*x;
                res%=MOD;
            }
            y>>=1;
            x=x*x;
            x%=MOD;
        }
        return res;
    }

ll fst[MAX], snd[MAX];
map<pair<ll, ll>, ll> m;
pair<ll, ll> check(int idx){
    ll x = fst[idx], y = snd[idx];
    if(x == 0 && y == 0)
        return {0, 0};
    ll g = __gcd(x, y);
    x /= g;
    y /= g;
    if(y < 0)
        x *= -1, y *= -1;
    if(x == 0)
        y = 1;
    if(y == 0)
        x = 1;
    return {x, y};
}
pair<ll, ll> opp(pair<ll, ll> pairs){
    ll x = pairs.first, y = pairs.second;
    swap(x, y);
    if(x == 0 && y == 0)
        return {0, 0};
    x *= -1;
    if(y < 0)
        x *= -1, y *= -1;
    if(x == 0)
        y = 1;
    if(y == 0)
        x = 1;
    return {x, y};
}
void solve(){
    // cout<<mpow(2, 3);
    int n;
    cin>>n;
    for(int i = 0; i < n; i++){
        cin>>fst[i]>>snd[i];
        m[check(i)]++;
    }
    ll ans = 1;
    map<pair<ll, ll>, ll> vis;
    for(auto &itr : m){
        if(vis[itr.first] == 1)
            continue;
        pair<ll, ll> zero = {0, 0};
        if(itr.first == zero)
            continue;
        vis[itr.first] = 1;
        pair<ll, ll> oppo = opp(itr.first);
        if(m.count(oppo)){
            ll plus = itr.second;
            vis[oppo] = 1;
            ll minus = m[oppo];
            ans *= (mpow(2, plus) + mpow(2, minus) - 1);
        }
        else{
            ans *= mpow(2, itr.second);
        }
        ans %= MOD;
    }
    ans -= 1;
    ans += MOD;
    ans += m[{0, 0}];
    ans %= MOD;
    cout<<ans;
}
int main(){ 
        hs;
        ll t;
        t=1;
        // cin>>t;
        for (int i=1; i<=t; i++){
                //cout<<"Case #"<<i<<": ";
                solve();
         }
        return 0; 
}

Measured memory_bytes: 31608
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int[] a = new int[n];
        for (int i = 0 ; i < n ; i++) {
            a[i] = sc.nextInt();

        }
        if (n == 2) {
            System.out.println(Math.max(a[0], a[1]));
            return;
        }

        //a0カエルケース
        int gcd1 = a[1];
        for (int i = 1 ; i < n ; i++) {
            gcd1 = gcd(gcd1, a[i]);
        }

        //a0変えないケース、a0の約数を求めたいお気持ち
        //約数の列挙エラトステネスの篩で割り切れたときの商も詰めてくとできる。
        Set<Integer> set = new HashSet<>();
        double sqrt = Math.floor(Math.sqrt(a[0]));
        for (int i = 1 ; i <=  sqrt ; i++) {
            if (a[0] % i == 0) {
                set.add(i);
                set.add(a[0] / i);
            }
        }


        int max = 1;
        //a0の約数が候補なので全探索する。a1~anの中で割り切れなかった個数が1以下のときにそいつが候補
        for (Integer i : set) {
            int count = 0;
            for (int j = 1 ; j < n ; j++) {
                if (a[j] % i != 0) {
                    count++;
                }

            }
            if (count <= 1) {
                max = Math.max(max, i);
            }
        }

        System.out.println(Math.max(gcd1, max));
    }

    private static int gcd(int m, int n) {
        if(m < n) return gcd(n, m);
        if(n == 0) return m;
        return gcd(n, m % n);
    }

}


Measured memory_bytes: 52848
/*********************************************JMD**********************************************/
//                                  |\  |     | |   |   /\                                   //
    //                              | \ |     | |---|  /--\                              //
        //                          |  \| |___| |   | /    \1999                     //
/*******************************************************************************************/
#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;

#define mp make_pair
#define pb push_back
#define pf push_front
#define ss second
#define ff first
#define mem(x,val) memset(x,val,sizeof(x))
#define forr(i,a,b) for(ll i=a;i<b;i++)
#define f(i,n) forr(i,0,n)
#define sz(x) ll((x).size())
#define all(x) ((x).begin(),(x).end())
#define asc(x) ((int)(x))
#define precision(x) cout<<fixed<<setprecision((x));

const ll mod=1e9 + 7;

/*******************************************************************************************/

void solve()
{
    string s;
    cin>>s;
    ll n=s.size();

    ll k;
    cin>>k;

    vector<ll> v;
    ll c=1,i=1;

    while(i<n)
    {
        if(s[i]!=s[i-1])
        {
            v.pb(c);
            c=1;
        }
        else c++;
        i++;
    }
    v.pb(c);

    if(v.size()==1)
    {
        cout<<(n*k)/2<<endl;
        return;
    }

    ll a=0;
    for(auto x:v)
    {
        //cout<<x<<" ";
        a+=(x/2);
    }

    ll ans=a*k;

    if(s[n-1]==s[0])
    {
        if(v[0]%2==0 || v[v.size()-1]%2==0);
        else ans+=k-1;
    }
    cout<<ans<<endl;

    return;
}

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

    ll t=1;
    //cin>>t;
    clock_t launch=clock();

    while(t--)
    {
        solve();
    }

    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    int h,n;
    cin>>h>>n;
    int sum=0;
    while(n--)
    {
        int num;
        cin>>num;
        sum+=num;
    }
    if(sum>=h)
        cout<<"Yes";
    else
        cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
        using namespace std;
        #define int long long
         
        int N;
         
        int rec(int n,bool x3,bool x5,bool x7){
        	if(n > N) return 0;
        	int res = 0;
        	if(n <= N && n != 0 && x3 && x5 && x7) res++;
         
        	res += rec(n*10+3,true,x5,x7);
        	res += rec(n*10+5,x3,true,x7);
        	res += rec(n*10+7,x3,x5,true);
        	return res;
        }
         
        signed main(){
        	cin >> N;
        	cout<<rec(0,false,false,false)<<endl;
        	return 0;
        }

Measured memory_bytes: 256
N = int(input())
ls = [0]*(N+2)

for i in range(1,151):
    for j in range(1,151):
        for k in range(1,151):
            t = i*i + j*j + k*k + i*j + j*k + k*i 
            if t <= N :
                ls[t] += 1

for p in range(1,N+1):
    print(ls[p])

Measured memory_bytes: 9180
s=input()
t=input()


ma=0
for i in range(len(s)):
  cnt=0
  now=s[i:i+len(t)]
  if len(now)!=len(t):
    break


  
  for j in range(len(now)):
    if now[j]==t[j]:
      cnt+=1
  ma=max(cnt,ma)

print(len(t)-ma)


Measured memory_bytes: 9128
#include <iostream>


using namespace std;


int main()
{
	int board[2020];	// [0]は使用不可とする
	int *koma;
	int N, M;
	int in_data;

	// すごろくボードの初期化
	for(int i = 1; i < 2020; i++)
		board[i] = 0;

	// 駒位置の初期化
	cin >> N;
	koma = new int[N];
	for(int i = 0; i < N; i++){
		cin >> koma[i];
		board[koma[i]] = 1;
	}

	// 操作
	cin >> M;
	for(int i = 0; i < M; i++){
		cin >> in_data;
		in_data--;
		if(!board[koma[in_data] + 1] && koma[in_data] <= 2018){
			board[koma[in_data]] = 0;
			board[++koma[in_data]] = 1;
		}
	}

	for(int i = 0; i < N; i++)
		cout << koma[i] << endl;

	return 0;
}


Measured memory_bytes: 3120
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String[] S = new String[N];
		int score = 0;

		for(int i = 0;i < N;i++) {
			S[i] = sc.next();
			if(S[i].equals("Y")) {
				score += 1;
			}
		}

		if(score == 0) {
			System.out.println("Three");
		}else {
			System.out.println("Four");
		}

	}

}


Measured memory_bytes: 21588
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof a) ;
#define vi vector<int>
#define ull unsigned long long
#define ll long long 
#define db double 
#define fl float
#define rep(i,a,b) for(int i=a;i<b;i++)
#define lrep(i,a,b) for(ll i=a;i<b;i++)
#define mod 1000000007
#define mpr make_pair
#define pb push_back
#define fr first
#define sn second
#define bpp(x) __builtin_popcountll(x)
int main()
{
ios_base::sync_with_stdio(false);
cout.tie(0);
cin.tie(NULL);
int ch[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
int k; cin>>k;
cout<<ch[k-1];
}

Measured memory_bytes: 256
n = int(input())
s = str(input())

alfaA = [chr(i) for i in range(65, 65+26)]
alfaB = [chr(i) for i in range(65, 65+26)]

alfa = alfaA + alfaB

ans = []

for i in s:
    ans.append(alfa[alfa.index(i) + n])

print(''.join(ans))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int 	     	  long long   // [9,223,372,036,854,775,807 to -9.....808] 19 digits
#define pb                push_back
#define all(x)            (x).begin(),(x).end()
#define mp                make_pair
#define vi                vector<int>
#define vpi               vector<pair<int,int>>
#define mii               map<int,int>
#define x                 first
#define y                 second
#define mem(a,x)          memset(a,x,sizeof(a))
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define sz(x)             (int)((x).size())

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; // find_by_order()  // order_of_key

//const int32_t hellhsh = 444440583533; const double pi=2*acos(0.0);
const int32_t mod = 1e9+7;
const int32_t maxn=2e5+5;
int inf=1e18;

void solve(){
    int ans=0;
    string s;cin>>s;
    rep(i,0,sz(s)){
        int t=1;
        if(s[i]=='S') continue;
        while(i+1<sz(s) and s[i+1]=='R') t++,i++;
        ans=max(ans,t);
    }
    cout<<ans;
}

signed main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int tc=1,k=1;
    //cin>>tc;
    while(tc--){
        //cout<<"Case #"<<k++<<": ";
        solve();
    }
    return 0;
}

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


   
int main(){
  int n,m;
  cin >> n >> m;
  VI a(m);
  VI b(m);
  rep(i,m){
    cin >> a.at(i) >> b.at(i);
  }
  map<int,int> cntr;
  rep(i,m){
    if(a.at(i)==1){
      if(cntr.count(b.at(i))){
        cntr.at(b.at(i))++;
      }
      else{
        cntr[b.at(i)]=1;
      }
    }
    else if(b.at(i)==n){
      if(cntr.count(a.at(i))){
        cntr.at(a.at(i))++;
      }
      else{
        cntr[a.at(i)]=1;
      }
    }
  }
    bool x=false;
    for(auto p:cntr){
      int k=p.first;
      int v=p.second;
      if(v>=2){
        x=true;
        break;
      }
    }
    if(x)cout << "POSSIBLE" << endl;
    else cout << "IMPOSSIBLE"  << endl;
  }


Measured memory_bytes: 11136
#include<bits/stdc++.h>
#include<boost/dynamic_bitset.hpp>
using namespace std;
using u64 = uint64_t;
using s64 = int64_t;

int main() {
	u64 N, K;
	cin >> N >>K;

	u64 mod = 998244353;
	vector<pair<u64, u64>> S(K);

	for(u64 i=0; i<K; i++) {
		u64 L, R;
		cin >> L >> R;
		S[i] = make_pair(L, R);
	}
	
	vector<u64> sum(N);
	sum[0] = 1;
	u64 dp = 0;

	for(s64 i=1; i<N; i++) {
		dp = 0;

		for(const auto& lr : S) {
			s64 R = i - lr.first;
			if(R >= 0) {
				dp = (dp + sum[R]) % mod;
				s64 L = i - lr.second - 1;
				if(L >= 0) {
					dp = (dp >= sum[L]) ? dp - sum[L] : dp + mod - sum[L];
				}
			}
		}
		
		sum[i] = (sum[i-1] + dp) % mod;
	}

	u64 ans = (sum[N-1] >= sum[N-2]) ? sum[N-1] - sum[N-2] : sum[N-1] + mod - sum[N-2];
	cout << dp << endl;

    return 0;
}


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

ll A, B, Q;

int main()
{
    cin >> A >> B >> Q;
    vector<ll> s(A), t(B);
    for (int i = 0; i < A; i++)
    {
        cin >> s[i];
    }
    for (int i = 0; i < B; i++)
    {
        cin >> t[i];
    }
    for (int i = 0; i < Q; i++)
    {
        ll x;
        cin >> x;
        auto s_ind = distance(s.begin(), lower_bound(s.begin(), s.end(), x));
        auto t_ind = distance(t.begin(), lower_bound(t.begin(), t.end(), x));
        vector<ll> a;
        if (s_ind != A && t_ind != B)
            a.push_back(max(s[s_ind], t[t_ind]) - x);
        if (s_ind != A && t_ind != 0)
        {
            a.push_back(abs(s[s_ind] - x) + 2 * abs(t[t_ind - 1] - x));
            a.push_back(2 * abs(s[s_ind] - x) + abs(t[t_ind - 1] - x));
        }
        if (s_ind != 0 && t_ind != B)
        {
            a.push_back(abs(s[s_ind - 1] - x) + 2 * abs(t[t_ind] - x));
            a.push_back(2 * abs(s[s_ind - 1] - x) + abs(t[t_ind] - x));
        }
        if (s_ind != 0 && t_ind != 0)
        {
            a.push_back(x - min(s[s_ind - 1], t[t_ind - 1]));
        }

        sort(a.begin(), a.end());
        cout << a[0] << endl;
    }
}

Measured memory_bytes: 2944
#include <iostream>
#include <string>
#include <set>
#include <vector>
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<string> v(n);
	set<string> st;
	for (int i = 0; i < n; ++i) {
		cin >> v[i];
		st.insert(v[i]);
	}
	if (st.size() != v.size()) 
	{
		cout << "No" << endl;
		return 0;
	}
	
	char back = v[0].back();
	char front;
	auto itr = v.begin() + 1;
	for (itr; itr != v.end(); ++itr) {
		front = itr->front();
		if (front != back) {
			cout << "No" << endl;
			return 0;
		}
		back = itr->back();
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 256
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr = input.trim().split("\n");
var nmt = arr.shift().split(" ").map(Number);
var a = arr.shift().split(" ").map(Number);
a.length = nmt[0];
var m = nmt[1];
var t = nmt[2];
var sum = 0;
var iti = 0;
var i = 0;
while (i < t) {
   if (iti == 0) {
      if (a.length == 0) {
         //console.log("??????" + i);
         sum++;
         i++;
      } else if (i + m == a[0]) {
         //console.log("??????" + i);
         iti = 1;
         i += m;
         a.shift();
      } else {
         //console.log("??????" + i);
         sum++;
         i++;
      }
   } else if (iti == 1) {
      if (a.length == 0) {
         //console.log("??°???" + i);
         iti = 0;
         i += m;
      } else if (i + 2 * m < a[0]) {
         //console.log("??°???" + i);
         iti = 0;
         i += m;
      } else {
         //console.log("??????" + i);
         i = a[0];
         a.shift();
      }
   }
}
console.log(sum);

Measured memory_bytes: 15696
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
using lint = long long int;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
constexpr int MOD = 1000000007;
const double PI=3.1415926535897932;

int main()
{
    double a, b, x;
    cin >> a >> b >> x;
    x /= a;
    if(x <= a*b/2) {
        double y = 2*x/b;
        double ans = atan(b/y) * 180 / PI;
        cout << setprecision(10) << ans << endl;
    } else {
        double y = 2*x/a - b;
        double z = b - y;
        double ans = atan(z/a) * 180 / PI;
        cout << setprecision(10) << ans << endl;
    }
}

Measured memory_bytes: 256
n, m ,c = gets.chomp.split(" ").map(&:to_i)
b = gets.chomp.split(" ").map(&:to_i)
count = 0
(0...n).each do |i|
    all = c
    a = gets.chomp.split(" ").map(&:to_i)
    (0...m).each do |j|
        all = all + a[j] * b[j]
    end
    if all > 0
        count += 1
    end
end
puts  count

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

using namespace std;

short dp[200009][2020];
int main(){
  string s;
  cin >> s;
  memset(dp, 0, sizeof(dp));
  dp[0][s[0]-'0']++;
  for(int i=1;i<s.length();i++){
    dp[i][s[i]-'0']++;
    for(int j=0;j<2019;j++){
      dp[i][(j*10+s[i]-'0')%2019]+=dp[i-1][j];
    }
  }
  int ans=0;
  for(int i=0;i<s.length();i++){
    ans += dp[i][0];
  }
  cout << ans << endl;
}



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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int N,M;
int deg[100];
signed main(){
    cin>>N>>M;
    rep(i,N){
        cout<<"lst "<<i<<endl;
        cin>>deg[i];
        int a;
        rep(j,deg[i])cin>>a;
    }

    int ans=0;
    rep(i,N)ans+=deg[i]*(deg[i]-1);
    cout<<"ans "<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3088
#include <iostream>

using namespace std;

int N;
int t[22][22];

int solve(int idx)
{
    int res = 0;
    
    for (int i = 0; i < N; i++) {
        if (t[idx][i] > 0) {
            t[i][idx] = 0;
            res = max(res, t[idx][i] + solve(i));
        }
    }
    return res;
}

int main()
{
    while (cin >> N, N) {
        int a, b, cost;
        int sum = 0;

        for (int i = 0; i < N; i++)
            for (int j = 0; j < N; j++)
                t[i][j] = 0;

        for (int i = 0; i < N - 1; i++) {
            cin >> a >> b >> cost;
            t[a - 1][b - 1] = t[b - 1][a - 1] = cost;
            sum += cost * 2;
        }

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

            for (int j = 0; j < N; j++) 
                if (t[i][j] > 0 || t[i][j] == -1) {
                    cnt++;
                    idx = j;
                }

            if (i != 0 && cnt == 1) {
                sum -= 2 * t[i][idx];
                t[i][idx] = t[idx][i] = -1;
            }
        }

        cout << sum - solve(0) << endl;
    }

    return 0;
}

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

int main(){
    double x1,y1,x2,y2;
    cin >> x1 >> y1 >> x2 >> y2;
    double d = sqrt(pow(x1-x2,2.0) +pow(y1 - y2,2.0));
    printf("%f",d);
    return 0;
}



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

#define MAX 100001
typedef long long ll;

ll dp[MAX][3];
ll points[MAX][3];

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

    for(int i = 1; i <= n; i++){
        cin >> points[i][0] >> points[i][1] >> points[i][2];
    }

    for(int i = 0; i < 3; i++) dp[0][i] = 0;
    for(int i = 1; i <= n; i++){
        dp[i][0] = max(dp[i-1][1],dp[i-1][2])+points[i][0];
        dp[i][1] = max(dp[i-1][0],dp[i-1][2])+points[i][1];
        dp[i][2] = max(dp[i-1][0],dp[i-1][1])+points[i][2];
    }

    cout << max(max(dp[n][0],dp[n][1]),dp[n][2]) << endl;
}

Measured memory_bytes: 4992
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 1e5;
const int Inf = 1 << 30;

int main()
{
	int N,ans;
	while(~scanf("%d",&N)){
		ans = 0;
		for(int i = 1;i <= N;i++) ans += i;
		printf("%d\n",ans);
	}
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
typedef long long int ll;
ll cnt,n;
void rekkyo(string s){
 if(s!=""){
  if(stoll(s)>n) return;
  ll k=s.size(),se=0,f=0,t=0;
  for(ll i=0;i<k;i++) {
    if(s[i]=='7') se++;
    if(s[i]=='5') f++;
    if(s[i]=='3') t++;
  }
  if(se>=1&&f>=1&&t>=1) cnt++;
 }
  rekkyo(s+"3");
  rekkyo(s+"7");
  rekkyo(s+"5");
}
int main(){
  cin >> n;
  string s="";
  rekkyo(s);
  cout <<cnt<<endl;
  return 0;
}


Measured memory_bytes: 384
#include "bits/stdc++.h"
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;++i)
#define END(x) (*(x.end()-1))

using namespace std;
typedef long long ll;

template<typename T>
T gcd(T a, T b){
   if (a%b == 0){
       return(b);
   }
   else{
       return(gcd(b, a%b));
   }
}

template<typename T>
T lcm(T a,T b){
    return a*b/gcd(a,b);
}


template<typename T>
bool same(T x_b,T x_e,T y_b,T y_e){
    for(auto i = x_b, j = y_b; i != x_e && j != y_e;++i,++j){
        if(*i!=*j){
            return false;
        }
    }
    return true;
}

int main(void){
    int n,centor=0;
    cin>>n;
    vector<char> s(n);
    vector<char> t(n);
    char t_;
    rep(i,n){
        cin>>s[i];
    }
    rep(i,n){
        cin>>t[i];
    }

    rep(i,n){
        if(same(s.end()-(i+1),s.end(),t.begin(),t.begin()+(i+1))){
            centor=i+1;
        }
    }

   cout<<n*2-centor;
}
/*

*/


Measured memory_bytes: 380
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define PI 3.141592653589793238462643383279502884L
#define make_unique(vec) vec.resize(distance(vec.begin(),unique(vec.begin(),vec.end())))
#define Sort(vec) sort(vec.begin(),vec.end())
#define RSort(vec) sort(vec.rbegin(),vec.rend())
#define endl "\n"
#define tr1(i) cout<<i<<endl;
#define tr2(i,j) cout<<i<<" "<<j<<endl;
#define tr3(i,j,k) cout<<i<<" "<<j<<" "<<k<<endl;
#define vvi vector<vector<int> > 
#define vvl vector<vector<ll> >
#define all(st) st.begin(),st.end()
#define vpl vector<pair<ll,ll> >
#define vpi vector<pair<int,int> >
#define pi pair<int,int>
#define pl pair<ll,ll>
#define al vector<list<int> >
#define vs vector<string>
#define vb vector<bool>
#define vi vector<int>
#define vl vector<ll>
#define vc vector<char>
#define rep(i,l,r) for(int i=l;i<r;i++)
#define repit(st) for(auto it=st.begin();it!=st.end();it++)
#define cs(ans); cout<<setprecision(6)<<fixed<<ans<<endl;
#define ull unsigned long long int
#define eb emplace_back
#define pb push_back
#define ll long long int
#define minf -(1e18)
#define inf 1e18
#define f first
#define se second
#define mod 1000000007
using namespace std;
using namespace __gnu_pbds; 
ll mi(ll n,ll m){ll pw=n%m;ll ex=m-2;ll ans=1;while(ex){if(ex&1) ans = ans*pw%m;pw = pw*pw%m;ex>>=1;}return ans%mod;}
ll pw(ll a,ll n){ll pw=a;ll ex=n;ll ans=1;while(ex){if(ex&1) ans = ans*pw;pw = pw*pw;ex>>=1;}return ans;}
ll pwm(ll a,ll n){ll pw=a%mod;ll ex=n;ll ans=1;while(ex){if(ex&1) ans = ans*pw%mod;pw = pw*pw%mod;ex>>=1;}return ans%mod;}
template<typename T>istream &operator>>(istream &is, vector<T> &v) { for (T &t : v) is >> t; return is; }
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v) { for (const T &t : v) {os << t <<" ";} os << '\n'; return os; }
template<typename T> using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//st.order_of_key(num)->number of elements < num
//st.find_by_order(i)->iterator of ith element in sorted order starting from zero
ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
ll Abs(ll x){return x>0?x:(-x);}
ll Ceil(ll a,ll b){return a/b+(a%b!=0);}
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define mkp make_pair
//#define int long long int
//Binary_Search->dp->greedy
//auto check = [&](ll x){};
struct comp{
	bool operator()(const pair<int,int>&a,const pair<int,int>&b) const {
		if(a.first>b.first) return true;
		if(a.first<b.first) return false; 
		if(a.second<b.second) return true;
		return false;
	}
};
	
void solve(){
	ll x;
	cin>>x;
	for(ll i=0;i<=1000;i++){
		for(int j=-1000;j<=1000;j++){
			ll a=pw(i,5);
			ll b=pw(j,5);
			if((a-b)==x){
				cout<<i<<" "<<j<<endl;
				return;
			}
		}
	}
	
	
	
			
		
	
	
	
		
	
}
int32_t main(){
int t=1;
//scanf("%d",&t);
while(t--){
	solve();
}
return 0;
}    


Measured memory_bytes: 3644
import java.util.Scanner;
import java.util.Arrays;
public class Main{
	public static void main(String[] args){
        new Main().run();
    }
	public void run(){
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int data = scan.nextInt();
			for(int Case = 0;Case < data;Case++){
				int n = scan.nextInt();
				int k = scan.nextInt();
				int[] x = new int[n-1];
				int a = scan.nextInt();
				int b;
				int sum = 0;
				for(int i = 0;i < n-1;i++){
					b = scan.nextInt();
					x[i] = b - a;
					a = b;
					sum += x[i];
				}
				if(n <= k){
					System.out.println(0);
				}else{
					Arrays.sort(x);
					for(int i = 0;i < k-1;i++){
						sum -= x[x.length-1-i];
					}
					System.out.println(sum);
				}
			}
		}
	}
}

Measured memory_bytes: 96524
#include <vector>
#include <iostream>

int main(){
	int i;
	double x[4],y[4],xp,yp;
	double ax,px,ay,py;
	bool left,right;
	
	while(std::cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>xp>>yp){
		x[3]=x[0];
		y[3]=y[0];
		
		left = false;
		right = false;
		
		for(i=0;i<3;i++){
			ax = x[i+1]-x[i];
			ay = y[i+1]-y[i];
			px = xp - x[i];
			py = yp - y[i];
			if(ax*py-px*ay < 0){
				right = true;
			}else{
				left = true;
			}
		}
		
		if(left^right){
			std::cout << "YES" << std::endl;
		}else{
			std::cout << "NO" << std::endl;
		}
	}
}

Measured memory_bytes: 1216
def main():
    n,k = map(int, input().split())
    array = []
    for i in range(k):
        _ = input()
        array.extend(map(int,input().split()))
    array = set(array)
    ans = 0
    for i in range(1,n+1):
        if i in array:
            continue
        else:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 67744
import sys
s = int(input())

if s == 10**18:
    a = [0, 0]
    b = [0, 10**9]
    c = [10**9, 0]

    print(a[0], a[1], b[0], b[1], c[0], c[1])

    sys.exit()
a = [0, 0]

b = [0, 0]

c = [0, 0]

b[0] = int(s ** 0.5) + 1
c[1] = int(s ** 0.5) + 1

abouts = b[0] * c[1]

c[0] = 1
b[1] = abouts - s

print(a[0], a[1], b[0], b[1], c[0], c[1])


Measured memory_bytes: 3188
#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn is_palindrome(s: String) -> bool {
    let bytes = s.as_bytes();
    let len = s.len();
    for i in 0..len / 2 {
        if bytes[i] != bytes[len - 1 - i] {
            return false;
        }
    }
    return true;
}

fn main() {
    let s: String = read();
    let n = s.len();
    let front = &s[..n / 2];
    let rear = &s[(n + 3) / 2 - 1..];

    if !is_palindrome(front.to_string()) || front != rear {
        println!("No");
    } else {
        println!("Yes");
    }
}


Measured memory_bytes: 4352
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

const int size = 101;
int B[size][size];
int V[size][size];

typedef pair <int, int> PII;
typedef queue <PII> QUEUE;

int main() {
    int w, h;
    while ( cin >> w >> h && w && h ) {
        for ( int i = 0; i < h; ++ i ) {
            for ( int j = 0; j < w; ++ j ) {
                B[i][j] = 0;
                V[i][j] = 0;
            }
        }
        int xs, ys, xg, yg;
        cin >> xs >> ys >> xg >> yg;
        xs --;
        ys --;
        xg --;
        yg --;
        int n;
        cin >> n;
        for ( int i = 0; i < n; ++ i ) {
            int c, d, x, y;
            cin >> c >> d >> x >> y;
            x --;
            y --;
            for ( int j = 0; j < ( d ? 4 : 2 ); ++ j ) {
                for ( int k = 0; k < ( d ? 2 : 4 ); ++ k ) {
                    int nx = x + k;
                    int ny = y + j;
                    B[ny][nx] = c;
                }
            }
        }

//         for ( int i = 0; i < h; ++ i ) {
//             for ( int j = 0; j < w; ++ j ) {
//                 cout << B[i][j];
//             }
//             cout << endl;
//         }
//         cout << endl;

        if ( ! B[ys][xs] || ! B[yg][xg] ) {
            cout << "NG" << endl;
            continue;
        }
        
        PII start( xs, ys );
        V[ys][xs] = 1;
        QUEUE Q;
        Q.push( start );
        bool flag = true;
        while ( ! Q.empty() ) {
            PII node = Q.front();
            Q.pop();

            int x = node.first;
            int y = node.second;

            if ( x == xg && y == yg ) {
                cout << "OK" << endl;
                flag = false;
                break;
            }
            
            const int dx[4] = { 1, -1, 0, 0 };
            const int dy[4] = { 0, 0, 1, -1 };
            for ( int i = 0; i < 4; ++ i ) {
                int nx = x + dx[i];
                int ny = y + dy[i];
                if ( nx < 0 || nx >= w ) continue;
                if ( ny < 0 || ny >= h ) continue;
                if ( B[y][x] != B[ny][nx] ) continue;
                if ( V[ny][nx] ) continue;
                V[ny][nx] = 1;
                PII next( nx, ny );
                Q.push( next );
            }
        }

        if ( flag ) cout << "NG" << endl;
    }
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
using ll = long long;

/*
 string -> int : stoi(S);
 int -> string : to_string(N);
 Sのn文字以降をm文字取り出す : S.substr(n,m)
cout << fixed << setprecision(2) << 3.14 << endl; //3.1

 int: -2,147,483,648 ～ 2,147,483,647 (2×10^9)
 ll: -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 (9×10^18)

*/

int main() {

  double n, count=0, ans=0;
  string s;
 
  cin >> n;
  double pai = 3.1415926535;
  ans=2*n*pai;


  cout << fixed << setprecision(10) << ans << endl;
}

Measured memory_bytes: 3812
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

using namespace std;

const int MAX_Q = 100005;

int Q;
int L[MAX_Q], R[MAX_Q];

bool prime[MAX_Q];
int imos[MAX_Q];

void initPrime()
{
  for(int i = 0; i < MAX_Q; i++) {
    prime[i] = true;
  }

  prime[0] = prime[1] = false;
  for(int i = 2; i <= sqrt(MAX_Q); i++) {
    if(prime[i]) {
      for(int j = 2; i*j < MAX_Q; j++) {
	prime[i*j] = false;
      }
    }
  }

  for(int i = 0; i < MAX_Q; i++) {
    if(i%2 == 1 && prime[i] && prime[(i+1)/2]) {
      imos[i]++;
    }
    if(i > 0) {
      imos[i] += imos[i-1];
    }
  }

}

int main()
{
  initPrime();

  cin >> Q;
  for(int q = 0; q < Q; q++) {
    cin >> L[q] >> R[q];
  }

  for(int q = 0; q < Q; q++) {
    cout << imos[R[q]] - imos[L[q]-1] << endl;
  }

  return 0;
}


Measured memory_bytes: 1920
#include <iostream>
#include <string>
#include <vector>
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include <cmath>
#include <iomanip>
#include <ctype.h>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi >;
using vl = vector<ll>;
using vvl = vector<vl >;
using pairi = pair<int, int>;
using pairl = pair<ll, ll>;

#define TR ","
#define TS " "
#define rep(i,N) for(ll i=0;i<(ll)N;++i)
#define rpt(i,a,b) for(ll i=a;i<(ll)b;++i)
#define all(v) v.begin(), v.end()
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

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

ll lcm(ll x, ll y) {
    return x / gcd(x, y) * y;
}

void printVector(const vector<ll>& vec) {
    for (ll value : vec) {
        cout << value << " ";
    }
    cout << endl;
}

vector<int> IntegerToVector(int bit, int N) {
    vector<int> S;
    for (int i = 0; i < N; ++i) {
        if (bit & (1 << i)) {
            S.push_back(i);
        }
    }
    return S;
}

int main()
{
    IO;

    string N;
    cin >> N;

    int a = N.size();
    int sum = 0;

    rep(i, a) {
        char b = N[i];
        sum += b - '0';
    }

    if (sum % 9 == 0) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }

}

Measured memory_bytes: 3732