akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <algorithm>
#define int long long
#define N 100002
using namespace std;
int head[N],ver[N*2],nxt[N*2],l;
int head1[N],ver1[N*2],nxt1[N*2],l1;
int n,m,i,j,a[N],b[N],c[N],fa[N],p[N],f[N],sum[N];
bool vis[N];
void add(int x,int y){
	l++;
	ver[l]=y;
	nxt[l]=head[x];
	head[x]=l;
}
void add1(int x,int y){
	l1++;
	ver1[l1]=y;
	nxt1[l1]=head1[x];
	head1[x]=l1;
}
int cmp(const int &x,const int &y){
	return c[x]<c[y];
}
int find(int x){
	if(fa[x]!=x) fa[x]=find(fa[x]);
	return fa[x];
}
void dfs(int x){
	sum[x]=b[x];
	for(int i=head1[x];i;i=nxt1[i]){
		int y=ver1[i];
		dfs(y);
		sum[x]+=sum[y];
	}
	f[x]=sum[x]+c[x];
	for(int i=head1[x];i;i=nxt1[i]){
		int y=ver1[i];
		f[x]=min(f[x],sum[x]-sum[y]+max(f[y],c[x]));
	}
}
signed main(){
	scanf("%lld%lld",&n,&m);
	for(i=1;i<=n;i++){
		scanf("%lld%lld",&a[i],&b[i]);
		c[i]=max(a[i]-b[i],0ll);
	}
	for(i=1;i<=m;i++){
		int u,v;
		scanf("%lld%lld",&u,&v);
		add(u,v);
		add(v,u);
	}
	for(i=1;i<=n;i++) fa[i]=p[i]=i;
	sort(p+1,p+n+1,cmp);
	for(i=1;i<=n;i++){
		int x=p[i];
		vis[x]=1;
		for(j=head[x];j;j=nxt[j]){
			int y=ver[j];
			if(vis[y]){
				int f=find(y);
				if(f!=x){
					fa[f]=x;
					add1(x,f);
				}
			}
		}
	}
	dfs(p[n]);
	cout<<f[p[n]]<<endl;
	return 0;
}

Measured memory_bytes: 19684
#include<iostream>
#include<vector>
#include<queue>
#include <cmath>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
  string a,b,c;
  cin >>a >> b>>c;
  
 if (a[a.size()-1] ==b[0]  && b[b.size()-1] ==c[0] ){
   cout <<"YES";
 }else{
  cout <<"NO"; 
 }
     return 0;
}






Measured memory_bytes: 256
S = input()
N = len(S)


def is_palindrome(s):
    s_reverse = s[::-1]
    if s == s_reverse:
        return True
    else:
        return False

if is_palindrome(S) and is_palindrome(S[:(N-1)//2]) and is_palindrome(S[(N+3)//2-1:]):
    print('Yes')
else:
    print('No')


Measured memory_bytes: 2940
n, l = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)

x = (n-1).times.find {|i| a[i] + a[i+1] >= l}

if !x
    puts "Impossible"
    exit
end

puts "Possible"
0.upto(x-1) {|i| puts i + 1}
(n-2).downto(x+1) {|i| puts i + 1}
puts x+1

Measured memory_bytes: 22072
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s1;
  cin >> s1;
  string s2;
  int x;
  string ans;
  for (int bit = 0; bit < 8; bit++){
    s2 = s1;
    x = s2[0]-'0';
    for (int i = 0; i < 3; i++){
      if (bit & (1 << i)){
        x = x+(s2[2*i+1]-'0');
        s2.insert(2*i+1,"+");
      }else{
        x = x-(s2[2*i+1]-'0');
        s2.insert(2*i+1, "-");
      }
    }
    if (x == 7){
      ans = s2 + "=7";
      break;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3608
using System;
public class Hello{
    public static void Main(){
        // Your code here!
        int n =int.Parse(System.Console.ReadLine());
        string[] s = System.Console.ReadLine().Split(' ');
        //int[] p = new int[n];
        int cnt=0;
        for(int i=0 ; i<n ; i++){
            if(int.Parse(s[i]) != i+1){
                cnt++;
                if(cnt>2){
                    System.Console.WriteLine("NO");
                    return;
                }
            }
        }
        System.Console.WriteLine("YES");
    }
}

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


int main()
{

//道具
    string s;

//入力

    cin >> s;

//計算
    
//出力

    if (s[2] == s[3] && s[4] == s[5])
        cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define ushi int
#define tapu main
#define nichia (
#define kunn void
#define wara )

using ll = long long;

const int INF = 1073741823;
const int MINF = -1073741823;
const ll LINF = ll(4661686018427387903);
const ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main(){

	int a, b, c;
	scanf("%d%d%d", &a, &b, &c);
	printYN((a * 100 + b * 10 + c) % 4 == 0);

	Please AC;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<sstream>
#include<algorithm>
#include<stack>
#include<bitset>
#include<map>
#include<set>
#define rep(i,n) for(int i=0;(i)<(n);i++)
#define rep1(i,n) for(int i=1;(i)<=(n);i++)
#define mst(a,b) memset(a,b,sizeof(a))
#define scd(a) scanf("%d",&a)
#define scdd(a,b) scanf("%d%d",&a,&b)
#define scddd(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define dbg(a) cout<<"* "<< #a <<" : "<<a<<endl
#define fr first
#define se second
#define ls x<<1
#define rs x<<1|1
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define lowbit(x) x&(-x)
#define ac cout<<ans<<endl
//#define DEBUG 0
using namespace std;
const double pi=acos(-1.0);
const double eps=1e-8;
const ull hashp=131;
const ll INF=0x3f3f3f3f3f3f3f3fll;
const int inf=0x3f3f3f3f;
const int mod=1e9+7;
const int maxn=1e3+100;
int head[maxn],cnt;
struct edge{
	int nxt,to,cost,val,id;
}e[maxn*200];
void add(int a,int b,int cost,int val,int id){
	e[++cnt].nxt=head[a],e[cnt].to=b,e[cnt].id=id,e[cnt].val=val,e[cnt].cost=cost,head[a]=cnt;
}
int c[maxn],d[maxn];
ll dis[55][5005];
struct node{
	ll d;
	int u,v;
	node():d(),u(),v(){}
	node(ll _d,int _u,int _v):d(_d),u(_u),v(_v){}
	bool operator < (const node&z)const {return d>z.d;}
};
priority_queue<node>q;
void dij(){
	while(!q.empty()){
		node now=q.top();q.pop();
		int u=now.u,v=now.v;
		if(dis[u][v]!=now.d)continue;
		for(int i=head[u];i;i=e[i].nxt){
			int to=e[i].to,val=e[i].val;
			int cost=e[i].cost;
			if(v>=cost&&dis[to][v-cost]>dis[u][v]+val){
				dis[to][v-cost]=dis[u][v]+val;
				q.push(node(dis[to][v-cost],to,v-cost));
			}
		}
		int nxt=v+c[u];
		if(nxt>5000)nxt=5000;
		if(dis[u][nxt]>dis[u][v]+d[u]){
			dis[u][nxt]=dis[u][v]+d[u];
			q.push(node(dis[u][nxt],u,nxt));
		}
	}
}
void solve(){
	int n,m,s;
	scddd(n,m,s);
	rep1(i,m){
		int x,y,k,l;
		scdd(x,y);
		scdd(k,l);
		add(x,y,k,l,i);
		add(y,x,k,l,i);
	}
	rep1(i,n)
		scdd(c[i],d[i]);
	if(s>5000)s=5000;
	mst(dis,inf);
	dis[1][s]=0;
	q.push(node(dis[1][s],1,s));dij();
	for(int i=2;i<=n;i++)
		for(int j=0;j<=5000;j++)
			dis[i][j]=min(dis[i][j],dis[i][j-1]);
	for(int i=2;i<=n;i++)
		printf("%lld\n",dis[i][5000]);
}
int main(){
    //IOS;
    //freopen("fenwick.in","r",stdin);
    //freopen("fenwick.out","w",stdout);
    solve();
    
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;;                                             ;;
	;;         ;;            ;;;;;;;;;       ;;    ;;
	;;        ;; ;;        ;;                ;;    ;;
	;;       ;;   ;;       ;;                ;;    ;;
	;;      ;;;;;;;;;      ;;                ;;    ;;
	;;     ;;       ;;     ;;                      ;;
    ;;    ;;         ;;      ;;;;;;;;;       ;;    ;;
    ;;                                             ;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    return 0;
}

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

#define pb              push_back
#define pi              acos(-1.0)
#define loop(i,a,n)     for(int i=a;i<n;i++)
#define rloop(i,n,a)    for(int i=n;i>=a;i--)
#define ll              long long int
#define ff              first
#define ss              second
#define pii             pair<ll,ll>
#define sc1(a)          scanf("%d",&a)
#define sc2(a,b)        scanf("%d %d",&a,&b)
#define sc3(a,b,c)      scanf("%d %d %d",&a,&b,&c)
#define all(v)          v.begin(),v.end()
#define ms(a,b)         memset(a,b,sizeof a)
#define FastIO          ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define fileout         freopen("output.txt","w",stdout)
#define filein          freopen("input.txt","r",stdin)
#define inf             2e9+5
#define Q               int q;cin>>q;while(q--)
#define check           cout<<"HI"<<endl;

//int x[]= {-1,0,0,1};
//int y[]= {0,-1,1,0};

using namespace std;

int main()
{
  
        int n,p=0;
        string s;
        char t='0';
        cin >> n >> s;
        loop(i,0,n-1)
        {
            if(s[i]!=s[i+1])
            {
                p++;
                t=s[i];
            }
        }
        if(t!=s[n-1])p++;
        cout<<p<<endl;
    }














Measured memory_bytes: 3716
#include <iostream>
#include <string>

using namespace std;

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

    long long L[N];
    for (int i = 0; i < N; i++)
    {
        cin >> L[i];
    }

    long long counter = 0;
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            for (int k = 0; k < N; k++)
            {
                if ((L[i] == L[j]) || (L[j] == L[k]) || (L[k] == L[i]))
                {
                    /* 処理なし */
                }
                else
                {
                    int a = L[i];
                    int b = L[j];
                    int c = L[k];
                    if (((a + b) > c) && ((b + c) > a) && ((c + a) > b))
                    {
                        counter++;
                    }
                }
            }
        }
    }

    cout << counter / 6 << "\n";
}


Measured memory_bytes: 3196
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n ,ac = 0, wa = 0, tle = 0, re = 0;
  string test;
  cin >> n;
  for(int i=0;i<n;i++){
	  cin >> test;
      if(test=="AC") ac++;
      if(test=="WA") wa++;
      if(test=="TLE") tle++;
      if(test=="RE") re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  
}

Measured memory_bytes: 3624
/* In the name of Anton */

/*
* Motto :)
*
*
*
*
*
*/

#include<bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define repa(i,a,n) for(int i=a;i<=n;i++)
#define repb(i,a,n) for(int i=a;i>=n;i--)
#define trav(x,a) for(auto &x: a)
#define all(x) x.begin(),x.end()
#define sz(x) (int)(x).size()
#define fst first
#define snd second
#define pb push_back
#define mp make_pair
#define vt vector
typedef long double ld;
typedef pair <int,int> pii;
typedef vector <int> vi;
typedef long long ll;

template<class A> void read(vt<A>& v);
template<class T> void read(T& x){
  cin>>x;
}

void read(double &d){
  string t;
  read(t);
  d=stod(t);
}
void read(long double &d){
  string t;
  read(t);
  d=stold(t);
}

template<class H, class... T> void read(H &h, T&...t){
  read(h);
  read(t...);
}

template <class A> void read(vt<A> &x){
  trav(a,x)
    read(a);
}

string to_string(char c){
  return string(1,c);
}

string to_string(bool b){
  return b?"true":"false";
}

string to_string(const char* s){
  return string(s);
}

string to_string(string s){
  return string(s);
}

string to_string(vt<bool> v){
  string res;
  rep(i,sz(v)){
    res+=char('0'+v[i]);
  }
  return res;
}

template<class T> string to_string(T v){
  bool f=1;
  string res;
  trav(x,v){
    if(!f)
      res+=' ';
    f=0;
    res+=to_string(x);
  }
  return res;
}

template<class A> void write(A x){
  cout<<to_string(x);
}

template<class H, class...T> void write(const H& h, const T&...t){
  write(h);
  write(t...);
}

void print(){
  write("\n");
}

template<class H, class...T> void print(const H& h, const T&...t){
  write(h);
  if(sizeof...(t))
    write(' ');
  print(t...);
}

/* -----------------------------------------------------------------------------------------------*/

void pre(){

}

void solve(){
  int n;
  read(n);

  print(abs(1-n));
}

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);
  pre();
  int t=1;
  // read(t);
  rep(i,t) solve();
  return 0;
}


Measured memory_bytes: 3684
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod=1337;
int main()
{
  string s,t;
  cin>>s>>t;
  int n=t.size();
  char x=t[n-1];
  s=s+x;
  if(s==t)
  {
      cout<<"Yes";
  }
  else{
    cout<<"No";
  }
  cout<<"\n";
}


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

dp = {}

# 最短で通ってるやつのうちの連続してる箇所


# Y, X, ひとつ前が#かどうか
def rec(y, x, f):
    if (y, x, f) in dp:
        return dp[(y, x, f)]
    if y == h - 1 and x == w - 1:
        return 0
    if y < 0 or h <= y or x < 0 or w <= x:
        print(10.0 / 0)
    ret = 10**8
    steps = [0, 1, 0]
    for i in range(2):
        next_x, next_y = x + steps[i], y + steps[i + 1]
        if 0 <= next_y < h and 0 <= next_x < w:
            if table[next_y][next_x] == "#":
                if f == True:
                    ret = min(rec(next_y, next_x, True), ret)
                else:
                    ret = min(rec(next_y, next_x, True) + 1, ret)
            else:
                ret = min(rec(next_y, next_x, False), ret)
        else:
            continue
    dp[(y, x, f)] = ret
    return ret


ans = rec(0, 0, True) + 1 if table[0][0] == "#" else rec(0, 0, False)
print(ans)
"""
問題文読み違えてた？
3 3
.##
#.#
#..
だと
2
じゃなくて
1
が正解？

ADD: やっぱり読み違えてたみたいだ 1時間以上ロスしたんだけど 日本語のおべんきょうをやりなおそうね
"""

Measured memory_bytes: 4464
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;
#define fi first
#define se second
#define all(v) (v).begin(),v.end()
const ll inf=(1e18);
const ll mod=1000000007;
const ll mod2=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll dp[100010][2];//桁数、１超えていない：０確定していない
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
  ll n,m;
  cin>>n>>m;
  multiset<ll> a;
    ll ans=0;
  for(int i=0;i<n;i++){
      ll c;cin>>c;
      a.insert(c);
  }
  vector<P> b(m);
  for(int i=0;i<m;i++)cin>>b[i].se>>b[i].fi;
  sort(all(b),greater<P>());
  for(int i=0;i<m;i++){
        auto itl=a.upper_bound(b[i].fi);
       if(itl==a.begin())break;
       ll cnt=0;
       while(!a.empty()&&b[i].se--&&*a.begin()<b[i].fi){
           a.erase(a.begin());
           cnt++;
       }
       ans+=cnt*b[i].fi;
  }
  while(!a.empty()){
      ans+=*a.begin();
      a.erase(a.begin());
  }
   cout<<ans<<endl;
}

Measured memory_bytes: 6528
#include <bits/stdc++.h>
#define itn int
#define rep(i, n) for (int i = 0; i < n; i++)
#define irep(i,n) for(int i = n-1; i>=0; i--)
#define repeach(itr, k) for(auto itr : k)
#define MOD 1000000007
using namespace std;
typedef long long ll;

const ll INF = 1LL << 60;

int GCD(int a,int b){
  int A,B;
  if(a<b){
    A=b;
    B=a;
  }
  else{
    A=a;
    B=b;
  }
  int R=A%B;
  while(R!=0){
    A=B;
    B=R;
    R=A%B;
  }
  return B;
}

int main(){
    ll a,b,c,d;
    cin >> a >> b >> c >> d;
    ll c_=(b/c)-((a-1)/c);
    ll d_=(b/d)-((a-1)/d);
    ll c_d=(c*d)/GCD(c,d);
    ll cd_=(b/(c_d))-((a-1)/(c_d));
    cout << (b-a+1)-(c_+d_-cd_) << endl;
}


Measured memory_bytes: 256
//author-abhijit dey
 //Welcome to my code. btw I hate coding 😉
#include <bits/stdc++.h>
using namespace std;
#define     ff first
#define     ss second
#define     pb push_back
#define     mp make_pair
#define     INF 1000000005
#define     MOD 1000000000
#define     ninf -1000000000
#define     all(c) c.begin(), c.end()
#define     tinput long long int t;cin>>t;
#define     mem(a,x) memset(a,x,sizeof a)
#define     for0(i,n) for(long long int i=0;i<n;i++)
#define     pi 3.141592653589793238462643383279502884
#define     fori(i,a,n) for(long long int i=a;i<n;i++)
#define     forxy(i,x,y) for(int i=x;i<=y;i++)
#define     rfor(i,n) for(long long int i=n-1;i>=0;i--)
#define     ainput for(int i=0; i<n; i++) cin>>a[i];
#define     fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

typedef     long long int ll;
typedef     vector<long long int>vll;
typedef     vector<vector<int> >vvll;
typedef     pair<long long int,long long int>pr;
typedef     vector<pair<long long int,long long int> >vp;

inline long long  min2(long long  a, long long  b)  {return (a)<(b)?(a):(b);}
inline long long  max2(long long  a, long long  b)  {return (a)>(b)?(a):(b);}
inline long long  max3(long long  a, long long  b, long long  c)    {return (a)>(b)?((a)>(c)?(a):(c)):((b)>(c)?(b):(c));}
inline long long  min3(long long  a, long long  b, long long  c)    {return (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c));}
using namespace std::chrono;
ll N,k;
vll dp(100001,-1);
vll a(100001);
vll b(101,INT_MAX);
ll mincost(ll ind)
{
    //base case
    if(ind==N)return 0;
    //if allready precomputed
    if(dp[ind]!=-1)return dp[ind];
    //else
    for(ll i=1;i<=k;i++)
    {
        if(ind+i<=N)
        b[i]=abs(a[ind]-a[ind+i])+mincost(ind+i);
    }
    dp[ind]=*min_element(all(b));

    return dp[ind];
}
void process()
{
    cin>>N>>k;
    for(ll i=1;i<=N;i++)cin>>a[i];
    cout<<mincost(1);
}
int main()
{
    fastio;
    //tinput;
    //while(t--)
        process();
}

Measured memory_bytes: 8064
x=int(input())
max=0
if x==1:
    print(1)
else:
    for i in range(1,x):
        for j in range(3,x):
            if i**j>x:
                if x>=i**(j-1)>max:
                    max=i**(j-1)
                break
    print(max)


Measured memory_bytes: 2940
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N = I()

ans = 10 ** 18
for i in range(1, int(sqrt(N))+1):
    if N % i != 0:
        continue
    j = N // i

    ans = min(ans, i+j-2)
    
print(ans)

Measured memory_bytes: 12472
x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
#include<iostream>
    using namespace std;
    int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if((a==b&&a==5&&c==7)||(c==b&&c==5&&a==7)||(a==c&&a==5&&b==7)){
    	cout<<"YES";
    }
     else{
     cout<<"NO";
     }}

Measured memory_bytes: 3588
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;



class Program
{
    const int MOD = 1000000007;
    const int INF = 1 << 30;

    static void Main(string[] args)
    {
        Solve();
    }



    static void Solve()
    {
        Scan sc = new Scan();
        write wr = new write();

        var N = sc.intarr[0];
        if (N <= 104) wr.wri(0);
        else if (N <= 134) wr.wri(1);
        else if (N <= 164) wr.wri(2);
        else if (N <= 188) wr.wri(3);
        else if (N <= 194) wr.wri(4);
        else wr.wri(5);

    }
}
    




class Scan
{
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
    public char[] chararr => str.ToArray();


}



class write
{
    public void wri<Type>(Type x)
    {
        Console.WriteLine(x);
    }
}


Measured memory_bytes: 13396
#include<bits/stdc++.h>
#define ll long long
#define db double
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define endl "\n"
#define pb push_back
#define mp make_pair
#define inf LONG_LONG_MAX
#define inf1 INT_MAX
using namespace std;
/*
ll mpow(ll a, ll b){
    if(!b)
        return 1;
    ll temp=mpow(a,b/2);
    temp=(temp*temp)%mod;
    if(b%2)
        return (a*temp)%mod;
    return temp;
}

ll _pow(ll a, ll b){
    if(!b)
        return 1;
    ll temp=_pow(a,b/2);
    temp=(temp*temp);
    if(b%2)
        return (a*temp);
    return temp;
}

ll mod_in(ll n){
    return mpow(n,mod-2);
}
*/
int main()
{
    fastio
    ll n, k;
    cin>>n>>k;
    ll a[n];
    ll i, j;
    for(i=0; i<n; i++)
    {
        cin>>a[i];
    }
    ll dp[n];
    dp[0]=0;
    for(i=1; i<min(n, k+1); i++)
    {
        dp[i]=abs(a[i]-a[0]);
    }
    for(i=2; i<n; i++)
    {
        dp[i]=inf;
        for(j=1; j<=k; j++)
        {
            if(i-j>=0)
            {
                dp[i]=min(dp[i], dp[i-j]+abs(a[i]-a[i-j]));
            }
        }
        //dp[i]=min(dp[i-1]+abs(a[i-1]-a[i]), dp[i-2]+abs(a[i-2]-a[i]));
    }
    cout<<dp[n-1];
    return 0;
}

Measured memory_bytes: 1792
#include"bits/stdc++.h"


#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fr(x) freopen(x,"r",stdin)
#define fw(x) freopen(x,"w",stdout)
#define iout(x) printf("%d\n",x)
#define lout(x) printf("%lld\n",x)
#define REP(x,l,u) for(int x = (l);x<=(u);x++)
#define RREP(x,l,u) for(int x = (l);x>=(u);x--)
#define mst(x,a) memset(x,a,sizeof(x))
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
#define se second
#define fi first
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define sz(x) ((int)x.size())
#define cl(x) x.clear()

typedef  long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
using namespace std;

const int maxn = 600010;
const int mod = 1e9+7;
const int MAX = 1000000010;
const double eps = 1e-6;
const double PI = acos(-1);

template<typename T> inline void read(T &x){
x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}

template<typename A,typename B> inline void read(A&x,B&y){read(x);read(y);}
template<typename A,typename B,typename C> inline void read(A&x,B&y,C&z){read(x);read(y);read(z);}
template<typename A,typename B,typename C,typename D> inline void read(A&x,B&y,C&z,D&w){read(x);read(y);read(z);read(w);}
template<typename A,typename B> inline A fexp(A x,B p){A ans=1;for(;p;p>>=1,x=1LL*x*x%mod)if(p&1)ans=1LL*ans*x%mod;return ans;}
template<typename A,typename B> inline A fexp(A x,B p,A mo){A ans=1;for(;p;p>>=1,x=1LL*x*x%mo)if(p&1)ans=1LL*ans*x%mo;return ans;}

int n,rt1,rt2;

int fa[maxn];

vector<int> G[maxn];

int f[maxn],Ans[maxn],S[maxn],top;

map<PII,int> mp;

void Euler(int u){
	for(int i=(int)G[u].size()-1;i>=0;i--){
		int v=G[u][i];G[u].pop_back();
		if(!mp[MP(u,v)]){
			mp[MP(v,u)]=mp[MP(u,v)]=1;
			Euler(v);
			i=min(i,(int)G[u].size());
		}
	}
	S[++top]=u;
}

void dfs(int u){
	f[u]=1;
	for(auto v:G[u])if(v!=fa[u])dfs(v),f[u]^=1;
}

void Work(){
	dfs(rt1);
	dfs(rt2);
	REP(i,1,n)if(f[i]!=f[i+n]){
		puts("IMPOSSIBLE");
		return;
	}
	puts("POSSIBLE");
	REP(i,1,n)if(f[i])G[i].PB(i+n),G[i+n].PB(i),Ans[i]=-1;
	G[0].PB(rt1);G[rt1].PB(0);
	G[0].PB(rt2);G[rt2].PB(0);
	Euler(0);
	REP(i,1,top-1)if(S[i+1]==S[i]+n)Ans[S[i]]=1;
	REP(i,1,n)printf("%d ",Ans[i]);puts("");
}

void Init(){
	read(n);
	REP(i,1,n){
		read(fa[i]);
		if(fa[i]==-1)rt1=i;
		else G[i].PB(fa[i]),G[fa[i]].PB(i);
	}
	REP(i,n+1,n*2){
		read(fa[i]);
		if(fa[i]==-1)rt2=i;
		else fa[i]+=n,G[i].PB(fa[i]),G[fa[i]].PB(i);
	}
}

int main(){
	Init();
	Work();
	return 0;
}


Measured memory_bytes: 108920
#include <iostream>
#include <iosfwd>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cassert>
#include <cctype>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <math.h>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <sstream>
#include <complex>
#include <fstream>
#include <functional>
#include <numeric>
#include <utility>
#include <algorithm>
#include <assert.h>
#include <unordered_map>
#pragma GCC optimize ("-O3")
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(NULL);
#define tolower(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define toupper(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define ll long long int
ll max(ll a, ll b) {  return a > b ? a : b; }
ll gcd(ll a, ll b) { if (a == 0) return b; return b == 0 ? a : gcd(b, a % b);}
#define case(i) cout<<"Case #"<<i<<": ";
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); cerr << '\n'; }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
#define debug2(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
void err(istream_iterator<string> it, T a, Args... args) { cerr << "[ " << *it << " = " << a << " ]"; err(++it, args...);}
#define time__(d) for (auto blockTime = make_pair(chrono::high_resolution_clock::now(), true); blockTime.second; debug2("%s: %lld ms\n", d, chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - blockTime.first).count()), blockTime.second = false)
#define pii pair <ll , ll >
#define pb push_back
#define PRECISION 10
const ll inf = 9223372036854775800;
const int MAXN = 100001;
const int LOGN = 22;
const int MAXBIT = 62;
const long double PI = 3.141592653589793;
const int DIGITSIZE = 18;
ll mod = 1e9 + 7;
ll MOD = 998244353;
int x4[] = {1, -1, 0, 0};
int y4[] = {0, 0, 1, -1};
int x8[] = {1, 1, 1, -1, -1, -1, 0, 0};
int y8[] = {1, 0, -1, 1, 0, -1, 1, -1};
bool takeTestCases = 0;
bool printCaseNo = 0;

void getac(int T) {
    int x;
    cin>>x;
    if(x>=30){
        cout<<"Yes";
    }else{
        cout<<"No";
    }
}
int  main()
{
// #ifndef ONLINE_JUDGE
//     freopen("input.txt", "r", stdin);
//     freopen("output.txt", "w", stdout);
//     freopen("error.txt", "w", stderr);
// #endif
    fastio;
    int t = 1;
    if (takeTestCases) cin >> t;
    int t_t = 1;
    while (t--) {
        if (printCaseNo)
        case (t_t);
        getac(t_t);
        t_t++;
    }
    cerr << "Total time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
    return 0;
}


Measured memory_bytes: 3748
N = int(input())
a_list = list(map(int, input().split()))

index_a_tuples = []
for index, a in enumerate(a_list):
    index_a_tuples.append((index + 1, a))

sorted_tuples = sorted(index_a_tuples, key=lambda t: t[1])

sorted_index = []
for sorted_tuple in sorted_tuples:
    sorted_index.append(sorted_tuple[0])

print(" ".join(map(str, sorted_index)))

Measured memory_bytes: 25700
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;

vector<ll> ans;

void dfs(ll a){
  if(a>3234566667){
    return;
  }
  else{
    ans.push_back(a);
    int x=a%10;
    if(x!=0) dfs(a*10+x-1);
    dfs(a*10+x);
    if(x!=9) dfs(a*10+x+1);
  }
}

int main(){
  int k; cin >> k;
  ans.resize(0);
  for(int i=1;i<10;i++) dfs(i);
  sort(all(ans));
  cout << ans[k-1] << endl;
}

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

using namespace std;

const int N = int(110);
char tab[N][N];
int dp[N][N][2];
const int inf = int(1e9);
int n, m;

int solve(int i, int j, int c){
	if(j >= m || i >= n){
		return inf;
	}

	if(i == n - 1 && j == m - 1) return 0;

	int &ans = dp[i][j][c];

	if(ans != -1){
		return ans;
	}

	ans = 0;

	int op1 = solve(i + 1, j, tab[i + 1][j]);

	if(tab[i + 1][j] == 1 && !c){
		op1++;
	}

	int op2 = solve(i, j + 1, tab[i][j + 1]);

	if(tab[i][j + 1] == 1 && !c){
		op2++;
	}

	ans = min(op1, op2);

	return ans;
}

int main(){
	memset(dp, -1, sizeof dp);

	scanf("%d %d", &n, &m);

	for(int i = 0 ; i < n ; i++){
		for(int j = 0 ; j < m ; j++){
			scanf("\n%c", &tab[i][j]);
			tab[i][j] = (tab[i][j] == '.') ? 0 : 1;
			// printf("%d\n", tab[0][0]);
		}
	}

	printf("%d\n", solve(0, 0, tab[0][0]) + tab[0][0]);

	return 0;
}

Measured memory_bytes: 384
package main

import "fmt"

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

	ans := 0
	for i := 1; i <= n; i += 2 {

		count := 0
		for j := 1; j <= i; j++ {
			if i%j == 0 {
				count++
			}
		}
		if count == 8 {
			ans++
		}
	}

	fmt.Println(ans)
}


Measured memory_bytes: 512
n = int(input())
if n == 1:
  print(0)
  quit()
else:
  res = n-1 if n%(n-1) == int(n/(n-1)) else 0
i = 2
while i*i <= n:
  if n%i == 0:
    if n%(i-1) == int(n/(i-1)):
      res += i-1
    if i*i != n:
      if n%(int(n/i)-1) == int(n/(int(n/i)-1)):
        res += int(n/i) - 1
  else:
    pass
  i += 1
print(res)
  
  

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

int
main(int argc, char *argv[])
{
        char in;
        int tmp;

        while (in = getc(stdin)) {
                if (in == '\n') {
                        printf("%d\n", tmp);
                        tmp = 0;
                        continue;
                }
                if (tmp == 0 && in == '0')
                        break;
                tmp += in - '0';
        }

        return 0;
}

Measured memory_bytes: 524
h,w = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
R = []
for i in range(n):
    for j in range(a[i]):
        R.append(i+1)
E = []
for i in range(h):
    E.append(R[i*w:(i*w)+w])
for i in range(h):
    if i%2:
        print(" ".join(map(str,reversed(E[i]))))
    else:
        print(" ".join(map(str,E[i])))

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

int main(){
    int n; cin >> n;
    bool flg = false;
    vector<int> a(n);
    for(int i=0; i<n; i++){
        cin >> a[i];
        if(a[i] == 1) flg = true;
    }

    int count =0;
    int num=1;
    int pre_ids=0;
    if(flg){
        for(int i=0; i<n; i++){
            if(a[i] == num)
                num++;
            else
                count++;
        }
    }
    
    if(flg) cout << count << endl;
    else    cout << "-1"<< endl;

    return 0;

}

Measured memory_bytes: 4064
N = int(input())
S = input()
we = []
w = 0
e = 0

for i in range(N):
    if S[i] == "W":
        w += 1
    else:
        e += 1
    we.append([w,e])

e_count = we[-1][1]
ans = min(e_count,we[-1][0])
for i in range(N):
    ans = min(we[i][0] + abs(we[i][1] - e_count), ans)
print(ans)

Measured memory_bytes: 77600
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N = I()
A = LI()
B = LI()

x = 0
y = 0
for i in range(N):
    a = A[i]
    b = B[i]
    if a < b:
        if (b-a)%2 == 0:
            x += (b-a)//2
        else:
            x += (b-a)//2 + 1
            y += 1
    else:
        y += a-b

if x < y:
    print('No')
    exit()
count = 2*x-y

if count == sum(B)-sum(A) and count >= 0:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 40816
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc =  new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		long a = (long)Math.pow(10, 9) + 7;
		for(int i = 1; i <= n; i++){
			ans = i * ans % a;
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 23764
N=input()
s1,s2,s3=set(),set(),set()
L=[]
S=[set(),set(),set()]
R=[0]*N
for i in range(N):
    t1,t2,t3=map(int,raw_input().split())
    if t1 not in s1:
        s1.add(t1)
    else:
        S[0].add(t1)
    if t2 not in s2:
        s2.add(t2)
    else:
        S[1].add(t2)
    if t3 not in s3:
        s3.add(t3)
    else:
        S[2].add(t3)
    L.append([t1,t2,t3])
for i in range(len(L)):
    for j in range(len(L[0])):
        if L[i][j] not in S[j]:
            R[i]+=L[i][j]
    print R[i]

Measured memory_bytes: 4292
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,k,s;
    cin>>n>>k>>s;
    for(int i=1;i<=k;++i){
        printf("%d ",s);
    }
    for(int i=1;i<=(n-k);++i){
        printf("%d ",s==1e9?1:s+1);
    }
}


Measured memory_bytes: 1280
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] AB = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int A = AB[0];
            int B = AB[1];
            if (A > 9 || B > 9) 
            {
                Console.WriteLine(-1);
            }
            else
            {
                Console.WriteLine(A * B);
            }
        }
    }
}


Measured memory_bytes: 13268
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#include<map>
#include<iostream>
#include <cstring>
#include <iomanip>
#include <algorithm>
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define input ios_base::sync_with_stdio(0);cin.tie(0);

const double PI  = acos(-1.0);
using namespace std;
//typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
//typedef complex<double> point;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//char rv[4]={'D','R','L','U'};
const double EPS = 1e-9;
const int N = 100000 + 9;
int n,k,mem[N],a[N];

int dp(int i=1)
{
    if(i == n)return 0;
    if(i > n) return 1e9+9;
    if(mem[i] != -1) return mem[i];

    int c = 1e9+9;
    forr(j,1,k) c = min(c,  abs(a[i] - a[i+j]) + dp(i+j));
    return mem[i] = c;
}

 int main()
{
//freopen("calc.in","r",stdin);
//freopen("calc.out","w",stdout);
//__builtin_popcount()
input
        cin>>n>>k;
        forr(i,1,n)cin>>a[i];

        memset(mem,-1,sizeof mem);
        cout<<dp()<<endl;





return 0;
}


Measured memory_bytes: 12232
open System


[<EntryPoint>]
let main argv =
    let N,K =stdin.ReadLine().Split()|>fun c -> int c.[0],int c.[1]
    let h=[|for i in [0..N-1] do yield (stdin.ReadLine()|>int)|]|>Array.sort
    [for i in [0..N-K] do yield ((h.[i+K-1] - h.[i])|>abs)]
    |>List.min
    |>stdout.WriteLine
    0


Measured memory_bytes: 28248
fun main(args: Array<String>) {
    val (r, g, b, n) = readLine()?.split(" ")?.map(String::toInt) ?: return
    val rr = n / r
    var total = 0L
    0.until(rr + 1).forEach { i ->
        val remain = n - (r * i)
        val gg = remain / g
        0.until(gg + 1).forEach {
            val remain2 = remain - (g * it)
            if (remain2 % b == 0) {
                total++
            }
        }
    }
    println(total.toString())
}


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

using namespace std;

const int N = 205;

int n, m, r, d[N][N], vr[10], dp[N][300];

int main() {
  scanf("%d %d %d", &n, &m , &r);
  for (int i = 0; i < r; ++i) {
    scanf("%d", &vr[i]);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      d[i][j] = (int)1e9;
    }
  }
  for (int i = 1; i <= m; ++i) {
    int u, v, w;
    scanf("%d %d %d", &u, &v, &w);
    d[u][v] = d[v][u] = w;
  }
  for (int k = 1; k <= n; ++k) {
    for (int i = 0; i <= n; ++i) {
      for (int j = 0; j <= n; ++j) {
        if (i != j && i != k && j != k) {
          d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
        }
      }
    }
  }
  int S = 1 << r;
  for (int i = 0; i < r; ++i) {
    for (int s = 0; s < S; ++s) {
      dp[i][s] = (int)1e9;
    }
  }
  for (int i = 0; i < r; ++i) {
    dp[i][1 << i] = 0;
  }
  for (int s = 0; s < S; ++s) {
    for (int i = 0; i < r; ++i) {
      if (s & (1 << i)) {
        for (int j = 0; j < r; ++j) {
          if (i != j && (s & (1 <<j)) != 0) {
            int ss = ((S - 1) ^ (1 << i)) & s;
            //cerr << i << ' ' << j << ' ' << s << ' ' << ss << ' ' << d[vr[j]][vr[i]] << ' ' << S << endl;
            //cerr << dp[i][s] << ' ' << dp[j][ss] + d[vr[j]][vr[i]] << endl;
            dp[i][s] = min(dp[i][s], dp[j][ss] + d[vr[j]][vr[i]]);
            //cerr << dp[i][s] << endl;
          }
        }
      }
    }
  }
  int res = INT_MAX;
  for (int i = 0; i < r; ++i) {
    res = min(res, dp[i][S - 1]);
    //cerr << "--" << dp[i][S - 1] << endl;
  }
  printf("%d\n", res);
  return 0;
}


Measured memory_bytes: 384
A,B,C,X,Y=map(int,input().split())
if A+B<2*C:
  ans=A*X+B*Y
else:
  if X<=Y:
    ans=C*2*X
    if 2*C<=B:
      ans+=2*C*(Y-X)
    else:
      ans+=B*(Y-X)
  else:
    ans=C*2*Y
    if 2*C<=A:
      ans+=2*C*(X-Y)
    else:
      ans+=A*(X-Y)
print(ans)

Measured memory_bytes: 9152
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> VI;
typedef pair <int,int> ii;
typedef long long LL;
#define pb push_back
const int INF = 2147483647;

LL n, p, res; 
int i, d;

int main() {
cin >> n >> p;
if (n == 1) {
	cout << p << endl;
	return 0;
}
res = 1;
for (i=2;i*1LL*i<=p;i++) if (p % i == 0) {
	d = 0;
	while (p % i == 0) {
		p /= i;
		d++;
	}
	d /= n;
	while (d--) res = res * i;
}
cout << res << endl;
return 0;
}



Measured memory_bytes: 256
# -*- coding:utf-8 -*-

def solve():
    A, B, C, D = list(map(int, input().split()))

    turn = True
    while A>0 and C>0:
        if turn:
            C -= B
        else:
            A -= D
        turn = not turn

    if A > 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    solve()


Measured memory_bytes: 9108
package main

import "fmt"

func main() {
	var N int
	var S, T string
	result := ""
	fmt.Scan(&N)
	fmt.Scan(&S, &T)
	for i := 0; i < len(S); i++ {
		result += string(S[i]) + string(T[i])
	}
	fmt.Println(result)
}


Measured memory_bytes: 512
#include <iostream>
#include <cstring>
#include<vector>
#include <algorithm>
#include<cstdlib>
#include<set>
#include<math.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(ll i=0;i<n;i++)

int main()
{
	ll n, m, t;
	cin >> n;
	m = n;
	t = 0;
	while (0 < m)
	{
		t++;
		m /= 10;
	}

	ll ans = 0;
	for (int i = 1; i < t ; i++)
	{
		if (i % 2 == 1)
		{
			ans += 9 * pow(10, i - 1);
		}
	}

	if (t % 2 == 1)
	{
		ans += n - pow(10, t - 1) + 1;
	}

	cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 4036
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3+10, mod = 1e9+7;
int sum(int a, int b){
    return (a + b)%mod;
}
int h, w, dp[maxn][maxn];
bool mat[maxn][maxn];
int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    cin >> h >> w;
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            char a;
            cin >> a;
            if(a == '#') mat[i][j] = 1;
        }
    }
    dp[1][1] = 1;
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            if(mat[i][j]) continue;
            dp[i][j+1] =  sum(dp[i][j], dp[i][j+1]);// passando minha resposta pra direita
            dp[i+1][j] = sum(dp[i][j], dp[i+1][j]);  // passando minha resposta pra baixo
        }
    }
    cout << dp[h][w] << "\n";
    return 0;
}



Measured memory_bytes: 8544
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma comment(linker, "/STACK:16777216")
#pragma warning( disable : 6031)
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <map>
#include <stack>
#include <set>
#include <queue>
#include <numeric>
#include <algorithm>
#include <utility>
#include <bitset>
#include <cmath>
#include <sstream>
#include <functional>
#include <iomanip>
#include <limits>

#define all(a) (a).begin(),(a).end()
#define sz(a) (int)(a).size()
#define eps (1e-9)
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector<double> vd;
typedef vector< vd > vvd;
typedef vector< string > vs;
typedef pair< int, int > pii;
typedef vector< pii > vpii;
typedef tuple<int, int, int> tiii;
const long long inf = 1e12;

int main()
{
#ifdef LOCAL_MACHINE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); cout << setprecision(18) << fixed;
	int n;
	cin >> n;
	vi a(n);
	vi x(n);
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int j = 0; j < n; j++)
		x[0] += a[j] * (j % 2 == 0 ? 1 : -1);
	for (int j = 1; j < n; j++)
		x[j] = 2 * a[j - 1] - x[j - 1];
	for (int i = 0; i < n; i++)
		cout << x[i] << " \n"[i == n - 1];
	return 0;
}

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

#define all(x) x.begin(), x.end()

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MN = 1e5 + 5, LN = 17, INF = 0x3f3f3f3f, MOD = 1e9 + 7;

map<pii, int> mp;
ll H, W, N;
int ret[10];

int main() {
    ios_base::sync_with_stdio(false), cin.tie(nullptr);
    cin >> H >> W >> N;
    ll zero = (H - 2) * (W - 2);
    for (int i = 0, a, b; i < N; i++) {
        cin >> a >> b;
        for (int j = max(1, a - 2); j <= a && j + 2 <= H; j++) {
            for (int k = max(1, b - 2); k <= b && k + 2 <= W; k++) {
                if (mp[pii(j, k)] == 0) zero--;
                mp[pii(j, k)]++;
            }
        }
    }
    for (auto i : mp) {
        ret[i.second]++;
    }
    cout << zero << '\n';
    for (int i = 1; i < 10; i++) cout << ret[i] << '\n';
    return 0;
}

Measured memory_bytes: 56576
#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Bytes, Chars, Isize1, Usize1},
};

#[allow(unused_macros)]
macro_rules! echo {
    ($($e:expr),+) => ( { $(println!("{}", $e))+ } );
}

fn main() {
    input! {
        n: usize,
    }

    let mut ans = 0;

    for i in 1..=n {
        if i % 3 == 0 || i % 5 == 0 {
            continue;
        }
        ans += i;
    }

    echo!(ans);
}


Measured memory_bytes: 2116
#include<stdio.h>
int n,m,a[12],b[12],c[4][2],f[4];
int main()
{
    scanf("%d%d",&n,&m);
    if(m==0)
    {
        if(n==1)
            printf("0");
        else if(n==2)
            printf("10");
        else if(n==3)
            printf("100");
        return 0;
    }
    for(int i=1;i<=m;i++)
        scanf("%d%d",&a[i],&b[i]);
    for(int i=1;i<=m;i++)
    {
        if(n==1&&a[i]==1&&b[i]==0)
        {
            printf("0");
            return 0;
        }
        else if(a[i]==1&&b[i]==0)
        {
            printf("-1");
            return 0;
        }
        c[a[i]][0]=b[i];
        if(c[a[i]][1]&&c[a[i]][0]!=f[a[i]])
        {
            printf("-1");
            return 0;
        }
        c[a[i]][1]++;
        f[a[i]]=b[i];
    }
    for(int i=1;i<=n;i++)
    {
        if(i==1&&!c[1][0])
        {
            printf("1");
        }
        if(i==1&&c[1][0])
            printf("%d",c[1][0]);
        else if(i!=1)
            printf("%d",c[i][0]);
    }
    return 0;
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

map<ll, pll> mp;

int main(){
	ll H, W, D, Q;
	cin >> H >> W >> D;
	REP(i, H)REP(j, W){
		ll A;
		cin >> A;
		mp[A] = make_pair(i+1, j+1);
	}
	cin >> Q;

	vector<ll> tobi[D];
	vector<ll> tobi_sum[D];
	for(int i=1;i<H*W+1;i++){
		if(i+D>H*W) continue;
		pll loc1 = mp[i];
		pll loc2 = mp[i+D];
		tobi[i%D].push_back(abs(loc2.first - loc1.first)+abs(loc2.second - loc1.second));
	}

	REP(i, D){
		tobi_sum[i].push_back(0);
		REP(j, tobi[i].size()) tobi_sum[i].push_back(tobi_sum[i][j]+tobi[i][j]);
	}

	/*
	REP(i, D){
		REP(j, tobi[i].size()){
			cout << tobi[i][j] << " ";
		}
		cout << endl;
	}
	REP(i, D){
		REP(j, tobi_sum[i].size()){
			cout << tobi_sum[i][j] << " ";
		}
		cout << endl;
	}
	*/


	REP(i, Q){
		ll L,R;
		cin >> L >> R;
		ll Lp = (L%D==0?L/D-1:L/D);
		ll Rp = (R%D==0?R/D-1:R/D);
		cout << tobi_sum[L%D][Rp] - tobi_sum[L%D][Lp] << endl;
	}

    return 0;
}

Measured memory_bytes: 13056
#include <stdio.h>

int main(){
    char s[15];
    int i=0, win=0;

    scanf("%s", s);

    while(s[i] != '\0'){
        if(s[i] == 'o')
            win++;
        i++;
    }

    if(win + (15-i) >= 8)
        printf("YES\n");
    else
        printf("NO\n");
    
    return 0;
}

Measured memory_bytes: 128
n, k = gets.split.map(&:to_i)
h = n.times.map { gets.to_i }
h.sort!
min_diff = h[-1] - h[0]
for i in 0...(n - k + 1) do
  diff = h[i + k - 1] - h[i]
  min_diff = [min_diff, diff].min
end
puts min_diff


Measured memory_bytes: 4016
#include "bits/stdc++.h"

#define rep(i, a) for (int i = 0; i < (a); ++i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define FORV(a, A) for (auto &a : A)

using namespace std;
using ll = long long;
using P = pair<int, int>;

void Main() {
  int h, a;
  cin >> h >> a;
  if (h % a == 0)
    cout << h / a << endl;
  else
    cout << h / a + 1 << endl;
  return;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}


Measured memory_bytes: 256
n=int(input())
listA=list(map(int,input().split()))
listB=[0]

for i in range(len(listA)-1):
  if listA[i+1]<listA[i]:
    listB.append(listA[i]-listA[i+1])
    listA[i+1]=listA[i]
  else:
    listB.append(0)
    
print(sum(listB))

Measured memory_bytes: 32184
#include<stdio.h>

main()
{
    int n,flag=0,res;
    scanf("%d",&n);

    while(n!=0)
    {
        res = n%10;
        n/=10;
        if(res==7)
        {
            flag=1;
            break;
        }
    }
    if(flag)
        printf("Yes");
    else
        printf("No");
}


Measured memory_bytes: 1732
import sys
sys.setrecursionlimit(10**8)
T=int(input())

def solve(N):
    if N==0:
        return 0
    if N==1:
        return D
    if N in dic:
        return dic[N]
    tmp=N*D    
    if N%2==0:
        tmp=min(tmp,solve(N//2)+A)
    else:
        tmp=min(tmp,solve((N-1)//2)+A+D,solve((N+1)//2)+A+D)
    if N%3==0:
        tmp=min(tmp,solve(N//3)+B)
    else:
        b=N%3 
        tmp=min(tmp,solve((N+(3-b))//3)+B+(3-b)*D,solve((N-b)//3)+B+b*D)
    if N%5==0:
        tmp=min(tmp,solve(N//5)+C)
    else:
        c=N%5
        tmp=min(tmp,solve((N-c)//5)+C+D*c,solve((N+(5-c))//5)+C+D*(5-c))
    dic[N]=tmp
    return tmp

for _ in range(T):
    N,A,B,C,D=map(int,input().split())
    dic={}
    print(solve(N))


Measured memory_bytes: 11020