akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
const int dx[]={1,0,0,-1,1,-1,-1,1};
const int dy[]={0,1,-1,0,1,1,-1,-1};
const int INF = 1<<30;
const double EPS = 1e-8;
#define PB push_back
#define mk make_pair
#define fr first
#define sc second
#define reps(i,j,k) for(int i = (j); i < (k); ++i)
#define rep(i,j) reps(i,0,j)
#define MOD 1000000007
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> Pii;
typedef pair<int,vi > P;

typedef unsigned long long ll;

int main(){
	int N,W,H;
	scanf("%d%d%d",&N,&W,&H);
	int Himos[100010] = {0};
	int Wimos[100010] = {0};
	rep(i,N){
		int x,y,w;
		scanf("%d%d%d",&x,&y,&w);
		Himos[max(0,y-w)]++;
		Himos[min(H-1,y+w-1)]--;
		Wimos[max(0,x-w)]++;
		Wimos[min(W-1,x+w-1)]--;
	}/*
	rep(i,10){
		printf("%d ",Himos[i]);
	}
	puts("");
	rep(i,10){
		printf("%d ",Wimos[i]);
	}
	puts("");*/
	int now = 0;
	bool con = false;
	bool flg = true;
	rep(i,W){
		if(Wimos[i] == 0 && con == false){
			flg = false;
			break;
		}
		now += Wimos[i];
		if(now != 0){
			con = true;
		}
		if(now == 0){
			con = false;
		}
	}
	now = 0;
	con = false;
	if(flg == false){
		flg = true;
		rep(i,H){
			if(Himos[i] == 0 && con == false){
				flg = false;
				break;
			}
			now += Himos[i];
			if(now != 0){
				con = true;
			}
			if(now == 0){
				con = false;
			}
		}
	}
	if(W == 1 && H == 1)flg = true;
	flg ? puts("Yes") : puts("No");

	return 0;
}

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

typedef long long ll;
constexpr ll MOD = ll(1e9+7);

ll power(ll x, ll n){
    ll res = 1;
    while(n > 0){
        if(n&1){
            res *= x;
            res %= MOD;
        }
        x *= x;
        x %= MOD;
        n >>= 1;
    }
    return res;
}

int main(){
    string Z, O;
    ll n, m, l;
    cin >> Z >> O >> n;
    m = Z.size();
    l = O.size();
    if(n <= l){
        string s,h;
        s += O.substr(l-n,n);
        reverse(s.begin(), s.end());
        h = s;
        s += Z;
        s += h;
        s += O;
        bool ok = true;
        for(int i=0;i<int(s.size());i++){
            ok &= (s[i] == s[int(s.size())-1-i]);
        }
        cout << (ok ? 1 : 0) << endl;
    }
    else{
        if(Z.size() > O.size()){
            if(Z.substr(0,O.size())==O){
                bool ok = true;
                for(int i=l;i<m;i++){
                    ok &= (Z[i] == Z[m-1-(i-l)]);
                }
                if(ok){
                    cout << power(26, (n-l+1)/2) << endl;
                }
                else{
                    cout << 0 << endl;
                }
            }
            else{
                cout << 0 << endl;
            }
        }
        else{
            if(O.substr(0,Z.size())==Z){
                bool ok = true;
                for(int i=m;i<l;i++){
                    ok &= (O[i]==O[l-1-(i-m)]);
                }
                if(ok){
                    cout << power(26, (n-l+1)/2) << endl;
                }
                else{
                    cout << 0 << endl;
                }
            }
            else{
                cout << 0 << endl;
            }
        }
    }
    return 0;
}


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

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

  int h, w, k;
  cin >> h >> w >> k;

  char m[h][w];
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      cin >> m[i][j];
    }
  }

  int ans = 0;

  int sum = h + w;
  for (int bit = 0; bit < (1<<sum); ++bit) {
    int black = 0;
    vector<int> ch(h, 0), cw(w, 0);

    for (int i = 0; i < sum; ++i) {
      if (bit & (1<<i)) {
        int j = i;
        if (j >= h) {
          j -= h;
          cw[j] = 1;
        } else ch[j] = 1;
      }
    }

    for (int i = 0; i < h; ++i) {
      for (int j = 0; j < w; ++j) {
        if (ch[i] || cw[j] || m[i][j] == '.') continue;
        ++black;
      }
    }

    if (black == k) ++ans;
  }

  cout << ans << '\n';

  return (0);
}

Measured memory_bytes: 3668
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define INF 999999999
#define rep(i,n) for(int i=0;i<n;i++)
const int MOD = 1000000007;

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

    vector<int>a(n+1),b(n+1);
    for(int i=1;i<=n;i++){
        cin >> a.at(i);
        b.at(i) = 0;
    }
    ll cnt = 0;

    for(int i=n;i>0;i--){
        int k=0;
        k=a[i];
        for(int j=1;j*i<=n;j++){
            k += b.at(i*j);
        }

        b.at(i) = k%2;
        cnt += b.at(i);

    }

    cout << cnt << endl;
    
    for(int i=1;i<=n;i++){
        if(b.at(i) == 1){
            cout << i << " " ;
        }
    }
    cout << endl;
    
   

    return 0;

}

Measured memory_bytes: 2432
#include<bits/stdc++.h>
using namespace std ;
long long int power(long long int a,long long int n,long long int m) ;
 long long int power(long long int a,long long int n,long long int m)
{  if(n==0)
   return 1 ;
   long long int x=power(a,n/2,m) ;
   if(n%2!=0)
    return (((a*x)%m)*(x)%m)%m ;
    else return (x*x)%m ;
}
int main()
{ long long int n,i,j,x,y,m,k,t,sum,count,cnt,b,c,d,j1,z,m1,a;
  string s  ;
  cin>>n ;
 sum=(n)*(n+1)/2 ;
  a=n/3 ;
  sum-=((a)*(a+1)*3)/2 ;
  a=n/5 ;
    sum-=((a)*(a+1)*5)/2 ;
    a=(n/15) ;
      sum+=((a)*(a+1)*15)/2 ;
      cout<<sum ;
      return 0 ; }


Measured memory_bytes: 3628
#include <stdio.h>

int main() {
	char s[3];
	int a, b;

	scanf("%s", s);

	a = s[0] + s[1] + s[2];
	b = 'a' + 'b' + 'c';

	if ( a== b) {printf("Yes\n");}
	else { printf("No\n"); }

	return 0;
}

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

#define INF ((1<<30)-1)
#define LLINF (1LL<<60)
#define EPS (1e-10)

int main() {
    int N;
    cin >> N;
    vector<ll> L(N);
    rep(i, N) cin >> L[i];
    int ans = 0;
    sort(L.begin(), L.end());
    rep(i, N) {
        for (int j = i+1; j < N; ++j) {
            if (L[i] == L[j]) continue;
            for (int k = j+1; k < N; ++k) {
                if (L[i] == L[k] or L[j] == L[k]) continue;
                if (abs(L[j] - L[k]) < L[i] and L[i] < L[j] + L[k]) {
                    ans++;
                    //cout << L[i] << ", " << L[j] << ", " << L[k] << endl;
                }
            }
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e6 + 5;
const int INF = 0x3f3f3f3f;
#define DEBUG(x) cout << (x) << '\n'
#define fi first
#define se second

int n, a[MAXN];
void run(){
    cin >> n;
    ll ans = 0;
    for(int i = 1; i <= n; i++){
        for(int j = i; j <= n; j += i)
            a[j]++;
        ans += a[i];
    }
    DEBUG(ans - a[n]);
}
int main(){
#ifdef Irene
    freopen("in.txt", "r", stdin);
#endif // Irene
    ios_base::sync_with_stdio(false);

    run(); return 0;
}


Measured memory_bytes: 7548
def main():
    n = int(input())
    num_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

    print(num_list[n-1])

if __name__ == '__main__':
    main()

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N, M;
    cin >> N >> M;
    vector<int> vec(N);
    for (int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
        vec.at(a-1)++;
        vec.at(b-1)++;
    }
    for (int i = 0; i < N; i++) {
        cout << vec.at(i) << endl;
    }
    


}

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

string str[45];
int A[45][45];
int N;
ll DP[45][45][45];


ll solve(int l , int r , int m){
  if(l == r)return 1;
  if(l == m || r == m)return 0;
  if(~DP[l][r][m])return DP[l][r][m];
  DP[l][r][m] = 0;
  for(int j = l; j < m; ++j){
    for(int k = m + 1; k <= r; ++k){
      if(A[j][k]){ // cut (j , k)
        for(int x = j; x < m; ++x){
          for(int y = m; y < k; ++y){
            DP[l][r][m] += solve(l , x , j) * solve(x + 1 , y , m) * solve(y + 1 , r , k);
          }
        }
      }
    }
  }
  return DP[l][r][m];
}


int main(){
  cin >> N;
  for(int i = 1; i <= 2 * N; ++i){
    cin >> str[i];
  }
  for(int i = 1; i <= 2 * N; ++i){
    for(int j = 0; j < 2 * N; ++j){
      A[i][j + 1] = str[i][j] == '1';
    }
  }
  ll ret = 0;
  memset(DP , -1 , sizeof(DP));
  for(int i = 2; i <= 2 * N; ++i){
    if(A[1][i]){
      ret += solve(2 , 2 * N , i);
    }
  }
  cout << ret << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include<vector>
#include <algorithm>
#include <queue>
#include<string>
#include <map>
#include <cmath>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef long double ld;

int main() {
	int n;
	cin >> n;
	vector<int> p(n);
	rep(i, n)cin >> p[i];
	int count = 0;
	for (int i = 1; i < n - 1;++i) {
		if ((p[i - 1] < p[i] &&
			p[i] < p[i + 1]) ||
			(p[i] < p[i - 1] &&
				p[i+1 ] < p[i])) {
			count++;
		}
	}
	cout << count << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
int main() {
    ios :: sync_with_stdio(false);
    cin.tie(0);
    long long n, m, s;
    cin >> n >> m;
    s = n * m;
  	if(n == 1 or m == 1)
      cout << 1;
    else 
      cout << (s % 2 == 0 ? s / 2 : (s / 2) + 1);
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
    public static void main(String... args) {
        String S = IN.next();
        String T = IN.next();
        int z = S.length();
        boolean flag = false;
        for (int i = 0; i < z; i++) {
            String x = S.substring(z - i - 1) + S.substring(0, z - i - 1);
            if (x.equals(T)) {
                flag = true;
                break;
            }
        }
        puts(flag ? "Yes" : "No");
    }
    static final Scanner IN = new Scanner(System.in);
    static <T> void puts(T arg) { System.out.println(arg); }
}

Measured memory_bytes: 21204
#include<algorithm>
#include<stack>
#include<ctime>
#include<cstring>
#include<cmath>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<queue>
using namespace std;
typedef int _int;
#define int long long 
inline int read(){
	int num=0,f=1;char x=getchar();
	while(x<'0'||x>'9'){if(x=='-')f=-1;x=getchar();}
	while(x>='0'&&x<='9'){num=num*10+x-'0';x=getchar();}
	return num*f;
}
const int maxn=200005;
int n,a[maxn];
_int main(){
	n=read();
	for(int i=1;i<=n;++i)a[i]=read();
	int ans=0;
	for(int i=2;i<=n;++i){
		if(a[i]<a[i-1]){
			ans+=a[i-1]-a[i];
			a[i]=a[i-1];
		}
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 5304
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  for(int i=0;i<N;i++){
    string S;
    cin>>S;
    if(S=="Y"){cout<<"Four"<<endl;
    return 0;}}
    
    cout<<"Three"<<endl;
    
    
    return 0;
}

Measured memory_bytes: 3604
#include <iostream>
#include <string>
#include <vector>
#include <queue>
using ll=long long;
using namespace std;

int main(){
    int H,W;
    cin>>H>>W;
    int Ch,Cw,Dh,Dw;
    cin>>Ch>>Cw>>Dh>>Dw;
    Ch--;Cw--;Dh--;Dw--;
    vector<vector<char>> S(H,vector<char>(W));
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cin>>S[i][j];
        }
    }

    queue<pair<int,int>> q1;
    queue<pair<int,int>> q2;
    vector<vector<int>> dist(H,vector<int>(W,H*W+1));
    q1.push({Ch,Cw});
    dist[Ch][Cw]=0;
    pair<int,int> tmp;
    int x,y;
    while(!q1.empty()){
        while(!q1.empty()){
            tmp=q1.front();
            x=tmp.first;y=tmp.second;
            //cout<<x<<" "<<y<<endl;
            q1.pop();
            for(int i=-2;i<=2;i++){
                for(int j=-2;j<=2;j++){
                    if(i!=0 || j!=0){
                        if(i*j==0 && i!=2 && j!=2 && i!=-2 && j!=-2){
                            if(x+i>=0 && x+i<H && y+j>=0 && y+j<W && dist[x+i][y+j]>dist[x][y] &&S[x+i][y+j]=='.'){
                                dist[x+i][y+j]=dist[x][y];
                                q1.push({x+i,y+j});
                            }
                        }else{
                            if(x+i>=0 && x+i<H && y+j>=0 && y+j<W && dist[x+i][y+j]>dist[x][y] &&S[x+i][y+j]=='.'){
                                dist[x+i][y+j]=dist[x][y]+1;
                                q2.push({x+i,y+j});
                            }
                        }
                    }

                }
            }
        }

        while(!q2.empty()){
            q1.push(q2.front());
            q2.pop();
        }
    }
    int ans=dist[Dh][Dw];
    if(ans==H*W+1){
        ans=-1;
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 10920
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

using namespace std;

int main() {
   int a,b,x;
   cin >> a >> b >> x; 
   if(a>x || a+b<x)
   cout << "NO" << endl;
   else 
   cout << "YES" << endl;
}

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

#if DEBUG && !ONLINE_JUDGE
  #include "header.h"
#else
  #define debug(args...)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef long long lli;
typedef long double ld;

#define pb push_back
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x).size()
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define rep(i,a,b) for(auto i=(a);i<b;i++)

#define INF (int)1e9
#define EPS 1e-9
#define MOD 1000000007
void preprocess(void) {
  return;
}
vi p, in, ss;
vector<vi> adj;
void dfs(int v, int par = -1) {
  int flag = 0;
  for(auto x: adj[v]) {
    if(x == par) continue;
    flag = 1;
    ss[v]++;
    p[x] = v;
    dfs(x, v);
  }
  if(!flag) in.pb(v);
}

vi matched;
int ans = 0;
void dfs1(int v, int par = -1) {
  for(auto x: adj[v])  {
    if(x == par) continue;
    dfs(x, v);
  }
  if(par != -1 && !matched[v]) {
    if(matched[par]) {
      ans = 1;
    }
    matched[par] = 1;
    matched[v] = 1;
  }

}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(20);
  preprocess();
  int n; cin>>n;
  adj.resize(n+1, vi(0));
  ss.resize(n+1);
  p.resize(n+1, -1);
  rep(i,0,n-1) {
    int x, y; cin>>x>>y;
    adj[x].pb(y);
    adj[y].pb(x);
  }
  if(n%2) {
    cout<<"First"<<endl;
    return 0;
  }
  dfs(1, -1);
  int flag = 0; //flag = 0 => matching exists
  vi d(n+1);
  while(!in.empty()) {
    int x = in.back();
    in.pop_back();
    if(p[x] == -1 || d[p[x]]) {
      flag = 1;
      break;
    }
    d[x] = 1;
    d[p[x]] = 1;
    if(p[p[x]] != -1) {
      ss[p[p[x]]]--;
      if(ss[p[p[x]]] == 0) {
        in.pb(p[p[x]]);
      }
    }
  }
  if(flag) cout<<"First"<<endl;
  else cout<<"Second"<<endl;
}



Measured memory_bytes: 7296
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#include<bits/stdc++.h>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX
#define vvi vector<vector<int> >
#define vvc vector<vector<char> >
#define vvs vector<vector<string> >
#define P 1000000007
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;}
const long long LLINF=1LL<<60;
//set<int>::iterator it;

std::vector<ll> enum_div(ll n)//nの約数を列挙
{
	std::vector<ll> ret;
	for(ll i=1 ; i*i<=n ; ++i)
	{
		if(n%i == 0)
		{
			ret.push_back(i);
			if(i!=1 && i*i!=n)
			{
				ret.push_back(n/i);
			}
		}
	}
	return ret;
}

int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
	
	ll n,ans=0,i;
	cin>>n;
	vector<ll> r = enum_div(n);
	//for(auto i : r) std::cout << i << std::endl;
	//cout<<"aaa"<<endl;
	for(i=1;i<r.size();i++){
		if(n/(r[i]-1)==n%(r[i]-1)){
			ans+=r[i]-1;
		}
	}
	if(n>1&&n/(n-1)==n%(n-1)){
		ans+=n-1;
	}
	fin(ans);
	
//////////////////////////////////////////////////////
return 0;}











Measured memory_bytes: 384
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>

typedef unsigned long long int uint64;
typedef long long int          int64;
 
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

void get_N (int64 *n)
{
  int cnt;
  
  cnt = scanf("%lld", n);

  return;
}

void get_NK (int64 *n, int64 *k)
{
  int cnt;
  
  cnt = scanf("%lld %lld", n, k);

  return;
}

void omit_LF (void)
{
  char c;
  int  cnt;
  
  cnt = scanf("%c", &c);
  return;
}

char *get_S (int64 n)
{
  char *buf;
  int  i;
  int  cnt;

  buf = malloc((size_t)(n * sizeof(char)));
  if (buf == NULL) {
    return NULL;
  }

  cnt = scanf("%s", buf);

  return buf;
}

char *get_SN (int64 max, int64 *size)
{
  char *buf;
  int  i;
  int  n;

  buf = malloc((size_t)(max * sizeof(char)));
  if (buf == NULL) {
    return NULL;
  }

  scanf("%s", buf);

  n = strlen(buf);

  *size = n;
  
  return buf;
}

int64 *get_NSeq (int64 n)
{
  int64 *buf;
  int64 i;

  buf = malloc((size_t)(n * sizeof(int64)));
  for (i=0; i<n; i++) {
    get_N(&buf[i]);
  }

  return buf;
}

typedef struct _tmp_t {
  int64    a;
  int64    b;
} tmp_t;


int compare_a(const void *a, const void *b)
{
  tmp_t *x;
  tmp_t *y;

  x = (tmp_t *)a;
  y = (tmp_t *)b;

  if (x->a > y->a) return 1;
  if (x->a < y->a) return -1;

  return 0;
}

int compare_b(const void *a, const void *b)
{
  tmp_t *x;
  tmp_t *y;

  x = (tmp_t *)a;
  y = (tmp_t *)b;

  if (x->b > y->b) return 1;
  if (x->b < y->b) return -1;

  return 0;
}

void qsort_a (tmp_t *array, int size)
{
  qsort(array, size, sizeof(tmp_t), compare_a);
}

void qsort_b (tmp_t *array, int size)
{
  qsort(array, size, sizeof(tmp_t), compare_b);
}
double ecache[1001];

double get_expected_val(int64 n)
{
  int64 i;
  int64 total = 0;

  if (ecache[n] > 0) return ecache[n];
  
  for (i=1; i<=n; i++) {
    total += i;
  }
  
  ecache[n] = ((double)total/(double)n);
    
  return ecache[n];
}


int main()
{
  int64  N,K;
  int64  *p;
  int64  i;
  double e, maxe, ke;

  get_NK(&N, &K);

  p = get_NSeq(N);

  ke = 0;
  maxe=0;
  for (i=0; i<K; i++) {
    e = get_expected_val(p[i]);
    ke += e;
  }
//  printf("ke0 = %lf\n", ke);
  maxe = ke;
  for (i=1; i<=(N-K); i++) {
    ke -= get_expected_val(p[i-1]);
    ke += get_expected_val(p[i+K-1]);
//    printf("ke%d = %lf\n", i, ke);
    if (ke > maxe) {maxe = ke;}
  }

  printf("%lf", maxe);
  
  return 0;
}



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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 29;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};

int main()
{
  int h, w; cin >> h >> w;
  int sum = 0;
  vector<vector<int>> a(h, vector<int>(w));
  rep(i, h) rep(j, w) cin >> a[i][j];

  vector<tuple<int, int, int, int>> ans;
  for(int k = 0; k < h*w-1; ++k) {
    int i = k/w;
    int j = k%w; 
    if(i%2==1) j = w-1-j;

    int ni = (k+1)/w;
    int nj = (k+1)%w;
    if(ni%2==1) nj = w-1-nj;

    if(a[i][j]%2==1) {
      ++a[ni][nj];
      ans.emplace_back(i+1, j+1, ni+1, nj+1);
    }
  }
  cout << SZ(ans) << endl;
  for(auto x : ans) cout << get<0>(x) << " " << get<1>(x) << " " << get<2>(x) << " " << get<3>(x) << endl;
}

Measured memory_bytes: 5232
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n,k;cin>>n>>k;
  ll a[n];ll sum[n];
  for(ll i=0;i<n;i++){
    cin>>a[i];
    if(i==0)sum[i]=a[i];
    if(i>=1)sum[i]=sum[i-1]+a[i];
  }
  vector<ll> summ;
  for(ll i=0;i<n;i++){
    for(ll j=i;j<n;j++){
      ll ss;
      if(i==0)ss=sum[j];
      else ss=sum[j]-sum[i-1];
      summ.push_back(ss);
    }
  }
  sort(summ.begin(),summ.end(),greater<ll>());
 
  ll x;
  for(ll i=0;;i++){
    if(pow(2,i)>=summ[0]){
      x=i-1;
      break;
    }
  }
  ll o=pow(2,3);
  ll t=9&o;
  //cout<<t;return 0;
  ll ans[x+1];
  for(ll i=x;i>=0;i--){
    ll cnt=0;
    ll p=pow(2,i);
    vector<ll>v;
    for(ll j=0;j<summ.size();j++){
      ll e=summ[j];
      if(e>=p){
        cnt++;
        summ[j]-=p;
        v.push_back(summ[j]);
        //cout<<e<<" ";
        
        //cout<<summ[j]<<endl;
      }
    }
    //cout<<cnt<<endl;
    if(cnt>=k){
      ans[i]=1;
      summ=v;
      continue;
    }
    else{
      ans[i]=0;
      continue;
    }
  }
  ll an=0;
  for(ll i=0;i<=x;i++){
    an+=ans[i]*pow(2,i);
  }
  cout<<an<<endl;
}

Measured memory_bytes: 6384
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define debug(x) cerr << #x << " " << x << '\n'
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
const int INF = 0x3f3f3f3f, N = 55;
const ll LINF = 1e18 + 5;
constexpr int mod = 1e9 + 7;
int n;
ll k;
struct matrix
{
	ll mat[N][N];
}a;
matrix operator * (matrix a, matrix b) 
{
	matrix res;
	for(int i=1; i<=n; i++)
		for(int j=1; j<=n; j++)
		{
			res.mat[i][j] = 0;
			for(int k=1; k<=n; k++)
				res.mat[i][j] = (res.mat[i][j]+a.mat[i][k]*b.mat[k][j]%mod)%mod;
		}
	return res;
}
void one(matrix& E) 
{
	for(int i=1; i<=n; i++)
		for(int j=1; j<=n; j++)
			E.mat[i][j] = (i==j);
}
matrix operator ^ (matrix a, ll x) 
{
	matrix res;
	one(res);
	while(x)
	{
		if(x&1) res = res * a;
		a = a * a;
		x >>= 1;
	}
	return res;
}
int main()
{
 	ios::sync_with_stdio(false);
 	cin.tie(0);
 	cin >> n >> k;
 	for(int i=1; i<=n; i++)
 		for(int j=1; j<=n; j++)
 			cin >> a.mat[i][j];
 	a = a^k;
 	ll ans = 0;
 	for(int i=1; i<=n; i++)	
 		for(int j=1; j<=n; j++)
 			ans = (ans + a.mat[i][j])%mod;
 	ans = (ans + mod)%mod;
 	cout << ans;
	return 0;
}


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

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<pair<int, int>, int> PP;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;

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

int main(void) { 
    int H, W, K;
    cin >> H >> W >> K;
    char cake[310][310];
    for(int i = 0; i < H; i++) {
        for(int j=0;j<W;j++){
            cin>>cake[i][j];
        }
    }
    int cnt = 0;
    int ans[310][310];
    bool col[310];
    for(int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            if(cake[i][j]=='#'){
                col[i] = true;
            }
        }
    }
    for(int i = 0; i < H; i++) {
        int x = 0;
        if (col[i]) {
            for (int j = 0; j < W; j++) {
                if (cake[i][j] == '#') x++;
                if (x == 0) ans[i][j] = cnt + 1;
                else ans[i][j] = cnt + x;
            }
        }
        cnt += x;
    }
    for(int i = 0; i < H - 1; i++) {
        if(col[i]){
            if(!col[i+1]){
                for(int j = 0; j < W; j++) {
                    ans[i + 1][j] = ans[i][j];
                }
                col[i + 1] = true;
            }
        }
    }
    for(int i = 0; i < H; i++) {
        if(col[i]){
            for(int j = 0; j < i; j++) {
                for(int k = 0; k < W; k++) {
                    ans[j][k] = ans[i][k];
                }
            }
            break;
        }
    }
    for(int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            cout << ans[i][j] << ' ';
        }
        cout << endl;
    }
}


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

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

#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
//typedef pair<ll, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX / 10;
//const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
//typedef pair<int, int> P;
//typedef pair<double, double> P;

bool contain(set<P> &s, P a) { return s.find(a) != s.end(); }

//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);


void print_line(vector<ll> &line) {
    if (line.size() == 0ll) {
        cout << endl;
        return;
    }
    for (ll i = 0; i < line.size(); i++) {
        cout << line[i];
        if (i == line.size() - 1) cout << endl;
        else cout << ' ';
    }
}


typedef priority_queue<long long, vector<long long>, greater<long long>> PQ_ASK;
const int mod = 1000000007;

int main() {

    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];


    int m;
    cin >> m;
    vector<ll> b(m);
    rep(i, m) cin >> b[i];

    sort(a.begin(), a.end());
    sort(b.begin(), b.end());

    vector<ll> results;
    set_difference(a.begin(), a.end(), b.begin(), b.end(), inserter(results, end(results)));

    for(ll i : results) {
        cout << i << endl;
    }

}



Measured memory_bytes: 8044
import numpy as np
from scipy import signal

H, W =map(int, input().split()) 
S = np.array([list(input()) for _ in range(H)])
K = np.array([[1,1,1],[1,0,1],[1,1,1]])
T = signal.convolve2d(S=="#",K,"same").astype(str)
T[S=="#"]="#"
for t in T:
    print("".join(t))

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

#define ST_ARR_LEN(array) (sizeof(array)/sizeof(*array))

using namespace std;

using ll = long long;
const ll MAX = LLONG_MAX;
const ll MIN = LLONG_MIN;

typedef stack<int> IntStack;
typedef queue<int> IntQueue;
typedef vector<int> IntVector;
typedef list<int> IntList;

typedef struct S{
  int a;
  int b;
} Object;

int main(){
  ll N;
  cin >> N;
  ll a[N][3];
  for(int i=0;i<N;i++){
    cin >> a[i][0] >> a[i][1] >> a[i][2];
  }
  
  ll dp[N][3];
  for(int i=0;i<N;i++){
    for(int j=0;j<3;j++){
      dp[i][j] = MIN;
    }
  }
  for(int i=0;i<3;i++){
    dp[0][i] = a[0][i];
  }
  for(int i=1;i<N;i++){
    for(int j=0;j<3;j++){
      for(int k=0;k<3;k++){
        if(j == k) continue;
        dp[i][j] = max(dp[i][j], (dp[i-1][k]+a[i][j]));
      }
    }
  }
  ll ans = MIN;
  for(int i=0;i<3;i++){
    ans = max(ans, dp[N-1][i]);
  }
                
  
  cout << ans << endl;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define sl set<ll>
#define vs vector<string>
#define vl vector<ll>
#define vi vector<int>
#define vpl vector<pair<ll,ll>>
#define pb push_back
#define PI 3.14159265358979323846
#define ll long long
#define ld long double
#define endl "\n"
#define rep(i,a,b) for (ll i = (a); i < (b); i++)
#define repp(i,a,b) for (ll i = (a); i >= (b); i--)
#define rop(i,a,b)  for(ll i=(a); i>(b); i--)
#define min3(a, b, c) min(c, min(a, b))
#define min4(a, b, c, d) min(d, min(c, min(a, b)))
#define tt long long t; cin>>t; while(t--)
#define IOS ios::sync_with_stdio(0);cin.tie(0);
const int maxn=1e5+100;

int main()
{
	ll x;
	cin>>x;
	if(x==0)cout<<"1";
	else if(x==1)cout<<"0";
}

Measured memory_bytes: 3632
from collections import deque
K = int(input())
d = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])

if K <= 9:
  print(K)
else:
  for i in range(K):
    num = d[0]
    d.popleft()
    plus = int(10*num + num%10)
    if num % 10 != 0:
      d.append(plus-1)
    d.append(plus)
    if (i<K) and (num%10!=9):
      d.append(plus+1)
  print(num)

Measured memory_bytes: 18796
using System;
class Program
{
	static void Main()
	{
	  long n = int.Parse(Console.ReadLine());
    long answer = 1;
    long[] divideNum = new long[1000];//素因数の個数

    for(int i = 0; i < n; i++) divideNum[i] = 1;

    for(int i = 2; i <= n; i++)
    {
    int ii = i;
      for(int j = 2; j <= ii; j++)
      {
        while(ii % j == 0)
        {
        divideNum[j-1] ++;//素因数を加算
        ii /= j;
          if(ii == 1) break;
        }
      }
    }

    for(int i = 0; i < n; i++)
    {
    answer *= divideNum[i];
    answer %= 1000000007;
    }

	   Console.WriteLine(answer);//WriteLineをWriteとすると、改行なしで出力。
	}
}

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

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 999999999
const int mod = 1000000007;
ll cnt = 0;
 
int main(){
  ll n,m; cin >> n >> m;
  cout << (1900*m+100*(n-m))*pow(2,m) << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

#define SUB 4                  /* 教科の数 */

int main()
{
  int sum_a = 0, sum_b = 0;
  int i;
  int temp;

  for (i = 0; i < SUB; i++) {
    scanf("%d", &temp);
    sum_a += temp;
  }

	for (i = 0; i < SUB; i++) {
    scanf("%d", &temp);
    sum_b += temp;
  }
	
  if (sum_a >= sum_b) {
    printf("%d\n", sum_a);
  } else {
    printf("%d\n", sum_b);
  }
  return 0;
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
const ll MOD=1e9+7;
const long long INF = 1LL<<60;

int main() {
    string s;
    cin >> s;

    if(s.at(2)==s.at(3) && s.at(4)==s.at(5)){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
n, x, m = map(int, input().split())

mn = min(n, m)
P = [] # value of pre & cycle
sum_p = 0 # sum of pre + cycle
X = [False] * m # for cycle check

for _ in range(mn):
    if X[x]: break
    X[x]  = True
    P.append(x)
    sum_p += x
    x = x*x % m

if len(P) >= mn:
    print(sum_p)
    exit()

pre_len = P.index(x)
cyc_len = len(P) - pre_len
nxt_len = (n - pre_len) % cyc_len

cyc_num = (n - pre_len) // cyc_len

cyc = sum(P[pre_len:])
remain = sum(P[:pre_len + nxt_len])

print(cyc * cyc_num + remain)


Measured memory_bytes: 12188
#include<bits/stdc++.h>
#define rep(i,x,y) for(int i=x;i<=y;i++)
using namespace std;
void cmax(int&x,const int&y){x=x>y?x:y;}
void cmin(int&x,const int&y){x=x<y?x:y;}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int d,t,s;
	cin>>d>>t>>s;
	if(d<=t*s)cout<<"Yes";
	else cout<<"No";	
	return 0;
}


Measured memory_bytes: 3612
#include <cstdio>
#include <cstdlib>
using namespace std;
namespace IO{
	const int L=10000010;
	char inBuf[L];
	int inPos;
	void load(){
		fread(inBuf,1,L,stdin);
		inPos=0;
	}
	char getChar(){
		return inBuf[inPos++];
	}
	int getInt(){
		int x=0,f=1;
		char c=getChar();
		while(c<'0'||c>'9'){if(c=='-')f=-1;c=getChar();}
		while('0'<=c&&c<='9'){x=x*10+c-'0';c=getChar();}
		return x*f;
	}
	char getColor(){
		char c=getChar();
		while(c!='W'&&c!='B')
			c=getChar();
		return c;
	}
}
using IO::getInt;
using IO::getColor;
const int N=100010;
const int INF=1e9;
int n,originN;
int deg[N];
int h[N],tot;
struct Edge{
	int v,next;
}e[N*2];
int col[N]; // 0:black 1:white
int whiteSum,firstWhite;
inline int min(int x,int y){
	return x<y?x:y;
}
inline int max(int x,int y){
	return x>y?x:y;
}
void addEdge(int u,int v){
	e[++tot]=(Edge){v,h[u]}; h[u]=tot;
	e[++tot]=(Edge){u,h[v]}; h[v]=tot;
}
void readData(){
	n=getInt();
	originN=n;
	int u,v;
	for(int i=1;i<n;i++){
		u=getInt(); v=getInt();
		addEdge(u,v);
	}
	for(int i=1;i<=n;i++){
		col[i]=(getColor()=='W');
		whiteSum+=col[i];
		if(col[i]&&!firstWhite)
			firstWhite=i;
	}
}
bool del[N];
bool haveWhite[N];
int originNeed;
int maxMinus;
int f[N];
void deleteUseless(int u,int fa){
	haveWhite[u]=(col[u]==1);
	for(int i=h[u],v;i;i=e[i].next)
		if((v=e[i].v)!=fa){
			deleteUseless(v,u);
			if(!haveWhite[v]){
				n--;
				del[v]=true;
			}
			else{
				haveWhite[u]|=haveWhite[v];
				deg[u]++;
				deg[v]++;
			}
		}
}
int getRoot(){
	for(int u=1;u<=originN;u++)
		if(!del[u]&&deg[u]>1)
			return u;
	return -1; // unexpected
}
void dfs(int u,int fa){
	int type=(col[u]&1)^(deg[u]&1);
	originNeed+=(type==1);
	f[u]=-INF;
	bool haveSon=false;
	for(int i=h[u],v;i;i=e[i].next)
		if((v=e[i].v)!=fa&&!del[v]){
			haveSon=true;
			dfs(v,u);
			if(f[u]!=-INF)
				maxMinus=max(maxMinus,f[u]+f[v]);
			f[u]=max(f[u],f[v]+1+(type==1)-(type==0));
		}
	if(!haveSon) // leaf
		f[u]=1+(type==1)-(type==0);
}
void check(){
	if(whiteSum<=1){
		printf("%d\n",whiteSum);
		exit(0);
	}
	if(n==2){
		puts("2");
		exit(0);
	}
}
int main(){
	IO::load();
	readData();
	check();
	deleteUseless(firstWhite,0);
	check();
	originNeed=(n-1)*2; // for each edge twice
	maxMinus=-INF;
	int rt=getRoot();
	dfs(rt,0);
	printf("%d\n",originNeed-maxMinus);
	return 0;
}


Measured memory_bytes: 13184
#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
  int N;
  cin>>N;
  int D[50];
  for(int i=0;i<N;i++) cin>>D[i];
  sort(D,D+N);
  int l=0;
  int r=0;
  int answer=12;
  for(int i=0;i<N;i++){
    if(l+D[i]<=D[i]-r){
      answer=min(answer,min(D[i]-r,24+l-D[i]));
      r=D[i];
    }
    else{
      answer=min(answer,min(l+D[i],24-D[i]-r));
      l=-D[i];
    }
  }
  cout<<answer<<endl;
  
  return 0;
}

Measured memory_bytes: 3160
h, w, k = map(int, input().split())
C = [list(input()) for _ in range(h)]

res = 0
for a in range(2 ** h):
    for b in range(2 ** w):
        l_1 = []
        l_2 = []
        for i in range(h):
            if a >> i & 1:
                l_1.append(i)
        for i in range(w):
            if b >> i & 1:
                l_2.append(i)
        cnt = 0
        for c in range(h):
            for d in range(w):
                if c in l_1 or d in l_2:
                    continue
                if C[c][d] == '#':
                    cnt += 1
        if cnt == k:
            res += 1

print(res)

Measured memory_bytes: 68712
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] array = new String[3];
        int[] cnt = new int[3]; 
        int i,j=0;
        for(i=0;i<3;i++) array[i] = sc.next();
        while(true){
            if(cnt[j]==array[j].length()){
                System.out.println((char)(j+'A'));
                break;
            }
            j = array[j].charAt(cnt[j]++)-'a';
        }
    }
}


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

int main() {
  
  int n;
  cin >> n;
  
  bool ans = true;
  
  int a;
  REP(i,n) {
    cin >> a;
    if (a % 2 == 0 && a % 3 != 0 && a % 5 != 0) ans = false;
  }
  
  cout << (ans ? "APPROVED" : "DENIED") << endl;

}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		boolean possible = true;

		if (!(s.charAt(0) == 'A')) {
			possible = false;
		} else if (s.substring(2, s.length() - 1).indexOf("C") == -1) {
			possible = false;
		} else {
			String tmpS =  s.substring(1, s.substring(2, s.length() - 1).indexOf("C") + 2) + s.substring(s.substring(2, s.length() - 1).indexOf("C") + 3);
			if (!tmpS.toUpperCase().toLowerCase().equals(tmpS)) possible = false;
		}
		if (possible) {
			System.out.println("AC");
		} else {
			System.out.println("WA");
		}
	}
}


Measured memory_bytes: 21972
N,X = map(int, input().split())
A = list(map(int, input().split()))

ans = float("inf")
bik = A[:]

get_idx_back = lambda idx,b: idx-b if idx>=b else idx+N-b

for loop in range(0, N+1):
  if loop == 0:
      bik = A[:]
  else: 
      for i in range(N):
          bik[i] = min(bik[i], A[ get_idx_back(i, loop) ])

  tmp = (loop)*X + sum(bik)

  ans = min(tmp, ans)
print(ans)
exit(0)


Measured memory_bytes: 43244
//12-4-20
#define _CRT_SECURE_NO_WARNINGS 1

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
//using namespace std :: chrono;

#define scu(n)                     scanf("%u",&n)
#define scl(n)                     scanf("%d",&n)
#define scll(n)                     scanf("%lld",&n)
#define  maxN                     1005
#define uu                           first
#define vv                           second
#define ll                            long long
#define U                             unsigned
#define pb                            push_back
#define mp                           make_pair
#define pii                           pair<int,int>
#define vi                             vector<int>
#define mii                            map<int,int>
#define Pi                              acos(-1.0)
#define endl                          "\n"
#define pqb                            priority_queue<int>
#define pqs                             priority_queue<int,vi,greater<int> >
#define setbits(x)                    __builtin_popcountll(x)
#define zrobits(x)                    __builtin_ctzll(x)
#define mod                              1000000007
#define inf                               1e18
#define ps(x,y)                          fixed<<setprecision(y)<<x
#define mk(arr,n,type)              type *arr=new type[n];
#define w(x)                             int x; cin>>x; while(x--)
//mt19937                                  rng(chrono::steady_clock::now().time_since_epoch().count());

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

//Vector Macros
#define pb                                 push_back
#define eb                                  emplace_back
#define ALL(v)                           v.begin(),v.end()
#define UNIQUE(v)                    v.erase(unique(ALL(v)),v.end())
#define MIN(c)                          *min_element(ALL(c))
#define MAX(c)                          *max_element(ALL(c))
#define SUM(c)                          accumulate(ALL(c),0)

//Loop Macros
#define FOR(i,a,b)                       for(ll i=a;i<=b;i++)
#define rep(i,a,b)                         for(int i=a;i<=b;i++)
#define For(i,n)                            for(int i=0;i<n;i++)

//Debug Macros
#define deb(a)                             cout << #a << " : " << a << " ";
#define debln(a)                          cout<< #a <<" : " << a << endl;
//Print Macros
#define print(v)    for(auto x : v) {  cout<<x<<" ";   }  cout<<endl;
#define PRINT(v)  for(auto x : v) { cout<<x.uu<<" "<<x.vv<<endl;

/*
Time Calculation :
auto st = high_resolution_clock::now();
auto en = high_resolution_clock::now();
auto duration = duration_cast < milliseconds > (en-st);
cout<< "consumed time in ms " << duration.count() <<endl;
*/


int main()
{

    string s;
    cin>>s;

    if(s[0]=='7' || s[1]=='7' ||s[2]=='7')
        cout<< "Yes\n";
    else
        cout<< "No\n";

    return 0;
}




Measured memory_bytes: 3624
#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 <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip> // setprecision
#include <complex> // complex
#include <math.h> 
#include <climits> 
#include <assert.h>
#include <random>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1'000'000'007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[8] = {1, 0, -1, 0,1,1,-1,-1};
const int dy[8] = {0, 1, 0, -1,1,-1,1,-1};
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; }
// ---------------------------------------------------------------------------

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N,x;
  cin >> N >> x;
  if(N == 2){
    if(x == 2){
      cout << "Yes\n";
      cout << "1 2 3\n";
    }else{
      cout << "No\n";
    }
    return 0;
  }
  if(x == 1 || x == 2*N-1){
    cout << "No\n";
    return 0;
  }
  vector<int> ans(2*N-1,-1);
  int now = x;
  for(int i=N-1; i<2*N-1; i++){
    ans[i] = now;
    now++;
    if(now == 2*N) now = 1;
  }
  for(int i=0; i<N-1; i++){
    ans[i] = now;
    now++;
    if(now == 2*N) now = 1;
  }
  cout << "Yes\n";
  for(int i=0; i<2*N-1; i++){
    cout << ans[i] << "\n";
  }
  return 0;
}

Measured memory_bytes: 3960
#include <iostream>

using namespace std;

int main(){
  int N, count=0;
  string A, B, C;
  cin >> N;
  cin >> A >> B >> C;
  for(int i=0; i<N; i++){
    if(A[i] == B[i] && B[i] == C[i]);
    else if(A[i] == B[i] && B[i] != C[i]) count++;
    else if(A[i] == C[i] && B[i] != C[i]) count++;
    else if(B[i] == C[i] && A[i] != C[i]) count++;
    else if(A[i] != B[i] && B[i] != C[i] && C[i] != A[i]) count+=2;
  }
  cout << count << "\n";
  return 0;
}


Measured memory_bytes: 256
#include"bits/stdc++.h"
//#include"atcoder.h"
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i, c) for(int i = 0; i < (int)c; i++)
const ll inf = ll(1e18) + 1;
const ll mod = 1000000007;

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

	if (n[n.size()-1]=='s') {
		cout << n << "es" << endl;
	}
	else {
		cout << n << "s" << endl;
	}

	return 0;
}


Measured memory_bytes: 3624
#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long ll;

int main() {
  string a = "CODEFESTIVAL2016";
  string s;
  cin >> s;
  int c = 0;
  REP(i,0,16) {
    if(a[i] != s[i]) {
      c++;
    }
  }
  cout << c << endl;
  return 0;
}


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

int main(){
    
    int N;
    cin >> N;
    int A[N];
    for(int i=0;i<N;i++) cin >> A[i];
    /*
    int N =5;
    int A[5] = {5,3,2,4,1};
*/
    int minj;
    int sw=0;

    for(int i=0;i<N;i++){
        minj = i;
        for(int j=i+1;j<N;j++){
            if(A[j]<A[minj]) minj = j;
        }
        swap(A[i],A[minj]);
        if(minj != i) sw++;
    }
    for(int i=0;i<N;i++){
        if (i != 0) cout << " ";
        cout << A[i];
    }
    cout << endl << sw << endl;;
    
}


Measured memory_bytes: 3096
#!/usr/bin/env python
# coding: utf-8

# In[1]:


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


# In[2]:


if W/2 == x and H/2 == y:
    multi = 1
else:
    multi = 0
print(W*H/2.0, multi)


# In[ ]:






Measured memory_bytes: 2940
c=0
while 1:
  a,b = map(int,raw_input().split())
  if a==b==0: break
  x=[i for i in range(a,b+1) if i%4==0 and (i%100!=0 or i%400==0)]
    
  if c: print
  if x==[]: print "NA"
  else:
    for e in x: print e
  c=1

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

using namespace std;

#define li long long int
#define pb push_back

int main()
{
    li a,b,c; cin>>a>>b>>c; li k; cin>>k;
    li ct=0;
    while(a >= b)
    {
        b=b*2;
        ct++;
    }
    while(b >= c)
    {
        c=c*2;
        ct++;
    }
    if(ct <= k)
        cout<<"Yes";
        else
        cout<<"No";
}


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

using namespace std;

#define S scanf
#define P printf
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define FI first
#define SE second
#define PI acos(-1)
#define PS push
#define PP pop()
#define PSF push_front
#define PSB push_back
#define PPF pop_front()
#define PPB pop_back()
#define MP make_pair
#define LL long long int
#define ULL unsigned long long int
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>
#define PLI pair<long long int,int>
#define PLL pair<long long int,long long int>
#define MII map<int,int>
#define MSI map<string,int>
#define MIS map<int,string>
#define MLI map<long long int,int>
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)





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






int main()
{
    FAST();

//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    int i,n,cnt=0,x=1;
    cin >> n;
    int a[n+5];
    for(i=1;i<=n;i++)cin >> a[i];
    for(i=1;i<=n;i++)
    {
        if(a[i] == x)
        {
            ++cnt,++x;
        }
    }
    if(cnt == 0)cout << "-1";
    else cout << n-cnt;
    return 0;
}


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

int main(void){
    string s;
    cin >> s;
    int n = s.size();
    long long b = 0, bs = 0;
    for(int i = 0; i < n; i ++){
        if(s[i] == 'B'){
            b ++;
            bs += n-1-i;
        }
    }
    long long a = ((b == 0) ? 0 : (bs - b*(b-1)/2));
    
    cout << a << "\n";
}

Measured memory_bytes: 640