akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main(){
    int c=0,d=0,N;
    cin >> N;
    vector<pair<int,int>> q;
    for(int i=0;i<N;i++){
      int a,b;
      cin >> a >> b;
      q.push_back(make_pair (b,a));
    }
    sort(q.begin(),q.end());
    for(int j=0;j<N;j++){
        c=c+q[j].second;
        
        if(c>q[j].first){
            cout << "No" << endl;
            break;
        }
      d=d+1;
    }
    if(d==N){
        cout << "Yes" << endl; 
    }
    
}

Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9+5;
const ll INFLL = 1e18l+5;

int main(){
    string N;
    cin>>N;
    int ans=0;
    for(int i=0; i<N.size(); ++i){
        ans+=(N[i]-'0');
    }

    if(ans%9==0) cout<<"Yes";
    else cout<<"No";
    
}

Measured memory_bytes: 3736
//#pragma GCC optimize "trapv"
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define S 2005
#define M 998244353
#define nl cout<<"\n";
#define er  cout<<"\n***********\n";
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define test lli t;  cin>>t; while(t--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define Y cout<<"Yes\n";
#define N cout<<"No\n";
#define print(x)                 cout<<#x<<": "<<x<<endl;
#define print2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define print3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define print4(a, b, c, d)       cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define print5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl;
#define print6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl;

void solve()
{
     lli n,d,ans=0;
     cin>>n>>d;
     vector<pair<lli,lli> > pp(n,{0,0});

     for(lli i=0;i<n;i++)
     {
          cin>>pp[i].fi>>pp[i].se;
          lli x=pp[i].fi,y=pp[i].se,dd=d;

          if((x*x)+(y*y)<=d*d)
          {
               ans++;
          }
     }

     cout<<ans;



     


}
int main()
{
    fast
    #ifndef ONLINE_JUDGE
     freopen("inputa.txt", "r", stdin);
     freopen("outputa.txt", "w", stdout);
    #endif    
     
     // test
     {
          solve();
          nl
     }
}
//a+b=a?b+2?(a&b)
//__builtin_popcount(number)
//cout<<fixed<<setprecision(8)<<output<<"\n";




Measured memory_bytes: 6364
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string str;
	cin >> str;		  
	for (int i = 0; str[i] != '\0'; i++)
	{
		int d = 3;
		if (str[i] == 'A' || str[i] == 'B' || str[i] == 'C')d = -23;
		str[i] = str[i] - d;
	}
	cout << str << endl;
	return 0;
}

Measured memory_bytes: 3172
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<stack>
#include<vector>
#include<cstdio>
#include<cassert>
#include<iomanip>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define C 0.5772156649
#define pi acos(-1.0)
#define ll long long
#define mod 1000000007
#define ls l,m,rt<<1
#define rs m+1,r,rt<<1|1
#pragma comment(linker, "/STACK:1024000000,1024000000")

using namespace std;

const double g=10.0,eps=1e-7;
const int N=100+10,maxn=1000+10,inf=0x3f3f3f;

pair<int,int>p[N*N];
int ans[N][N];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int h,w,n;
    cin>>h>>w>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>p[i].first;
        p[i].second=i;
    }
    int f=1,k=1;
    for(int i=1;i<=h;i++)
    {
        if(f)
        {
            for(int j=1;j<=w;j++)
            {
                ans[i][j]=p[k].second;
                p[k].first--;
                if(p[k].first==0)k++;
            }
        }
        else
        {
            for(int j=w;j>=1;j--)
            {
                ans[i][j]=p[k].second;
                p[k].first--;
                if(p[k].first==0)k++;
            }
        }
        f^=1;
    }
    for(int i=1;i<=h;i++)
    {
        for(int j=1;j<=w;j++)
            cout<<ans[i][j]<<" ";
        cout<<endl;
    }
    return 0;
}
/********************

********************/


Measured memory_bytes: 384
def is_palindrome str
  str == str.reverse
end

def solve s, t
  
  return  0 if is_palindrome(s) 
  return -1 unless is_palindrome(t)
  
  sl = s.length
  tl = t.length
  
  o = (tl+1)/2 - 1
  # puts o
  
  i = 0
  j = 0
  k = 0
  l = 0
  m = 0
  cnt = 0
  
  r = s.reverse
  
  loop do
    
    # break if m == o
    
    while s[i] == 'x' do
      i+=1
      k+=1
    end
    
    while r[j] == 'x' do
      j+=1
      l+=1
    end
    
    cnt += ( k - l ).abs
    
    k = 0
    l = 0
    
    # puts "#{i} #{j}"
    break if m == o
    
    i += 1
    j += 1
  
    m += 1
  
  end
  
  return cnt
end

s = gets.chomp
t = s.gsub("x","")

puts solve s, t

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if(c>=b || d<=a){
		cout<<"0"<<endl;
	}else cout<<min(b,d)-max(a,c)<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define out(x) cout << x << endl;
#define INF 1ll<<60;
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; }

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

int main(){
    int n, a, b, cnt=0;
     cin >> n >> a >> b;

     for(int i=1; i<=n; i++){
         int s=0;
         int tmp = i;
         while(tmp>0){
             s+=tmp%10;
             tmp/=10;
         }
         if(a<=s && s<=b){
             cnt+=i;
         }
     }
    out(cnt);
}

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

int main() {
    int i, n, m, a, b;
    cin >> n >> m;
    vector<int> d(n);

    for (i=0; i<m; i++) {
        cin >> a >> b;
        d[a-1]++;
        d[b-1]++;
    }

    for (i=0; i<n; i++) {
        cout << d[i] << endl;
    }
}


Measured memory_bytes: 3608
#include <iostream>
using namespace std;
int main() {
	long long N, S=1;

	cin >> N;

	for (int i = 1; i <= N; i++)
	{
		S *= i;
		if (S >= 1000000007) {
			S %= 1000000007;
		}
	}

	cout << S << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int n, A[2000];
int solve(int i, int m){
  if(m == 0){
    return 1;
  }
  if(i >= n){
    return 0;
  }
  int res = solve(i + 1, m) || solve(i + 1, m - A[i]);
  return res;
}
int main(){
  int i,q,m;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&m);
    if((solve(0,m))==1){
      printf("yes\n");
    }
    else
      printf("no\n");
  }
  return 0;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i, n) ;for (int i = 0;i < (int)(n);i++)
#define rep2(i, s, n) ;for (int i = s; i < (int)(n);i++)
#define ALL(vec)  (vec).begin(),(vec).end()
#define pi 3.1415926535897932384626433832795
#define MAX_INF 9223372036854775807
#define MIN_INF (922337203685477587+1)
#define sosuu 1000000007

int main() {
  int N;
  cin >> N;
  if(N==1)
    cout << "Hello World" << endl;
  else{
    int a;
  N=0;
  cin >>a;
  N+=a;
  cin >>a;
  N+=a;
  cout << N << endl;
  }
}

Measured memory_bytes: 256
from collections import deque

P = deque()
t = 0
n, q =map(int, input().split())
for i in range(n):
    name, time = input().split()
    P.append([name, int(time)])
while(len(P)):
    if P[0][1] <= q:
        t += P[0][1]
        print(P[0][0], t)
        P.popleft()
    else:
        t += q
        P[0][1] -= q
        P.rotate(-1)
    

Measured memory_bytes: 16196
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main() {
    int N; cin >> N;
    vector<int>B(N);
    vector<int>A(N);
    int ans = 0;
    rep(i, N) {
        if (i != 0 && i != N - 1) {
            cin >> B[i];
            A[i] = min(B[i], B[i - 1]);
        }
        else if (i == 0) {
            cin >> B[i];
            A[0] = B[0];
        }
        else A[i] = B[i - 1];
        ans += A[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 3628
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

#define rep(i, n) REP(i, 0, n)
#define REP(i, a, n) for(int i = a ; i < (int)n ; i++)
#define pb push_back
#define N_MAX 1000
#define INF (1LL << 50)

using namespace std;

typedef long long ll;

struct EDGE{
  int to;
  ll cost;
  
  EDGE(int t, ll c){
    to = t;
    cost = c;
  }

};

typedef vector<vector<EDGE> > AdjList;

AdjList v;
int n, m;
ll d[N_MAX+1];

bool bellman_ford(int n){

  rep(i, N_MAX+1){
    d[i] = INF;
  }

  d[0] = 0;

  rep(i, n-1){
    rep(j, n){
      rep(k, v[j].size()){
	EDGE e = v[j][k];
	if(d[j] != INF && (d[e.to] > d[j] + e.cost)){
	  d[e.to] = d[j] + e.cost;
	}
      }
    }
  }
  
  ll ans = d[n-1];
  
  bool neg[N_MAX+1];

  rep(i, n) neg[i] = false;

  rep(i, n){
    rep(j, n){
      rep(k, v[j].size()){
	EDGE e = v[j][k];
	if(d[j] != INF && d[e.to] > d[j] + e.cost){
	  d[e.to] = d[j] + e.cost;
	  neg[e.to] = true;
	}

	if(neg[j] == true){
	  neg[e.to] = true;
	}

      }
    }
  }
  return neg[n-1];
}

signed main(){

  int from, to;
  ll cost;

  cin >> n >> m;

  v = AdjList(n);
  rep(i, m){
    cin >> from >> to >> cost;
    v[from-1].pb(EDGE(to-1, -cost));
  }
  
  
  if(bellman_ford(n) || d[n-1] == INF){
    cout << "inf" << endl;
  }else{
    cout << -d[n-1] << endl;
  }
  

}


Measured memory_bytes: 384
import sys
import bisect
 
input = sys.stdin.readline
 
def main():
    N = int(input())
    L = list(map(int, input().split()))
 
    L.sort()
    ans = 0
    for a in range(N - 2):
        for b in range(a + 1, N - 1):
            # print(a, b)
            c = bisect.bisect_left(L, L[a] + L[b]) - 1
            ans += c - b
 
    print(ans)
 
 
if __name__ == "__main__":
    main()

Measured memory_bytes: 9232
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    r = 0
    for i1 in range(1, n+1):
        for i2 in range(1, n+1):
            if i1 * i2 >= n:
                break
            else:
                r += 1
    print(r)

if __name__ == '__main__':
    main()


Measured memory_bytes: 67700
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <numeric>
#include <queue>
#include <stack>
#include <map> 
#include <set>
#include <string>
#include <functional>
#include <list>
#include <random>
#include <time.h>
#include <iomanip>
#include <assert.h>
#include <numeric>
#include <new>
#include <sstream>
#include <complex>
#define BIT(nr) (1ULL << (nr))
#define int long long
#define ll long long
#define double complex<long double>
#define mod 1000000007
#define MAXN (int)1e+5 * 2+1
#define LL_MAX 9223372036854775807	
#define LL_HALFMAX 9223372036854775807 / 2	
#define MIN -(9223372036854775807 / 2)
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define mp make_pair
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; }

using namespace std;


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

	int len = s.length();
	int ans = 0;

	rep(left, len) {
		REP(right, left + 1, len + 1) {
			bool f = true;
			REP(i, left, right) {
				if (s[i] != 'A' && s[i] != 'T' && s[i] != 'G' && s[i] != 'C') {
					f = false;
				}
			}
			if (f) {
				chmax(ans, right - left);
			}
		}
	}
	cout << ans << "\n";
}

Measured memory_bytes: 256
S = str(input())
A = "dream"
B = "dreamer"
C = "erase"
D = "eraser"
while len(S) >= 5:
  if len(S) >= 7 and S[-7:] == B:
    S = S[:-7]
  elif len(S) >=6 and S[-6:] == D:
    S = S[:-6]
  elif S[-5:] == A or S[-5:] == C:
      S = S[:-5]
  else:
    break
if len(S) == 0:
  print("YES")
else:
  print("NO")

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

int main(void){
    int N; cin >> N;
    string S;
    S=to_string(N);
    int a=0;
    for(int i=0; i<S.size(); i++){
        a+=stoi(S.substr(i,1));
    }

    if(N%a==0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

#define rep(l, r) for (int i = (l); i < (r); i++)

typedef long long ll;
 
using namespace std;

char head_char(string s) {
    return s[0];
}

char tail_char(string s) {
    return s[s.size() - 1];
}

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

    cout << (tail_char(a) == head_char(b) && tail_char(b) == head_char(c) ? "YES" : "NO") << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(int i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<int,int> Pi;
const int INF=(ll)(1LL<<31)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
//int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int n,w,d;

bool comp(Pi p1,Pi p2){
	return p1.first*p1.second<p2.first*p2.second;
}

int main(){
	vector<Pi> vv;
	while(1){
		vv.clear();
		cin>>n>>w>>d;
		if(n==0&&w==0&d==0){
			break;
		}
		vv.push_back(Pi(d,w));
		for(int i=0;i<n;i++){
			int p,s;
			cin>>p>>s;
			p--;
			while(s>2*(vv[p].first+vv[p].second)){
				s-=2*(vv[p].first+vv[p].second);
			}
			if(s>vv[p].first+vv[p].second){
				s-=(vv[p].first+vv[p].second);
			}
			Pi p1,p2;
			if(s<vv[p].second){
				p1=Pi(vv[p].first,s);
				p2=Pi(vv[p].first,vv[p].second-s);
			}else{
				p1=Pi(s-vv[p].second,vv[p].second);
				p2=Pi(vv[p].first-s+vv[p].second,vv[p].second);
			}
			if(p1.first*p1.second>p2.first*p2.second)
				swap(p1,p2);
			vv.erase(vv.begin()+p);
			vv.push_back(p1);
			vv.push_back(p2);
			//cout<<p1.first<<"/"<<p1.second<<endl;
			//cout<<p2.first<<"/"<<p2.second<<endl;
		}
		sort(vv.begin(),vv.end(),comp);
		for(int i=0;i<vv.size();i++){
			cout<<vv[i].first*vv[i].second;
			if(i!=vv.size()-1)
				cout<<" ";
		}
		cout<<endl;
	}
	return 0;
}
		


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

#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for(int (i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for(int (i) = (n); (i) < (m); ++(i))

constexpr int INF = 1e9;
//constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9+7;



int main(){
  string S;
  cin >> S;
  map<char, bool> mp;
  // mp['W'] = mp['N'] = mp['S'] = mp['E'] = false;
  mp['W'] = false;
  mp['N'] = false;
  mp['S'] = false;
  mp['E'] = false;
  REP(i, (int)S.size()){
    mp[S[i]] = true;
  }
  bool ans = true;
  // cout << 'w' << mp['W'] << " N" << mp['N'] << " S" << mp['S'] << " E" << mp['E'] << endl;
  if(mp['W'] != mp['E']) ans =false;
  if(mp['S'] != mp['N']) ans = false;
  if(ans){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll =long long;
#define SORT(i) sort((i).begin(),(i).end())
#define INF 2000000000
constexpr ll mod = 1000000007;

int main() {
	int r, g;
	cin >> r >> g;
	int ans = 2 * g - r;
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

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

#define PUTS(x) cout << (x) << endl;

LL gcd(LL m,LL n){
    if(m<n) swap(m,n);
    while(true){
        if(n==0) break;
        LL t = n;
        n = m%n;
        m = t;
    }
    return m;
}

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,x;
    cin>>n>>x;
    VI a(n);
    REP(i,n)cin>>a[i];
    a.PB(x);
    SORT(a);
    LL d = 0;
    FOR(i,1,a.size())
    {
        d = gcd(d,a[i] - a[i-1]);
    }

    PUTS(d);
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using vll = vector<ll> ;
#define all(v) v.begin(),v.end()

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

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

int minv=10000000;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	ull n,k;
	cin>>n>>k;
	ull w=n%k,m=abs(k-n%k);
	ull minv=min(w,m);
	
	cout<<minv<< endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()

ll mpow(ll a, ll b){
	if(b==0){
		return 1;
	}else if(b%2==0){
		ll memo = mpow(a,b/2);
		return memo*memo%MOD;
	}else{
		return mpow(a,b-1) * a % MOD;
	}
}

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

int main(void){
	int n;
	cin>>n;
	if(n<=2){
		cout<<"No"<<endl;
		return 0;
	}else if(n==3){
		cout<<"Yes"<<endl;
		reps(i,n*2-1){
			cout<<i<<" "<<i+1<<endl;
		}
		return 0;
	}

	int memo = n;

	while(true){
		if(memo%2==1){
			break;
		}
		memo /= 2;
		if(memo == 1){
			cout<<"No"<<endl;
			return 0;
		}
	}

	cout<<"Yes"<<endl;
	reps(i,2){
		cout<<i<<" "<<i+1<<endl;
		cout<<i+n<<" "<<i+1+n<<endl;
	}
	cout<<1<<" "<<n+3<<endl;

	ll keta = 2;
	reps(i,n){
		if(i<=3) continue;
		if(i == keta*2){
			keta*=2;
		}
		if(i == n){
			cout<<i<<" "<<keta+1<<endl;
			if(i-keta == 2){
				cout<<i-keta<<" "<<i+n<<endl;
			}else{
				cout<<i-keta+n<<" "<<i+n<<endl;
			}
			
			break;
		}



		cout<<i<<" "<<i+1<<endl;
		cout<<i+1<<" "<<1<<endl;

		cout<<1<<" "<<i+n<<endl;
		cout<<i+n<<" "<<i+1+n<<endl;
		i++;
	}


	return 0;
}


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

struct T {
	int v, x, y;
	T() {
	}
	T(int d, int x, int y) :
			v(d), x(x), y(y) {
	}
};

int h, w, ax, ay, bx, by, d[1000][1000];
bool b[1000][1000], seen[1000][1000];

auto comp = [](T &x, T &y) {
	return x.v > y.v;
};
priority_queue<T, vector<T>, decltype(comp)> q(comp);

int main() {
	cin >> h >> w >> ax >> ay >> bx >> by;
	--ax;
	--ay;
	--bx;
	--by;
	for (int i = 0; i < h; ++i) {
		string s;
		cin >> s;
		for (int j = 0; j < w; ++j)
			if (s[j] == '.')
				b[i][j] = 1;
	}

	q.emplace(0, ax, ay);
	while (!q.empty()) {
		int v, x, y;
		v = q.top().v;
		x = q.top().x;
		y = q.top().y;
		q.pop();

		if (seen[x][y])
			continue;
		seen[x][y] = 1;
		d[x][y] = v;
		if (x == bx && y == by) {
			{
				cout << v << endl;
				return 0;
			}
		}
		for (int i = -2; i < 3; ++i)
			for (int j = -2; j < 3; ++j) {
				int nx = x + i;
				int ny = y + j;
				if (nx < 0 || nx >= h || ny < 0 || ny >= w || !b[nx][ny]
						|| seen[nx][ny])
					continue;
				int nd = abs(i) + abs(j) > 1;
				q.emplace(v + nd, nx, ny);
			}
	}

	cout << -1 << endl;
}


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

ll N, X;

vector<ll> L(55, -1), ACC(55, 0);
vector<ll> r = {0, 1, 2, 3, 3};

ll dfs1(ll i){
    if(i == 1){
        L[i] = 5;
        ACC[i] = 3;
        return 5;
    }
    if(L[i] == -1){
        L[i] = 2 * dfs1(i-1) + 3;
        ACC[i] = 2 * ACC[i-1] + 1;
    }
    return L[i];
}

ll dfs2(ll i, ll t){
    if(i == 1) return r[t];
    if(t == 0) return 0;
    if(t == L[i]-1) return 2 * ACC[i-1] + 1;
    if(t == L[i]/2) return ACC[i-1] + 1;
    if(t < L[i]/2) return dfs2(i - 1, t - 1);
    if(t > L[i]/2) return ACC[i-1] + dfs2(i - 1, t - L[i-1] -  2) + 1;
}

int main(){
    cin >> N >> X;
    dfs1(N);
    cout << dfs2(N, X-1) << endl;
    return 0;
}

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

const ll mod = 1000000007;


int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int r, x, d; cin >> r >> d >> x;
	for(int i = 0; i < 10; i++){
		cout << r * x - d << endl;
		x = r * x -d;
	}

} 

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

void swap(int &A, int &B){
    int TMP;
    TMP = A;
    A = B;
    B = TMP;
}

int main(void){
    // Your code here!
    int A, B, C;
    cin >> A >> B >> C;
    
    if (A > B) swap(A,B);
    if (B > C) swap(B,C);
    if (A > B) swap(A,B);
    
    cout << A << " " << B << " " << C << endl;
    
    return 0;
}



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

typedef long long ll;

const int MOD = 1000000007;

char color[2] = {'B', 'W'};
int main() {
  ll n;
  cin >> n;
  string s;
  cin >> s;
  ll ans = 1;
  int rem = 0;
  for (int i = 0; i < 2*n; ++i) {
    char c = s[i];
    char tobe = color[rem&1];
    if (tobe == c) {
      if (rem >= 2*n-i) { cout << 0 << endl; return 0; }
      ++rem;
    }
    else {
      if (rem == 0) { cout << 0 << endl; return 0; }
      ans *= rem;
      ans %= MOD;
      --rem;
    }
  }

  for (int i = 1; i <= n; ++i) {
    ans *= i;
    ans %= MOD;
  }
  cout << ans << endl;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define all(aaa) aaa.begin(), aaa.end()

const ll INF = 1e18;
const int N = 2e5 + 5;
ll dp[N][5], a[N];
int n;

ll solve() {
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j < 5; j++) {
            dp[i][j] = INF;
        }
    }

    dp[0][0] = 0;

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 5; j++) {
            if (j + 1 < 5) {
                dp[i][j + 1] = min(dp[i][j + 1], dp[i][j]);
            }

            ll w = a[i];

            if (j == 1 || j == 3) {
                w = a[i] - 2;
                if (w > 0)
                    w &= 1;
                else
                    w = -w;
            }
            else if (j == 2) {
                w = a[i] - 1;
                if (w > 0)
                    w &= 1;
                else
                    w = -w;
            }

            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + w);
        }
    }

    ll ans = INF;
    for (int i = 0; i < 5; i++)
        ans = min(ans, dp[n][i]);
    return ans;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n;

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

    ll ans = solve();

    cout << ans << "\n";

    return 0;
}

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

#define mian main
#define maxn 2000001
#define fo(i,a,b) for(register int (i)=(a);(i)<=(b);++(i))
#define rd read()
string s;

int read() {
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9') {
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9') {
		x=x*10+c-'0';
		c=getchar();
	}
	return x*f;
}
int mian() {
  cin>>s;
  fo(i,0,s.size()-9)
  {cout<<s[i];
  }
    return 0;

}



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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define vi vector<ll>
#define sll(x) scanf("%lld",&x)
#define prll(x) printf("%lld ",x)
#define pri(x) printf("%d ",x)
#define si(x) scanf("%d",&x)
#define el printf("\n")
#define pb push_back
#define f first
#define s second
#define arrondi(a) (long long)floor(a+0.5);
#define NIL -1
ll N=500005;
ll MAX=9223372036854775807;
ll MOD=1000000007;
long double PI =4*atan(1);

int main()
{
	IOS;
    cout.precision(30);
    int x ,a; cin >> x  >> a;
    if (x<a) cout << 0; else cout << 10;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int A,B,C,D;
    while(cin>>A>>B>>C>>D)
    {
        while(1)
        {
            C-=B;
            if(C<=0)
            {
                cout<<"Yes"<<endl;
                break;
            }
            A-=D;
            if(A<=0)
            { 
                cout<<"No"<<endl;
                break;
            }
        }
    }
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<int, int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repd(i,a,b) for(int i=a;i>=b;--i)
#define mp make_pair
#define hell 1000000007
#define endl '\n'
#define vvll vector<vector<int> >
#define vll vector<int>
#define mint map<int,int> 
#define sz(x) (int)x.size()
#define sll set<int>
#define pll pair<int,int>
#define F first
#define S second


void solve(){
	
	string s,t;
	cin>>s>>t;
	int n=sz(s);
	int m=sz(t);
	string ans="";
	int dp[n+1][m+1];
	memset(dp,0, sizeof dp);
	rep(i,0,n+1){
		rep(j,0,m+1){
			if(i==0 || j==0){
				dp[i][j]=0;
				continue;
			}
			if(s[i-1]==t[j-1]){
				dp[i][j] = 1 + dp[i-1][j-1];
				continue;
			}
			dp[i][j] = max({dp[i][j], dp[i-1][j],dp[i][j-1]});
		}
	}
	int i=n-1,j=m-1;
	while(i>=0 && j>=0){
		if(s[i]==t[j]){
			ans+=s[i];
			i--,j--;
		}
		else if(dp[i][j+1] > dp[i+1][j]){
			i--;
		}
		else
			j--;
	}
	reverse(all(ans));
	cout<<ans<<endl;



}
signed main(){
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    srand (static_cast <unsigned> (time(0)));
    int t=1;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 70656
from itertools import accumulate
n = int(input())
w_lst = list(map(int,input().split()))
wa = [0] + list(accumulate(w_lst))
ans = wa[-1]

for i in range(len(wa)-1):
    sa = abs((wa[-1] - wa[i]) - wa[i])
    if sa < ans:
        ans = sa

print(ans)

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

int main() {
	int s[5];
	cin >> s[0] >> s[1] >> s[2] >> s[3] >> s[4];
	int sum = 0, cnt = 0, ma = 0;
	for (int i = 0; i < 5; i++) {
		if (s[i] % 10 == 0) {
			sum += s[i];
		}
		else {
			sum += (s[i] / 10 + 1) * 10;
			ma = max(ma, 10 - s[i] % 10);
		}
	}
	cout << sum - ma << endl;
}

Measured memory_bytes: 256
# coding: utf-8
# Your code here!

N = int(input())
R = [list(map(int, input().rstrip().split(' '))) for _ in range(N)]
B = [list(map(int, input().rstrip().split(' '))) for _ in range(N)]
G = [[] for _ in range(2 * N + 2)]

def add_edge(f, to, cap):
    G[f].append([to, cap, len(G[to])])
    G[to].append([f, 0, len(G[f]) - 1])

# S -> R and B -> T
for i in range(N):
    add_edge(0, 1 + i, 1)
    add_edge(N + 1 + i, 2 * N + 1, 1)
    
# R -> B
for i in range(N):
    for j in range(N):
        if R[i][0] < B[j][0] and R[i][1] < B[j][1]:
            add_edge(1 + i, N + 1 + j, 1)

used = [False] * (2 * N + 2)
def dfs(v, t, f):
    if v == t: return f
    used[v] = True
    for i in range(len(G[v])):
        e_to, e_cap, e_rev = G[v][i]
        if used[e_to] == False and e_cap > 0:
            d = dfs(e_to, t, min(f, e_cap))
            if d > 0:
                G[v][i][1] -= d
                G[e_to][e_rev][1] += d
                return d
    return 0
    
def max_flow(s, t):
    global used
    flow = 0
    while True:
        used = [False] * (2 * N + 2)
        f = dfs(s, t, float('inf'))
        if f == 0: return flow
        flow += f
        
print(max_flow(0, 2 * N + 1))


Measured memory_bytes: 3700
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
#define rep(i, n) for (int i = 0; i < n; i++)

using namespace std;

int main(){
	long long int r[200000],n;
	cin>>n;
	for(int i=0;i<n;i++) cin >> r[i];
	long long int maxv = -10000000000, minv = r[0];
	for(int i=1;i<n;i++) {
		maxv = max(maxv, r[i] - minv);
		minv = min(minv, r[i]);
	}
	cout << maxv << endl;
	return 0;
}


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

int main() {
  int n;
  cin >> n;
  
  if (n == 1) {
    cout << "No" << endl;
    return 0;
  }
  
  if (n == 2) {
    char t, y;
    cin >> t >> y;
    if (t == y) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }  
    return 0;
  }
  
  int r;
  if (n % 2 == 1) {
    r = (n - 1) / 2;
  } else {
    r = n / 2 - 1;
  }
  
  char a[r], b[r];
  for (int i = 0; i <= r; ++i) {
    cin >> a[i];
  }
  
  if (n % 2 == 1) {
    char k;
    cin >> k;
  }
  
  for (int q = 0; q <= r; ++q) {
    cin >> b[q];
  }
  
  for (int p = 0; p <= r; ++p) {
    if (a[p] != b[p]) {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i,j;
  int n,s;
  while(cin>>n&&n){
    s=0;
    for(i=2;i<50;i++){
      for(j=1;;j++){
	if((2*j+i-1)*i/2==n){
	  s++;
	  break;
	}else if((2*j+i-1)*i/2>n)
	  break;
      }
    }
    cout<<s<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <stdio.h>
int main()
{
          int n , i, x, count = 0 ;
          scanf("%d%d", &n, &x) ;
          int d[n] , l[n] ;
          d[0] = 0 ;
          for (i = 0 ; i < n ; i++)
          {
                    scanf("%d", &l[i]) ;
          }
           for (i = 1 ; i < n ; i++)
          {
                    d[i] = d[i-1] + l[i-1] ;

          }
          for (i = 0 ; i <= n ; i++)
          {
                    if(d[i] > x) break ;
                              count++ ;

          }
          printf("%d", count);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
int score_cal(char a, int R, int S, int P){
  switch(a){
    case 'r':
      return P; 
    case 's':
      return R;
    case 'p':
      return S;
  }
}
 
int main(){
  long long N, K, R, S, P;
  string janken;
  cin >> N >> K;
  cin >> R >> S >> P;
  cin >> janken;
  long long score = 0;
  for(int i=0; i<N; i++){
    if(i >= K && janken[i] == janken[i-K]){
      janken[i] = 'n';
      continue;
    }
    score += score_cal(janken[i], R, S, P);
  }
  cout << score;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define FOR0(i,n) for(i=0;i<n;i++)
#define FOR(i,j,n) for(i=j;i<n;i++)
#define FORD(i,j,k) for(i=j;i>=k;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 1000000000
#define ninf -1000000000
#define endl '\n' 
#define she_told_me_dont_worry ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// Use cout.flush() for interactive problems.
// Use this for increased stack size: g++ -o a.exe -Wl,--stack=256000000 -O2 source.cpp
inline long long  MAX2(long long  a, long long int 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  MIN2(long long  a, long long  b){return (a)<(b)?(a):(b);}
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;
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< ii > vii;
int main()
{
    she_told_me_dont_worry
    int n, x;
    cin>>n>>x;
    int l[n+5];
    int i;
    int ans = 1;
    FOR0(i, n)
    {
        cin>>l[i];
        if(i > 0) l[i] += l[i-1];
        if(x >= l[i]) ans++;
    }
    cout<<ans;
    cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
}

Measured memory_bytes: 256
n,m=map(int,input().split())
aa=list(map(int,input().split()))
bb=list(map(int,input().split()))
mod=10**9+7
ss=0
for i in range(n-1):
    ss+=(aa[i+1]-aa[i])*(i+1)*(n-i-1)
    ss%=mod
tt=0
for i in range(m-1):
    tt+=(bb[i+1]-bb[i])*(i+1)*(m-i-1)
    tt%=mod
print((ss*tt)%mod)


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

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()
#define range(x,min,max) ((min) <= (x) && (x) <= (max))
#define xyrange(x, minX, maxX, y, minY, maxY) (range(x, minX, maxX) && range(y, minY, maxY))

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef pair<int,int> PII;
typedef vector<PII> VPII;


const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};
const int INF = INT_MAX / 2;

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	int ans = 0;
	REP (i, 1, n + 1) {
		ans += i;
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 256
def solve():
    S = input()
    day = ["MON","TUE","WED","THU","FRI","SAT","SUN"]
    for i in range(len(day)):
        if S == "SUN":
            print(7)
            break
        elif S == day[i]:
            print(6-i)
            break
if __name__ == '__main__':
    solve()

Measured memory_bytes: 38256
#include <string>
#include <iostream>
#include<list>
#include<array>
#include<vector>
#include <algorithm>
#include <functional>
using namespace std;




int main()
{
	int N;
	vector<long long> A;

	cin >> N;
	for (int i = 0; i < N; i++) {
		int tmp;
		cin >> tmp;
		A.push_back(tmp);
	}

	long long sum = 0;
	long long min_height = 0;
	for (int i = 0; i < N; i++) {
		if (min_height < A[i]) {
			min_height = A[i];
		}
		else {
			sum += min_height - A[i];
		}
	}

	cout << sum;

	return 0;
}



Measured memory_bytes: 5336
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <cctype>
#include <fstream>

using namespace std;

#define ll long long
#define INF 2000000000
#define LINF 9000000000000000000
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define du(x) cout<<#x<<'='<<x<<endl
#define du2(x,y) cout<<#x<<'='<<x<<' '<<#y<<'='<<y<<'\n'<<endl
#define du3(x,y,z) cout<<#x<<'='<<x<<' '<<#y<<'='<<y<<' '<<#z<<'='<<z<<'\n'<<endl
#define darr(arr,n) rep(i,(n-arr)){cout<<*(arr+i)<<' ';}cout<<endl
#define ddarr(arr,a,b) rep(i,a){rep(j,b){cout<<*(arr+i*b+j)<<' ';}cout<<endl;}
#define ddd ifstream in("Text.txt");cin.rdbuf(in.rdbuf());


int main() {

    int A, B;
    cin >> A >> B;

    cout << (A*B % 2 != 0 ? "Yes" : "No")<<endl;


}


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

ans=0
for i in range(1,m+1):
    for j in range(22,d+1):
        if int(str(j)[1])>=2 and int(str(j)[0])*int(str(j)[1])==i:
            ans+=1
            # print(i,j)
print(ans)


Measured memory_bytes: 2940
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define N 3
#define N2 9
#define NMAX 500001

int head = 0,tail = 0;
int V[NMAX];
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};

struct Puzz{
  int f[N2];
  int space;
  int path;
};

struct Puzz Q[NMAX];

void enqueue(struct Puzz x){
  
  int next = (tail + 1) % NMAX;
  Q[tail] = x;
  tail = next;
}

struct Puzz dequeue(void){
  struct Puzz temp;
  temp = Q[head];
  head = (head + 1) % NMAX;
  return temp;
}
int _Sort(struct Puzz x){
  int i,j,key,cnt,n = 0;

  for(i = 0,key = 1;i < N2;key *= ++i){
    for(j = 0,cnt = 0;j < i;j++){
      if(x.f[j] < x.f[i]){
	cnt++;
      }
    }
    n += cnt * key;
  }
  return n;
}

int isTarget(struct Puzz x){
  int i;

  for(i = 0;i < N2;i++){
    if(x.f[i] != (i + 1)){
      return 0;
    }
  }
  return 1;
}

int bfs(struct Puzz s){
  int r,sx,sy,tx,ty,temp;
  struct Puzz u,v;

  s.path = 0;
  enqueue(s);
  V[_Sort(s)] = 1;

  while(head != tail){
    u = dequeue();
    if(isTarget(u) == 1){
      return u.path;
    }
    sx = u.space / N;
    sy = u.space % N;
    for(r = 0;r < 4;r++){
      tx = sx + dx[r];
      ty = sy + dy[r];
      if(tx < 0 || ty < 0|| tx >= N || ty >= N){
	continue;
      }
      v = u;
      temp = v.f[u.space];
      v.f[u.space] = v.f[tx * N + ty];
      v.f[tx * N + ty] = temp;
      v.space = tx * N + ty;
      if(V[_Sort(v)] != 1){
	V[_Sort(v)] = 1;
	v.path++;
	enqueue(v);
      }
    }
  }

  return -1;
}

int main(void){

  int i,ans;
  struct Puzz in;

  for(i = 0;i < N2;i++){
    scanf("%d",&in.f[i]);
    if(in.f[i] == 0){
      in.f[i] = N2;
      in.space = i;
    }
  }

  ans = bfs(in);
  printf("%d\n",ans);

  return 0;
}



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

P p[500000];
int calc(P*a, int n) {
	if (n == 1)return INT_MAX;
	int x = a[n / 2].first;
	int d = min(calc(a, n / 2), calc(a + n / 2, n - n / 2));
	inplace_merge(a, a + n / 2, a + n, [](const P&a, const P&b) {return a.second < b.second; });
	rep(i, n) {
		if (abs(a[i].first - x)*abs(a[i].first - x) >= d)continue;
		for (int j = i + 1; j < n; j++) {
			int dx = a[i].first - a[j].first;
			int dy = a[i].second - a[j].second;
			if (dy*dy >= d)break;
			d = min(d, dx*dx + dy*dy);
		}
	}
	return d;
}
int main() {
	int n; scanf("%d", &n);
	rep(i, n)scanf("%d%d", &p[i].first, &p[i].second);
	sort(p, p + n);
	printf("%d\n", calc(p, n));
}

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

using namespace std;

int main() {
    string s;
    cin >> s;
    for (int i = s.length() / 2; i >= 1; i--) {
        string a = s.substr(0, i);
        string b = s.substr(i, i);
        int len = a.length() + b.length();
        if (a == b && len < s.length()) {
            cout << len << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 256
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F551C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


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


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N, T = read_int_list()
    res = 9999
    for i in range(N):
        c, t = read_int_list()
        if t <= T:
            if c < res:
                res = c
    if res == 9999:
        res = 'TLE'
    print(res)


main()


Measured memory_bytes: 3696
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <string.h>

#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()
#define NMAX 100000

using namespace std;

int main(){
	char S[NMAX];
	int ans[NMAX];
	int pin=0;
	int max_a = 0;
	int N,Q;
	int l[NMAX],r[NMAX];
	int count=0;
	ans[0] = 0;
	cin >> N >> Q;
	cin >> S;
	rep(i,1,N){
		if(S[i-1] == 'A' && S[i] == 'C'){
			count++;
			ans[i] = ans[i-1] + 1;
		}else{
			ans[i] = ans[i-1];
		}
	}
	rep(i,0,Q){
		cin >> l[i] >> r[i];
	}
	rep(i,0,Q){
		cout << ans[r[i]-1] - ans[l[i]-1] << endl;
	}
}


Measured memory_bytes: 2048
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstdio>
#include<queue> 

using namespace std;
 
int main(void){
 
  priority_queue<int> que;
  char ch[10];
  int k;
 
  while(true){
    scanf(" %s",ch);
    if(ch[2]=='d')break;
    if(ch[0]=='i'){
      scanf("%d",&k);
      que.push(k);
    } else {
      printf("%d\n",que.top());
      que.pop();
    }
  }
 
  return 0;
}

Measured memory_bytes: 6196
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>


using namespace std;

using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int sqrt_n(ll a) {
	ll cur = 1;
	while(cur * cur <= a) {
		if (cur * cur == a) {
			return (int) cur;
		}
		cur++;
	}
	return -1;
}

int main() {
	ll a, b, c;

	cin >> a >> b >> c;

	ll sa = sqrt_n(a);
	ll sb = sqrt_n(b);
	ll sc = sqrt_n(c);
	if (sa != -1 && sb != -1 && sc != -1) {
		if (sa + sb < sc) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
		return 0;
	}

	int sab = sqrt_n(a * b);
	if (sab != -1) {
		if (a + b + 2 * sab < c) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
		return 0;
	}



	if (sqrt((long double) a) + sqrt((long double) b) 
		< sqrt((long double) c)) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 384
#include<stdio.h>
int main(){
  int a, b, c;
  scanf("%d %d %d",&a,&b,&c);
  if(a<=b && b<=c){
    printf("%d %d %d\n",a,b,c);
  }
  else if(a<=c && c<=b){
    printf("%d %d %d\n",a,c,b);
  }
  else if(b<=a && a<=c){
    printf("%d %d %d\n",b,a,c);
  }
  else if(b<=c && c<=a){
    printf("%d %d %d\n",b,c,a);
  }
  else if(c<=a && a<=b){
    printf("%d %d %d\n",c,a,b);
  }
  else{
    printf("%d %d %d\n",c,b,a);
  }
  return 0;
}


Measured memory_bytes: 2092
r, c = list(map(int, input().split()))
a = []
for i in range(r):
	a.append(list(map(int, input().split())))
	a[i] += [sum(a[i])]
	print(*a[i])
a = list(zip(*a))
for i in range(c):
	print(sum(a[i]), end=" ")
print(sum(a[c]))



Measured memory_bytes: 5768
import * as fs from 'fs';

// parameter "input" gets all data
function Main(input: string) {
    const r = parseInt(input);
    // const c = 2 * Math.PI * r;
    const c = 628 * r;

    //output
    console.log(c / 100);
}

// Don't edit this line!
Main(fs.readFileSync('/dev/stdin', 'utf8'));


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

template <typename T> inline void rd(T& x) {
	int si = 1; char c = getchar(); x = 0;
	while(!isdigit(c)) si = c == '-' ? -1 : si, c = getchar();
	while(isdigit(c)) x = x * 10 + c - 48, c = getchar();
	x *= si;
}
template <typename T, typename... Args>
inline void rd(T& x, Args&... args) { rd(x); rd(args...); }

#define fi first
#define se second

typedef long long ll;
typedef double ff;
typedef std::pair<int, int> pii;

std::deque <int> s;

int main() {
	ll n; rd(n); ++n;
	int ptr = 0, ans = 1;
	for(int i = 50; ~i; --i) {
		if((n >> i) && !(n >> (i + 1))) {
			//s.push_back(++ptr); ans = 2;
		} else if(n >> i) {
			//s.push_back(++ptr);//printf("??? %d %lld\n", i, n >> i);
			s.push_back(++ptr); ans *= 2;
			if((n >> i) & 1) {
				//printf("???3\n");
				s.push_front(++ptr);
				ans += 1;
			}
			//if(i) s.push_back(++ptr), ans *= 2;
		}
		//printf("Ans = %d\n", ans);
	}
	printf("%d\n", s.size() + ptr);
	for(auto x : s) printf("%d ", x);
	for(int i = 1; i <= ptr; ++i) printf("%d ", i);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  string s;
  vector<char> h;
  in(s);
  rep(i, s.size()){
    if(s[i] == '0')
      h.pb('0');
    if(s[i] == '1')
      h.pb('1');
    if(s[i] == 'B' && h.size() > 0)
      h.pop_back();
  }
  rep(i, h.size())
    out(h[i]);
  memi;
}

Measured memory_bytes: 256
x, y = map(int, input().split())
group = [0] * 13
group[ 0] = 1
group[ 2] = 2
group[ 4] = 3
group[ 6] = 3
group[ 9] = 3
group[11] = 3

print('Yes' if group[x] == group[y] else 'No')


Measured memory_bytes: 3060