akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <climits>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll x, y;
    cin >> x >> y;
    if(x * y > 0) {
        if(y > x) cout << abs(y - x) << endl;
        else cout << abs(y - x) + 2 << endl;
    } else if(x * y < 0) {
        cout << abs(abs(y) - abs(x)) + 1 << endl;
    } else if(x == 0) {
        if(y >= 0) cout << y << endl;
        else cout << abs(y) + 1 << endl;
    } else { // y == 0
        if(x < 0) cout << abs(x) << endl;
        else cout << x + 1 << endl;
    }
    return 0;
}


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

import sys
from datetime import date

def print_week(n):
  n_to_week = {0:"Monday",1:"Tuesday",2:"Wednesday",3:"Thursday",4:"Friday",5:"Saturday",6:"Sunday"}
  print n_to_week[n]

for s in sys.stdin:
  d = map(int,s.split())
  if d == [0,0]:
    exit()
  print_week(date(2004,d[0],d[1]).weekday())

Measured memory_bytes: 4408
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 10000000000
using namespace std;
using ll = long long;
int main()
{
    int n,k;
    cin >> n >> k;
    vector<double> v(n);
    rep(i,n){
        double p;
        cin >> p;
        p = p * (p + 1) / p / 2;
        v[i] = p;
    }
    vector<double> l(n+1);
    l[0] = 0;
    rep(i,n){
        l[i + 1] = l[i] + v[i];
    }
    double ans = 0;
    rep(i,n-k+1){
        ans = max(ans, l[i + k] - l[i]);
    }
    printf("%lf", ans);
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
#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 ll = long long;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using P = pair<int, int>;

int main(){
    int n,m;
    cin >> n >> m;
    vector<P> y(m);
    VI p(m);

    rep(i,m){
        int pi,yi;
        cin >> pi >> yi;
        p[i] = pi;
        y[i].first = yi;
        y[i].second = i;
    }

    sort(y.begin(), y.end());

    vector<ll> ans(m);
    VI city(n);
    rep(i,n) city[i] = 0;
    rep(j,m){
        int i = y[j].second;
        city[p[i]]++;
        ans[i] = 1000000 * (ll)p[i] + city[p[i]];
    }

    rep(i,m){
        int d = (int)log10(ans[i]) + 1;
        rep(i,12-d) cout << 0;
        cout << ans[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 4096
#include<stdio.h>
#include<string.h>
int main(void){
    int A,B,C,X,cou=0,v[3];
    char S[10];
    scanf("%d %d %d",&A,&B,&C);
    if(A*B>=C){
        printf("%d",C);
    }else{
        printf("%d",A*B);
    }
    return 0;
}

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

int main(){
    int N;
    cin >> N;
    int A[N], B[N];
    for (int i = 1; i < N; ++i){
        B[i] = 0;
        cin >> A[i+1];
    }
    B[N] = 0;
    for (int j = 1; j < N; ++j){
        ++B[A[j+1]];
    }
    for (int k = 1; k < N+1; ++k){
        cout << B[k] << endl;
    }
    return 0;
}


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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
typedef long long ll;
typedef pair<int, int> pii;
const int inf=1010001000;
const ll  INF=1001000100010001000;
const int mod=(int)1e9+7;

int main(){
    int n;
    cin>>n;
    vector<vector<int>>g(n);
    int x,y;
    cin>>x>>y;
    x--;y--;
    g.at(x).push_back(y);
    g.at(y).push_back(x);
    rep(i,0,n-1){
        g.at(i).push_back(i+1);
        g.at(i+1).push_back(i);
    }
    vector<int>d(n,-1);
    queue<int>q;
    vector<int>ad(n,0);
    rep(i,0,n){
        vector<int>d(n,-1);
        /*rep(j,0,n){
            d.at(j)=-1;
        }*/
        d.at(i)=0;
        q.push(i);
        while(!q.empty()){
            int now=q.front();
            q.pop();
            for(auto next:g.at(now)){
                if(d.at(next)!=-1)continue;
                d.at(next)=d.at(now)+1;
                q.push(next);
                ad.at(d.at(next))++;
            }
        }
    }
    rep(i,1,n){
        cout<<ad.at(i)/2<<endl;
    }
return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
 
#define ALL(l)  (l).begin(),(l).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
//const ll mod =  1000000007;
//const ll maxn = 1000000000;

//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vll = vector<ll>; // intの1次元の型に vi という別名をつける
using vvll = vector<vll>; // intの2次元の型に vvi という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pll = pair<ll, ll>; // これ以降 pii という型名はpair<ll, ll> と同じ意味で使える
//---------------------------------------------------------------------------------------------------

int main(){
  int a,b,c,d;
  bool ans=true;
  cin>>a>>b>>c>>d;
  while(1){
      c-=b;
      if(c<=0)break;
      a-=d;
      if(a<=0){
          ans=false;
          break;
      }
  }
  if(ans)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}
   



Measured memory_bytes: 3624
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
 
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
 
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
 
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
 
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
 
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        a: i64,
        b: i64,
        c: i64,
    }
    if(a<b && b<c){
        println!("Yes");
    }
    else{
        println!("No");
    }
}


Measured memory_bytes: 5028
#define _CRT_SECURE_NO_WARNINGS

/* include ***********************/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>

/* define *************************/
//for
#define REP(i,n) for(int i=0,i##_len=(int)(n);i<i##_len;i++)
#define REPS(i,n) for(int i=1,i##_len=(int)(n);i<=i##_len;i++)
#define RREP(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define RREPS(i,n) for(int i=(int)(n);i>0;i--)
#define FOR(i,s,n) for(int i=(int)(s),i##_len=(int)(n);i<i##_len;i++)
#define RFOR(i,s,n) for(int i=(int)(s)-1,i##_len=(int)(n);i>=i##_len;i--)

//printf
#define PRINTD(d) printf("%d\n",(d))
#define PRINTL(d) printf("%lld\n",(d))

//memset
#define m0(s) memset(s,0,sizeof(s))
#define ml(s) memset(s,63,sizeof(s))
#define fill(s,c) memset(s,c,sizeof(s))

#define INF 1e9
#define MOD 1000000007

typedef long long ll;
typedef unsigned long long ull;

int diff[4][2] = {
	{ 0, -1 },
	{ -1, 0 },
	{ 1, 0 },
	{ 0, 1 },
};

int Min(int a, int b) {
	return (a)<(b) ? (a) : (b);
}
int Max(int  a, int  b) {
	return (a) > (b) ? (a) : (b);
}
void Swap(int *a, int *b) {
	int tmp = *a;
	*a = *b;
	*b = tmp;
}

int main() {
	int a, b;
	scanf("%d%d", &a, &b);
	if (b%a) {
		PRINTD(b - a);
	}
	else {
		PRINTD(b + a);
	}
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>

#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define repp(i, m, n) for(ll i = m, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define clr(ar, val) memset(ar, val, sizeof(ar))
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main(void)
{
	int n, a, b[100001];
	cin >> n;
	rep(i, n){
		cin >> a;
		b[a  - 1] = i + 1;
	}
	rep(i, n) {
		cout << b[i] << (i == n - 1 ? '\n' : ' ');
	}

	return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define leadinz zero str.erase(0, min(str.find_first_not_of('0'), str.size()-1));
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
string text="abcdefghijklmnopqrstuvwxyz";
const int maxn=1e6+7;
//        .--------------.
//        | Try First One|
//        '--------------'
//                |     .--------------.
//                |     |              |
//                V     V              |
//              .--------------.       |
//              |      AC.     |<---.  |
//              '--------------'    |  |
//              (True)|  |(False)   |  |
//           .--------'  |          |  |
//           |           V          |  |
//           |  .--------------.    |  |
//           |  |   Try Again  |----'  |
//           |  '--------------'       |
//           |                         |
//           |  .--------------.       |
//           '->| Try Next One |-------'
//              '--------------'
ll bin_pow(ll a,ll b,ll m)
{
    ll res=1;
    a%=m;
    while(b>0){
        if(b&1)res=res*a%m;
        b>>=1;
        a=a*a%m;
    }
    return res;
}
bool miller_rabin(ll d,ll n)
{
    ll a=2+rand()%(n-4);
    ll x=bin_pow(a,d,n);
    if(x==1 || x==n-1)return true;
    while(d!=n-1){
        x=(x*x)%n;
        d*=2;
        if(x==1)return false;
        if(x==n-1)return true;
    }
    return false;
}
bool prime(ll n,ll k)
{
    if(n==1 || n==4)return false;
    if(n<=3)return true;
    ll d=n-1;
    while(d%2==0)d/=2;
    for(int i=0;i<k;i++){
        if(!miller_rabin(d,n))return false;
    }
    return true;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    int pos=s.find("A");
    reverse(s.begin(),s.end());
    int pos1=s.size()-s.find("Z")-1;
    cout<<(pos1-pos+1)<<endl;
}


Measured memory_bytes: 720
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int N;
    cin >> N;
    for(int i = 1; i <= 3500; i++) {
        for(int j = 1; j <= 3500; j++) {
            int X = 4*i*j-N*i-N*j;
            if(X <= 0) {
                continue;
            }
            if(i*j*N%X == 0) {
                cout << i << " " << j << " " << (i*j*N)/X << endl;
                return 0;
            }
        }
    }
}


Measured memory_bytes: 3584
using System;

namespace _177
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(solution());
        }

        static public string solution()
        {
            string[] input = Console.ReadLine().Split(' ');
            int D = int.Parse(input[0]);    //Distance m           
            int T = int.Parse(input[1]);    // Time min
            int S = int.Parse(input[2]);    //Speed m/min

            if (S * T >= D)
                return "Yes";
            else
            { return "No"; }
        }
    }
}


Measured memory_bytes: 27512
#include<iostream>
#include<iomanip>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<algorithm>
#include<functional>
#include<math.h>
#include<unordered_set>
using namespace std;

const int MAX = 100;

bool solve(int n[], int op[], int pos) {
	if (pos >= 3) {
		int num = n[0];
		for (int i = 0; i < 3; i++) {
			if (op[i])num += n[i + 1];
			else num -= n[i + 1];
		}
		if (num == 7)return true;
		return false;
	}
	
	for (int i = 0; i < 2; i++) {
		op[pos] = i;
		if (solve(n, op, pos + 1))return true;
	}
	return false;
}

int main() {
	int n[4];
	int op[3] = { 0 };

	for (int i = 0; i < 4; i++) {
		char c;
		cin >> c;
		n[i] = c - '0';
	}

	solve(n, op, 0);

	cout << n[0];
	for (int i = 0; i < 3; i++) {
		if (op[i])cout << "+";
		else cout << "-";
		cout << n[i + 1];
	}
	cout << "=7" << endl;

	return 0;
}

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

#define LL long long
#define REP(i, n) for(LL i = 0; i < (LL)(n); i++)
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9 + 7;

LL md_add(LL x, LL y) {
    return (x%mod) + (y%mod);
}
LL md_sub(LL x, LL y) {
    return ((x%mod) - (y%mod) + mod)%mod;
}
LL md_mul(LL x, LL y) {
    return ((x%mod)*(y%mod))%mod;
}
LL md_pw(LL x, LL y) {
    LL res = 1;
    while(y != 0) {
        if(y%2) {
            res = md_mul(x, res);
            y--;
        }else{
            x = md_mul(x, x);
            y /= 2;
        }
    }
    return res;
}
LL md_div(LL x, LL y) {
    return md_mul(x, md_pw(y, mod - 2));
}
LL _md_combi(int n, int r, LL **dp) {
    if(n < r)
        return 0;
    if(n == r)
        return 1;
    if(dp[n][r])
        return dp[n][r];
    dp[n][r] = md_add(_md_combi(n - 1, r - 1, dp), _md_combi(n - 1, r, dp));
    return dp[n][r];
}
LL md_fact(LL n) {
    LL res = 1;
    FOR(i, 1, n + 1)
        res = md_mul(res, i);
    return res;
}
LL md_combi(LL n, LL r) {
    if(n < r)
        return 0;
    LL bunsi = md_fact(n);
    LL bunbo = md_mul(md_fact(r), md_fact(n - r));
    return md_div(bunsi, bunbo);
}

int main() {
    LL N, K;
    cin >> N >> K;
    FOR(i, 1, K + 1) {
        cout << md_mul(md_combi(N - K + 1, i), md_combi(K - 1, i - 1)) << endl;
    }
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>
#include <complex>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapii map<int, int>
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()
#define minit(a, i) memset(a, i, sizeof(a));

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }

typedef long long ll;
typedef double D;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }


ll npair[2020];

void make() {
	for_(i, 0, 1001) for_(j, 0, 1001) npair[i+j]++;
}

int main() {
	int n;
	minit(npair, 0); make();
	
	while (cin>>n) {
		ll ans = 0;
		
		for_(i, 0, min(2001, n+1)) {
			ll sub1, sub2;
			
			if (n-i>2000) continue;
			sub1 = npair[i];
			sub2 = npair[n-i];
			ans += sub1*sub2;
		}
		
		cout << ans << endl;
	}
	
	return 0;
}

Measured memory_bytes: 1180
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
#define M_PI 3.14159265358979323846
int main() {

    double H, M;
    double A, B;

    cin >> A >> B >> H >> M;

    double angle = H * 30 - M * 5.5;

    if (angle > 180)
        angle = 360 - angle;

    double length;
    length = pow(A, 2) + pow(B, 2) - 2 * A * B * cos(angle * M_PI / 180.0);
    length = sqrt(length);
    cout << fixed << setprecision(16) << length;
}


Measured memory_bytes: 4228
#include<iostream>
#include<string>
#include<vector>
#include<list>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<set>
#include<map>
#include<queue>
#include<cstring>
#include<sstream>
using namespace std;

typedef long long ll;

int main() {
  ll r,D,x; cin >> r >> D >> x;
  for ( int i = 0; i < 10; i++ ) {
    x = r*x-D;
    cout << x << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<cmath>
#include<algorithm>
#include<bitset>
#define lson node<<1,st,mid
#define rson node<<1|1,mid+1,ed
#define mem(a,x) memset(a,x,sizeof(a))
#define me(a) memset(a,0,sizeof(a))
#define IOS ios::sync_with_stdio(false)
#define lowbit(x) x&(-x)
#define up(i,x,y) for(long long i=x;i<y;i++)
#define down(i,x,y) for(long long i=x;i>=y;i--)
#define in freopen("in.txt","r",stdin)
#define out freopen("out.txt","w",stdout)   
typedef long long ll;
const ll mod = 1e9+7;
const ll INF = 0x3f3f3f3f;
const ll maxn = 1e6 + 5;
const ll N=1e3+5;
const double pi = acos(-1.0);
const double eps=1e-9;
using namespace std;
ll read()     
{
    ll res=0,ch,flag=0;
    if((ch=getchar())=='-')
        flag=1;		
    else if(ch>='0'&&ch<='9')
        res=ch-'0';
    while((ch=getchar())>='0'&&ch<='9')
        res=res*10+ch-'0';
    return flag?-res:res;
}
ll gcd(ll a,ll b){
    return b==0?a:gcd(b,a%b);
}
int main(){
    ll n;
    cin>>n;
    
    ll sum=0;
    for(ll i=1;i<=n;i++){
        for(ll j=1;j<=n;j++){
            for(ll k=1;k<=n;k++){
                ll x=gcd(i,j);
                ll res=gcd(x,k);
                sum+=res;
            }
        }
    }
    cout<<sum<<endl;
 
}

Measured memory_bytes: 3192
#include <stdio.h>

int main(void)
{
  int x , y ,z ,i;
  scanf("%d %d %d",&x,&y,&z);
  int k = x;
  
 for(i = 1;i;i++){
   
   if(y*i+z*(i+1)>x){
     break;
   }
 }

  printf("%d",i-1);
  
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
#define MOD 1000000007LL
#define endl "\n"

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N;
  cin >> N;
  vll A(N);
  vll B(0);
  map<ll, ll> ma;
  for(int i = 0; i < N; i++){
    cin >> A.at(i);
    if(!ma.count(i + A.at(i))){
      ma[i + A.at(i)] = 1LL;
      B.push_back(i + A.at(i));
    }
    else ma[i + A.at(i)]++;
  }
  ll ans = 0LL;
  for(int i = 0; i < N; i++){
    ll num = i - A.at(i);
    if(ma.count(num)) ans += ma[num];
  }
  cout << ans << endl;
}

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

int main() {
	int n, m;
	cin >> n >> m;
	bool ans = false;
	vector<bool> da1(n, false), da2(n, false);
	vector<int> sh1(m), sh2(m);
	for (int i = 0;i < m;i++)
		cin >> sh1[i] >> sh2[i];
	for (int i = 0;i < m;i++) {
		if (sh1[i] == 1) {
			if (da2[sh2[i] - 1]) {
				ans = true;
				break;
			}
			else
				da1[sh2[i] - 1] = true;
		}
		else if (sh2[i] == n) {
			if (da1[sh1[i] - 1]) {
				ans = true;
				break;
			}
			else
				da2[sh1[i] - 1] = true;
		}
	}
	if (ans)
		cout << "POSSIBLE" << endl;
	else
		cout << "IMPOSSIBLE" << endl;
	/*for (int i = 0;i < n;i++) {
		if (da2[i])
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}*/
}

Measured memory_bytes: 1920
#pragma GCC optimize(2)
#include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
#define int long long
const int N=2e5+5;
#define ls x<<1
#define rs x<<1|1
#define lss ls,l,mid,ql,qr
#define rss rs,mid+1,r,ql,qr

int n,q,a,b,c[N];

struct xds{
    int mn[N<<2],flag[N<<2];

    void pushup(int x){
        mn[x]=min(mn[ls],mn[rs]);
    }

    void pusha(int x,int a){
        mn[x]+=a; flag[x]+=a;
    }

    void pushdown(int x){
        if(flag[x]) pusha(ls,flag[x]),pusha(rs,flag[x]),flag[x]=0;
    }

    void modify(int x,int l,int r,int ql,int qr,int c){
        if(ql>qr) return;
        if(ql<=l and r<=qr) return pusha(x,c),void();
        int mid=l+r>>1; pushdown(x);
        if(ql<=mid) modify(lss,c);
        if(mid<qr) modify(rss,c);
        pushup(x);
    }

    int query(int x,int l,int r,int ql,int qr){
        if(ql<=l and r<=qr) return mn[x];
        int mid=l+r>>1,ans=1e18; pushdown(x);
        if(ql<=mid) ans=min(ans,query(lss));
        if(mid<qr) ans=min(ans,query(rss));
        return ans;
    }
}A,B;

void build(int x,int l,int r){
    if(l==r){
        A.mn[x]=abs(l-b)-l; B.mn[x]=abs(l-b)+l;
        // printf("l=%lld,a=%lld,b=%lld\n",l,A.mn[x],B.mn[x]);
        return;
    } int mid=l+r>>1;
    build(ls,l,mid),build(rs,mid+1,r);
    A.pushup(x),B.pushup(x);
}

void modify(int x,int l,int r,int ql,int qr,int c){
    if(l==r) return A.mn[x]=c-l,A.flag[x]=0,B.mn[x]=c+l,B.flag[x]=0,void();
    int mid=l+r>>1; A.pushdown(x),B.pushdown(x);
    ql<=mid?modify(lss,c):modify(rss,c);
    A.pushup(x),B.pushup(x);
}

signed main(){
    scanf("%lld%lld%lld%lld",&n,&q,&a,&b); c[0]=a;
    build(1,1,n);
    for(int i=1;i<=q;i++){
        scanf("%lld",&c[i]);
        int now=min(A.query(1,1,n,1,c[i])+c[i],B.query(1,1,n,c[i],n)-c[i]);
        // printf("now=%lld\n",now);
        modify(1,1,n,c[i-1],c[i-1],now);
        A.modify(1,1,n,1,c[i-1]-1,abs(c[i]-c[i-1]));A.modify(1,1,n,c[i-1]+1,n,abs(c[i]-c[i-1]));
        B.modify(1,1,n,1,c[i-1]-1,abs(c[i]-c[i-1]));B.modify(1,1,n,c[i-1]+1,n,abs(c[i]-c[i-1]));
        // printf("a=%lld\n",A.query(1,1,n,3,3));
    } int ans=1e18;
    for(int i=1;i<=n;i++){
        // printf("i=%lld,a=%lld\n",i,A.query(1,1,n,i,i));
        ans=min(ans,A.query(1,1,n,i,i)+i);
    }
    printf("%lld\n",ans); return 0;
}


Measured memory_bytes: 26368
#include<iostream>
#include<queue>
using namespace std;
int dist[205][205];
int x[205][205];bool y[205][205];
int main(){
	int h,w;cin>>h>>w;int gx=0,gy=0,sx=0,sy=0;
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			char B;cin>>B;
			if(B=='%'){gx=i;gy=j;x[i][j]=1;}
			if(B=='$'){x[i][j]=1;y[i][j]=true;}
			if(B=='@'){sx=i;sy=j;x[i][j]=1;}
			if(B=='.'){x[i][j]=1;}
		}
	}
	for(int i=0;i<205*205;i++)dist[i/205][i%205]=114514;
	queue<pair<int,int>>Q;Q.push(make_pair(gx,gy));dist[gx][gy]=0;
	while(!Q.empty()){
		int a1=Q.front().first,a2=Q.front().second;Q.pop();
		int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
		for(int i=0;i<4;i++){
			int cx=a1+dx[i],cy=a2+dy[i];
			if(x[cx][cy]==0)continue;
			if(dist[cx][cy]>dist[a1][a2]+1){
				dist[cx][cy]=dist[a1][a2]+1;
				Q.push(make_pair(cx,cy));
			}
		}
	}
	int minx=114514;
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			if(y[i][j]==true)minx=min(minx,dist[i][j]);
		}
	}
	if(dist[sx][sy]<minx)cout<<"Yes"<<endl;
	else{cout<<"No"<<endl;}
	return 0;
}

Measured memory_bytes: 3548
import heapq
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N, M = list(map(int, sys.stdin.readline().split()))
AB = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]

AB.sort(key=lambda ab: (ab[0], -ab[1]))

heap = []
abi = 0
ans = 0
for i in range(1, M + 1):
    # i までのやつは入れられる
    while abi < N and AB[abi][0] <= i:
        a, b = AB[abi]
        heapq.heappush(heap, (-b, a))
        abi += 1
    if heap:
        b, a = heapq.heappop(heap)
        ans += -b
print(ans)


Measured memory_bytes: 87644
#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>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define PB push_back

template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}

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

//scanf("%lld", &);
//cin >> ;
//cout << ans << endl;

int N, M, K, i, j, k, l, tmp, ans;

int main(){
    M = 1000005;
    cin >> N;
    vector<int> a(N);
    REP(i, N) cin >> a[i];
    vector<int> cnt(M);

    for(int x : a){
        if(cnt[x] != 0){//既に数えられたことがある
            cnt[x] = 2;
            continue;
        }
        for(int i = x; i < M; i += x){
            cnt[i]++;
        }
    }

    for(int x : a){
        if(cnt[x] == 1){
            ans++;
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 7924
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(i=0;i<n;i++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1; rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define fact(n) nPr((int)(n),(int)(n))
#define nHr(n,r) nCr((int)((n)+(r)+1),(int)(r))
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
void initialize(){
    
}
int a[LIMIT2]={0};
int tmp(const void *p,const void *q){
  return a[*(int *)p]-a[*(int *)q];
}
int main(void){
  initialize();
  ll n,m,i,j,k,result=0;
  int c[LIMIT1]={0};
  char s[LIMIT1];
  
  scanf("%lld",&n);
  rep(i,n){
    scanf("%d",&a[i]);
    c[i]=i;
  }
  
  qsort(c,n,sizeof(int),tmp);
  
  rep(i,n) printf("%d ",c[i]+1);
  
  return 0;
}



Measured memory_bytes: 1916
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<vector<int> > vvi;
typedef vector<int> vi;
typedef vector<string> vs;
int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	vi s(N);
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
		s[i] = A[i];
	}
	ll sum = accumulate(A.begin(),A.end(),0);
	int len = A.size();
	sort(s.begin(),s.end());
	for (int i = 0; i < N; i++)
	{
		if (A[i]==s[len-1]) {
			cout << s[len - 2] << endl;
		}
		else {
			cout << s[len - 1] << endl;
		}
	}

};

Measured memory_bytes: 3200
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		String s = in.next();
		String t = in.next();
		int r = 0;
		for (int i = 0; i < s.length(); i++)
			if (s.charAt(i) != t.charAt(i))
				r++;
		System.out.println(r);
	}
}

Measured memory_bytes: 41148
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using INT=mp::cpp_int;
using namespace std;
using ll=long long;
using vec=vector<ll>;
using vect=vector<double>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n;i>=0;i--)
#define Pool(i, m, n) for(ll i=n;i>=m;i--)
#define MAX 99999999999ll
#define MIN -99999999999ll
#define setbit bitset<8>
#define flagcount __builtin_popcount
#define flag(x) (1<<x)
#define flagadd(bit,x) bit|=flag(x)
#define flagpop(bit,x) bit&=~flag(x) 
#define flagon(bit,i) bit&flag(i)
#define flagoff(bit,i) !(bit & (1<<i))
#define all(v) v.begin(),v.end()
#define low2way(v,x) lower_bound(all(v),x)
#define high2way(v,x) upper_bound(all(v),x)
#define count2way(v,x) high2way(v,x)-low2way(v,x)
#define lower(v,x) low2way(v,x)-v.begin() //1番左が0、もし見つから無いならｎを出力
#define higher(v,x) high2way(v,x)-v.begin()-1 //1番左が0、もし見つからないならn-1を出力（注意）
#define putout(a) cout<<a<<endl
#define putout2(a,b) putout(a);putout(b)
#define putout3(a,b,c) putout(a);putout(b);putout(c)
#define putout4(a,b,c,d) putout(a);putout(b);putout(c);putout(d)
#define putout5(a,b,c,d,e) putout(a);putout(b);putout(c);putout(d);putout(e)
#define Gput(a,b) G[a].push_back(b)
#define cin1(a) cin>>a
#define cin2(a,b) cin>>a>>b
#define cin3(a,b,c) cin>>a>>b>>c
#define cin4(a,b,c,d) cin>>a>>b>>c>>d
#define cin5(a,b,c,d,e) cin>>a>>b>>c>>d>>e
#define sum(v) accumulate(all(v), 0ll)
#define gcd(x,y) __gcd(x,y)
ll ctoi(char c){
	if(c>='0'&&c<='9'){
		return c-'0';
	}
	return 0;
}
ll lcm(ll x,ll y){
  ll z=gcd(x,y);
  return x*y/z;
}
INT LCM(INT x,INT y){
  INT z=gcd(x,y);
  return x*y/z;
}
ll primejudge(ll n){
  if(n<2)return 0;
  else if(n==2)return 1;
  else if(n%2==0)return 0;
  double sqrtn=sqrt(n);
  Loop(i,3,sqrtn+1){
     if(n%i==0){
        return 0;
     }
     i++;
  }
  return 1;
}
INT modinv(INT a, INT m) {
    INT b = m, u = 1, v = 0;
    while (b) {
        INT t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
int main() {
  cout << fixed << setprecision(30);
  ll n;
  cin>>n;
  vec b(n);
  loop(i,n)cin>>b[i];
  vector<vector<ll>> create(n+1);
  vec ans(n);
  ll size=n;
  loop(i,n)create[0].push_back(b[i]);
  bool check=true;
  ll g=0;
  if(n>1){
  loop(i,n){
    g=0;
    ll delite=-1;
    pool(j,size-1){
      if(create[i][j]==j+1){
        delite=j;
        break;
      }
    }
    ans[i]=create[i][delite];
    loop(j,size){
      if(create[i][j]==ans[i]&&g==0){
        g++;
        continue;
      }
      else create[i+1].push_back(create[i][j]);
    }
    if(delite==-1)check=false;
    size=create[i].size();
  }
  reverse(all(ans));
  if(check)loop(i,n)putout(ans[i]);
  else putout(-1);
}
else{
  if(b[0]==1)putout(1);
  else putout(-1);
}
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


template<typename T> 
struct BIT{
  int n;
  vector<T> bit;
  //1-indexed
  BIT():n(-1){}
  BIT(int n_,T d):n(n_),bit(n_+1,d){}
  
  T sum(int i){
    T s=bit[0];
    for(int x=i;x>0;x-=(x&-x))
      s+=bit[x];
    return s;
  }
  void add(int i,T a){
    if(i==0) return;
    for(int x=i;x<=n;x+=(x&-x))
      bit[x]+=a;
  }
};

//INSERT ABOVE HERE
signed main(){
  int n;
  cin>>n;
  vector<vector<int> > a(3,vector<int>(n));

  for(int i=0;i<3;i++)
    for(int j=0;j<n;j++) cin>>a[i][j];

  auto NG=[](){cout<<"No"<<endl;exit(0);};
  set<int> s;
  for(int j=0;j<n;j++){
    if(a[1][j]%3!=2) NG();
    if((a[1][j]/3)%2!=(j&1)) NG();
    if(j%4>=2) swap(a[0][j],a[2][j]);
    if(abs(a[0][j]-a[1][j])!=1) NG();
    if(abs(a[2][j]-a[1][j])!=1) NG();
    if(j%4<2) s.emplace(j*3+1);
    else s.emplace(j*3+3);
  }
    
  for(int j=0;j<n;j++)
    assert(s.count(a[0][j])||s.count(a[2][j]));
  
  auto rot=
    [&](int x){
      assert(0<x&&x+1<n);
      for(int i=0;i<3;i++)
        swap(a[i][x-1],a[i][x+1]);
      swap(a[0][x],a[2][x]);
    };

  for(int i=0;i<3;i++)
    for(int j=1;j+1<n;j++)
      if(!s.count(a[0][j])) rot(j),j-=2,chmax(j,0);  
  
  if(!s.count(a[0][0])){
    rot(1);rot(2);rot(1);   
  }
  if(!s.count(a[0][n-1])){
    rot(n-2);rot(n-3);rot(n-2);   
  }
  //for(int j=0;j<n;j++) assert(s.count(a[0][j]));  

  vector<int> eve,odd;
  for(int j=0;j<n;j++)
    (j&1?odd:eve).emplace_back(a[0][j]);

  const int MAX = 3e5+100;
  auto calc=
    [&](vector<int> v)->int{
      BIT<int> bit(MAX,0);
      int res=0;
      for(int i=0;i<(int)v.size();i++){
        res+=(i-bit.sum(v[i]))&1;
        bit.add(v[i],1);
      }
      return res&1;
    };
  
  if(calc(eve)) NG();
  if(calc(odd)) NG();
  cout<<"Yes"<<endl;
  return 0;
}


Measured memory_bytes: 8056
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define pi pair<int,int>
#define pl pair<long long,long long>
#define lg length()
#define pb push_back
ifstream in("file.in");
ofstream out("file.out");
#define MAXN 100005
#define INF 1000000005
#define LINF 1000000000000000005

long long n,a[200005],l,r,t,p[200005];

set <long long> s;

int main(){
    ios_base :: sync_with_stdio(0);
    cin >> n;
    for(int i=1;i<=n;i++) cin >> a[i],p[a[i]]=i;
    s.insert(0); s.insert(n+1);
    for(int i=1;i<=n;i++){
        s.insert(p[i]);
        auto it=s.find(p[i]);
        it--; l=*it+1;
        it++; it++; r=*it-1;
        //cout << l << ' ' << r << '\n';
        l=p[i]-l+1; r=r-p[i]+1;
        t+=l*r*i;
    }
    cout << t;
}


Measured memory_bytes: 12800
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define SUM(a)  accumulate((a).begin(),(a).end(),0)
#define SORT(a) sort(ALL(a))
#define REV(a) reverse(ALL(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
typedef long long ll;
const int INTINF = 1<<29;
const ll LLINF = 1LL<<61;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int DX[8]={ 0, 1, 0,-1, 1, 1,-1,-1};
const int DY[8]={ 1, 0,-1, 0, 1,-1, 1,-1};


int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x,y,z;
  cin >> x >> y >> z;
  x -= z;
  cout << x / (y+z) << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

        if (scanner.hasNextLine()) {
            String[] array = scanner.nextLine().split(" ");
            long a = Integer.parseInt(array[0]);
            long b = Integer.parseInt(array[1]);
            long c = Integer.parseInt(array[2]);
            int k = Integer.parseInt(scanner.nextLine());

            if (a > b && a > c) {
                for (int i = 0; i < k; ++i) {
                    a *= 2;
                }
            } else if (b > c) {
                for (int i = 0; i < k; ++i) {
                    b *= 2;
                }
            } else {
                for (int i = 0; i < k; ++i) {
                    c *= 2;
                }
            }
            System.out.println(a + b + c);
        }
    }
}

Measured memory_bytes: 21972
import numpy as np

n,m,c = map(int,input().split())
b = list(map(int,input().split()))
a = [0]*n 
for i in range(n):
  a[i] = list(map(int,input().split()))

a_array = np.array(a)
b_array = np.array(b)
count = 0  
for i in range(n):
  if np.sum(a_array[i]*b_array) > -c:
    count += 1

print(count)
    

Measured memory_bytes: 12452
#include<bits/stdc++.h>
using namespace std;
map <string, int> h;
int n;
int main(){
	cin >> n;
	string st;
	for (int i = 1; i <= n; i++) {
		cin >> st;
		h[st]++;
	}
	cout << "AC x " << h["AC"] << endl;
	cout << "WA x " << h["WA"] << endl;
	cout << "TLE x " << h["TLE"] << endl;
	cout << "RE x " << h["RE"] << endl;
  return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926535
const long long int MOD = 1000000007;
#define pb push_back
#define mp make_pair
#define fill(a)  memset(a, 0, sizeof (a))
#define SORT(v)  sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define MAX(v) *max_element(v.begin(), v.end())
#define MIN(v) *min_element(v.begin(), v.end())
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define watch(x) cout << (#x) << " is " << (x) << endl;
const long long int MAXX = 2e6 + 5;
const long long int MINN = 2e5 + 5;
const long long int inf = 1e6;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<ll,ll> ii;
typedef pair<int,ii> iii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector< iii > viii;

ll lcm(ll a, ll b) {
   return a / __gcd(a, b) * b;
}
int XOR(int x, int y){
  return (x | y) & (~x | ~y);
}
bool cmp(const pair<int,int> &a,const pair<int,int> &b) {
    return (a.second < b.second);
}
// bool isl = binary_search(x.begin(), x.end(), 5);
// __builtin_popcount(x)  - Returns the number of set bits in x
const long long int N = 10050;
const int MAXN = 105;
int binsearch(int lo, int hi){
	while(lo<hi){
		int mid=(lo+hi)/2;
		if((mid))   // check(mid)
			hi=mid;
		else
			lo=mid+1;
	}
	return lo;
}
ll power(ll x,ll y){
    ll res=1;
    while(y>0){
      if(y&1) res=((res*x));

      y/=2;
      x=((x*x));
    }
    return res;
}

int main(){
    FAST
    string s;
int flag=0;
cin>>s;
for(int i=0;i<s.length();i++){
  if(s[i]=='7') flag=1;
}
if(flag) cout<<"Yes";
else cout<<"No";
    return 0;
}


Measured memory_bytes: 3652
#line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"


#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void say(bool val, T yes, T no) { cout << (val ? yes : no) << "\n"; }

void say(bool val, string yes = "Yes", string no = "No") { say<string>(val, yes, no); }

template <class T> void chmin(T &a, T b) {
  if (a > b)
    a = b;
}

template <class T> void chmax(T &a, T b) {
  if (a < b)
    a = b;
}

// C++ 17に完全移行したら消す
// 最大公約数を求める
template <class T> T gcd(T n, T m) { return n ? gcd(m % n, n) : m; }

// 最小公倍数を求める
template <class T> T lcm(T n, T m) {
  int g = gcd(n, m);
  return n * m / g;
}

// 重複を消す。計算量はO(NlogN)
template <class T> void unique(std::vector<T> &v) {
  std::sort(v.begin(), v.end());
  v.erase(std::unique(v.begin(), v.end()), v.end());
}


#line 2 "abc171_e.cpp"

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

  int n;
  cin >> n;
  vi a(n);
  int sum = 0;
  REP(i, n) {
    cin >> a[i];
    sum = (sum ^ a[i]);
  }

  REP(i, n) { cout << (sum ^ a[i]) << (i == n - 1 ? "\n" : " "); }
}


Measured memory_bytes: 3960
a =int( input())
_number=0;_kaerichi="No"
for i in range(a):
    b, c = map(int, input().split())
    if(b==c):
        _number+=1
    else:
        _number=0
        
    if(_number==3):
        _kaerichi="Yes"
print(_kaerichi)


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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n; cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	int mx = 1;
	for (int i = 0; i < n; i++) mx *= 3;
	int ans = 0;
	for (int i = 0; i < mx; i++) {
		vector<int> b(n);
		vector<int> c(n);
		int t = i;
		bool ok = false;
		for (int j = 0; j < n; j++) {
			c[j] = t % 3; t /= 3;
			if (c[j] == 0) b[j] = a[j] - 1;
			if (c[j] == 1) b[j] = a[j];
			if (c[j] == 2) b[j] = a[j] + 1;
			if (~b[j] & 1) ok = true;
		}
		if (ok) ans++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P  = pair<int,int>;
using v  = vector<int>;
using vv = vector<v>;

int main(){
    int n;
    cin >> n;
    
    vv cost(n,v (n));
    vector<vector<bool>> seat(n,vector<bool> (n,true));
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            cost[i][j] = min(min(i,n-1-i), min(j,n-1-j));
        }
    }
    
    int ans = 0;
    
    v di={-1,0,1,0};
    v dj={0,-1,0,1};//四方
    
    for(int i=0; i<n*n; i++){
        int p;
        cin >> p;
        int pi = (p-1)/n;
        int pj = (p-1)%n;
        
        ans += cost[pi][pj];
        seat[pi][pj] = false;
        
        //幅優先で距離リストを更新
        queue<P> more;
        more.push({pi,pj});
        
        while(!more.empty()){
            
            int ni = more.front().first;
            int nj = more.front().second;
            
            for(int l=0; l<4; l++){
                if(ni+di.at(l)<n && ni+di.at(l)>=0 && nj+dj.at(l)<n && nj+dj.at(l)>=0){
                    if(seat[ni][nj]){
                        if(cost[ni+di[l]][nj+dj[l]]>cost[ni][nj]+1){
                            cost[ni+di[l]][nj+dj[l]] = cost[ni][nj]+1;
                            more.push({ni+di[l], nj+dj[l]});
                        }
                    }else{
                        if(cost[ni+di[l]][nj+dj[l]]>cost[ni][nj]){
                            cost[ni+di[l]][nj+dj[l]] = cost[ni][nj];
                            more.push({ni+di[l], nj+dj[l]});
                        }
                    }
                }
            }
            more.pop();
        }
    }
    
    cout << ans << endl;
    return 0;
}

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

using namespace std;

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

    bool ok = true;
    for(int i=0;i<S.size()/2;i++){
        if(S[i]!=S[S.size()-1-i]){
            ok = false;
        }
    }

    for(int i=0;i<(S.size()-1)/4;i++){
        if(S[i]!=S[S.size()/2-1-i]){
            ok = false;
        }
    }

    for(int i=0;i<(S.size()-1)/4;i++){
        if(S[S.size()/2 + 1+i]!=S[S.size()-1-i]){
            ok = false;
        }
    }

    if(ok){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

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

char chess(int h,int w){
    if((h+w)%2==0){
        return '#';
    }
    return '.';
}

int main(void){
    int H,W;
    while(true){
    cin>>H>>W;
    if(H==0&&W==0){
        break;
    }
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
        cout<<chess(i,j);
     }
     cout<<endl;
  }
  cout<<endl;
    }
}


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

abs = [list(map(int, input().split())) for i in range(M)]

ans = 0

for ab in abs:
    a = ab[0] - 1
    b = ab[1] - 1
    _abs = abs[::]
    _abs.remove(ab)

    dist_map = [[i == j for j in range(N)] for i in range(N)]

    for _ab in _abs:
        _a = _ab[0] - 1
        _b = _ab[1] - 1
        if not dist_map[_a][_b]:
            dist_map[_a][_b] = True
            dist_map[_b][_a] = True

    for i in range(N):
        for j in range(N):
            for k in range(N):
                dist_map[j][k] = dist_map[j][k] or (dist_map[j][i] and dist_map[i][k])
                dist_map[k][j] = dist_map[j][k]

    if not dist_map[a][b]:
        ans += 1

print(ans)


Measured memory_bytes: 47580
import java.util.*;

public class Main {
  public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int A = sc.nextInt();
    int B = sc.nextInt();
    
    int res = 0;
    for (int i = 1; i <= N; i++) {
        int n = i;
        int digSum = 0;
        
        while(n > 0) {
            digSum += n % 10;
            n /= 10;
        }
        if (digSum >= A && digSum <= B) {
            res += i;
        }
    }
    
    System.out.println(res);
  }
}


Measured memory_bytes: 21716
H, W, A, B = map(int, input().split())
strW1 = "1" * A + "0" * (W - A)
strW0 = "0" * A + "1" * (W - A)
for _ in range(B):
    print(strW1, end="\n")
for _ in range(H - B):
    print(strW0, end="\n")


Measured memory_bytes: 39664
fun main(args: Array<String>) {
    val s = readLine()!!
    if (s.filterIndexed { index, c -> index % 2 == 0 }.all { it == 'R' || it == 'U' || it == 'D' } && s.filterIndexed { index, c -> index % 2 == 1 }.all { it == 'L' || it == 'U' || it == 'D' }
    ) {
        println("Yes")
    } else {
        println("No")
    }
}

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

int V, E;

void dfs(vector<vector<int>> &G, int p, int u, int d, vector<int> &depth, vector<int> &lowlink, vector<bool> &visited){
    visited[u] = true;
    depth[u] = lowlink[u] = d;
    
    for(auto v: G[u]) if(v != p){
        if(!visited[v]){
            dfs(G, u, v, d+1, depth, lowlink, visited);
            lowlink[u] = min(lowlink[u], lowlink[v]);
        }else{
            lowlink[u] = min(lowlink[u], depth[v]);
        }
    }
}

int main(){
    cin >> V >> E;
    
    vector<vector<int>> G(V);
    for(int i=0; i<E; i++){
        int s, t; cin >> s >> t;
        G[s].push_back(t);
        G[t].push_back(s);
    }
    for(int i=0; i<V; i++)
        sort(G[i].begin(), G[i].end());
    
    vector<int> depth(V, -1), lowlink(V, -1);
    vector<bool> visited(V, false);
    dfs(G, -1, 0, 0, depth, lowlink, visited);
    
    for(int s=0; s<V; s++){
        for(auto t: G[s]) if(s<t && (depth[s]<lowlink[t]||depth[t]<lowlink[s])){
            cout << s << " " << t << endl;
        }
    }
    
    return 0;
}

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

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rept(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define reps(i,s,n) for(int (i)=(s);(i)<(int)(n);(i)++)
#define repst(i,s,n) for(int (i)=(s);(i)<=(int)(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define each(itr,v) for(auto (itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp(x,y) make_pair((x),(y))
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln "\n"
#define show(x) cout << #x << " = " << x ln
#define dbg(x) cout<<#x"="<<x ln

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

const int inf = (int)1e9;
const ll linf = (ll)1e18;
const int mod = (int)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

int a, b, c;

int main() {
	cin >> a >> b >> c;
	if ((b*10+c)%4==0) cout << "YES" << ln;
	else cout << "NO" << ln;
}

Measured memory_bytes: 256