akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <iterator>
#include <cmath>
#include <deque> 

using namespace std;


int a,b,c,d,e;
int k;

int main()
{
	scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &k);
	if ((e - a) > k)
		printf(":(\n");
	else
		printf("Yay!\n");
	
	return 0;
}



Measured memory_bytes: 128
#include <iostream>
#include <math.h>
using namespace std;
int main(){
    int a, b, c, i1, i2, i3;
    double i4;
    while(1){
        cin >> a >> b >> c;
        if(a==0)break;
        i1 = a;
        i3 = 0;
        while(1){
            i2 = 2;
            i4 = sqrt(i1);
            while(1){
                if(i1==1){break;}
                if(i1==2){i3++; break;}
                if(i1%i2==0){break;}
                i2++;
                if(i2 > i4){i3++; break;}
            }
            if(i3==c){cout << i1 << endl; break;}
            i1 = i1 + b;
        }
    }
    return 0;
}

Measured memory_bytes: 1160
import java.util.Scanner;

public class Main {
	public static void main(String[]args){
		
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		
		int[] l = new int[N];
		int[] r = new int[N];
		int[] D = new int[N];
		int goukei = 0;
		
		for(int i = 0;i<N;i++){
			
			l[i] = scan.nextInt();
			r[i] = scan.nextInt();
			
			D[i] = r[i]-l[i]+1;
			
			goukei+=D[i];
			
			
		}
		
		System.out.println(goukei);
		
		
		
		
		
		
		
		
		
		
	}

}


Measured memory_bytes: 25712
N = int(input())
A = [int(i) for i in input().split()]
MOD = 10 ** 9 + 7

def judge() :
    p = N % 2
    c = [0] * ((N + 1) // 2)

    for a in A :
        if a % 2 == p or a < 0 or N <= a :
            return 0
            
        c[a//2] += 1
 
    if p == 1 and c[0] == 1 and c[1:].count(2) == (N - 1) // 2 :
        return pow(2, (N - 1) // 2, MOD)
    
    elif p == 0 and c.count(2) == N // 2 :
        return pow(2, N // 2, MOD)
        
    return 0
    
print(judge())

Measured memory_bytes: 52460
#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cassert>
#include <string>
#include <cstring>
#include <queue>

using namespace std;

#define rep(i,a,b) for(int i = a; i < b; i++)
#define S(x) scanf("%d",&x)
#define S2(x,y) scanf("%d%d",&x,&y)
#define P(x) printf("%d\n",x)
#define all(v) v.begin(),v.end()
#define FF first
#define SS second
#define pb push_back
#define mp make_pair

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

const int N = 100002;

vector<pii > g[N];
int tin[N], tout[N];
int D[N];
int _tm;
bool vis[N];
int in[N];
int n;

bool dfs(int c, int d) {
  D[c] = d;
  tin[c] = ++_tm;
  bool res = true;
  rep(i,0,g[c].size()) {
    int u = g[c][i].FF;
    if(vis[u]) {
      if(tin[c] >= tin[u] && tin[c] <= tout[u]) return false;
      if(c != n + 1 && D[u] - D[c] != g[c][i].SS) return false;
    } else {
      vis[u] = true;
      res &= dfs(u, d + g[c][i].SS);
    }
  }
  tout[c] = ++_tm;
  return res;
}

int main() {
  int m;
  S2(n,m);
  rep(i,0,m) {
    int u,v,d;
    scanf("%d%d%d",&u,&v,&d);
    g[u].pb(mp(v,d));
    in[v]++;
  }

  rep(i,1,n+1) if(!in[i]) {
    g[n + 1].pb(mp(i, 0));
  }
  bool res = dfs(n + 1, 0);
  rep(i,1,n+1) if(!vis[i]) {
    res = false;
  }
  if(res) printf("Yes\n");
  else printf("No\n");
  return 0;
}


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

int main() {
    int a, b, k;
    cin >> a >> b >> k;
    vector<int> ans(100);
    
    if (k * 2 > b - a)
    {
        for (int i = a; i <= b; i++)
        {
            cout << i << endl;
        }
        return 0;
    }
    else
    {
        for (int i = a; i < a + k; i++)
        {
            cout << i << endl;
        }
        for (int i = b + 1 - k; i < b + 1; i++)
        {
            cout << i << endl;
        }
        return 0;
    }
}

Measured memory_bytes: 384
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <tuple>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
const int INF = 1000000000;
const int MOD = 1000000007;

int main(){
	int h,w;
	cin >> h >> w;
	vector<string> grid(h);
	for(int i = 0;i < h;i++)cin >> grid[i];

	vector<vector<int>> r(h,vector<int>(w,0));
	vector<vector<int>> c(h,vector<int>(w,0));

	for(int i = 0;i < h;i++){
		for(int j = 0;j < w;j++){
			if(grid[i][j] == '.'){
				int k = j;
				int cnt = 0;
				while(k < w && grid[i][k] == '.'){
					k++;
					cnt++;
				}
				k = j;
				while(k < w && grid[i][k] == '.'){
					r[i][k] = cnt;
					k++;
				}
				j = k-1;
			}
		}
	}

	for(int i = 0;i < w;i++){
		for(int j = 0;j < h;j++){
			if(grid[j][i] == '.'){
				int k = j;
				int cnt = 0;
				while(k < h && grid[k][i] == '.'){
					k++;
					cnt++;
				}
				k = j;
				while(k < h && grid[k][i] == '.'){
					c[k][i] = cnt;
					k++;
				}
				j = k-1;
			}
		}
	}

	int ans = 0;
	for(int i = 0;i < h;i++){
		for(int j = 0;j < w;j++){
			ans = max(ans,r[i][j]+c[i][j]-1);
		}
	}

	cout << ans << endl;
}



Measured memory_bytes: 35712
// IO library
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>

// container library
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

// namespace
using namespace std;

// typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VB> VVB;

// conversion
#define INT(c) static_cast<int>(c)
#define CHAR(n) static_cast<char>(n)
#define LL(n) static_cast<ll>(n)

// container
#define EACH(i, c) for (auto i = (c).begin(); i != (c).end(); i++)
#define SORT(c) sort((c).begin(), (c).end())
#define GSORT(c) sort((c).begin(), (c).end(), greater<decltype((c).front())>())
#define SZ(x) (INT((x).size()))
#define MEMSET(c, v) memset((c), v, sizeof(c))

// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define NREP(i, n) FOR(i, 1, n + 1)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define RREP(i, n) RFOR(i, n, 0)
#define RNREP(i, n) RFOR(i, n, 1)

// constant
// const ll MOD = 1e9 + 7;
// const int INF = 1<<25;
// const ll INF = 1LL<<50;
// const int dx[4] = {0, -1, 1, 0};
// const int dy[4] = {-1, 0, 0, 1};
// const int dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
// const int dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};

// debug
#define test(x) cout << #x << " = " << x << endl

// answer output
#define Yes(c) cout << ((c) ? "Yes" : "No") << endl;
#define YES(c) cout << ((c) ? "YES" : "NO") << endl;
#define yes(c) cout << ((c) ? "yes" : "no") << endl;

#define possible(c) cout << ((c) ? "possible" : "impossible") << endl;
#define POSSIBLE(c) cout << ((c) ? "POSSIBLE" : "INPOSSIBLE") << endl;


// --------------------------------------------------------


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

  ll x;
  cin >> x;
  ll ans = (x / 11) * 2;
  x %= 11;
  if (x > 0) {
    ans++;
  }
  if (x > 6) {
    ans++;
  }
  cout << ans << endl;
  return 0;
}

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

int main()
{
    int n,flag=0,i=n;
    char s[i];
    scanf("%d",&n);
    scanf("%s",s);
if(n%2) printf("No");
else{
    for(int j=0;j<(n/2);j++)
    {
        if(s[j]!=s[j+(n/2)])
            flag=1;
    }
    if (flag==1) printf("No");
    else printf("Yes");
    //return 0;
}
}

Measured memory_bytes: 3780
//Megalomania

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define irep(i,a) for(auto i = a.begin(); i != a.end(); ++i)
#define nvarep(n,a) ll n;cin>>n;vector<ll>a(n);rep(i,0,n)cin>>a[i]
#define nxvarep(n,x,a) ll n,x;cin>>n>>x;vector<ll>a(n);rep(i,0,n)cin>>a[i]
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a/__gcd(a, b)*b)
#define range(a) (a).begin(),(a).end() 
#define pb push_back
#define mp make_pair
#define nnn "\n"
#define spa " "
#define cout15(a) printf("%.15f\n",a)
template<class T>inline bool chmin(T& a,T b,bool f){
if(f==1){if(a>b){a=b;return true;}return false;}
else if(f==0){if(a<b){a=b;return true;}return false;}return false;}
typedef pair<ll,ll> p;
const int inf = 2147483647;//2*10^9
const ll INF = 9223372036854775807;//9*10^18

int main (){
    int n;cin>>n;
    vector<p>a(n);
    rep(i,0,n)cin>>a[i].second>>a[i].first;
    sort(range(a));
    ll c=0,lm=0;
    rep(i,0,n){
        c+=a[i].second;
        if(a[i].first<c){
            cout<<"No"<<nnn;
            return 0;
        }
    }
    cout<<"Yes"<<nnn;
    return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>

using Bool = bool;
using Int = long long int;
using String = std::string;
template <class T>
using Vector = std::vector<T>;
template <class T>
using Set = std::set<T>;

const Vector<Vector<Int>> trans{
    {0, 1, 2, 3},
    {4, 5, 6, 7},
    {0, 1, 5, 4},
    {3, 2, 6, 7}};

void rotate(Vector<String>& v, Int t) {
    for (Int i = 0; i < 2; ++i) {
        for (Int j = 0; j < 3; ++j) {
            std::swap(v[trans[t * 2 + i][j]], v[trans[t * 2 + i][j + 1]]);
        }
    }
}

Bool solve() {
    Vector<String> s(8);
    if (!(std::cin >> s[0])) return false;
    for (Int i = 1; i < 8; ++i) std::cin >> s[i];

    std::sort(s.begin(), s.end());
    Set<Vector<String>> pats;
    do {
        pats.insert(s);
    } while (std::next_permutation(s.begin(), s.end()));

    Int ans = 0;
    while (!pats.empty()) {
        s = *pats.begin();
        ++ans;

        for (Int i = 0; i < 4; ++i) {
            for (Int j = 0; j < 4; ++j) {
                for (Int k = 0; k < 4; ++k) {
                    for (Int l = 0; l < 4; ++l) {
                        pats.erase(s);
                        rotate(s, 0);
                    }
                    rotate(s, 1);
                }
                rotate(s, 0);
            }
            rotate(s, 1);
        }
    }

    std::cout << ans << std::endl;
    return true;
}

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



Measured memory_bytes: 8884
eval"N,K="+`tr \\  ,`
*I=x=y=1
s=0
1.upto([N,K+1].min){|i|s+=x*y
I<<r=i<2?1:M/i*-I[M%i]%M
x=x*N*r%M=10**9+7
y=y*r%M*N-=1}
p s%M

Measured memory_bytes: 4360
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll a,b;
	cin>>a>>b;
	ll l=b-a+1;
	ll r=b+a-1;
	for(ll i=l;i<=r;i++){
		cout << i<<" ";
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 256
k = 0
t = 0

x, y = map(int, input().split())


if y % 2 == 1:
    print("No")
else:
    y2 = y / 2
    k = abs(x - y2)
    # print("k=", k)

    n = abs(4 * k - k)
    m = abs(x - y)
    t = abs(n - m)
    # print("n=", n)
    # print("m=", m)
    # print("t=", t)
    if k + t == x:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 9196
#include <bits/stdc++.h>
using namespace std;
inline bool isp(int x) {
	if (x == 1) return false;
	for (int i = 2; i * i <= x; i++) if (x % i == 0) return false;
	return true;
}
int n, p1[1005], p2[1005];
int main() {
	scanf("%d", &n);
	if (n == 2) {
		printf("4 7\n23 10\n");
		return 0;
	}
	int x = 2;
	for (int i = 1; i <= 2 * n - 1; i += 2) {
		while (!isp(x)) x++;
		p1[i] = x++;
	}
	p2[0] = p2[n * 2] = 1;
	for (int i = ((n & 1) ? 1 : 2); i <= 2 * n - 1; i += 2) {
		while (!isp(x)) x++;
		p2[i] = x++;
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			if ((i + j) & 1) {
				printf("%lld", 1ll * p1[i + j - 2] * p1[i + j] * p2[i - j + n - 1] * p2[i - j + n + 1] + 1);
			} else {
				printf("%lld", 1ll * p1[i + j - 1] * p2[i - j + n]);
			}
			printf("%c", " \n"[j == n]);
		}
	}
	return 0;
}

Measured memory_bytes: 3200
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=5e5+5;
ll a[maxn],ans[maxn];
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;++i){
		cin>>a[i];
		if(i+a[i]<200000)
		ans[i+a[i]]++;
	}
	ll x=0;
	for(int i=n;i>=1;--i){
		if(i-a[i]>=200000||i-a[i]<=0) continue;
		x+=ans[i-a[i]];
		if(i+a[i]<200000) ans[i+a[i]]--;
	}
	cout<<x<<endl;
	return 0;
} 

Measured memory_bytes: 6752
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <set>
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
typedef long long ll;

const int MOD = 1000000007;  // 1 000 000 007


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

    // input
    int N, M;
    cin >> N >> M;
    vector< pair<int , int> > vec(M);  // (N, M) array 0で初期化
    vector<int> bridge(N, 0);
    REP(i, M) cin >> vec[i].first >> vec[i].second;
    
    // calculation
    pair<int , int> brdg;
    REP(i, M) {
        brdg = vec[i];
        bridge[brdg.first-1]++;
        bridge[brdg.second-1]++;
    }
    
    REP(i, N) {
        cout << bridge[i] << "\n";
    }
    
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

ll gcd(ll A, ll B) {
	if (B == 0) return A;
	return gcd(B, A % B);
}


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

	
	ll A, B, C, D;
	cin >> A >> B >> C >> D;

	ll kotae = B - A + 1;
	kotae -= B / C;
	kotae -= B / D;
	kotae += B / (C * D /gcd(C, D));

	kotae += (A - 1) / C;
	kotae += (A - 1) / D;
	kotae -= (A - 1) / (C * D / gcd(C, D));

	co(kotae);

	Would you please return 0;
}

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

using namespace std;

const int N = 303;
char s[N][N];
bool can[N][N];

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i)
    scanf("%s", s[i]);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      can[i][j] = 1;
      for (int k = 0; k < n; ++k)
        can[i][j] &= s[(i+k) % n][j] == s[i][(j+k) % n]; 
    }
  }
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    bool bisa = 1;
    for (int j = 0; j < n; ++j) {
      bisa &= can[(i+j) % n][j];
    }
    cnt += bisa;
  }
  cout << 1LL * cnt * n << endl;
  return 0;
}

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

int main(void)
{
	int n, n_;
	cin >> n;
	n_ = n;

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

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


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long LL;
char C[100][101];
char Ans[200][101];
int main() {
	int H, W;
	cin >> H >> W;
	for (int i = 0; i < H; i++) {
		cin >> C[i];
	}
	for (int i = 0; i < 2 * H; i++) {
		for (int j = 0; j < W; j++) {
			Ans[i][j] = C[i/ 2][j];
		}
	}
	for (int i = 0; i < 2 * H; i++) {
		cout << Ans[i] << endl;
	}
}

Measured memory_bytes: 256
#include<stdio.h>
 
void spin_w(int x[]){
  int sai1[6],i;
 
  for(i=0;i<6;i++){
    sai1[i]=x[i];
  } 
 
  sai1[0]=x[2];
  sai1[2]=x[5];
  sai1[3]=x[0];
  sai1[5]=x[3];
 
  for(i=0;i<6;i++){
    x[i]=sai1[i];
  }
 
}
 
void spin_s(int x[]){
int sai1[6],i;
 
  for(i=0;i<6;i++){
    sai1[i]=x[i];
  } 
  sai1[0]=x[4];
  sai1[1]=x[0];
  sai1[4]=x[5];
  sai1[5]=x[1];
 
  for(i=0;i<6;i++){
    x[i]=sai1[i];
  }
 
}
 
 
int main(){
  
  int i,a=0,j,sai1[6];
  char dic[101];
  for(i=0;i<6;i++){
    scanf("%d",&sai1[i]);
  }
  scanf("%s",dic);
   
  for(i=0;i<=100;i++){
    if(dic[i]=='\0')break;
     
    if(dic[i]=='W'){
      spin_w(sai1);
    }else if(dic[i]=='E'){
      for(j=0;j<3;j++){
    spin_w(sai1);
      }
    }else if(dic[i]=='S'){
      spin_s(sai1);
 
    }else if(dic[i]=='N'){
      for(j=0;j<3;j++){
    spin_s(sai1);
      }
    }
  }
  printf("%d\n",sai1[0]);
  return 0;
}

Measured memory_bytes: 596
#include <cstdio>
#include <vector>
#include <cstring>
#include <functional>
#include <algorithm>
#include <math.h>
#include <bitset>
#include <set>
#include <queue>
#include <assert.h>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <complex>
#include <numeric>
#include <map>
#include <time.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<int,ull> piu;
typedef pair<ull,ull> puu;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
typedef pair<pii,ll> ppl;
typedef pair<ll,pii> plp;
typedef pair<ll,pll> plP;
typedef pair<int,pii> pip;
typedef pair<pii,int> ppi;
typedef pair<pii,pii> ppp;
typedef pair<double,int> pdi;
typedef pair<int,double> pid;
typedef pair<double,pii> pdp;
typedef pair<double,double> pdd;
typedef pair<pdd,double> pd3;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i,n) for (int (i) = 0; (i) < (n); (i)++)
#define repn(i,a,n) for (int (i) = (a); (i) < (n); (i)++)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define SORT(x) sort((x).begin(),(x).end())
#define SORTN(x,n) sort((x),(x)+(n))
#define ERASE(x) (x).erase(unique((x).begin(),(x).end()),(x).end())
#define COUNT(x,c) count((x).begin(),(x).end(),(c))
#define REMOVE(x,c) (x).erase(remove((x).begin(),(x).end(),(c)),(x).end())
#define REVERSE(x) reverse((x).begin(),(x).end())
#define FORIT(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))-(x).begin()
#define lb(x,a) lower_bound((x).begin(),(x).end(),(a))
#define LBN(x,a,n) lower_bound((x),(x)+(n),(a))-(x)
#define lbN(x,a,n) lower_bound((x),(x)+(n),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))-(x).begin()
#define ub(x,a) upper_bound((x).begin(),(x).end(),(a))
#define BS(x,a) binary_search((x).begin(),(x).end(),(a))
#define BS2(x,n,a) binary_search((x),(x)+(n),(a))
#define NB(x) (((x)&~((x)+((x)&-(x))))/((x)&-(x))>>1)|((x)+((x)&-(x)))
#define NP(x) next_permutation((x).begin(),(x).end())
#define MM(x,p) memset((x),(p),sizeof(x))
#define SQ(x) (x)*(x)
#define SC(c1,c2) strcmp(c1,c2)==0
#define mp make_pair
#define INF (1<<29)
#define INFL (1LL<<61)
#define fi first
#define se second
#define EPS 1e-9
#define MOD 1000000007
#define MIN(x,a) x=min(x,a)
#define MAX(x,a) x=max(x,a)
#define madd(x,a) x=(x+a)%MOD
#define msub(x,a) x=(x+MOD-a)%MOD
#define OUTPUT(x) rep(__,x.size())printf("%d%c",x[__],__+1==x.size()?'\n':' ')

int N;
string S1,S2;

int main()
{
	scanf("%d",&N);
	cin>>S1>>S2;
	int res=-1;
	if(S1[0]==S2[0])res=3;
	else res=6;
	repn(i,1,N)
	{
		if(S1[i]==S2[i])
		{
			if(S1[i-1]==S2[i-1])res=res*2%MOD;
		}
		else if(S1[i]!=S1[i-1])
		{
			if(S1[i-1]!=S2[i-1])res=ll(res)*3%MOD;
			else res=res*2%MOD;
		}
	}
	printf("%d\n",res);
}

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

using namespace std;

static const int N = 100;
static const int WHITE = 0;//?????¢?´¢
static const int GRAY = 1;//??¢?´¢???
static const int BLACK = 2;//??¢?´¢??????

int n, M[N][N];
int color[N], d[N], f[N], tt;
int nt[N];

/**
  *??£??\?????¢???
  */
int next(int u) {
  for(int v = nt[u]; v < n; v++) {
    nt[u] = v + 1;
    if(M[u][v]) return v;
  }
  return -1;
}

/**
  *??±???????????¢?´¢???????????¨???
  */
void dfs_visit(int r) {
  for(int i = 0; i < n; i++) nt[i] = 0;

  stack<int> S;
  S.push(r);
  color[r] = GRAY;
  d[r] = ++tt;

  /*
    ??£?????°???????????????????????¨?????¢?´¢?????????????????§??°?????????
  */
  while(!S.empty()) {
    int u = S.top();
    int v = next(u);
    if(v != -1) {
      //??¢?´¢??????????????????????????£?????¢?´¢
      if(color[v] == WHITE) {
        color[v] = GRAY;
        d[v] = ++tt;
        S.push(v);
      }
    }
    else {
      //??£???????????¨?????¢?´¢?????????
      S.pop();
      color[u] = BLACK;
      f[u] = ++tt;
    }
  }
}

/**
  *?????£?????°???????????¢?´¢??????????????????
  **/
void dfs() {
  //init
  for(int i = 0; i < n; i++) {
    color[i] = WHITE;
    nt[i] = 0;
  }
  tt = 0;


  for(int u = 0; u < n; u++) {
    //?????¢?´¢????????????????±??????¢?´¢
    if(color[u] == WHITE ) dfs_visit(u);
  }
  for(int i = 0; i < n; i++) {
    cout << i + 1 << " " << d[i] << " " <<f[i] << endl;
  }
}


int main(void) {
  int u, k, v;
  cin >> n;
  //init
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < n; j++) {
      M[i][j] = 0;
    }
  }


  //??£??\???????????¨??????0-origin?????£??\???????????????
  for(int i = 0; i < n; i++) {
    cin >> u >> k;
    u--;
    for(int j = 0; j < k; j++) {
      cin >> v;
      v--;
      M[u][v] = 1;
    }
  }

  dfs();

  return 0;
}

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

int main() 
{
	string s; cin>>s;
	int one=0,zero=0;
	for(char c: s)
	{
		if(c=='1')
		{
			one++;
		}
		else
		{
			zero++;
		}
	}
	cout<<min(one,zero)*2;
	


}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
const int maxn=200005,maxm=1000005;
int n,m,ans,a[maxn],cnt[maxm];
bool boo[maxm];
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		m=max(m,a[i]);
	}
	sort(a+1,a+1+n);
	for (int i=1;i<=n;i++)
		if (!boo[a[i]])
		{
			ans++;
			cnt[a[i]]++;
			for (int j=a[i];j<=m;j+=a[i]) boo[j]=true;
		} else
		if (cnt[a[i]]==1)
		{
			ans--;
			cnt[a[i]]++;
		}
	printf("%d\n",ans);
	return 0;
}


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

int main() {
    string o, e; cin >> o >> e;
    int n = o.size(), m = e.size();
    char ans[n + m + 1];
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        ans[cnt] = o[i];
        cnt += 2;
    } 
    cnt = 1;
    for (int j = 0; j < m; j++) {
        ans[cnt] = e[j];
        cnt += 2;
    }
    for (int i = 0; i < n + m; i++) {
        cout << ans[i];
    }
    cout << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string s,r;
	int i;
	const char *a[7] = 
	{
		"afkpuz",
		"bglqv.",
		"chmrw?",
		"dinsx!",
		"ejoty ",
	};
	while(cin >> s)
	{
		r="";
		for(i=0;i+1<s.size();i+=2)
		{
			if(s[i]>'6' || s[i+1]>'5' || s[i]<'1' || s[i+1]<'1') break; 
			r+=a[s[i+1]-'1'][s[i]-'1'];
		}
		if(i != s.size())
			cout << "NA"<<endl;
		else
			cout << r << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <numeric>
using namespace std;
typedef long long int ll;

int cnt[100100];
int main(){
    int n,k,q; cin >> n >> k >> q;
    for(int i=0;i<q;i++){
        int a; cin >> a; a--;
        cnt[a]++;
    }
    for(int i=0;i<n;i++){
        if(k-(q-cnt[i])>0){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define ss(x) scanf("%s",x)
#define mod 1000000007
#define bitcount __builtin_popcountll
#define ll long long
#define pb push_back
#define pi pair<int,int>
#define pii pair<pi,int>
#define mp make_pair
int main()
{
	int i,j,k;
	ll n,m;
	slld(m);
	slld(n);
	ll ans=min(m,n/2);
	m-=ans;
	n-=ans*2;
	ans+=n/4;
	printf("%lld\n",ans );
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int gcd(int x,int y){
	
	if(x%y==0){
		return y;
	}else{
		return gcd(y,x%y);
	}
	
}
vecl(S)
vecl(T)

int bin1(ll x,int left,int right){
	int mid=(right+left)/2;
	while(abs(left-right)>1){
		 mid=(left+right)/2;
		if(S.at(mid)>=x){
			right=mid;
		}else{
			left=mid;
		}
		
	}
	return mid;
}

int bin2(ll x,int left,int right){
	int mid=(right+left)/2;
	while(abs(right-left)>1){
		 mid=(left+right)/2;
		if(T.at(mid)>=x){
			right=mid;
		}else{
			left=mid;
		}
		
	}
	return mid;
}

int main() {

int A,B,Q;

cin>>A>>B>>Q;
fx(A){
	vecpl(S)
}
fx(B){
	vecpl(T)
}
sorts(S)
sorts(T)
fy(Q){
	ll ans=LLONG_MAX;
	ll x;
	cin>>x;
	
	int i=bin1(x,0,A-1);
	int j=bin2(x,0,B-1);
 // doublece(i,j)
	for(int k=-5;k<=5;k++){
		if(i+k<0||i+k>=A){continue;}
		for(int l=-5;l<=5;l++){
			if(j+l<0||j+l>=B){continue;}
			ll h=(S.at(i+k)-x)/abs(S.at(i+k)-x)*(T.at(j+l)-x);
			
			if(h>=0){
				ans=min(ans,max(abs(S.at(i+k)-x),abs(T.at(j+l)-x)));
			}else{
				ans=min(ans,abs(S.at(i+k)-x)+abs(T.at(j+l)-x)+min(abs(S.at(i+k)-x),abs(T.at(j+l)-x)));
            }
			
		}
	}
	ce(ans)
}


}


Measured memory_bytes: 3060
#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>

using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int MAXN = 345678;
int ans[MAXN];

int main() {
    int N, K;
    while (~scanf("%d %d", &K, &N)) {
          int cur = N - 1;
          if (K % 2 == 0) {
             ans[0] = K / 2;
             for (int i = 1; i < N; i++) ans[i] = K;
          } else {
             for (int i = 0; i < N; i++) ans[i] = (K + 1) / 2;
             for (int i = 0; i < N / 2; i++) {
                 if (ans[cur] == 1) {
                    cur--;
                    continue;
                 }
                 ans[cur]--;
                 while (cur != N - 1) ans[++cur] = K;
             }
          }
          for (int i = 0; i <= cur; i++) printf("%d%c", ans[i], i == cur ? '\n' : ' ');
    }

    return 0;
}


Measured memory_bytes: 3456
#define _USE_MATH_DEFINES

#include <bits/stdc++.h>
using namespace std;
using i32 = int; using i64 = long long int; using f64 = double; using str = string;
template <typename T> using vec = vector<T>;
template <typename T> using heap = priority_queue<T, vec<T>, greater<T>>;
#define times(n, i) for (i32 i = 0; i < (n); ++i)
#define range(a, b, i) for (i32 i = (a); i < (b); ++i)
#define upto(a, b, i) for (i32 i = (a); i <= (b); ++i)
#define downto(a, b, i) for (i32 i = (a); i >= (b); --i)
#define all(xs) (xs).begin(), (xs).end()
#define sortall(xs) sort(all(xs))
#define reverseall(xs) reverse(all(xs))
#define uniqueall(xs) (xs).erase(unique(all(xs)), (xs).end())
#define even(x) (((x) & 1) == 0)
#define odd(x) (((x) & 1) == 1)
#define append emplace_back
#define findge lower_bound
#define findgt upper_bound
const i64 MOD = 1000000007;
const f64 EPS = 1e-10;

i64 h, w;

i32 main()
{
	cin >> h >> w;
	i64 ans = LLONG_MAX;
	{
		i64 w1 = w / 3;
		i64 w2 = (w - w1) / 2;
		i64 w3 = w - w1 - w2;
		i64 s1 = min(h*w1, min(h*w2, h*w3));
		i64 s2 = max(h*w1, max(h*w2, h*w3));
		if (s1 > 0)
			ans = min(ans, s2 - s1);
	}
	{
		i64 h1 = h / 3;
		i64 h2 = (h - h1) / 2;
		i64 h3 = h - h1 - h2;
		i64 s1 = min(w*h1, min(w*h2, w*h3));
		i64 s2 = max(w*h1, max(w*h2, w*h3));
		if (s1 > 0)
			ans = min(ans, s2 - s1);
	}
	{
		i64 h1 = h / 2;
		i64 h2 = h - h1;
		upto(1, w - 1, w1) {
			i64 w2 = w - w1;
			i64 s1 = min(w1*h, min(w2*h1, w2*h2));
			i64 s2 = max(w1*h, max(w2*h1, w2*h2));
			if (s1 > 0)
				ans = min(ans, s2 - s1);
		}
	}
	{
		i64 w1 = w / 2;
		i64 w2 = w - w1;
		upto(1, h - 1, h1) {
			i64 h2 = h - h1;
			i64 s1 = min(w*h1, min(w1*h2, w2*h2));
			i64 s2 = max(w*h1, max(w1*h2, w2*h2));
			if (s1 > 0)
				ans = min(ans, s2 - s1);
		}
	}
	cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll; 
typedef vector<int> vi;
typedef vector<long long> vl;
const ll INFL = 1e18;
const int INF = 1001001001; 
typedef pair<int,int> P;
#define foreach(ix,i) for(auto& (ix) : (i))
typedef long double ld;
int mod =1000000007;
const double PI = acos(-1);
int main(){
   int d,a,b;cin>>d>>a>>b;
   
   if(a*b>=d)cout<<"Yes"<<endl;
   else
   {
       cout<<"No"<<endl;
   }
   
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
typedef long long  ll ;
typedef double db;
const double pi = 3.141592654;
#define pb         push_back
#define forab(i,a,b)       for(int i=(a);i<=(b);i++)
#define CIN	ios_base::sync_with_stdio(0); cin.tie(0)
#define pcase(z,x)     printf("Case %ld: %lld\n",z,x)
#define nw	 "\n"

int main(void)
{
	CIN;
	ll tc,l,k,sum=0,x=0,y,z=0,m=1,n=0,ans=0,cnt=0;
	cin>>n;
	ll arr[n];
	for(ll i=0;i<n;i++)cin>>arr[i];
	ll maxh=0;
	for(ll i=1;i<n;i++){
		if(arr[i]<=arr[i-1])ans++;
		else ans=0;
		maxh=max(maxh,ans);
	}
	cout<<maxh;

}

Measured memory_bytes: 4392
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <iomanip>
#include <random>
#include <complex>
#include <functional>
#include <tuple>

using namespace std;

#define Rep(i,a,b) for(ll i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")

using ll = long long;

constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

namespace {
    template<typename T> void chmax(T& a, T b) { a = std::max(a, b); }
    template<typename T> void chmin(T& a, T b) { a = std::min(a, b); }
    template<typename T> void chadd(T& a, T b) { a = a + b; }

    void Cout(long long x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const T& x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; i++) { std::cout << x[i] << (i == sz - 1 ? end : sep); } }

    // 標準入出力
    struct inp {
        std::size_t sz;
        inp(std::size_t _sz = 1) : sz(_sz) {}
        template <typename T> operator T () const { T a; std::cin >> a; return a; }
        template <typename T> operator std::vector<T>() const { std::vector<T> a(sz); for (std::size_t i = 0; i < sz; i++) std::cin >> a[i]; return a; }
    };

    // 2次元用の標準入出力
    template<typename T>
    struct inpn {
        std::size_t szi, szj;
        inpn(std::size_t _szi, std::size_t _szj) : szi(_szi), szj(_szj) {}
        operator std::vector<std::vector<T>>() const {
            std::vector<std::vector<T>> a(szi, std::vector<T>(szj));
            for (std::size_t i = 0; i < szi; ++i)
                for (std::size_t j = 0; j < szj; ++j) cin >> a[i][j];
            return a;
        }
    };

    inp inp1; // input one

    ll F(ll n) {
        ll res = 0;
        while (n != 0) {
            n /= 10;
            ++res;
        }
        return res;
    }
}

int main() {

    ll n = inp1;

    ll ans = inf;

    for (ll i = 1; i * i <= n; ++i) {
        if (n % i != 0) continue;

        ll first = i;
        ll second = n / i;

        chmin(ans, max(F(first), F(second)));
    }

    Cout(ans);

    return 0;
}


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

int main() {
    int N;
    cin >> N;
    vector<int> vec(N);
    for (int i = 0; i < N; i++) {
        cin >> vec.at(i);
    }
    sort(vec.begin(), vec.end());
    string A = "NO";
    for (int i = 1; i < N; i++) {
        if (vec.at(i - 1) == vec.at(i)) break;
        else if (i == N - 1) A = "YES";
    }
    cout << A << endl;
    
}


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

int main(){
  long double W,H; cin >> W >> H;
  long double x,y; cin >> x >> y;
  long double ans = W*H/2;
  int ans2 = 0;
  if(x + x == W && y + y == H) ans2 = 1;
  cout << ans << ' ' << ans2 << endl;
}



Measured memory_bytes: 256
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
* * WRITER:kakitamasziru/OxOmisosiru * *
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG //FOR THE DEBUG! COMMENT OUT THIS WHEN SUBMITTING!
#endif
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
//It is so troublesome that I include bits/stdc++.h !
using namespace std;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const long long INF = 1001001001001001;
const long long MOD = 1000000007;
typedef pair<long long,long long> P;
//NのM乗を求める(繰り返し二乗法)
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //最下位ビット(*N)が1の時は単独でNをかける
    if (M & 1) res = (res * N) % MOD;

    return res %= MOD;
}
long long nCr(long long n, long long r) {
    long long A = 1, B = 1;
    //Aが分子Bが1/r!
    for (long long i = n - r + 1; i <= n; i++) {
        A = A * i % MOD;
    }
    for (long long i = 1; i <= r; i++) {
        B = B * i % MOD;
    }
    B = mod_pow(B, MOD - 2);
    B %= MOD;
    //Bは割るのではなく掛ける
    return (A * B) % MOD;
}

long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
 
long long lcm(long long a, long long b) {
    return a * b / gcd(a, b);
}

long long A,B;
bool ok(long long key,long long index){
    string S = to_string(index);
    long long nagasa = S.size();
    if(index*A+nagasa*B > key) return true;
    else if(index*A+nagasa*B <= key) return false;
}
long long binary_search(long long key,long long size){
    //left,right,midはいずれもindex
    long long left = -1,right = size;
    while(right - left > 1){
        long long mid = left + (right-left)/2;
        long long hantei = ok(key,mid);
        if(hantei) right = mid;
        else left = mid;
    }
    if(left == -1)return 0;
    return left;
}

int main() {
    long long N,M;cin >> N >> M;
    cout << abs((N*M)+4-2*(N+M)) << endl;

    // PLEASE GIVE ME THE "ACCEPTED" !
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    double b;
    cin >> b;

    ll r = a * (ll)round(b * 100.0) / 100;

    cout << r << endl;

    return 0;
}

Measured memory_bytes: 3748
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

// vectorの重複削除
// std::sort(test.begin(), test.end());
// test.erase(std::unique(test.begin(), test.end()), test.end());

using namespace std;
using ll = long long;
using P = pair<int, int>; // vector<P> ba(n); みたいな感じですぐ使える ba[i] = P(a, b); make_pairをしなくてもいい
// typedef vector<int> v;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}
#define rep(i, c) for(int i = 0; i < int(c); i++)
#define ALL(x) (x).begin(), (x).end() //sort(ALL(obj))みたいな
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値
#define pb push_back //
// const int MOD = 1000000007;


int main() {
  string s, t;
  cin >> s >> t;
  rep(i,s.size()) {
    if (s[i] != t[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 3132
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

vector<vi> G;
vi memo, color;

void dfs(int v, int d, int c){
    if(color[v] == 0){
        color[v] = c;
    }
    if(d == 0) return;

    if(memo[v] >= d){
        return;
    }
    memo[v] = d;

    for(auto& nv : G[v]){
        dfs(nv, d-1, c);
    }
}

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

    int n, m; cin >> n >> m;
    G = vector<vi>(n);
    rep(loop, m){
        int a, b; cin >> a >> b;
        a--, b--;
        G[a].emplace_back(b);
        G[b].emplace_back(a);
    }

    int Q; cin >> Q;
    using vdc = tuple<int, int, int>;
    vector<vdc> in(Q);
    for(auto& e : in){
        int v, d, c; cin >> v >> d >> c;
        v--;
        e = vdc(v, d, c);
    }

    color = vi(n);
    memo  = vi(n, -1);
    rrep(i, Q){
        int v, d, c; tie(v, d, c) = in[i];
        dfs(v, d, c);
    }

    for(auto& e : color){
        cout << e << endl;
    }

    return 0;
}


Measured memory_bytes: 8440
N, M = map(int, input().split())

preds = {}
i = 1
for _ in range(M):
    x, y = input().split(' ')
    preds[i] = (int(x), int(y))
    i += 1


ans = [0 for x in range(M)]

flg = -1
num = 1
for x, y in sorted(preds.items(), key=lambda x: x[1]):
    if flg != y[0]:
        num = 1
        ans[x-1] = str(y[0]).rjust(6, '0') + str(num).rjust(6, '0')
        flg = y[0]
    else:
        num += 1
        ans[x-1] = str(y[0]).rjust(6, '0') + str(num).rjust(6, '0')

for i in ans:
    print(i)


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

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)

#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

#define INF 1000000000000
#define MOD 1000000007
#define MAXR 100000

using namespace std;
typedef long long ll;

int main() {
    string s;
    cin >> s;
    string a = "";
    ll result = atoll(s.c_str());
    int k = 0;
    FOR(i, 1, pow(2, s.size() - 1) - 1){
        a = s[0];
        REP(j, s.size()-1){
            k++;
            if (i & (1 << j)){
                result += atoll(a.c_str());
                a = "";
            }
            a += s[k];
        }
        k = 0;
        result += atoll(a.c_str());
        a = "";
    }
    cout << result;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii=pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c),end(c)
#define rall(c) rbegin(c),rend(c)
#define fore(x,c) for(auto &&x:c)
#define rep(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define rrep(i, a, n) for(int i=(int)(n-1);i>=a;--i)
#define sz(c) ((int)c.size())
#define contains(c,x) (c.find(x)!=end(c))
#define inseg(l,x,r) ((l)<=(x)&&(x)<(r))
#define dump(...)
#define pb push_back
#define _ 0
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(nullptr); ios::sync_with_stdio(0);
        cout << setprecision(15) << fixed;
        // #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    string s,t;
    cin >> s >> t;
    int ans = 0;
    rep(i, 0, 3) {
        if (s[i] == t[i]) {
            ans++;
        }
    }
    cout << ans << endl;
    return (0^_^0);
}



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

#define INTINF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	int tmp;
	int n, t;
	cin >> n >> t;
	int gr = 0;
	int ma[n+1] = {}, a[n];
	map<int, int> d;
	REP(i, n) cin >> a[i];
	for(int i = n-1; i >= 0; i--){
		ma[i] = max(ma[i+1], a[i]);
		d[ma[i]-a[i]]++;
		gr = max(gr, ma[i]-a[i]);
	}
	cout << d[gr] << endl;
}


Measured memory_bytes: 9056
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;

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

  cout << a + a*a + a*a*a << "\n";
  
  return 0;
}


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

int main() {
  char S;
  cin >> S;

  // ここにプログラムを追記
 if (S == 'a' || S == 'i' || S == 'u' || S == 'e' || S == 'o') {
 cout << "vowel" << endl;
 }
else {
cout << "consonant" << endl;
}
}


Measured memory_bytes: 256
//you never give up.
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define v32 vector<int>
#define v64 vector<ll>
#define Mod 1000000007
ll modulos(ll a, ll b, ll mod = Mod)
{
    return (((a % mod) * (b % mod)) % mod);
}

using namespace std;

void solve()
{
    ll n, k;
    cin >> n >> k;
    ll *arr = new ll[n];
    for (ll i = 0; i < n; i++)
    {
        cin >> arr[i];
    }

    ll j = 0;
    for (ll i = k; i < n; i++)
    {
        if (arr[i] > arr[j])
            cout << "Yes" << endl;
        else
            cout << "No" << endl;

        j++;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    t = 1;
    while (t--)
    {
        solve();
    }
}

Measured memory_bytes: 5232
import java.io.*;
import java.util.Scanner;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		
		int[] cnt = new int[m];
		for (int i = 0; i < n; i++) {
			int k = sc.nextInt();
			for (int j = 0; j < k; j++) {
				int a = sc.nextInt() - 1;
				cnt[a]++;
			}
		}

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

		pr.println(ans);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}


Measured memory_bytes: 23124
#include<bits/stdc++.h>
using namespace std;
int s[100005];
int main() {
    int n;
    scanf("%d",&n);
    int sum=0;
    for(int i=0; i<n; i++) {
        int a;
        scanf("%d",&a);
        s[a]++;
        s[a+1]++;
        if(a>0)
            s[a-1]++;
        sum=max(sum,s[a]);
        sum=max(sum,s[a+1]);
        if(a>0)
            sum=max(sum,s[a-1]);
    }
    printf("%d\n",sum);
    return 0;
}


Measured memory_bytes: 640