akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
#include<complex>
using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	//ios::sync_with_stdio(false); cin.tie(0);
	int n;
	cin >> n;
	int cnt = 0;
	FOR(i, 0, n)
	{
		int a;
		cin >> a;
		if (a & 1) cnt++;
	}

	if (cnt % 2 == 0)
	{
		cout << "YES" << endl;
		return 0;
	}

	cout << "NO" << endl;

}


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

int main(){
  int n,a,b; cin>>n>>a>>b;
  int native=0,foreign=0;
  string s; cin>>s;
  for(int i=0;i<n;i++){
    if(s[i]=='a'){
      native++;
      if((native+min(b,foreign))<=(a+b)) cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    }else if(s[i]=='b'){
      foreign++;
      if((native+foreign)<=(a+b) && foreign<=b) cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    }else{
      cout<<"No"<<endl;
    }
  }
}

Measured memory_bytes: 896
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <limits>
using namespace std;
#define ll long long
#define ld long double
#define pii pair<int,int>
#define x first
#define y second
#define sf scanf
#define pf printf
#define vec vector
#define pb push_back
#define mp make_pair
#define sz(a) int(a.size())
#define all(a) a.begin(),a.end()
#define clr(a,b) memset(a,b,sizeof(a))
#define bin_cnt(x) __builtin_popcount(x)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define rrep(i,b,a) for(int i=b;i>=a;i--)
#define srep(sub,s) for(int sub=s&(s-1);sub;sub=(sub-1)&s)
#define irep(i,a) for(__typeof(a.begin()) i=a.begin();i!=a.end();i++)
#define irrep(i,a) for(__typeof(a.rbegin()) i=a.rbegin();i!=a.rend();i++)
#define inf numeric_limits<int>::max()
#define finf numeric_limits<double>::infinity()
#define eps 1e-8
#pragma GCC optimize ("O3")
#define o3 __attribute__((optimize("O3")))
#pragma comment(linker, "/STACK:32505856")

template<class T> inline T sqr(T a) {return a*a;}
template<class T> inline int gmin(T&a,T b) {if(a>b){a=b;return 1;}return 0;}
template<class T> inline int gmax(T&a,T b) {if(a<b){a=b;return 1;}return 0;}
inline int dcmp(const double &a) {return a>eps?1:(a<-eps?-1:0);}
struct Initializer{Initializer(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}}initializer;

#define N 100010
int n,a,b,cnt;
char st[N];

int main() {
//  cnt = 0;
  while (~sf("%d%d%d",&n,&a,&b)) {
    sf("%s", st+1);
    rep(i,1,n) {
      if (st[i] == 'a') {
        if (a + b > 0) {
          if (a > 0) a--; else b--;
          pf("Yes\n");
        } else pf("No\n");
      } else

      if (st[i] == 'b') {
        if (b > 0) {
          b--;
          pf("Yes\n");
        } else pf("No\n");
      } else pf("No\n");

    }
  }
  return 0;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#define SZ(x) ((int) (x).size())
using namespace std;

typedef long long i64;

vector<int> genPrimes(int n) {
    vector<bool> isPrime(n, true);
    for (int i = 2; i * i <= n; ++i) {
        if (isPrime[i]) {
            for (int j = i * i; j <= n; j += i) {
                isPrime[j] = false;
            }
        }
    }
    vector<int> ret;
    for (int i = 2; i <= n; ++i) {
        if (isPrime[i]) {
            ret.push_back(i);
        }
    }
    return ret;
}

int main() {
    #ifdef LOCAL_RUN
    freopen("task.in", "r", stdin);
    freopen("task.out", "w", stdout);
    //freopen("task.err", "w", stderr);
    #endif // ONLINE_JUDGE
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;

    vector<int> primes = genPrimes(3000);

    map<int64_t, int> cnt;
    map<int64_t, int64_t> complement;
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        int64_t x;
        cin >> x;

        int64_t px = 1;
        int64_t vx = 1;
        for (int64_t p: primes) {
            if (p * p > x) {
                break;
            }
            if (x % p == 0) {
                int k = 0;
                while (x % p == 0) {
                    k++;
                    x /= p;
                }
                k %= 3;
                if (k > 0) {
                    int r = (3 - k);
                    while (k-- > 0) {
                        px *= p;
                    }
                    while (r-- > 0) {
                        vx *= p;
                    }
                }
            }
        }
        if (x != 1) {
            int64_t sq = sqrt(x);
            if (sq * sq == x) {
                px *= sq * sq;
                vx *= sq;
            } else {
                if (x > 100000) {
                    ans++;
                    continue;
                }
                px *= x;
                vx *= (int64_t) x * x;
            }
        }
        complement[px] = vx;
        complement[vx] = px;
        cnt[px]++;
        cnt[vx];
    }
    for (const pair<int64_t, int>& p: cnt) {
        int64_t cmpl = complement[p.first];
        if (p.first < cmpl) {
            ans += max(p.second, cnt[cmpl]);
        }
    }
    if (cnt[1]) {
        ans++;
    }
    cout << ans << '\n';
}

Measured memory_bytes: 20864
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		double[] ca = new double[] {35.5,37.5,40,43,50,55,70};
		double[] cb = new double[] {71,77,83,89,105,116,148};
		String[] c  = new String[] {"AAA","AA","A","B","C","D","E","NA"};
		while(stdIn.hasNext()) {
			double a = stdIn.nextDouble();
			double b = stdIn.nextDouble();
			
			int ar = 100;
			int br = 100;
			for(int i = 0; i < ca.length; i++) {
				if(ca[i] > a) {
					ar = i;
					break;
				}
			}
			for(int i = 0; i < cb.length; i++) {
				if(cb[i] > b) {
					br = i;
					break;
				}
			}
			
			int ans = Math.max(ar, br);
			if(ans == 100) {
				ans = c.length-1;
			}
			
			System.out.println(c[ans]);
			
			
			
			
		}
	}
}

Measured memory_bytes: 20580
import java.util.*;

public class Main {
    public void main(Scanner sc) {
        int n = sc.nextInt();

        int sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }

        System.out.println(sum == 1 ? 10 : sum);
    }

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


Measured memory_bytes: 23252
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;

public class Main {

    private static final int MOD = 1_000_000_007;
    private static final int INF = Integer.MAX_VALUE / 2;

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] X = sc.next().toCharArray();

        int sum = 0;
        int sequence = 0;
        char prev = '0';
        for (int i = 0; i < X.length; i++) {
            if (X[i] == 'S') {
                sequence++;
            } else if (X[i] == 'T') {
                if (sequence > 0) {
                    sequence--;
                    sum++;
                }
            }
        }

        System.out.println(X.length - sum * 2);
    }

    public static class Scanner {
        private BufferedInputStream inputStream;

        public Scanner(InputStream in) {
            inputStream = new BufferedInputStream(in);
        }

        public int nextInt() throws IOException {
            int num = 0;

            int read = skip();
            do {
                num = num * 10 + (read - 0x30);
            } while ((read = inputStream.read()) > 0x20);

            return num;
        }

        public int[] nextInt(int n) throws IOException {
            int[] array = new int[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextInt();
            }

            return array;
        }

        public long nextLong() throws IOException {
            long num = 0;

            int read = skip();
            do {
                num = num * 10 + (read - 0x30);
            } while ((read = inputStream.read()) > 0x20);

            return num;
        }

        public long[] nextLong(int n) throws IOException {
            long[] array = new long[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextLong();
            }

            return array;
        }

        public String next() throws IOException {
            StringBuilder builder = new StringBuilder();

            int read = skip();
            do {
                builder.append((char) read);
            } while ((read = inputStream.read()) > 0x20);

            return builder.toString();
        }

        private int skip() throws IOException {
            int read;
            while ((read = inputStream.read()) <= 0x20)
                ;

            return read;
        }
    }
}


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

using namespace std;

#include <vector>

class UnionFind {
public:
  std::vector<int> data; // sizeとparを同時に管理する
  UnionFind(int size) : data(size, -1) {}

  int find(int x) {
    return data[x] < 0 ? x : data[x] = find(data[x]);
  }

  void unite(int x, int y) {
    int px = find(x);
    int py = find(y);
    if (px != py) {
      if (data[py] < data[px]) std::swap(px, py);
      data[px] += data[py]; data[py] = px;
    }
  }

  bool same(int x, int y) {
    return find(x) == find(y);
  }

  int size(int x) {
    return -data[find(x)];
  }
};


int main() {
  int n, m; cin >> n >> m;
  UnionFind uf(n);
  for (int i = 0; i < m; ++i) {
    int a, b; cin >> a >> b;
    --a; --b;
    uf.unite(a,b);
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    ans = max(ans, uf.size(i));
  }
  cout << ans << endl;
}



Measured memory_bytes: 4048
N = int(input())
n = [[] for i in range(11)]
s = [[] for i in range(11)]
s[0].append('a')
n[0].append(1)
for i in range(10):
    for j in range(len(s[i])):
        for k in range(n[i][j]+1):
            temp = s[i][j]
            s[i+1].append(temp + chr(97+k))
            if k == n[i][j]:
                n[i+1].append(n[i][j]+1)
            else:
                n[i+1].append(n[i][j])

for i in range(len(s[N-1])):
    print(s[N-1][i])

Measured memory_bytes: 127120
#include <bits/stdc++.h>
#define exrep(i, a, b) for(long long i = a; i <= b; i++)
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
ll gcd(ll x , ll y){
  if(x%y==0)return y;
  return gcd(y,x%y);
}
ll lcm(ll x, ll y){
  return x/gcd(x,y)*y;
}
ll modpow(ll a, ll n){
  if(n==0)return 1;
  if(n%2==0){
    ll t=modpow(a,n/2);
    return t*t%MOD;
  }
  return a*modpow(a,n-1)%MOD;
}
ll modinv(ll a){
  return modpow(a,MOD-2);
}
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
struct UnionFind {
    vector<int> par; // 親ノード
    vector<int> rank; // ランク

    UnionFind(int n = 1) {
        init(n);
    }

    void init(int n = 1) {
        par.resize(n); rank.resize(n);
        for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0;
    }

    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            return par[x] = r;
        }
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        return true;
    }
};
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  ll n;
  cin >> n;
  ll ans=1;
  rep(i,n){
    ll t;
    cin >> t;
    ans=lcm(ans,t);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    string s;
    cin>>s;
    if(s=="SUN"){
        cout<<7;
        return 0;
    }else if(s=="MON"){
        cout<<6;
        return 0;
    }else if(s=="TUE"){
        cout<<5;
        return 0;
    }else if(s=="WED"){
        cout<<4;
        return 0;
    }else if(s=="THU"){
        cout<<3;
        return 0;
    }else if(s=="FRI"){
        cout<<2;
        return 0;
    }else if(s=="SAT"){
        cout<<1;
        return 0;
    }
}


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

using namespace std;

int main()
{
    int cnt = 0, answer = 0;
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C')
        {
            cnt++;
        }
        else
        {
            cnt = 0;
        }
        answer = max(answer, cnt);
    }
    cout << answer << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using i64 = long long;

int main() {
    std::vector<int> cnt(4);
    for (int i = 0; i < 3; i++) {
        int a, b;
        std::cin >> a >> b;
        cnt[a - 1]++;
        cnt[b - 1]++;
    }
    bool ret = *std::max_element(cnt.begin(), cnt.end()) <= 2;
    std::cout << (ret ? "YES" : "NO") << std::endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;


public class Main
{
	static class Company
	{
		int no;
		int count;
		boolean is_trade;
	};
	
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		ArrayList<Company> comp = new ArrayList<>();
		for(; ;)
		{
			String input = scanner.nextLine();
			if(input.equals(""))
			{
				break;
			}
			String[] word = input.split(",");
			
			boolean is_add = true;
			for(int i=0; i<comp.size(); i++)
			{
				if(comp.get(i).no == Integer.parseInt(word[0]))
				{
					comp.get(i).count++;
					is_add = false;
					break;
				}
			}
			
			if(is_add)
			{
				Company c = new Company();
				c.no = Integer.parseInt(word[0]);
				c.count = 1;
				c.is_trade = false;
				comp.add(c);
			}
		}
		
		Collections.sort(comp, new CompanyComparator());
		
		for(; scanner.hasNext();)
		{
			String input = scanner.next();
			String[] word = input.split(",");
			
			for(int i=0; i<comp.size(); i++)
			{
				if(comp.get(i).no == Integer.parseInt(word[0]))
				{
					comp.get(i).count++;
					comp.get(i).is_trade = true;
				}
			}
		}
		
		for(int i=0; i<comp.size(); i++)
		{
			if(comp.get(i).is_trade)
			{
				System.out.println(comp.get(i).no +" "+ comp.get(i).count);
			}
		}
	}
	
	static class CompanyComparator implements Comparator<Company>
	{
		@Override
		public int compare(Company o1, Company o2)
		{
			return o1.no<o2.no ? -1: 1;
		}
		
	}
}

Measured memory_bytes: 26040
import sys
input = sys.stdin.readline

def gcd(x,y):
  if x>y: x,y = y,x
  while x:
    x,y = y%x, x
  return y

def lcm(x,y):
  return x*y//gcd(x,y)

N = int(input())
ans = 1
for _ in range(N):
  ans = lcm(ans, int(input()))
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <complex>
#include <string>
#define rep(i, a) for(int i=0;i<a;i++)
using namespace std;

int main(){
    string n, t;
    cin >> n >> t;
    size_t l = n.length();
    int count = 0;
    rep(i, l){
        if(n[i] != t[i]){
            count++;
        }
    }
    cout << count << endl;

    return 0;
}

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

int main()
{
    int a,b,c;
    while(scanf("%d%d%d",&a,&b,&c) == 3)
    {
        if(a - b == 0)
            printf("%d\n",c);
        else if(a - c == 0)
            printf("%d\n",b);
        else
            printf("%d\n",a);
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX=1e6+5;
ll n,m,x;
ll a[MAX];
ll sum[2][MAX];
ll pre[MAX];
int main()
{
    while(cin>>n>>m)
    {
        for(int i=1;i<=n;i++)scanf("%lld",&a[i]);
        sort(a+1,a+1+n);
        for(int i=1;i<=n;i++)
        {
            pre[i]=pre[i-1]+a[i];
            sum[i%2][i]=a[i];
            sum[0][i]+=sum[0][i-1];
            sum[1][i]+=sum[1][i-1];
        }
        while(m--)
        {
            scanf("%lld",&x);
            ll l=1,r=n,mid;
            while(l<r)
            {
                mid=(l+r)>>1;
                ll j=mid-(n-mid);//second的最左端
                if(j<1||a[mid]-x<x-a[j])l=mid+1;
                else r=mid;
            }
            ll en=r-(n-r);
         //   cout<<"::: "<<en<<"   "<<r<<endl;

            ll ans=pre[n]-pre[r-1];
            ans+=sum[en%2][en-1];
            printf("%lld\n",ans);
        }
    }
}


Measured memory_bytes: 12672
#!/usr/bin/env fsharpi

open System;

let readIntN ( str : string ) =
    str.Split(' ')
    |> Array.map System.Int32.Parse

let readInt1 ( str : string ) =
    readIntN str |> fun arr -> arr.[0]

let readInt2 ( str : string ) =
    readIntN str |> fun arr -> (arr.[0],arr.[1])

let readInt3 ( str : string ) =
    readIntN str |> fun arr -> (arr.[0],arr.[1],arr.[2])

let n = readInt1 <| Console.ReadLine()
let ts = readIntN <| Console.ReadLine()
let sum = Array.fold (+) 0 ts
let m = readInt1 <| Console.ReadLine()
fun _ -> Console.ReadLine()
|> Seq.initInfinite
|> Seq.take m
|> Seq.map readInt2
|> Seq.map (fun (p,x) -> sum - ts.[p-1] + x)
|> Seq.iter (fun r -> Console.WriteLine r)


Measured memory_bytes: 13652
//yukicoder@cpp14
//author:luckYrat(twitter:@luckYrat_)
//<ここに一言>

//せんげん！
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <bitset>

#include <cctype>
#include <utility>
#include <climits>


//なまえくーかん！
using namespace std;
using ll = long long;
using P = pair<ll,ll>;

//てーすう！
const int mod = 1000000007;
const int inf = (1<<30)-1;
const ll linf = (1LL<<62LL)-1;
const double EPS = (1e-10);

//でふぁいん！
#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)

//みじかく！
#define pb push_back
#define fir first
#define scn second
#define ednl endl

//いぇすのー！
#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")

//きんぼーnほーこー！！
P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる

計算量は変わらないが楽できるシリーズ
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる
*/
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/gcd(a,b)*b;
}


__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}
int main(){
	int n;cin>>n;
	vector<P> A(n);
	for(int i = 0; n > i; i++){
		cin>>A[i].first;
	}
	for(int i = 0; n > i; i++){
		cin>>A[i].second;
	}
	sort(A.begin(),A.end());
	int ans = 1000000000;
	do{
		int t = 0;
		for(int i = 0; n > i; i++){
			if(A[i].first==1){
				//左利き
				if(A[(i-1<0?i-1+n:i-1)].first==0)t+=A[i].second;
			}else{
				if(A[i+1==n?0:i+1].first==1)t+=A[i].second;
			}
		}
		ans = min(ans,t);
	}while(next_permutation(A.begin(),A.end()));
	cout << ans << endl;
}



Measured memory_bytes: 3232
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define INF 100000000000
#define MOD 100000007 //10^9+7
using namespace std;
using ll = long long;
using P = pair<int, int>;

char s[50][50];
int h, w;

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> s(n,0);
    int d;
    rep(j,k) {
        cin >> d;
        rep(i,d) {
            int tmp;
            cin >> tmp;
            tmp--;
            s[tmp] = 1;
        }
    }

    int ans = 0;
    rep(i,n) {
        if(s[i] == 0)
            ans++;
    }
    cout << ans << endl;
    
    return 0;
}


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

int win(bool a) {
    if (a) cout << "First\n";
    else cout << "Second\n";
    return 0;
}

int lose(bool a) {
    return win(!a);
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    if (n == 1) {
        if (a[0] != 1) return win(1);
        else return lose(1);
    }
    int cnt = 0;
    while (++cnt) {
        int sum = 0; bool one = false;
        for (int i = 0; i < n; i++) {
            sum += a[i] & 1;
            one |= a[i] == 1;
        }
        if (one) break;
        if ((sum & 1) != (n & 1)) return win(cnt&1);
        else if (sum > 1) return lose(cnt&1);
        while (true) {
            int s = 0;
            int g = a[0] - (a[0] & 1);
            for (int i = 0; i < n; i++) {
                g = __gcd(g, a[i]-(a[i]&1));
            }
            for (int i = 0; i < n; i++) {
                a[i] /= g;
                s += a[i] & 1;
            }
            if (s) break;
        }
    }
    int y = 0;
    for (int i = 0; i < n; i++) y = (y + a[i]) & 1;
    if ((n & 1) != y) return win(cnt&1);
    else return lose(cnt&1);
    return 0;
}

Measured memory_bytes: 640
a,b=map(int,input().split())
import fractions
g=fractions.gcd(a,b)
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return set(a)
print(len(prime_factorize(g))+1)


Measured memory_bytes: 5304
#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    
     
N, = getIntList()
#print(N)

T = 2*N

for i in range(1, 1000000000000):
    if i* (i+1) == T:
        break
    if i*(i+1) > T:
        print('No')
        sys.exit()

g = i

res = [ [] for i in range(g+1) ]
ac = 1
for i in range(g+1):
    for j in range(i+1, g+1):
        res[i].append(ac)
        res[j].append(ac)
        ac+=1

print('Yes')
print(len(res))
for x in res:
    print(len(x), end = ' ')
    for y in x:
        print(y,end = ' ')
    print()


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

//#pragma GCC optimize("Ofast")

#define fi first
#define se second
#define ll long long
#define dl double long

using namespace std;

const int NN = 1e9 + 7;
const int N = 2e6 + 7;
const int M = 26;
const ll mod = 1e9 + 7;
const ll inf = 1e18 + 7;
const dl rf = 1e-14;
const int B = sqrt(N);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void solve1()
{
    int l;
    cin >> l;
    int r = 0;
    while( (1 << r) <= l )r += 1;
    r -= 1;
    vector < pair < int , pair < int , int > > > v;
    for( int i = 0; i < r; i++ ){
        v.push_back({ 0 , { i + 1 , i + 2 } });
        v.push_back({ (1 << i) , { i + 1 , i + 2 } });
    }
    int len = l - (1 << r);
    int x = (1 << r);
    for( int i = 0; i < 20; i++ ){
        if( (len & (1 << i)) ){
            v.push_back({ x , { i + 1 , r + 1 } });
            x += (1 << i);
        }
    }
    cout << r + 1 << " " << (int)v.size() << "\n";
    for( auto x : v ){
        cout << x.se.fi << " " << x.se.se << " " << x.fi << "\n";
    }
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    //freopen( "input.txt" , "r" , stdin );
    //freopen( "output.txt" , "w" , stdout );

    int cghf = 1;//cin >> cghf;
    while( cghf-- ){
        solve1();
    }
}


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

int a, b, c, d;

int main(){
  
  cin >> a >> b >> c >> d;
  
  cout << c - (d - b) << ' ' << d + (c - a) << ' ' << a - (d - b) << ' ' << b + (c - a) << endl;
}

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

const int MAX = 1000001;
const int MOD = 1000000007;

int fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

int COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int modpow(int m, int n){
  if(n == 0) return 1;
  else if(n % 2 == 0) return modpow(m * m % MOD, n/2);
  else{
    return modpow(m, n - 1) * m % MOD;
  }
}

signed main(){
	int N, K; cin >> N >> K;
	int ans = modpow(K, N);
	COMinit();
	for(int i = 1; i <= K; i++){
		int rest = K - i;
		int ans1 = COM(K, i) * modpow(rest, N);
		ans1 %= MOD;
		if(i % 2 == 1) ans -= ans1;
		else ans += ans1;
		ans %= MOD;
		if(ans < 0) ans += MOD;
	}
	cout << ans << endl;
}


Measured memory_bytes: 26556
n=int(input())
a=0
b=0
c=0
d=0
for i in range(n):
    s=input()
    a+=s.count('AC')
    b+=s.count('WA')
    c+=s.count('TLE')
    d+=s.count('RE')
print('AC x '+str(a))
print('WA x '+str(b))
print('TLE x '+str(c))
print('RE x '+str(d))

Measured memory_bytes: 9208
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, o, n) for (auto i = (o); (i) < (n); ++(i))
#define FOR1(i, n) FOR(i, 1, n+1)
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (auto i = (n)-1; (i) >= 0; --i)
#define REPI(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define REPIR(itr, v) for (auto itr = v.rbegin(); itr != v.rend(); ++itr)
#define fi first
#define se second
#define ll long long
#define int long long
#define V2(name, h, w) vector<vector<int> > name((h), vector<int>(w));
#define myCeil(dividend, divisor) ceil((double)(dividend) / (double)(divisor))
#define myFloor(dividend, divisor) floor((double)(dividend) / (double)(divisor))
#define calcDigits(num) floor(log10(num))+1

#define dl(line) cerr << "RUN: until " << (line) << "th line." << endl;
#define dv(name, value) cerr << (name) << " is " << (value) << endl;
#define da(v)  cerr << "["; REPI(itr, v){cerr << *itr << (itr != --v.end() ? ", " : "");} cerr << "]" << endl;
#define dpa(v) cerr << "[ " << endl;REPI(itr, v) { cerr << "  [" << (*itr).first << ", " << (*itr).second << ']' << (itr != --v.end() ? "," : "") << endl; } cerr << "]" << endl;


void solve(long long N, long long D, std::vector<std::vector<long long>> X){
  int cnt = 0;

  REP(x1, N) {
    FOR(x2, x1+1, N){
      double distance = 0.0;
      REP(y, D) {
        double num = (X.at(x1).at(y) - X.at(x2).at(y));
        distance += num * num;
      }
      if (sqrt(distance) == ceil(sqrt(distance))) cnt++;
    }
  }

  cout << cnt << endl;
}

signed main(){
  long long N;
  scanf("%lld",&N);
  long long D;
  scanf("%lld",&D);
  std::vector<std::vector<long long>> X(N, std::vector<long long>(D));
  for(int i = 0 ; i < N ; i++){
    for(int j = 0 ; j < D ; j++){
      scanf("%lld",&X[i][j]);
    }
  }
  solve(N, D, std::move(X));
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define fi first
#define se second
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define SZ(x) (int)(x).size()
#define endl '\n'
#define FOR(a, b, c) for (auto a = (b); (a) < (c); ++(a))
#define F0R(a, b) FOR (a, 0, (b))
#define CEIL(a, b) ((a) + (b)-1) / (b)
template <class T>
bool ckmin(T& a, const T& b) {
  return a > b ? a = b, true : false;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, true : false;
}
#ifndef DEBUG
#define DEBUG 0
#endif
#define dout \
  if (DEBUG) std::cerr
#define dvar(...) " [" << #__VA_ARGS__ ": " << mt(__VA_ARGS__) << "] "
template <typename T>
struct IsC {
  template <typename C>
  static char test(typename C::const_iterator*);
  template <typename C>
  static int test(...);
  static const bool value = sizeof(test<T>(0)) == sizeof(char);
};
template <>
struct IsC<string> {
  static const bool value = false;
};
template <typename C>
typename enable_if<IsC<C>::value, ostream&>::type operator<<(ostream&, const C&);
template <typename T1, typename T2>
ostream& operator<<(ostream&, const pair<T1, T2>&);
template <typename... T> using TS = tuple_size<tuple<T...>>;
template<size_t idx, typename... T>
typename enable_if<TS<T...>::value == idx + 1, ostream&>::type
operator<<(ostream& o, const tuple<T...>& t) {
  return o << ", " << get<idx>(t) << ')';
}
template<size_t idx, typename... T>
typename enable_if<0 < idx && idx + 1 < TS<T...>::value, ostream&>::type
operator<<(ostream& o, const tuple<T...>& t) {
  return operator<<<idx + 1>(o << ", " << get<idx>(t), t);
}
template<size_t idx = 0, typename... T>
typename enable_if<1 < TS<T...>::value && !idx, ostream&>::type
operator<<(ostream& o, const tuple<T...>& t) {
  return operator<<<idx + 1>(o << '(' << get<idx>(t), t);
}
template<typename T>
ostream& operator<<(ostream& o, const tuple<T>& t) {
  return o << get<0>(t);
}
template <typename T1, typename T2>
ostream& operator<<(ostream& o, const pair<T1, T2>& p) {
  return o << mt(p.fi, p.se);
}
template <typename C>
typename enable_if<IsC<C>::value, ostream&>::type operator<<(
    ostream& o, const C& c) {
  o << '[';
  for (auto it = c.cbegin(); it != c.cend(); ++it)
    o << *it << (next(it) != c.cend() ? ", " : "");
  return o << ']';
}
template <typename T>
void tprint(vector<vector<T>>& v, size_t width = 0, ostream& o = cerr) {
  if (!DEBUG) return;
  for (const auto& vv : v) {
    for (const auto& i : vv) o << setw(width) << i;
    o << endl;
  }
}

void solve() {
    int x;
    cin >> x;

    int score = 600;
    int kyu = 8;
    while(1) {
        if(x < score) {
            cout << kyu;
            return;
        }
        score += 200;
        kyu--;
    }

}

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

    int tc = 1;
    FOR(i, 1, tc + 1) {
        //cout << "Case #" << i << ": ";
        solve();
    }
}



Measured memory_bytes: 3648
#include <bits/stdc++.h>
#ifdef __DEBUG__
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

ll N;
void input(){
    fast_io();
    cin >> N;
}

int solve(){
    N--;
    string ans;
    while(N>=0){
        ans += (N%26)+'a';
        N/=26;
        N--;
    }
    reverse(ans.begin(),ans.end());
    cout << ans << endl;
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}

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

#define ff first
#define ss second
#define pb push_back

using namespace std;
using ll = long long;
using ii = pair<int, int>;

const int N = 100005;

int main() {
	int n, k;
	scanf("%d %d", &n, &k);
	int ans = 0;
	while(n){
		n /= k;
		ans++;
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;
const double PI = 3.1415926535897932;
const int MOD = 1e9 + 7;

//cin.tie(0);ios::sync_with_stdio(false);
int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  rep (i, n) cin >> p[i];

  ll ans = 0;
  for (int i = 0; i < n; i++) {
    if (i + 1 == p[i]) {
      int tmp  = p[i];
      p[i] = p[i + 1];
      p[i + 1] = tmp;
      ans++;
    }
  }

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


Measured memory_bytes: 3760
#heapq p,qの最小値側にrの最大値入れていく。
#p_changeとq_changeが等しい場合がおかしかったのを直した
import heapq 

#初期入力
X,Y,A,B,C = (int(x) for x in input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))


# ソート⇒無色と比較
p.sort()
q.sort()
r.sort(reverse=True)

ans_sum =sum(p[-X:]) + sum(q[-Y:])
p_hq = p[-X:]
q_hq = q[-Y:]
heapq.heapify(p_hq)
heapq.heapify(q_hq)
p_change =heapq.heappop(p_hq)
q_change =heapq.heappop(q_hq)
count_p =0
count_q =0
for i in r: #rは大きい順
    if i < p_change and i < q_change:
        break
    if p_change <= q_change:
        if  count_p < X:
            heapq.heappush(p_hq,i)
            count_p +=1
            ans_sum = ans_sum -p_change +i
            p_change =heapq.heappop(p_hq)
    elif p_change > q_change:
        if  count_q < Y:
            heapq.heappush(q_hq,i)
            count_q +=1
            ans_sum = ans_sum -q_change +i
            q_change =heapq.heappop(q_hq)
print(ans_sum)

Measured memory_bytes: 23456
#include <iostream>
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <string.h>
//#include <bits/stdc++.h>

using namespace std;

long long a, b, c;
float x, y, z;

int main () {
    cin >> a >> b >> c;
    if ( c - a - b > 0 ) {
        if ( (c - a - b) * (c - a - b) > 4 * a * b ) {
            cout <<"Yes";
        }
        else {
            cout <<"No";
        }
    }
    else {
        cout <<"No";
    }
}


Measured memory_bytes: 888
#include<bits/stdc++.h>
#define ll  long long
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define pb push_back
#define Max(x,y,z) max(x,max(y,z))
#define f first
#define s second
#define lbd lower_bound
#define sz(x)       (ll)x.size()
#define pi 3.1415926536
#define mod 1000000007
using namespace std;
void solve()
{
    ll n,m,k,x,y,res=0,l,cnt=0,sum=0,z,sum1=0,cnt1=0,h,res1,cnt2=0;
   cin>>n>>m>>k;
   ll ar[m];
   rep(i,0,m)
   cin>>ar[i];
   rep(i,0,n)
   {   sum=k;
       rep(j,0,m)
       {
           cin>>x;
           sum+=(x*ar[j]);
       }
       if(sum>0)
        cnt++;
   }
   cout<<cnt;

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


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
int main() {
	int q;
	std::cin >> q;
	std::set<int> set;
	for (int i = 0; i < q; ++i) {
		int t, x;
		std::cin >> t >> x;
		switch (t) {
		case 0: set.insert(x);
			std::cout << set.size() << std::endl;
			break;
		default:
			std::cout << set.count(x) << std::endl;
		}
	}
}


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

int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  for (int i=0; i<N; i++) {
    cin >> S.at(i);
  }
  
  int M;
  cin >> M;
  vector<string> T(M);
  for (int i=0; i<M; i++) {
    cin >> T.at(i);
  }
  
  int score=0;
  
  for (int i=0; i<N; i++) {
    int a=0;
    for (int j=0; j<N; j++) {
      if (S.at(i) == S.at(j)) {
        a++;
      }
    }
    
    for (int j=0; j<M; j++) {
      if (S.at(i) == T.at(j)) {
        a--;
      }
    }
    
    if (a > score) {
      score = a;
    }
  }
  
  cout << score << endl;
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(x) (((long long)x)%modulo)



int main(){
	int N;
	cin>>N;
	vector<pair<int,int>> p(0);
	for(int i=2;i<=1000;i++){
		bool flag = false;
		for(int j=0;j<p.size();j++){
			if(i%p[j].first==0){
				flag=true;
				break;
			}
		}
		
		if(!flag)p.push_back(make_pair(i,0));
	}
	for(int i=2;i<=N;i++){
		int x = i;
		for(int j=0;j<p.size();j++){
			if(x==1)break;
			if(x%p[j].first==0){
				p[j].second++;
				x/=p[j].first;
				j--;
				continue;
			}
		}
	}
	int ans = 1;
	for(int i=0;i<p.size();i++){
		ans=mod(ans*(p[i].second+1));
	}
	
	cout<<ans<<endl;
	
	
	
	return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

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

		int x = 0;
		ArrayList<Integer> list = new ArrayList<>();

		int N = sc.nextInt();
		int X = sc.nextInt();
		//int X = Integer.parseInt(sc.nextLine());
		for (int index = 1; index <= N; index++) {
			//int m = Integer.parseInt(sc.nextLine());
			int m = sc.nextInt();
			list.add(m);
			X = X - m;
		}
		if (X == 0) {
			System.out.println(N);
			return;
		}
		Collections.sort(list);
		int y = X / (list.get(0));
		System.out.println(N + y);
	}
}

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

int main(){
  int K,S;
  cin >> K >> S;

  int ans= 0;
  for(int i=0; i<=K; i++){
    if( i>S ){
      break;
    }
    else if( i+2*K < S ){
      i= S-2*K;
      i--; // continueでのインクリメントを先に相殺
      continue;
    }
    else{
      for(int j=0; j<=K; j++){
        int k= S-i-j;
        if( 0<=k && k<=K ){
          ans++;
        }
      }
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>

using namespace std;

int main(void)
{
    int N, A[110], i;
    double B[110], sum=0;

    cin >> N;

    for(i=1; i<=N; i++){
	cin >> A[i];

	B[i] = 1.0 / (double)A[i];

	sum += B[i];
    }

    cout << setprecision(10) << 1.0/sum << endl;

    return 0;
}

Measured memory_bytes: 256
N,M = map(int, input().split())
r = {}
a = {}
for i in range(M):
    l = input().split()
    p = int(l[0])
    q = l[1]
    w = q + str(p)
    if r.get(p) == 'AC':
        pass
    else:
        r.update([(p, q)])
        if a.get(w) != None:
            a[w] += 1
        else:
            a.update([(w, 1)])
ks = [k for k, v in r.items() if v == 'AC']
wa = 0
ac = 0
for i in ks:
    wk = 'WA' + str(i)
    ak = 'AC' + str(i)
    if a.get(wk) != None:
        wa += a[wk]
    ac += a[ak]
print(ac, wa)

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

int main() {
    int n,k,c;
    string s;
    cin >> n >> k >> c >> s;
    vector<ll> mae(1,0),ushiro(1,0);
    int count=0;
    rep(i,n){
        if(s[i]=='o'){
            mae.push_back(i+1);
            count++;
            i+=c;
        }
        if (count==k) break;
    }
    count=0;
    rep(i,n){
        if(s[n-1-i]=='o'){
            ushiro.push_back(n-i);
            count++;
            i+=c;
        }
        if (count==k) break;
    }
    sort(ushiro.begin(),ushiro.end());
    int ans=0;
    rep(i,k){
        if(mae[i+1]==ushiro[i+1]){
            cout << mae[i+1] << endl;
        }
    }
}

Measured memory_bytes: 8048
#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main() {
	string s;
	cin >> s;
	sort(s.begin(), s.end());
	if (s[0] == s[1] && s[2] == s[3] && s[0] != s[3])cout << "Yes" << endl;
	else cout << "No" << endl;
}


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

int input(){
  char str[10];
  scanf("%s",str);
  
  if(str[0]=='B'){
    return 11;
  }
  
  if(str[0]=='A'){
    if(str[1]=='#')return 10;
    return 9;
  }

  if(str[0]=='G'){
    if(str[1]=='#')return 8;
    return 7;
  }
  
  if(str[0]=='F'){
    if(str[1]=='#')return 6;
    return 5;
  }

  if(str[0]=='E'){
    return 4;
  }

  if(str[0]=='D'){
    if(str[1]=='#')return 3;
    return 2;
  }
  
  if(str[0]=='C'){
    if(str[1]=='#')return 1;
    return 0;
  }

  assert(0);
  return -1;
}

int n,m;
int t[50005];
int u[50005];

int dfs(int depth,int pos){
  if(depth==m&&n<pos+2)return 1;
  if(depth==m)return 0;
  
  if( 1<=pos-1  && (t[pos-1]+11)%12 == u[depth] ){
    if( dfs( depth+1, pos-1 ) ) return 1;
  }

  if( pos+1 <= n && t[pos+1]==u[depth] ){
    if( dfs(depth+1,pos+1) )return 1;
  }

  if( pos+2 <= n && (t[pos+2]+1)%12==u[depth] ){
    if( dfs(depth+1,pos+2) )return 1;
  }

  return 0;
}

int main(){
  int Tc;
  scanf("%d",&Tc);
  while(Tc--){
    scanf("%d %d",&n,&m);
    for(int i=1;i<=n;i++)t[i]=input();
    for(int i=0;i<m;i++)u[i]=input();
    
    int ans=dfs(0,0);
    if(ans)printf("Yes\n");
    else printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 5856
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define ALL(obj) (obj).begin(),(obj).end()
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef priority_queue<int> p_que;
typedef priority_queue<int, vector<int>, greater<int>()> p_que_rev;
// const int INF = INT_MAX;
const lint LINF = LLONG_MAX;
// const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};


int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    string a, s, c;
    cin >> a >> s >> c;
    string ans = "";
    ans = ans + a[0];
    ans = ans + s[0];
    ans = ans + c[0];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define pb push_back
#define mk make_pair
#define fast                    \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define rep(i, a, b) for (ll i = a; i < b; i++)
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define sz(x) (int)x.size()
#define mem(a, val) memset(a, val, sizeof(a))
#define deci(x) cout << fixed << setprecision(x);
#define bitcount(x) __builtin_popcountll(x)

const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};

const long long int mod = 1e9 + 7;
const long double EPS = 1e-12;
const int N = 1e5 + 20;

void solve() {
  ll a;
  cin >> a;
  a += (a * a + a * a * a);
  cout << a;
}
int main() {
  fast;
  ll t;
  t = 1;

  // cin>>t;

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

  return 0;
}
// Problem : B - Minor Change
// Contest : AtCoder - AtCoder Beginner Contest 172
// URL : https://atcoder.jp/contests/abc172/tasks/abc172_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)


Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
  long long a[4];
  cin>>a[0]>>a[1]>>a[2];
  sort(a,a+3);
  if(!(a[2]%2))cout<<0;
  else cout<<a[0]*a[1];
  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;

class Main{
	public static void main(String[] args) {
		SC sc=new SC(System.in);
		int N=sc.nextInt();
		int M=sc.nextInt();
		int K=sc.nextInt();

		for(int i=0; i<=N; i++) {
			for(int j=0; j<=M; j++) {
				int res=i*M+j*N-2*i*j;
				if(res==K) {
					pl("Yes");
					System.exit(0);
				}
			}
		}
		pl("No");
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
}


Measured memory_bytes: 22484