akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <unordered_map>
#define mem(ara, a) memset(ara, a, sizeof(ara))
#define fo freopen("output.txt", "w", stdout)
#define fi freopen("bruh.txt", "r", stdin)
#define int long long
#define sp " "
#define pb push_back
#define ff first
#define sz(x) x.size();
#define len(x) x.length();
#define ss second
#define vi vector<int>
#define double long double
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define pii pair<int, int>


long long inf = 2e18;
long long minf = -inf;
int ans = 0;
using namespace std;

signed main() {
 int k ,a , b;
 cin >> k >> a >> b;
 if(a%k==0){
    cout<<"OK"<<endl;
    exit(0);
 }
int f=((a/k )*k)+k;
if(f>=a and f<=b)cout<<"OK";
else cout<<"NG";

}


Measured memory_bytes: 3572
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>

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

const long long MAX = 5100000;
const long long INF = 1LL << 60;
const long long mod = 1000000007LL;
//const long long mod = 998244353LL;

using namespace std;
typedef unsigned long long ull;
typedef long long ll;


long long extGCD(long long a, long long b, long long& x, long long& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int main()
{
	/*
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	*/

	ll a, b; scanf("%lld %lld", &a, &b);
	ll x, y;
	extGCD(a, b, x, y);
	cout << x << " " << y << endl;
	return 0;
}



Measured memory_bytes: 3228
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PA;
typedef priority_queue<int, vector<int>, greater<int> > PQG;
#define REP(i, a, n) for(ll i = (ll) a;i < (ll) n;i++)
#define fi first
#define se second
#define pb push_back
#define INF 1000000009
#define MOD 1000000007
#define MAXN 103
#define MAXC 100000000000014
#define MAXV 1000000009

int c[3][3];

int main()
{
    REP(i, 0, 3){
        REP(j, 0, 3){
            cin >> c[i][j];
        }
    }
    int sx = c[0][0] - c[0][1];
    int sy = c[0][0] - c[1][0];
    int sx2 = c[2][2] - c[2][1];
    int sy2 = c[2][2] - c[1][2];
    REP(i, 0, 2){
        if(c[0][i] - c[1][i] != sy){
            printf("No\n");return 0;
        }
        if(c[i][0] - c[i][1] != sx){
            printf("No\n");return 0;
        }
    }
    for(int i = 2;i >= 0;i--){
        if(c[2][i] - c[1][i] != sy2){
            printf("No\n");return 0;
        }
        if(c[i][2] - c[i][1] != sx2){
            printf("No\n");return 0;
        }
    }
    printf("Yes\n");

    return 0;
}
















Measured memory_bytes: 384
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;

struct edge {
    ll to, cost;
};

int V;
vector<edge> G[1000000];
ll d[1000000];

void addedge(int st, int ed, ll co) {
    edge e;
    e.to = ed;
    e.cost = co;
    G[st].push_back(e);
}

void dijkstra(int s) {
    priority_queue<plglg, vector<plglg>, greater<plglg> > que;
    fill(d, d + V + 10, llmax);
    d[s] = 0;
    que.push(plglg(0, s));

    while (!que.empty()) {
        plglg p = que.top();
        que.pop();
        ll v = p.second;
        if (d[v] < p.first) {
            continue;
        }
        int len = G[v].size();
        for (int i = 0; i < len; i++) {
            edge e = G[v][i];
            if (d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                que.push(plglg(d[e.to], e.to));
            }
        }
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    V = N;
    REP(i, 0, N - 1) {
        ll a, b, c;
        cin >> a >> b >> c;
        addedge(a - 1, b - 1, c);
        addedge(b - 1, a - 1, c);
    }
    ll Q, K;
    cin >> Q >> K;
    dijkstra(K - 1);
    REP(i, 0, Q) {
        ll x, y;
        cin >> x >> y;
        cout << d[x - 1] + d[y - 1] << endl;
    }
}


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

#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).begin(),(x).end(),greater<int>())
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define dump(x)  cout << #x << " = " << (x) << endl;

typedef long long ll;
typedef pair<int, int> ii;
const int mod = 1e9+7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;

void solve()
{
  int n; cin>>n;
  vector<int> a(n, 0);
  for (int i=0; i<n; i++) {
    cin>>a[i];
  }
  int ans = a[0];
  for (int i=0; i<n; i++) {
    ans = __gcd(ans, a[i]);
  }
  cout << ans << endl;
}

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


Measured memory_bytes: 640
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>
#include <cassert>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main(){
    string s;
    cin >> s;
    stack<char> st;
    int ans = 0;
    rep(i, (int)s.size()) {
        if (st.empty()) {
            st.push(s[i]);
        }
        else if ( st.top() == '0' && s[i] == '1') {
            st.pop();
            ++ans;
        }
        else if ( st.top() == '1' && s[i] == '0' ) {
            st.pop();
            ++ans;
        }
        else {
            st.push(s[i]);
        }
        //cout << i << " " << st.size() << " " << ans << endl;
    }
    cout << ans * 2 << endl;
}


Measured memory_bytes: 512
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <vector>
#include <ctime>
#include <cassert>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <fstream>
using namespace std;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define inf 1000000000
#define INF 1000000000000000000ll
const int N = 1e6;
const int mod = 1e9+7;

map<string,int>m;
string s[5], t;
int a, b;
int main() {
    for(int i =1; i <= 2;++i){
        cin >> s[i];
    }
    for(int i = 1; i <= 2; ++i){
        cin >> a;
        m[s[i]] += a;
    }
    cin >> t;
    m[ t ]--;
    cout << m[ s[1] ] << " " << m[ s[2] ];
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  if(n==3) {
    cout << 2 << " " << 5 << " " << 63 << endl;
    return 0;
  }
  vector<ll> v[2];
  for(int i=2; i<=30000; i++) {
    if(i%2==0) v[0].push_back(i);
    else if(i%3==0) v[1].push_back(i);
  }
  for(int k=1; k<=v[1].size(); k++) {
    if(n-k>v[0].size()) continue;
    ll d=v[1][0],sum=d;
    for(int i=1; i<k; i++) {
      d=__gcd(d,v[1][i]);
      sum+=v[1][i];
    }
    for(int i=0; i<n-k; i++) {
      d=__gcd(d,v[0][i]);
      sum+=v[0][i];
    }
    for(int i=0; i<k; i++) {
      if(__gcd(sum-v[1][i],v[1][i])==1) goto next;
    }
    for(int i=0; i<n-k; i++) {
      if(__gcd(sum-v[0][i],v[0][i])==1) goto next;
    }
    if(d==1) {
      vector<int> a;
      for(int i=0; i<k; i++) a.push_back(v[1][i]);
      for(int i=0; i<n-k; i++) a.push_back(v[0][i]);
      for(int i=0; i<a.size(); i++) {
        if(i) cout << " ";
        cout << a[i];
      }
      cout << endl;
      return 0;
    }
    next:;
  }
  return 0;
}

Measured memory_bytes: 768
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def root(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.root(self.parents[x])
            return self.parents[x]

    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)

        if x == y:
            return

        if (-self.parents[x]) < (-self.parents[y]):
            self.parents[y] += self.parents[x]
            self.parents[x] = y
        else:
            self.parents[x] += self.parents[y]
            self.parents[y] = x

    def size(self, x):
        return -self.parents[self.root(x)]

    def same(self, x, y):
        return self.root(x) == self.root(y)

N, M, K = map(int,input().split())

uf = UnionFind(N)
friends = [0] * N
blocks = [0] * N

for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    uf.unite(a, b)
    friends[a] += 1
    friends[b] += 1

for _ in range(K):
    c, d = map(int, input().split())
    c -= 1
    d -= 1
    if uf.same(c, d):
        blocks[c] += 1
        blocks[d] += 1

for i in range(N):
    print(uf.size(i) - friends[i] - blocks[i] - 1, end=" ")
print("")

Measured memory_bytes: 9420
def main():
    x = int(input())

    ele = x // 11
    answer = 2 * ele

    if x % 11 != 0:
        x -= 11 * ele
        answer = 2 * ele

        if x <= 6:
            answer += 1
        else:
            answer += 2

    print(answer)


if __name__ == '__main__':
    main()

Measured memory_bytes: 9084
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

int N, M;
vector<int> G[1005];

bool ok;
int prv[1005];

void show(const vector<int>& v){
  ok = true;
  vector<int> ret;

  vector<int> use(1005, 0);
  rep(i,v.size()){
    use[v[i]] = 1;
  }

  rep(i,v.size()){
    int cnt = 0;
    rep(j,G[v[i]].size()){
      if(use[G[v[i]][j]] == 1){
        cnt++;
      }
    }
    if(cnt >= 2){
      ok = false;
      return;
    }
  }
  
  cout << v.size() << endl;
  rep(i,v.size()){
    cout << v[i] << endl;
  }
}

void dfs(int v){
  rep(i, G[v].size()){
    if(ok) return;
    if(prv[G[v][i]] != -1){
      // loop check
      vector<int> tmp;
      int goal = G[v][i];
      int now = v;
      tmp.push_back(now);
      while(now != goal){
        now = prv[now];
        tmp.push_back(now);
      }
      reverse(ALLOF(tmp));
      show(tmp);
    }else{
      prv[G[v][i]] = v;
      dfs(G[v][i]);
      prv[G[v][i]] = -1;
    }
  }
}

bool solve(int st){
  ok = false;
  rep(i,N+1) prv[i] = -1;
  prv[st] = st;
  dfs(st);
  return ok;
}

int main(){
  cin >> N >> M;
  rep(i,M){
    int a, b;
    cin >> a >> b;
    G[a].push_back(b);
  }

  REP(i,1,N+1){
    if(solve(i)) return 0;
  }
  cout << -1 << endl;
  
  return 0;
}

Measured memory_bytes: 384
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define pb            push_back
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)
#define kiriage(a,b)  ((a)+(b)-1)/(b)

const int INF = 1e9;

// code
// ------------------------------------------------
int main() {

  string s;
  cin >> s;

  int h,b;
  h = s.find('A');
  b = s.rfind('Z');

  cout << b - h  + 1 << endl;

  return 0;
}
// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}


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

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

  vector<int> six;
  vector<int> nine;

  int a = 6;
  int b = 9;

  while(a <= 100000) {
    six.emplace_back(a);
    a *= 6;
  }

  while(b <= 100000) {
    nine.emplace_back(b);
    b *= 9;
  }

  vector<int> ans(100001);

  iota(ans.begin(), ans.end(), 0);

  for(int i=0;i<n;i++) {
    for(int j=0;j<six.size();j++) {
      if(i + six[j] > 100000) continue;
      else if(ans[i] + 1 < ans[i+six[j]]) ans[i+six[j]] = ans[i] + 1;
    }
    for(int j=0;j<nine.size();j++) {
      if(i + nine[j] > 100000) continue;
      else if(ans[i] + 1 < ans[i+nine[j]]) ans[i+nine[j]] = ans[i] + 1;
    }
  }

  cout << ans[n] << endl;
  return 0;
}

Measured memory_bytes: 640
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int top,S[1000];
int max=1000;

int isEmpty(){
	int a=0;
	if(top==0){
		a=1;
		return a;
	}
	return a;
}

int isFULL(int max){
	int b=0;
	if(top>=max-1){
		b=1;
		return b;
	}
	return b;
}

void push(int x){
	if(isFULL(max)==1){
		exit(1);
	}
	top++;
	S[top]=x;
}

int pop(){
	if(isEmpty()==1){
		exit(1);
	}
	top--;
	return S[top+1];
}

int main(void){
	int a,b,i;
  	char s[100];
	
	for(i=0;i<1000;i++){
		S[i]=0;
	}
	
  	while( scanf("%s", s) != EOF ){
		if ( s[0] == '+' ){
			a=pop();
			b=pop();
			push(a+b);
    		}
  		else if ( s[0] == '-' ){
  			a=pop();
			b=pop();
			push(b-a);
    		}
  		else if ( s[0] == '*' ){
  			a=pop();
			b=pop();
			push(a*b);
    		}	 
  		else {
      			push(atoi(s));
  		}
	}

	printf("%d\n",pop());
	
	return 0;
}


Measured memory_bytes: 2036
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <math.h>
#include <algorithm>
#include <deque>
#include <queue>
#include <climits>
using namespace std;
#define rep(i,l,r) for(int i=l;i<r;i++)
#define repb(i,r,l) for(int i=r;i>l;i--)
#define ll long long
#define ull unsigned long long
#define ve vector
#define umap unordered_map
#define iter iterator

void solve() {
    string a,b;
    cin>>a>>b;
    if(a.length() < b.length()) {
        cout<<"LESS \n";
        return;
    }
    if(a.length() > b.length()) {
        cout<<"GREATER \n";
        return;
    }
    for(int i=0;i<a.length();i++) {
        if(a[i]-'0' < b[i]-'0') {
            cout<<"LESS \n"; return;
        }
        if(a[i]-'0' > b[i]-'0') {
            cout<<"GREATER \n"; return;
        }
    }
    cout<<"EQUAL \n";
}

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

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
static inline int s(const int norig)
{
  int digsum = 0;
  int n = norig;
  while(n > 0)
  {
    digsum += (n % 10);
    n /= 10;
  }
  return norig % digsum;
}
int main()
{
  string const ans[2] = 
  {"Yes\n", "No\n"};
  int n;
  cin >> n;
  cout << ans[min(1, s(n))];

  return 0;
}


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

int main() {
    vector<int> v(3);
    for (int i = 0; i < 3; i++) {
        cin >> v.at(i);
    }
    
    sort(v.begin(), v.end());
    
    for (int i = 0; i < 3; i++) {
        cout << v.at(i);
        if (i == 2) {
            cout << endl;
        } else {
            cout << ' ';
        }
    }
}


Measured memory_bytes: 3092
#include <cstdio>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

#define rep(i,n) for(long long i=0;i<(n);i++)
#define INT(n) int n;scanf("%d",&n);
#define LL(n) long long n;scanf("%lld",&n);
#define pint(n) printf("%d",n);
#define pll(n) printf("%lld",n);
#define psp printf(" ");
#define pln puts("");

int main(){
	INT(N)
	int P[N];
	rep(i,N){
		INT(b)
		P[i] = b;
	}
	int ans = 0;
	for(int i=0;;i++){
		if(P[i] == i+1){
			int s = P[i];
			P[i] = P[i+1];
			P[i+1] = s;
			ans++;
		}
		if(P[N-1-i] == N-i){
			int s = P[N-i-1];
			P[N-i-1] = P[N-i-2];
			P[N-i-2] = s;
			ans++;
		}
		if(i>=N-1-i)break;
	}

	pint(ans)
	pln
	return 0;
}

Measured memory_bytes: 640
#include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
// constexpr ll MOD = 998244353;
constexpr ll MOD = 1000000007;

// struct UnionFind {
//     vector<ll> par;
//     vector<ll> siz;
    
//     UnionFind(ll N): par(N), siz(N,1) {
//         for (ll i=0;i<N;i++) par[i] = i;
//     }

//     ll root(ll x) {
//         if (par[x] == x) return x;
//         else return par[x] = root(par[x]);
//     }

//     void unite(ll x, ll y) {
//         ll rx = root(x);
//         ll ry = root(y);
//         if (rx == ry) return;
//         // if (siz[rx] < siz[ry]) swap(rx,ry);
//         par[rx] = ry;
//         siz[ry] += siz[rx];
//     }

//     bool same(ll x, ll y) {
//         ll rx = root(x);
//         ll ry = root(y);
//         return rx == ry;
//     }

//     ll size(ll x) {
//         return siz[root(x)];
//     }
// };

//     vector<ll> par;
//     vector<ll> siz;
    
//     UnionFind(ll N): par(N), siz(N,1LL) {
//         for (ll i=0;i<N;i++) par[i] = i;
//     }

//     ll root(ll x) {
//         if (par[x] == x) return x;
//         else return par[x] = root(par[x]);
//     }

//     void unite(ll x, ll y) {
//         ll rx = root(x);
//         ll ry = root(y);
//         if (rx == ry) return;
//         par[rx] = ry;
//         siz[ry] += siz[rx];
//     }

//     bool same(ll x, ll y) {
//         ll rx = root(x);
//         ll ry = root(y);
//         return rx == ry;
//     }

//     ll size(ll x) {
//         return siz[root(x)];
//     }
// };

int main(void) {
    int N;
    vector<ull> A(100010);
    cin >> N;
    for (int i=0;i<N;i++) cin >> A[i];
    ull res = 1, pres = 0;
    for (int i=0;i<N;i++) {
        if (A[i] == 0) {
            cout << 0 << endl;
            return 0;
        }
    }
    for (int i=0;i<N;i++) {
        pres = res;
        res *= A[i];
        // cout << res << endl;
        if (res > 1000000000000000000 || pres > res) {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 3828
#include <cstdio>
#include <cstring>

const int MAXN = 105;
char map[MAXN][MAXN];
int n, m;
int d[4][2] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1} };

int dfs(int px, int py, char c)
{
    map[px][py] = ' ';
    for(int i = 0; i < 4; i++)
    {
        int x = px + d[i][0];
        int y = py + d[i][1];
        if(x >= 0 && x < n && y >=0 && y < m
           && c == map[x][y])
           dfs(x, y, c);
    }
}

int main()
{
    while(~scanf("%d%d", &n, &m))
    {
        if(0 == n && 0 == m) break;
        getchar();
        for(int i = 0; i < n; i++)
        {
            for(int j = 0; j < m; j++)
            {
                scanf("%c", &map[i][j]);
            }
            getchar();
        }
        int ans = 0;
        for(int i = 0; i < n; i++)
        {
            for(int j = 0; j < m; j++)
            {
                if(' ' != map[i][j])
                {
                    dfs(i, j, map[i][j]);
                    ans++;
                }
            }
        }
        printf("%d\n", ans);
    }
    return 0;
}

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


Measured memory_bytes: 26184
#include <bits/stdc++.h>
using namespace std;
int a,b,c;
 
int main (){
	cin >> a >> b >> c;
	if(a==b&&a!=c) cout << c << endl;
	else if(a==c&&a!=b)	cout << b << endl;
	else if (b==c&&b!=a) cout << a << endl;
}
 

Measured memory_bytes: 256
# coding: utf-8

class PhysicalExp
  def solve
    while line = gets do
      v = line.chomp.to_f
      t = v / 9.8
      y = 4.9 * (t ** 2)
      n = (y + 5) / 5
      puts n.ceil
    end
  end
end

PhysicalExp.new.solve

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

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

using ll = long long;
const ll INF = 1LL << 60;

int main()
{
  int n;
  ll d[100100][3];
  ll v[100100][3];

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

  for (int i = 0; i < 3; ++i)
  {
    d[0][i] = 0;
  }
  for (int i = 1; i <= n; ++i)
  {
    for (int j = 0; j < 3; ++j)
    {
      d[i][j] = -INF;
    }
  }

  for (int i = 1; i <= n; ++i)
  {
    for (int j = 0; j < 3; ++j)
    {
      for (int k = 0; k < 4; ++k)
      {
        if (j == k)
          continue;
        chmax(d[i][k], d[i - 1][j] + v[i][k]);
      }
    }
  }
  ll ans = 0;
  for (int i = 0; i < 3; ++i)
  {
    chmax(ans, d[n][i]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4992
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<ll> A(N);
  rep(i,N) cin >> A[i];
  int cnt = 0;
  while(1){
    rep(i,N){
      if(A[i]%2==0){
        A[i] /= 2;
      }
      else{
        cout << cnt << endl;
        return 0;
      }
    }
    cnt++;
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>

using namespace std;

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

#define BIL ((ll)1e9)
#define MOD ((ll)1e9+7)
#define INF (1LL<<60)           //1LL<<63でオーバーフロー
#define inf (1<<29)             //1<<29でオーバーフロー

int main(int argc,char* argv[]){
    string s;
    cin >> s;

    int one=0,zero=0;
    for(int i=0;i<s.size();i++){
        if(s[i]=='0')zero++;
        else one++;
    }

    cout << 2*min(zero,one) << endl;

    return 0;
}


Measured memory_bytes: 3752
#include<iostream>
#include<vector>
#include<climits>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
#define ip(arr, n) for(int i=0; i<n; i++) cin>>arr[i];
#define op(arr, n) for(int i=0; i<n; i++) cout<<arr[i]<<" ";
#define fstIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define MAX 3005

int n;
ll *arr, dp[MAX][MAX];

/*
dpi][j] -> what will be the max score if i have option to pick i th item from left or jth item from right.

Now point samajna yeh hai ki jo bhi element pick karta hai voh corresponding user ke score mein add ho jata hai.
Second this If i assume ki iss samay mera pass do hi item hai, them agr mein ith(0) elemnt pick kiya, toh 0 item mera
score mein add ho jayeyga and now qki abb dusare player ki turn hogi toh, voh jo pick karega uske socre mein add ho jaeyga
So total diff will be x-y.

Same thing I assume, and I pick one element one from left or one from right and add corresponding val into my score and call for rec to 
tell what will be score of next player if i pick these option element.

Yeh pointer thoda confusion ki kaise player ki turn maintain ho rahi hai.
Dekh X->total score of first, Y->total score of second

So if at a point I assume there are only 2 element and first player pick one so add this into his score and call to cal
score of second player if he has arr with first element removed(as first player pick this item) and function return me 
his score and i substract it from first player score. This is how rec handle turm of players.

As rec give me the final score second player will get if first player pick either ith or jth item.
*/

ll solve(int i, int j){
    if(i>j) return 0;
    if(dp[i][j] != -1) return dp[i][j];

    ll opt1 = arr[i]-solve(i+1, j);
    ll opt2 = arr[j]-solve(i, j-1);

    return dp[i][j] = max(opt1, opt2);
}

void topDown(){
    memset(dp, -1, sizeof(dp));
    cout<<solve(0, n-1)<<endl;
}

void bottomUp(){
    memset(dp, 0, sizeof(dp));

    for(int i=n-1; i>=0; i--){
        for(int j=0; j<n; j++){
            if(i>j) dp[i][j]=0;
            else{
                dp[i][j] = max(arr[i]-dp[i+1][j], arr[j]-dp[i][j-1]);
            }
        }
    }
    cout<<dp[0][n-1]<<endl;
}
int main(){
    fstIO;
    cin>>n;
    arr = new ll[n+1];
    ip(arr, n);
    // topDown();
    bottomUp();
    return 0;
}

Measured memory_bytes: 70784
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <utility>
#include <vector>

using namespace std;

int main(){
  char s[100001];
  scanf(" %s", s);
  string str_s(s);
  int K;
  scanf("%d", &K);
  
  for (int i = 0; i < str_s.length(); i++){
    if (str_s[i] == 'a'){
      continue;
    }else{
      if (('z'-str_s[i]+1) <= K){
        K -= 'z'-str_s[i]+1;
        str_s[i] = 'a';
      }else{
        continue;
      }
    }
  } 
  if (K >= 26){
    K %= 26;
  }
  str_s[str_s.length()-1] += K;
  cout << str_s << endl;
  return 0;
}


Measured memory_bytes: 640
import sys
#import cython

def main():
    read = lambda: sys.stdin.readline().rstrip()
    
    #N: cython.longlong = 0
    A, B, C, K = map(int,read().split())
    print(K if A >= K else A if K-A <= B else A-(K-A-B))
    #a, b, c = map(int,read().split())
    #l = [int(read()) for _ in range(5)]
    

 
if __name__ == "__main__":
    main()


Measured memory_bytes: 8996
t = int(input())
for _ in range(t):
    n = int(input())
    a = list(map(int,input().split()))
    s = input()
    check = True
    l = [0]*61
    for i in range(n-1,-1,-1):
        x = a[i]
        for j in range(60,-1,-1):
            if x & (1<<j):
                x ^= l[j]

        if s[i] == "0":
            if x:
                l[x.bit_length()-1] = x
        else:
            if x:
                print(1)
                check = False
                break
    if check:
        print(0)
                




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

using namespace std;
const int N = 1e5+1;

int main(){
    string s; cin >> s;
    map <char, int> cnt;

    for (char& x: s)
        ++ cnt[x];
    if (cnt.size() != 2){
        cout << "No\n";
        return 0;
    }
    for (auto& i: cnt)
        if (i.second != 2){
            cout << "No\n";
            return 0;
        }
    cout << "Yes\n";
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
#include<cstring>
#include<cmath>
#include<cstdio>
#include<string>
#include<string.h>
#include<stdio.h>

int main() {


    int n,i,j,c=0;
    cin >> n;
    int a[n];
    for(i=1;i<=n;i++)
    {
        cin >> a[i];
    }
    for(i=1;i<=n;i++)
    {
       if(a[i] != i)
       {
           c++;
       }

    }
    if(c>2)
    {
        cout << "NO" << endl;
    }
    else
    {
        cout << "YES" << endl;
    }




  return 0;

}







Measured memory_bytes: 256
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();

        int plus = A + B;
        int minus = A - B;
        int multi = A * B;

        int max = Math.max(plus,Math.max(minus,multi));
        System.out.println(max);
    }
}

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

int main() {
	int X,Y,N;
	cin>>X>>Y>>N;

	int graph[X][Y];
	rep(i,X)rep(j,Y)graph[i][j]=0;

	vector<int> x(N),y(N),a(N);
	rep(k,N){
		cin>>x[k]>>y[k]>>a[k];
		if(a[k]==1){
			rep(i,X)rep(j,Y){
				if(i<x[k])graph[i][j]=1;
			}
		}
		if(a[k]==2){
			rep(i,X)rep(j,Y){
				if(i>=x[k])graph[i][j]=1;
			}
		}
		if(a[k]==3){
			rep(i,X)rep(j,Y){
				if(j<y[k])graph[i][j]=1;

			}
		}
		if(a[k]==4){
			rep(i,X)rep(j,Y){
				if(j>=y[k])graph[i][j]=1;
			}
		}
	}

	int ans=0;
	rep(i,X)rep(j,Y){
		ans+=graph[i][j];
	}
	cout<<X*Y-ans<<endl;
}

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

using namespace std;

int main(){
    int N;
    long long int ans=0;
    cin >> N;
    vector<int> a(3*N);
    for(int i=0;i<3*N;i++){
        cin >> a[i];
    }
    sort(a.begin(),a.end());
    for(int i=0;i<N;i++){
        ans += a[2*i+N];
    }

    cout << ans << endl;;
}

Measured memory_bytes: 1408
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX(x,y) (x>y?x:y)
#define MIN(x,y) (x<y?x:y)
#define ABS(x) (x>0?x:-(x))

#define INF 1000000000

int array_min_max(int* p, int n,bool f)  //f: true→min false→max
{
	int tmp;

	if (f)
		tmp = INF;
	else
		tmp = 0;

	for (int i = 0; i < n; i++)
	{
		if (f)
		{
			if (p[i] < tmp)
				tmp = p[i];
		}
		else
		{
			if (p[i] > tmp)
				tmp = p[i];
		}
	}
	return tmp;
}

int main()
{
	char S[100000];
	int count = 0;
	int count2=0;

	scanf("%s", S);

	for (int i = 0; S[i]!=NULL; i++)
	{
		if (i % 2 == 0)
		{
			if (S[i] == '1')
				count++;
		}
		else
		{
			if (S[i] == '0')
				count++;
		}

	}

	for (int i = 0; S[i] != NULL; i++)
	{
		if (i % 2 == 0)
		{
			if (S[i] == '0')
				count2++;
		}
		else
		{
			if (S[i] == '1')
				count2++;
		}

	}

	printf("%d\n", MIN(count, count2));
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		
		int n,num,min,max;
	
		long sum = 0;
		n =Integer.parseInt(scan.nextLine());
		String[] str = scan.nextLine().split(" ");
		num = 0;
		min = 1000000;
		max = -1000000;
		
		for(int i=0; i<n; i++){
			num = Integer.parseInt(str[i]);
			if(num>max){
				max = num;
			}
			if(num<min){
				min = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} 

Measured memory_bytes: 25680
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <climits>

using namespace std;

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

	string s;
	cin >> s;

	for (int i = 1; i < 4; i++) {
		if (s[i] == s[i - 1]) {
			cout << "Bad" << endl;
			return 0;
		}
	}

	cout << "Good" << endl;
	return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;




int main(){

	int N;
	scanf("%d",&N);

	printf("%d\n",N-(N%500));

	return 0;
}



Measured memory_bytes: 3240
#include <iostream>
#include <cmath>
#define pc(x) putchar_unlocked(x);

inline void fastscan(int &num) {
    bool neg = false;
    int c;
    num = 0;
    c = getchar();
    if (c == '-') {
        neg = true;
        c = getchar();
    }
    for (; (c > 47 && c < 58); c = getchar()) num = num * 10 + c - 48;
    if (neg) num *= -1;
}

inline void fastout(int n) {
    int N = n, rev, count = 0;
    rev = N;
    if (N == 0) { putchar_unlocked('0'); putchar_unlocked('\n'); return ;}
    while ((rev % 10) == 0) { count++; rev /= 10;}
    rev = 0;
    while (N != 0) { rev = (rev<<3) + (rev<<1) + N % 10; N /= 10;}
    while (rev != 0) { putchar_unlocked(rev % 10 + '0'); rev /= 10;}
    while (count--) putchar_unlocked('0');
}
 
int main(){
    
    int N; fastscan(N);
    int v[N];
    for (int i = 0; i < N; ++i) fastscan(v[i]);
    int sum = 0;
 
    for (int i = 1; i < N; ++i) sum += abs(v[i - 1] - v[i]);
    sum = sum + abs(0 - v[0]) + abs(v[N - 1] - 0);
    int diff[N];
    diff[0] = abs(0 - v[0]) + abs(v[0] - v[1]) - abs(0 - v[1]);
    for (int i = 1; i < N - 1; ++i){
        diff[i] = abs(v[i - 1] - v[i]) + abs(v[i] - v[i + 1]) - abs(v[i - 1] - v[i + 1]);
    }
    diff[N - 1] = abs(v[N - 2] - v[N - 1]) + abs(v[N - 1] - 0) - abs(v[N - 2] - 0);

    for (int i = 0; i < N; ++i){
        fastout(sum - diff[i]); putchar_unlocked('\n');
    }
    return 0;
}

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

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;



int main(){
	int a,b[3];
	scanf("%1d%1d%1d%1d",&a,&b[0],&b[1],&b[2]);

	int t=7-a;
	for (int i = 0; i < 8; i++){
		int sum=0;
		for (int j = 0; j < 3 ; j++){
			if(i&(1<<j)){
				sum+=b[j];
			}else{
				sum-=b[j];
			}
		}
		if(sum==t){
			cout<<a;
			for (int j = 0; j < 3 ; j++){
				if(i&(1<<j)){
					cout<<'+'<<b[j];
				}else{
					cout<<'-'<<b[j];
			}
			}
			cout<<"=7"<<endl;
			return 0;
		}
	}

	return 0;
}

Measured memory_bytes: 256
"use strict"

function Main(stdin){
stdin = stdin.trim().split("\n").reverse();
var stdout = [];
function input(){return stdin.pop()};
function print(x){stdout.push(x)};
function mapint(x){return x.map(n=>parseInt(n))};
function max(x){return x.reduce(function(a,b){ return Math.max(a,b) }) }
function min(x){return x.reduce(function(a,b){ return Math.min(a,b) }) }
function sum(x){return x.reduce(function(a,b){ return a+b }) }
function all(x){return x.reduce(function(a,b){ return a && b }) }
function any(x){return x.reduce(function(a,b){ return a || b }) }



var n = parseInt(input())
var s = 0.0
for (var i = 0; i < n; i++){
    var tmp = input().split(" ")
    var xi = parseFloat(tmp[0])
    var vi = tmp[1]
    if (vi == "BTC"){
        s += xi * 380000.0
    }else{
        s += xi
    } 
}
print(s)




stdout = stdout.join("\n");
console.log(stdout);
return stdout
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"))

Measured memory_bytes: 7496
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPS(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using namespace std;
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; }
#define INF 1e9
#define PI (acos(-1))
#define mod (int)1e9+7
int main() {
    int h,n;
    cin>>h>>n;
    vector<int> a(n);
    int sum=0;
    REP(i,n){
        cin>>a[i];
        sum+=a[i];
    }
    if(h<=sum)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 640
//#define MYDEBUG
#include <bits/stdc++.h>
#ifdef MYDEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#define ifcin(x) std::ifstream cin(x)
#else
#define debug(x)
#define ifcin(x)
#endif
#define ll long long
#define ull unsigned long long
#define eps 1e-14
#define all(x) x.begin(), x.end()
using std::cout;
using std::cin;
using std::endl;
using std::vector;
using std::ostream;
using std::min;
using std::max;
using std::sort;

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
	out << "[";
	size_t last = v.size() - 1;
	for (size_t i = 0; i < v.size(); ++i) {
		out << v[i];
		if (i != last)
			out << ",";
	}
	out << "]";
	return out;
}

void solve() {
	ll x;
	cin >> x;
	ll r = x % 11L;
	ll d = x / 11L;
	ll ans = d * 2;
	if (0 < r && r <= 6) {
		ans += 1;
	} else if (0 < r) {
		ans += 2;
	}
	cout << ans << endl;
}

int main() {
	solve();
}


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

int main(){
    int N;
    vector<int64_t> vec(100,0);
    cin >> N;
    vec.at(0) = 2;
    vec.at(1) = 1;
    for (int i = 2; i <= N; i++){
        vec.at(i) += vec.at(i-2) + vec.at(i-1);
    }
    cout << vec.at(N) << endl;
}

Measured memory_bytes: 256
import math
from functools import reduce
N=int(input())
MOD=10**9+7

def all_multiple(a):
    return reduce(lambda a,b:a*b,a)

def is_prime(n):
    if n==1: return False
    for k in range(2,int(math.sqrt(n))+1):
        if n%k==0:
            return False
    return True


A=[1]*(N+1)#indexと割られる数を合わせる
ans=1
for N_t in range(2,N+1):
    for num in range(1,N_t+1):
        if is_prime(num):
            cnt=0
            while N_t%num==0:
                N_t=N_t//num
                cnt+=1
            A[num]+=cnt 

print(all_multiple(A)%MOD)

            


Measured memory_bytes: 3692
#include <bits/stdc++.h>
#include <ext/hash_map>
#include <ext/numeric>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for( (i)=0 ; (i)<(n) ; (i)++ )
#define rep(i,x,n) for( (i)=(x) ; (i)<(n) ; (i)++ )
#define REV(i,n) for( (i)=(n) ; (i)>=0 ; (i)-- )
#define FORIT(it,x) for( (it)=(x).begin() ; (it)!=(x).end() ; (it)++ )
#define foreach(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define rforeach(it,c) for(__typeof((c).rbegin()) it=(c).rbegin();it!=(c).rend();++it)
#define foreach2d(i, j, v) foreach(i,v) foreach(j,*i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define SZ(x) ((int)(x).size())
#define MMS(x,n) memset(x,n,sizeof(x))
#define mms(x,n,s) memset(x,n,sizeof(x)*s)
#define pb push_back
#define mp make_pair
#define NX next_permutation
#define UN(x) sort(all(x)),x.erase(unique(all(x)),x.end())
#define CV(x,n) count(all(x),(n))
#define FIND(x,n) find(all(x),(n))-(x).begin()
#define ACC(x) accumulate(all(x),0)
#define PPC(x) __builtin_popcountll(x)
#define LZ(x) __builtin_clz(x)
#define TZ(x) __builtin_ctz(x)
#define mxe(x) *max_element(all(x))
#define mne(x) *min_element(all(x))
#define low(x,i) lower_bound(all(x),i)
#define upp(x,i) upper_bound(all(x),i)
#define NXPOW2(x) (1ll << ((int)log2(x)+1))
#define PR(x) cout << #x << " = " << (x) << endl ;

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

const int OO = (int) 2e9;
const double eps = 1e-9;

int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
//	freopen("in.txt", "rt", stdin);
//	freopen("out.txt", "wt", stdout);
#endif
	int t, x;
	cin >> t >> x;
	cout << max(0, t - x) << endl;
	return 0;
}


Measured memory_bytes: 256
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
// 出典
// https://qiita.com/EqualL2/items/6e3de4d1d09e2e5f3611
ll euclidean_gcd(ll a, ll b) {
  if(a < b) return euclidean_gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
ll a,b,c,d;
ll cul(ll x){
    if(x == 0){
        return 0;
    }else{
        return x- (x/d+x/c-x/(c/euclidean_gcd(c,d)*d));
    }
}
int main() {
    std::cin >> a>>b>>c>>d;

    std::cout << cul(b)-cul(a-1) << std::endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define ii pair<int,int>
#define setin set.insert
using namespace std;
vector<int>v;
set<int>set;
vector<ii>vp;
ll ans,count,mx,mn;
int i;
int main()
{
    string s;
    cin >> s;
    string t;
    cin >> t;
    ll l=s.size();
    ll k=t.size();
    if((k-1)!=l){
        cout << "No" << endl;
        return 0;
    }
    ll c=0;
    for(i=0;i<=l;i++)
    {
        if(s[i]==t[i])
            c++;
    }
    if(c==l)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3600
#include <iostream>

#include <vector>
#include <stdio.h>
#include <string>

#include <cassert>

#include <algorithm>

#include <functional>

#include <cmath>

#include <iomanip>

#include <limits>
#include <bits/stdc++.h>
#include<queue>
#include<type_traits>
#include<cstdint>
using namespace std;
int MOD = 1e9+7;

int main(){
   int n;
   cin >> n;
   vector<int> vec(n);
   for(int i=0;i<n;i++){
       int x;
       cin >> x;
       vec[i]=x;
   }
   vector<int> dp(n);
   dp[0]=0;
   dp[1]=abs(vec[1]-vec[0]);
   for(int state=2;state<n;state++){
       dp[state]=min(dp[state-2]+abs(vec[state-2]-vec[state]),dp[state-1]+abs(vec[state]-vec[state-1]));
   }
   cout<<dp[n-1]<<endl;
}


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

int main()
{
    int n = 0;
    int x = 0;
    int res = 0;
    
    while (cin >> n >> x)
    {
        if ((0 == n) && (0 == x))
        {
            break;
        }
        
        res = 0;
        for (int i = 1; i <= n; i++)
        {
            for (int j = i + 1; j <= n; j++)
            {
                for (int k = j + 1; k <= n; k++)
                {
                    if (x == i + j + k)
                    {
                        res++;
                    }
                }
            }
        }
        
        cout << res << endl;
    }
    
    return 0;
}



Measured memory_bytes: 3092
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n); for(int i = 0;i < (int)(n);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
ll lucas(ll n){
    if(n == 0)return 2;
    else if(n == 1)return 1;
    else return lucas(n-1)+lucas(n-2);
}

int main(){
    ll n;
    cin >> n;
    ll h[n];
    rep(i,n)cin >> h[i];
    int ans = 0;
    int cnt = 0;
    rep(i,n-1){
        if(h[i+1]<=h[i])cnt++;
        else cnt = 0;
        ans = max(ans,cnt);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1152
#include<stdio.h>
#include<math.h>


int main()
{
	double north=0,east=0,rad;
	int angle=0;
	int distance,tmpang;
	
	do
	{
		scanf("%d,%d",&distance,&tmpang);
		rad=angle*3.141592654/180;
		north+=cos(rad)*distance;
		east+=sin(rad)*distance;
		angle+=tmpang;
	}while(distance!=0||tmpang!=0);
	printf("%d\n%d\n",(int)east,(int)north);
	return 0;
}

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

#define fast_io ios_base::sync_with_stdio(false) ; cin.tie(0); cout.tie(0);

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

int ans;
int k;
void dfs(vector<int> s) {
    if(s.size()==3) {
        ans+=gcd(gcd(s[0],s[1]),s[2]);
        //cout<<s[0]<<' '<<s[1]<<' '<<s[2]<<endl;
        return;
    }

    for(int i=1;i<=k;i++) {
        s.push_back(i);
        dfs(s);
        s.pop_back();
    }

    return;
        
}

int main() {
    fast_io;
    ans=0;

    cin>>k;

    vector<int> s;

    dfs(s);
    cout<<ans<<endl;


}




Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long n,sum=0;
	cin>>n;
	sum+=n/11*2;
	n%=11;
	if(n>6) sum+=2;
	else if(n>0) sum+=1;
	cout<<sum;
	return 0;
}


Measured memory_bytes: 256
using System;
using System.IO;
using System.Linq;
using System.Text;
using static Scanner;

class Program
{
    static void Main(string[] args) {
        var writer = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
        Console.SetOut(writer);
        Solve();
        Console.Out.Flush();
    }
    static void Solve() {
        int N = ScanInt(), K = ScanInt();
        var nums = new int[N + 1];
        for (int i = 0; i < N; i++) {
            var A = ScanInt();
            nums[A]++;
        }
        var arr = nums.Where(x => x > 0).ToArray();
        Array.Sort(arr);
        var count = 0;
        if (arr.Length > K) {
            for (int i = 0; i < arr.Length - K; i++) {
                count += arr[i];
            }
        }
        Console.WriteLine(count);
    }
}

public static class Scanner
{
    static readonly Stream stream = Console.OpenStandardInput();
    static readonly byte[] buffer = new byte[1024];
    static int length, p;
    static bool isEof;
    private static byte ConsoleIn() {
        if (isEof) return 0;
        if (p < length) return buffer[p++];
        p = 0;
        if ((length = stream.Read(buffer, 0, 1024)) > 0) return buffer[p++];
        isEof = true;
        return 0;
    }
    public static char GetChar() {
        var by = ConsoleIn();
        while ((by < '!' || '~' < by) && !isEof) by = ConsoleIn();
        return (char) by;
    }
    public static int ScanInt() {
        var temp = 0;
        for (var ch = GetChar(); '0' <= ch && ch <= '9'; ch = (char) ConsoleIn()) {
            temp = temp * 10 + ch - '0';
        }
        return temp;
    }
}

Measured memory_bytes: 26720
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18


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

	vector<vector<int>> tb(m, vector<int>());

	for (int i = 0; i < m; i++) {
		int k; cin >> k;
		for (int j = 0; j < k; j++) {
			int x; cin >> x;
			x--;
			tb[i].push_back(x);
		}
	}

	vector<int> p(m);
	for (int i = 0; i < m; i++) {
		cin >> p[i];
	}

	//スイッチの列挙
	int ans = 0;
	for (int bit = 0; bit < (1 << n); ++bit) {

		//電球の列挙
		bool f = true;
		for (int i = 0; i < m; i++) {
			int cnt = 0;
			for (int j = 0; j < tb[i].size(); j++) {
				if (bit&(1 << tb[i][j])) {
					cnt++;
				}
			}

			if (cnt % 2 != p[i]) {
				f = false;
			}
		}

		if (f) {
			ans++;
		}
		
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256