akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>


int main(int argc, char* argv[])
{
	int a, b, c;
	char temp[100];

	fgets(temp, sizeof(temp), stdin);
	sscanf(temp, "%d %d %d", &a, &b, &c);

	if (a < b && b < c) {
		printf("Yes\n");
	}
	else {
		printf("No\n");
	}

	return 0;
}

Measured memory_bytes: 2616
#include <stdio.h>
#include <stdlib.h>

int main(){
  int n;
  scanf("%d",&n);
  int p[50];
  for(int i=0;i<n;i++){
    scanf("%d",&p[i]);
  }
  int count;
  for(int i=0;i<n;i++){
    if(p[i] != i+1){
      count += 1;
    }
  }
  if(count <= 2){
    printf("YES\n");
  }else{
    printf("NO\n");
  }
  return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
int main(void){
  int i,N,ans=1;
  if(scanf("%d",&N)<1) return 1;
  char S[N];
  if(scanf("%s",S)<1) return 1;
  if(N%2==1) ans = 0;
  else{
    for(i=0;i<N/2;i++){
      if(S[i]==S[(N/2)+i]) ans *= 1;
      else ans *= 0;
    }
  }
  
  if(ans==1) printf("Yes\n");
  else printf("No\n");
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using ll = long long;
using namespace std;
const ll INF = 1000000000000000000;
const ll mod = 1000000007;
ll test[345678];
map<ll, ll> res;
void prime_factor(ll n) {
	for (int i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			++res[i];
			if (i != n / i) { ++res[n / i]; }
		}
	}
}
signed main() {
	ll n, a = 0; cin >> n;
	vector<ll>ans;
	for (int h = 1; h <= n; h++) {
		cin >> test[h];
	}
	for (int h = n; h > 0; h--) {
		if ((res[h] + test[h]) % 2 == 1) { prime_factor(h); ans.push_back(h); a++; }
	}
	reverse(ans.begin(), ans.end());
	cout << a << endl;
	for (int h = 0; h < a; h++) {
		cout << ans[h] << endl;
	}
	return 0;
}

Measured memory_bytes: 15732
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner kbd = new Scanner(System.in);
        int n = kbd.nextInt();
        int x = kbd.nextInt();
        int count = 1;
        int d = 0;
        int i = 0;
        while (x >= d && i < n) {
            int temp = kbd.nextInt();
            if (temp + d > x) {
                break;
            } else {
                d = d + temp;
                count++;
                i++;
            }
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

int main(){
  int N, M;
  cin >> N >> M;
  vector<vector<bool>> G(N, vector<bool>(N, false));
  rep(i, M){
    int a, b;
    cin >> a >> b;
    G.at(a-1).at(b-1) = true;
    G.at(b-1).at(a-1) = true;
  }
  
  vector<int> vec(N);
  rep(i, N) vec.at(i) = i;
  int ans = 0;
  do { 
    bool flag = true;
    for(int i = 0; i < N - 1 ; i++){
      if (!G.at(vec.at(i)).at(vec.at(i+1))){
        flag = false;
        break;
      }
    }
    if(flag) ans++;
  } while (next_permutation(vec.begin()+1, vec.end()));
  cout << ans << endl;
}


Measured memory_bytes: 256
def bb
    s = gets.chomp

    # 先頭A
    unless s[0] == 'A'
        puts 'WA'
        exit
    end

    # Cは3文字目、末尾から2文字目の間に１つ
    cn = []
    idx = 0
    s.each_char do |c|
        cn.push(idx) if c == 'C'
        idx += 1
    end
    unless cn.length == 1
        puts 'WA'
        exit
    end
    unless cn[0] >= 2 and cn[0] <= s.length-2
        puts 'WA'
        exit
    end

    swoac = s.delete('A').delete('C')
    if swoac == swoac.downcase
        puts 'AC'
    else
        puts 'WA'
    end
end

bb

Measured memory_bytes: 1788
#include<bits/stdc++.h>
#include<iomanip>
#define fast {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define N 1000000
#define ar array
#define inf 1e18
#define mod 998244353
#define ld long double
#define pb push_back
#define f first
#define s second
typedef long long int ll;
using namespace std;
/*

ll d[N];
set<pair<ll,ll>>s;
ll par[N];
vector<pair<ll,ll>>adj[N];
void Dijkstra(ll v){
	d[v]=0;
	s.insert({d[v],v});
	par[v]=v;
	while(!s.empty()){
		ll u=s.begin()->second;
		s.erase(s.begin());
		for(auto x:adj[u]){
			if(d[x.first]>d[u]+x.second){
				s.erase({d[x.first],x.first});
				d[x.first]=d[u]+x.second;
				s.insert({d[x.first],x.first});
				par[x.first]=u;
			}
		}
	}
}*/
int main(void){
	fast;
	int n,i;
	cin>>n;
	string a[4]={"AC","WA","TLE","RE"};
	map<string,int>mp;
	for(i=0;i<n;i++){
		string x;
		cin>>x;
		mp[x]++;
	}
	for(i=0;i<4;i++){
		cout<<a[i]<<" x "<<mp[a[i]]<<endl;
	}
}


Measured memory_bytes: 3668
a, b, c = map(int,input().split())

a_mod_b = a % b

flg = False
while a_mod_b > 0:
	a_mod_b = ( a_mod_b + a ) % b
	if a_mod_b == c :
		flg = True
		break
if flg:
	print("YES")
else:
	print("NO")

Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

int dp[1024][100001],v[323456],w[323456];
int n,q;

int f(int a,int l) {
  if(l<0) return -1e9;
  if(!a) return 0;
  if(a>1023) return max(f(a/2,l),f(a/2,l-w[a])+v[a]);
  if(~dp[a][l]) return dp[a][l];
  return dp[a][l]=max({f(a/2,l),f(a,l-1),f(a/2,l-w[a])+v[a]});
}

int main() {
  cin >> n;
  memset(dp,-1,sizeof(dp));
  for(int i=1;i<=n;i++) cin >> v[i] >> w[i];
  cin >> q;

  while(q--) {
    int a,l;
    cin >> a >> l;
    cout << f(a,l) << endl;
  }
}

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

int main()
{
	int a, b;
	cin >> a >> b;

	if (a > b) {
		printf("a > b\n");
	}
	else if (a < b) {
		printf("a < b\n");
	}
	else {
		printf("a == b\n");
	}
	
	return 0;
}


Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
const ld EPS = 1e-10;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

int main(){
    int Q;
    cin >> Q;
    int MAX = 100000;
    vector<bool> p(MAX+1, true);
    p[0] = p[1] = false;
    rep2(i, 2, MAX){
        if(!p[i]) continue;
        for(int j = 2; i*j <= MAX; j++) p[i*j] = false;
    }
    int cnt[MAX+1];
    cnt[0] = 0;
    rep2(i, 1, MAX){
        cnt[i] = cnt[i-1];
        if(i%2 == 1 && p[i] && p[(i+1)/2]) cnt[i]++;
    }
    rep(i, Q){
        int l, r; cin >> l >> r; l--;
        cout << cnt[r]-cnt[l] << endl;
    }
}

Measured memory_bytes: 4000
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};

// //graph[出発地]に辺を入れる。initした後に入れないとダメ
// struct edge{int to; int cost;};
// vector<vector<edge>> graph(0);
// vector<int> d(0);
// const int MAX_dist=1e9;

// //頂点数でinitが必要
// void init(int n){
//     graph.resize(n);
//     d.resize(n,MAX_dist);
// }

// //スタート地点を入れる
// //O((V+E)logV)くらい V:頂点, E:辺の数
// void dijkstra(int s){
// //if(d.size()==0){cout<<"You Should init"<<endl;return;}
//     priority_queue<P, vector<P>, greater<P>> que;
//     d[s]=0;
//     que.emplace(0,s);
//     while(!que.empty()){
//         P p=que.top();
//         que.pop();
//         int v=p.second;
//         if(d[v]<p.first) continue;
//         rep(i,graph[v].size()){
//             edge e=graph[v][i];
//             if(d[e.to]>d[v]+e.cost){
//             d[e.to]=d[v]+e.cost;
//             que.emplace(d[e.to],e.to);
//             }
//         }
//     }
// }

struct dijkstra{
    struct edge{int to; int cost;};
    vector<vector<edge>> graph;
    vector<int> d;
    int MAX_dist;

    dijkstra(int n): graph(n,vector<edge>(0)){
        MAX_dist = inf;
        d.resize(n,MAX_dist);
    }

    void add(int from, int to, int cost){
        graph[from].push_back({to, cost});
        return;
    }

    void culc(int s){
        priority_queue<P, vector<P>, greater<P>> que;
        d[s]=0;
        que.emplace(0,s);
        while(!que.empty()){
            P p=que.top();
            que.pop();
            int v=p.second;
            if(d[v]<p.first) continue;
            for(auto e: graph[v]){
                if(d[e.to]>d[v]+e.cost){
                    d[e.to]=d[v]+e.cost;
                    que.emplace(d[e.to],e.to);
                }
            }
        }
    }

    int ans(int t){
        return d[t];
    }
};

int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int n,m;
    cin>>n>>m;
    vector<vector<int>> g(n,vector<int>(0));
    int x,y;
    rep(i,m){
        cin>>x>>y;
        x --,y --;
        g[x].emplace_back(y);
    }
    int s,t;
    cin>>s>>t;
    s--,t--;

    dijkstra dk(n*3);
    rep(i,n){
        for(auto z:g[i]){
            // graph[i].push_back({z+n,1});
            // graph[i+n].push_back({z+n+n,1});
            // graph[i+n+n].push_back({z,1});
            dk.add(i,z+n,1);
            dk.add(i+n,z+n+n,1);
            dk.add(i+n+n,z,1);
        }
    }

    dk.culc(s);
    int ans=dk.ans(t);
    if(ans==dk.MAX_dist) cout<<-1<<endl;
    else cout<<ans/3<<endl;
    return 0;
}/*
./problem.exe
*/

Measured memory_bytes: 26136
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

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

    int n;
    cin >> n;
    vector<double> p(n);
    rep(i, n) cin >> p[i];

    vector<vector<double>> dp(n+1, vector<double>(n+1));
    dp[0][0] = 1.0;
    rep(i, n){
        for(int j = 0; j <= i; j++){
            dp[i+1][j+1] += dp[i][j] * p[i];
            dp[i+1][j] += dp[i][j] * (1.0 - p[i]);
        }
    }

    double ans = 0;
    for(int i = n / 2 + 1; i <= n; i++){
        ans += dp[n][i];
    }
    cout << fixed << setprecision(10) << ans << endl;

    return 0;
}


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

typedef long long LL;
const int N = 2e3 + 10;
const int M = 4e6 + 10;
const int Mod = 1e9 + 7;
int n, K, fac[M], inv[M], f[N][N];

inline int mls(int x) {return x < 0 ? x + Mod : x;}
inline int pls(int x) {return x >= Mod ? x - Mod : x;}
template <class T> inline void in(T &x) {
	x = 0; int f = 1; char ch = getchar();
	for (; ch<'0' || ch>'9';) {if (ch=='-') f=-1; ch = getchar();}
	for (; ch>='0' && ch<='9';) x = x*10 + ch-'0', ch = getchar();
	x *= f;
}

inline int C(int n, int m) {
	if (n < m || m < 0) return 0;
	return 1LL * fac[n] * inv[m] % Mod * inv[n - m] % Mod;
}

int main() {
	in(n), in(K);
	if (K == 1) {puts("1"); return 0;}
	inv[0] = fac[0] = inv[1] = fac[1] = f[0][0] = 1;
	for (int i = 2; i < M; ++i) inv[i] = 1LL * (Mod - Mod/i) * inv[Mod%i] % Mod;
	for (int i = 2; i < M; ++i) inv[i] = 1LL * inv[i - 1] * inv[i] % Mod;
	for (int i = 2; i < M; ++i) fac[i] = 1LL * fac[i - 1] * i % Mod;
	for (int i = 1; i <= n; ++i)
		for (int j = i; ~j; --j) {
			f[i][j] = f[i][j + 1];
			if (j) f[i][j] = pls(f[i][j] + 1LL * f[i-1][j-1] * C(i*K-j-1, K-2) % Mod);
		}
	printf("%lld\n", 1LL * f[n][0] * fac[n] % Mod);
	return 0;
}

Measured memory_bytes: 46336
import math

a, b, h, m = map(int, input().split())
degree_a = (h + m / 60.0) / 12 * 360
degree_b = (m / 60.0) * 360
ans = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(abs(degree_a - degree_b))))
print(ans)

Measured memory_bytes: 62368
//2020-07-31
#include <bits/stdc++.h>
using namespace std;
#define loop(v, st, en) for (int v = st; v < en; v++)
#define loopdesc(v, st, en) for (int v = st; v >= en; v--)
#define INF 1E9
#define clr(v, d) memset(v, d, sizeof(v))
#define P(x) cout << #x << " = { " << x << " }\n"
#define PI acos(-1)

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
const int M = 2e5 + 5;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int x;
    cin >> x;
    if (x < 600)
        cout << "8";
    else if (x < 800)
        cout << "7";
    else if (x < 1000)
        cout << "6";
    else if (x < 1200)
        cout << "5";
    else if (x < 1400)
        cout << "4";
    else if (x < 1600)
        cout << "3";
    else if (x < 1800)
        cout << "2";
    else cout <<"1";

    return 0;
}

Measured memory_bytes: 3660
#include <stdio.h>
#include <stdlib.h>

#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <stdint.h>
#include <string.h>

#define _USE_MATH_DEFINES
#include <math.h>

#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <deque>
#include <string>

#include <algorithm>
#include <functional>
#include <bitset>
#include <functional>
#include <chrono>
#include <random>

#define sqr(x) (x) * (x)

typedef unsigned int u32;
typedef int i32;
typedef unsigned long long int u64;
typedef long long int i64;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;

using namespace std;
using namespace std::chrono;

const i64 mod = 1'000'000'000ll + 7;
//const i64 smod = 998244353ll;
//const i64 inf = 1'000'000'000'000'000'000ll + 7;
const i64 inf = 1'000'000'007;

const long double eps = 1e-8;

const i64 MAXN = 300'000 + 5;

i64 T;

i64 n;
i64 a[MAXN];

int main(int argc, char* argv[]) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(15); cout.setf(ios::fixed); cerr.precision(15); cerr.setf(ios::fixed);

    cin >> n;
    for (i64 i = 0; i < n; i++) {
        cin >> a[i];
    }

    sort(a, a + n, greater<i64>());

    i64 R = 0;
    multiset<i64, greater<i64>> q;
    q.insert(a[0]);

    for (i64 i = 1; i < n; i++) {
        R += *q.begin();
        q.erase(q.begin());
        q.insert(a[i]);
        q.insert(a[i]);
    }

    cout << R << endl;

    return 0;
}

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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


A, B, C, X, Y = readnums()

if A + B > C * 2:
    if X > Y:
        ans = min(C * 2 * Y + A * (X - Y), C * 2 * X)
    else:
        ans = min(C * 2 * X + B * (Y - X), C * 2 * Y)
else:
    ans = A * X + B * Y

print(ans)


Measured memory_bytes: 3064
n, m = map(int, input().split())
if n==1:
    ans = [0]
else:
    ans = [1]+[0]*(n-1)
sc = [tuple(map(int, input().split())) for _ in [0]*m]
used = [False]*n
for s, c in set(sc):
    s -= 1
    if not used[s]:
        ans[s] = c
        used[s] = True
    else:
        print(-1)
        exit()
if n>1 and ans[0]==0:
    print(-1)
else:
    print(*ans, sep='')

Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int main(){
int a,ans=0;
  cin>>a;
  for(int i=a;;i++){
    int s=0;
    for(int j=2;j<=i-1;j++){
  if(i%j==0)s++;
 }
    ans=i;
    if(s==0)break;
}
  
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
sA = [A[0]]
d = []
for i in range(1, N):
    sA.append(sA[-1] + A[i])

for i in range(N):
    d.append(abs(sA[i] - (sA[-1] - sA[i])))
print(min(d))

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

using ll = long long;
using ld = long double;

int main () {

    ll q; cin >> q;
    for (ll i = q; i--; ) {

        ll c, a, n; cin >> c >> a >> n;

        ll can = min({c, a, n});
        c -= can;
        a -= can;
        n -= can;

        ll ans = 0;
        for (ll cca = 0; cca <= a && cca * 2 <= c; cca++) {
            ll ccc = (c - cca * 2) / 3;
            ll cand = can + cca + ccc;
            if (cand > ans) ans = cand;
        }
        cout << ans << endl;

    }

}


Measured memory_bytes: 3124
from collections import defaultdict
import bisect
import sys
s=input()
t=input()

d=defaultdict(list)

ls=len(s)
lt=len(t)

for i in range(ls):
    d[s[i]].append(i)

buf=-1
l=0
for i in range(lt):
    if not d[t[i]]:
        print(-1)
        sys.exit()
    idx=bisect.bisect_right(d[t[i]],buf)
    if idx>=len(d[t[i]]):
        buf=d[t[i]][0]
        l+=1
    else:
        buf=d[t[i]][idx]
print(l*ls+buf+1)

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

int main()
{
    int e,y;
    cin >> e >> y;
    if(e==0){
        if(y<=1911)
            cout << "M" << y-1867 << endl;
        else if(y<=1925)
            cout << "T" << y-1911 << endl;
        else if(y<=1988)
            cout << "S" << y-1925 << endl;
        else
            cout << "H" << y-1988 << endl;
    }
    else if(e==1)
        cout << y+1867 << endl;
    else if(e==2)
        cout << y+1911 << endl;
    else if(e==3)
        cout << y+1925 << endl;
    else if(e==4)
        cout << y+1988 << endl;
    return 0;
}



Measured memory_bytes: 3116
#include <iostream>
#include <algorithm>
#define ll long long
#define endl "\n"
#define __ ios::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
using namespace std;

int a,b;

int main(){

	cin >> a >> b;
	if(a%2==0||b%2==0) cout << "Even\n";
	else cout << "Odd\n";

}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cstdio>
#include<set>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
    int N,K,sum=0;
    cin >> N >> K;
    vector<int> vc(N);
    for(int i=0;i<N;i++)    cin >> vc[i];
    sort(vc.begin(),vc.end());
    for(int i=N-1;i>=N-K;i--) sum+=vc[i];
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
    int n,x,min=10000,ans=0,i,m;
    scanf("%d%d",&n,&x);
    ans=n;
    for(i=0;i<n;i++){
        scanf("%d",&m);
        x-=m;
        if(m<min){
            min=m;
        }
    }
    ans+=x/min;
    printf("%d",ans);
    return 0;
}


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

using namespace std;

int main() {
	int64_t n, a, b;
	cin >> n >> a >> b;
	int64_t res = 0, hs1 = n/(a+b), hs2 = n%(a+b);
	if(hs2 > a) hs2 = a;
	res = hs1*a+hs2;
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define F first
#define S second
#define db double
#define pb push_back
#define rep(i,a,b)  for(ll i=a;i<=b;i++)
using namespace std;
 
 ll mod=1e9 +7;
 
ll expo(ll base,ll exponent,ll mod){
    ll ans=1;
    while(exponent!=0){
        if(exponent&1) ans=(1LL*ans*base)%mod;
        base=(1LL*base*base)%mod;
        exponent>>=1;
    }
    return ans%mod;
}
 
vector<bool>  prime(90000002,true);
void Sieve() 
{ 
   
    for (int p=2; p*p<=90000001; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            for (int i=p*p; i<=90000001; i += p) 
                prime[i] = false; 
        } 
    } 
}

const ll M=200006;
ll f[M],inv[M];

void compute(){
    f[0]=1;
    rep(i,1,M-1){
        f[i]=(1LL*i*f[i-1])%mod;
    }
    inv[M-1]=expo(f[M-1],mod-2,mod);
    for(ll i=M-2;i>=0;i--){
        inv[i]=(1LL*(i+1)*inv[i+1])%mod;
    }
}
ll C(ll n,ll r){
    return (1LL*((1LL*f[n]*inv[r])%mod)*inv[n-r])%mod;
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // compute();
    // Sieve();
    ll tests=1;
    // cin>>tests;
    while(tests--)
    {
      string  n;
      cin>>n;
      if(n[0]=='7' || n[1]=='7' ||  n[2]=='7') cout<<"Yes";
      else cout<<"No";

    }
    return 0;
   }

Measured memory_bytes: 14152
package main

import (
	"fmt"
)

func main() {
	var n, k, q int
	fmt.Scan(&n, &k, &q)

	var a = make([]int, q)
	for i:=0; i<q; i++ {
		fmt.Scan(&a[i])
	}

	var nn = make(map[int]int, n)
	for i:=0; i<n; i++ {
		nn[i] = k - q
	}

	for i:=0; i<q; i++ {
		j := a[i] - 1
		nn[j] += 1
	}

	for i:=0; i<n; i++ {
		if nn[i] > 0 {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	}
}

Measured memory_bytes: 8192
let () =
  let rec read () =
    let n = Scanf.scanf " %d\n" (fun x -> x) in
    if n = 0 then ()
    else
      begin
        let rec loop p_max max= function
            0 -> Printf.printf "%d %d\n" p_max max
          | i ->
             let (p,d) = Scanf.scanf " %d %d %d\n" (fun x y z->(x,y+z)) in
             if d > max then
               loop p d (i-1)
             else
               loop p_max max (i-1)
        in
        loop 0 (-1) n;
        read ()
      end
  in read ()
;;

Measured memory_bytes: 4560
#include<iostream>
#include<string.h>
#include<ctype.h>
#include<string>
#include<math.h>
#define pi 3.141592653589
#include<iomanip>
using namespace std;
#include<algorithm>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define INF 1e9
#define LINF 1e17
#define ll long long
#define MOD (int)(1e9+7)
 
 
 
int main(){
    
    string s,match[2]={"dream","erase"};
    int flag=0;
    
    cin>>s;
    rep(i,0,s.size()){
        if(s[i]=='d'){
            rep(j,0,5){
                if(i+j>=s.size()||s[i+j]!=match[0][j]){
                    cout<<"NO"<<endl;
                    return 0;
                }
            }
            flag=0;
            rep(j,0,3){
                if(s[i+j+5]!=match[1][j]){
                    if(j==0||j==1){
                        i+=4;
                        flag=1;
                        break;
                    }
                    else{
                        i+=6;
                        flag=1;
                        break;
                    }
                }
            }
            if(!flag)i+=4;
        }
        else if(s[i]=='e'){
            rep(j,0,5){
                if(i+j>=s.size()||s[i+j]!=match[1][j]){
                    cout<<"NO"<<endl;
                    return 0;
                }
            }
            if(s[i+5]=='r')i+=5;
            else i+=4;
        }
        else{
            cout<<"NO"<<endl;
            return 0;
        }
    }
    cout<<"YES"<<endl;
    
    return 0;
}

Measured memory_bytes: 512
while n = gets.split.map(&:to_i)
  break if n.all?{ |v| v == 0 }
  3.times { |i| n[2-i] += n.pop }
  ret = 0
  3.times do |i|
    break if n.any?{ |v| v - i < 0 }
    ret = [ret, n.reduce(0){ |sum, v| sum += (v - i) / 3 } + i].max
  end
  p ret
end

Measured memory_bytes: 8804
'use strict'

const main = arg => {
        
    const r = arg.trim().split("\n")[0];
    const area = (r * r * Math.PI).toFixed(6);
    const circumference = (r * 2 * Math.PI).toFixed(6);

    console.log(area + " " + circumference);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 15104
#include "bits/stdc++.h"
using namespace std;
using ll = long long; using ull = unsigned long long;
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vector<int>>;
using vl = vector<ll>; using vvl = vector<vector<ll>>;
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
//#define int ll
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
signed main(){
  int n,m;
  cin >> m >> n;
  vvb a(m,vb(n,false));
  REP(i,m){
    int k;
    cin >> k;
    REP(j,k){
      int t;
      cin >> t;
      a[i][t-1] = true;
    }
  }
  int ans = 0;
  REP(i,n){
    REP(j,m){
      if(a[j][i]==false) break;
      if(j==m-1) ans++;
    }
  }
  cout << ans << endl;
}

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

#define ll long long
#define ull unsigned long long 
#define endl '\n'
//const int MOD = 1e9+7;

bool ok(int a, int b, int c, int d, vector<char> s){
    int ans=0;
    if(s[1]=='+')
        ans = a+b;
    else
        ans = a-b;
    
    if(s[3]=='+')
        ans = ans + c;
    else
        ans = ans-c;

    if(s[5]=='+')
        ans += d;
    else
        ans -= d;
    
    if(ans==7)
        return true;
    else
        return false;
}

int main(){
    string s;
    cin >> s;
    int a=s[0]-'0';
    int b=s[1]-'0';
    int c=s[2]-'0';
    int d=s[3]-'0';
    

    char sign[2] = {'+', '-'};
    vector<char> ans(7);
    ans[0]=s[0];
    ans[2]=s[1];
    ans[4]=s[2];
    ans[6]=s[3];
    
    for(int i=0; i<2; ++i){
        for(int j=0; j<2; ++j){
            for(int k=0; k<2; ++k){
                ans[1]=char(sign[i]);
                ans[3]=char(sign[j]);
                ans[5]=char(sign[k]);
                if(ok(a,b,c,d,ans)){
                    for(auto x:ans)
                        cout << x;
                    cout << "=7";
                    return 0;
                }
            }
        }
    }
}


Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main(void)
{
    int N, W;
    cin >> N >> W;
    vector<int> v(N);
    vector<int> w(N);
    rep(i, N) {
        cin >> v[i] >> w[i];
    }

    vector<vector<int> > dp(W+1, vector<int>(N, 0));
    rep(i, W+1) if(i >= w[0]) dp[i][0] = v[0];

   rep(i, W+1)rep(j, N) {
       if(i == 0 || j == 0) continue;

       dp[i][j] = dp[i][j-1];
       if(i - w[j] >= 0) dp[i][j] = max(dp[i][j], dp[i-w[j]][j-1] + v[j]);
   }

   cout << dp[W][N-1] << endl;
    /*for(int i = 0; i < W+1; i++) {
        for(int j = 0; j < N; j++) {
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }*/

    return 0;
}


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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{
  gearup;
  ll k,a,b; cin >> k >> a >> b;
  ll res = 1;
  if((b-a) <= 2)res += k;
  else{
    ll turn = a - 1;
    if(k < turn){
      res += k;
    }
    else{
      k-=turn;
      res = a + (b-a) * (k/2);
      if(k&1)res++;
    }
  }
  out(res);
}

Measured memory_bytes: 256
import sys
N = int(input())
s = input()

lst = ["SW", "WS", "SS", "WW"]
ans = []

for tmp in lst:
    for i in range(1, N-1):
        if(s[i] == "o"):
            if(tmp[i] == "S"):
                tmp += tmp[i-1]
            else:
                if(tmp[i-1] == "S"):
                    tmp += "W"
                else:
                    tmp += "S"
        else:
            if(tmp[i] == "W"):
                tmp += tmp[i-1]
            else:
                if(tmp[i-1] == "S"):
                    tmp += "W"
                else:
                    tmp += "S"

    ans.append(tmp)

for st in ans:
    flg = True
    if(s[0] == "o"):
        if(st[0] == "S"):
            if(st[-1] != st[1]):
                flg = False
        else:
            if(st[-1] == st[1]):
                flg = False
    else:
        if(st[0] == "S"):
            if(st[-1] == st[1]):
                flg = False
        else:
            if(st[-1] != st[1]):
                flg = False
    if(s[N-1] == "o"):
        if(st[N-1] == "S"):
            if(st[N-2] != st[0]):
                flg = False
        else:
            if(st[N-2] == st[0]):
                flg = False
    else:
        if(st[N-1] == "S"):
            if(st[N-2] == st[0]):
                flg = False
        else:
            if(st[N-2] != st[0]):
                flg = False
    if(flg):
        print(st)
        sys.exit()
print(-1)      

Measured memory_bytes: 9784
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>



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

using namespace std;
int n;
int a[2][200];
int ans;
int b1[200];
int b2[200];
int main(){
  cin >> n;
  REP(i,2){
    REP(j,n){
      cin >> a[i][j];
    }
  }
  b1[0] = a[0][0];
  REP(i,n-1) b1[i+1] = b1[i]+ a[0][i+1];
  b2[n-1] = a[1][n-1];
  for(int i = n-2;i>=0;i--){
    b2[i] = b2[i+1] + a[1][i];
  }
  int ans = 0;
  REP(i,n){
    int t = b1[i]+b2[i];
    ans = max(t,ans);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    string s;
    cin >> s;
    int r = 0;
    int b = 0;
    REP(i,n){
        if(s[i]=='R'){
            r++;
        }else{
            b++;
        }
    }
    if(r>b){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
import java.io.*
import java.lang.*


fun solve() {
    val N = rd.readInt()
    val A = rd.readIntArray()

    val mp = mutableMapOf<Int, Int>()
    for (i in 0 until N) {
        mp[A[i]] = (mp[A[i]]?:0) + 1
    }
    val K = mp.size

    var ans = if (K % 2 == 1) K else K - 1
    println(ans)
}


//val rd = debug.Reader("arc", "068", "b", "sample-2")
val rd = Reader()


fun main(args: Array<String>) {
    try {
        var exception: Throwable? = null
        val sth = Thread(null, SolveThread(), "solveThread", 128 * 1024 * 1024)
        sth.setUncaughtExceptionHandler { _, e -> exception = e }
        sth.start(); sth.join()
        if (exception != null) throw exception!!
    } catch (e: Exception) { throw e }
}
const val MOD = 1_000_000_007L; const val INF = Int.MAX_VALUE/2; const val LINF = Long.MAX_VALUE/2
data class IntPair(val first: Int, val second: Int)
val errPrintln: (Any) -> Unit = { msg -> System.err.println(msg) }
fun rAssert(exp: Boolean, lazyMsg: () -> String = {""}) {
    if (!exp) { val msg = lazyMsg(); errPrintln("EAssert Error: $msg"); throw Error(msg) }
}
fun tAssert(exp: Boolean, lazyMsg: () -> String = {""}) {
    if (!exp) { val msg = lazyMsg(); errPrintln("TAssert Error: $msg"); Thread.sleep(3000) }
}
class SolveThread : Runnable {
    override fun run() { solve() }
}
class Reader {
    private val br = BufferedReader(InputStreamReader(System.`in`))
    val readString: () -> String = { br.readLine() }
    val readInt: () -> Int = { br.readLine().toInt() }
    val readLong: () -> Long = { br.readLine().toLong() }
    val readIntArray: () -> IntArray = { br.readLine().split(' ').map { it.toInt() }.toIntArray() }
    val readLongArray: () -> LongArray = { br.readLine().split(' ').map { it.toLong() }.toLongArray() }
    val readListInt: () -> List<Int> = { br.readLine().split(' ').map { it.toInt() } }
    val readListLong: () -> List<Long> = { br.readLine().split(' ').map { it.toLong() } }
}


Measured memory_bytes: 56664
import math
def c(n,r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 
n,k=map(int,input().split())
mod=10**9+7
 
for i in range(k):
    if n-k<i:
        print(0)
    else:
        print(c(k-1,i)*c(n-k+1,i+1)%mod)

Measured memory_bytes: 3316
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#define _USE_MATH_DEFINES
#define LL long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
using namespace std;

int main() {
	int h, w, ans, base, ansh, answ;
	for (;;) {
		cin >> h >> w;
		ansh = answ = 0;
		if (h == 0 && w == 0) break;
		base = h*h + w*w;
		ans = 100000000;
		for (int i = 1; i < 151; i++) {
			for (int j = 1; j < 151; j++) {
				if (base < i*i + j*j&&i*i + j*j < ans&&i < j) {
					ans = i*i + j*j;
					ansh = i;
					answ = j;
				}
			}
		}
		for (int i = 1; i < 151; i++) {
			for (int j = 1; j < 151; j++) {
				if ((base < i*i + j*j||(base==i*i+j*j&&h<i))&&(i*i + j*j < ans)&&i < j) {
					ans = i*i + j*j;
					ansh = i;
					answ = j;
				}
			}
		}
		printf("%d %d\n", ansh, answ);
	}
	return 0;
}

Measured memory_bytes: 3152
import java.io.*;
import java.math.*;

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        String s[]=bu.readLine().split(" ");
        int a=Integer.parseInt(s[0]),v=Integer.parseInt(s[1]);
        s=bu.readLine().split(" ");
        int b=Integer.parseInt(s[0]),w=Integer.parseInt(s[1]);
        if(a>b) a=a^b^(b=a);
        int t=Integer.parseInt(bu.readLine());
        double relt=1.0*(b-a)/(v-w);
        if(relt>=0 && relt<=t) sb.append("YES");
        else sb.append("NO");
        System.out.print(sb);
    }
}


Measured memory_bytes: 32632
#include<stdio.h>
#include<string.h>
int main()
{
	int i,N,j;
	long long sum;
	int a[1001],p[1001];
	while(~scanf("%d",&N))
	{
		memset(p,0,sizeof(p));
		for(i=2;i<=N;i++)
		{
			a[i]=i;
			while(a[i]%2==0)
			{
				a[i]/=2;
				p[2]++;
			}
		}
		for(i=3;i<=N;i++)
		for(j=3;j<=i;j+=2)
		while(a[i]%j==0)
		{
				a[i]/=j;
				p[j]++;
		}
		sum=(p[2]+1)%(1000000000+7);
		for(i=3;i<=N;i+=2)
		if(p[i])
		{
			sum=((p[i]+1)%(1000000000+7))*sum%(1000000000+7);
		}
		printf("%lld\n",sum);
	}
	return 0;
}

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

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

  vector<int> vec(N);
  
  for (int i = 0; i < N; i++){
      cin >> vec.at(i);
  }
    
  sort(vec.begin(), vec.end()); // 小さい順に並んでいる
  
  vector<int> moc(0);// vecからかぶりを抜く用
  moc.push_back(vec.at(0)); // これは確定
  
    for (int i = 1; i < N; i++){
      if (vec.at(i) != vec.at(i-1))
        moc.push_back(vec.at(i));
    }
  cout << moc.size() << endl;
}


Measured memory_bytes: 256
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 28;
	double EPS = 1e-5;
	
	int n, m;
	LinkedList<E>[] edges;
	double[][][] map;

	@SuppressWarnings("unchecked")
	void run() {
		Scanner sc = new Scanner(System.in);
		for(;;) {
			n = sc.nextInt();
			m = sc.nextInt();
			if( (n|m) == 0 ) break;
			
			short s = (short)(sc.nextInt()-1);
			short g = (short)(sc.nextInt()-1);
			
			edges = new LinkedList[n];
			for(int i=0;i<n;i++) edges[i] = new LinkedList<E>();
			
			for(int i=0;i<m;i++) {
				short a = (short)(sc.nextShort()-1);
				short b = (short)(sc.nextShort()-1);
				short d = sc.nextShort();
				short c = sc.nextShort();
				
				edges[a].add( new E(b, c, d));
				edges[b].add( new E(a, c, d));
			}
			
//			for(LinkedList<E> es: edges) for(E e: es) debug(e.to, e.c, e.d);
			
			double d = dijkstra(s, g);
			
			System.out.println((d<-EPS? "unreachable": d));
		}
		
	}
	
	double dijkstra(short s, short g) {
		PriorityQueue<V> que = new PriorityQueue<V>();
		
		que.add(new V(s, (short)0, s, 0.0));
		
		map = new double[n][31][n];
		for(double[][] a: map) for(double[] b: a) fill(b, INF);
		
		map[s][0][s] = 0.0;
		
		while(!que.isEmpty()) {
			V now = que.poll();
			
			debug(now.u, now.v, now.p, now.t, map[now.u][now.p]);
			
			if( now.u == g && now.v == 1 ) return now.t;
			if( map[now.u][now.v][now.p] -now.t < 0.0 ) continue;

			for(E edge: edges[now.u]) if( edge.to != now.p ) {
				for(int dv = 1;dv>=-1;dv--) if( 0 < now.v+dv && now.v + dv<=edge.c ) {
				debug("a");
					double t = now.t + 1.0 * edge.d / (now.v+dv);
					if( t - map[edge.to][now.v+dv][now.u] < 0.0 ) {
						map[edge.to][now.v+dv][now.u] = t;
						que.add(new V(edge.to, (short)(now.v+dv), now.u, t));
					}
				}
			}
		}
		
		return -1;
	}
	
	class E {
		short to, c, d;
		E ( short to, short c, short d) {
			this.to = to;
			this.c = c;
			this.d = d;
		}
	}
	
	class V implements Comparable<V>{
		short u, v, p;
		double t;
		V(short u, short v, short p, double t) {
			this.u = u;
			this.v = v;
			this.p = p;
			this.t = t;
		}
		@Override
		public int compareTo(V o) {
			// TODO Auto-generated method stub
			if(t - o.t > 0 ) return 1;
			else if( o.t - t > 0 ) return -1;
			return o.v - v;
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... os) {
//		System.err.println(Arrays.deepToString(os));
	}
}

Measured memory_bytes: 16000
n = int(input())
a = list(map(int,input().split()))

ans = []
if n%2 == 0:
  for i in range(n//2):
    ans.append(a[n-1-i*2])
  for i in range(n//2):
    ans.append(a[i*2])
else:
  for i in range(n//2+1):
    ans.append(a[n-1-i*2])
  for i in range(n//2):
    ans.append(a[i*2+1])
print(*ans)


Measured memory_bytes: 102100
#include <bits/stdc++.h>
using namespace std;
#define forx(i, a, b) for (int i = (a); i < (b); i++)
#define rep(j, n) for (int j = 0; j < (n); j++)

typedef long long ll;

int main(){
int d,n;
cin>>d>>n;
if(d==0&&n!=100)cout<<n<<endl;
else if(d==0&&n==100)cout<<"101"<<endl;
if(d==1&&n!=100)cout<<100*n<<endl;
else if(d==1&&n==100)cout<<"10100"<<endl;
if(d==2&&n!=100)cout<<10000*n<<endl;
else if(d==2&&n==100)cout<<"1010000"<<endl;
return 0;
}


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

int main() {
  int A, B;
  cin >> A >> B;
  int tmp = 1;
  int cnt = 0;
  while (tmp < B) {
    cnt++;
    tmp += (A-1);
  }
  cout << cnt;
}


Measured memory_bytes: 256
# coding: utf-8
N, M = map(int, input().split())
A, B = [], []
for i in range(N):
    tmp = input()
    A.append(tmp[:])
for i in range(M):
    tmp = input()
    B.append(tmp[:])
for r in range(len(A[0]) - len(B[0]) + 1):
    for i in range(N - M + 1):
        cnt = 0
        for j in range(i, M+i):
            # print(A[j][r:r+len(B[0])], B[j-i])
            if A[j][r:r+len(B[0])] == B[j-i]:
                cnt += 1
        if cnt == M:
            print("Yes")
            exit()
        # print()
print("No")

Measured memory_bytes: 3064
A, V = [int(n) for n in input().split()]
B, W = [int(n) for n in input().split()]
T = int(input())

if V <= W:
    print('NO')
    exit()

d = abs(A - B)

if V > W and d <= (V - W) * T:
    print('YES')
else:
    print('NO')


Measured memory_bytes: 9188
#include <iostream>
#include <cmath>
 
int main(void) {
    u_int a, b;
 
    while (std::cin >> a >> b) {
        std::cout << (int) log10 (a + b) + 1 << std::endl;	//a+b = 0?????¨????????¨??????
    }
 
    return 0;
}

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

int main() {
	int n, t, a;
	scanf("%d %d %d", &n, &t, &a);
	vector<int> h(n);
	vector<double> temp(n);
	int ans;
	double mi = 1e9;
	for(int i = 0; i < n; i++) {
		scanf("%d", &h[i]);
		temp[i] = t - h[i] * 0.006;
	}
	for(int i = 0; i < n; i++) {
		mi = min(mi, abs((double)a - temp[i]));
		if(mi == abs((double)a - temp[i])) {
			ans = i;
		}
	}
	printf("%d\n", ans + 1);
} 

Measured memory_bytes: 256
local N, M, C = io.read("n", "n", "n")
local B = {}
for i=1,M do
    table.insert(B, io.read("n"))
end
local ans = 0
for i=1,N do
    local score = C
    for j=1,M do
        score = score + io.read("n") * B[j]
    end
    if score > 0 then
        ans = ans + 1
    end
end
print(ans)


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

int main(){
  int N,K;
  cin >> N >> K;
  vector<long int> H(N);
  for (int i=0; i<N; i++){
    cin >> H.at(i);
  }
  
  sort(H.begin(),H.end());//小さい順
  reverse(H.begin(),H.end());//大きい順
  long int ans = 0;
  
  if(N <= K){
    cout << 0 << endl;
  }
  
  else{
    for(int i=K; i<N; i++){
      ans += H.at(i);
    }
    cout << ans << endl;
  }
}



Measured memory_bytes: 1792
#include<cstdio>
#define pritnf printf
#define scnaf scanf
#define retrun return
#define sizoef sizeof
#define inl inline
#define br break
#define con continue
#define mst(a,b) memset(a,b,sizeof(a))
#define fora(x,a,b) for(re nti (x)=(a);(x)<=(b);++(x))
#define forb(x,a,b) for(re nit (x)=(a);(x)>=(b);--(x))
#define re register
#define stt struct
#define infa (0x3f3f3f3f)
#define infb (0x7fffffff)
#define infd (0x7f)
#define abss(x) ((x)>(0)?(x):(-1)*(x))
#define maxx(a,b) ((a)>(b)?(a):(b))
#define minn(a,b) ((a)<(b)?(a):(b))
#define pf(_) ((_)*(_))
#define in(a) freopen("D:/""/in"a".in","r",stdin)
#define out(a) freopen("D:/""/out"a".out","w",stdout)
typedef long long ll;
typedef int itn,nti,tin,tni,nit;
using namespace std;
const nit maxa=10004;
const nit maxb=1e2;
const nit maxc=5;

itn n,m,ans;

tni main()
{
	scanf("%d%d",&n,&m);
	//
	ans=n*m-n-m+1;
	//
	pritnf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
import math

A, B = map(int, input().split())
jdg = False
ans = 1000
for i in range(B*10, (B+1)*10-1):
    M = math.floor(i*0.08)
    if M == A:
        jdg = True
        ans = min(ans,i)

if jdg:
    print(ans)
else:
    print(-1)


Measured memory_bytes: 38256
#include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;
using Graph = vector<vector<int> >;
int flag=0;
int h[100010];

void tp(int v,const Graph &G,vector<bool> &seen,vector<int> &order){
  seen[v] = true;
  for(auto next:G[v]){
    if(seen[next]==true)continue;
    tp(next,G,seen,order);
  }
  order.push_back(v);
}


int main(){
  int N,M;
  cin >> N >>M;
  Graph G(N);
  vector<bool> seen(N,0);
  vector<int> order;

  for(int i=0;i<M;i++){
    int a,b;
    cin >>a>>b;
    G[a].push_back(b);
    h[b]++;
  }

  stack<int> st;
  for(int i=0;i<N;i++){if(h[i]==0)st.push(i);}

  while(st.size()){
    int i = st.top();
    st.pop();
    order.push_back(i);
    for(auto & j:G[i]){
      h[j]--;
      if(h[j]==0)st.push(j);
    }
  }


  //  for(int i:order) cout << i<<"->";
  //  cout << endl;
  if(order.size()==N)cout <<0<<endl;
  else cout <<1 <<endl;

}


Measured memory_bytes: 3172
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
//#pragma warning(disable : 4996)

#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#define __builtin_popcountll __popcnt64
#endif

#include <limits.h>
#include <math.h>
#include <time.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m - 1; i >= n; --i)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v, n) reverse(v, v + n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout << (x) << '\n'
#define pe(x) cout << (x) << " "
#define DEBUG(x) cout << #x << ": " << x << endl
#define lb(v, n) lower_bound(v.begin(), v.end(), (n))
#define ub(v, n) upper_bound(v.begin(), v.end(), (n))
#define int long long
#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i, v.size()) cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
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; }
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 1e9 + 7;
constexpr int MAX = 500050;
const double pi = acos(-1);
constexpr double EPS = 1e-8;
constexpr ll LINF = 1e18 + 1;
constexpr int INF = 1e9 + 1;

void solve() {
	int N; cin >> N;
	N %= 1000;
	print((1000 - N) % 1000);
}



signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q;
	//cin >> q;
	//while (q--)
	solve();
}


Measured memory_bytes: 3652
import java.util.*;

class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    
    if(str.equals("a")||str.equals("e")||str.equals("i")||str.equals("o")||str.equals("u")){
      System.out.println("vowel");
    }else{
      System.out.println("consonant");
  	}
  }
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
#define inf 1e9
using namespace std;
struct node{
	int nxt,to,weigh;
}edge[400010];
int head[100100],n,S,T,cnt=1,level[100100];
int a[10010],b[10010],c[10001000],sum,tot,ans;
queue<int> qu;
bool check(int a){
	if(a<=2)return false; 
	for(int i=2;i<=sqrt(a);i++)
		if(a%i==0)return false;
	return true;
}
void addedge(int x,int y,int z){
	edge[++cnt].nxt=head[x];
	edge[cnt].to=y;
	edge[cnt].weigh=z;
	head[x]=cnt;
	edge[++cnt].nxt=head[y];
	edge[cnt].to=x;
	edge[cnt].weigh=0;
	head[y]=cnt;	
}
bool bfs(){
	memset(level,-1,sizeof(level));
	level[S]=0;
	qu.push(S);
	while(!qu.empty()){
		int u=qu.front();
		qu.pop();
		for(int i=head[u];i;i=edge[i].nxt){
			int upup=edge[i].to;
			if(edge[i].weigh!=0 && level[upup]==-1){
				level[upup]=level[u]+1;
				qu.push(upup);
			}
		}
	}
	if(level[T]==-1)return false;
	return true;
}
int dfs(int x,int flow){
	if(x==T)return flow;
	int rest=0;
	for(int i=head[x];i;i=edge[i].nxt){
		int upup=edge[i].to;
		if(rest==flow)break;
		if(level[upup]==level[x]+1){
			int sum=dfs(upup,min(flow-rest,edge[i].weigh));
			rest+=sum,edge[i].weigh-=sum;edge[i^1].weigh+=sum;
		}
	} 
	return rest;
}
int Dinic(){
	int ans=0;
	while(bfs())
		ans+=dfs(S,inf);
	return ans;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		c[a[i]]=1;
	}
	for(int i=1;i<=10000000;i++)
		if(c[i]!=c[i-1])
			b[++sum]=i;
	S=0,T=sum+1;
	for(int i=1;i<=sum;i++)
		if(b[i]&1){
			tot++;
			addedge(S,i,1);
			for(int j=1;j<=sum;j++)
				if(!(b[j]&1)&&check(abs(b[j]-b[i])))
					addedge(i,j,1);
		}
		else addedge(i,T,1);
	ans=Dinic();
	printf("%d\n",sum-ans+(tot-ans)%2);
	return 0;
}

Measured memory_bytes: 39168